Mirror of metasploit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parser.rb 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # -*- coding: binary -*-
  2. module Msf
  3. class Exploit
  4. class Remote
  5. module Java
  6. module Rmi
  7. module Client
  8. module Jmx
  9. module Server
  10. module Parser
  11. # Parses a javax/management/remote/rmi/RMIServer_Stub#newClient() return value
  12. # to find out the remote reference information.
  13. #
  14. # @param return_value [Rex::Java::Serialization::Model::ReturnValue]
  15. # @return [Hash, NilClass] The remote interface information if success, nil otherwise
  16. def parse_jmx_new_client_endpoint(return_value)
  17. values_size = return_value.value.length
  18. end_point_block_data = return_value.value[values_size - 2]
  19. unless end_point_block_data.is_a?(Rex::Java::Serialization::Model::BlockData)
  20. return nil
  21. end
  22. return_io = StringIO.new(end_point_block_data.contents, 'rb')
  23. reference = extract_reference(return_io)
  24. reference
  25. end
  26. end
  27. end
  28. end
  29. end
  30. end
  31. end
  32. end
  33. end
  34. end