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.



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

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

Instance Attribute Details

#filepathObject (readonly)

Returns the value of attribute filepath.



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

def filepath
  @filepath
end

#inputObject (readonly)

Returns the value of attribute input.



60
61
62
# File 'lib/aikido/zen/attack.rb', line 60

def input
  @input
end

Instance Method Details

#exceptionObject



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

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

#humanized_nameObject



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

def humanized_name
  "path traversal attack"
end

#kindObject



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

def kind
  "path_traversal"
end

#metadataObject



69
70
71
# File 'lib/aikido/zen/attack.rb', line 69

def 
  {filename: filepath}
end