CTFd with Whale搭建过程记录【避坑指南】
jerem1ah Lv4

CTFd with Whale搭建过程记录【避坑指南】

参考赵师傅:https://www.zhaoj.in/read-6333.html#_Direct_Frp

避坑指南:https://blog.csdn.net/weixin_51797394/article/details/127826913

1.前言

自己在配置CTFd的过程中遇到了n多问题,经历了很多次失败,历时2个多月,有空了还是想继续尝试一下,最后还是成功配置出来了。首先是参考的赵师傅博客搭建,由于讲述的太过于简单很多东西都一概而过,就去查看docker swarm和docker-compose以及frp的使用去了,就没然后了。其次,是想到可以直接拿来别人搭建好的带CTFd的docker镜像直接来使用,pull之后很兴奋确实可以访问登录界面了,但是失望的是只有静态内容,配置不了动态web靶机,最多就是misc和re的专场,这怎么能行,于是又去找是否有直接带CTFd with whale的docker镜像,search了一下,还真有两个。pull来之后只有一个可以访问登录界面,whale的配置面板也不同,估计不太能配置的出来。于是又一条路走到了尽头。最后,也就只有把docker swarm和docker-compose以及frp等相关内容搞清楚之后再来看赵师傅的博客去搭建CTFd with whale。

img

image-20231023233321113

2.准备过程

学习如下工具的使用:

1
2
3
4
docker
docker-compose
docker swarm
frp

3.具体步骤【单机direct】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sudo su

cd /home
git clone -b single https://github.com/glzjin/CTFd.git
cd CTFd/frp
vim frpc.ini #修改token 赵总博客上强调的随机的意思我猜可能就是让你随意改一改
vim frps.ini #client和server的toekn应该一致
git submodule update --init

docker swarm init
docker node ls
docker node update --label-add name=linux-1 [id]

docker-compose up -d

以上基本上就是赵总博客的全部安装步骤,但是坑是真的多。下面一一介绍:

可能出现的问题:

1.网速慢直接去github上下载压缩包自己解压,然后拖到机器里。【这样子要注意下载单机模式的,最好去glzjin下载】

image-20221224154314354

2.关于编辑frps.ini和frpc.ini的问题【他强调的随机的意思就是不要和他一样自己随机一个吧我觉得,但是frps和frpc的token一定要对应】

3.接着docker-compose up -d就会遇到报python的问题【这个注意把Dockerfile中的 python 和 python-dev改为python3和python3-dev】

image-20221224155013753

4.接着重新docker-compose 遇到ctfd_frpc_containers报错

image-20221224155145155

解决办法:

1
2
docker network rm ctfd_frp_containers
docker network create --driver overlay --attachable ctfd_frp_containers

5.然后重新docker-compose 遇到ctf_ctfd活不起来状态 一直是restart状态

docker logs [ctfd_ctfd 对应id]

发现jinjia2报错,回头修改requirements.txt文件添加一些内容,并且修改一个版本才过去【真的会寄】

1
2
3
jinja2==2.11.3 #添加
gevent==21.12.0 #修改版本
markupsafe==1.1.1 #添加

重新运行docker-compose之前记得先stop和rm当前存活的容器,并且rmi对应的四个镜像

1
2
3
4
5
6
7
#对5个容器和4个镜像执行下面操作
docker ps -a
docker stop [id]
dcoker rm [id]

docker images
docker rmi [id]

然后重新docker-compose如果还不行就docker logs [id]看这个容器为啥up不了,查找原因。

成功运行的状态如下:

image-20221224160132703

4.插件whale配置界面

按照glzjin的文章直接配置就好,非常详细了

image-20221224161053312

5.结语

接着可以开心的耍啦!有问题欢迎联系2796925695@qq.com

接下来如何使用docker出一道CTF题目,参考:https://www.v0n.top/2020/05/01/%E5%A6%82%E4%BD%95%E6%AD%A3%E7%A1%AE%E4%BD%BF%E7%94%A8Docker%E5%87%BA%E4%B8%80%E9%81%93CTF%E9%A2%98%E7%9B%AE/

参考好文:https://up-wind.github.io/2021/05/28/CTFd/

6.后续暴漏的问题

1.frpc 报错 172.1.0.4连接不了【问题出现在项目down之后 再up的时候可能会报这个错】

image-20230101191709780

经过一番折腾,证明了172.1.0.1才是正确配置。赵师傅图上配置的172.1.0.4可能是误了,但是下面给出的代码是正确的。

具体可以分析docker-compose文件内容,就可以知道应该是172.1.0.1。

2.记一个找了3天的一个动态靶机启动成功访问不了的问题【问题由自己错误操作删了本地的frpc.ini代码 按照初始化配置发生的】

image-20230101193951554

1
2
3
4
5
6
7
8
9
10
11
#这个应该是正确配置

[common]
token = randomme
server_addr = 172.1.0.1
server_port = 6490
pool_count = 200
tls_enable = true

admin_addr = 172.1.0.3
admin_port = 7400
1
2
3
4
5
6
7
8
#我在删了之后一直按下面的代码配置的,没有意识到错误

[common]
token = randomme
server_addr = 172.1.0.1
server_port = 6490
pool_count = 200
tls_enable = true

报错是由ctfd_ctfd_1报错的,原因是frp这个网络中ctfd_ctfd地址为172.1.0.2连不上172.1.0.3的地址。

一直在查看日志为什么连不上,之前还好好的突然出错,还分析了docker-compose的网络结构,也是没发现原因,然后重新又在另一个文件配置了一个CTFd,对比发现出错的呢个是因为frpc根本没写入靶机的端口地址等信息,那必然访问不了靶机。错误就在ctfd_ctfd_1这个容器无法往frpc这个容器写入数据,然后报错是172.1.0.3:7400无法连接。

最后脑子一抽才意识到是7400根本没这个端口怎么会连接成功,最后看了一下加了7400但是多了一个admin_user和admin_pwd删了试一试,!结果成功啦!排错了三天才找到不容易,本来都想放弃了,学一段docker-compose文件之后再来试试,结果惊喜就来了。

小结:不是重装CTFd解决的问题的问题还是有些兴奋的。

2.本地kali报错frpc【盲猜可能是本地的原因,暂时不需要搁置一下,有空来解决】

image-20221231133749024

7.二次开发

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
.
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CTFd
│   ├── admin
│   │   ├── challenges.py
│   │   ├── __init__.py
│   │   ├── notifications.py
│   │   ├── pages.py
│   │   ├── scoreboard.py
│   │   ├── statistics.py
│   │   ├── submissions.py
│   │   ├── teams.py
│   │   └── users.py
│   ├── api
│   │   ├── __init__.py
│   │   └── v1
│   │   ├── awards.py
│   │   ├── challenges.py
│   │   ├── config.py
│   │   ├── files.py
│   │   ├── flags.py
│   │   ├── hints.py
│   │   ├── __init__.py
│   │   ├── notifications.py
│   │   ├── pages.py
│   │   ├── scoreboard.py
│   │   ├── statistics
│   │   │   ├── challenges.py
│   │   │   ├── __init__.py
│   │   │   ├── submissions.py
│   │   │   ├── teams.py
│   │   │   └── users.py
│   │   ├── submissions.py
│   │   ├── tags.py
│   │   ├── teams.py
│   │   ├── tokens.py
│   │   ├── unlocks.py
│   │   └── users.py
│   ├── auth.py
│   ├── cache
│   │   └── __init__.py
│   ├── challenges.py
│   ├── config.py
│   ├── errors.py
│   ├── events
│   │   └── __init__.py
│   ├── exceptions
│   │   └── __init__.py
│   ├── __init__.py
│   ├── logs
│   ├── models
│   │   └── __init__.py
│   ├── plugins
│   │   ├── challenges
│   │   │   ├── assets
│   │   │   │   ├── create.html
│   │   │   │   ├── create.js
│   │   │   │   ├── update.html
│   │   │   │   ├── update.js
│   │   │   │   ├── view.html
│   │   │   │   └── view.js
│   │   │   └── __init__.py
│   │   ├── ctfd-whale
│   │   │   ├── assets
│   │   │   │   ├── config.js
│   │   │   │   ├── containers.js
│   │   │   │   ├── create.html
│   │   │   │   ├── create.js
│   │   │   │   ├── update.html
│   │   │   │   ├── update.js
│   │   │   │   ├── view.html
│   │   │   │   └── view.js
│   │   │   ├── CHANGELOG.md
│   │   │   ├── config.json
│   │   │   ├── control_utils.py
│   │   │   ├── db_utils.py
│   │   │   ├── docker_utils.py
│   │   │   ├── frp_utils.py
│   │   │   ├── __init__.py
│   │   │   ├── LICENSE
│   │   │   ├── models.py
│   │   │   ├── README.md
│   │   │   ├── redis_utils.py
│   │   │   ├── requirements.txt
│   │   │   └── templates
│   │   │   ├── config.html
│   │   │   ├── configs
│   │   │   │   └── settings.html
│   │   │   └── containers.html
│   │   ├── dynamic_challenges
│   │   │   ├── assets
│   │   │   │   ├── create.html
│   │   │   │   ├── create.js
│   │   │   │   ├── update.html
│   │   │   │   ├── update.js
│   │   │   │   ├── view.html
│   │   │   │   └── view.js
│   │   │   ├── function.png
│   │   │   ├── __init__.py
│   │   │   └── README.md
│   │   ├── flags
│   │   │   ├── assets
│   │   │   │   ├── regex
│   │   │   │   │   ├── create.html
│   │   │   │   │   └── edit.html
│   │   │   │   └── static
│   │   │   │   ├── create.html
│   │   │   │   └── edit.html
│   │   │   └── __init__.py
│   │   └── __init__.py
│   ├── schemas
│   │   ├── awards.py
│   │   ├── challenges.py
│   │   ├── config.py
│   │   ├── files.py
│   │   ├── flags.py
│   │   ├── hints.py
│   │   ├── __init__.py
│   │   ├── notifications.py
│   │   ├── pages.py
│   │   ├── submissions.py
│   │   ├── tags.py
│   │   ├── teams.py
│   │   ├── tokens.py
│   │   ├── unlocks.py
│   │   └── users.py
│   ├── scoreboard.py
│   ├── teams.py
│   ├── themes
│   │   ├── admin
│   │   │   ├── assets
│   │   │   │   ├── css
│   │   │   │   │   ├── admin.scss
│   │   │   │   │   ├── challenge-board.scss
│   │   │   │   │   ├── codemirror.scss
│   │   │   │   │   └── includes
│   │   │   │   │   └── sticky-footer.css
│   │   │   │   └── js
│   │   │   │   ├── challenges
│   │   │   │   │   ├── challenge.js
│   │   │   │   │   ├── files.js
│   │   │   │   │   ├── flags.js
│   │   │   │   │   ├── hints.js
│   │   │   │   │   ├── new.js
│   │   │   │   │   ├── requirements.js
│   │   │   │   │   └── tags.js
│   │   │   │   ├── pages
│   │   │   │   │   ├── challenge.js
│   │   │   │   │   ├── challenges.js
│   │   │   │   │   ├── configs.js
│   │   │   │   │   ├── editor.js
│   │   │   │   │   ├── events.js
│   │   │   │   │   ├── main.js
│   │   │   │   │   ├── notifications.js
│   │   │   │   │   ├── pages.js
│   │   │   │   │   ├── reset.js
│   │   │   │   │   ├── scoreboard.js
│   │   │   │   │   ├── statistics.js
│   │   │   │   │   ├── style.js
│   │   │   │   │   ├── submissions.js
│   │   │   │   │   ├── team.js
│   │   │   │   │   ├── teams.js
│   │   │   │   │   ├── user.js
│   │   │   │   │   └── users.js
│   │   │   │   ├── styles.js
│   │   │   │   └── templates
│   │   │   │   └── admin-flags-table.njk
│   │   │   ├── static
│   │   │   │   ├── css
│   │   │   │   │   ├── admin.dev.css
│   │   │   │   │   ├── admin.min.css
│   │   │   │   │   ├── challenge-board.dev.css
│   │   │   │   │   ├── challenge-board.min.css
│   │   │   │   │   ├── codemirror.dev.css
│   │   │   │   │   └── codemirror.min.css
│   │   │   │   └── js
│   │   │   │   ├── core.dev.js
│   │   │   │   ├── core.min.js
│   │   │   │   ├── graphs.dev.js
│   │   │   │   ├── graphs.min.js
│   │   │   │   ├── helpers.dev.js
│   │   │   │   ├── helpers.min.js
│   │   │   │   ├── pages
│   │   │   │   │   ├── challenge.dev.js
│   │   │   │   │   ├── challenge.min.js
│   │   │   │   │   ├── configs.dev.js
│   │   │   │   │   ├── configs.min.js
│   │   │   │   │   ├── editor.dev.js
│   │   │   │   │   ├── editor.min.js
│   │   │   │   │   ├── main.dev.js
│   │   │   │   │   ├── main.min.js
│   │   │   │   │   ├── notifications.dev.js
│   │   │   │   │   ├── notifications.min.js
│   │   │   │   │   ├── pages.dev.js
│   │   │   │   │   ├── pages.min.js
│   │   │   │   │   ├── reset.dev.js
│   │   │   │   │   ├── reset.min.js
│   │   │   │   │   ├── scoreboard.dev.js
│   │   │   │   │   ├── scoreboard.min.js
│   │   │   │   │   ├── statistics.dev.js
│   │   │   │   │   ├── statistics.min.js
│   │   │   │   │   ├── submissions.dev.js
│   │   │   │   │   ├── submissions.min.js
│   │   │   │   │   ├── team.dev.js
│   │   │   │   │   ├── team.min.js
│   │   │   │   │   ├── teams.dev.js
│   │   │   │   │   ├── teams.min.js
│   │   │   │   │   ├── user.dev.js
│   │   │   │   │   ├── user.min.js
│   │   │   │   │   ├── users.dev.js
│   │   │   │   │   └── users.min.js
│   │   │   │   ├── plotly.bundle.dev.js
│   │   │   │   ├── plotly.bundle.min.js
│   │   │   │   ├── vendor.bundle.dev.js
│   │   │   │   └── vendor.bundle.min.js
│   │   │   └── templates
│   │   │   ├── base.html
│   │   │   ├── challenges
│   │   │   │   ├── challenge.html
│   │   │   │   ├── challenges.html
│   │   │   │   └── new.html
│   │   │   ├── config.html
│   │   │   ├── configs
│   │   │   │   ├── accounts.html
│   │   │   │   ├── appearance.html
│   │   │   │   ├── backup.html
│   │   │   │   ├── email.html
│   │   │   │   ├── mlc.html
│   │   │   │   ├── settings.html
│   │   │   │   └── time.html
│   │   │   ├── editor.html
│   │   │   ├── integrations.html
│   │   │   ├── modals
│   │   │   │   ├── awards
│   │   │   │   │   └── create.html
│   │   │   │   ├── challenges
│   │   │   │   │   ├── challenges.html
│   │   │   │   │   ├── files.html
│   │   │   │   │   ├── flags.html
│   │   │   │   │   ├── hints.html
│   │   │   │   │   ├── requirements.html
│   │   │   │   │   ├── solves.html
│   │   │   │   │   └── tags.html
│   │   │   │   ├── flags
│   │   │   │   │   ├── create.html
│   │   │   │   │   └── edit.html
│   │   │   │   ├── hints
│   │   │   │   │   └── edit.html
│   │   │   │   ├── mail
│   │   │   │   │   └── send.html
│   │   │   │   ├── teams
│   │   │   │   │   ├── captain.html
│   │   │   │   │   ├── create.html
│   │   │   │   │   └── edit.html
│   │   │   │   └── users
│   │   │   │   ├── create.html
│   │   │   │   └── edit.html
│   │   │   ├── notifications.html
│   │   │   ├── page.html
│   │   │   ├── pages.html
│   │   │   ├── reset.html
│   │   │   ├── scoreboard.html
│   │   │   ├── statistics.html
│   │   │   ├── submissions.html
│   │   │   ├── teams
│   │   │   │   ├── new.html
│   │   │   │   ├── team.html
│   │   │   │   └── teams.html
│   │   │   └── users
│   │   │   ├── new.html
│   │   │   ├── user.html
│   │   │   └── users.html
│   │   ├── core
│   │   │   ├── assets
│   │   │   │   ├── css
│   │   │   │   │   ├── challenge-board.scss
│   │   │   │   │   ├── codemirror.scss
│   │   │   │   │   ├── core.scss
│   │   │   │   │   ├── fonts.scss
│   │   │   │   │   ├── includes
│   │   │   │   │   │   ├── award-icons.scss
│   │   │   │   │   │   ├── flag-icons.scss
│   │   │   │   │   │   ├── jumbotron.css
│   │   │   │   │   │   └── sticky-footer.css
│   │   │   │   │   └── main.scss
│   │   │   │   └── js
│   │   │   │   ├── api.js
│   │   │   │   ├── config.js
│   │   │   │   ├── CTFd.js
│   │   │   │   ├── events.js
│   │   │   │   ├── ezq.js
│   │   │   │   ├── fetch.js
│   │   │   │   ├── graphs.js
│   │   │   │   ├── helpers.js
│   │   │   │   ├── pages
│   │   │   │   │   ├── challenges.js
│   │   │   │   │   ├── events.js
│   │   │   │   │   ├── main.js
│   │   │   │   │   ├── notifications.js
│   │   │   │   │   ├── scoreboard.js
│   │   │   │   │   ├── settings.js
│   │   │   │   │   ├── setup.js
│   │   │   │   │   ├── stats.js
│   │   │   │   │   ├── style.js
│   │   │   │   │   └── teams
│   │   │   │   │   └── private.js
│   │   │   │   ├── patch.js
│   │   │   │   ├── styles.js
│   │   │   │   ├── times.js
│   │   │   │   └── utils.js
│   │   │   ├── static
│   │   │   │   ├── css
│   │   │   │   │   ├── challenge-board.dev.css
│   │   │   │   │   ├── challenge-board.min.css
│   │   │   │   │   ├── codemirror.dev.css
│   │   │   │   │   ├── codemirror.min.css
│   │   │   │   │   ├── core.dev.css
│   │   │   │   │   ├── core.min.css
│   │   │   │   │   ├── fonts.dev.css
│   │   │   │   │   ├── fonts.min.css
│   │   │   │   │   ├── main.dev.css
│   │   │   │   │   └── main.min.css
│   │   │   │   ├── fonts
│   │   │   │   │   ├── fa-brands-400.eot
│   │   │   │   │   ├── fa-brands-400.svg
│   │   │   │   │   ├── fa-brands-400.ttf
│   │   │   │   │   ├── fa-brands-400.woff
│   │   │   │   │   ├── fa-brands-400.woff2
│   │   │   │   │   ├── fa-regular-400.eot
│   │   │   │   │   ├── fa-regular-400.svg
│   │   │   │   │   ├── fa-regular-400.ttf
│   │   │   │   │   ├── fa-regular-400.woff
│   │   │   │   │   ├── fa-regular-400.woff2
│   │   │   │   │   ├── fa-solid-900.eot
│   │   │   │   │   ├── fa-solid-900.svg
│   │   │   │   │   ├── fa-solid-900.ttf
│   │   │   │   │   ├── fa-solid-900.woff
│   │   │   │   │   ├── fa-solid-900.woff2
│   │   │   │   │   ├── fontawesome-webfont.eot
│   │   │   │   │   ├── fontawesome-webfont.svg
│   │   │   │   │   ├── fontawesome-webfont.ttf
│   │   │   │   │   ├── fontawesome-webfont.woff
│   │   │   │   │   ├── fontawesome-webfont.woff2
│   │   │   │   │   ├── lato-latin-100italic.woff
│   │   │   │   │   ├── lato-latin-100italic.woff2
│   │   │   │   │   ├── lato-latin-100.woff
│   │   │   │   │   ├── lato-latin-100.woff2
│   │   │   │   │   ├── lato-latin-300italic.woff
│   │   │   │   │   ├── lato-latin-300italic.woff2
│   │   │   │   │   ├── lato-latin-300.woff
│   │   │   │   │   ├── lato-latin-300.woff2
│   │   │   │   │   ├── lato-latin-400italic.woff
│   │   │   │   │   ├── lato-latin-400italic.woff2
│   │   │   │   │   ├── lato-latin-400.woff
│   │   │   │   │   ├── lato-latin-400.woff2
│   │   │   │   │   ├── lato-latin-700italic.woff
│   │   │   │   │   ├── lato-latin-700italic.woff2
│   │   │   │   │   ├── lato-latin-700.woff
│   │   │   │   │   ├── lato-latin-700.woff2
│   │   │   │   │   ├── lato-latin-900italic.woff
│   │   │   │   │   ├── lato-latin-900italic.woff2
│   │   │   │   │   ├── lato-latin-900.woff
│   │   │   │   │   ├── lato-latin-900.woff2
│   │   │   │   │   ├── raleway-latin-100italic.woff
│   │   │   │   │   ├── raleway-latin-100italic.woff2
│   │   │   │   │   ├── raleway-latin-100.woff
│   │   │   │   │   ├── raleway-latin-100.woff2
│   │   │   │   │   ├── raleway-latin-200italic.woff
│   │   │   │   │   ├── raleway-latin-200italic.woff2
│   │   │   │   │   ├── raleway-latin-200.woff
│   │   │   │   │   ├── raleway-latin-200.woff2
│   │   │   │   │   ├── raleway-latin-300italic.woff
│   │   │   │   │   ├── raleway-latin-300italic.woff2
│   │   │   │   │   ├── raleway-latin-300.woff
│   │   │   │   │   ├── raleway-latin-300.woff2
│   │   │   │   │   ├── raleway-latin-400italic.woff
│   │   │   │   │   ├── raleway-latin-400italic.woff2
│   │   │   │   │   ├── raleway-latin-400.woff
│   │   │   │   │   ├── raleway-latin-400.woff2
│   │   │   │   │   ├── raleway-latin-500italic.woff
│   │   │   │   │   ├── raleway-latin-500italic.woff2
│   │   │   │   │   ├── raleway-latin-500.woff
│   │   │   │   │   ├── raleway-latin-500.woff2
│   │   │   │   │   ├── raleway-latin-600italic.woff
│   │   │   │   │   ├── raleway-latin-600italic.woff2
│   │   │   │   │   ├── raleway-latin-600.woff
│   │   │   │   │   ├── raleway-latin-600.woff2
│   │   │   │   │   ├── raleway-latin-700italic.woff
│   │   │   │   │   ├── raleway-latin-700italic.woff2
│   │   │   │   │   ├── raleway-latin-700.woff
│   │   │   │   │   ├── raleway-latin-700.woff2
│   │   │   │   │   ├── raleway-latin-800italic.woff
│   │   │   │   │   ├── raleway-latin-800italic.woff2
│   │   │   │   │   ├── raleway-latin-800.woff
│   │   │   │   │   ├── raleway-latin-800.woff2
│   │   │   │   │   ├── raleway-latin-900italic.woff
│   │   │   │   │   ├── raleway-latin-900italic.woff2
│   │   │   │   │   ├── raleway-latin-900.woff
│   │   │   │   │   └── raleway-latin-900.woff2
│   │   │   │   ├── img
│   │   │   │   │   ├── ctfd.ai
│   │   │   │   │   ├── ctfd.svg
│   │   │   │   │   ├── ctfd_transfer.svg
│   │   │   │   │   ├── favicon.ico
│   │   │   │   │   ├── logo_old.png
│   │   │   │   │   ├── logo.png
│   │   │   │   │   └── scoreboard.png
│   │   │   │   ├── js
│   │   │   │   │   ├── core.dev.js
│   │   │   │   │   ├── core.min.js
│   │   │   │   │   ├── helpers.dev.js
│   │   │   │   │   ├── helpers.min.js
│   │   │   │   │   ├── pages
│   │   │   │   │   │   ├── challenges.dev.js
│   │   │   │   │   │   ├── challenges.min.js
│   │   │   │   │   │   ├── main.dev.js
│   │   │   │   │   │   ├── main.min.js
│   │   │   │   │   │   ├── notifications.dev.js
│   │   │   │   │   │   ├── notifications.min.js
│   │   │   │   │   │   ├── scoreboard.dev.js
│   │   │   │   │   │   ├── scoreboard.min.js
│   │   │   │   │   │   ├── settings.dev.js
│   │   │   │   │   │   ├── settings.min.js
│   │   │   │   │   │   ├── setup.dev.js
│   │   │   │   │   │   ├── setup.min.js
│   │   │   │   │   │   ├── stats.dev.js
│   │   │   │   │   │   ├── stats.min.js
│   │   │   │   │   │   └── teams
│   │   │   │   │   │   ├── private.dev.js
│   │   │   │   │   │   └── private.min.js
│   │   │   │   │   ├── plotly.bundle.dev.js
│   │   │   │   │   ├── plotly.bundle.min.js
│   │   │   │   │   ├── vendor.bundle.dev.js
│   │   │   │   │   └── vendor.bundle.min.js
│   │   │   │   └── sounds
│   │   │   │   ├── notification.mp3
│   │   │   │   └── notification.webm
│   │   │   └── templates
│   │   │   ├── base.html
│   │   │   ├── challenges.html
│   │   │   ├── confirm.html
│   │   │   ├── errors
│   │   │   │   ├── 403.html
│   │   │   │   ├── 404.html
│   │   │   │   ├── 429.html
│   │   │   │   ├── 500.html
│   │   │   │   └── 502.html
│   │   │   ├── login.html
│   │   │   ├── notifications.html
│   │   │   ├── page.html
│   │   │   ├── register.html
│   │   │   ├── reset_password.html
│   │   │   ├── scoreboard.html
│   │   │   ├── settings.html
│   │   │   ├── setup.html
│   │   │   ├── teams
│   │   │   │   ├── join_team.html
│   │   │   │   ├── new_team.html
│   │   │   │   ├── private.html
│   │   │   │   ├── public.html
│   │   │   │   ├── team_enrollment.html
│   │   │   │   └── teams.html
│   │   │   └── users
│   │   │   ├── private.html
│   │   │   ├── public.html
│   │   │   └── users.html
│   │   ├── neon
│   │   │   ├── LICENSE
│   │   │   ├── README.md
│   │   │   ├── screenshots
│   │   │   │   ├── index.png
│   │   │   │   └── login.png
│   │   │   ├── static
│   │   │   │   ├── css
│   │   │   │   │   └── style.dev.css
│   │   │   │   └── img
│   │   │   │   └── favicon.ico
│   │   │   └── templates
│   │   │   ├── base.html
│   │   │   ├── challenges.html
│   │   │   ├── components
│   │   │   │   └── navbar.html
│   │   │   ├── confirm.html
│   │   │   ├── errors
│   │   │   │   └── 404.html
│   │   │   ├── index.html
│   │   │   ├── login.html
│   │   │   ├── notifications.html
│   │   │   ├── register.html
│   │   │   ├── reset_password.html
│   │   │   ├── scoreboard.html
│   │   │   ├── settings.html
│   │   │   └── users
│   │   │   ├── private.html
│   │   │   ├── public.html
│   │   │   └── users.html
│   │   └── pixo
│   │   ├── assets
│   │   │   ├── css
│   │   │   │   ├── challenge-board.scss
│   │   │   │   ├── codemirror.scss
│   │   │   │   ├── core.scss
│   │   │   │   ├── fonts.scss
│   │   │   │   ├── includes
│   │   │   │   │   ├── award-icons.scss
│   │   │   │   │   ├── flag-icons.scss
│   │   │   │   │   ├── jumbotron.css
│   │   │   │   │   └── sticky-footer.css
│   │   │   │   └── main.scss
│   │   │   └── js
│   │   │   ├── api.js
│   │   │   ├── config.js
│   │   │   ├── CTFd.js
│   │   │   ├── events.js
│   │   │   ├── ezq.js
│   │   │   ├── fetch.js
│   │   │   ├── graphs.js
│   │   │   ├── helpers.js
│   │   │   ├── pages
│   │   │   │   ├── challenges.js
│   │   │   │   ├── events.js
│   │   │   │   ├── main.js
│   │   │   │   ├── notifications.js
│   │   │   │   ├── scoreboard.js
│   │   │   │   ├── settings.js
│   │   │   │   ├── setup.js
│   │   │   │   ├── stats.js
│   │   │   │   ├── style.js
│   │   │   │   └── teams
│   │   │   │   └── private.js
│   │   │   ├── patch.js
│   │   │   ├── styles.js
│   │   │   ├── times.js
│   │   │   └── utils.js
│   │   ├── static
│   │   │   ├── css
│   │   │   │   ├── challenge-board.dev.css
│   │   │   │   ├── challenge-board.min.css
│   │   │   │   ├── codemirror.dev.css
│   │   │   │   ├── codemirror.min.css
│   │   │   │   ├── core.dev.css
│   │   │   │   ├── core.min.css
│   │   │   │   ├── fonts.dev.css
│   │   │   │   ├── fonts.min.css
│   │   │   │   ├── main.dev.css
│   │   │   │   └── main.min.css
│   │   │   ├── fonts
│   │   │   │   ├── fa-brands-400.eot
│   │   │   │   ├── fa-brands-400.svg
│   │   │   │   ├── fa-brands-400.ttf
│   │   │   │   ├── fa-brands-400.woff
│   │   │   │   ├── fa-brands-400.woff2
│   │   │   │   ├── fa-regular-400.eot
│   │   │   │   ├── fa-regular-400.svg
│   │   │   │   ├── fa-regular-400.ttf
│   │   │   │   ├── fa-regular-400.woff
│   │   │   │   ├── fa-regular-400.woff2
│   │   │   │   ├── fa-solid-900.eot
│   │   │   │   ├── fa-solid-900.svg
│   │   │   │   ├── fa-solid-900.ttf
│   │   │   │   ├── fa-solid-900.woff
│   │   │   │   ├── fa-solid-900.woff2
│   │   │   │   ├── fontawesome-webfont.eot
│   │   │   │   ├── fontawesome-webfont.svg
│   │   │   │   ├── fontawesome-webfont.ttf
│   │   │   │   ├── fontawesome-webfont.woff
│   │   │   │   ├── fontawesome-webfont.woff2
│   │   │   │   ├── lato-latin-100italic.woff
│   │   │   │   ├── lato-latin-100italic.woff2
│   │   │   │   ├── lato-latin-100.woff
│   │   │   │   ├── lato-latin-100.woff2
│   │   │   │   ├── lato-latin-300italic.woff
│   │   │   │   ├── lato-latin-300italic.woff2
│   │   │   │   ├── lato-latin-300.woff
│   │   │   │   ├── lato-latin-300.woff2
│   │   │   │   ├── lato-latin-400italic.woff
│   │   │   │   ├── lato-latin-400italic.woff2
│   │   │   │   ├── lato-latin-400.woff
│   │   │   │   ├── lato-latin-400.woff2
│   │   │   │   ├── lato-latin-700italic.woff
│   │   │   │   ├── lato-latin-700italic.woff2
│   │   │   │   ├── lato-latin-700.woff
│   │   │   │   ├── lato-latin-700.woff2
│   │   │   │   ├── lato-latin-900italic.woff
│   │   │   │   ├── lato-latin-900italic.woff2
│   │   │   │   ├── lato-latin-900.woff
│   │   │   │   ├── lato-latin-900.woff2
│   │   │   │   ├── raleway-latin-100italic.woff
│   │   │   │   ├── raleway-latin-100italic.woff2
│   │   │   │   ├── raleway-latin-100.woff
│   │   │   │   ├── raleway-latin-100.woff2
│   │   │   │   ├── raleway-latin-200italic.woff
│   │   │   │   ├── raleway-latin-200italic.woff2
│   │   │   │   ├── raleway-latin-200.woff
│   │   │   │   ├── raleway-latin-200.woff2
│   │   │   │   ├── raleway-latin-300italic.woff
│   │   │   │   ├── raleway-latin-300italic.woff2
│   │   │   │   ├── raleway-latin-300.woff
│   │   │   │   ├── raleway-latin-300.woff2
│   │   │   │   ├── raleway-latin-400italic.woff
│   │   │   │   ├── raleway-latin-400italic.woff2
│   │   │   │   ├── raleway-latin-400.woff
│   │   │   │   ├── raleway-latin-400.woff2
│   │   │   │   ├── raleway-latin-500italic.woff
│   │   │   │   ├── raleway-latin-500italic.woff2
│   │   │   │   ├── raleway-latin-500.woff
│   │   │   │   ├── raleway-latin-500.woff2
│   │   │   │   ├── raleway-latin-600italic.woff
│   │   │   │   ├── raleway-latin-600italic.woff2
│   │   │   │   ├── raleway-latin-600.woff
│   │   │   │   ├── raleway-latin-600.woff2
│   │   │   │   ├── raleway-latin-700italic.woff
│   │   │   │   ├── raleway-latin-700italic.woff2
│   │   │   │   ├── raleway-latin-700.woff
│   │   │   │   ├── raleway-latin-700.woff2
│   │   │   │   ├── raleway-latin-800italic.woff
│   │   │   │   ├── raleway-latin-800italic.woff2
│   │   │   │   ├── raleway-latin-800.woff
│   │   │   │   ├── raleway-latin-800.woff2
│   │   │   │   ├── raleway-latin-900italic.woff
│   │   │   │   ├── raleway-latin-900italic.woff2
│   │   │   │   ├── raleway-latin-900.woff
│   │   │   │   └── raleway-latin-900.woff2
│   │   │   ├── img
│   │   │   │   ├── ctfd.ai
│   │   │   │   ├── ctfd.svg
│   │   │   │   ├── ctfd_transfer.svg
│   │   │   │   ├── favicon.ico
│   │   │   │   ├── logo_old.png
│   │   │   │   ├── logo.png
│   │   │   │   └── scoreboard.png
│   │   │   ├── js
│   │   │   │   ├── core.dev.js
│   │   │   │   ├── core.min.js
│   │   │   │   ├── helpers.dev.js
│   │   │   │   ├── helpers.min.js
│   │   │   │   ├── pages
│   │   │   │   │   ├── challenges.dev.js
│   │   │   │   │   ├── challenges.min.js
│   │   │   │   │   ├── main.dev.js
│   │   │   │   │   ├── main.min.js
│   │   │   │   │   ├── notifications.dev.js
│   │   │   │   │   ├── notifications.min.js
│   │   │   │   │   ├── scoreboard.dev.js
│   │   │   │   │   ├── scoreboard.min.js
│   │   │   │   │   ├── settings.dev.js
│   │   │   │   │   ├── settings.min.js
│   │   │   │   │   ├── setup.dev.js
│   │   │   │   │   ├── setup.min.js
│   │   │   │   │   ├── stats.dev.js
│   │   │   │   │   ├── stats.min.js
│   │   │   │   │   └── teams
│   │   │   │   │   ├── private.dev.js
│   │   │   │   │   └── private.min.js
│   │   │   │   ├── plotly.bundle.dev.js
│   │   │   │   ├── plotly.bundle.min.js
│   │   │   │   ├── vendor.bundle.dev.js
│   │   │   │   └── vendor.bundle.min.js
│   │   │   └── sounds
│   │   │   ├── notification.mp3
│   │   │   └── notification.webm
│   │   └── templates
│   │   ├── base.html
│   │   ├── challenges.html
│   │   ├── confirm.html
│   │   ├── errors
│   │   │   ├── 403.html
│   │   │   ├── 404.html
│   │   │   ├── 429.html
│   │   │   ├── 500.html
│   │   │   └── 502.html
│   │   ├── login.html
│   │   ├── notifications.html
│   │   ├── page.html
│   │   ├── register.html
│   │   ├── reset_password.html
│   │   ├── scoreboard.html
│   │   ├── settings.html
│   │   ├── setup.html
│   │   ├── teams
│   │   │   ├── join_team.html
│   │   │   ├── new_team.html
│   │   │   ├── private.html
│   │   │   ├── public.html
│   │   │   ├── team_enrollment.html
│   │   │   └── teams.html
│   │   └── users
│   │   ├── private.html
│   │   ├── public.html
│   │   └── users.html
│   ├── uploads
│   ├── users.py
│   ├── utils
│   │   ├── config
│   │   │   ├── __init__.py
│   │   │   ├── integrations.py
│   │   │   ├── pages.py
│   │   │   └── visibility.py
│   │   ├── countries
│   │   │   └── __init__.py
│   │   ├── crypto
│   │   │   └── __init__.py
│   │   ├── dates
│   │   │   └── __init__.py
│   │   ├── decorators
│   │   │   ├── __init__.py
│   │   │   ├── modes.py
│   │   │   └── visibility.py
│   │   ├── email
│   │   │   ├── __init__.py
│   │   │   ├── mailgun.py
│   │   │   └── smtp.py
│   │   ├── encoding
│   │   │   └── __init__.py
│   │   ├── events
│   │   │   └── __init__.py
│   │   ├── exports
│   │   │   └── __init__.py
│   │   ├── formatters
│   │   │   └── __init__.py
│   │   ├── helpers
│   │   │   └── __init__.py
│   │   ├── humanize
│   │   │   ├── __init__.py
│   │   │   └── numbers.py
│   │   ├── initialization
│   │   │   └── __init__.py
│   │   ├── __init__.py
│   │   ├── logging
│   │   │   └── __init__.py
│   │   ├── migrations
│   │   │   └── __init__.py
│   │   ├── modes
│   │   │   └── __init__.py
│   │   ├── notifications
│   │   │   └── __init__.py
│   │   ├── plugins
│   │   │   └── __init__.py
│   │   ├── scores
│   │   │   └── __init__.py
│   │   ├── security
│   │   │   ├── auth.py
│   │   │   ├── csrf.py
│   │   │   ├── __init__.py
│   │   │   ├── passwords.py
│   │   │   └── signing.py
│   │   ├── sessions
│   │   │   └── __init__.py
│   │   ├── updates
│   │   │   └── __init__.py
│   │   ├── uploads
│   │   │   ├── __init__.py
│   │   │   └── uploaders.py
│   │   ├── user
│   │   │   └── __init__.py
│   │   └── validators
│   │   └── __init__.py
│   └── views.py
├── development.txt
├── docker-compose.yml
├── docker-entrypoint.sh
├── Dockerfile
├── docs
│   ├── api.rst
│   ├── configuration.rst
│   ├── conf.py
│   ├── contributing.rst
│   ├── deployment.rst
│   ├── index.rst
│   ├── make.bat
│   ├── Makefile
│   ├── plugins.rst
│   ├── scoring.rst
│   └── themes.rst
├── export.py
├── frp
│   ├── frpc.ini
│   └── frps.ini
├── import.py
├── LICENSE
├── Makefile
├── manage.py
├── migrations
│   ├── 1_2_0_upgrade_2_0_0.py
│   ├── alembic.ini
│   ├── env.py
│   ├── README
│   ├── script.py.mako
│   └── versions
│   ├── 080d29b15cd3_add_tokens_table.py
│   ├── 1093835a1051_add_default_email_templates.py
│   ├── 4e4d5a9ea000_add_type_to_awards.py
│   ├── 8369118943a1_initial_revision.py
│   ├── a03403986a32_add_theme_code_injections_to_configs.py
│   ├── b295b033364d_add_ondelete_cascade_to_foreign_keys.py
│   └── b5551cd26764_add_captain_column_to_teams.py
├── package.json
├── populate.py
├── prepare.sh
├── README.md
├── requirements.txt
├── scripts
│   └── install_docker.sh
├── serve.py
├── setup.cfg
├── tests
│   ├── admin
│   │   ├── __init__.py
│   │   ├── test_challenges.py
│   │   ├── test_config.py
│   │   ├── test_export_csv.py
│   │   ├── test_notifications.py
│   │   ├── test_pages.py
│   │   ├── test_scoreboard.py
│   │   ├── test_statistics.py
│   │   ├── test_submissions.py
│   │   ├── test_teams.py
│   │   ├── test_users.py
│   │   └── test_views.py
│   ├── api
│   │   ├── __init__.py
│   │   ├── test_tokens.py
│   │   └── v1
│   │   ├── __init__.py
│   │   ├── teams
│   │   │   ├── __init__.py
│   │   │   ├── test_scoring.py
│   │   │   └── test_team_members.py
│   │   ├── test_awards.py
│   │   ├── test_challenges.py
│   │   ├── test_config.py
│   │   ├── test_csrf.py
│   │   ├── test_files.py
│   │   ├── test_flags.py
│   │   ├── test_hints.py
│   │   ├── test_notifications.py
│   │   ├── test_pages.py
│   │   ├── test_scoreboard.py
│   │   ├── test_submissions.py
│   │   ├── test_tags.py
│   │   ├── test_teams.py
│   │   ├── test_tokens.py
│   │   ├── test_users.py
│   │   ├── user
│   │   │   ├── __init__.py
│   │   │   ├── test_admin_access.py
│   │   │   ├── test_challenges.py
│   │   │   └── test_hints.py
│   │   └── users
│   │   ├── __init__.py
│   │   └── test_scoring.py
│   ├── challenges
│   │   ├── __init__.py
│   │   └── test_dynamic.py
│   ├── helpers.py
│   ├── __init__.py
│   ├── oauth
│   │   ├── __init__.py
│   │   ├── test_redirect.py
│   │   └── test_teams.py
│   ├── teams
│   │   ├── __init__.py
│   │   ├── test_auth.py
│   │   ├── test_challenges.py
│   │   ├── test_hidden_team_scores.py
│   │   ├── test_hints.py
│   │   ├── test_scoreboard.py
│   │   └── test_teams.py
│   ├── test_config.py
│   ├── test_plugin_utils.py
│   ├── test_setup.py
│   ├── test_themes.py
│   ├── test_views.py
│   ├── users
│   │   ├── __init__.py
│   │   ├── test_auth.py
│   │   ├── test_challenges.py
│   │   ├── test_hints.py
│   │   ├── test_profile.py
│   │   ├── test_scoreboard.py
│   │   ├── test_settings.py
│   │   ├── test_setup.py
│   │   ├── test_submissions.py
│   │   └── test_users.py
│   └── utils
│   ├── __init__.py
│   ├── test_ctftime.py
│   ├── test_email.py
│   ├── test_encoding.py
│   ├── test_events.py
│   ├── test_exports.py
│   ├── test_formatters.py
│   ├── test_humanize.py
│   ├── test_passwords.py
│   ├── test_plugins.py
│   ├── test_ratelimit.py
│   ├── test_sessions.py
│   ├── test_updates.py
│   ├── test_uploaders.py
│   └── test_validators.py
├── Vagrantfile
├── webpack.config.js
├── wsgi.py
└── yarn.lock

1.第一处

1
2
/data/CTFd/CTFd/plugins/ctfd-whale/assets/view.js
'<p class="card-text">' + response.ip + ':' + response.port + '</p>' +

修改为

1
2
/data/CTFd/CTFd/plugins/ctfd-whale/assets/view.js
'<p class="card-text">' + response.ip + response.port + '</p>' +

2.第二处

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
/data/CTFd/CTFd/plugins/ctfd-whale/__init__.py

if dynamic_docker_challenge.redirect_type == "http":
if int(configs.get('frp_http_port', "80")) == 80:
return json.dumps({'success': True, 'type': 'http', 'domain': data.uuid + domain,
'remaining_time': timeout - (datetime.now() - data.start_time).seconds,
'lan_domain': lan_domain})
else:
return json.dumps({'success': True, 'type': 'http',
'domain': data.uuid + domain + ":" + configs.get('frp_http_port', "80"),
'remaining_time': timeout - (datetime.now() - data.start_time).seconds,
'lan_domain': lan_domain})
else:
if dynamic_docker_challenge.category == 'pwn':
return json.dumps({'success': True, 'type': 'redirect', 'ip': "nc "+configs.get('frp_direct_ip_address', "")+" ",
'port': data.port,
'remaining_time': timeout - (datetime.now() - data.start_time).seconds,
'lan_domain': lan_domain})
else:

return json.dumps({'success': True, 'type': 'redirect', 'ip': "<a>http://"+configs.get('frp_direct_ip_address', "")+":",
'port': data.port+"</a>",
'remaining_time': timeout - (datetime.now() - data.start_time).seconds,
'lan_domain': lan_domain})
# return json.dumps({'success': True, 'type': 'redirect', 'ip': configs.get('frp_direct_ip_address', ""),
# 'port': data.port,
# 'remaining_time': timeout - (datetime.now() - data.start_time).seconds,
# 'lan_domain': lan_domain})
else:
return json.dumps({'success': True})
 Comments