示例#1
0
    def test_generate_requirements_txt(self, ci_mock):
        EXPECTED = 'a==1.2.3\nc==3.2.1\n'
        requirements_file = generate_requirements_txt([
            PIPDependency('a', 'a', '1.2.3'),
            PIPDependency('b', 'c', '3.2.1'),
        ])

        self.assertEqual(EXPECTED, file(requirements_file).read())
        os.unlink(requirements_file)
示例#2
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

"""
from w3af.core.controllers.dependency_check.pip_dependency import PIPDependency

CORE = 1
GUI = 2


CORE_PIP_PACKAGES = [PIPDependency('pyclamd', 'pyClamd', '0.3.15'),
                     PIPDependency('github', 'PyGithub', '1.21.0'),
                     PIPDependency('git.util', 'GitPython', '0.3.2.RC1'),
                     PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.14'),
                     PIPDependency('esmre', 'esmre', '0.3.1'),
                     PIPDependency('phply', 'phply', '0.9.1'),
                     PIPDependency('nltk', 'nltk', '3.0.1'),
                     PIPDependency('chardet', 'chardet', '2.1.1'),
                     PIPDependency('tblib', 'tblib', '0.2.0'),
                     PIPDependency('pdfminer', 'pdfminer', '20140328'),
                     PIPDependency('concurrent.futures', 'futures', '2.1.5'),
                     PIPDependency('OpenSSL', 'pyOpenSSL', '0.15.1'),
                     PIPDependency('ndg', 'ndg-httpsclient', '0.3.3'),

                     # We need 0.1.8 because of mitmproxy
                     PIPDependency('pyasn1', 'pyasn1', '0.1.8'),
示例#3
0
w3af is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

"""
from w3af.core.controllers.dependency_check.pip_dependency import PIPDependency

CORE = 1
GUI = 2

CORE_PIP_PACKAGES = [PIPDependency('clamd', 'clamd', '1.0.1'),
                     PIPDependency('github', 'PyGithub', '1.21.0'),
                     PIPDependency('git.util', 'GitPython', '0.3.2.RC1'),
                     PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.11'),
                     PIPDependency('esmre', 'esmre', '0.3.1'),
                     PIPDependency('phply', 'phply', '0.9.1'),
                     PIPDependency('nltk', 'nltk', '2.0.4'),
                     PIPDependency('chardet', 'chardet', '2.1.1'),
                     PIPDependency('pdfminer', 'pdfminer', '20110515'),
                     PIPDependency('concurrent.futures', 'futures', '2.1.5'),
                     PIPDependency('OpenSSL', 'pyOpenSSL', '0.13.1'),
                     PIPDependency('lxml', 'lxml', '2.3.2'),
                     PIPDependency('scapy.config', 'scapy-real', '2.2.0-dev'),
                     PIPDependency('guess_language', 'guess-language', '0.2'),
                     PIPDependency('cluster', 'cluster', '1.1.1b3'),
                     PIPDependency('msgpack', 'msgpack-python', '0.2.4'),
示例#4
0
class MacOSX(Platform):
    SYSTEM_NAME = 'Mac OS X'
    PKG_MANAGER_CMD = 'sudo port install'
    PIP_CMD = 'pip-2.7'

    #
    # Remember to use http://www.macports.org/ports.php to search for
    # packages
    #
    # Python port includes the dev headers
    CORE_SYSTEM_PACKAGES = [
        'py27-pip', 'python27', 'py27-setuptools', 'gcc48', 'autoconf',
        'automake', 'git-core', 'py27-pcapy', 'py27-libdnet', 'libffi'
    ]

    GUI_SYSTEM_PACKAGES = CORE_SYSTEM_PACKAGES[:]
    GUI_SYSTEM_PACKAGES.extend(
        ['graphviz', 'py27-pygtksourceview', 'py27-pygtk'])

    SYSTEM_PACKAGES = {CORE: CORE_SYSTEM_PACKAGES, GUI: GUI_SYSTEM_PACKAGES}

    # pybloomfilter is broken in Mac OS X, so we don't require it
    # https://github.com/andresriancho/w3af/issues/485
    MAC_CORE_PIP_PACKAGES = CORE_PIP_PACKAGES[:]
    MAC_CORE_PIP_PACKAGES.remove(
        PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.11'))

    MAC_GUI_PIP_PACKAGES = MAC_CORE_PIP_PACKAGES[:]
    MAC_GUI_PIP_PACKAGES.extend(GUI_PIP_EXTRAS)

    PIP_PACKAGES = {CORE: MAC_CORE_PIP_PACKAGES, GUI: MAC_GUI_PIP_PACKAGES}

    @staticmethod
    def is_current_platform():
        return 'darwin' in platform.dist() or 'mac' in platform.dist()

    @staticmethod
    def os_package_is_installed(package_name):
        not_installed = 'None of the specified ports are installed'
        installed = 'The following ports are currently installed'

        try:
            p = subprocess.Popen(['port', '-v', 'installed', package_name],
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE)
        except OSError:
            # We're not on a mac based system
            return None
        else:
            port_output, _ = p.communicate()

            if not_installed in port_output:
                return False
            elif installed in port_output:
                return True
            else:
                return None

    @staticmethod
    def after_hook():
        # Is the default python executable the one in macports?
        #
        # We need to warn the user about this situation and let him know how to
        # fix. See: http://stackoverflow.com/questions/118813/
        if sys.executable.startswith('/opt/'):
            # That's what we need since pip-2.7 will install all the libs in
            # that python site-packages directory
            pass
        else:
            print TWO_PYTHON_MSG % sys.executable

        #check if scapy is correctly installed/working on OSX
        try:
            from scapy.all import traceroute
        except ImportError:
            # The user just needs to work on his dependencies.
            pass
        except OSError, ose:
            if "Device not configured" in str(ose):
                print(TRACEROUTE_SCAPY_MSG)
示例#5
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

"""
from w3af.core.controllers.dependency_check.pip_dependency import PIPDependency

PHPLY_GIT = 'git+https://github.com/andresriancho/phply.git#egg=phply'
PHPLY_GIT_TGZ = 'https://github.com/andresriancho/phply/archive/0.9.1.tar.gz#egg=phply'

PIP_PACKAGES = [
    PIPDependency('clamd', 'clamd', '1.0.1'),
    PIPDependency('github', 'PyGithub', '1.21.0'),
    PIPDependency('git.util', 'GitPython', '0.3.2.RC1'),
    PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.11'),
    PIPDependency('esmre', 'esmre', '0.3.1'),
    PIPDependency('phply',
                  'phply',
                  '0.9.1',
                  git_src=PHPLY_GIT,
                  tgz_src=PHPLY_GIT_TGZ),
    PIPDependency('nltk', 'nltk', '2.0.4'),
    PIPDependency('chardet', 'chardet', '2.1.1'),
    PIPDependency('pdfminer', 'pdfminer', '20110515'),
    PIPDependency('concurrent.futures', 'futures', '2.1.5'),
    PIPDependency('OpenSSL', 'pyOpenSSL', '0.13.1'),
    PIPDependency('lxml', 'lxml', '2.3.2'),
示例#6
0
"""
requirements.py

Copyright 2013 Andres Riancho

This file is part of w3af, http://w3af.org/ .

w3af is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 2 of the License.

w3af is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

"""
from w3af.core.controllers.dependency_check.pip_dependency import PIPDependency
from w3af.core.controllers.dependency_check.requirements import PIP_PACKAGES

# I imported the information from the core, now I need to append the GUI
# requirements to those lists!
PIP_PACKAGES.extend([
    PIPDependency('xdot', 'xdot', '0.6'),
])
示例#7
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

"""
from w3af.core.controllers.dependency_check.pip_dependency import PIPDependency

CORE = 1
GUI = 2

CORE_PIP_PACKAGES = [
    PIPDependency('pyclamd', 'pyClamd', '0.4.0'),
    PIPDependency('github', 'PyGithub', '1.21.0'),
    PIPDependency('git.util', 'GitPython', '2.1.3'),
    PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.14'),
    PIPDependency('phply', 'phply', '0.9.1'),
    PIPDependency('nltk', 'nltk', '3.0.1'),
    PIPDependency('chardet', 'chardet', '3.0.4'),
    PIPDependency('tblib', 'tblib', '0.2.0'),
    PIPDependency('pdfminer', 'pdfminer', '20140328'),
    PIPDependency('concurrent.futures', 'futures', '3.2.0'),
    PIPDependency('OpenSSL', 'pyOpenSSL', '18.0.0'),
    PIPDependency('ndg', 'ndg-httpsclient', '0.4.0'),

    # We need 0.1.8 because of mitmproxy
    PIPDependency('pyasn1', 'pyasn1', '0.4.2'),
    PIPDependency('lxml', 'lxml', '3.4.4'),
示例#8
0
文件: mac.py 项目: fooying/w3af
#    Remember to use http://www.macports.org/ports.php to search for packages
#
SYSTEM_PACKAGES = {
    'PIP': ['py27-pip'],
    # Python port includes the dev headers
    'C_BUILD':
    ['python27', 'py27-setuptools', 'gcc48', 'autoconf', 'automake'],
    'GIT': ['git-core'],
    'SCAPY': ['py27-pcapy', 'py27-libdnet'],
}
PIP_CMD = 'pip-2.7'

# pybloomfilter is broken in Mac OS X, so we don't require it
# https://github.com/andresriancho/w3af/issues/485
PIP_PACKAGES.remove(
    PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.11'))


def os_package_is_installed(package_name):
    not_installed = 'None of the specified ports are installed'
    installed = 'The following ports are currently installed'

    try:
        p = subprocess.Popen(['port', '-v', 'installed', package_name],
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
    except OSError:
        # We're not on a debian based system
        return None
    else:
        port_output, _ = p.communicate()
示例#9
0
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with w3af; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

"""
from w3af.core.controllers.dependency_check.pip_dependency import PIPDependency

CORE = 1
GUI = 2

CORE_PIP_PACKAGES = [
    PIPDependency('clamd', 'clamd', '1.0.1'),
    PIPDependency('github', 'PyGithub', '1.21.0'),
    PIPDependency('git.util', 'GitPython', '0.3.2.RC1'),
    PIPDependency('pybloomfilter', 'pybloomfiltermmap', '0.3.11'),
    PIPDependency('esmre', 'esmre', '0.3.1'),
    PIPDependency('phply', 'phply', '0.9.1'),
    PIPDependency('stopit', 'stopit', '1.1.0'),
    PIPDependency('nltk', 'nltk', '3.0.1'),
    PIPDependency('chardet', 'chardet', '2.1.1'),
    PIPDependency('tblib', 'tblib', '0.2.0'),
    PIPDependency('pdfminer', 'pdfminer', '20140328'),
    PIPDependency('concurrent.futures', 'futures', '2.1.5'),
    PIPDependency('OpenSSL', 'pyOpenSSL', '0.13.1'),
    PIPDependency('ndg', 'ndg-httpsclient', '0.3.3'),

    # There is a newer pyasn1 release, but we're requiring this