Class: Msf::Plugin::PcapLog

Inherits:
Msf::Plugin show all
Defined in:
plugins/pcap_log.rb

Defined Under Namespace

Classes: PcapLogDispatcher

Constant Summary collapse

PCAP_FILE_HEADER =

Only little-endian is supported in this implementation.

"\xD4\xC3\xB2\xA1\x02\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00\x01\x00\x00\x00"

Instance Attribute Summary

Attributes inherited from Msf::Plugin

#opts

Attributes included from Framework::Offspring

#framework

Instance Method Summary collapse

Methods inherited from Msf::Plugin

#add_console_dispatcher, create, #flush, #input, #output, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #remove_console_dispatcher

Constructor Details

#initialize(framework, opts) ⇒ PcapLog

Returns a new instance of PcapLog.


180
181
182
183
184
# File 'plugins/pcap_log.rb', line 180

def initialize(framework, opts)
  super
  add_console_dispatcher(PcapLogDispatcher)
  print_status "PcapLog plugin loaded."
end

Instance Method Details

#cleanupObject

Kill the background thread


187
188
189
190
191
# File 'plugins/pcap_log.rb', line 187

def cleanup
  @capture_thread.kill if @capture_thread && @capture_thread.alive?
  @capture_file.close if @capture_file.respond_to? :close
  remove_console_dispatcher('PcapLog')
end

#descObject


197
198
199
# File 'plugins/pcap_log.rb', line 197

def desc
  "Logs all socket operations to pcaps (in /tmp by default)"
end

#nameObject


193
194
195
# File 'plugins/pcap_log.rb', line 193

def name
  "pcap_log"
end