-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
3536 lines (3027 loc) · 396 KB
/
atom.xml
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
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
<title type="text">lioders 's blog</title>
<subtitle type="html">lioders's blog 梦想被扼杀的第一个征候,是抱怨没有时间</subtitle>
<updated>2021-12-29T14:09:53+08:00</updated>
<id>https://lioders.com/</id>
<link rel="alternate" type="text/html" href="https://lioders.com/" />
<link rel="self" type="application/atom+xml" href="https://lioders.com/atom.xml" />
<author>
<name>Lioders</name>
<uri>https://lioders.com/</uri>
<email>liodersmall@gmail.com</email>
</author>
<rights>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</rights>
<generator uri="https://gohugo.io/" version="0.87.0">Hugo</generator>
<entry>
<title type="text">electron去除敏感cli flag</title>
<link rel="alternate" type="text/html" href="https://lioders.com/posts/electron%E5%85%B3%E9%97%AD%E9%BB%98%E8%AE%A4%E8%B0%83%E8%AF%95cli/" />
<id>https://lioders.com/posts/electron%E5%85%B3%E9%97%AD%E9%BB%98%E8%AE%A4%E8%B0%83%E8%AF%95cli/</id>
<updated>2021-12-29T14:07:32+08:00</updated>
<published>2021-12-28T16:42:28+08:00</published>
<author>
<name>Lioders</name>
<uri>https://lioders.com/</uri>
<email>liodersmall@gmail.com</email>
</author>
<rights>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</rights><summary type="html">electron去除debug、调试……</summary>
<content type="html"><h2 id="electron去除debug调试等敏感cli">electron去除debug、调试等敏感cli</h2>
<h3 id="前言">前言</h3>
<p>最近工作一直在使用electron开发桌面端应用,在调试的过程中发现默认打包后支持一些默认的cli flag。如下列举:</p>
<blockquote>
<p>Electron CLI 标志<a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#electron-cli-%E6%A0%87%E5%BF%97"></a></p>
<p>--remote-debugging-port=<code>port</code><a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#--remote-debugging-portport"></a></p>
<p>在指定<code>端口</code>开启HTTP远程调试.</p>
<p>--js-flags=<code>flags</code><a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#--js-flagsflags"></a></p>
<p>指定传递到 Node.js 引擎的flags。 如果您想在主进程中启用 <code>flags</code> ,则必须在一开始运行Electron的时候就传递。</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh">$ electron --js-flags<span class="o">=</span><span class="s2">&#34;--harmony_proxies --harmony_collections&#34;</span> your-app
</code></pre></td></tr></table>
</div>
</div><p>复制</p>
<p>查看<a href="https://nodejs.org/api/cli.html">Node.js 文档</a>或者在终端中运行<code>node --help</code>命令查看可用的flags列表。 此外,还可以运行<code>node --v8-options</code>来查看与Node.js的V8 JavaScript引擎特定相关的flags列表。</p>
</blockquote>
<blockquote>
<p>Node.js Flags<a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#nodejs-flags"></a></p>
<p>--inspect-port=[host:]port<a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#--inspect-porthostport"></a></p>
<p>当检查器被激活时要使用的 <code>主机:端口</code>。 常用于通过发送 SIGUSR1 信号激活检查器时。 默认主机是 <code>127.0.0.1</code>。</p>
<p>是 <code>--debug-port=[host:]port</code>的别名</p>
<p>--inspect[=[host:]port]<a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#--inspecthostport"></a></p>
<p>在 <code>主机:端口</code> 上激活检查器。 默认是 <code>127.0.0.1:9229</code>。</p>
<p>集成V8 检查器允许Chrome 开发者工具和 IDE 这些工具调试和修改 Electron 实例。 这些工具通过 TCP 端口连接到 Electron 实例,并使用 <a href="https://chromedevtools.github.io/devtools-protocol/">Chrome 开发者工具协议</a>进行通信。</p>
<p>调试相关的标识, 更多详细信息请查看 <a href="https://www.electronjs.org/zh/docs/latest/tutorial/debugging-main-process">Debugging the Main Process</a>指南。</p>
<p>是 <code>--debug[host:]port</code>的别名</p>
<p>--inspect-publish-uid=stderr,http<a href="https://www.electronjs.org/zh/docs/latest/api/command-line-switches#--inspect-publish-uidstderrhttp"></a></p>
<p>指定检查器的 web 套接字url 公开方式。</p>
<p>默认情况下,websocket url在 stderr 中和在 http://host:port/json/list 的 /json/list 端点下都是可用的。</p>
</blockquote>
<p>对其为了关闭,官方给出了解决方案,https://www.electronjs.org/zh/docs/latest/tutorial/fuses</p>
<blockquote>
<p>For a subset of Electron functionality it makes sense to disable certain features for an entire application. For example, 99% of apps don't make use of <code>ELECTRON_RUN_AS_NODE</code>, these applications want to be able to ship a binary that is incapable of using that feature. We also don't want Electron consumers building Electron from source as that is both a massive technical challenge and has a high cost of both time and money.</p>
<p>Fuses are the solution to this problem, at a high level they are &quot;magic bits&quot; in the Electron binary that can be flipped when packaging your Electron app to enable / disable certain features / restrictions. Because they are flipped at package time before you code sign your app the OS becomes responsible for ensuring those bits aren't flipped back via OS level code signing validation (Gatekeeper / App Locker).</p>
</blockquote>
<p>总结来讲就是你可以在构建electron时在源码删除不必要的标志位,但是构建源码太复杂,官方给予Fuses来对编译后的应用程序修改标识位来启用或关闭的功能。(此处黑人疑问🤔️:岂不是关闭的标志位后面也可以启用开启,后面自己尝试下)</p>
<h3 id="修改方法">修改方法</h3>
<h4 id="1electron-evil-feature-patcher-测试失败">1、electron-evil-feature-patcher (测试失败)</h4>
<p>该项目node写的,作者通过修改<code>--inspect</code>替换为 <code> --inspect</code> 多了两个space 来替换敏感的cli标志。</p>
<p>使用方法:</p>
<p><code>npx electron-evil-feature-patcher your-app-path</code></p>
<p><code>node electron-evil-feature-patcher/cli your-app-path</code></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="kr">const</span> <span class="nx">patch</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;electron-evil-feature-patcher&#39;</span><span class="p">);</span>
<span class="nx">patch</span><span class="p">({</span> <span class="nx">path</span><span class="o">:</span> <span class="s1">&#39;your-app-path&#39;</span> <span class="p">});</span>
</code></pre></td></tr></table>
</div>
</div><p><a href="https://github.com/antelle/electron-evil-feature-patcher">https://github.com/antelle/electron-evil-feature-patcher</a></p>
<p>这里测试如下</p>
<p><a href="https://github.com/QDMarkMan/electron-builder-start">https://github.com/QDMarkMan/electron-builder-start</a> 官方测试app</p>
<blockquote>
<p>Mac</p>
<p><img src="https://image-1258536138.cos.ap-shanghai.myqcloud.com/uPic/Z9N2JF.png" alt="image-20211229114419939"></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash">&gt; node electron-evil-feature-patcher/cli ./electron-evil-feature-patcher/electron-builder-start.app
Electron feature patcher v1.2.1
/Users/lioders/Documents/tools/electron-evil-feature-patcher/patch.js:138
throw new Error<span class="o">(</span><span class="sb">`</span>Not found: <span class="si">${</span><span class="nv">replacement</span><span class="p">.name</span><span class="si">}</span><span class="sb">`</span><span class="o">)</span><span class="p">;</span>
^
Error: Not found: Debugger listening message
at patch <span class="o">(</span>/Users/lioders/Documents/tools/electron-evil-feature-patcher/patch.js:138:19<span class="o">)</span>
at Object.&lt;anonymous&gt; <span class="o">(</span>/Users/lioders/Documents/tools/electron-evil-feature-patcher/cli.js:15:1<span class="o">)</span>
at Module._compile <span class="o">(</span>node:internal/modules/cjs/loader:1101:14<span class="o">)</span>
at Object.Module._extensions..js <span class="o">(</span>node:internal/modules/cjs/loader:1153:10<span class="o">)</span>
at Module.load <span class="o">(</span>node:internal/modules/cjs/loader:981:32<span class="o">)</span>
at Function.Module._load <span class="o">(</span>node:internal/modules/cjs/loader:822:12<span class="o">)</span>
at Function.executeUserEntryPoint <span class="o">[</span>as runMain<span class="o">]</span> <span class="o">(</span>node:internal/modules/run_main:81:12<span class="o">)</span>
at node:internal/main/run_main_module:17:47
</code></pre></td></tr></table>
</div>
</div></blockquote>
<p>测试均失败</p>
<h4 id="2electron-hardener-测试有效">2、electron-hardener (测试有效)</h4>
<p>1Password 开发的 <a href="https://github.com/1Password/electron-hardener">https://github.com/1Password/electron-hardener</a></p>
<p>使用Rust开发,测试下来很好用。</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash">git clone https://github.com/1Password/electron-hardener.git
<span class="nb">cd</span> electron-hardener
cargo build
electron-hardener /path/youriapp
</code></pre></td></tr></table>
</div>
</div><div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"> Updating crates.io index
Downloaded memchr v2.3.4
Downloaded regex v1.4.6
Downloaded regex-syntax v0.6.23
Downloaded aho-corasick v0.7.15
Downloaded <span class="m">4</span> crates <span class="o">(</span>671.6 KB<span class="o">)</span> in 3.13s
Compiling memchr v2.3.4
Compiling regex-syntax v0.6.23
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
Compiling aho-corasick v0.7.15
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
Compiling regex v1.4.6
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
Compiling electron-hardener v0.2.2 <span class="o">(</span>/Users/lioders/Documents/tools/electron-hardener<span class="o">)</span>
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
<span class="o">[</span>proxychains<span class="o">]</span> DLL init: proxychains-ng 4.14
Finished dev <span class="o">[</span>unoptimized + debuginfo<span class="o">]</span> target<span class="o">(</span>s<span class="o">)</span> in 2m 11s
</code></pre></td></tr></table>
</div>
</div><p>使用cli</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash">./electron-hardener /Users/lioders/Downloads/electron-builder-start-master/dist/mac/electron-builder-start.app/Contents/MacOS/electron-builder-start RemoteDebuggingPipe
./electron-hardener /Users/lioders/Downloads/electron-builder-start-master/dist/mac/electron-builder-start.app/Contents/MacOS/electron-builder-start RemoteDebuggingPort
</code></pre></td></tr></table>
</div>
</div><p>修复效果如下</p>
<p><img src="https://image-1258536138.cos.ap-shanghai.myqcloud.com/uPic/Rvnht0.png" alt="image-20211229140718954"></p>
<h4 id="3electronfuses">3、electron/fuses</h4>
<p>官方的一个简单库 <a href="https://www.npmjs.com/package/@electron/fuses">https://www.npmjs.com/package/@electron/fuses</a></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="kr">import</span> <span class="p">{</span> <span class="nx">flipFuses</span><span class="p">,</span> <span class="nx">FuseVersion</span><span class="p">,</span> <span class="nx">FuseV1Options</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">&#39;@electron/fuses&#39;</span><span class="p">;</span>
<span class="kr">await</span> <span class="nx">flipFuses</span><span class="p">(</span>
<span class="nx">require</span><span class="p">(</span><span class="s1">&#39;electron&#39;</span><span class="p">),</span> <span class="c1">// Returns the path to the electron binary
</span><span class="c1"></span> <span class="p">{</span>
<span class="nx">version</span><span class="o">:</span> <span class="nx">FuseVersion</span><span class="p">.</span><span class="nx">V1</span><span class="p">,</span>
<span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">RunAsNode</span><span class="p">]</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// Disables ELECTRON_RUN_AS_NODE
</span><span class="c1"></span> <span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">EnableCookieEncryption</span><span class="p">]</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// Enables cookie encryption
</span><span class="c1"></span> <span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">EnableNodeOptionsEnvironmentVariable</span><span class="p">]</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// Disables the NODE_OPTIONS environment variable
</span><span class="c1"></span> <span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">EnableNodeCliInspectArguments</span><span class="p">]</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> <span class="c1">// Disables the --inspect and --inspect-brk family of ClI options
</span><span class="c1"></span> <span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">EnableEmbeddedAsarIntegrityValidation</span><span class="p">]</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// Enables validation of the app.asar archive on macOS
</span><span class="c1"></span> <span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">OnlyLoadAppFromAsar</span><span class="p">]</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="c1">// Enforces that Electron will only load your app from &#34;app.asar&#34; instead of it&#39;s normall search paths
</span><span class="c1"></span> <span class="p">},</span>
<span class="p">);</span>
</code></pre></td></tr></table>
</div>
</div><p>For <code>arm64</code> macOS builds of your app if you are not immediately codesigning your app after flipping the fuses you will need to pass <code>resetAdHocDarwinSignature: true</code> to the <code>flipFuses</code> method. Otherwise the app will refuse to launch with code signature validation errors. This is a new security measure on Apple Silicon devices.</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="kr">import</span> <span class="p">{</span> <span class="nx">flipFuses</span><span class="p">,</span> <span class="nx">FuseVersion</span><span class="p">,</span> <span class="nx">FuseV1Options</span> <span class="p">}</span> <span class="nx">from</span> <span class="s1">&#39;@electron/fuses&#39;</span><span class="p">;</span>
<span class="kr">await</span> <span class="nx">flipFuses</span><span class="p">(</span>
<span class="nx">require</span><span class="p">(</span><span class="s1">&#39;electron&#39;</span><span class="p">),</span>
<span class="p">{</span>
<span class="nx">version</span><span class="o">:</span> <span class="nx">FuseVersion</span><span class="p">.</span><span class="nx">V1</span><span class="p">,</span>
<span class="nx">resetAdHocDarwinSignature</span><span class="o">:</span> <span class="nx">targetPlatform</span> <span class="o">===</span> <span class="s1">&#39;darwin&#39;</span> <span class="o">&amp;&amp;</span> <span class="nx">targetArch</span> <span class="o">===</span> <span class="s1">&#39;arm64&#39;</span><span class="p">,</span>
<span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">RunAsNode</span><span class="p">]</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">);</span>
</code></pre></td></tr></table>
</div>
</div><p>一个简单例子</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-javascript" data-lang="javascript"><span class="kr">const</span> <span class="nx">path</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;path&#39;</span><span class="p">)</span>
<span class="kr">const</span> <span class="p">{</span> <span class="nx">flipFuses</span><span class="p">,</span> <span class="nx">FuseVersion</span><span class="p">,</span> <span class="nx">FuseV1Options</span> <span class="p">}</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;@electron/fuses&#39;</span><span class="p">)</span>
<span class="nx">module</span><span class="p">.</span><span class="nx">exports</span> <span class="o">=</span> <span class="kr">async</span> <span class="kd">function</span> <span class="nx">afterPack</span><span class="p">(</span><span class="nx">context</span><span class="p">)</span> <span class="p">{</span>
<span class="kr">const</span> <span class="nx">ext</span> <span class="o">=</span> <span class="p">{</span>
<span class="nx">darwin</span><span class="o">:</span> <span class="s1">&#39;.app&#39;</span><span class="p">,</span>
<span class="nx">win32</span><span class="o">:</span> <span class="s1">&#39;.exe&#39;</span><span class="p">,</span>
<span class="p">}[</span><span class="nx">context</span><span class="p">.</span><span class="nx">electronPlatformName</span><span class="p">]</span>
<span class="kr">const</span> <span class="nx">electronBinaryPath</span> <span class="o">=</span> <span class="nx">path</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="nx">context</span><span class="p">.</span><span class="nx">appOutDir</span><span class="p">,</span> <span class="nx">context</span><span class="p">.</span><span class="nx">packager</span><span class="p">.</span><span class="nx">appInfo</span><span class="p">.</span><span class="nx">productFilename</span> <span class="o">+</span> <span class="nx">ext</span><span class="p">)</span> <span class="c1">// is there a better way?
</span><span class="c1"></span> <span class="kr">await</span> <span class="nx">flipFuses</span><span class="p">(</span>
<span class="nx">electronBinaryPath</span><span class="p">,</span>
<span class="p">{</span>
<span class="nx">version</span><span class="o">:</span> <span class="nx">FuseVersion</span><span class="p">.</span><span class="nx">V1</span><span class="p">,</span>
<span class="p">[</span><span class="nx">FuseV1Options</span><span class="p">.</span><span class="nx">EnableNodeCliInspectArguments</span><span class="p">]</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">)</span>
<span class="p">}</span>
</code></pre></td></tr></table>
</div>
</div><h3 id="sdk-自己编写">SDK (自己编写)</h3>
<p>准备自己写一个python库的SDK</p>
<p><img src="https://image-1258536138.cos.ap-shanghai.myqcloud.com/uPic/NiKVVt.jpeg" alt="真正的信鸽,从来不会“放鸽子”!| 果壳科技有意思"></p>
</content>
<category scheme="https://lioders.com/categories/electron/" term="electron" label="electron" />
<category scheme="https://lioders.com/categories/node/" term="node" label="node" />
<category scheme="https://lioders.com/tags/electron/" term="electron" label="electron" />
<category scheme="https://lioders.com/tags/node/" term="node" label="node" />
</entry>
<entry>
<title type="text">CTF题目-空投的秘密</title>
<link rel="alternate" type="text/html" href="https://lioders.com/posts/ctf%E9%A2%98%E7%9B%AE-%E7%A9%BA%E6%8A%95%E7%9A%84%E7%A7%98%E5%AF%86/" />
<id>https://lioders.com/posts/ctf%E9%A2%98%E7%9B%AE-%E7%A9%BA%E6%8A%95%E7%9A%84%E7%A7%98%E5%AF%86/</id>
<updated>2021-12-27T11:07:28+08:00</updated>
<published>2021-10-22T16:42:28+08:00</published>
<author>
<name>Lioders</name>
<uri>https://lioders.com/</uri>
<email>liodersmall@gmail.com</email>
</author>
<rights>[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh)</rights><summary type="html">前言 最近出了一道智能合约题目,学习了……</summary>
<content type="html"><h2 id="前言">前言</h2>
<p>最近出了一道智能合约题目,学习了以太坊web3开发,调用合约敏感approve达到偷币的目的。以下是该次合约信息。</p>
<h2 id="oops-合约信息">Oops 合约信息</h2>
<h3 id="相关信息">相关信息</h3>
<p>合约地址: <a href="https://ropsten.etherscan.io/token/0x08f702612b798a3ec23d2f7061ab450000e3e551">https://ropsten.etherscan.io/token/0x08f702612b798a3ec23d2f7061ab450000e3e551</a></p>
<p>Ropsten 发币水龙头🚰 领取eth 手续费用</p>
<ul>
<li><a href="https://faucet.ropsten.be/">https://faucet.ropsten.be</a></li>
<li><a href="https://faucet.metamask.io/">https://faucet.metamask.io/</a></li>
<li><a href="https://faucet.dimensions.network/">https://faucet.dimensions.network/</a></li>
<li><a href="https://faucet.kyber.network/">https://faucet.kyber.network/</a>(仅限GitHub用户)</li>
<li><a href="http://faucet.bitfwd.xyz/">http://faucet.bitfwd.xyz/</a></li>
</ul>
<p>每一个注册用户会分配一个以太坊测试环境(ropsten)钱包地址。需要在这个地址上转入合约代币Oops Coin 即可获得<code>flag</code>(需要获取50%代币)</p>
<h2 id="知识点">知识点</h2>
<p>在用户和Dapp进行交互的时候,首先需要授权(approve),这样Dapp才能对用户的账户余额进行转移等操作。某些Dapp开发者为了避免用户反复授权,一般会默认设置授权最大数量的代币给智能合约,但是这样的处理也有暴露风险,如果智能合约出现漏洞或者管理员跑路,那么用户的代币就会有丢失风险,这就是<strong>Dapp过度授权</strong></p>
<p>火币钱包如下图所示</p>
<p><img src="https://image-1258536138.cos.ap-shanghai.myqcloud.com/uPic/P057a0.png" alt=""></p>
<h3 id="approve方法">approve方法</h3>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-solidity" data-lang="solidity"><span class="n">approve</span><span class="p">(</span><span class="kt">address</span> <span class="n">_spender</span><span class="p">,</span> <span class="kt">uint</span> <span class="n">_amount</span><span class="p">)</span> <span class="k">returns</span> <span class="p">(</span><span class="kt">bool</span> <span class="n">success</span><span class="p">)</span>
</code></pre></td></tr></table>
</div>
</div><ul>
<li>
<p>_spender: 要授权的对象地址</p>
</li>
<li>
<p>_amount: 要授权的数量</p>
</li>
</ul>
<p>该方法调用成功后,会将调用者的固定<code>_amount</code>数量的币授权给<code>_spender</code>操作。换言之,<em>spender可以操作(比如转走)调用者</em>amount个数量的币。</p>
<h3 id="allowance方法">allowance方法</h3>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-solidity" data-lang="solidity"><span class="n">allowance</span><span class="p">(</span><span class="kt">address</span> <span class="n">_owner_address</span><span class="p">,</span> <span class="kt">address</span> <span class="n">_spender_address</span><span class="p">)</span>
</code></pre></td></tr></table>
</div>
</div><ul>
<li>
<p>_owner_address: 授权者,这个授权者是授权代币操作权限给被授权者的地址</p>
</li>
<li>
<p>_spender_address: 被授权者</p>
</li>
</ul>
<h3 id="transferfrom方法">transferFrom方法</h3>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-solidity" data-lang="solidity"><span class="n">transferFrom</span><span class="p">(</span><span class="kt">address</span> <span class="k">from</span><span class="p">,</span> <span class="kt">address</span> <span class="n">to</span><span class="p">,</span> <span class="kt">uint256</span> <span class="nb">value</span><span class="p">)</span>
</code></pre></td></tr></table>
</div>
</div><ul>
<li>from, 从这个地址进行转账</li>
<li>to, 币转到这个地址</li>
<li>value, 数量(如果是代币,会有单位换算)</li>
</ul>
<h2 id="空投的秘密">空投的秘密</h2>
<p>小明发现牛市来了,为了炒币发现一个发币团队的Dapp网站。后来发现这是发币团队留下的一个后门用于持续发空投。</p>
<h2 id="代码实现">代码实现</h2>
<h3 id="后端">后端</h3>
<p>后端使用py-web3调用合约函数,创建账号绑定地址。</p>
<h4 id="1创建一个eth地址">1、创建一个eth地址</h4>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="kn">import</span> <span class="nn">blocksmith</span>
<span class="k">def</span> <span class="nf">getEthKey</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">uuid</span>
<span class="n">kg</span> <span class="o">=</span> <span class="n">blocksmith</span><span class="o">.</span><span class="n">KeyGenerator</span><span class="p">()</span>
<span class="n">kg</span><span class="o">.</span><span class="n">seed_input</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">uuid</span><span class="o">.</span><span class="n">uuid4</span><span class="p">()))</span>
<span class="n">key</span> <span class="o">=</span> <span class="n">kg</span><span class="o">.</span><span class="n">generate_key</span><span class="p">()</span>
<span class="k">return</span> <span class="n">key</span>
<span class="k">def</span> <span class="nf">createEthereumWallet</span><span class="p">(</span><span class="n">key</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">str</span><span class="p">:</span>
<span class="s2">&#34;&#34;&#34;
</span><span class="s2">
</span><span class="s2"> :param key:
</span><span class="s2"> :return:
</span><span class="s2"> &#34;&#34;&#34;</span>
<span class="n">block_address</span> <span class="o">=</span> <span class="n">blocksmith</span><span class="o">.</span><span class="n">EthereumWallet</span><span class="o">.</span><span class="n">generate_address</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
<span class="n">checksum_address</span> <span class="o">=</span> <span class="n">blocksmith</span><span class="o">.</span><span class="n">EthereumWallet</span><span class="o">.</span><span class="n">checksum_address</span><span class="p">(</span><span class="n">block_address</span><span class="p">)</span>
<span class="k">return</span> <span class="n">checksum_address</span>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
<span class="n">address</span> <span class="o">=</span> <span class="n">createEthereumWallet</span><span class="p">(</span><span class="n">getEthKey</span><span class="p">())</span>
<span class="nb">print</span><span class="p">(</span><span class="n">address</span><span class="p">)</span>
</code></pre></td></tr></table>
</div>
</div><h4 id="2调用合约类">2、调用合约类</h4>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt"> 10
</span><span class="lnt"> 11
</span><span class="lnt"> 12
</span><span class="lnt"> 13
</span><span class="lnt"> 14
</span><span class="lnt"> 15
</span><span class="lnt"> 16
</span><span class="lnt"> 17
</span><span class="lnt"> 18
</span><span class="lnt"> 19
</span><span class="lnt"> 20
</span><span class="lnt"> 21
</span><span class="lnt"> 22
</span><span class="lnt"> 23
</span><span class="lnt"> 24
</span><span class="lnt"> 25
</span><span class="lnt"> 26
</span><span class="lnt"> 27
</span><span class="lnt"> 28
</span><span class="lnt"> 29
</span><span class="lnt"> 30
</span><span class="lnt"> 31
</span><span class="lnt"> 32
</span><span class="lnt"> 33
</span><span class="lnt"> 34
</span><span class="lnt"> 35
</span><span class="lnt"> 36
</span><span class="lnt"> 37
</span><span class="lnt"> 38
</span><span class="lnt"> 39
</span><span class="lnt"> 40
</span><span class="lnt"> 41
</span><span class="lnt"> 42
</span><span class="lnt"> 43
</span><span class="lnt"> 44
</span><span class="lnt"> 45
</span><span class="lnt"> 46
</span><span class="lnt"> 47
</span><span class="lnt"> 48
</span><span class="lnt"> 49
</span><span class="lnt"> 50
</span><span class="lnt"> 51
</span><span class="lnt"> 52
</span><span class="lnt"> 53
</span><span class="lnt"> 54
</span><span class="lnt"> 55
</span><span class="lnt"> 56
</span><span class="lnt"> 57
</span><span class="lnt"> 58
</span><span class="lnt"> 59
</span><span class="lnt"> 60
</span><span class="lnt"> 61
</span><span class="lnt"> 62
</span><span class="lnt"> 63
</span><span class="lnt"> 64
</span><span class="lnt"> 65
</span><span class="lnt"> 66
</span><span class="lnt"> 67
</span><span class="lnt"> 68
</span><span class="lnt"> 69
</span><span class="lnt"> 70
</span><span class="lnt"> 71
</span><span class="lnt"> 72
</span><span class="lnt"> 73
</span><span class="lnt"> 74
</span><span class="lnt"> 75
</span><span class="lnt"> 76
</span><span class="lnt"> 77
</span><span class="lnt"> 78
</span><span class="lnt"> 79
</span><span class="lnt"> 80
</span><span class="lnt"> 81
</span><span class="lnt"> 82
</span><span class="lnt"> 83
</span><span class="lnt"> 84
</span><span class="lnt"> 85
</span><span class="lnt"> 86
</span><span class="lnt"> 87
</span><span class="lnt"> 88
</span><span class="lnt"> 89
</span><span class="lnt"> 90
</span><span class="lnt"> 91
</span><span class="lnt"> 92
</span><span class="lnt"> 93
</span><span class="lnt"> 94
</span><span class="lnt"> 95
</span><span class="lnt"> 96
</span><span class="lnt"> 97
</span><span class="lnt"> 98
</span><span class="lnt"> 99
</span><span class="lnt">100
</span><span class="lnt">101
</span><span class="lnt">102
</span><span class="lnt">103
</span><span class="lnt">104
</span><span class="lnt">105
</span><span class="lnt">106
</span><span class="lnt">107
</span><span class="lnt">108
</span><span class="lnt">109
</span><span class="lnt">110
</span><span class="lnt">111
</span><span class="lnt">112
</span><span class="lnt">113
</span><span class="lnt">114
</span><span class="lnt">115
</span><span class="lnt">116
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="kn">import</span> <span class="nn">json</span>
<span class="kn">from</span> <span class="nn">web3</span> <span class="kn">import</span> <span class="n">Web3</span>
<span class="k">class</span> <span class="nc">ContractHandler</span><span class="p">:</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">web3</span> <span class="o">=</span> <span class="n">Web3</span><span class="p">(</span><span class="n">Web3</span><span class="o">.</span><span class="n">HTTPProvider</span><span class="p">(</span><span class="s1">&#39;https://ropsten.infura.io/v3/27063df63424480190b94f02f173fcf5&#39;</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">abi</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s2">&#34;Oops.json.json&#34;</span><span class="p">,</span> <span class="s1">&#39;r&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">abi_definition</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">abi</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">abi_definition</span><span class="p">)</span>
<span class="c1"># 合约地址信息</span>
<span class="bp">self</span><span class="o">.</span><span class="n">contract_address</span> <span class="o">=</span> <span class="s1">&#39;0x08f702612b798a3ec23d2f7061ab450000e3e551&#39;</span>
<span class="c1"># self.web3.isAddress(self.contract_address)</span>
<span class="n">verify_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">contract_address</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">contract</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">contract</span><span class="p">(</span><span class="n">abi</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">abi</span><span class="p">,</span> <span class="n">address</span><span class="o">=</span><span class="n">verify_address</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">unlockContract</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="c1"># self.web3.eth.account.</span>
<span class="k">pass</span>
<span class="k">def</span> <span class="nf">getAccountOops</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">account</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="s2">&#34;&#34;&#34;
</span><span class="s2">
</span><span class="s2"> :param account:
</span><span class="s2"> :return:
</span><span class="s2"> &#34;&#34;&#34;</span>
<span class="n">balance</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">contract</span><span class="o">.</span><span class="n">functions</span><span class="o">.</span><span class="n">balanceOf</span><span class="p">(</span><span class="n">account</span><span class="p">)</span><span class="o">.</span><span class="n">call</span><span class="p">()</span>
<span class="c1"># print(&#39;balance@latest =&gt; {0}&#39;.format(balance/1000000000000000000))</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">fromWei</span><span class="p">(</span><span class="n">balance</span><span class="p">,</span> <span class="s1">&#39;ether&#39;</span><span class="p">)</span>
<span class="c1"># return balance/1000000000000000000</span>
<span class="k">def</span> <span class="nf">gold_aridopOops</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">to_address</span><span class="p">):</span>
<span class="s2">&#34;&#34;&#34;
</span><span class="s2">
</span><span class="s2"> :param address:
</span><span class="s2"> :return:
</span><span class="s2"> &#34;&#34;&#34;</span>
<span class="kn">from</span> <span class="nn">ctf.config</span> <span class="kn">import</span> <span class="n">address</span><span class="p">,</span> <span class="n">private_key</span>
<span class="n">gold_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">address</span><span class="p">)</span>
<span class="n">gas_price</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">gasPrice</span>
<span class="c1"># nonce = self.web3.eth.getTransactionCount(gold_address)</span>
<span class="n">to_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">to_address</span><span class="p">)</span>
<span class="n">now_Oops</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">getAccountOops</span><span class="p">(</span><span class="n">gold_address</span><span class="p">)</span>
<span class="k">if</span> <span class="n">now_Oops</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">nonce</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">getTransactionCount</span><span class="p">(</span><span class="n">gold_address</span><span class="p">)</span>
<span class="n">transaction</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">contract</span><span class="o">.</span><span class="n">functions</span><span class="o">.</span><span class="n">transfer</span><span class="p">(</span><span class="n">to_address</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toWei</span><span class="p">(</span><span class="mi">10000</span><span class="p">,</span> <span class="s2">&#34;ether&#34;</span><span class="p">))</span><span class="o">.</span><span class="n">buildTransaction</span><span class="p">({</span>
<span class="s1">&#39;gas&#39;</span><span class="p">:</span> <span class="mi">241838</span><span class="p">,</span>
<span class="s1">&#39;gasPrice&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toWei</span><span class="p">(</span><span class="s1">&#39;10&#39;</span><span class="p">,</span> <span class="s1">&#39;gwei&#39;</span><span class="p">),</span>
<span class="s1">&#39;nonce&#39;</span><span class="p">:</span> <span class="n">nonce</span><span class="p">,</span>
<span class="p">})</span>
<span class="n">signed_tx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">signTransaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">,</span> <span class="n">private_key</span><span class="p">)</span>
<span class="n">txn_hash</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">sendRawTransaction</span><span class="p">(</span><span class="n">signed_tx</span><span class="o">.</span><span class="n">rawTransaction</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;txn_hash:&#39;</span><span class="p">,</span> <span class="n">Web3</span><span class="o">.</span><span class="n">toHex</span><span class="p">(</span><span class="n">txn_hash</span><span class="p">))</span>
<span class="k">def</span> <span class="nf">transformer</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">from_address</span><span class="p">,</span> <span class="n">to_address</span><span class="p">,</span> <span class="n">amount</span><span class="p">,</span> <span class="n">private_key</span><span class="p">):</span>
<span class="s2">&#34;&#34;&#34;
</span><span class="s2">
</span><span class="s2"> :param from_address:
</span><span class="s2"> :param to_address:
</span><span class="s2"> :param amount:
</span><span class="s2"> :return:
</span><span class="s2"> &#34;&#34;&#34;</span>
<span class="n">key</span> <span class="o">=</span> <span class="n">private_key</span>
<span class="n">from_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">from_address</span><span class="p">)</span>
<span class="n">to_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">to_address</span><span class="p">)</span>
<span class="n">now_Oops</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">getAccountOops</span><span class="p">(</span><span class="n">from_address</span><span class="p">)</span>
<span class="k">if</span> <span class="n">now_Oops</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">now_Oops</span> <span class="o">&gt;</span> <span class="n">amount</span><span class="p">:</span>
<span class="n">nonce</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">getTransactionCount</span><span class="p">(</span><span class="n">from_address</span><span class="p">)</span>
<span class="n">transaction</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">contract</span><span class="o">.</span><span class="n">functions</span><span class="o">.</span><span class="n">transfer</span><span class="p">(</span><span class="n">to_address</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toWei</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">amount</span><span class="p">),</span> <span class="s2">&#34;ether&#34;</span><span class="p">))</span><span class="o">.</span><span class="n">buildTransaction</span><span class="p">({</span>
<span class="s1">&#39;gas&#39;</span><span class="p">:</span> <span class="mi">241838</span><span class="p">,</span>
<span class="s1">&#39;gasPrice&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toWei</span><span class="p">(</span><span class="s1">&#39;10&#39;</span><span class="p">,</span> <span class="s1">&#39;gwei&#39;</span><span class="p">),</span>
<span class="s1">&#39;nonce&#39;</span><span class="p">:</span> <span class="n">nonce</span><span class="p">,</span>
<span class="p">})</span>
<span class="n">signed_tx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">signTransaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">,</span> <span class="n">private_key</span><span class="o">=</span><span class="n">key</span><span class="p">)</span>
<span class="n">txn_hash</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">sendRawTransaction</span><span class="p">(</span><span class="n">signed_tx</span><span class="o">.</span><span class="n">rawTransaction</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;txn_hash:&#39;</span><span class="p">,</span> <span class="n">Web3</span><span class="o">.</span><span class="n">toHex</span><span class="p">(</span><span class="n">txn_hash</span><span class="p">))</span>
<span class="k">def</span> <span class="nf">approve</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">spender</span><span class="p">,</span> <span class="n">amount</span><span class="p">):</span>
<span class="s2">&#34;&#34;&#34;
</span><span class="s2">
</span><span class="s2"> :param spender:
</span><span class="s2"> :param amount:
</span><span class="s2"> :return:
</span><span class="s2"> &#34;&#34;&#34;</span>
<span class="kn">from</span> <span class="nn">ctf.config</span> <span class="kn">import</span> <span class="n">address</span><span class="p">,</span> <span class="n">private_key</span>
<span class="n">gold_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">address</span><span class="p">)</span>
<span class="n">spender</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">spender</span><span class="p">)</span>
<span class="n">now_Oops</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">getAccountOops</span><span class="p">(</span><span class="n">gold_address</span><span class="p">)</span>
<span class="k">if</span> <span class="n">now_Oops</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">now_Oops</span> <span class="o">&gt;</span> <span class="n">amount</span><span class="p">:</span>
<span class="n">nonce</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">getTransactionCount</span><span class="p">(</span><span class="n">gold_address</span><span class="p">)</span>
<span class="n">transaction</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">contract</span><span class="o">.</span><span class="n">functions</span><span class="o">.</span><span class="n">approve</span><span class="p">(</span><span class="n">spender</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toWei</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">amount</span><span class="p">),</span> <span class="s2">&#34;ether&#34;</span><span class="p">))</span><span class="o">.</span><span class="n">buildTransaction</span><span class="p">({</span>
<span class="s1">&#39;gas&#39;</span><span class="p">:</span> <span class="mi">241838</span><span class="p">,</span>
<span class="s1">&#39;gasPrice&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toWei</span><span class="p">(</span><span class="s1">&#39;10&#39;</span><span class="p">,</span> <span class="s1">&#39;gwei&#39;</span><span class="p">),</span>
<span class="s1">&#39;nonce&#39;</span><span class="p">:</span> <span class="n">nonce</span><span class="p">,</span>
<span class="p">})</span>
<span class="n">signed_tx</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">signTransaction</span><span class="p">(</span><span class="n">transaction</span><span class="p">,</span> <span class="n">private_key</span><span class="p">)</span>
<span class="n">txn_hash</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">eth</span><span class="o">.</span><span class="n">sendRawTransaction</span><span class="p">(</span><span class="n">signed_tx</span><span class="o">.</span><span class="n">rawTransaction</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;txn_hash:&#39;</span><span class="p">,</span> <span class="n">Web3</span><span class="o">.</span><span class="n">toHex</span><span class="p">(</span><span class="n">txn_hash</span><span class="p">))</span>
<span class="k">return</span> <span class="n">Web3</span><span class="o">.</span><span class="n">toHex</span><span class="p">(</span><span class="n">txn_hash</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="s1">&#39;&#39;</span>
<span class="k">def</span> <span class="nf">allowance</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">spender</span><span class="p">,</span> <span class="n">owner</span><span class="p">):</span>
<span class="n">spender</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">spender</span><span class="p">)</span>
<span class="n">l_address</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">toChecksumAddress</span><span class="p">(</span><span class="n">owner</span><span class="p">)</span>
<span class="n">blance</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">contract</span><span class="o">.</span><span class="n">functions</span><span class="o">.</span><span class="n">allowance</span><span class="p">(</span><span class="n">l_address</span><span class="p">,</span> <span class="n">spender</span><span class="p">)</span><span class="o">.</span><span class="n">call</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">fromWei</span><span class="p">(</span><span class="n">blance</span><span class="p">,</span> <span class="s1">&#39;ether&#39;</span><span class="p">))</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">web3</span><span class="o">.</span><span class="n">fromWei</span><span class="p">(</span><span class="n">blance</span><span class="p">,</span> <span class="s1">&#39;ether&#39;</span><span class="p">)</span>
</code></pre></td></tr></table>
</div>
</div><p>提供注册,注册完毕获取Oops代币判断是否获得flag 并购买。部分代码如下:</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span><span class="lnt">28
</span><span class="lnt">29
</span><span class="lnt">30
</span><span class="lnt">31
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="k">class</span> <span class="nc">Oops</span><span class="p">(</span><span class="n">APIView</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">request</span><span class="p">):</span>
<span class="n">ret</span> <span class="o">=</span> <span class="p">{}</span>
<span class="nb">print</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">query_params</span><span class="p">)</span>
<span class="n">address</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">query_params</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;Oops&#39;</span><span class="p">)</span>
<span class="c1"># address = request.user.</span>
<span class="k">if</span> <span class="n">address</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span>
<span class="kn">from</span> <span class="nn">user.libs.contract.ContractHandler</span> <span class="kn">import</span> <span class="n">ContractHandler</span>
<span class="n">test</span> <span class="o">=</span> <span class="n">ContractHandler</span><span class="p">()</span>
<span class="n">Oops</span> <span class="o">=</span> <span class="n">test</span><span class="o">.</span><span class="n">getAccountOops</span><span class="p">(</span><span class="n">address</span><span class="p">)</span>
<span class="c1"># flag{}</span>
<span class="n">content</span> <span class="o">=</span> <span class="s2">&#34;hello&#34;</span>
<span class="k">if</span> <span class="n">Oops</span> <span class="o">&gt;</span> <span class="mi">500000000</span><span class="p">:</span>
<span class="c1"># 回收相关flag</span>
<span class="n">user</span> <span class="o">=</span> <span class="n">CharinUser</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">eth_address</span><span class="o">=</span><span class="n">address</span><span class="p">)</span>
<span class="kn">from</span> <span class="nn">user.libs.contract.ContractHandler</span> <span class="kn">import</span> <span class="n">ContractHandler</span>
<span class="n">test</span> <span class="o">=</span> <span class="n">ContractHandler</span><span class="p">()</span>
<span class="kn">from</span> <span class="nn">ctf.config</span> <span class="kn">import</span> <span class="n">address</span>
<span class="nb">print</span><span class="p">(</span><span class="n">user</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
<span class="n">test</span><span class="o">.</span><span class="n">transformer</span><span class="p">(</span><span class="n">from_address</span><span class="o">=</span><span class="n">user</span><span class="o">.</span><span class="n">eth_address</span><span class="p">,</span> <span class="n">to_address</span><span class="o">=</span><span class="n">address</span><span class="p">,</span> <span class="n">amount</span><span class="o">=</span><span class="mi">500000000</span><span class="p">,</span> <span class="n">private_key</span><span class="o">=</span><span class="n">user</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
<span class="c1"># // flag is here</span>
<span class="kn">from</span> <span class="nn">flag</span> <span class="kn">import</span> <span class="n">flag</span>
<span class="n">user</span><span class="o">.</span><span class="n">flag</span> <span class="o">=</span> <span class="n">flag</span>
<span class="n">user</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
<span class="n">_ret</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;Oops&#39;</span><span class="p">:</span> <span class="n">Oops</span>
<span class="p">}</span>
<span class="k">return</span> <span class="n">Response</span><span class="p">(</span><span class="n">_ret</span><span class="p">)</span>
</code></pre></td></tr></table>
</div>
</div><h3 id="前端">前端</h3>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt"> 10
</span><span class="lnt"> 11
</span><span class="lnt"> 12
</span><span class="lnt"> 13
</span><span class="lnt"> 14
</span><span class="lnt"> 15
</span><span class="lnt"> 16
</span><span class="lnt"> 17
</span><span class="lnt"> 18
</span><span class="lnt"> 19
</span><span class="lnt"> 20
</span><span class="lnt"> 21
</span><span class="lnt"> 22
</span><span class="lnt"> 23
</span><span class="lnt"> 24
</span><span class="lnt"> 25
</span><span class="lnt"> 26
</span><span class="lnt"> 27
</span><span class="lnt"> 28
</span><span class="lnt"> 29
</span><span class="lnt"> 30
</span><span class="lnt"> 31
</span><span class="lnt"> 32
</span><span class="lnt"> 33
</span><span class="lnt"> 34
</span><span class="lnt"> 35
</span><span class="lnt"> 36
</span><span class="lnt"> 37
</span><span class="lnt"> 38
</span><span class="lnt"> 39
</span><span class="lnt"> 40
</span><span class="lnt"> 41
</span><span class="lnt"> 42
</span><span class="lnt"> 43
</span><span class="lnt"> 44
</span><span class="lnt"> 45
</span><span class="lnt"> 46
</span><span class="lnt"> 47
</span><span class="lnt"> 48
</span><span class="lnt"> 49
</span><span class="lnt"> 50
</span><span class="lnt"> 51
</span><span class="lnt"> 52
</span><span class="lnt"> 53
</span><span class="lnt"> 54
</span><span class="lnt"> 55
</span><span class="lnt"> 56
</span><span class="lnt"> 57
</span><span class="lnt"> 58
</span><span class="lnt"> 59
</span><span class="lnt"> 60
</span><span class="lnt"> 61
</span><span class="lnt"> 62
</span><span class="lnt"> 63
</span><span class="lnt"> 64
</span><span class="lnt"> 65
</span><span class="lnt"> 66
</span><span class="lnt"> 67
</span><span class="lnt"> 68
</span><span class="lnt"> 69
</span><span class="lnt"> 70
</span><span class="lnt"> 71
</span><span class="lnt"> 72
</span><span class="lnt"> 73
</span><span class="lnt"> 74
</span><span class="lnt"> 75
</span><span class="lnt"> 76
</span><span class="lnt"> 77
</span><span class="lnt"> 78
</span><span class="lnt"> 79
</span><span class="lnt"> 80
</span><span class="lnt"> 81
</span><span class="lnt"> 82
</span><span class="lnt"> 83
</span><span class="lnt"> 84
</span><span class="lnt"> 85
</span><span class="lnt"> 86
</span><span class="lnt"> 87
</span><span class="lnt"> 88
</span><span class="lnt"> 89
</span><span class="lnt"> 90
</span><span class="lnt"> 91
</span><span class="lnt"> 92
</span><span class="lnt"> 93
</span><span class="lnt"> 94
</span><span class="lnt"> 95
</span><span class="lnt"> 96
</span><span class="lnt"> 97
</span><span class="lnt"> 98
</span><span class="lnt"> 99
</span><span class="lnt">100
</span><span class="lnt">101
</span><span class="lnt">102
</span><span class="lnt">103
</span><span class="lnt">104
</span><span class="lnt">105
</span><span class="lnt">106
</span><span class="lnt">107
</span><span class="lnt">108
</span><span class="lnt">109
</span><span class="lnt">110
</span><span class="lnt">111
</span><span class="lnt">112
</span><span class="lnt">113
</span><span class="lnt">114
</span><span class="lnt">115
</span><span class="lnt">116
</span><span class="lnt">117
</span><span class="lnt">118
</span><span class="lnt">119
</span><span class="lnt">120
</span><span class="lnt">121
</span><span class="lnt">122
</span><span class="lnt">123
</span><span class="lnt">124
</span><span class="lnt">125
</span><span class="lnt">126
</span><span class="lnt">127
</span><span class="lnt">128
</span><span class="lnt">129
</span><span class="lnt">130
</span><span class="lnt">131
</span><span class="lnt">132
</span><span class="lnt">133
</span><span class="lnt">134
</span><span class="lnt">135
</span><span class="lnt">136
</span><span class="lnt">137
</span><span class="lnt">138
</span><span class="lnt">139
</span><span class="lnt">140
</span><span class="lnt">141
</span><span class="lnt">142
</span><span class="lnt">143
</span><span class="lnt">144
</span><span class="lnt">145
</span><span class="lnt">146
</span><span class="lnt">147
</span><span class="lnt">148
</span><span class="lnt">149
</span><span class="lnt">150
</span><span class="lnt">151
</span><span class="lnt">152
</span><span class="lnt">153
</span><span class="lnt">154
</span><span class="lnt">155
</span><span class="lnt">156
</span><span class="lnt">157
</span><span class="lnt">158
</span><span class="lnt">159
</span><span class="lnt">160
</span><span class="lnt">161
</span><span class="lnt">162
</span><span class="lnt">163
</span><span class="lnt">164
</span><span class="lnt">165
</span><span class="lnt">166
</span><span class="lnt">167
</span><span class="lnt">168
</span><span class="lnt">169
</span><span class="lnt">170
</span><span class="lnt">171
</span><span class="lnt">172
</span><span class="lnt">173
</span><span class="lnt">174
</span><span class="lnt">175
</span><span class="lnt">176
</span><span class="lnt">177
</span><span class="lnt">178
</span><span class="lnt">179
</span><span class="lnt">180
</span><span class="lnt">181
</span><span class="lnt">182
</span><span class="lnt">183
</span><span class="lnt">184
</span><span class="lnt">185
</span><span class="lnt">186
</span><span class="lnt">187