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
-
#build_dir ⇒ String?
readonly
The build directory for the payload.
Instance Method Summary collapse
-
#perform_build ⇒ Object
Sets #build_dir and then builds the payload.
-
#perform_cleanup ⇒ Object
Cleans up the payload and deletes the #build_dir.
Instance Attribute Details
#build_dir ⇒ String? (readonly)
The build directory for the payload.
37 38 39 |
# File 'lib/ronin/payloads/mixins/build_dir.rb', line 37 def build_dir @build_dir end |
Instance Method Details
#perform_build ⇒ Object
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_cleanup ⇒ Object
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 |