lib/micro_blitz/attacks/corrupter.rb
# Corrupter is exactly what the name implies, it corrupts things.
#
# This is a relatively easy error to trace down in production. This will
# surely throw errors in the prod logs. All that is required is a login
# to the prod server and open the trouble file. Visually, the engineer
# won't notice anything unless they open the file.
Corrupter is exactly what the name implies, it corrupts things.
This is a relatively easy error to trace down in production. This will
surely throw errors in the prod logs. All that is required is a login
to the prod server and open the trouble file. Visually, the engineer
won't notice anything unless they open the file.
Corrupter is exactly what the name implies it corrupts things . This is a relatively easy error to trace down in production . This will surely throw errors in the prod logs . All that is required is a login to the prod server and open the trouble file . Visually the engineer won ' t notice anything unless they open the file .
def corrupt
      copy = contents_in_bytes
      length_to_corrupt = (copy.size.to_f / 2).ceil
      length_to_corrupt.times do |x|
        copy[x] = [RANDOM_BYTES.sample, ""].sample
      end
      File.write(@file, copy.pack('H2' * copy.size))
    end
def corrupt copy = contents_in_bytes length_to_corrupt = ( copy . size . to_f / 2 ) . ceil length_to_corrupt . times do | x | copy [ x ] = [ RANDOM_BYTES . sample , "" ] . sample end File . write ( @file , copy . pack ( 'H2' * copy . size ) ) end
Corrupter is exactly what the name implies, it corrupts things.
Corrupter is exactly what the name implies it corrupts things .