Reputation: 8434
Does anybody know how to block/disable ruby exec commands? There are three commands that execute shell commands in ruby: exec
, system
, and %x()
or ``
. I want to block/disable these commands.
Upvotes: 2
Views: 425
Reputation: 7225
Try this out:
module Kernel
remove_method :exec
remove_method :system
remove_method :`
end
It reopens the Kernel
module and and remove the exec
and system
methods.
Upvotes: 3