当前位置: 首页 > 工具软件 > bash-parser > 使用案例 >

安装 OpenSSH-Network-Parser

曹旭
2023-12-01

安装 OpenSSH-Network-Parser

第一次尝试

从github上下载压缩包:https://github.com/fox-it/OpenSSH-Network-Parser

可以直接

git clone https://github.com/fox-it/OpenSSH-Network-Parser.git

解压后,使用python2运行

python setup.py install

发现报错

修改setup.py文件

打开setup.py

from setuptools import setup, find_packages


setup(
    name="openssh-network-parser",
    version="1.0",
    description="Framework to decrypt and parse OpenSSH traffic.",
    packages=find_packages(),
    use_scm_version=True,
    include_package_data=True,
    setup_requires=['setuptools_scm'],
    python_requires='>=2.7, <3', #pynids is not compatible with py3 :(
    install_requires=[
        'dissect.cstruct==1.0.0',
        'psutil',
        'tabulate',
        'gevent',
        'libnacl',
        'cryptography',
        'pynids @ https://github.com/MITRECND/pynids/tarball/master#egg=pynids-0.6.2'
    ],
    entry_points = {
        'console_scripts': [
            'network-parser=openssh_network_parser.tools.network_parser:main',
        ]
    }
)

发现有一行setup_requires=['setuptools_scm'],将其删除。

再安装setup.py中的库:

dissect.cstruct==1.0.0
psutil
tabulate
gevent
libnacl
cryptography
pynids

安装库

可直接安装的库

使用pip直接安装:

pip install dissect.cstruct==1.0.0
pip install psutil
pip install tabulate
pip isntall libnacl
pip install cryptography
pip install python-dev

无法直接安装的库

使用whl文件安装:

从https://pypi.org/project/gevent/1.2.0/#files下载whl文件:

https://files.pythonhosted.org/packages/ec/a0/6bc3a7aa5945ac26ff44775cd2df59fc89904392715aaa2af78065af0806/gevent-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl

使用pip安装:

pip install gevent-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl

源码安装

从github上下载源码:

git clone https://github.com/MITRECND/pynids

解压

tar zxvf MITRECND-pynids-0.6.2-4-g6a385a3.tar.gz

安装支撑库:

sudo apt-get install libnet-dev
sudo apt-get install libpcap-dev
sudo apt-get install libnids-dev

安装pynids

cd MITRECND-pynids-6a385a3
python2 setup.py install

安装 OpenSSH-Network-Parser

进入 OpenSSH-Network-Parser 的目录,再次使用python2安装:

python2 setup.py install

即可完成安装。

作者博客:www.on-l.xyz

 类似资料: