某通用型学校网站系统SQL注入影响大量学校网站
首先是从沈阳航空职业技术学院搜到的信息:
http://www.syhzy.cn/

于是按照关键字搜了一下:
技术支持:校无忧科技
看了用户量不小啊

下载了源码看了下:Xiao5u_School_v2.1.zip
看到这个文件/admin/check.asp:
if request("action")="login" then
Username=trim(request("admin_name"))
Password=trim(request("admin_pass"))
end if
If Instr(Username,"or")<>0 or Instr(Password,"or")<>0 or Instr(Username,"and")<>0 or Instr(Password,"and")<>0Then
response.write "<br><br><br><br><font size=2><center>没事别搞人家后台,谢谢!<br>否则一切后果自负!<br>校无忧-Www.Xiao5u.Com</font>"
else
set rs=server.createobject("adodb.recordset")
sql="select * from admin where Username='"&Username&"' and Password='"&md5(Password)&"'"
rs.open sql,conn,1,3
从代码中看出,虽然他做了一点点的处理,但是基本上跟没处理一样,只是判断用户名和密码中是否有or和and关键字,那我们不是用大写或者大小写混合不就绕过了。
本地环境测试了下,成功绕过后台登陆,后台登陆地址/admin/login.asp

登陆后台后,在网站信息处,可以拿shell,文件/admin/siteconfig.asp:
sub SaveConfig()
If ObjInstalled=false Then
FoundErr=true
ErrMsg=ErrMsg & "<br><li>你的服务器不支持 FSO(Scripting.FileSystemObject)! </li>"
exit sub
end if
dim fso,hf
set fso=Server.CreateObject("Scripting.FileSystemObject")
set hf=fso.CreateTextFile(Server.mappath("../inc/config.asp"),true)
hf.write "<" & "%" & vbcrlf
hf.write "Const SiteName=" & chr(34) & trim(request("SiteName")) & chr(34) & " '网站名称" & vbcrlf
hf.write "Const keywords=" & chr(34) & trim(request("keywords")) & chr(34) & " '关键字" & vbcrlf
hf.write "Const description=" & chr(34) & trim(request("description")) & chr(34) & " '描述" & vbcrlf
hf.write "Const Copyright=" & chr(34) & InPutStr(trim(request("Copyright"))) & chr(34) & " '版权信息" & vbcrlf
hf.write "%" & ">"
hf.close
set hf=nothing
set fso=nothing
end sub
这里没有任何过滤,直接将接收到的配置信息写入了配置文件/inc/config.asp中。

来看看配置文件/inc/config.asp内容;

成功写入一句话密码,入侵检测拿到webshell

来两个案例证明吧:


有拿上述网站shell,没有破坏数据。
影响挺大,拿shell,拿站都可以批量的,请cncert国家互联网应急中心及时处理吧。
修复方案:
加强过滤。
版权与免责声明:
凡注明稿件来源的内容均为转载稿或由网友用户注册发布,本网转载出于传递更多信息的目的;如转载稿涉及版权问题,请作者联系我们,同时对于用户评论等信息,本网并不意味着赞同其观点或证实其内容的真实性;

![英雄棋士团(预下载)?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/shouyoupic/yingxiongqishituanyuxiazai.jpg)
![美食小当家?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/shouyoupic/meishixiaodangjia.png)
![2047?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/shouyoupic/2047.jpg)
![荣誉指挥官(预下载)?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/shouyoupic/rongyuzhihuiguanyuxiazai.png)
![繁荣美食市场物语?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/shouyoupic/fanrongmeishishichangwuyu.jpg)
![夸克浏览器 v4.2.1.138 好用的手机浏览器?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/appimg/202007/kuakezuolanqi.jpg)
![移动办公软件 OfficeSuite Premium v10.18.28716 内购解锁版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/appimg/202007/yidongbangongruanjian.jpg)
![乐秀视频编辑器 VideoShow v8.8.4 内购解锁版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/appimg/202007/lexiushipinbianjiqi.png)
![X 浏览器 v3.3.9 一款小巧的安卓浏览器?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/appimg/202007/x.jpg)
![安卓密码管理软件 Enpass v6.4.5.368 内购解锁版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/appimg/202007/anzhuomimaguanliruanjian.jpg)
![差分复制同步 FastCopy-M v3.6.3.51 绿色便携版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/softimg/FastCopy3.png)
![多标签页拓展 Clover v3.5.2 Build 19809 精简绿色版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/softimg/Clover.png)
![文件重命名 Advanced Renamer v3.85 Lite 绿色便携版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/softimg/Advanced_Renamer.png)
![网络防火监控 GlassWire Elite v2.1.166 绿色便携版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/softimg/GlassWire.png)
![影音播放器 Daum Potplayer v1.7.20538 美化便携版?=$bqr['banben']?>](http://shouyouimg.cnzzla.com/d/file/softimg/PotPlayer.png)