### 简要描述:
任意上传getshell
### 详细说明:
看见前人提交了一个 [WooYun: 强智教务系统通杀Getshell(提权服务器内网渗透)](http://www.wooyun.org/bugs/wooyun-2014-074367) ,我也来提交一下。。。
1,任意文件上传
漏洞文件 /jwgl/jxjh/JxjhXGBc.asp
部分源码如下:
```
<%OPTION EXPLICIT%>
<!--#include FILE="upfile_class.asp"-->
<%
server.ScriptTimeout =10000000
dim upfile,formPath,ServerPath,FSPath,formName,FileName,oFile
set upfile=new upfile_class ''建立上传对象
upfile.GetData (10240000) '取得上传数据,限制最大上传10M
%>
<html>
<head>
<title>文件上传 - 长沙市强科技发展有限责任公司·版权所有</title>
<style type="text/css">
<!--
.p9{ font-size: 9pt; font-family: 宋体 }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="20" topmargin="20" class="p9">
<p class="tx1"><font color="#0000FF" size="1"></font></p>
<hr size=1 noshadow width=300 align=left><%
if upfile.err > 0 then '如果出错
select case upfile.err
case 1
Response.Write "你没有上传数据呀???是不是搞错了??"
case 2
Response.Write "你上传的文件超出我们的限制,最大10M"
end select
else
%>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" class="p9" style="border-collapse: collapse">
<tr bgcolor="#CCCCCC">
<td height="25" valign='middle'> 本地文件 </td>
<td valign='middle'> 大小(字节) </td>
<td valign='middle'> 上传到 </td>
</tr>
<%
FSPath=GetFilePath(Server.mappath("upfile.asp"),"\")'取得当前文件在服务器路径
ServerPath=GetFilePath(Request.ServerVariables("HTTP_REFERER"),"/")'取得在网站上的位置
for each formName in upfile.file '列出所有上传了的文件
set oFile=upfile.file(formname)
FileName=upfile.form(formName)'取得文本域的值
if not FileName>"" then FileName=oFile.filename'如果没有输入新的文件名,就用原来的文件名
oFile.SaveToFile FSPath&FileName ''保存文件
%>
<tr>
<td valign="middle" align = "left" height="20"><%=oFile.FilePath&oFile.FileName%></td>
<td valign="middle" align = "center"><%=oFile.filesize%></td>
<td valign="middle" align = "center"><A HREF="<%=serverpath&FileName%>" title = "<%=serverpath&FileName%>"><%=FileName%></A></td>
</tr><%
set oFile=nothing
next
%>
<tr>
<td colspan="3" height="25" valign='middle'> 一共上传了<%=upfile.file.Count%>个文件</td>
</tr>
<%
end if
set upfile=nothing '删除此对象
%>
</table>
<p></p>
</p>[<a href="javascript:history.back();">返回</a>]
</body>
</html>
<%
function GetFilePath(FullPath,str)
If FullPath <> "" Then
GetFilePath = left(FullPath,InStrRev(FullPath, str))
Else
GetFilePath = ""
End If
End function
%>
```
可以看出该文件无任何访问验证,getshell可参考上述大牛构造的exp
### 漏洞证明:
1,任意文件上传,给出3例供CNCERT测试
[<img src="https://images.seebug.org/upload/201411/11225011aaef660cf4f5c07c9ae2e1e87ff6e340.jpg" alt="1.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/11225011aaef660cf4f5c07c9ae2e1e87ff6e340.jpg)
[<img src="https://images.seebug.org/upload/201411/11225022d0158e53b28047ef93234a1e6403898e.jpg" alt="2.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/11225022d0158e53b28047ef93234a1e6403898e.jpg)
[<img src="https://images.seebug.org/upload/201411/112250333e4ab0b1aa0e22f334f043798b173191.jpg" alt="3.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/112250333e4ab0b1aa0e22f334f043798b173191.jpg)
暂无评论