trustedsec / ptf

The Penetration Testers Framework (PTF) is a way for modular support for up-to-date tools.
5.12k stars 1.23k forks source link

Installing modules fails on ArchLinux if dependencies are not defined #80

Closed mdeous closed 8 years ago

mdeous commented 8 years ago

It seems that only modules/vulnerability-analysis/ftpmap is installable on ArchLinux, as it's the only one who has ArchLinux dependencies defined (i.e. the ARCHLINUX variable), trying to install any other module on ArchLinux makes ptf crash.

Any attempt to install a module on ArchLinux results in the following error:

ptf> use modules/exploitation/beef
ptf:(modules/exploitation/beef)>install

Module Author:         David Kennedy (ReL1K)
Module Description:    This module will install/update the Browser Exploitation Framework (BeEF)
-------------------------------------------------------------------------------------
INSTALL_TYPE:           GIT
REPOSITORY_LOCATION:    https://github.com/beefproject/beef
INSTALL_LOCATION:       /pentest/exploitation/beef/
-------------------------------------------------------------------------------------
[*] Preparing dependencies for module: modules/exploitation/beef
[!] Warning, module modules/exploitation/beef was found but contains no ARCHLINUX field.
[!] Check the module again for errors and try again.
[!] Module has been removed from the list.
Traceback (most recent call last):
  File "ptf", line 63, in <module>
    import src.framework
  File "/data/Tools/ptf/src/framework.py", line 454, in <module>
    use_module(prompt[1], "0")
  File "/data/Tools/ptf/src/framework.py", line 242, in use_module
    base_install_modules(arch_modules) 
  File "/data/Tools/ptf/src/platforms/archlinux.py", line 12, in base_install_modules
    modules = module_name.replace(",", " ")
AttributeError: 'NoneType' object has no attribute 'replace'

I know maintaining dependencies lists for every existing distro on earth isn't possible, but at least install shouldn't crash like this. An option when the ARCHLINUX variable is missing might be to notify the user and display the Debian dependencies list, so the user can find the corresponding packets in ArchLinux and install them by himself. Something like this for example:

[*] Preparing dependencies for module: modules/exploitation/beef
[!] Warning, module modules/exploitation/beef was found but contains no ARCHLINUX field.
[!] Warning, unable to automatically install dependencies.
[*] Dependencies for Debian are: foo, bar, baz
[*] install their ArchLinux equivalent and press <Enter> to resume installation

If you think this alternative would be ok for you, I might implement it by myself and make a pull-request, just tell me. Because in its current state, ptf is just not usable on ArchLinux :disappointed: .

trustedsec commented 8 years ago

Fixed in latest version.