Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

基础镜像升级计划 #14

Open
firmianay opened this issue Jun 9, 2021 · 2 comments
Open

基础镜像升级计划 #14

firmianay opened this issue Jun 9, 2021 · 2 comments

Comments

@firmianay
Copy link
Member

将Ubuntu从16.04升级到18.04(保持python2的兼容性)或者一步到位20.04(仅支持python3,需重写部分exp),可能需要做大量测试工作,特开此帖白嫖PR :)

@firmianay
Copy link
Member Author

临时替换python3小版本:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.7

修改apt指定的python3:

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2

修改系统默认命令的软链指向:

sudo update-alternatives --config python3

@chenxiaohe
Copy link

可通过修改对应CVE漏洞下的dockerfile脚本实现升级至python3.6
例如 Tenda CVE-2018-16333
修改Tenda/CVE-2018-16333-system-emu/Dcokerfile 为如下脚本
image

即增加以下执行可实现升级至python3.6
image

代码如下:

升级python3至python3.6 BY chenxiaohe

RUN apt-get update \
&& apt-get install software-properties-common -y
&& add-apt-repository ppa:deadsnakes/ppa
&& apt-get update
&& apt-get install python3.6 -y
&& apt-get install python3.6-dev -y
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
&& apt-get install --fix-missing python3-pip -y
&& sed -i "s/from pip._internal.cli.main import main/from pip import main/g" /usr/local/bin/pip3
&& curl https://bootstrap.pypa.io/get-pip.py | python3 -
&& pip3 install --upgrade pip

由于升级了python3的版本号,所以exp.py脚本引入的依赖库需要做相应的升级。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants