Class: Aikido::Zen::Attacks::SQLInjectionAttack

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(query:, input:, dialect:, **opts) ⇒ SQLInjectionAttack

Returns a new instance of SQLInjectionAttack.



120
121
122
123
124
125
# File 'lib/aikido/zen/attack.rb', line 120

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

Instance Attribute Details

#dialectObject (readonly)

Returns the value of attribute dialect.



118
119
120
# File 'lib/aikido/zen/attack.rb', line 118

def dialect
  @dialect
end

#inputObject (readonly)

Returns the value of attribute input.



117
118
119
# File 'lib/aikido/zen/attack.rb', line 117

def input
  @input
end

#queryObject (readonly)

Returns the value of attribute query.



116
117
118
# File 'lib/aikido/zen/attack.rb', line 116

def query
  @query
end

Instance Method Details

#exceptionObject



139
140
141
# File 'lib/aikido/zen/attack.rb', line 139

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

#humanized_nameObject



127
128
129
# File 'lib/aikido/zen/attack.rb', line 127

def humanized_name
  "SQL injection"
end

#kindObject



131
132
133
# File 'lib/aikido/zen/attack.rb', line 131

def kind
  "sql_injection"
end

#metadataObject



135
136
137
# File 'lib/aikido/zen/attack.rb', line 135

def 
  {sql: @query}
end