某酒业网会员注册上传漏洞

发布日期:2011-01.29
发布作者:xiaokis

漏洞类型:文件上传
漏洞描述:

文件:sub_upload.asp

01 <!--#include file="UPLOAD.INC"-->

02 <%if session("admin_name")="" and Session("ME_name")="" then%>

03 <style type="text/css">

04 <style type="text/css">

05 <!--

06 body,td,th {

07 font-size: 12px;

08 }

09 -->

10 </style>

11 <link href="css/01.css" rel="stylesheet" type="text/css">

12 <style type="text/css">

13 <!--

14 body {

15 background-color: #333333;

16 }

17 -->

18 </style>

19 对不起,您不是会员,不会进行此项操作!

20 <%else%>

21 <%

22 dim arr(3)

23 dim upload,file,formName,formPath,iCount,filename,fileExt,i

24 set upload=new upload_5xSoft ''建立上传对象

25

26 formPath="" '图片存放的路径:product目录下的uploadimages文件夹 ''在目录后加(/)

27

28 ''列出所有上传了的文件

29 for each formName in upload.file

30 set file=upload.file(formName)

31 if file.filesize>0 then

32 if file.filesize>10000000 then

33 response.write "<font size=2>图片大小超小了限制[<a href=#

34

35 οnclick=history.go(-1)>重新上传</a>]</font>"

36 response.end

37 end if

38 fileExt=lcase(right(file.filename,4))

39 if fileExt<>".jpg" then

40 response.write "<font size=2>文件格式限制[<a href=# οnclick=history.go(-1)>请重新上

41

42 传</a>]</font>"

43 response.end

44 end if

45 end if

46

47 filename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)

48

49 &file.FileName

50

51 if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据

52 file.SaveAs Server.mappath(formpath&filename) ''保存文件

53 'response.write file.FilePath&file.FileName&"("&file.FileSize&") =>

54

55 "&formPath&File.FileName&"上传成功"

56 response.write "上传成功 <a href=# οnclick=history.go(-1)>请返回</a>"

57

58 end if

59 set file=nothing

60 next

61 set upload=nothing

62 Response.Write "<script>parent.add.picUrl.value='"&FileName&"'</script>"

63 %>

64 <%end if%>


文件上传是自定义名字的,所以利用IIS 解析漏洞。

 

利用方法:首先注册用户,然后填写黄页,上传x.asp;.jpg
上传页面upImgFile/upload.htm
提交页面:upImgFile/sub_upload.asp
文件上传后存在目录下:upImgFile

漏洞证明:http://www.xxx.com/upImgFile/2011129204147jiami.asp;.jpg

修复方案:临时限制上传目录脚本执行或者加强文件过滤。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值