-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
239 lines (234 loc) · 35.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<!doctype html>
<html lang="zh"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta><title>Knaithe Blog</title><link rel="manifest" href="/manifest.json"><meta name="application-name" content="Knaithe Blog"><meta name="msapplication-TileImage" content="/img/favicon.svg"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Knaithe Blog"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="description" content="Security researcher"><meta property="og:type" content="blog"><meta property="og:title" content="Knaithe Blog"><meta property="og:url" content="https://knaithe.github.io/"><meta property="og:site_name" content="Knaithe Blog"><meta property="og:description" content="Security researcher"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://knaithe.github.io/img/og_image.png"><meta property="article:author" content="Knaithe"><meta property="article:tag" content="Linux驱动开发,二进制安全,Linux内核漏洞分析,Linux内核漏洞挖掘"><meta property="twitter:card" content="summary"><meta property="twitter:image" content="/img/og_image.png"><script type="application/ld+json">{"@context":"https://schema.org","@type":"BlogPosting","mainEntityOfPage":{"@type":"WebPage","@id":"https://knaithe.github.io"},"headline":"Knaithe Blog","image":["https://knaithe.github.io/img/og_image.png"],"author":{"@type":"Person","name":"Knaithe"},"publisher":{"@type":"Organization","name":"Knaithe Blog","logo":{"@type":"ImageObject","url":"https://knaithe.github.io/img/logo.svg"}},"description":"Security researcher"}</script><link rel="icon" href="/img/favicon.svg"><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.2/css/all.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/styles/atom-one-light.css"><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;600&family=Source+Code+Pro"><link rel="stylesheet" href="/css/default.css"><style>body>.footer,body>.navbar,body>.section{opacity:0}</style><!--!--><!--!--><!--!--><!--!--><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/build/cookieconsent.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/lightgallery.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/justifiedGallery.min.css"><!--!--><!--!--><style>.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#3273dc;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}</style><script src="https://cdn.jsdelivr.net/npm/[email protected]/pace.min.js"></script><!--!--><!--!--><!-- hexo injector head_end start --><script>
(function () {
function switchTab() {
if (!location.hash) {
return;
}
Array
.from(document.querySelectorAll('.tab-content'))
.forEach($tab => {
$tab.classList.add('is-hidden');
});
Array
.from(document.querySelectorAll('.tabs li'))
.forEach($tab => {
$tab.classList.remove('is-active');
});
const $activeTab = document.querySelector(location.hash);
if ($activeTab) {
$activeTab.classList.remove('is-hidden');
}
const $tabMenu = document.querySelector(`a[href="${location.hash}"]`);
if ($tabMenu) {
$tabMenu.parentElement.classList.add('is-active');
}
}
switchTab();
window.addEventListener('hashchange', switchTab, false);
})();
</script><!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.2.0"></head><body class="is-3-column"><nav class="navbar navbar-main"><div class="container navbar-container"><div class="navbar-brand justify-content-center"><a class="navbar-item navbar-logo" href="/"><img src="/img/logo.svg" alt="Knaithe Blog" height="28"></a></div><div class="navbar-menu"><div class="navbar-start"><a class="navbar-item is-active" href="/">Home</a><a class="navbar-item" href="/archives">Archives</a><a class="navbar-item" href="/categories">Categories</a><a class="navbar-item" href="/tags">Tags</a><a class="navbar-item" href="/about">About</a></div><div class="navbar-end"><a class="navbar-item" target="_blank" rel="noopener" title="Download on GitHub" href="https://github.com/Knaithe"><i class="fab fa-github"></i></a><a class="navbar-item search" title="搜索" href="javascript:;"><i class="fas fa-search"></i></a></div></div></div></nav><section class="section"><div class="container"><div class="columns"><div class="column order-2 column-main is-8-tablet is-8-desktop is-6-widescreen"><div class="card"><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item"><time dateTime="2022-06-01T16:00:00.000Z" title="2022/6/2 00:00:00">2022-06-02</time>发表</span><span class="level-item"><time dateTime="2022-06-01T16:48:09.406Z" title="2022/6/2 00:48:09">2022-06-02</time>更新</span><span class="level-item">28 分钟读完 (大约4201个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2022/06/02/%E4%BB%BF%E5%86%99%E7%BE%8E%E5%9B%BDNSA%E6%96%B9%E7%A8%8B%E5%BC%8Fbvp47%E9%A1%B6%E7%BA%A7%E5%90%8E%E9%97%A8-%E9%9A%90%E8%94%BD%E4%BF%A1%E9%81%93%E7%AF%87/">仿写"美国NSA方程式bvp47顶级后门"-隐蔽信道篇</a></h1><div class="content"><h2 id="背景描述"><a href="#背景描述" class="headerlink" title="背景描述"></a>背景描述</h2><p> Bvp47是2013年盘古实验室研究员在针对某国内要害部门主机的调查过程中,提取了一个经过复杂加密 的Linux平台后门。是一款集基于SYN包的高级隐蔽信道、身份认证及加密通信、自身代码混淆、系统隐藏、静态反调试及自毁设计、SeLinux安全机制绕过的一个世界级顶级后门。</p>
<h2 id="仿写目标"><a href="#仿写目标" class="headerlink" title="仿写目标"></a>仿写目标</h2><ul>
<li>功能描述:</li>
</ul>
<table>
<thead>
<tr>
<th align="left">既定目标</th>
<th align="center">完成时间</th>
<th align="center">完成情况</th>
</tr>
</thead>
<tbody><tr>
<td align="left">SYN敲门ebpf后门xdp程序隐蔽信道构建</td>
<td align="center">2022年5月10日</td>
<td align="center">√</td>
</tr>
<tr>
<td align="left">后门加载器,同时在加载器实现反弹shell</td>
<td align="center">2022年5月16日</td>
<td align="center">√</td>
</tr>
<tr>
<td align="left">SYN敲门攻击端程序(打算用python写)</td>
<td align="center">2022年5月18日</td>
<td align="center">√</td>
</tr>
<tr>
<td align="left">后门加载增加公私钥认证功能</td>
<td align="center">2022年5月20号</td>
<td align="center">o</td>
</tr>
</tbody></table>
<ul>
<li><p>编译环境</p>
<p>ubuntu20.04,内核5.4.0。</p>
</li>
<li><p>运行环境</p>
<p>内核5.4.0以上。</p>
</li>
</ul>
<h2 id="隐蔽信道设计思路"><a href="#隐蔽信道设计思路" class="headerlink" title="隐蔽信道设计思路"></a>隐蔽信道设计思路</h2><h3 id="Bvp47隐蔽信道解读"><a href="#Bvp47隐蔽信道解读" class="headerlink" title="Bvp47隐蔽信道解读"></a>Bvp47隐蔽信道解读</h3><p> 根据盘古实验室发布的《Bvp47美国NSA方程式的顶级后门》这篇报告显示,Bvp47后门程序通过加载bpf程序来构建隐蔽信道,从而达到“敲门”的效果 ,大致工作图示如下。</p>
<p> <img src="https://img-blog.csdnimg.cn/a71352b408f244e8bd1888aa09f66e54.png" alt="img"> </p>
<h3 id="BPF简介"><a href="#BPF简介" class="headerlink" title="BPF简介"></a>BPF简介</h3><p> 经过我对eBPF的一番学习和了解,<strong>BPF全名Berkeley Packet Filter</strong> ,诞生于1992年一篇名为《 The BSD Packet Filter: A New Architecture for User-level Packet Capture 》的论文。 </p>
<p> BPF 技术最早源于 BSD系统,后移植至 Linux 内核,常用的 tcpdump 就是基于 BPF 技术,BPF早期被称作cBPF,在内核开发者的不断扩展下,演变成如今的eBPF。由此可知,BPF功能模块最初是为了<strong>高效处理网络数据包</strong>而开发。</p>
<h3 id="XDP介绍"><a href="#XDP介绍" class="headerlink" title="XDP介绍"></a>XDP介绍</h3><p> XDP全称eXpress Data Path,是一个<strong>内核态、高性能、可编程 BPF 包处理框架</strong> 。不同于常规的<strong>DPDK这类内核旁路可编程包处理过程</strong>,将网络硬件的控制权从内核层转移到到用户空间,XDP保留了完整的从<strong>网络硬件</strong>-><strong>网卡驱动</strong>-><strong>内核网络协议栈</strong>-><strong>socket</strong>-><strong>用户应用层</strong>的网络数据包处理过程。通俗的说,XDP只是一个介于内核网络协议栈之下的一系列hook点,能更早的处理网络数据包,大大减小数据包在庞大且复杂的内核协议栈中被处理带来的资源和时间的消耗,从而更高效的处理网络数据包。</p>
<h4 id="XDP工作模式"><a href="#XDP工作模式" class="headerlink" title="XDP工作模式"></a>XDP工作模式</h4><ol>
<li><p>XDP程序工作模式大致分为以下三种:</p>
<ul>
<li><strong>Offload XDP</strong></li>
</ul>
<p>直接attach到网卡 ,还在网卡驱动之前, hook到可编程的智能网卡硬件设备上,无需主机CPU执行处理,由网卡上的程序处理,大大节省主机CPU资源消耗,目前仅有<strong>Netronome</strong> 这个牌子的智能网卡支持这种模式。</p>
<ul>
<li><strong>Native XDP</strong></li>
</ul>
<p>直接运行在网络驱动的早期,接收来自网卡发送数据给网络驱动的处理路径上,hook在网络驱动处理之前。但是也不是所有网络驱动都支持,比如我在虚拟机运行Ubuntu时常见的e1000、e1000e网络驱动就不支持Native模式。</p>
<ul>
<li><strong>Generic XDP</strong></li>
</ul>
<p>介于网卡驱动程序之后,用于不支持Native XDP网卡驱动的主机上, 需要分配额外的套接字缓冲区,性能较Native XDP差一些,但也早于tc和内核网络协议栈处理。</p>
</li>
<li><p>XDP三种运行模式大致所处位置:</p>
</li>
</ol>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">NIC设备------>Driver---->Traffic Control-->Netfilter-->TCP stack-->Socket-->application</span><br><span class="line"> | | |</span><br><span class="line">Offload Native Generic</span><br></pre></td></tr></table></figure>
<h4 id="XDP工作用途"><a href="#XDP工作用途" class="headerlink" title="XDP工作用途"></a>XDP工作用途</h4><p> XDP程序正常可用作 <strong>DDoS 防御、防火墙、 转发和负载均衡、数据帧抽样监控</strong>等高效的网络数据包处理工具。 </p>
<h3 id="基于TCP协议首部的隐蔽信道"><a href="#基于TCP协议首部的隐蔽信道" class="headerlink" title="基于TCP协议首部的隐蔽信道"></a>基于TCP协议首部的隐蔽信道</h3><p> XDP既然可以在数据链路层截获以太帧,让我们来分析分析,为何选择在TCP协议首部隐藏数据,而不是选择在以太帧首部、IP协议首部或者是TCP数据段来传递隐藏数据。</p>
<ul>
<li><p>首先,以太帧的首部格式如下:</p>
<p> <img src="https://img-blog.csdnimg.cn/73737526483d42da90ca4a878a638cb4.png" alt="img"></p>
</li>
</ul>
<p> <strong>前同步码</strong>:占7个字节,用来使接收端的适配器在接收 MAC 帧时能够迅速调整时钟频率,使它和发送端的频率相同。前同步码为 7 个字节,1 和 0 交替。 </p>
<p> <strong>帧开始定界符</strong>:占1个字节,帧的起始符,前6位1和0交替,最后的两个连续的1。 </p>
<p> <strong>目的MAC地址</strong>:占6个字节,存放目的MAC地址。</p>
<p> <strong>源MAC地址</strong>:占6个字节,存放源端MAC地址。</p>
<p> <strong>类型</strong>:占2个字节,描述上层网络层协议类型。</p>
<p> <strong>数据</strong>:称为效载荷,表示交付给上层的数据,这里指的是上层IP协议的IP数据包。</p>
<p> <strong>帧检验序列 FCS</strong>: 占4个字节,存放CRC值,用于接收端检查整个帧的是否出差错。</p>
<p> 经过以上介绍,发现以太帧头部并没有冗余字段,无法隐藏需要传递的信息。</p>
<ul>
<li><p>接下来是IP数据报格式如下:</p>
<p> <img src="https://img-blog.csdnimg.cn/2e2b907ed71e4fff95fb3da61b6f9793.png" alt="img"></p>
<p><strong>版本</strong>:占 4 bit,表示 IP 协议的版本,通信双方使用的 IP 协议版本必须一致,该字段无法利用。</p>
<p><strong>首部长度</strong>:占 4 bit,用来描述首部长度,该字段不建议利用。</p>
<p><strong>区分服务</strong>:占 1个字节,这个字段在旧标准中实际一直没有被使用过。现在只有在使用区分服务时,这个字段才起作用,可以利用。</p>
<p><strong>总长度</strong>:占 2个字节,首部和数据之和,单位为字节。能描述数据报的最大长度为 2^16-1=65535 字节,该字段也无法利用。</p>
<p><strong>标识</strong>:占 2个字节,数据报分片传输时,具有相同的标识字段值的分片报文会被重组成原来的数据报,可以利用。</p>
<p><strong>标志</strong>:占 3 bit,用于描述数据报分片状态的字段,不建议利用。</p>
<p><strong>片偏移</strong>:占 13 bit,用于描述数据报分片后,标记该分片在原报文中的相对位置,不建议利用。</p>
<p><strong>生存时间TTL</strong>:占 1个字节,用于描述数据包在网络中传输的寿命,最大值为255,每经过一次路由TLL减1,用于防止出现广播风暴,不建议利用。</p>
<p><strong>协议</strong>:占 1个字节,描述上层传输层协议类型,无法利用。</p>
<p><strong>首部检验和</strong>:占2个字节, 用于校验数据报的首部,由于TTL会一直变,所以这个字段无法利用。</p>
<p><strong>源地址</strong>:占4个字节,表示数据报的源 IP 地址,无法利用。</p>
<p><strong>目的地址</strong>:占4个字节,表示数据报的目的 IP 地址,无法利用。</p>
<p><strong>可选字段</strong>:占4个字节,可有可无,主要用于测试、调试和安全的目的,正常的数据包不会包含这个字段,不建议利用。</p>
<p><strong>数据部分</strong>:表示传输层的数据,如 TCP、UDP这类协议的数据,长度不固定。</p>
<p>以上是IP数据报格式,首部最小也有20个字节,含有冗余字段有<strong>标识 2个字节</strong>、<strong>区分服务字段 1个字节</strong>。</p>
</li>
<li><p>接下来是TCP报文的头部格式,</p>
<p> <img src="https://img-blog.csdnimg.cn/153a376e1ec34321875dc8384ac356b6.png" alt="img"></p>
<p><strong>源端口</strong>:占2个字节,源计算机上的应用程序的端口号,无法利用。</p>
<p><strong>目的端口</strong>:占2个字节,源目标计算机的应用程序的端口号,无法利用。</p>
<p><strong>序列号字段</strong>:占4个字节,表示本报文段所发送数据的第一个字节的编号,用于对序列号进行同步,作为TCP握手的第一个SYN包时,可以利用。</p>
<p><strong>确认号字段</strong>:占4个字节,表示接收方期望收到发送方下一个报文段的第一个字节数据的编号,不能时随机值,当作为SYN包时,默认为0,不建议利用。</p>
<p><strong>数据偏移字段</strong>:占4bit, 指数据段中的“数据”部分起始处距离 TCP 数据段起始处的字节偏移量,其实这里的“数据偏移”也是在确定 TCP 数据段头部分的长度,告诉接收端的应用程序,数据从何处开始,无法利用。</p>
<p><strong>保留字段</strong>:占4bit,无实际用处,目前必须全部为 0,不建议利用。</p>
<p><strong>标志位字段</strong>:</p>
<ul>
<li>CWR(Congestion Window Reduce):拥塞窗口减少标志,用来表明它接收到了设置 ECE 标志的 TCP 包。并且,发送方收到消息之后,通过减小发送窗口的大小来降低发送速率。</li>
<li>ECE(ECN Echo):用来在 TCP 三次握手时表明一个 TCP 端是具备 ECN 功能的。在数据传输过程中,它也用来表明接收到的 TCP 包的 IP 头部的 ECN 被设置为 11,即网络线路拥堵。</li>
<li>URG(Urgent):表示本报文段中发送的数据是否包含紧急数据。URG=1 时表示有紧急数据。当 URG=1 时,后面的紧急指针字段才有效。</li>
<li>ACK:表示前面的确认号字段是否有效。ACK=1 时表示有效。只有当 ACK=1 时,前面的确认号字段才有效。TCP 规定,连接建立后,ACK 必须为 1。</li>
<li>PSH(Push):告诉对方收到该报文段后是否立即把数据推送给上层。如果值为 1,表示应当立即把数据提交给上层,而不是缓存起来。</li>
<li>RST:表示是否重置连接。如果 RST=1,说明 TCP 连接出现了严重错误(如主机崩溃),必须释放连接,然后再重新建立连接。</li>
<li>SYN:在建立连接时使用,用来同步序号。当 SYN=1,ACK=0 时,表示这是一个请求建立连接的报文段;当 SYN=1,ACK=1 时,表示对方同意建立连接。SYN=1 时,说明这是一个请求建立连接或同意建立连接的报文。只有在前两次握手中 SYN 才为 1。</li>
<li>FIN:标记数据是否发送完毕。如果 FIN=1,表示数据已经发送完成,可以释放连接。</li>
</ul>
<p>总共1个字节,该字段不建议利用。</p>
<p><strong>窗口大小字段</strong>:占2个字节,表示从 Ack Number 开始还可以接收多少字节的数据量,也表示当前接收端的接收窗口还有多少剩余空间。该字段可以用于 TCP 的流量控制,不建议利用。</p>
<p><strong>TCP 校验和字段</strong>:占2个字节,也成为 TCP Checksum,用于接收端来验证TCP数据包的完整性的,Checksum 是根据伪头 + TCP 头 + TCP 数据三部分进行计算的,无法利用。</p>
<p><strong>紧急指针字段</strong>:占2个字节,当URG 控制位为1时才有意义 ,因为SYN包,URG位为0,所以这个字段默认为0,不建议利用。</p>
<p><strong>可选项字段</strong>:占4个字节,没有特殊用途正常情况下垃圾数值,可以利用。</p>
<p>以上是TCP数据报格式,含有冗余字段有<strong>序列号字段 4个字节</strong>、<strong>可选字段 4个字节</strong>可以被利用隐藏数据。</p>
</li>
<li><p>问答环节</p>
<p>问:那SYN包的TCP数据段能拿来用吗?</p>
<p>答:Bvp47有在SYN包的TCP数据段携带88个字节的信息,但是那毕竟是2000年零几年的隐蔽信道,正常的SYN包的TCP数据段为空?所以我不想太扎眼,不建议在SYN包的TCP数据段携带隐蔽信息。</p>
</li>
</ul>
<h2 id="隐蔽信道后门实现思路"><a href="#隐蔽信道后门实现思路" class="headerlink" title="隐蔽信道后门实现思路"></a>隐蔽信道后门实现思路</h2><h3 id="XDP隐蔽信道程序和攻击者“敲门”方式的实现思路"><a href="#XDP隐蔽信道程序和攻击者“敲门”方式的实现思路" class="headerlink" title="XDP隐蔽信道程序和攻击者“敲门”方式的实现思路"></a>XDP隐蔽信道程序和攻击者“敲门”方式的实现思路</h3><p> 以上介绍了XDP的正常用途,和基于TCP协议的隐蔽性信道。如果我把XDP程序集合对TCP隐蔽信道的利用,不仅能传递隐蔽信息,而且XDP程序还能最早处理攻击者的数据包,在XDP经过简单的“敲门”验证后,把身份认证信息传回用户层,即可直接DROP掉该SYN包,能逃避基于内核网络协议栈的安全模块的检测,从而最大程度做到隐蔽通信。</p>
<p> 攻击者对后门程序的“敲门”唤醒采用特定构造的基于TCP的SYN包,将隐蔽信息藏在TCP头的<strong>序列号字段 4个字节</strong>和<strong>可选字段 4个字节</strong>,这里编写基于python3的攻击脚本。</p>
<h3 id="XDP加载器及反弹shell实现思路"><a href="#XDP加载器及反弹shell实现思路" class="headerlink" title="XDP加载器及反弹shell实现思路"></a>XDP加载器及反弹shell实现思路</h3><p> xdp程序加载的方式除了通过iproute2这个命令行工具来手动加载,也可以通过c、python、go等语言自行编写xdp程序来加载,这样做的好处是,如果目标机器默认没有安装net-tools这个工具包,自然没有iproute2这个工具,自行编写的xdp加载器就能够很好的适应这种突发状况,避免过度依赖环境。这里我采用了c语言实现xdp加载器程序。</p>
<p> map是<strong>驻留在内核的高效键值对仓库</strong>,既可以被BPF程序(包括xdp。程序)直接访问,也可以<strong>从用户空间通过文件描述符访问</strong>,自然成了BPF程序和用户空间通讯的极佳方式。因此,xdp程序可以通过map将攻击者的<strong>认证信息</strong>和<strong>源ip地址</strong>通过map仓库,传给应用层的xdp加载器程序,由xdp加载器程序继续完成身份验证和反弹shell的动作。</p>
<h2 id="不成熟的身份认证设计理念"><a href="#不成熟的身份认证设计理念" class="headerlink" title="不成熟的身份认证设计理念"></a>不成熟的身份认证设计理念</h2><ul>
<li><p>为什么要做身份认证?</p>
<p>答:防止他人伪造我的SYN请求包,“敲击”并唤醒后门程序,就算其他人捕捉到了后门样本进行分析,也无法伪造出的我的“敲门”请求。</p>
</li>
<li><p>身份认证的方案:</p>
<p>建议:SM2 + 祖冲之序列密码算法</p>
<p>答:不宜用常规的非对称的签名算法,例如RSA-1024的签名信息就有128字节,SM2当然也不行,需要将签名信息放到SYN包的data段,有点刺眼,不方便隐蔽信道传输。“方程式顶级bvp47后门”就是采用了将身份验证信息放到SYN包放到data段,我猜各大厂商应该做了相对应防范措施。</p>
<p>解决方案:采用RSA-32算法,将身份验证的信息藏到tcp头里,虽然能藏的信息有限,相对简单,但是也能增加破解者的伪造请求难度。</p>
</li>
<li><p>备用解决方案:</p>
<p>答:采用了写死的魔数字到tcp头的seq字段,用来做简单的验证。</p>
</li>
</ul>
<h2 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h2><p>[美] David Calavera,[意] Lorenzo Fontana 著,范彬,狄卫华 译 《Linux内核观测技术BPF》 </p>
<p><a target="_blank" rel="noopener" href="https://arthurchiao.art/blog/cilium-bpf-xdp-reference-guide-zh/">[译] Cilium:BPF 和 XDP 参考指南(2021)</a></p>
<p><a target="_blank" rel="noopener" href="https://arthurchiao.art/blog/xdp-paper-acm-2018-zh/">[译] [论文] XDP (eXpress Data Path):在操作系统内核中实现快速、可编程包处理(ACM,2018)</a></p>
<p> 娄嘉鹏, 张萌, 付鹏, 张开. 一种基于TCP协议的网络隐蔽传输方案设计[J]. 信息网络安全, 2016, 16(1): 34-39. </p>
</div></article></div><div class="card"><article class="card-content article" role="article"><div class="article-meta is-size-7 is-uppercase level is-mobile"><div class="level-left"><span class="level-item"><time dateTime="2022-05-31T16:28:22.628Z" title="2022/6/1 00:28:22">2022-06-01</time>发表</span><span class="level-item"><time dateTime="2022-06-01T14:49:43.813Z" title="2022/6/1 22:49:43">2022-06-01</time>更新</span><span class="level-item">1 分钟读完 (大约123个字)</span></div></div><h1 class="title is-3 is-size-4-mobile"><a class="link-muted" href="/2022/06/01/hello-world/">Hello World</a></h1><div class="content"><p>Welcome to <a target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a target="_blank" rel="noopener" href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a target="_blank" rel="noopener" href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a target="_blank" rel="noopener" href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure>
<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>
<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>
<p>More info: <a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>
</div></article></div></div><div class="column column-left is-4-tablet is-4-desktop is-3-widescreen order-1"><div class="card widget" data-type="profile"><div class="card-content"><nav class="level"><div class="level-item has-text-centered flex-shrink-1"><div><figure class="image is-128x128 mx-auto mb-2"><img class="avatar" src="/img/avatar.png" alt="Knaithe"></figure><p class="title is-size-4 is-block" style="line-height:inherit;">Knaithe</p><p class="is-size-6 is-block">Binary Security Researcher</p><p class="is-size-6 is-flex justify-content-center"><i class="fas fa-map-marker-alt mr-1"></i><span>ZhuHai,China</span></p></div></div></nav><nav class="level is-mobile"><div class="level-item has-text-centered is-marginless"><div><p class="heading">文章</p><a href="/archives"><p class="title">2</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">分类</p><a href="/categories"><p class="title">0</p></a></div></div><div class="level-item has-text-centered is-marginless"><div><p class="heading">标签</p><a href="/tags"><p class="title">0</p></a></div></div></nav><div class="level"><a class="level-item button is-primary is-rounded" href="https://github.com/Knaithe" target="_blank" rel="noopener">关注我</a></div><div class="level is-mobile is-multiline"><a class="level-item button is-transparent is-marginless" target="_blank" rel="noopener" title="Github" href="https://github.com/Knaithe"><i class="fab fa-github"></i></a><a class="level-item button is-transparent is-marginless" target="_blank" rel="noopener" title="Twitter" href="https://twitter.com/KnaitheYuan"><i class="fab fa-twitter"></i></a></div></div></div><!--!--><div class="card widget" data-type="archives"><div class="card-content"><div class="menu"><h3 class="menu-label">归档</h3><ul class="menu-list"><li><a class="level is-mobile" href="/archives/2022/06/"><span class="level-start"><span class="level-item">六月 2022</span></span><span class="level-end"><span class="level-item tag">2</span></span></a></li></ul></div></div></div><!--!--><div class="column-right-shadow is-hidden-widescreen"></div></div><div class="column column-right is-4-tablet is-4-desktop is-3-widescreen is-hidden-touch is-hidden-desktop-only order-3"><div class="card widget" data-type="recent-posts"><div class="card-content"><h3 class="menu-label">最新文章</h3><article class="media"><div class="media-content"><p class="date"><time dateTime="2022-06-01T16:00:00.000Z">2022-06-02</time></p><p class="title"><a href="/2022/06/02/%E4%BB%BF%E5%86%99%E7%BE%8E%E5%9B%BDNSA%E6%96%B9%E7%A8%8B%E5%BC%8Fbvp47%E9%A1%B6%E7%BA%A7%E5%90%8E%E9%97%A8-%E9%9A%90%E8%94%BD%E4%BF%A1%E9%81%93%E7%AF%87/">仿写"美国NSA方程式bvp47顶级后门"-隐蔽信道篇</a></p></div></article><article class="media"><div class="media-content"><p class="date"><time dateTime="2022-05-31T16:28:22.628Z">2022-06-01</time></p><p class="title"><a href="/2022/06/01/hello-world/">Hello World</a></p></div></article></div></div><!--!--><div class="card widget" data-type="links"><div class="card-content"><div class="menu"><h3 class="menu-label">链接</h3><ul class="menu-list"><li><a class="level is-mobile" href="https://hexo.io" target="_blank" rel="noopener"><span class="level-left"><span class="level-item">Hexo</span></span><span class="level-right"><span class="level-item tag">hexo.io</span></span></a></li><li><a class="level is-mobile" href="https://bulma.io" target="_blank" rel="noopener"><span class="level-left"><span class="level-item">Bulma</span></span><span class="level-right"><span class="level-item tag">bulma.io</span></span></a></li></ul></div></div></div><div class="card widget" data-type="subscribe-email"><div class="card-content"><div class="menu"><h3 class="menu-label">订阅更新</h3><form action="https://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('https://feedburner.google.com/fb/a/mailverify?uri=','popupwindow','scrollbars=yes,width=550,height=520');return true"><input type="hidden" value="" name="uri"><input type="hidden" name="loc" value="en_US"><div class="field has-addons"><div class="control has-icons-left is-expanded"><input class="input" name="email" type="email" placeholder="Email"><span class="icon is-small is-left"><i class="fas fa-envelope"></i></span></div><div class="control"><input class="button" type="submit" value="订阅"></div></div></form></div></div></div></div></div></div></section><footer class="footer"><div class="container"><div class="level"><div class="level-start"><a class="footer-logo is-block mb-2" href="/"><img src="/img/logo.svg" alt="Knaithe Blog" height="28"></a><p class="is-size-7"><span>© 2022 Knaithe</span> Powered by <a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> & <a href="https://github.com/ppoffice/hexo-theme-icarus" target="_blank" rel="noopener">Icarus</a></p></div><div class="level-end"><div class="field has-addons"><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Creative Commons" href="https://creativecommons.org/"><i class="fab fa-creative-commons"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Attribution 4.0 International" href="https://creativecommons.org/licenses/by/4.0/"><i class="fab fa-creative-commons-by"></i></a></p><p class="control"><a class="button is-transparent is-large" target="_blank" rel="noopener" title="Download on GitHub" href="https://github.com/ppoffice/hexo-theme-icarus"><i class="fab fa-github"></i></a></p></div></div></div></div></footer><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/min/moment-with-locales.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/clipboard.min.js" defer></script><script>moment.locale("zh-CN");</script><script>var IcarusThemeSettings = {
article: {
highlight: {
clipboard: true,
fold: 'unfolded'
}
}
};</script><script src="/js/column.js"></script><script src="/js/animation.js"></script><a id="back-to-top" title="回到顶端" href="javascript:;"><i class="fas fa-chevron-up"></i></a><script src="/js/back_to_top.js" defer></script><!--!--><!--!--><!--!--><script src="https://cdn.jsdelivr.net/npm/[email protected]/build/cookieconsent.min.js" defer></script><script>window.addEventListener("load", () => {
window.cookieconsent.initialise({
type: "info",
theme: "edgeless",
static: false,
position: "bottom-left",
content: {
message: "此网站使用Cookie来改善您的体验。",
dismiss: "知道了!",
allow: "允许使用Cookie",
deny: "拒绝",
link: "了解更多",
policy: "Cookie政策",
href: "https://www.cookiesandyou.com/",
},
palette: {
popup: {
background: "#edeff5",
text: "#838391"
},
button: {
background: "#4b81e8"
},
},
});
});</script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/lightgallery.min.js" defer></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/jquery.justifiedGallery.min.js" defer></script><script>window.addEventListener("load", () => {
if (typeof $.fn.lightGallery === 'function') {
$('.article').lightGallery({ selector: '.gallery-item' });
}
if (typeof $.fn.justifiedGallery === 'function') {
if ($('.justified-gallery > p > .gallery-item').length) {
$('.justified-gallery > p > .gallery-item').unwrap();
}
$('.justified-gallery').justifiedGallery();
}
});</script><!--!--><!--!--><!--!--><!--!--><!--!--><script src="/js/main.js" defer></script><div class="searchbox"><div class="searchbox-container"><div class="searchbox-header"><div class="searchbox-input-container"><input class="searchbox-input" type="text" placeholder="想要查找什么..."></div><a class="searchbox-close" href="javascript:;">×</a></div><div class="searchbox-body"></div></div></div><script src="/js/insight.js" defer></script><script>document.addEventListener('DOMContentLoaded', function () {
loadInsight({"contentUrl":"/content.json"}, {"hint":"想要查找什么...","untitled":"(无标题)","posts":"文章","pages":"页面","categories":"分类","tags":"标签"});
});</script></body></html>