Class: Aikido::Zen::Attacks::PathTraversalAttack

Inherits:
Aikido::Zen::Attack show all
Defined in:
lib/aikido/zen/attack.rb

Instance Attribute Summary collapse

Attributes inherited from Aikido::Zen::Attack

#context, #operation, #sink

Instance Method Summary collapse

Methods inherited from Aikido::Zen::Attack

#as_json, #blocked?, #will_be_blocked!

Constructor Details

#initialize(input:, filepath:, **opts) ⇒ PathTraversalAttack

Returns a new instance of PathTraversalAttack.



65
66
67
68
69
# File 'lib/aikido/zen/attack.rb', line 65

def initialize(input:, filepath:, **opts)
  super(**opts)
  @input = input
  @filepath = filepath
end

Instance Attribute Details

#filepathObject (readonly)

Returns the value of attribute filepath.



63
64
65
# File 'lib/aikido/zen/attack.rb', line 63

def filepath
  @filepath
end

#inputObject (readonly)

Returns the value of attribute input.



62
63
64
# File 'lib/aikido/zen/attack.rb', line 62

def input
  @input
end

Instance Method Details

#exceptionObject



85
86
87
# File 'lib/aikido/zen/attack.rb', line 85

def exception(*)
  PathTraversalError.new(self)
end

#humanized_nameObject



77
78
79
# File 'lib/aikido/zen/attack.rb', line 77

def humanized_name
  "path traversal attack"
end

#kindObject



81
82
83
# File 'lib/aikido/zen/attack.rb', line 81

def kind
  "path_traversal"
end

#metadataObject



71
72
73
74
75
# File 'lib/aikido/zen/attack.rb', line 71

def 
  {
    filename: filepath
  }
end