mushorg / glastopf

Web Application Honeypot
http://glastopf.org
558 stars 169 forks source link

Error messages after installation #204

Closed zappe closed 7 years ago

zappe commented 9 years ago

We noticed some error messages when installing on Ubuntu 14.10. Is there some compatability issues for that version? Since it seems to work fine in 12.04

/opt/BFR# tail -n 30 /root/.pip/pip.log 

    return _do_download(version, download_base, to_dir, download_delay)

  File "distribute_setup.py", line 132, in _do_download

    _build_egg(egg, tarball, to_dir)

  File "distribute_setup.py", line 123, in _build_egg

    raise IOError('Could not build the egg.')

IOError: Could not build the egg.

Cleaning up... Removing temporary dir /tmp/pip_build_root... Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/glastopf Exception information:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1229, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 325, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/glastopf
glaslos commented 9 years ago

Can you try updating 'updatetools': https://github.com/glastopf/glastopf/issues/200

zappe commented 9 years ago

It seems to already be up to date

Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages Cleaning up...

glaslos commented 9 years ago

Have you check the other solutions recommended in #200 ? Re-installing distribute?

zappe commented 9 years ago

No it got stuck on this instead

Downloading/unpacking hpfeeds (from glastopf) Could not find any downloads that satisfy the requirement hpfeeds (from glastopf) Some externally hosted files were ignored (use --allow-external hpfeeds to allow). Cleaning up... No distributions at all found for hpfeeds (from glastopf) Storing debug log for failure in /root/.pip/pip.log

glaslos commented 9 years ago

Have you tried installing it manually?

zappe commented 9 years ago

No, we used MHN to deploy it.

You mean like https://github.com/glastopf/glastopf/blob/master/docs/source/installation/installation_ubuntu.rst this?

glaslos commented 9 years ago

Get the zip from here: https://github.com/rep/hpfeeds and run the setup.py

glaslos commented 9 years ago

NHM has a ./install_hpfeeds.sh script

zappe commented 9 years ago

I closed this by mistake, the installation went fine. Though I get some errors in .out log file

Traceback (most recent call last):
  File "/usr/local/bin/glastopf-runner", line 80, in <module>
    honeypot = GlastopfHoneypot(work_dir=args.workdir)
  File "/usr/local/lib/python2.7/dist-packages/glastopf/glastopf.py", line 78, in __init__
    self.dork_generator = self.setup_dork_generator(conf_parser, self.work_dir)
  File "/usr/local/lib/python2.7/dist-packages/glastopf/glastopf.py", line 145, in setup_dork_generator
    mnem_service_instance=mnemosyne_service)
  File "/usr/local/lib/python2.7/dist-packages/glastopf/modules/handlers/emulators/dork_list/dork_page_generator.py", line 60, in __init__
    self.bootstrap_dorkdb()
  File "/usr/local/lib/python2.7/dist-packages/glastopf/modules/handlers/emulators/dork_list/dork_page_generator.py", line 155, in bootstrap_dorkdb
    dorks = self.mnem_service.get_dorks()
  File "/usr/local/lib/python2.7/dist-packages/glastopf/modules/handlers/emulators/dork_list/mnem_service.py", line 35, in get_dorks
    response = sess.post(base_url + '/login', payload, timeout=timeout, verify=False)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 498, in post
    return self.request('POST', url, data=data, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 456, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 559, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 327, in send
    timeout=timeout
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 496, in urlopen
    body=body, headers=headers)
  File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line 298, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 812, in send
    self.connect()
  File "/usr/lib/python2.7/dist-packages/urllib3/connection.py", line 218, in connect
    ssl_version=resolved_ssl_version)
  File "/usr/lib/python2.7/dist-packages/urllib3/util/ssl_.py", line 124, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python2.7/ssl.py", line 350, in wrap_socket
    _context=self)
TypeError: __init__() got an unexpected keyword argument 'server_hostname'

Might be related to https://github.com/shazow/urllib3/issues/482 ?

glaslos commented 9 years ago

hm, might be related. Can you try to upgrade gevent and urllib3 first? pip install -U gevent urllib3

zappe commented 9 years ago

urllib3 was already up to date, but gevent was updated to the latest version. Unfortunately it didn't solve the problem

glaslos commented 9 years ago

It seems to be that your python ssl library and urllib3 are not compatible. Do you need the urllib3 module installed? requests ships it's own version of it. Remove ssl, urllib3 and requests. Then install requests. Make sure the files are properly removed. After uninstalling make sure that importing causes an import error. After installation, try:

import requests
r = requests.get('https://google.com')