Module: Ronin::Exploits::Verifiers

Included in:
Exploit
Defined in:
lib/ronin/exploits/verifiers.rb

Instance Method Summary collapse

Instance Method Details

#verify_arch!true

Verifies that the selected target has an arch property.

Returns:

  • (true)

    Specifies that an architecture is being targeted by the currently selected target.

Raises:



52
53
54
55
56
57
58
# File 'lib/ronin/exploits/verifiers.rb', line 52

def verify_arch!
  if arch.nil?
    raise(TargetDataMissing,"no suitable arch was provided",caller)
  end

  return true
end

#verify_os!true

Verifies that the selected target has an os property.

Returns:

  • (true)

    Specifies that an OS is being targeted by the currently selected target.

Raises:



70
71
72
73
74
75
76
# File 'lib/ronin/exploits/verifiers.rb', line 70

def verify_os!
  if os.nil?
    raise(TargetDataMissing,"no suitable os was provided",caller)
  end

  return true
end

#verify_product!true

Verifies that the selected target has an product property.

Returns:

  • (true)

    Specifies that a product is being targeted by the currently selected target.

Raises:



88
89
90
91
92
93
94
# File 'lib/ronin/exploits/verifiers.rb', line 88

def verify_product!
  if product.nil?
    raise(TargetDataMissing,"no suitable product was provided",caller)
  end

  return true
end

#verify_restricted!(text) ⇒ true

Reviews text for restricted characters.

Parameters:

  • text (String)

    The text to review for restricted characters.

Returns:

  • (true)

    Specifies that the text does not contain restricted characters.

Raises:

  • (RestrictedChar)

    A restricted character was found in the specified text.



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/ronin/exploits/verifiers.rb', line 108

def verify_restricted!(text)
  found = @restricted_chars.select { |char|
    text.include?(char)
  }.map { |char| char.dump }

  unless found.empty?
    raise(RestrictedChar,"restricted characters #{found.join(', ')} was detected in #{text.dump}",caller)
  end

  return true
end

#verify_target!true

Verifies that a target has been selected.

Returns:

  • (true)

    Specifies that a target has been selected.

Raises:



34
35
36
37
38
39
40
# File 'lib/ronin/exploits/verifiers.rb', line 34

def verify_target!
  if target.nil?
    raise(TargetUnspecified,"no suitable target provided",caller)
  end

  return true
end