Class: Ronin::Exploits::Target

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/ronin/exploits/target.rb

Overview

Contains targeting information used for exploits. A target may specify which architecture, Operating System (OS), software version is targets. The target may also contain additional target parameters.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arch: nil, os: nil, os_version: nil, software: nil, version: nil, **params) {|target| ... } ⇒ Target

Creates a new ExploitTarget object

Parameters:

  • arch (Symbol, nil) (defaults to: nil)

    The architecture name of the target (ex: :x86_64).

  • os (Symbol, nil) (defaults to: nil)

    The Operating System (OS) name of the target (ex: :linux).

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

    The Operating System (OS) version of the target (ex: "10.13").

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

    The software name of the target (ex: "Apache").

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

    The software version of the target (ex: "2.4.54").

Yields:

  • (target)

    If a block is given, it will be passed the new target object.

Yield Parameters:

  • target (Target)

    The newly created target object.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/ronin/exploits/target.rb', line 83

def initialize(arch:       nil,
               os:         nil,
               os_version: nil,
               software:   nil,
               version:    nil,
               **params)
  super(**params)

  @arch = arch

  @os         = os
  @os_version = os_version

  @software = software
  @version  = version

  yield self if block_given?
end

Instance Attribute Details

#archSymbol? (readonly)

The target's architecture.

Returns:

  • (Symbol, nil)


37
38
39
# File 'lib/ronin/exploits/target.rb', line 37

def arch
  @arch
end

#osSymbol? (readonly)

The target's Operating System.

Returns:

  • (Symbol, nil)


42
43
44
# File 'lib/ronin/exploits/target.rb', line 42

def os
  @os
end

#os_versionString? (readonly)

The target's Operating System (OS) version.

Returns:

  • (String, nil)


47
48
49
# File 'lib/ronin/exploits/target.rb', line 47

def os_version
  @os_version
end

#softwareString? (readonly)

The target's software.

Returns:

  • (String, nil)


52
53
54
# File 'lib/ronin/exploits/target.rb', line 52

def software
  @software
end

#versionString? (readonly)

The target's software version.

Returns:

  • (String, nil)


57
58
59
# File 'lib/ronin/exploits/target.rb', line 57

def version
  @version
end