Sha256: 7f240c09e1db942463395cb70e5ed1de3d3d72166426bc638e3b62415133c837

Contents?: true

Size: 657 Bytes

Versions: 224

Compression:

Stored size: 657 Bytes

Contents

class ExploitableBackDoor
  def exploited?
    @exploited_through_setter || @exploited_through_init_with || @exploited_through_ivars
  end

  def exploited_through_setter?
    @exploited_through_setter
  end

  def exploited_through_init_with?
    @exploited_through_init_with
  end

  def exploited_through_ivars?
    self.instance_variables.any?
  end

  def init_with(command)
    # Note: this is how bad this COULD be.
    # system("#{command}")
    @exploited_through_init_with = true
  end

  def []=(command, arguments)
    # Note: this is how bad this COULD be.
    # system("#{command} #{arguments}")
    @exploited_through_setter = true
  end
end

Version data entries

224 entries across 216 versions & 17 rubygems

Version Path
brakeman-3.3.4 bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
brakeman-3.3.3 bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
brakeman-3.3.2 bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
brakeman-3.3.1 bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
brakeman-3.3.0 bundle/ruby/2.3.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
puppet-3.8.7 lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
puppet-3.8.7-x86-mingw32 lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
puppet-3.8.7-x64-mingw32 lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
puppet-3.8.6 lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
puppet-3.8.6-x86-mingw32 lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
puppet-3.8.6-x64-mingw32 lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/safe_yaml-1.0.4/spec/support/exploitable_back_door.rb