Class: Msf::Sessions::Custom
- Inherits:
-
Object
- Object
- Msf::Sessions::Custom
- Includes:
- Msf::Session, Msf::Session::Basic
- Defined in:
- lib/msf/base/sessions/custom.rb
Overview
This class provides the ability to receive a custom stage callback
Instance Attribute Summary collapse
-
#arch ⇒ Object
Returns the value of attribute arch.
-
#platform ⇒ Object
Returns the value of attribute platform.
Attributes included from Msf::Session::Interactive
Attributes included from Rex::Ui::Interactive
#completed, #interacting, #next_session, #on_command_proc, #on_print_proc, #on_run_command_error_proc, #orig_suspend, #orig_usr1, #orig_winch
Attributes included from Rex::Ui::Subscriber::Input
Attributes included from Rex::Ui::Subscriber::Output
Attributes included from Msf::Session
#alive, #db_record, #exploit, #exploit_datastore, #exploit_task, #exploit_uuid, #framework, #info, #machine_id, #payload_uuid, #routes, #sid, #sname, #target_host, #target_port, #username, #uuid, #via, #workspace
Attributes included from Framework::Offspring
Class Method Summary collapse
- .can_cleanup_files ⇒ Object
- .create_session(rstream, opts = {}) ⇒ Object
-
.type ⇒ Object
Returns the type of session.
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#desc ⇒ Object
Returns the session description.
-
#initialize(rstream, opts = {}) ⇒ Custom
constructor
A new instance of Custom.
- #process_autoruns(datastore) ⇒ Object
-
#type ⇒ Object
Calls the class method.
Methods included from Msf::Session::Basic
Methods included from Msf::Session::Interactive
#_interact, #_interact_complete, #_interrupt, #_suspend, #_usr1, #abort_foreground, #abort_foreground_supported, #comm_channel, #interactive?, #kill, #run_cmd, #tunnel_local, #tunnel_peer, #user_want_abort?
Methods included from Rex::Ui::Interactive
#_interact, #_interact_complete, #_interrupt, #_local_fd, #_remote_fd, #_stream_read_local_write_remote, #_stream_read_remote_write_local, #_suspend, #_winch, #detach, #handle_suspend, #handle_usr1, #handle_winch, #interact, #interact_stream, #prompt, #prompt_yesno, #restore_suspend, #restore_usr1, #restore_winch
Methods included from Rex::Ui::Subscriber
Methods included from Rex::Ui::Subscriber::Input
Methods included from Rex::Ui::Subscriber::Output
#flush, #print, #print_blank_line, #print_error, #print_good, #print_line, #print_status, #print_warning
Methods included from Msf::Session
#alive?, #comm_channel, #dead?, #inspect, #interactive?, #kill, #log_file_name, #log_source, #name, #name=, #register?, #session_host, #session_host=, #session_port, #session_port=, #session_type, #set_from_exploit, #set_via, #tunnel_local, #tunnel_peer, #tunnel_to_s, #via_exploit, #via_payload
Constructor Details
#initialize(rstream, opts = {}) ⇒ Custom
Returns a new instance of Custom.
29 30 31 32 33 34 |
# File 'lib/msf/base/sessions/custom.rb', line 29 def initialize(rstream, opts = {}) super self.platform ||= "" self.arch ||= "" datastore = opts[:datastore] end |
Instance Attribute Details
#arch ⇒ Object
Returns the value of attribute arch.
19 20 21 |
# File 'lib/msf/base/sessions/custom.rb', line 19 def arch @arch end |
#platform ⇒ Object
Returns the value of attribute platform.
20 21 22 |
# File 'lib/msf/base/sessions/custom.rb', line 20 def platform @platform end |
Class Method Details
.can_cleanup_files ⇒ Object
60 61 62 |
# File 'lib/msf/base/sessions/custom.rb', line 60 def self.can_cleanup_files false end |
.create_session(rstream, opts = {}) ⇒ Object
36 37 38 |
# File 'lib/msf/base/sessions/custom.rb', line 36 def self.create_session(rstream, opts = {}) Msf::Sessions::Custom.new(rstream, opts) end |
.type ⇒ Object
Returns the type of session.
25 26 27 |
# File 'lib/msf/base/sessions/custom.rb', line 25 def self.type "custom" end |
Instance Method Details
#cleanup ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/msf/base/sessions/custom.rb', line 44 def cleanup print_good("Custom stage sent; session has been closed") if rstream # this is also a best-effort rstream.close rescue nil rstream = nil end end |
#desc ⇒ Object
Returns the session description.
56 57 58 |
# File 'lib/msf/base/sessions/custom.rb', line 56 def desc "Custom" end |
#process_autoruns(datastore) ⇒ Object
40 41 42 |
# File 'lib/msf/base/sessions/custom.rb', line 40 def process_autoruns(datastore) cleanup end |
#type ⇒ Object
Calls the class method
67 68 69 |
# File 'lib/msf/base/sessions/custom.rb', line 67 def type self.class.type end |