본문 바로가기

CTF

Sage Installation on WSL2

Disclaimer: I don't know why this works/doesn't work; it is only a result of trial and error.

0. If you didn't install a WSL2, please download and install it(https://learn.microsoft.com/en-us/windows/wsl/install). 

- You should be aware that you must turn on virtualization on windows and bios.

1. AFAIK installing from conda-forge is best. Download Anaconda(https://www.anaconda.com/) here or something similar. Create a conda virtual environment. In my case, the default base environment didn't work, so creating a new env might be helpful. See https://anaconda.org/conda-forge/sagelib and install sagelib by command on your virtual env. 

If you have trouble resolving the dependencies when installing the sage, try to update the conda to the newest version. 

2. Try to run the sage console on your environment. If you have a problem with the module import, download and install it with the conda. For example, if you have a problem with module "example_module", resolve it by "conda install example_module". If it doesn't work, reference anaconda.org and find out the command.

3. Most sage users work on jupyter notebook(or jupyter lab), so it is nice to set it up. Install jupyter-lab by "conda install -c conda-forge jupyterlab", then the notebook will follow. In my case, installing jupyter notebook made an error with module dependencies, so I must downgrade some modules.

However, when we try to turn it on, it causes problems because running jupyter invokes a browser connection as default, and the wsl2 does not support a network connection between Linux distribution and Windows.

Make a config file by "jupyter notebook --generate-config" and "jupyter lab --generate-config". Find every
"*.open_browser" argument and change it to False. For example, the jupyter lab configuration has an argument
"c.LabApp.open_browser", so you should set it to false. By this setting, the jupyter does not open new windows as default.

 

'CTF' 카테고리의 다른 글

Newbie Cryptography Cheatsheet (작업 중)  (0) 2021.03.17
UTCTF - Writeups  (0) 2021.03.15
[Crypto] 해시 함수와 취약점 (Basic)  (1) 2021.01.20
[*CTF Writeup] Crypto - MyEnc  (0) 2021.01.18
[*CTF Writeup] Crypto - GuessKey2  (0) 2021.01.18