Class: Ronin::Payloads::Java::ReverseShell
- Inherits:
-
Ronin::Payloads::JavaPayload
- Object
- Payload
- Ronin::Payloads::JavaPayload
- Ronin::Payloads::Java::ReverseShell
- Includes:
- Mixins::BuildDir, Mixins::ERB, Mixins::ReverseShell
- Defined in:
- lib/ronin/payloads/builtin/java/reverse_shell.rb
Overview
A basic Java reverse shell.
Constant Summary collapse
- TEMPLATE =
Path to the
Payload.java.erb
ERB template file. File.join(__dir__,'reverse_shell','Payload.java.erb')
Instance Attribute Summary collapse
-
#class_file ⇒ String?
readonly
The path to the generated
.class
file. -
#java_file ⇒ String?
readonly
The path to the generated
.java
file.
Attributes included from Mixins::BuildDir
Attributes included from Mixins::PostEx
Attributes inherited from Payload
Instance Method Summary collapse
-
#build ⇒ Object
Builds the Java reverse shell payload.
Methods included from Mixins::BuildDir
#perform_build, #perform_cleanup
Methods included from Mixins::ReverseShell
#host, included, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #port
Methods included from Mixins::PostEx
Methods inherited from Ronin::Payloads::JavaPayload
#compile_java, javac, payload_type
Methods inherited from Payload
#built?, #built_payload, #bytesize, #cleanup, #encode_payload, #encoded_payload, encoder_class, #initialize, #length, payload_type, #perform_build, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #perform_validate, #postlaunch, #prelaunch, #rebuild_payload, #reencode_payload, register, #to_s, #validate
Constructor Details
This class inherits a constructor from Ronin::Payloads::Payload
Instance Attribute Details
#class_file ⇒ String? (readonly)
The path to the generated .class
file.
58 59 60 |
# File 'lib/ronin/payloads/builtin/java/reverse_shell.rb', line 58 def class_file @class_file end |
#java_file ⇒ String? (readonly)
The path to the generated .java
file.
53 54 55 |
# File 'lib/ronin/payloads/builtin/java/reverse_shell.rb', line 53 def java_file @java_file end |
Instance Method Details
#build ⇒ Object
Builds the Java reverse shell payload.
63 64 65 66 67 68 69 70 71 |
# File 'lib/ronin/payloads/builtin/java/reverse_shell.rb', line 63 def build @java_file = File.join(build_dir,'Payload.java') @class_file = File.join(build_dir,'Payload.class') File.write(@java_file,erb(TEMPLATE)) compile(@java_file, dest_dir: build_dir) @payload = File.binread(@class_file) end |