#!/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 } one_gadget_install2(){ Echo_ERROR "one_gadget installation failed, try to reinstall one_gadget" case $Linux_Version in *"Kali"*|*"Ubuntu"*|*"Debian"*) add-apt-repository ppa:brightbox/ruby-ng apt-get update apt-get purge --auto-remove ruby apt-get install -y ruby2.6 ruby2.6-dev gem install one_gadget ;; *) ;; esac } # -web CTF_WEB_tools(){ Rm_Lock echo -e "\033[1;33m\n>> Installing common py modules\n\033[0m" CTF_WEB_py3_module_install echo -e "\033[1;33m\n>> Installing Sqlmap\n\033[0m" Pentest_Sqlmap_Install echo -e "\033[1;33m\n>> Installing GitHack\n\033[0m" CTF_GitHack_install echo -e "\033[1;33m\n>> Installing Git_Extract\n\033[0m" CTF_Git_Extract_install echo -e "\033[1;33m\n>> Installing flask-session-cookie-manager\n\033[0m" CTF_flask-session-cookie-manager_install echo -e "\033[1;33m\n>> Installing Gopherus\n\033[0m" Pentest_Gopherus_Install echo -e "\033[1;33m\n>> Installing redis-rogue-server\n\033[0m" Pentest_redis-rogue-server_Install echo -e "\033[1;33m\n>> Installing redis-rogue-server-win\n\033[0m" Pentest_redis-rogue-server-win_Install echo -e "\033[1;33m\n>> Installing redis-rce\n\033[0m" Pentest_redis-rce_Install echo -e "\033[1;33m\n>> Installing redis_lua_exploit\n\033[0m" Pentest_redis_lua_exploit_Install echo -e "\033[1;33m\n>> Installing redis-ssrf\n\033[0m" Pentest_redis-ssrf_Install echo -e "\033[1;33m\n>> Installing Typhon\n\033[0m" CTF_Typhon_install echo -e "\033[1;33m\n>> Installing Fenjing\n\033[0m" CTF_Fenjing_install } # -misc CTF_MISC_tools(){ Rm_Lock echo -e "\033[1;33m\n>> Installing some misc tools\n\033[0m" CTF_Misc_install echo -e "\033[1;33m\n>> Installing common py modules\n\033[0m" CTF_Misc_py3_module_install CTF_Misc_py2_module_install echo -e "\033[1;33m\n>> Installing hashcat、7z2hashcat\n\033[0m" Pentest_hashcat_Install echo -e "\033[1;33m\n>> Installing stegoveritas\n\033[0m" CTF_stegoveritas_install echo -e "\033[1;33m\n>> Installing ImageMagick\n\033[0m" CTF_ImageMagick_install echo -e "\033[1;33m\n>> Installing morse2ascii\n\033[0m" CTF_morse2ascii_install echo -e "\033[1;33m\n>> Installing exiftool\n\033[0m" CTF_exiftool_install echo -e "\033[1;33m\n>> Installing steghide\n\033[0m" CTF_steghide_install echo -e "\033[1;33m\n>> Installing pdfinfo\n\033[0m" CTF_pdfinfo_install echo -e "\033[1;33m\n>> Installing zbarimg\n\033[0m" CTF_zbarimg_install echo -e "\033[1;33m\n>> Installing outguess\n\033[0m" CTF_outguess_install echo -e "\033[1;33m\n>> Installing zsteg\n\033[0m" CTF_zsteg_install echo -e "\033[1;33m\n>> Installing F5-steganography\n\033[0m" CTF_F5-steganography_install echo -e "\033[1;33m\n>> Installing LSB-Steganography\n\033[0m" CTF_LSB-Steganography_install echo -e "\033[1;33m\n>> Installing BlindWaterMark\n\033[0m" CTF_BlindWaterMark_install echo -e "\033[1;33m\n>> Installing crc32\n\033[0m" CTF_crc32_install echo -e "\033[1;33m\n>> Installing cloacked-pixel\n\033[0m" CTF_cloacked-pixel_install echo -e "\033[1;33m\n>> Installing stegosaurus\n\033[0m" CTF_stegosaurus_install Volatility_Install volatility3_Install case $Linux_architecture_Name in *"linux-x86_64"*) echo -e "\033[1;33m\n>> Installing bkcrack\n\033[0m" CTF_bkcrack_install ;; esac } # -crypto CTF_Crypto_tools(){ Rm_Lock echo -e "\033[1;33m\n>> Installing some misc tools\n\033[0m" CTF_Crypto_install echo -e "\033[1;33m\n>> Installing common py modules\n\033[0m" CTF_Crypto_py3_module_install CTF_Crypto_py2_module_install echo -e "\033[1;33m\n>> Installing rsatool\n\033[0m" CTF_rsatool_install echo -e "\033[1;33m\n>> Installing RsaCtfTool\n\033[0m" CTF_RsaCtfTool_install echo -e "\033[1;33m\n>> Installing CTF-RSA-tool\n\033[0m" CTF_CTF-RSA-tool_install echo -e "\033[1;33m\n>> Installing rsa-wiener-attack\n\033[0m" CTF_rsa-wiener-attack_install echo -e "\033[1;33m\n>> Installing basecrack\n\033[0m" CTF_basecrack_install } # -iot CTF_IOT_tools(){ Rm_Lock echo -e "\033[1;33m\n>> Installing some misc tools\n\033[0m" CTF_IOT_install binwalk_Install echo -e "\033[1;33m\n>> Installing firmware-mod-kit\n\033[0m" CTF_firmware_mod_kit_Install } # -re CTF_RE_tools(){ Rm_Lock #echo -e "\033[1;33m\n>> Installing some misc tools\n\033[0m" #CTF_RE_install echo -e "\033[1;33m\n>> Installing common py modules\n\033[0m" CTF_RE_py3_module_install #CTF_RE_py2_module_install echo -e "\033[1;33m\n>> Installing pyinstxtractor\n\033[0m" CTF_RE_pyinstxtractor_install echo -e "\033[1;33m\n>> Installing upx\n\033[0m" CTF_RE_upx_install } # -pwn CTF_PWN_tools(){ Rm_Lock echo -e "\033[1;33m\n>> Installing some misc tools\n\033[0m" CTF_PWN_install pyenv_Install echo -e "\033[1;33m\n>> Installing common py modules\n\033[0m" CTF_PWN_py3_module_install CTF_PWN_py2_module_install echo -e "\033[1;33m\n>> Installing pwntools\n\033[0m" CTF_PWN_pwntools_install echo -e "\033[1;33m\n>> Installing pwndbg\n\033[0m" CTF_PWN_pwndbg_install echo -e "\033[1;33m\n>> Installing peda\n\033[0m" CTF_PWN_peda_install echo -e "\033[1;33m\n>> Installing gef\n\033[0m" CTF_PWN_gef_install echo -e "\033[1;33m\n>> Installing peda-heap\n\033[0m" CTF_PWN_peda-heap_install echo -e "\033[1;33m\n>> Installing one_gadget\n\033[0m" CTF_PWN_one_gadget_install echo -e "\033[1;33m\n>> Installing glibc-all-in-one\n\033[0m" CTF_PWN_glibc-all-in-one_install echo -e "\033[1;33m\n>> Installing patchelf\n\033[0m" CTF_PWN_patchelf_install echo -e "\033[1;33m\n>> Installing LibcSearcher\n\033[0m" CTF_PWN_LibcSearcher_install echo -e "\033[1;33m\n>> Installing LibcSearcher-ng\n\033[0m" CTF_PWN_LibcSearcher-ng_install echo -e "\033[1;33m\n>> Installing LibcSearcher_plus\n\033[0m" CTF_PWN_LibcSearcher_plus_install echo -e "\033[1;33m\n>> Installing libc-database\n\033[0m" CTF_PWN_libc-database_install } # -help Help_Info(){ echo -e "\033[1;34mInstall by category \033[0m" echo -e " \033[1;34m-web\033[0m \033[0;34m : install WEB environment\033[0m" echo -e " \033[1;34m-misc\033[0m \033[0;34m : install MISC environment\033[0m" echo -e " \033[1;34m-crypto\033[0m \033[0;34m: install Crypto environment\033[0m" echo -e " \033[1;34m-iot\033[0m \033[0;34m : install IOT environment\033[0m" echo -e " \033[1;34m-re\033[0m \033[0;34m : install Reverse environment\033[0m" echo -e " \033[1;34m-pwn\033[0m \033[0;34m : install PWN environment\033[0m" echo -e "" echo -e "\033[1;37mcreate by ffffffff0x\033[0m" echo -e "" } for cmd in $@ do case $cmd in -web) Proxy_Switch Base_Check Py_Check pip2_Check JDK_Check CTF_WEB_tools ;; -misc) Proxy_Switch Base_Check Py_Check pip2_Check JDK_Check CTF_MISC_tools ;; -crypto) Proxy_Switch Base_Check Py_Check pip2_Check JDK_Check CTF_Crypto_tools ;; -iot) Proxy_Switch Base_Check Py_Check pip2_Check JDK_Check CTF_IOT_tools ;; -re) Proxy_Switch Base_Check Py_Check pip2_Check JDK_Check CTF_RE_tools ;; -pwn) Proxy_Switch Base_Check Py_Check pip2_Check JDK_Check CTF_PWN_tools ;; -help | help) printf "\033c" Help_Info exit 0 ;; esac done echo -e "\033[1;36m \n-----OVER-----\n \033[0m"