Advertisement
Guest User

Untitled

a guest
Jul 1st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def explore_array(method_name)
  2. code = "[1,2,3,4].#{method_name}"
  3. puts "Evaluating: #{code}"
  4. eval code
  5. end
  6.  
  7. #
  8.  
  9. orga_input = "find_index(2)"
  10. p explore_array(orga_input) # => 1
  11.  
  12. otis_input = "map!(&:next)"
  13. p explore_array(otis_input) # => [2, 3, 4, 5]
  14.  
  15. sunkai_input = "object_id; Dir.glob('*')"
  16. p explore_array(sunkai_input) # => Some sensitive information!!!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement