CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/post/meterpreter/extension.rb
Views: 1904
1
# -*- coding: binary -*-
2
3
module Rex
4
module Post
5
module Meterpreter
6
7
#
8
# An error that is raised when a particular Meterpreter extension can not be
9
# loaded for any reason.
10
#
11
# @attr_reader [String] name The name of the extension that could not be loaded.
12
class ExtensionLoadError < RuntimeError
13
attr_reader :name
14
15
# @param [String] name The name of the extension that could not be loaded.
16
def initialize(name:)
17
@name = name
18
super
19
end
20
end
21
22
###
23
#
24
# Base class for all extensions that holds a reference to the
25
# client context that they are part of. Each extension also has a defined
26
# name through which it is referenced.
27
#
28
###
29
class Extension
30
31
#
32
# Initializes the client and name attributes.
33
#
34
def initialize(client, name)
35
self.client = client
36
self.name = name
37
end
38
39
#
40
# The name of the extension.
41
#
42
attr_accessor :name
43
protected
44
attr_accessor :client # :nodoc:
45
end
46
47
end; end; end
48
49