Module: Ronin::Exploits::Metadata::OS::ClassMethods

Defined in:
lib/ronin/exploits/metadata/os.rb

Overview

Class-methods.

Instance Method Summary collapse

Instance Method Details

#os(new_os = nil) ⇒ :unix, ...

Gets or sets the exploit's targeted Operating System (OS).

Examples:

os :linux

Parameters:

  • new_os (:unix, :bsd, :freebsd, :openbsd, :netbsd, :linux, :macos, :windows, :android, nil) (defaults to: nil)

    The optional new Operating System (OS) to set.

Returns:

  • (:unix, :bsd, :freebsd, :openbsd, :netbsd, :linux, :macos, :windows, :android, nil)

    The exploit's Operating System (OS).



61
62
63
64
65
66
67
68
69
# File 'lib/ronin/exploits/metadata/os.rb', line 61

def os(new_os=nil)
  if new_os
    @os = new_os
  else
    @os ||= if superclass.kind_of?(ClassMethods)
              superclass.os
            end
  end
end

#os_version(new_os_version = nil) ⇒ String?

Gets or sets the exploit's targeted Operating System (OS) version.

Examples:

os :linux
os_version '5.x'

Parameters:

  • new_os_version (String, nil) (defaults to: nil)

    The optional new Operating System (OS) version to set.

Returns:

  • (String, nil)

    The exploit's Operating System (OS) version.



86
87
88
89
90
91
92
93
94
# File 'lib/ronin/exploits/metadata/os.rb', line 86

def os_version(new_os_version=nil)
  if new_os_version
    @os_version = new_os_version
  else
    @os_version ||= if superclass.kind_of?(ClassMethods)
                      superclass.os_version
                    end
  end
end