【Python】Centos7安装dirsearch
一、升级Openssl1.1.1
1、官网下载源码:https://www.openssl.org/
2、安装
# ./config --prefix=/datas/soft/openssl-1.1.1 no-zlib # make # make install
3、新版配置
# ln -s /datas/soft/openssl-1.1.1/include/openssl /usr/include/openssl # ln -s /datas/soft/openssl-1.1.1/lib/libssl.so.1.1 /usr/local/lib64/libssl.so # ln -s /datas/soft/openssl-1.1.1/bin/openssl /usr/bin/openssl # echo "/datas/soft/openssl-1.1.1/lib" >> /etc/ld.so.conf # ldconfig
4、查看版本(查看版本遇到报错)
# openssl version openssl: error while loading shared libraries: libssl.so.46: cannot open shared object file: No such file or directory # ln -s /datas/soft/openssl-1.1.1/lib/libssl.so.1.1 /usr/lib64/libssl.so.46 #通过创建软连接方式解决 # openssl version openssl: error while loading shared libraries: libcrypto.so.44: cannot open shared object file: No such file or directory # ln -s /datas/soft/openssl-1.1.1/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.44 #通过创建软连接方式解决
# openssl version
OpenSSL 1.1.1-pre8 (beta) 20 Jun 2018
【说明】有些参考文档是创建下面的软链,我这边报错的名称不一样,但是创建软链的源文件是一致的,所以可以根据具体报错提示哪个共享库文件不存在,创建对应的软链:
# ln -s /datas/soft/openssl-1.1.1/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1
# ln -s /datas/soft/openssl-1.1.1/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
二、安装 LibreSSL
1、安装
# wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.8.2.tar.gz # tar xzvf libressl-2.8.2.tar.gz # cd libressl-2.8.2 # ./config # make # make install
2、验证Openssl版本(再次遇到报错)
# openssl version openssl: symbol lookup error: openssl: undefined symbol: EVP_mdc2, version OPENSSL_1_1_0 # sudo ldconfig
# openssl version
LibreSSL 2.8.2
三、安装Python3.7(dirsearch最低版本需要3.7)
1、官网下载python3.7软件包:https://www.python.org/ftp/python
2、安装
# tar -zxvf python-3.7.2.tgz # mkdir -p /datas/soft/python3.7 # ./configure --prefix=/datas/soft/python3.7 --with-openssl=/datas/soft/openssl-1.1.1 # make # make install
3、创建软链
# ln -s /datas/soft/python3.7/bin/python3 /usr/local/bin/python37 # ln -s /datas/soft/python3.7/bin/pip3 /usr/local/bin/pip37
4、运行,查看openssl版本
[root@localhost ~]# python37 Python 3.7.2 (default, May 16 2023, 19:40:14) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import ssl >>> ssl.OPENSSL_VERSION 'OpenSSL 1.1.1d 10 Sep 2019'
四、安装dirsearch
1、git下载:https://gitcode.net/mirrors/maurosoria/dirsearch?utm_source=csdn_github_accelerator
2、使用
# pip37 install --upgrade pip # 升级pip # python37 dirsearch.py -u aipo-learning.0752sc.cn -e php Failed to install dirsearch dependencies, try doing it manually. # 安装依赖报错 # pip37 install -r requirements.txt # 手动安装
参考文档:
Could not build the ssl module! 原因与解决方法
得意时做事,失意时读书