Skip to content

Commit 1bcc165

Browse files
committed
新增强制安装 Python2 的功能,并更新帮助信息;修复 one_gadget 安装过程中的错误处理
1 parent 9544922 commit 1bcc165

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

f8x

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7205,7 +7205,7 @@ clamav_Install(){
72057205

72067206
}
72077207

7208-
# -python2
7208+
# -py2
72097209
Python2_Install(){
72107210

72117211
name="python2"
@@ -7271,7 +7271,30 @@ Python2_Install(){
72717271

72727272
}
72737273

7274-
# -pip2-force
7274+
# -py2-f
7275+
Python2_force_Install(){
7276+
7277+
name="python2"
7278+
echo -e "\033[1;33m\n>> Installing $name\n\033[0m"
7279+
7280+
python2 -V > /dev/null 2>&1
7281+
if [ $? == 0 ]
7282+
then
7283+
Echo_ALERT "$name installed"
7284+
else
7285+
Rm_Lock
7286+
mkdir -p /usr/local/py2713 && cd /usr/local/py2713 && $Proxy_OK wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz ${wget_option}
7287+
tar -xf Python-2.7.13.tgz > /dev/null 2>&1
7288+
cd Python-2.7.13 && ./configure --with-pydebug
7289+
# make -s -j16
7290+
make install
7291+
ln -s /usr/local/py2713/Python-2.7.13/python /usr/bin/python2
7292+
python2 -V
7293+
fi
7294+
7295+
}
7296+
7297+
# -pip2-f
72757298
pip2_Install(){
72767299

72777300
echo -e "\033[1;33m\n>> Installing pip2\n\033[0m"
@@ -10196,6 +10219,7 @@ Help(){
1019610219
echo -e " \033[1;34m-openjdk\033[0m \033[0;34m : install openjdk\033[0m"
1019710220
echo -e " \033[1;34m-py3(7/8/9/10)\033[0m\033[0;34m : install python3\033[0m \033[1;33m(Based on package manager)\033[0m"
1019810221
echo -e " \033[1;34m-py2\033[0m \033[0;34m : install python2\033[0m \033[1;33m(Based on package manager)\033[0m"
10222+
echo -e " \033[1;34m-py2-f\033[0m \033[0;34m : force install python2\033[0m \033[1;33m(It is recommended to run with the -python2 option failing)\033[0m"
1019910223
echo -e " \033[1;34m-pip2-f\033[0m \033[0;34m : force install pip2\033[0m \033[1;33m(It is recommended to run with the -python2 option failing)\033[0m"
1020010224
echo -e " \033[1;34m-perl\033[0m \033[0;34m : install perl\033[0m"
1020110225
echo -e " \033[1;34m-ruby\033[0m \033[0;34m : install ruby\033[0m \033[1;33m(If that fails, try -ruby-f)\033[0m"
@@ -10558,6 +10582,10 @@ do
1055810582
mac_Check || exit 1
1055910583
Python2_Install
1056010584
;;
10585+
-py2-f)
10586+
mac_Check || exit 1
10587+
Python2_force_Install
10588+
;;
1056110589
-pip2-f)
1056210590
mac_Check || exit 1
1056310591
Proxy_Switch

f8x-ctf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,9 @@ CTF_PWN_pwndbg_install(){
690690
CTF_PWN_one_gadget_install(){
691691

692692
name="one_gadget"
693-
gem install one_gadget > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name" || one_gadget_install2
693+
Install_Switch "ruby"
694+
gem install one_gadget > /dev/null 2>&1 && Echo_INFOR "Successfully installed $name" || Echo_ERROR3
695+
# one_gadget_install2
694696

695697
}
696698

0 commit comments

Comments
 (0)