一直想搞个CTF,自己练练。
1、云主机上搞个虚机资源,操作系统Ubuntu18.04,安装过程省略了,省略更新源的一系列设置。
切换root,sudo su
2、参照建议,做下软件的更新
apt-get update
apt-get upgrade
3、开始安全GIT,Python,Flask
apt install git
apt install python3-pip,(安装过程中,前置程序较多,比较费时)同时被安装的一系列软件:build-essential dh-python dpkg-dev fakeroot g++ g++-7 gcc gcc-7 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan4 libatomic1 libc-dev-bin libc6-dev libcilkrts5 libexpat1-dev libfakeroot libgcc-7-dev libitm1 liblsan0 libmpx2 libpython3-dev libpython3.6-dev libquadmath0 libstdc++-7-dev libtsan0 libubsan0 linux-libc-dev make manpages-dev python-pip-whl python3-dev python3-distutils python3-lib2to3 python3-pip python3-setuptools python3-wheel python3.6-dev
不知是资源限速了,还是公司网络欠佳,这个过程已经超过20分钟了。
pip3 install Flask,速度很快
4、做个命令的更新:apt-get update,apt-get upgrade
5、下载CTFD,URL:https://github.com/isislab/CTFd.git
6、进到CTFD的目录
7、编辑文件./prepare.sh,vim ./prepare.sh
8、执行脚本,./prepare.sh
9、完成安装,运行CTFD,报错了,没起来
====================================================================
ctf@ctf-KVM:~/CTFd$ python3 serve.py
* Importing gevent and monkey patching. Use --disable-gevent to disable.
Traceback (most recent call last):
File "serve.py", line 18, in <module>
monkey.patch_all()
File "/usr/local/lib/python3.6/dist-packages/gevent/monkey.py", line 1255, in patch_all
_notify_patch(events.GeventWillPatchAllEvent(modules_to_patch, kwargs), _warnings)
File "/usr/local/lib/python3.6/dist-packages/gevent/monkey.py", line 190, in _notify_patch
notify_and_call_entry_points(event)
File "/usr/local/lib/python3.6/dist-packages/gevent/events.py", line 104, in notify_and_call_entry_points
subscriber = plugin.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2323, in load
self.require(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2346, in require
items = working_set.resolve(reqs, env, installer, extras=self.extras)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 778, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'psutil>=5.7.0; sys_platform != "win32" or platform_python_implementation == "CPython" and extra == "monitor"' distribution was not found and is required by the application
==================================================================
查了下,估计是psutil模块,版本的问题。
找到网站,下载下https://pypi.org/project/psutil/#files
还是使用:pip3 install psutil
在启动试试:python3 serve.py
psutil的版本问题已经,又有新的问题了
===================================================================
root@ctf-KVM:/home/ctf/CTFd# python3 serve.py
* Importing gevent and monkey patching. Use --disable-gevent to disable.
Traceback (most recent call last):
File "serve.py", line 21, in <module>
from CTFd import create_app
File "/home/ctf/CTFd/CTFd/__init__.py", line 16, in <module>
import CTFd.utils.config
File "/home/ctf/CTFd/CTFd/utils/__init__.py", line 9, in <module>
from CTFd.cache import cache
File "/home/ctf/CTFd/CTFd/cache/__init__.py", line 2, in <module>
from time import monotonic_ns
ImportError: cannot import name 'monotonic_ns'
====================================================================
失败了,搞不定monotonic_ns,后续继续
本文暂时没有评论,来添加一个吧(●'◡'●)