mirror of
https://codeberg.org/mayx/pages
synced 2026-01-01 13:13:41 +08:00
328 lines
18 KiB
HTML
328 lines
18 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<!-- Begin Jekyll SEO tag v2.8.0 -->
|
||
<title>关于网络攻防的一些看法 | Mayx的博客</title>
|
||
<meta name="generator" content="Jekyll v3.9.5" />
|
||
<meta property="og:title" content="关于网络攻防的一些看法" />
|
||
<meta name="author" content="mayx" />
|
||
<meta property="og:locale" content="zh_CN" />
|
||
<meta name="description" content="今天我想谈一谈关于网络攻防的一些看法。" />
|
||
<meta property="og:description" content="今天我想谈一谈关于网络攻防的一些看法。" />
|
||
<meta property="og:site_name" content="Mayx的博客" />
|
||
<meta property="og:type" content="article" />
|
||
<meta property="article:published_time" content="2019-02-17T00:00:00+08:00" />
|
||
<meta name="twitter:card" content="summary" />
|
||
<meta property="twitter:title" content="关于网络攻防的一些看法" />
|
||
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
|
||
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
|
||
<meta name="yandex-verification" content="fc0e535abed800be" />
|
||
<script type="application/ld+json">
|
||
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2019-02-17T00:00:00+08:00","datePublished":"2019-02-17T00:00:00+08:00","description":"今天我想谈一谈关于网络攻防的一些看法。","headline":"关于网络攻防的一些看法","mainEntityOfPage":{"@type":"WebPage","@id":"/2019/02/17/break.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2019/02/17/break.html"}</script>
|
||
<!-- End Jekyll SEO tag -->
|
||
|
||
<link rel="canonical" href="https://mabbs.github.io/2019/02/17/break.html" />
|
||
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
|
||
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
|
||
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
|
||
<link rel="stylesheet" href="/assets/css/style.css?v=1767196818" />
|
||
<!--[if !IE]> -->
|
||
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
|
||
<!-- <![endif]-->
|
||
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
|
||
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
|
||
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
|
||
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
|
||
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
|
||
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
|
||
<link rel="me" href="https://github.com/Mabbs" />
|
||
<script src="/assets/js/jquery.min.js"></script>
|
||
<!--[if lt IE 9]>
|
||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
|
||
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
|
||
<![endif]-->
|
||
<script>
|
||
var lastUpdated = new Date("Thu, 01 Jan 2026 00:00:18 +0800");
|
||
var BlogAPI = "https://summary.mayx.eu.org";
|
||
</script>
|
||
<script src="/assets/js/main.js"></script>
|
||
<!--[if !IE]> -->
|
||
|
||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
|
||
<script>
|
||
window.dataLayer = window.dataLayer || [];
|
||
function gtag(){dataLayer.push(arguments);}
|
||
gtag('js', new Date());
|
||
gtag('config', 'UA-137710294-1');
|
||
</script>
|
||
|
||
<script src="/assets/js/instant.page.js" type="module"></script>
|
||
<!-- <![endif]-->
|
||
</head>
|
||
|
||
<body>
|
||
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript,这不影响你的浏览,但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
|
||
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer,这不影响你的浏览,但可能会有一些功能无法使用……</small></marquee><![endif]-->
|
||
<div class="wrapper">
|
||
<header class="h-card">
|
||
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
|
||
|
||
|
||
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
|
||
|
||
|
||
<p class="p-note">Mayx's Home Page</p>
|
||
|
||
<form action="/search.html">
|
||
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." /> <input type="submit" value="搜索" />
|
||
</form>
|
||
<br />
|
||
|
||
|
||
|
||
|
||
|
||
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
|
||
|
||
<ul class="downloads">
|
||
|
||
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
|
||
|
||
</ul>
|
||
</header>
|
||
<section class="h-entry">
|
||
|
||
<small><time class="date dt-published" datetime="2019-02-17T00:00:00+08:00">17 February 2019</time> - 字数统计:1424 - 阅读大约需要5分钟 - Hits: <span id="/2019/02/17/break.html" class="visitors">Loading...</span></small>
|
||
<h1 class="p-name">关于网络攻防的一些看法</h1>
|
||
|
||
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
|
||
<div id="outdate" style="display:none;">
|
||
<hr /><p>
|
||
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
|
||
</p>
|
||
</div>
|
||
<script>
|
||
daysold = Math.floor((new Date().getTime() - new Date("Sun, 17 Feb 2019 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
|
||
if (daysold > 90) {
|
||
document.getElementById("outdate").style.display = "block";
|
||
document.getElementById("outime").innerHTML = daysold;
|
||
}
|
||
</script>
|
||
|
||
<hr />
|
||
|
||
<b>AI摘要</b>
|
||
<p id="ai-output">这篇文章主要讨论了网络攻防的几个方面,包括网站安全的重要性和常见的攻击类型,如修改网站内容、阻止访问、窃取信息的注入攻击、XSS和CSRF攻击,以及针对动态网站和静态网站的防御措施。作者提到使用CloudFlare可以有效防御DDoS攻击,并强调了自己编写或使用建站程序时的防御要点,如防注入、XSS/CSSRF和CC攻击,以及采用HTTPS的重要性。此外,作者还提醒用户保护云主机和虚拟空间的密码安全,以及应对如GFWban等特殊攻击的策略。最后,作者认为只要做好基本防护,网站安全就有可能得到保障。</p>
|
||
|
||
<hr />
|
||
|
||
|
||
|
||
<ul><li><a href="#关于攻击方法">关于攻击方法</a></li><li><a href="#如何防御">如何防御?</a></li><li><a href="#结尾">结尾</a></li></ul>
|
||
<hr />
|
||
|
||
|
||
<main class="post-content e-content" role="main"><p>今天我想谈一谈关于网络攻防的一些看法。<!--more--></p>
|
||
|
||
<p>作为一个站长【就几个站也敢叫站长?(几个站也是站啊!)】,应该明白一个网站在网络中并不是安全的,随时都有可能某个欧洲人找到你网站的漏洞来攻击作为非洲人的你,所以我对网站的安全也是很看重的。</p>
|
||
<h1 id="关于攻击方法">
|
||
|
||
|
||
<a href="#关于攻击方法"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 关于攻击方法
|
||
|
||
|
||
</h1>
|
||
|
||
<p>首先如果想防御网络攻击,必须先知道如何攻击。攻击的方法很多,大致分为三种:</p>
|
||
<ol>
|
||
<li>修改网站内容的攻击</li>
|
||
<li>阻止用户访问的攻击</li>
|
||
<li>窃取网站内容的攻击</li>
|
||
</ol>
|
||
|
||
<p>在此之中,修改和窃取基本上都需要攻入服务器,比较困难,一般能获取信息和修改信息的网站大多数都是有权限限制的,即只允许你获取有限的信息,修改基本上也都是有区域和格式限制的。
|
||
像这类攻击大多都是注入攻击,即利用网站程序本身的漏洞攻击。如果想试试这类的攻击,可以来<a href="http://www.shiyanbar.com/ctf/practice">实验吧</a>试试身手。 </p><p>
|
||
除了注入攻击,还有一种就是XSS和CSRF攻击,这种攻击还是蛮有意思的,可以自己构建语句修改网站内容。
|
||
当然上述攻击只限于动态网站的攻击,因为只有动态网站才有注入的可能性。不过除此之外,还有一种攻击是针对网络的攻击,即阻止用户访问正确内容的攻击,这类攻击一般就是DDOS和中间人攻击,当然,中间人攻击还能窃取网站内容。 </p><p>
|
||
不过像我这种菜鸡,还不会中间人攻击,因为这种攻击还要抓包,又要用什么WireShark之类的软件……而DDOS我又没有肉鸡,虽然知道智能家居很好黑,但是作为非洲人的我从来没碰到一个我能黑的智能家居产品……(是你没努力吧!)</p>
|
||
<h1 id="如何防御">
|
||
|
||
|
||
<a href="#如何防御"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 如何防御?
|
||
|
||
|
||
</h1>
|
||
|
||
<p>虽然我不是打广告,但是CloudFlare真的还是蛮好用的,至少用了这个,只要配置好,几乎所有的DDOS都不用怕了,而且还是免费的。除了在国内访问不是很理想外,其他都还不错(都是ZF的错!) </p><p>
|
||
不过即使用了CloudFlare,也只是静态网站不用担心了,动态网站还是得看网站程序本身了。 </p><p>
|
||
像用建站程序的人就只能看制作这个程序的人水平怎么样了,其实绝大多数的建站程序还是很不错的,也不用太担心。 </p><p>
|
||
问题就是自己写的动态网站了,自己写动态网站第一就是防注入,只要被注入,数据库就难保了,甚至整个服务器都会有风险。 </p><p>
|
||
第二就是防XSS&CSRF,XSS虽然有时候很鸡肋,但是有时有可能会发生网站数据泄露的问题。 </p><p>
|
||
第三就是防CC,这里的CC不止要防DDOS中的CC,还要防一些可能会存入数据库的CC,比如自己建了一个论坛,被屠版了怎么办?被大量注册小号怎么办?所以要注意限制用户发送请求的数量。 </p><p>
|
||
当然读取的CC也要防,比如如果登录页面上对尝试登录的次数没有限制的话,那么攻击者就可以不停地尝试,直到发现一个正确的密码。而如果用户用了弱密码,那么或许这个密码很快就可以被尝试出来。 </p><p>
|
||
对了,还有一定要使用HTTPS,这样可以避免很多问题。 </p><p>
|
||
针对不同的语言,防御的方法也不同,具体内容自己去搜索引擎上搜索吧。 </p><p>
|
||
当然有些攻击实在防不住,那也没办法,像网站被GFWban,那种事除了恐怖分子就再没人能解了吧……当然如果不在乎域名的话,像某些小黄网那样整天换域名也行。
|
||
还有就是使用云主机、虚拟空间等人一定要看好自己的密码,以及有可能可以找回密码的方法的密码(比如邮箱),不然被知道了密码,那基本上就无药可救了。 </p><p>
|
||
方法就是邮箱的密码一定不要和其他的密码相同,重要网站的密码和次要网站的密码一定不能相同,还有就是不要在可疑的网站上输入自己的密码,如果有必要,一定先用错误的密码试一遍。</p>
|
||
<h1 id="结尾">
|
||
|
||
|
||
<a href="#结尾"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 结尾
|
||
|
||
|
||
</h1>
|
||
|
||
<p>总而言之,互联网上虽然有闲人,但是既闲又有心还欧的人不多,所以只要祈祷自己的网站不要被炸,它就不会被炸了233333</p></main>
|
||
|
||
|
||
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E7%BD%91%E7%BB%9C"><em>网络</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%94%BB%E5%87%BB"><em>攻击</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E9%98%B2%E5%BE%A1"><em>防御</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2019-02-17-break.md">查看原始文件</a></span></small>
|
||
|
||
|
||
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
|
||
<p id="suggest-container">Loading...</p>
|
||
<script>
|
||
var suggest = $("#suggest-container");
|
||
$.get(BlogAPI + "/suggest?id=/2019/02/17/break.html&update=" + lastUpdated.valueOf(), function (data) {
|
||
if (data.length) {
|
||
getSearchJSON(function (search) {
|
||
suggest.empty();
|
||
var searchMap = {};
|
||
for (var i = 0; i < search.length; i++) {
|
||
searchMap[search[i].url] = search[i];
|
||
}
|
||
|
||
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
|
||
for (var j = 0; j < data.length; j++) {
|
||
var item = searchMap[data[j].id];
|
||
if (item) {
|
||
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
|
||
var contentPreview = item.content.substring(0, 100);
|
||
if (item.content.length > 100) {
|
||
contentPreview += "……";
|
||
}
|
||
link.hover(
|
||
function(e) {
|
||
tooltip.text($(this).data('content'))
|
||
.css({
|
||
top: e.pageY + 10,
|
||
left: e.pageX + 10
|
||
})
|
||
.show();
|
||
},
|
||
function() {
|
||
tooltip.hide();
|
||
}
|
||
).mousemove(function(e) {
|
||
tooltip.css({
|
||
top: e.pageY + 10,
|
||
left: e.pageX + 10
|
||
});
|
||
}).data('content', contentPreview);
|
||
|
||
suggest.append(link);
|
||
suggest.append(' - ' + item.date + '<br />');
|
||
}
|
||
}
|
||
});
|
||
} else {
|
||
suggest.html("暂无推荐文章……");
|
||
}
|
||
});
|
||
</script>
|
||
|
||
<br />
|
||
<div class="pagination">
|
||
|
||
<span class="prev">
|
||
<a href="/2019/02/07/paradise.html">
|
||
上一篇:玩《Finding Paradise》有感
|
||
</a>
|
||
</span>
|
||
|
||
<br />
|
||
|
||
<span class="next">
|
||
<a href="/2019/03/22/bgm.html">
|
||
下一篇:分享一下我最喜欢的游戏BGM
|
||
</a>
|
||
</span>
|
||
|
||
</div>
|
||
|
||
<!--[if !IE]> -->
|
||
<link rel="stylesheet" href="/assets/css/gitalk.css">
|
||
<script src="/assets/js/gitalk.min.js"></script>
|
||
|
||
<div id="gitalk-container"></div>
|
||
|
||
<script>
|
||
var gitalk = new Gitalk({
|
||
clientID: '36557aec4c3cb04f7ac6',
|
||
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
|
||
repo: 'mabbs.github.io',
|
||
owner: 'Mabbs',
|
||
admin: ['Mabbs'],
|
||
id: '/2019/02/17/break', // Ensure uniqueness and length less than 50
|
||
distractionFreeMode: false, // Facebook-like distraction free mode
|
||
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
|
||
})
|
||
gitalk.render('gitalk-container')
|
||
</script>
|
||
<!-- <![endif]-->
|
||
|
||
</section>
|
||
<!--[if !IE]> -->
|
||
<div id="landlord" style="left:5px;bottom:0px;">
|
||
<div class="message" style="opacity:0"></div>
|
||
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
|
||
<div class="live_talk_input_body">
|
||
<form id="live_talk_input_form">
|
||
<div class="live_talk_input_name_body" >
|
||
<input type="checkbox" id="load_this" />
|
||
<input type="hidden" id="post_id" value="/2019/02/17/break.html" />
|
||
<label for="load_this">
|
||
<span style="font-size: 11px; color: #fff;"> 想问这篇文章</span>
|
||
</label>
|
||
</div>
|
||
<div class="live_talk_input_text_body">
|
||
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
|
||
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<input name="live_talk" id="live_talk" value="1" type="hidden" />
|
||
<div class="live_ico_box" style="display:none;">
|
||
<div class="live_ico_item type_info" id="showInfoBtn"></div>
|
||
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
|
||
<div class="live_ico_item type_music" id="musicButton"></div>
|
||
<div class="live_ico_item type_youdu" id="youduButton"></div>
|
||
<div class="live_ico_item type_quit" id="hideButton"></div>
|
||
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
|
||
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
|
||
<input id="duType" value="douqilai" type="hidden" />
|
||
</div>
|
||
</div>
|
||
<div id="open_live2d">召唤伊斯特瓦尔</div>
|
||
<!-- <![endif]-->
|
||
<footer>
|
||
<p>
|
||
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-01 00:00:18<br /> 总字数:614622 - 文章数:178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
|
||
</p>
|
||
</footer>
|
||
</div>
|
||
<script src="/assets/js/scale.fix.js"></script>
|
||
<!--[if !IE]> -->
|
||
<script src="/assets/js/main_new.js"></script>
|
||
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
|
||
<script src="/Live2dHistoire/live2d/js/message.js"></script>
|
||
<!-- <![endif]-->
|
||
</body>
|
||
</html>
|