Common exploit mixins
Mixins are a comprehensive mechanism in Ruby language to include functionality into a module. Mixins provide a way to have multiple-inheritance in a single-inheritance language like Ruby. Using mixins in exploit modules can help in calling different functions that the exploit will require. In this recipe, we will learn about some important Metasploit exploit mixins.
How to do it...
Let us take a quick look at some of the common exploit mixins. Then, we will see its implementation in an existing exploit module.
Exploit::Remote::TCP
: This mixin provides TCP functionality to the module. It can be used to set up a TCP connection.connect()
anddisconnect()
functions are responsible for setting up and terminating connections respectively. It requires different parameters, such asRHOST
,RPORT
,SSL
.Exploit::Remote::UDP
: This mixin is used for UDP functionality in the module. UDP is generally treated as a faster mode of connectivity over TCP so it can also be a handy option...