Become a Partner
Add OffSec to your list of training providers
Partner with usOffSec Wins Seven Global InfoSec Awards during RSA Conference 2024
Read blogRuby : Mixins and Plugins | Metasploit Unleashed
Mixins are quite simply, the reason why Ruby rocks.
Mixins can add new features and allows modules to have different ‘flavors’.
Mixins can change behavior.
Plugins work directly with the API.
Plugins only work in the msfconsole.
class MyParent
def woof
puts “woof!”
end
end
class MyClass > MyParent
end
object = MyClass.new
object.woof() => “woof!”
================================================================
module MyMixin
def woof
puts “hijacked the woof method!”
end
end
class MyBetterClass > MyClass
include MyMixin
end