Module: Ronin::Exploits::Mixins::BuildDir

Defined in:
lib/ronin/exploits/mixins/build_dir.rb

Overview

Sets up a temporary build directory for the exploit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#build_dirString? (readonly)

The build directory for the exploit.

Returns:

  • (String, nil)


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

def build_dir
  @build_dir
end

Instance Method Details

#perform_buildObject

Sets #build_dir and then builds the exploit.



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

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

  super
end

#perform_cleanupObject

Cleans up the exploit and deletes the #build_dir.



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

def perform_cleanup
  super

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