运行W3AF的时候python报错

Python/PHP/Perl 开发与设计
回复
头像
九天星
帖子: 1333
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 38 次

运行W3AF的时候python报错

#1

帖子 九天星 » 2017-05-06 17:34

见代码:
一直提示让我upgrade,我升级过后查看pip版本,还是1.5.4,求助!

代码: 全选

root@wlp2s0-computer:/opt/w3af# ./w3af_gui
An old pip version was detected. We recommend a pip update before continuing:
    sudo pip install --upgrade pip
root@wlp2s0-computer:/opt/w3af# sudo pip install --upgrade pip
Downloading/unpacking pip from https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.4
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed pip
Cleaning up...
root@wlp2s0-computer:/opt/w3af# sudo pip install requests --upgrade
Downloading/unpacking requests from https://pypi.python.org/packages/7e/ac/a80ed043485a3764053f59ca92f809cc8a18344692817152b0e8bd3ca891/requests-2.13.0-py2.py3-none-any.whl#md5=5e432dcf5bd1e3402ea1656700d99365
  Downloading requests-2.13.0-py2.py3-none-any.whl (584kB): 584kB downloaded
Installing collected packages: requests
  Found existing installation: requests 2.2.1
    Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
Successfully installed requests
Cleaning up...
root@wlp2s0-computer:/opt/w3af# ./w3af_gui
An old pip version was detected. We recommend a pip update before continuing:
    sudo pip install --upgrade pip
root@wlp2s0-computer:/opt/w3af# 
头像
vickycq
论坛版主
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
送出感谢: 100 次
接收感谢: 994 次
联系:

Re: 运行W3AF的时候python报错

#2

帖子 vickycq » 2017-05-06 18:21

九天星 写了: Found existing installation: pip 1.5.4
Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
跟上次您发的帖子 viewtopic.php?f=63&t=483610
是一样的问题。首先检查是否已经安装了新版的 pip(即同时存在两个 pip)

代码: 全选

find /usr | grep bin/pip
如果已经安装了新版的 pip(即同时存在两个 pip),那么您只需要简单地执行 apt-get purge python-pip

如果没有已经安装了新版的 pip 您可能需要按顺序执行以下指令

代码: 全选

sudo -i
pip uninstall pip
apt-get purge python-pip
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz
tar -xzvf pip-9.0.1.tar.gz
cd pip-9.0.1
python setup.py install
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
头像
九天星
帖子: 1333
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 38 次

Re: 运行W3AF的时候python报错

#3

帖子 九天星 » 2017-05-06 21:17

这次可能不一样。

代码: 全选

root@wlp2s0-computer:/opt/w3af# find /usr | grep bin/pip
/usr/local/bin/pip2.7
/usr/local/bin/pip
/usr/local/bin/pip2
/usr/bin/pip
/usr/bin/pip2

代码: 全选

Installed /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip==9.0.1
Finished processing dependencies for pip==9.0.1
在使用apt-get purge python-pip命令之后再执行w3af的按装程序,程序会重新安装python-pip
见下面代码。

代码: 全选

root@wlp2s0-computer:/opt# cd w3af
root@wlp2s0-computer:/opt/w3af# ls
circle.yml  extras    README.md  tools  w3af      w3af_console
doc         profiles  scripts    venv   w3af_api  w3af_gui
root@wlp2s0-computer:/opt/w3af# ./w3af_gui
w3af's requirements are not met, one or more third-party libraries need to be installed.

On Ubuntu 14.04 systems please install the following operating system packages before running the pip installer:
    sudo apt-get -y install python-pip

A script with these commands has been created for you at /tmp/w3af_dependency_install.sh
root@wlp2s0-computer:/opt/w3af# ./w3af_console 
w3af's requirements are not met, one or more third-party libraries need to be installed.

On Ubuntu 14.04 systems please install the following operating system packages before running the pip installer:
    sudo apt-get -y install python-pip

A script with these commands has been created for you at /tmp/w3af_dependency_install.sh
root@wlp2s0-computer:/opt/w3af# . /tmp/w3af_dependency_install.sh 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
推荐安装的软件包:
  python-dev-all
下列【新】软件包将被安装:
  python-pip
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 0 B/97.3 kB 的软件包。
解压缩后会消耗掉 477 kB 的额外空间。
正在选中未选择的软件包 python-pip。
(正在读取数据库 ... 系统当前共安装有 290359 个文件和目录。)
正准备解包 .../python-pip_1.5.4-1ubuntu4_all.deb  ...
正在解包 python-pip (1.5.4-1ubuntu4) ...
正在处理用于 man-db (2.6.7.1-1ubuntu1) 的触发器 ...
正在设置 python-pip (1.5.4-1ubuntu4) ...
root@wlp2s0-computer:/opt/w3af# pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg (python 2.7)
root@wlp2s0-computer:/opt/w3af# ls
circle.yml  extras    README.md  tools  w3af      w3af_console
doc         profiles  scripts    venv   w3af_api  w3af_gui
root@wlp2s0-computer:/opt/w3af# ./w3af_gui
An old pip version was detected. We recommend a pip update before continuing:
    sudo pip install --upgrade pip
root@wlp2s0-computer:/opt/w3af# pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg (python 2.7)
root@wlp2s0-computer:/opt/w3af# pip install --upgrade pip
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
root@wlp2s0-computer:/opt/w3af# ./w3af_gui
An old pip version was detected. We recommend a pip update before continuing:
    sudo pip install --upgrade pip
头像
九天星
帖子: 1333
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 38 次

Re: 运行W3AF的时候python报错

#4

帖子 九天星 » 2017-05-06 21:26

但是现在的版本变成9.0.1了,只是他还是让我执行sudo pip install --upgrade pip

我在网上搜的贴子,让我pip install pyopenssl ndg-httpsclient pyasn1,执行完之后还是提示sudo pip install --upgrade pip

代码: 全选

root@wlp2s0-computer:/opt/w3af# pip install pyopenssl ndg-httpsclient pyasn1
Requirement already satisfied: pyopenssl in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: ndg-httpsclient in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: pyasn1 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: six>=1.5.2 in /usr/lib/python2.7/dist-packages (from pyopenssl)
Requirement already satisfied: cryptography>=0.7 in /usr/local/lib/python2.7/dist-packages (from pyopenssl)
Requirement already satisfied: idna>=2.1 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied: packaging in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyopenssl)
Collecting setuptools>=11.3 (from cryptography>=0.7->pyopenssl)
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading setuptools-35.0.2-py2.py3-none-any.whl (390kB)
    100% |████████████████████████████████| 399kB 130kB/s 
Requirement already satisfied: enum34 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied: ipaddress in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied: cffi>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyopenssl)
Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/dist-packages (from packaging->cryptography>=0.7->pyopenssl)
Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools>=11.3->cryptography>=0.7->pyopenssl)
Requirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi>=1.4.1->cryptography>=0.7->pyopenssl)
Installing collected packages: setuptools
  Found existing installation: setuptools 3.3
    Uninstalling setuptools-3.3:
      Successfully uninstalled setuptools-3.3
Successfully installed setuptools-35.0.2
root@wlp2s0-computer:/opt/w3af# ./w3af_gui
An old pip version was detected. We recommend a pip update before continuing:
    sudo pip install --upgrade pip
root@wlp2s0-computer:/opt/w3af# pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg (python 2.7)
root@wlp2s0-computer:/opt/w3af# 
头像
vickycq
论坛版主
帖子: 4507
注册时间: 2011-03-20 13:12
系统: Debian
来自: 山东省寿光县
送出感谢: 100 次
接收感谢: 994 次
联系:

Re: 运行W3AF的时候python报错

#5

帖子 vickycq » 2017-05-06 21:28

要不干脆禁用 pip 版本检测吧:https://github.com/andresriancho/w3af-k ... ning.patch
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
头像
九天星
帖子: 1333
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 38 次

Re: 运行W3AF的时候python报错

#6

帖子 九天星 » 2017-05-06 21:45

我在想是不是https和requests 这两个的问题!我记得之前我在使用机器人的时候也出现过这个问题,当时是使用pip install requests==2.5.3这个命令解决的,但这次不行了。
头像
九天星
帖子: 1333
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 38 次

Re: 运行W3AF的时候python报错

#7

帖子 九天星 » 2017-05-06 21:57

估计就是装上去了,我其他软件中的部份也要出问题,应该是python版本的兼容性问题。
头像
九天星
帖子: 1333
注册时间: 2007-07-14 20:45
送出感谢: 67 次
接收感谢: 38 次

Re: 运行W3AF的时候python报错

#8

帖子 九天星 » 2017-05-06 22:29

:Cry :Cry :Cry 我自已把系统搞坏了。
回复

回到 “Python/Php/Perl”