Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def explore_array(method_name)
- code = "[1,2,3,4].#{method_name}"
- puts "Evaluating: #{code}"
- eval code
- end
- #
- orga_input = "find_index(2)"
- p explore_array(orga_input) # => 1
- otis_input = "map!(&:next)"
- p explore_array(otis_input) # => [2, 3, 4, 5]
- sunkai_input = "object_id; Dir.glob('*')"
- p explore_array(sunkai_input) # => Some sensitive information!!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement