Parent

Methods

Class/Module Index [+]

Quicksearch

Rex::Post::Meterpreter::Extensions::Stdapi::Sys::ProcessList

Simple wrapper class for storing processes

Public Instance Methods

to_table(opts={}) click to toggle source

Create a Rex::Ui::Text::Table out of the processes stored in this list

opts is passed on to Rex::Ui::Text::Table.new, mostly unmolested

Note that this output is affected by Rex::Post::Meterpreter::Client#unicode_filter_encode

# File lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb, line 380
def to_table(opts={})
        if empty?
                return Rex::Ui::Text::Table.new(opts)
        end

        cols = [ "PID", "PPID", "Name", "Arch", "Session", "User", "Path" ]
        # Arch and Session are specific to native Windows, PHP and Java can't do
        # ppid.  Cut columns from the list if they aren't there.  It is conceivable
        # that processes might have different columns, but for now assume that the
        # first one is representative.
        cols.delete_if { |c| !( first.has_key?(c.downcase) ) or first[c.downcase].nil? }

        opts = {
                "Header"  => "Process List",
                "Columns" => cols
        }.merge(opts)

        tbl = Rex::Ui::Text::Table.new(opts)
        each { |process|
                tbl << cols.map {|c| process[c.downcase] }.compact
        }

        tbl
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.