1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
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
|