2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2010-12-27 17:56:29 +00:00
|
|
|
|
2012-05-17 22:13:25 +00:00
|
|
|
#
|
|
|
|
# A Post-exploitation module
|
|
|
|
#
|
2013-08-29 18:37:50 +00:00
|
|
|
class Msf::Post < Msf::Module
|
|
|
|
|
2013-09-05 18:41:25 +00:00
|
|
|
require 'msf/core/post/common'
|
|
|
|
require 'msf/core/post_mixin'
|
|
|
|
|
|
|
|
require 'msf/core/post/file'
|
2014-05-21 20:32:29 +00:00
|
|
|
require 'msf/core/post/webrtc'
|
2013-09-05 18:41:25 +00:00
|
|
|
|
|
|
|
require 'msf/core/post/linux'
|
|
|
|
require 'msf/core/post/osx'
|
|
|
|
require 'msf/core/post/solaris'
|
|
|
|
require 'msf/core/post/unix'
|
|
|
|
require 'msf/core/post/windows'
|
2015-09-11 06:56:21 +00:00
|
|
|
require 'msf/core/post/android'
|
2013-09-05 18:41:25 +00:00
|
|
|
|
|
|
|
include Msf::PostMixin
|
|
|
|
|
2014-12-04 23:07:59 +00:00
|
|
|
def setup
|
|
|
|
m = replicant
|
|
|
|
if m.actions.length > 0 && !m.action
|
|
|
|
raise Msf::MissingActionError, "Please use: #{m.actions.collect {|e| e.name} * ", "}"
|
|
|
|
end
|
|
|
|
end
|
2013-09-05 18:41:25 +00:00
|
|
|
|
|
|
|
def type
|
|
|
|
Msf::MODULE_POST
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.type
|
|
|
|
Msf::MODULE_POST
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create an anonymous module not tied to a file. Only useful for IRB.
|
|
|
|
#
|
|
|
|
def self.create(session)
|
|
|
|
mod = new
|
|
|
|
mod.instance_variable_set(:@session, session)
|
|
|
|
# Have to override inspect because for whatever reason, +type+ is coming
|
|
|
|
# from the wrong scope and i can't figure out how to fix it.
|
|
|
|
mod.instance_eval do
|
|
|
|
def inspect
|
|
|
|
"#<Msf::Post anonymous>"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
mod.class.refname = "anonymous"
|
|
|
|
|
|
|
|
mod
|
|
|
|
end
|
2014-05-29 18:20:32 +00:00
|
|
|
|
|
|
|
# This method returns the ID of the {Mdm::Session} that the post module
|
2015-04-13 08:21:41 +00:00
|
|
|
# is currently running against.
|
2014-05-29 18:20:32 +00:00
|
|
|
#
|
|
|
|
# @return [NilClass] if there is no database record for the session
|
|
|
|
# @return [Fixnum] if there is a database record to get the id for
|
|
|
|
def session_db_id
|
|
|
|
if session.db_record
|
|
|
|
session.db_record.id
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
2012-05-17 22:13:25 +00:00
|
|
|
end
|