Example - RB Example - RB
Example - RB Example - RB
###
#
# This exploit sample shows how an exploit module could be written to exploit
# a bug in an arbitrary TCP server.
#
###
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
#
# This exploit affects TCP servers, so we use the TCP client mixin.
# See ./documentation/samples/vulnapps/testsrv/testsrv.c for building the
# vulnerable target program.
#
include Exploit::Remote::Tcp
#
# The sample exploit just indicates that the remote host is always
# vulnerable.
#
def check
Exploit::CheckCode::Vulnerable
end
#
# The exploit method connects to the remote service and sends 1024 random bytes
# followed by the fake return address and then the payload.
#
def exploit
connect
# Send it off
sock.put(buf)
sock.get_once
handler
end
end