本文针对Kali高版本python安装OneForall问题的解决
- 目录
-
- 环境预设
-
- 1、安装git和pip3
- 2、python虚拟环境安装
-
- venv
- virtualenv
- virtualenvwrapper
- 下载地址
- 报错处理
-
- 1、克隆OneForall
- 2、创建虚拟环境
- 3、启动虚拟环境&&安装OneForAll
- 4、测试是否异常
- 常用使用方式
-
- 1、您可以在OneForAll的config目录下修改有关配置
- 备注
目录
本文主要针对kali测试平台的版本,主要为了给各位提供一个处理安装OneForall遇到问题的解决方式。
本人的Python版本为3.11.7
┌──(hunter㉿hunter)-[~]
└─$ python3 --version
Python 3.11.7
环境预设
1、安装git和pip3
sudo apt update
sudo apt install git python3-pip -y
2、python虚拟环境安装
venv
为了避免依赖冲突请安装python 虚拟环境
这里提供的工具为venv
需要注意的是,venv 工具没法创建不同版本的python环境,也就是如果你用python3.5没法创建python3.6的虚拟环境。如果想要使用不同python版本的虚拟环境,请安装 virtual env包。
- 安装
sudo apt install python3-venv
- 使用
- 创建虚拟环境
sudo python3 -m venv 虚拟环境名称
- 启动虚拟环境
source 虚拟环境名称/bin/activate
- 退出虚拟环境
deactivate
virtualenv
- 安装
apt install python3-virtualenv
- 使用
- 创建虚拟环境
virtualenv 虚拟环境名称
如果存在python解释器,可以选择指定Python解释器,例如
virtualenv -p /usr/bin/python2.7 my_project_env
- 启动虚拟环境
source my_project_env/bin/activate
- 停用虚拟环境
deactivate
virtualenvwrapper
- 安装(确保virtualenv已经安装)
pip3 install virtualenvwrapper
export WORKON_HOME=~/Envs #设置环境变量
mkdir -p $WORKON_HOME #创建虚拟环境管理目录
find / -name virtualenvwrapper.sh #找到virtualenvwrapper.sh的路径
source 路径 #激活virtualenvwrapper.sh
- 基本使用
- 创建虚拟环境
mkvirtualenv project_env
这会在Envs 中创建 project_env虚拟环境
选择一个python解释器来搭建:
mkvirtualenv env --python=python2.7
- 在虚拟环境上工作
workon project_env
或者,您可以创建一个项目,它会创建虚拟环境,并在 $WORKON_HOME
中创建一个项目目录。 当您使用 workon project_env
时,会 cd -ed
到项目目录中。
mkvirtualenv project_env
virtualenvwrapper
提供环境名字的tab补全功能。当您有很多环境, 并且很难记住它们的名字时,这就显得很有用。
workon
也能停止您当前所在的环境,所以您可以在环境之间快速的切换。
- 停止虚拟环境
deactivate
- 删除
rmvirtualenv project_env
这里只是简要介绍有关工具的使用方式,更详细的信息各位读者可以自行在互联网上查阅,更专业也更具体。
下载地址
克隆OneForAll项目,和上面一下镜像的为gitee,有条件的可以选GitHub,二选一个
github:
sudo git clone https://github/shmilylty/OneForAll.git
gitee:
sudo git clone https://gitee/shmilylty/OneForAll.git
报错处理
对于高版本的python,在执行OneForall安装文件时会出现报错,下面提供一种解决方式,目前本人测试在自己的环境中可以解决,但对于读者的配置环境存在无法解决的可能。
1、克隆OneForall
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集]
└─$ sudo git clone https://github/shmilylty/OneForAll.git
正克隆到 'OneForAll'...
remote: Enumerating objects: 11794, done.
remote: Counting objects: 100% (501/501), done.
remote: Compressing objects: 100% (217/217), done.
remote: Total 11794 (delta 293), reused 420 (delta 276), pack-reused 11293
接收对象中: 100% (11794/11794), 105.47 MiB | 15.49 MiB/s, 完成.
处理 delta 中: 100% (6846/6846), 完成.
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集]
└─$ ls
2_subfinder OneForAll
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集]
└─$ sudo mv OneForAll 1_OneForAll
2、创建虚拟环境
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集]
└─$ ls
1_OneForAll 2_subfinder
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集]
└─$ cd 1_OneForAll
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集/1_OneForAll]
└─$ sudo python3 -m venv Env
[sudo] hunter 的密码:
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集/1_OneForAll]
└─$ ls
brute.py Dockerfile images Pipfile takeover.py
common docs LICENSE Pipfile.lock test.py
config Env modules README.md thirdparty
data export.py oneforall.py requirements.txt
3、启动虚拟环境&&安装OneForAll
注:请在已经下载的OneForAll目录下创建虚拟环境,避免出现调用时引用依赖错误。另外请先进入root环境。
┌──(hunter㉿hunter)-[/Tools/1_信息搜集/2_子域名收集/1_OneForAll]
└─$ sudo su
┌──(root㉿hunter)-[/Tools/1_信息搜集/2_子域名收集/1_OneForAll]
└─# source Env/bin/activate
┌──(Env)─(root㉿hunter)-[/Tools/1_信息搜集/2_子域名收集/1_OneForAll]
└─# ls
brute.py Dockerfile images Pipfile takeover.py
common docs LICENSE Pipfile.lock test.py
config Env modules README.md thirdparty
data export.py oneforall.py requirements.txt
┌──(Env)─(root㉿hunter)-[/Tools/1_信息搜集/2_子域名收集/1_OneForAll]
└─# pip3 install -r requirements.txt
Collecting beautifulsoup4==4.11.1 (from -r requirements.txt (line 1))
Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)
Collecting bs4==0.0.1 (from -r requirements.txt (line 2))
Using cached bs4-0.0.1-py3-none-any.whl
Collecting certifi==2022.06.15 (from -r requirements.txt (line 3))
Using cached certifi-2022.6.15-py3-none-any.whl (160 kB)
Collecting chardet==5.0.0 (from -r requirements.txt (line 4))
Using cached chardet-5.0.0-py3-none-any.whl (193 kB)
Collecting colorama==0.4.4 (from -r requirements.txt (line 5))
Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting dnspython==2.2.1 (from -r requirements.txt (line 6))
Using cached dnspython-2.2.1-py3-none-any.whl (269 kB)
Collecting exrex==0.10.5 (from -r requirements.txt (line 7))
Using cached exrex-0.10.5-py3-none-any.whl
Collecting fire==0.4.0 (from -r requirements.txt (line 8))
Using cached fire-0.4.0-py2.py3-none-any.whl
Collecting future==0.18.2 (from -r requirements.txt (line 9))
Using cached future-0.18.2-py3-none-any.whl
Collecting idna==3.3 (from -r requirements.txt (line 10))
Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting loguru==0.6.0 (from -r requirements.txt (line 11))
Using cached loguru-0.6.0-py3-none-any.whl (58 kB)
Collecting PySocks==
发布者:admin,转转请注明出处:http://www.yc00.com/web/1754791697a5202834.html
评论列表(0条)