Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/lib/msf/core/exploit/remote.rb
Views: 11784
module Msf1###2#3# The remote exploit class is a specialization of the exploit module class4# that is geared toward exploits that are performed against targets other than5# the local machine. This typically implies exploiting other machines via a6# network connection, though it is not limited to this scope.7#8###9class Exploit::Remote < Exploit10include Msf::Exploit::AutoTarget1112#13# Initializes the socket array.14#15def initialize(info)16super1718self.sockets = Array.new19end2021#22# Returns the fact that this exploit is a remote exploit.23#24def exploit_type25Exploit::Type::Remote26end2728#29# Adds a socket to the list of sockets opened by this exploit.30#31def add_socket(sock)32self.sockets << sock33end3435#36# Removes a socket from the list of sockets.37#38def remove_socket(sock)39self.sockets.delete(sock)40end4142#43# This method is called once a new session has been created on behalf of44# this exploit instance and all socket connections created by this45# exploit should be closed.46#47def abort_sockets48sockets.delete_if { |sock|4950begin51sock.close52rescue ::Exception53end54true55}56end5758protected5960#61# The list of sockets established by this exploit.62#63attr_accessor :sockets6465end66end6768