Module: Ronin::Payloads::Mixins::BuildDir

Included in:
Java::ReverseShell
Defined in:
lib/ronin/payloads/mixins/build_dir.rb

Overview

Sets up a temporary build directory for the payload.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#build_dirString? (readonly)

The build directory for the payload.

Returns:

  • (String, nil)


37
38
39
# File 'lib/ronin/payloads/mixins/build_dir.rb', line 37

def build_dir
  @build_dir
end

Instance Method Details

#perform_buildObject

Sets #build_dir and then builds the payload.



42
43
44
45
46
47
# File 'lib/ronin/payloads/mixins/build_dir.rb', line 42

def perform_build
  payload_name = self.class.id.tr('/','-')
  @build_dir   = Dir.mktmpdir("ronin-payloads-#{payload_name}-")

  super
end

#perform_cleanupObject

Cleans up the payload and deletes the #build_dir.



52
53
54
55
56
57
# File 'lib/ronin/payloads/mixins/build_dir.rb', line 52

def perform_cleanup
  super

  FileUtils.rm_r(@build_dir)
  @build_dir = nil
end