-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
274 lines (237 loc) · 37 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<!DOCTYPE html><html lang="zh-CN" data-theme="dark"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>The Blog of Monoceros406 - Reverse</title><meta name="author" content="Monoceros406"><meta name="copyright" content="Monoceros406"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#0d0d0d"><meta name="description" content="智邮普创工作室安全组(退役)/Nepnep联合战队">
<meta property="og:type" content="website">
<meta property="og:title" content="The Blog of Monoceros406">
<meta property="og:url" content="https://monoceros406.github.io/index.html">
<meta property="og:site_name" content="The Blog of Monoceros406">
<meta property="og:description" content="智邮普创工作室安全组(退役)/Nepnep联合战队">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://monoceros406.github.io/img/avatar.jpg">
<meta property="article:author" content="Monoceros406">
<meta property="article:tag" content="Reverse">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://monoceros406.github.io/img/avatar.jpg"><link rel="shortcut icon" href="/img/avatar.jpg"><link rel="canonical" href="https://monoceros406.github.io/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: undefined,
translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '天',
dateSuffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: undefined,
lightbox: 'fancybox',
Snackbar: undefined,
infinitegrid: {
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
buttonText: '加载更多'
},
isPhotoFigcaption: false,
islazyload: false,
isAnchor: false,
percent: {
toc: true,
rightside: false,
},
autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: 'The Blog of Monoceros406',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2025-01-14 22:01:12'
}</script><script>(win=>{
win.saveToLocal = {
set: (key, value, ttl) => {
if (ttl === 0) return
const now = Date.now()
const expiry = now + ttl * 86400000
const item = {
value,
expiry
}
localStorage.setItem(key, JSON.stringify(item))
},
get: key => {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = Date.now()
if (now > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
Object.keys(attr).forEach(key => {
script.setAttribute(key, attr[key])
})
document.head.appendChild(script)
})
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
const link = document.createElement('link')
link.rel = 'stylesheet'
link.href = url
if (id) link.id = id
link.onerror = reject
link.onload = link.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
link.onload = link.onreadystatechange = null
resolve()
}
document.head.appendChild(link)
})
win.activateDarkMode = () => {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = () => {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
if (t === 'dark') activateDarkMode()
else if (t === 'light') activateLightMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const detectApple = () => {
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
})(window)</script><meta name="generator" content="Hexo 6.3.0"><link rel="alternate" href="/atom.xml" title="The Blog of Monoceros406" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">314</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">24</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://t.alcy.cc/ycy')"><nav id="nav"><span id="blog-info"><a href="/" title="The Blog of Monoceros406"><span class="site-name">The Blog of Monoceros406</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">The Blog of Monoceros406</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/Monoceros406" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:[email protected]" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a><a class="social-icon" href="https://monoceros406.github.io/atom.xml" target="_blank" title=""><i class="fas fa-rss"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/26/%E5%85%AC%E5%91%8A-%E6%97%A0%E9%99%90%E6%9C%9F%E5%81%9C%E6%9B%B4/" title="公告-无限期停更">公告-无限期停更</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-26T08:21:05.000Z" title="发表于 2024-12-26 16:21:05">2024-12-26</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%85%B6%E4%BB%96/">其他</a></span></div><div class="content">公告-停更博主要参加27考研,不打算二战,且本科课程学得稀烂,遂开始逐步复习。本博客主要记录信息安全相关主题,大概考前不打算继续学习技术相关。
(考前也可能会诈尸
</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/16/UEFI%E7%BC%96%E7%A8%8B%E5%85%A5%E9%97%A8-GUI%E5%BC%80%E5%8F%91/" title="UEFI编程入门-GUI开发">UEFI编程入门-GUI开发</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-16T08:22:35.000Z" title="发表于 2024-12-16 16:22:35">2024-12-16</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%80%86%E5%90%91%E5%B7%A5%E7%A8%8B/">逆向工程</a></span></div><div class="content">UEFI编程入门-GUI开发入门UEFI的事件接口函数运行于启动服务环境下,有不同的任务优先级TPL要求。启动服务环境下有4种任务优先级,高优先级任务可以中断低优先级任务。
TPL要求
含义
TPL_APPLICATION
最低优先级,应用程序运行在这个级别
TPL_CALLBACK
中等优先级,比较耗时的操作,如磁盘操作
TPL_NOTIFY
高优先级,不允许阻塞,如底层IO操作
TPL_HIGH_LEVEL
最高优先级,不允许被中断,如UEFI内核全局变量修改
事件存在两种互斥的状态:等待和触发。当事件被创建后,UEFI系统将其设置为等待状态。事件被触发后,UEFI系统将其转换为触发状态。
对于处于TPL_CALLBACK和TPL_NOTIFY级别的事件,存在处理队列。若队列中同志函数的TPL小于等于目前任务TPL,那它只能等到当前任务TPL降低,一般通过启动服务的RestoreTPL来改变TPL。
常用函数CreateEvent/CreateEventEx函数CreateEvent和CreateEventEx均用于产生事件,原型如下。其中Cr ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/15/WindowsAPI%E7%BC%96%E7%A8%8B%E6%A0%B8%E5%BF%83%E6%8A%80%E6%9C%AF-NPcap%E7%BD%91%E7%BB%9C%E6%8A%93%E5%8C%85%E5%85%A5%E9%97%A8/" title="WindowsAPI编程核心技术-NPcap网络抓包入门">WindowsAPI编程核心技术-NPcap网络抓包入门</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-15T13:12:01.000Z" title="发表于 2024-12-15 21:12:01">2024-12-15</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%80%86%E5%90%91%E5%B7%A5%E7%A8%8B/">逆向工程</a></span></div><div class="content">WindowsAPI编程核心技术-NPcap网络抓包入门环境搭建NPcap是WinPcap的改进版,后者已停止维护。在官网https://npcap.com/ 获取安装包和SDK,并运行安装包。
新建Visual Studio工程,添加SDK的Include目录为包含目录,添加Lib\x64目录为库目录,链接器附加依赖项添加wpcap.lib、packet.lib和ws2_32.lib文件。
PCAP文件格式文件格式大致为:
1234文件头24字节数据报头16字节 + 数据包数据报头16字节 + 数据包...
文件头格式为:
123456789struct pcap_file_header { bpf_u_int32 magic; //PCAP文件标识 如d4 c3 b2 a1 u_short version_major; //主版本号 u_short version_minor; //次版本号 bpf_int32 thiszone; /* 时区修正 未使用 总为0 */ bpf_u_int32 sigfigs; /* 精确时间戳 未使用 总为 ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/13/Windows%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91%E5%85%A5%E9%97%A8-WDF%E5%88%9D%E6%8E%A2/" title="Windows驱动开发入门-WDF初探">Windows驱动开发入门-WDF初探</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-13T09:24:26.000Z" title="发表于 2024-12-13 17:24:26">2024-12-13</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%80%86%E5%90%91%E5%B7%A5%E7%A8%8B/">逆向工程</a></span></div><div class="content">Windows驱动开发入门-WDF初探基本结构WDF基本对象包括驱动对象WDFDRIVER和设备对象WDFDEVICE。
每个设备驱动都必须有与之对应的唯一的驱动对象,该对象由内核执行体I/O管理器在驱动首次加载时创建,结构定义为:
1234567typedef struct _WDF_DRIVER_CONFIG { ULONG Size; PFN_WDF_DRIVER_DEVICE_ADD EvtDriverDeviceAdd; //设备对象添加例程 PFN_WDF_DRIVER_UNLOAD EvtDriverUnload; //卸载例程 ULONG DriverInitFlags; //初始化标识符 ULONG DriverPoolTag; //调试器显示的内存表示 4字节} WDF_DRIVER_CONFIG, *PWDF_DRIVER_CONFIG;
驱动至少创建一个设备对象,每个设备对象包含指向下一个对象的指针,形成一个设备链。设备对象是能使软件操作硬件的数据结构,包括位于设备堆栈最底层的物理设备对象PDO ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/12/Windows%E8%BD%AF%E4%BB%B6%E8%B0%83%E8%AF%95%E5%88%9D%E6%8E%A2-%E4%BA%8B%E4%BB%B6%E8%BF%BD%E8%B8%AAETW/" title="Windows软件调试初探-事件追踪ETW">Windows软件调试初探-事件追踪ETW</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-12T12:06:24.000Z" title="发表于 2024-12-12 20:06:24">2024-12-12</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%80%86%E5%90%91%E5%B7%A5%E7%A8%8B/">逆向工程</a></span></div><div class="content">Windows软件调试初探-事件追踪ETW入门ETW使用提供器-消耗器-控制器设计模式。输出追踪消息的目标程序是提供器,接收和查看追踪消息的工具或文件是消耗器,负责控制追踪会话的工具是控制器。用于支持ETW传输追踪信息的通信连接称为ETW会话,Windows最多支持64个ETW会话,其中有两个是系统专用的,分别是启动早期用的Global Logger Session和记录系统预定义事件的NT Kernel Logger Session。
ETW基础设施核心部分是实现在内核模块的,作为WMI一个部分实现。有一部分函数在DDK中公开,供驱动调用,用户模式API在ADVAPI32.DLL输出。
1x nt!Wmi*trace*
提供ETW消息ETW提供器通过RegisterTraceGuids向系统注册自己的GUID,这样ETW控制器才能通过GUID找到该提供器。若ETW控制器启动或停止该提供器,则系统调用回调函数。
123456789101112#include <evntrace.h>#define RegisterTraceGuids RegisterTrace ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/11/OpenSSL%E5%85%A5%E9%97%A8-SM2%E5%AE%9E%E8%B7%B5/" title="OpenSSL入门-SM2实践">OpenSSL入门-SM2实践</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-11T14:39:50.000Z" title="发表于 2024-12-11 22:39:50">2024-12-11</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Crypto/">Crypto</a></span></div><div class="content">OpenSSL入门-SM2实践MIRACL下载MIRACL:https://github.com/miracl/MIRACL ,打开x64 Native Tools Command Prompt for VS 2022,工作目录改为source下,并将include目录内所有文件拷贝到source目录下,并运行../lib/ms64doit_cpp.bat。于是在source目录下生成miracl.lib,接下来工程需要链接该.lib。
SM2加密需要复制来miracl.h和mirdef.h头文件。
test.c:
1234#include "SM2_ENC.h"void main() { SM2_ENC_SelfTest();}
SM2_ENC.c:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/11/OpenSSL%E5%85%A5%E9%97%A8-SSL-TLS%E7%BC%96%E7%A8%8B%E5%AE%9E%E6%88%98/" title="OpenSSL入门-SSL-TLS编程实战">OpenSSL入门-SSL-TLS编程实战</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-11T12:35:44.000Z" title="发表于 2024-12-11 20:35:44">2024-12-11</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Crypto/">Crypto</a></span></div><div class="content">OpenSSL入门-SSL-TLS编程实战入门用SSL_library_init、OpenSSL_add_ssl_algorithms或SSLeay_add_ssl_algorithms初始化SSL算法库,调用SSL系列函数前必须先调用一个:
123int SSL_library_init(); //成功1 否则0#define OpenSSL_add_ssl_algorithms() SSL_library_init()#define SSLeay_add_ssl_algorithms() SSL_library_init()
用SSL_CTX_new和SSL_CTX_free分别初始化和释放SSL上下文环境变量。
123456SSL_CTX* SSL_CTX_new( SSL_METHOD* meth //使用的SSL协议算法); //成功返回指针 否则NULLvoid SSL_CTX_free( SSL_CTX* ctx);
其中参数meth可以是:
12345678SSLv2_server_method();SSLv2_client_method();SSLv3 ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/10/OpenSSL%E5%85%A5%E9%97%A8-PKI%E5%AE%9E%E6%88%98/" title="OpenSSL入门-PKI实战">OpenSSL入门-PKI实战</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-10T10:50:27.000Z" title="发表于 2024-12-10 18:50:27">2024-12-10</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Crypto/">Crypto</a></span></div><div class="content">OpenSSL入门-PKI实战入门需要准备三台电脑:根CA主机、子CA主机和客户主机,下面先搭建根CA主机和子CA主机:
先查看防火墙,若开启则要关闭:
12firewall-cmd --state #查看状态systemctl stop firewalld
打开OpenSSL配置文件如下,或Windows下为/bin/openssl.cfg。
1cat /etc/ssl/openssl.cnf
部分内容为:
123456789101112131415161718192021222324252627282930313233343536[ ca ]default_ca = CA_default # 默认CA[ CA_default ]dir = /etc/pki/CA # CA工作目录 这里改一下certs = $dir/certs # 证书存储路径crl_dir = $dir/crl # 证书吊销列表da ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/08/OpenSSL%E5%85%A5%E9%97%A8-%E6%A4%AD%E5%9C%86%E6%9B%B2%E7%BA%BF/" title="OpenSSL入门-椭圆曲线">OpenSSL入门-椭圆曲线</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-08T14:00:05.000Z" title="发表于 2024-12-08 22:00:05">2024-12-08</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Crypto/">Crypto</a></span></div><div class="content">OpenSSL入门-椭圆曲线数学基础例如求椭圆曲线$y^2=x^3-x$在有限域$\operatorname{GF}(89)$上所有点:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112#include <iostream>#include<string.h>#include<math.h>#include<time.h>#define MAX 100typedef struct point { int point_x; int point_y;}Point;typedef struct ecc ...</div></div></div><div class="recent-post-item"><div class="recent-post-info no-cover"><a class="article-title" href="/2024/12/08/OpenSSL%E5%85%A5%E9%97%A8-RSA%E7%BB%BC%E5%90%88/" title="OpenSSL入门-RSA综合">OpenSSL入门-RSA综合</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2024-12-08T08:27:56.000Z" title="发表于 2024-12-08 16:27:56">2024-12-08</time></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Crypto/">Crypto</a></span></div><div class="content">OpenSSL入门-RSA综合PKCS#1加密填充格式:
1EB=00+BT+PS+00+D
EB位转化后十六进制表示的数据块,如密钥为1024位时EB长度为128字节。BT为处理模式,公钥操作为02,私钥操作为00或01,当D以00开头时BT为01,不以00开头时为00。PS为填充字节,填充数量为$密钥字节长-3-明文字节长$,最小长度为8,当BT为00时填充用00,BT为01时填充用FF,BT为02时随机非零填充。
C语言实现:
12345678910111213141516171819202122232425262728293031323334353637383940#include <iostream>#include <stdlib.h>#include <time.h>int rsaEncDataPaddingPkcs1(unsigned char* in, int ilen, unsigned char* eb, int olen) { int i; unsigned char byteRand; if ( ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">…</span><a class="page-number" href="/page/32/#content-inner">32</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Monoceros406</div><div class="author-info__description">智邮普创工作室安全组(退役)/Nepnep联合战队</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">314</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">24</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/Monoceros406"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/Monoceros406" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:[email protected]" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a><a class="social-icon" href="https://monoceros406.github.io/atom.xml" target="_blank" title=""><i class="fas fa-rss"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">哪里排版出锅了请告诉我QwQ QQ:1295625063</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/12/26/%E5%85%AC%E5%91%8A-%E6%97%A0%E9%99%90%E6%9C%9F%E5%81%9C%E6%9B%B4/" title="公告-无限期停更">公告-无限期停更</a><time datetime="2024-12-26T08:21:05.000Z" title="发表于 2024-12-26 16:21:05">2024-12-26</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/12/16/UEFI%E7%BC%96%E7%A8%8B%E5%85%A5%E9%97%A8-GUI%E5%BC%80%E5%8F%91/" title="UEFI编程入门-GUI开发">UEFI编程入门-GUI开发</a><time datetime="2024-12-16T08:22:35.000Z" title="发表于 2024-12-16 16:22:35">2024-12-16</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/12/15/WindowsAPI%E7%BC%96%E7%A8%8B%E6%A0%B8%E5%BF%83%E6%8A%80%E6%9C%AF-NPcap%E7%BD%91%E7%BB%9C%E6%8A%93%E5%8C%85%E5%85%A5%E9%97%A8/" title="WindowsAPI编程核心技术-NPcap网络抓包入门">WindowsAPI编程核心技术-NPcap网络抓包入门</a><time datetime="2024-12-15T13:12:01.000Z" title="发表于 2024-12-15 21:12:01">2024-12-15</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/12/13/Windows%E9%A9%B1%E5%8A%A8%E5%BC%80%E5%8F%91%E5%85%A5%E9%97%A8-WDF%E5%88%9D%E6%8E%A2/" title="Windows驱动开发入门-WDF初探">Windows驱动开发入门-WDF初探</a><time datetime="2024-12-13T09:24:26.000Z" title="发表于 2024-12-13 17:24:26">2024-12-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2024/12/12/Windows%E8%BD%AF%E4%BB%B6%E8%B0%83%E8%AF%95%E5%88%9D%E6%8E%A2-%E4%BA%8B%E4%BB%B6%E8%BF%BD%E8%B8%AAETW/" title="Windows软件调试初探-事件追踪ETW">Windows软件调试初探-事件追踪ETW</a><time datetime="2024-12-12T12:06:24.000Z" title="发表于 2024-12-12 20:06:24">2024-12-12</time></div></div></div></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/%E8%A7%A3%E9%A2%98%E6%8A%A5%E5%91%8A/" style="font-size: 1.28em; color: #99a0aa">解题报告</a> <a href="/tags/%E6%BC%8F%E6%B4%9E%E5%A4%8D%E7%8E%B0/" style="font-size: 1.1em; color: #999">漏洞复现</a> <a href="/tags/%E6%B8%97%E9%80%8F%E6%B5%8B%E8%AF%95/" style="font-size: 1.46em; color: #99a8bc">渗透测试</a> <a href="/tags/%E5%8F%96%E8%AF%81/" style="font-size: 1.1em; color: #999">取证</a> <a href="/tags/Web3/" style="font-size: 1.17em; color: #999ca0">Web3</a> <a href="/tags/Web/" style="font-size: 1.39em; color: #99a5b5">Web</a> <a href="/tags/LaTeX/" style="font-size: 1.1em; color: #999">LaTeX</a> <a href="/tags/IOT/" style="font-size: 1.17em; color: #999ca0">IOT</a> <a href="/tags/Batch/" style="font-size: 1.1em; color: #999">Batch</a> <a href="/tags/%E5%85%8D%E6%9D%80/" style="font-size: 1.14em; color: #999a9c">免杀</a> <a href="/tags/%E9%80%86%E5%90%91%E5%B7%A5%E7%A8%8B/" style="font-size: 1.5em; color: #99a9bf">逆向工程</a> <a href="/tags/Python/" style="font-size: 1.39em; color: #99a5b5">Python</a> <a href="/tags/PWN/" style="font-size: 1.35em; color: #99a3b1">PWN</a> <a href="/tags/Crypto/" style="font-size: 1.35em; color: #99a3b1">Crypto</a> <a href="/tags/C/" style="font-size: 1.1em; color: #999">C++</a> <a href="/tags/Misc/" style="font-size: 1.14em; color: #999a9c">Misc</a> <a href="/tags/%E5%BC%80%E5%8F%91/" style="font-size: 1.43em; color: #99a6b8">开发</a> <a href="/tags/OSINT/" style="font-size: 1.1em; color: #999">OSINT</a> <a href="/tags/%E5%85%B6%E4%BB%96/" style="font-size: 1.21em; color: #999da3">其他</a> <a href="/tags/%E7%A7%BB%E5%8A%A8%E5%AE%89%E5%85%A8/" style="font-size: 1.32em; color: #99a2ae">移动安全</a> <a href="/tags/PyJail/" style="font-size: 1.14em; color: #999a9c">PyJail</a> <a href="/tags/%E7%AE%97%E6%B3%95/" style="font-size: 1.14em; color: #999a9c">算法</a> <a href="/tags/AWD/" style="font-size: 1.1em; color: #999">AWD</a> <a href="/tags/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1/" style="font-size: 1.25em; color: #999fa7">数学建模</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/archives/" title="查看更多">
<i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/12/"><span class="card-archive-list-date">十二月 2024</span><span class="card-archive-list-count">13</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/11/"><span class="card-archive-list-date">十一月 2024</span><span class="card-archive-list-count">12</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/10/"><span class="card-archive-list-date">十月 2024</span><span class="card-archive-list-count">20</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/08/"><span class="card-archive-list-date">八月 2024</span><span class="card-archive-list-count">8</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/07/"><span class="card-archive-list-date">七月 2024</span><span class="card-archive-list-count">13</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/06/"><span class="card-archive-list-date">六月 2024</span><span class="card-archive-list-count">9</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/05/"><span class="card-archive-list-date">五月 2024</span><span class="card-archive-list-count">32</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">314</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2025-01-14T14:01:10.824Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2025-01-14T14:01:10.824Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2025 By Monoceros406</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"><script>window.typedJSFn = {
init: (str) => {
window.typed = new Typed('#subtitle', Object.assign({
strings: str,
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50,
}, null))
},
run: (subtitleType) => {
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/dist/typed.umd.min.js').then(subtitleType)
}
} else {
subtitleType()
}
}
}
</script><script>function subtitleType () {
if (true) {
typedJSFn.init(["Reverse"])
} else {
document.getElementById("subtitle").textContent = "Reverse"
}
}
typedJSFn.run(subtitleType)</script></div><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/fireworks.min.js"></script><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div class="docsearch-wrap"><div id="docsearch" style="display:none"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css/dist/style.min.css"/><script src="https://cdn.jsdelivr.net/npm/@docsearch/js/dist/umd/index.min.js"></script><script>(() => {
docsearch(Object.assign({
appId: '',
apiKey: '',
indexName: '',
container: '#docsearch',
}, null))
const handleClick = () => {
document.querySelector('.DocSearch-Button').click()
}
const searchClickFn = () => {
btf.addEventListenerPjax(document.querySelector('#search-button > .search'), 'click', handleClick)
}
searchClickFn()
window.addEventListener('pjax:complete', searchClickFn)
})()</script></div></div></body></html>