/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/msf/base/sessions/tty.rb
91 строка
1 KB
Ashley Donaldson
Prevent payloads being used if can't clean up files
17 ноя 2021, 07:40
Не верифицирован
17 ноя 2021, 07:40
f54f03f
Код
Авторство
О чём код?
# -*- coding: binary -*- module Msf module Sessions ### # # This class provides basic interaction with a command shell on the remote # endpoint. This session is initialized with a stream that will be used # as the pipe for reading and writing the command shell. # ### class TTY # # This interface supports basic interaction. # include Msf::Session::Basic # # This interface supports interacting with a single command shell. # include Msf::Session::Provider::SingleCommandShell # # Returns the type of session. # def self.type "tty" end # # Returns the session description. # def desc "Interactive TTY" end def run_cmd(cmd) shell_write(cmd) return rstream.get end # # Calls the class method. # def type self.class.type end # # The shell will have been initialized by default. # def shell_init return true end # # Read from the command shell. # def shell_read(length = nil) if length.nil? rv = rstream.get else rv = rstream.read(length) end return rv end # # Writes to the command shell. # def shell_write(buf) rstream.write(buf) end # # Closes the shell. # def shell_close() rstream.close end def self.can_cleanup_files true end end end end