您的位置:首页 > 教程 > 网页相关 > kali-linux 202202 安装w3af命令行版的详细过程

kali-linux 202202 安装w3af命令行版的详细过程

2022-06-21 14:09:13 来源:易采站长站 作者:

kali-linux 202202 安装w3af命令行版的详细过程

目录
更换国内源从github上面下载w3af查看kali上的python版本下载所需要的依赖包第一个是pip包接下来安装pip.py尝试启动执行w3af_dependency_install.sh启动w3af命令行

blu站长之家-易采站长站-Easck.Com

更换国内源

vi /etc/apt/sources.list
deb https://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src https://mirrors.aliyun.com/kali kali-rolling main non-free contrib

blu站长之家-易采站长站-Easck.Com

从github上面下载w3af

https://github.com/andresriancho/w3af

下载完成后放到kali里面去解压就可以,我放在了/usr/w3af目录下面。blu站长之家-易采站长站-Easck.Com

blu站长之家-易采站长站-Easck.Com

查看kali上的python版本

python --version

如果是3.10的版本,再用下面这条命令看kali上面装了几个python版本,一般是3个blu站长之家-易采站长站-Easck.Com

ll /usr/bin | grep python
-rwxr-xr-x 1 root root           967 11月 17  2020 apython
-rwxr-xr-x 1 root root          2336  7月 25  2018 dh_python3-ply
-rwxr-xr-x 1 root root           963  1月 24 15:22 ipython3
lrwxrwxrwx 1 root root            23  3月 28 16:47 pdb2.7 -> ../lib/python2.7/pdb.py
lrwxrwxrwx 1 root root            24  3月 24 09:07 pdb3.10 -> ../lib/python3.10/pdb.py
lrwxrwxrwx 1 root root            23  3月 24 09:02 pdb3.9 -> ../lib/python3.9/pdb.py
lrwxrwxrwx 1 root root            31  5月  1 18:33 py3versions -> ../share/python3/py3versions.py
-rwxr-xr-x 1 root root           953  5月  1  2021 pybabel-python3
lrwxrwxrwx 1 root root            24  6月 19 05:41 python -> /etc/alternatives/python
lrwxrwxrwx 1 root root             9  7月 28  2021 python2 -> python2.7
-rwxr-xr-x 1 root root       3533496  3月 28 16:47 python2.7
lrwxrwxrwx 1 root root            33  3月 28 16:47 python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root            10  5月  1 18:33 python3 -> python3.10
-rwxr-xr-x 1 root root       5540696  3月 24 09:07 python3.10
lrwxrwxrwx 1 root root            34  3月 24 09:07 python3.10-config -> x86_64-linux-gnu-python3.10-config
-rwxr-xr-x 1 root root       5447080  3月 24 09:02 python3.9
-rwxr-xr-x 1 root root           963  4月 23 15:15 python3-commonmark
lrwxrwxrwx 1 root root            17  5月  1 18:33 python3-config -> python3.10-config
-rwxr-xr-x 1 root root           960 12月 23  2020 python3-futurize
-rwxr-xr-x 1 root root           964 12月 23  2020 python3-pasteurize
-rwxr-xr-x 1 root root           945 10月 21  2021 python3-qr
-rwxr-xr-x 1 root root           977  3月 27 16:47 python-dotenv
lrwxrwxrwx 1 root root             7  4月 13 11:26 python-faraday -> faraday
lrwxrwxrwx 1 root root            29  7月 28  2021 pyversions -> ../share/python/pyversions.py
-rwxr-xr-x 1 root root          2970  3月 28 16:47 x86_64-linux-gnu-python2.7-config
-rwxr-xr-x 1 root root          3154  3月 24 09:07 x86_64-linux-gnu-python3.10-config
lrwxrwxrwx 1 root root            34  5月  1 18:33 x86_64-linux-gnu-python3-config -> x86_64-linux-gnu-python3.10-config

我的python有2.7,3.9和3.10三个版本。blu站长之家-易采站长站-Easck.Com

接下来设置切换python版本:blu站长之家-易采站长站-Easck.Com

┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives: 使用 /usr/bin/python2.7 来在自动模式中提供 /usr/bin/python (python)
                                                                             
┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# update-alternatives --install /usr/bin/python python /usr/bin/python3.9 2
update-alternatives: 使用 /usr/bin/python3.9 来在自动模式中提供 /usr/bin/python (python)
                                                                             
┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# update-alternatives --install /usr/bin/python python /usr/bin/python3.10 3
update-alternatives: 使用 /usr/bin/python3.10 来在自动模式中提供 /usr/bin/python (python)
                                                                             
┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# update-alternatives --config python
有 3 个候选项可用于替换 python (提供 /usr/bin/python)。

  选择       路径               优先级  状态
------------------------------------------------------------
* 0            /usr/bin/python3.10   3         自动模式
  1            /usr/bin/python2.7    1         手动模式
  2            /usr/bin/python3.10   3         手动模式
  3            /usr/bin/python3.9    2         手动模式

要维持当前值[*]请按<回车键>,或者键入选择的编号:1
update-alternatives: 使用 /usr/bin/python2.7 来在手动模式中提供 /usr/bin/python (python)
                                                                             
┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# python --version
Python 2.7.18

设置完成后切换到python2.7版本blu站长之家-易采站长站-Easck.Com

blu站长之家-易采站长站-Easck.Com

下载所需要的依赖包

blu站长之家-易采站长站-Easck.Com

第一个是pip包

┌──(root㉿kali)-[/usr/w3af/w3af-master/w3af]
└─# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
--2022-06-19 05:48:07--  https://bootstrap.pypa.io/pip/2.7/get-pip.py
正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)... 146.75.112.175, 2a04:4e42:8c::175
正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|146.75.112.175|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1908226 (1.8M) [text/x-python]
正在保存至: “get-pip.py”

get-pip.py              100%[==============================>]   1.82M  31.0KB/s  用时 96s     

2022-06-19 05:49:49 (19.5 KB/s) - 已保存 “get-pip.py” [1908226/1908226])

blu站长之家-易采站长站-Easck.Com

接下来安装pip.py

┌──(root㉿kali)-[/usr/w3af/w3af-master/w3af]
└─# python get-pip.py 
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.                                                                                         
Collecting pip<21.0
  Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 4.0 kB/s 
Collecting wheel
  Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, wheel
Successfully installed pip-20.3.4 wheel-0.37.1

blu站长之家-易采站长站-Easck.Com

尝试启动

┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# ./w3af_console 
w3af's requirements are not met, one or more third-party libraries need to be installed.

On Kali systems please install the following operating system packages before running the pip installer:
    sudo apt-get -y install npm python-setuptools python-pip libssl-dev python2.7-dev libsqlite3-dev libxslt1-dev libyaml-dev

Your python installation needs the following modules to run w3af:
    pyclamd github git.util pybloomfilter phply nltk chardet tblib pdfminer concurrent.futures OpenSSL ndg pyasn1 lxml scapy.config guess_language cluster msgpack ntlm Halberd darts.lib.utils jinja2 vulndb markdown psutil ds_store termcolor mitmproxy ruamel.ordereddict Flask yaml tldextract pebble acora esmre diff_match_patch bravado_core lz4 vulners ipaddresses subprocess32

After installing any missing operating system packages, use pip to install the remaining modules:
    sudo pip install pyClamd==0.4.0 PyGithub==1.21.0 GitPython==2.1.15 pybloomfiltermmap==0.3.14 phply==0.9.1 nltk==3.0.1 chardet==3.0.4 tblib==0.2.0 pdfminer==20140328 futures==3.2.0 pyOpenSSL==18.0.0 ndg-httpsclient==0.4.0 pyasn1==0.4.2 lxml==3.4.4 scapy==2.4.0 guess-language==0.2 cluster==1.1.1b3 msgpack==0.5.6 python-ntlm==1.0.1 halberd==0.2.4 darts.util.lru==0.5 Jinja2==2.10 vulndb==0.1.1 markdown==2.6.1 psutil==5.4.8 ds-store==1.1.2 termcolor==1.1.0 mitmproxy==0.13 ruamel.ordereddict==0.4.8 Flask==0.10.1 PyYAML==3.12 tldextract==1.7.2 pebble==4.3.8 acora==2.1 esmre==0.3.1 diff-match-patch==20121119 bravado-core==5.15.0 lz4==1.1.0 vulners==1.3.0 ipaddresses==0.0.2 subprocess32==3.5.4

External programs used by w3af are not installed or were not found.Run these commands to install them on your system:

    npm install -g retire@2.0.3
    npm update -g retire


According to Kali's documentation [0] in order to avoid breaking the packaged w3af version you should run the following commands:

cd ~
apt-get install -y python-pip
pip install --upgrade pip
git clone https/github.com/andresriancho/w3af.git
cd w3af
./w3af_console
. /tmp/w3af_dependency_install.sh

[0] http://www.kali.org/kali-monday/bleeding-edge-kali-repositories/

A script with these commands has been created for you at /tmp/w3af_dependency_install.sh

可以看到w3af为我们保存了一个安装脚本,在 /tmp/w3af_dependency_install.shblu站长之家-易采站长站-Easck.Com

blu站长之家-易采站长站-Easck.Com

执行w3af_dependency_install.sh

┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# bash /tmp/w3af_dependency_install.sh

接下来会出现很多次time out报错:blu站长之家-易采站长站-Easck.Com

Collecting pdfminer==20140328
  Downloading pdfminer-20140328.tar.gz (4.1 MB)
     |█████████████▌                  | 1.7 MB 6.0 kB/s eta 0:06:32ERROR: Exception:
Traceback (most recent call last):                                                             
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 223, in _main                                                                                         
    status = self.run(options, args)                                                           
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/req_command.py", line 180, in wrapper                                                                                        
    return func(self, options, args)                                                           
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 321, in run                                                                                           
    reqs, check_supported_wheels=not options.target_dir                                        
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolution/legacy/resolver.py", line 180, in resolve                                                                             
    discovered_reqs.extend(self._resolve_one(requirement_set, req))                            
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolution/legacy/resolver.py", line 385, in _resolve_one                                                                        
    dist = self._get_dist_for(req_to_install)                                                  
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolution/legacy/resolver.py", line 337, in _get_dist_for                                                                       
    dist = self.preparer.prepare_linked_requirement(req)                                       
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement                                                                  
    return self._prepare_linked_requirement(req, parallel_builds)                              
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 505, in _prepare_linked_requirement                                                                 
    self.download_dir, hashes,                                                                 
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 257, in unpack_url                                                                                  
    hashes=hashes,                                                                             
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 130, in get_http_url                                                                                
    from_path, content_type = download(link, temp_dir.path)                                    
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/network/download.py", line 163, in __call__                                                                                      
    for chunk in chunks:                                                                       
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/progress_bars.py", line 168, in iter                                                                                         
    for x in it:                                                                               
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/network/utils.py", line 88, in response_chunks                                                                                   
    decode_content=False,                                                                      
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/response.py", line 576, in stream                                                                                          
    data = self.read(amt=amt, decode_content=decode_content)                                   
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/response.py", line 541, in read                                                                                            
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)                           
  File "/usr/lib/python2.7/contextlib.py", line 35, in __exit__                                
    self.gen.throw(type, value, traceback)                                                     
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/response.py", line 451, in _error_catcher                                                                                  
    raise ReadTimeoutError(self._pool, None, "Read timed out.")                                
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

主要原因就是网不好,需要多次尝试,我大概下了20几次把他都下载完了。blu站长之家-易采站长站-Easck.Com

最后都下载完成再运行的时候会出现这个:blu站长之家-易采站长站-Easck.Com

┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# ./w3af_console                      
External programs used by w3af are not installed or were not found.Run these commands to install them on your system:

    npm install -g retire@2.0.3
    npm update -g retire


According to Kali's documentation [0] in order to avoid breaking the packaged w3af version you should run the following commands:

cd ~
apt-get install -y python-pip
pip install --upgrade pip
git clone https/github.com/andresriancho/w3af.git
cd w3af
./w3af_console
. /tmp/w3af_dependency_install.sh

[0] http://www.kali.org/kali-monday/bleeding-edge-kali-repositories/

A script with these commands has been created for you at /tmp/w3af_dependency_install.sh

这是需要你下载retire@2.0.3和升级它blu站长之家-易采站长站-Easck.Com

首先安装npmblu站长之家-易采站长站-Easck.Com

┌──(root㉿kali)-[/tmp]
└─# apt-get install npm
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成                 
npm 已经是最新版 (8.12.1~ds1-1)。
下列软件包是自动安装的并且现在不需要了:
  python3-distlib python3-filelock python3-pip-whl python3-platformdirs python3-setuptools-whl
  python3-wheel python3-wheel-whl
使用'apt autoremove'来卸载它(它们)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 475 个软件包未被升级。

然后再执行:blu站长之家-易采站长站-Easck.Com

┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# npm install -g retire@2.0.3

blu站长之家-易采站长站-Easck.Com

启动w3af命令行

在上述安装完毕后,就可以启动w3af命令行版了blu站长之家-易采站长站-Easck.Com

┌──(root㉿kali)-[/usr/w3af/w3af-master]
└─# ./w3af_console             
/usr/share/offsec-awae-wheels/pyOpenSSL-19.1.0-py2.py3-none-any.whl/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
Usage of w3af for sending any traffic to a target without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program.

Do you accept the terms and conditions? [N|y] y

到此这篇关于kali-linux 202202 安装w3af命令行版的文章就介绍到这了,更多相关kali-linux 安装w3af内容请搜索易采站长站以前的文章或继续浏览下面的相关文章希望大家以后多多支持易采站长站!blu站长之家-易采站长站-Easck.Com

如有侵权,请联系QQ:279390809 电话:15144810328

相关文章

  • Intellij idea2020永久破解,亲测可用!!!

    Intellij idea2020永久破解,亲测可用!!!

    前言 随着 IDEA 的 2020 版本的发布,新增和优化了很多的功能,今天陈某不说新增的功能,来讲一讲如何永久破解。不说别的,先上破解后的效果图: 如何破解? 破解过程很简单,基本
    2020-05-10
  • IntelliJ IDEA 2020最新注册码(亲测有效,可激活至 2089 年)

    IntelliJ IDEA 2020最新注册码(亲测有效,可激活至 2089 年)

    申明:本教程 IntelliJ IDEA 破解补丁、激活码均收集于网络,请勿商用,仅供个人学习使用,如有侵权,请联系作者删除。 注意 本教程适用于 IntelliJ IDEA 2020.1 以下所有版本,请放心食用
    2020-05-10
  • vscode修改默认浏览器的方法

    vscode修改默认浏览器的方法

    vscode怎么浏览器打开html预览?这里大家可以通过安装open in browser插件解决。 1.vscode怎么浏览器预览 1.点击拓展 2.输入open in browser,选择第一个 3.点击安装(笔者已安装,所以显示的禁用
    2020-02-19
  • 详解Idea 2020 找不到或无法安装官方汉化包解决方案

    详解Idea 2020 找不到或无法安装官方汉化包解决方案

    Idea 2020 发布之后,官方终于支持了中文语言包 但是,我下载后在插件市场无法找到官方的汉化包 那要怎么解决这个问题呢? 首先,查看你当前Idea的Bulid版本 然后去官网下载离线汉化
    2020-04-28
  • JetPack开发中使用CameraX完成拍照和拍视频功能

    JetPack开发中使用CameraX完成拍照和拍视频功能

    前段时间CameraX的Beta版发布了,这几天有时间也来尝试一下。Beta版本是对外测试版本,意味着它已经走出实验室走向生产,API的调用基本稳定不会大改了,bug也会更少可以用于生成环境
    2020-06-04
  • js获取富文本中的第一张图片(正则表达式)

    js获取富文本中的第一张图片(正则表达式)

    js获取富文本中的第一张图片url正则公式及去除字符串里面的html标签 后台发来一个富文本字符串里面可能包含了0、1、2、3…个图片标签(img),我们的任务是获取这个字符串里面第一张
    2020-02-21
  • js获取UEditor富文本编辑器中的图片地址

    js获取UEditor富文本编辑器中的图片地址

    写之前在网上找了很多方法,最简单的思路应该是1.获取UEditor中的内容;2.将获取到的字符串转换成jquery对象;3.选择器找到img元素,获取src值。 var content= UE.getEditor('details').getContent()
    2020-02-21
  • 十步搞定uni-app使用字体图标的方法

    十步搞定uni-app使用字体图标的方法

    uni-app简介 uni-app是一个使用Vue.js开发跨平台应用的前端框架,开发者编写一套代码,可编译到iOS、Android、H5、小程序等多个平台。 uni-app框架由Dcloud即数字天堂(北京)网络技术有限公司推
    2020-04-23