1

I am working on a project for an educational course. I am trying to set up a Cowrie honeypot on an Ubuntu 16.04 VM. I have followed the instructions from this site https://cowrie.readthedocs.io/en/latest/INSTALL.html. The first of which is to install dependencies, which is where things go awry*.


The command I used is as follows:

sudo apt-get install git python3-virtualenv libssl-dev libffi-dev build-essential libpython3-dev python3-minimal authbind virtualenv

When I enter this I get the following

Reading package lists... Done
Building dependency tree      
Reading state information... Done
python3-virtualenv is already the newest version (15.0.1+ds-3).
virtualenv is already the newest version (15.0.1+ds-3).
authbind is already the newest version (2.1.1+nmu1).
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1).
libffi-dev is already the newest version (3.2.1-4).
python3-minimal is already the newest version (3.5.1-3).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpython3-dev : Depends: libpython3.5-dev (>= 3.5.1-2~) but it is not going to be installed
 libssl-dev : Depends: libssl1.0.0 (= 1.0.2g-1ubuntu4) but 1.0.2g-1ubuntu4.15 is to be installed
              Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I then tried to manually install each dependency. For example, as can be seen above, libpython3-dev depends on libpython3.5-dev. So I try to install libpython3.5-dev and here is what happens:

sudo apt-get install libpython3.5-dev
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpython3.5-dev : Depends: libpython3.5-stdlib (= 3.5.1-10) but 3.5.2-2ubuntu0~16.04.9 is to be installed
                    Depends: libpython3.5 (= 3.5.1-10) but 3.5.2-2ubuntu0~16.04.9 is to be installed
E: Unable to correct problems, you have held broken packages.

Ok, so libpython3.5-dev depends upon libpython3.5, again I try to install:

sudo apt-get install libpython3.5
[sudo] password for administrator:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
libpython3.5 is already the newest version (3.5.2-2ubuntu0~16.04.9).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So after chasing the dependency train to the bottom, I am told that the needed package/item is already at the newest version. At this point I am unsure how to proceed, and various solutions offered online (use aptitude instead, clean/autoclean the cache, autofixing) have not worked. I could just start over entirely on a different virtual machine but that doesn't teach me anything, and this machine was earmarked for the honeypot.

*Full disclosure, there is a later step from those instructions where things went wrong and I assumed it was because this first step did not complete without a problem (I naively continued after seeing the dependency problem). I assume it is related to the dependency issue above because the error seems to indicate a syntax problem regarding python files. That later step in the installation of cowrie is after you activate the virtual cowrie environment (notice the prompt). The error is as follows:

(cowrie-env) cowrie@secureset:~/cowrie$ pip install --upgrade pip
Failed to import the site module
Traceback (most recent call last):
  File "/home/cowrie/cowrie/cowrie-env/lib/python3.5/site.py", line 703, in <module>
    main()
  File "/home/cowrie/cowrie/cowrie-env/lib/python3.5/site.py", line 683, in main
    paths_in_sys = addsitepackages(paths_in_sys)
  File "/home/cowrie/cowrie/cowrie-env/lib/python3.5/site.py", line 282, in addsitepackages
    addsitedir(sitedir, known_paths)
  File "/home/cowrie/cowrie/cowrie-env/lib/python3.5/site.py", line 204, in addsitedir
    addpackage(sitedir, name, known_paths)
  File "/home/cowrie/cowrie/cowrie-env/lib/python3.5/site.py", line 173, in addpackage
    exec(line)
  File "<string>", line 1, in <module>
  File "/home/cowrie/cowrie/cowrie-env/lib/python3.5/site-packages/_distutils_hack/__init__.py", line 194
    f'spec_for_{name}',
                     ^
SyntaxError: invalid syntax

Do not ask me to post this to askUbuntu, 16.04 is not supported. It is probably clear that I am a novice, but I am trying to learn and graciously appreciate any guidance.

1

0

You must log in to answer this question.

Browse other questions tagged .