​Windows11 WSL 2 安装anaconda、 pwntools步骤

1、 启动Windows PowerShell,以管理员身份运行。

2、 使用root账号登录wsl

我之前已安装Ubuntu-22.04,并强制使用WSL2。

Ubuntu-22.04,可以通过Windows Store进行安装。

强制使用WSL2的命令

wsl --set-default-version 2

3、 在/opt目录下下载anaconda

cd /opt
curl -L -O https://mirrors.tuna.tsinghua.edu.cn/github-release/conda-forge/miniforge/LatestRelease/Miniforge3-Linux-x86_64.sh

Sage Installation Guide 中给出的下载安装地址不好用,使用清华开源软件的镜像源

4、 安装anaconda,并创建虚拟环境sage,python版本为3.11

bash Miniforge3-Linux-x86_64.sh
conda create -n sage sage python=3.11

安装结束时会提示是否初始化conda,用户需要决定是否让conda在每次启动终端时自动初始化。

installation finished.
Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
   run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]

推荐yes,然后禁用base环境自动激活(避免每次启动终端都进入 Conda 环境)。

conda config --set auto_activate_base false  

可以手动激活

conda activate base  # 按需手动激活

5、 查看虚拟环境

conda env list

6、 激活sage环境,查看python版本。

conda activate sage
python --version

7、 安装pwntools

pip install pwntools

我这里已经安装过。

8、启动jupyter notebook

sage -n --allow-root

复制红框的内容(两行选择任意一行),粘贴到浏览器地址栏。

跳转后,点击New。

如果执行的是普通的python代码,选择Python3(ipykernel)。

弹出的页面可以输入代码执行。

如果是进行sagemath运算的,选择sagemath,比如ctf的crypto 或pwn方面。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值