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.

opt.rb 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. # -*- coding: binary -*-
  2. module Msf
  3. #
  4. # Builtin framework options with shortcut methods
  5. #
  6. # @example
  7. # register_options(
  8. # [
  9. # Opt::RHOST,
  10. # Opt::RPORT(21),
  11. # ]
  12. # )
  13. # register_advanced_options([Opt::Proxies])
  14. #
  15. module Opt
  16. # @return [OptAddress]
  17. def self.CHOST(default=nil, required=false, desc="The local client address")
  18. Msf::OptAddress.new(__method__.to_s, [ required, desc, default ])
  19. end
  20. # @return [OptPort]
  21. def self.CPORT(default=nil, required=false, desc="The local client port")
  22. Msf::OptPort.new(__method__.to_s, [ required, desc, default ])
  23. end
  24. # @return [OptAddress]
  25. def self.LHOST(default=nil, required=true, desc="The listen address")
  26. Msf::OptAddress.new(__method__.to_s, [ required, desc, default ])
  27. end
  28. # @return [OptPort]
  29. def self.LPORT(default=nil, required=true, desc="The listen port")
  30. Msf::OptPort.new(__method__.to_s, [ required, desc, default ])
  31. end
  32. # @return [OptString]
  33. def self.Proxies(default=nil, required=false, desc="A proxy chain of format type:host:port[,type:host:port][...]")
  34. Msf::OptString.new(__method__.to_s, [ required, desc, default ])
  35. end
  36. # @return [OptAddress]
  37. def self.RHOST(default=nil, required=true, desc="The target address")
  38. Msf::OptAddress.new(__method__.to_s, [ required, desc, default ])
  39. end
  40. # @return [OptPort]
  41. def self.RPORT(default=nil, required=true, desc="The target port")
  42. Msf::OptPort.new(__method__.to_s, [ required, desc, default ])
  43. end
  44. # @return [OptEnum]
  45. def self.SSLVersion
  46. Msf::OptEnum.new('SSLVersion', [ false,
  47. 'Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate)', 'Auto',
  48. ['Auto', 'SSL2', 'SSL3', 'SSL23', 'TLS', 'TLS1', 'TLS1.1', 'TLS1.2']])
  49. end
  50. # These are unused but remain for historical reasons
  51. class << self
  52. alias builtin_chost CHOST
  53. alias builtin_cport CPORT
  54. alias builtin_lhost LHOST
  55. alias builtin_lport LPORT
  56. alias builtin_proxies Proxies
  57. alias builtin_rhost RHOST
  58. alias builtin_rport RPORT
  59. end
  60. CHOST = CHOST()
  61. CPORT = CPORT()
  62. LHOST = LHOST()
  63. LPORT = LPORT()
  64. Proxies = Proxies()
  65. RHOST = RHOST()
  66. RPORT = RPORT()
  67. SSLVersion = SSLVersion()
  68. end
  69. end