-
Notifications
You must be signed in to change notification settings - Fork 295
Expand file tree
/
Copy pathf8x-ctf
More file actions
1276 lines (996 loc) · 35.1 KB
/
Copy pathf8x-ctf
File metadata and controls
1276 lines (996 loc) · 35.1 KB
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
#!/usr/bin/env bash
# ===================== Basic variable settings =====================
if test -e /usr/local/bin/f8x
then
sleep 0.001
# f8x -update
else
curl -o f8x https://raw.githubusercontent.com/ffffffff0x/f8x/main/f8x && mv --force f8x /usr/local/bin/f8x && chmod +x /usr/local/bin/f8x && echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;32m[INFOR]\033[0m - \033[1;32mInstalled f8x tools\033[0m" || echo -e "\033[1;36m$(date +"%H:%M:%S")\033[0m \033[1;31m[ERROR]\033[0m - \033[1;31mf8x installation failed\n\033[0m"
fi
. /usr/local/bin/f8x > /dev/null 2>&1
F8x_ctf_Version="0.1.3 Dev(2025/09/02)"
# ===================== Software version variable setting =====================
bkcrack_Ver="v1.8.0"
bkcrack_bin_amd64="bkcrack-1.8.0-Linux-x86_64.tar.gz"
bkcrack_bin_arm64="bkcrack-1.8.0-Linux-aarch64.tar.gz"
bkcrack_dir="bkcrack-1.8.0-Linux"
upx_Ver="v3.96"
upx_bin_amd64="upx-3.96-amd64_linux.tar.xz"
upx_dir_amd64="upx-3.96-amd64_linux"
upx_bin_arm64="upx-3.96-arm64_linux.tar.xz"
upx_dir_arm64="upx-3.96-arm64_linux"
Main
Pentest_Base_Install > /dev/null 2>&1
# ===================== CTF WEB Tool =====================
CTF_WEB_py3_module_install(){
Install_Switch4 "itsdangerous"
}
CTF_GitHack_install(){
name="GitHack"
dir="$P_Dir/GitHack"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
$Proxy_OK git clone ${GitProxy}https://github.com/lijiejie/GitHack.git $dir > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_Git_Extract_install(){
name="GitHack"
dir="$P_Dir/Git_Extract"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
$Proxy_OK git clone ${GitProxy}https://github.com/gakki429/Git_Extract.git $dir > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_dumpall_install(){
name="dumpall"
which dumpall > /dev/null 2>&1
if [ $? -eq 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch4 "dumpall"
fi
}
CTF_flask-session-cookie-manager_install(){
name="flask-session-cookie-manager"
dir="$P_Dir/flask-session-cookie-manager"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
$Proxy_OK git clone --depth 1 ${GitProxy}https://github.com/noraj/flask-session-cookie-manager.git $dir > /dev/null 2>&1
cd $dir && python3 setup.py install > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_Typhon_install(){
name="Typhon"
dir="$P_Dir/Typhon"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
$Proxy_OK git clone --depth 1 ${GitProxy}https://github.com/Team-intN18-SoybeanSeclab/Typhon.git $dir > /dev/null 2>&1
cd $dir && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_Fenjing_install(){
name="Fenjing"
which Fenjing > /dev/null 2>&1
if [ $? -eq 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch8 "Fenjing"
fi
}
Pentest_redis-ssrf_Install(){
name="redis-ssrf"
dir="$P_Dir/redis-ssrf"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
$Proxy_OK git clone ${GitProxy}https://github.com/xmsec/redis-ssrf.git $dir > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
# ===================== CTF MISC Tool =====================
CTF_Misc_install(){
Install_Switch "strace"
Install_Switch "unrar"
Install_Switch "python3-tk"
Install_Switch "android-tools-adb"
Install_Switch "foremost"
Install_Switch "rarcrack"
}
CTF_Misc_py3_module_install(){
Install_Switch4 "base58"
Install_Switch4 "requests"
Install_Switch4 "zlib" > /dev/null 2>&1
Install_Switch4 "struct" > /dev/null 2>&1
Install_Switch4 "libnum"
Install_Switch4 "Plaso"
Install_Switch4 "matplotlib"
Install_Switch4 "tqdm"
python3 -m pip install --upgrade Pillow > /dev/null 2>&1 && Echo_INFOR "Successfully installed Pillow"
}
CTF_Misc_py2_module_install(){
Install_Switch3 "pybase62"
Install_Switch3 "base92"
python2 -m pip install Pillow > /dev/null 2>&1 && Echo_INFOR "Successfully installed Pillow"
}
CTF_stegoveritas_install(){
name="stegoveritas"
which stegoveritas > /dev/null 2>&1
if [ $? -eq 0 ]
then
Echo_ALERT "$name installed"
else
pip3 install stegoveritas 1> /dev/null 2>> /tmp/f8x_error.log
stegoveritas_install_deps > /dev/null 2>&1
which stegoveritas > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
fi
}
CTF_ImageMagick_install(){
name="ImageMagick"
which convert > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch "graphicsmagick-imagemagick-compat" || Echo_ERROR2
Install_Switch "imagemagick" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
fi
}
CTF_morse2ascii_install(){
name="morse2ascii"
which morse2ascii > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch "morse2ascii" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
fi
}
CTF_exiftool_install(){
name="exiftool"
which exiftool > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch "exiftool" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
fi
}
CTF_steghide_install(){
name="steghide"
which steghide > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch "steghide" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
fi
}
CTF_pdfinfo_install(){
name="pdfinfo"
which pdfinfo > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch "poppler-utils" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
fi
}
CTF_zbarimg_install(){
name="zbarimg"
which zbarimg > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
case $Linux_Version in
*"CentOS"*|*"RedHat"*|*"Fedora"*)
Install_Switch "zbar" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
;;
*"Kali"*|*"Ubuntu"*|*"Debian"*)
Install_Switch "zbar-tools" && Echo_INFOR "Successfully installed $name" || Echo_ERROR2
;;
*) ;;
esac
fi
}
CTF_outguess_install(){
name="outguess"
which outguess > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
mkdir -p /tmp/outguess && cd /tmp/outguess
$Proxy_OK git clone --depth 1 https://github.com/crorvick/outguess > /dev/null 2>&1 || Echo_ERROR2
cd outguess
./configure > /dev/null 2>&1 && make > /dev/null 2>&1 && make install > /dev/null 2>&1
which outguess > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name" || Echo_ERROR3
rm -rf /tmp/outguess
fi
}
CTF_bkcrack_install(){
case $Linux_architecture_Name in
*"linux-x86_64"*)
bkcrack_bin=$bkcrack_bin_amd64
;;
*"linux-arm64"*)
bkcrack_bin=$bkcrack_bin_arm64
;;
esac
name="bkcrack"
which bkcrack > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
mkdir -p /tmp/bkcrack && cd /tmp/bkcrack
$Proxy_OK wget https://github.com/kimci86/bkcrack/releases/download/$bkcrack_Ver/$bkcrack_bin > /dev/null 2>&1 || Echo_ERROR2
tar -zxvf $bkcrack_bin > /dev/null 2>&1
cp $bkcrack_dir/bkcrack /usr/sbin/bkcrack
which bkcrack > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name" || Echo_ERROR3
rm -rf /tmp/bkcrack
fi
}
CTF_zsteg_install(){
name="zsteg"
which zsteg > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
$Proxy_OK gem install zsteg 1> /dev/null 2>> /tmp/f8x_error.log && Echo_INFOR "Successfully installed $name" || Echo_ERROR "Calling gem to install zsteg failed! Please run the -ruby option to install the Ruby environment"
fi
}
CTF_F5-steganography_install(){
name="F5-steganography"
dir="$P_Dir/F5-steganography"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/matthewgao/F5-steganography.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_LSB-Steganography_install(){
name="LSB-Steganography"
dir="$P_Dir/LSB-Steganography"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone https://github.com/RobinDavid/LSB-Steganography.git > /dev/null 2>&1 || Echo_ERROR2
cd LSB-Steganography && pip3 install -r requirements.txt > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_BlindWaterMark_install(){
name="BlindWaterMark"
dir="$P_Dir/BlindWaterMark"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
Install_Switch3 "opencv-python==4.2.0.32"
cd $P_Dir && $Proxy_OK git clone https://github.com/chishaxie/BlindWaterMark.git > /dev/null 2>&1 || Echo_ERROR2
cd $dir && python2 -m pip install -r requirements.txt > /dev/null
cd $dir && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_crc32_install(){
name="crc32"
dir="$P_Dir/crc32"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone https://github.com/theonlypwner/crc32.git > /dev/null 2>&1 || Echo_ERROR2
cd crc32
python3 crc32.py -h > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_cloacked-pixel_install(){
name="cloacked-pixel"
dir="$P_Dir/cloacked-pixel"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
Install_Switch3 "numpy"
Install_Switch3 "matplotlib"
case $Linux_Version in
*"Kali"*|*"Ubuntu"*|*"Debian"*)
Install_Switch "python-tk"
apt-get install -y python-backports.functools-lru-cache > /dev/null 2>&1
;;
*) ;;
esac
cd $P_Dir && $Proxy_OK git clone https://github.com/livz/cloacked-pixel.git > /dev/null 2>&1 || Echo_ERROR2
cd $dir && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_stegosaurus_install(){
name="stegosaurus"
dir="$P_Dir/stegosaurus"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone https://github.com/AngelKitty/stegosaurus.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR2
fi
}
# ===================== CTF CRYPTO Tool =====================
CTF_Crypto_install(){
Install_Switch "python-gmpy2"
Install_Switch "python3-gmpy2"
case $Linux_Version in
*"CentOS"*|*"RedHat"*|*"Fedora"*)
echo "" # 暂时不填
;;
*"Kali"*|*"Ubuntu"*|*"Debian"*)
Install_Switch "libgmp-dev"
Install_Switch "libmpfr-dev"
Install_Switch "libmpc-dev"
;;
*) ;;
esac
}
CTF_Crypto_py3_module_install(){
#name="ciphey"
#python3 -m pip install --upgrade ciphey > /dev/null 2>&1 && Echo_INFOR "已安装 ciphey" || Echo_ERROR "尝试使用 --ignore-installed 安装"
Install_Switch4 "xortool"
Install_Switch4 "pycrypto"
Install_Switch4 "primefac"
Install_Switch4 "gmpy"
Install_Switch4 "gmpy2"
Install_Switch4 "rsa"
Install_Switch4 "owiener"
Install_Switch4 "factordb-python"
Install_Switch4 "sympy"
Install_Switch4 "Arithmetic"
Install_Switch4 "secret"
Install_Switch4 "gmssl"
}
CTF_Crypto_py2_module_install(){
Install_Switch3 "libnum"
Install_Switch3 "owiener"
Install_Switch3 "primefac"
}
CTF_rsatool_install(){
name="rsatool"
dir="$P_Dir/rsatool"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/ius/rsatool.git > /dev/null 2>&1 || Echo_ERROR2
cd rsatool && python3 rsatool.py -h > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_RsaCtfTool_install(){
name="RsaCtfTool"
dir="$P_Dir/RsaCtfTool"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
case $Linux_Version in
*"Fedora"*)
Install_Switch "gmp-devel"
Install_Switch "mpfr-devel"
Install_Switch "libmpc-devel"
;;
*"Kali"*|*"Ubuntu"*|*"Debian"*)
Install_Switch "libgmp3-dev"
;;
*) ;;
esac
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/Ganapati/RsaCtfTool.git > /dev/null 2>&1 || Echo_ERROR2
cd RsaCtfTool
pip3 install -r "requirements.txt" > /dev/null 2>&1
pip3 install -r "optional-requirements.txt" > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
CTF_CTF-RSA-tool_install(){
name="CTF-RSA-tool"
dir="$P_Dir/CTF-RSA-tool"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/3summer/CTF-RSA-tool.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR2
fi
}
CTF_rsa-wiener-attack_install(){
name="rsa-wiener-attack"
dir="$P_Dir/rsa-wiener-attack"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone https://github.com/pablocelayes/rsa-wiener-attack.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR2
fi
}
CTF_basecrack_install(){
name="basecrack"
dir="$P_Dir/basecrack"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/mufeedvh/basecrack.git > /dev/null 2>&1 || Echo_ERROR2
cd basecrack
pip3 install -r "requirements.txt" > /dev/null 2>&1
python3 basecrack.py -h > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
fi
}
# ===================== CTF IOT Tool =====================
CTF_IOT_install(){
Install_Switch "btscanner"
}
CTF_firmware_mod_kit_Install(){
name="firmware-mod-kit"
dir="/opt/firmware-mod-kit/trunk"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
case $Linux_Version in
*"CentOS"*|*"RedHat"*|*"Fedora"*)
Install_Switch3 "firmware-mod-kit"
;;
*"Kali"*|*"Ubuntu"*|*"Debian"*)
Install_Switch3 "firmware-mod-kit"
;;
*) ;;
esac
fi
}
# ===================== CTF RE Tool =====================
CTF_RE_py3_module_install(){
Install_Switch4 "uncompyle6"
}
CTF_RE_pyinstxtractor_install(){
name="pyinstxtractor"
dir="$P_Dir/pyinstxtractor"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone https://github.com/extremecoders-re/pyinstxtractor.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR2
fi
}
CTF_RE_upx_install(){
case $Linux_architecture_Name in
*"linux-x86_64"*)
upx_bin=$upx_bin_amd64
;;
*"linux-arm64"*)
upx_bin=$upx_bin_arm64
;;
esac
name="upx"
which upx > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
mkdir -p /tmp/upx && cd $_ && rm -f $upx_bin > /dev/null 2>&1 && $Proxy_OK wget ${GitProxy}https://github.com/upx/upx/releases/download/$upx_Ver/$upx_bin > /dev/null 2>&1 || Echo_ERROR2
tar -xvJf $upx_bin > /dev/null 2>&1 && cd $upx_dir
mv --force upx /usr/local/bin/upx && chmod +x /usr/local/bin/upx && rm -rf /tmp/upx > /dev/null 2>&1
which upx > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name $upx_Ver in the /usr/local/bin/" || Echo_ERROR3
fi
}
# ===================== CTF PWN Tool =====================
CTF_PWN_install(){
Install_Switch "gdb"
Install_Switch "gdb-multiarch"
Install_Switch "checksec"
Install_Switch "strace"
Install_Switch "ltrace"
Install_Switch "xxd"
Install_Switch "socat"
case $Linux_Version in
*"Kali"*|*"Ubuntu"*|*"Debian"*)
which gdb > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "gdb installed"
else
Echo_ALERT "Please use [aptitude install gdb]"
fi
Install_Switch "libssl-dev"
Install_Switch "libffi-dev"
Install_Switch "build-essential"
Install_Switch "gcc-multilib"
Install_Switch "python-dev"
Install_Switch "python3-dev"
Install_Switch "binutils"
Install_Switch "rpm2cpio"
Install_Switch "cpio"
Install_Switch "zstd"
;;
*) ;;
esac
}
CTF_PWN_py3_module_install(){
pip3 install --upgrade pip > /dev/null 2>&1
Install_Switch4 "setuptools"
Install_Switch4 "capstone"
Install_Switch4 "filebytes"
Install_Switch4 "keystone-engine"
Install_Switch4 "ropper"
Install_Switch4 "pathlib2"
Install_Switch4 "psutil"
Install_Switch4 "unicorn"
Install_Switch8 "ropgadget"
Install_Switch8 "z3-solver"
Install_Switch8 "angr"
}
CTF_PWN_py2_module_install(){
python2 -m pip install --upgrade pip > /dev/null 2>&1
Install_Switch3 "pathlib2"
Install_Switch3 "psutil"
}
CTF_PWN_pwntools_install(){
name="pwntools"
Install_Switch3 "pwntools"
Install_Switch4 "pwntools"
}
CTF_PWN_pwndbg_install(){
name="pwndbg"
which pwndbg > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
case $Linux_Version in
*"Kali"*|*"Ubuntu"*|*"Debian"*)
$Proxy_OK wget -O pwndbg_2025.05.30_amd64.deb https://github.com/pwndbg/pwndbg/releases/download/2025.05.30/pwndbg_2025.05.30_amd64.deb
apt install ./pwndbg_2025.05.30_amd64.deb
;;
*) ;;
esac
$Proxy_OK curl -o install.sh -qsL 'https://install.pwndbg.re'
$Proxy_OK bash -xv install.sh -t pwndbg-gdb
fi
dir="$P_Dir/pwndbg"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/pwndbg/pwndbg.git > /dev/null 2>&1 && Echo_INFOR "Successfully Download $name in the $dir" || Echo_ERROR3
cd $dir && $Proxy_OK bash -xv setup.sh
echo "这块 pwndbg 和其他几个会冲突,使用时请自行对 ~/.gdbinit 里的插件进行注释"
# echo "# source /pentest/pwndbg/gdbinit.py" > ~/.gdbinit
# chmod setup.sh
# ./setup.sh
# case $Linux_Version in
# *"Kali"*|*"Ubuntu"*|*"Debian"*)
# $Proxy_OK wget -O pwndbg_2025.05.30_amd64.deb https://github.com/pwndbg/pwndbg/releases/download/2025.05.30/pwndbg_2025.05.30_amd64.deb
# apt install ./pwndbg_2025.05.30_amd64.deb
# ;;
# *) ;;
# esac
# $Proxy_OK curl -o install.sh -qsL 'https://install.pwndbg.re'
# $Proxy_OK bash -xv install.sh -t pwndbg-gdb
fi
}
CTF_PWN_Pwngdb_install(){
name="Pwngdb"
dir="$P_Dir/Pwngdb"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/scwuaptx/Pwngdb.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
grep -qxF "source $dir/pwngdb.py" ~/.gdbinit || {
echo "source $dir/pwngdb.py" >> ~/.gdbinit
echo "source $dir/angelheap/gdbinit.py" >> ~/.gdbinit
echo "define hook-run" >> ~/.gdbinit
echo "python" >> ~/.gdbinit
echo "import angelheap" >> ~/.gdbinit
echo "angelheap.init_angelheap()" >> ~/.gdbinit
echo "end" >> ~/.gdbinit
echo "end" >> ~/.gdbinit
}
fi
}
CTF_PWN_peda_install(){
name="peda"
dir="$P_Dir/peda"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/No-Github/peda.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir
grep -qxF "source $dir/peda.py" ~/.gdbinit || echo "source $dir/peda.py" >> ~/.gdbinit
# https://github.com/longld/peda/issues/177#issuecomment-2441751341
cp /usr/lib/python3/dist-packages/six.py $dir/lib/six.py
fi
}
CTF_PWN_gef_install(){
name="gef"
dir="$P_Dir/gef"
if test -d $dir
then
Echo_ALERT "$name is already installed in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/hugsy/gef.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir
grep -qxF "source $dir/gef.py" ~/.gdbinit || echo "source $dir/gef.py" >> ~/.gdbinit
case $Linux_Version in
*"CentOS"*|*"RedHat"*|*"Fedora"*|*"AlmaLinux"*|*"VzLinux"*|*"Rocky"*)
echo "export LANG=en_US.UTF-8" >> /etc/bashrc
echo "export LC_ALL=en_US.UTF-8" >> /etc/bashrc
echo "export PYTHONIOENCODING=utf-8" >> /etc/bashrc
;;
*"Kali"*|*"Ubuntu"*|*"Debian"*)
echo "export LANG=en_US.UTF-8" >> /etc/bash.bashrc
echo "export LC_ALL=en_US.UTF-8" >> /etc/bash.bashrc
echo "export PYTHONIOENCODING=utf-8" >> /etc/bash.bashrc
;;
*) ;;
esac
grep -qxF "[gef]" ~/.gef.rc || echo "[gef]" >> ~/.gef.rc
grep -qxF "show_deprecation_warnings = False" ~/.gef.rc || echo "show_deprecation_warnings = False" >> ~/.gef.rc
fi
}
CTF_PWN_peda-heap_install(){
name="peda-heap"
dir="$P_Dir/peda-heap"
if test -d $dir
then
Echo_ALERT "$name is already download in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/No-Github/peda-heap.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir
grep -qxF "source $dir/peda.py" ~/.gdbinit || echo "source $dir/peda.py" >> ~/.gdbinit
# https://github.com/longld/peda/issues/177#issuecomment-2441751341
cp /usr/lib/python3/dist-packages/six.py $dir/lib/six.py
fi
}
CTF_PWN_one_gadget_install(){
name="one_gadget"
Install_Switch "ruby"
gem install one_gadget > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name" || Echo_ERROR3
# one_gadget_install2
}
CTF_PWN_glibc-all-in-one_install(){
name="glibc-all-in-one"
dir="$P_Dir/glibc-all-in-one"
if test -d $dir
then
Echo_ALERT "$name is already download in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/matrix1001/glibc-all-in-one.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir
python3 update_list
fi
}
CTF_PWN_patchelf_install(){
name="patchelf"
which patchelf > /dev/null 2>&1
if [ $? == 0 ]
then
Echo_ALERT "$name installed"
else
Install_Switch "patchelf"
fi
}
CTF_PWN_LibcSearcher_install(){
name="LibcSearcher"
dir="$P_Dir/LibcSearcher"
if test -d $dir
then
Echo_ALERT "$name is already download in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/lieanu/LibcSearcher.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir && chmod +x setup.py && python setup.py develop
cd $dir && chmod +x setup.py && python3 setup.py develop
ln -sf "$P_Dir/libc-database" $dir
fi
}
CTF_PWN_LibcSearcher_ng_install(){
name="LibcSearcher_ng"
dir="$P_Dir/LibcSearcher_ng"
if test -d $dir
then
Echo_ALERT "$name is already download in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/No-Github/LibcSearcher.git LibcSearcher_ng > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir && chmod +x setup.py && python setup.py develop
cd $dir && chmod +x setup.py && python3 setup.py develop
# ln -sf "$P_Dir/libc-database" $dir
fi
}
CTF_PWN_LibcSearcher_plus_install(){
name="LibcSearcher_plus"
dir="$P_Dir/LibcSearcher_plus"
if test -d $dir
then
Echo_ALERT "$name is already download in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/lexsd6/LibcSearcher_plus.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir && chmod +x setup.py && python3 setup.py develop
ln -sf "$P_Dir/libc-database" $dir
fi
}
CTF_PWN_libc-database_install(){
name="libc-database"
dir="$P_Dir/libc-database"
if test -d $dir
then
Echo_ALERT "$name is already download in $dir"
else
cd $P_Dir && $Proxy_OK git clone --depth 1 https://github.com/niklasb/libc-database.git > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name in the $dir" || Echo_ERROR3
cd $dir
Echo_ALERT "Running './get ubuntu debian' will take a long time and download a lot of data.\nDo you want to continue? Type 'y' to proceed, or press Enter to skip and run manually later."
echo -e "\033[5;33m\nContinue? [y/N,Default N] (Press Enter for No)\033[0m" && read -r input
case $input in
[yY][eE][sS]|[Yy])
$Proxy_OK ./get ubuntu debian
;;
*)
mkdir -p $P_Dir/libc-database/db
Echo_INFOR "Skipped. You can run './get ubuntu debian' manually in $dir when ready."
;;
esac
CTF_PWN_libc-database_bakdb_install
fi
}
CTF_PWN_libc-database_bakdb_install(){
dir="/tmp/libc-database_bakdb"
mkdir -p $dir
$Proxy_OK wget -O $dir/db.zip https://github.com/No-Github/Archive/releases/download/libc-db/db.zip ${wget_option}
cd $dir && unzip db.zip > /dev/null 2>&1
cp $dir/db/* $P_Dir/libc-database/db