-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cowrie fails to deploy #835
Comments
Note, selecting 'python-dev-is-python2' instead of 'python-dev' E: Package 'python-virtualenv' has no installation candidate Here's the original deploy script result. Ubuntu 20.04 Server. |
After some tinkering, i got this: |
I just want to note that this project is not capable of using Python >2.7 in a number of locations. You've gone outside the norm by utilizing cowrie on Ubuntu 20.04 and with Python 3. This version of cowrie is utilized because it supports Python 2.7 still: Line 35 in d15325c
|
Well, it "mostly" works until now...just this last part of print obj...it breaks here. the rest i think is pretty much straightforward, it's just the HPF variables and supervisorctl...any help on this? |
I changed the following and was able to successfully install cowrie on Ubuntu 20.04, but it's stuck in a "STARTING" state: mhn/server/mhn/static/registration.txt Line 36 in d15325c
python -c 'import json;f=open("/tmp/deploy.json");obj=json.load(f);print(obj["uuid"]);' mhn/server/mhn/static/registration.txt Line 52 in d15325c
python -c 'import json;f=open("/tmp/deploy.json");obj=json.load(f);print(obj["identifier"]);' mhn/server/mhn/static/registration.txt Line 53 in d15325c
python -c 'import json;f=open("/tmp/deploy.json");obj=json.load(f);print(obj["secret"]);'
stuck :(
followed by a fail
I did this all by making a new registration.txt file and updating this part of the Line 62 in d15325c
After putting some time into this issue, I would suggest just using Ubuntu 18.04 since that is verified to work with MHN. The |
@wrharding by all means mate! My "fault" for using ubuntu 20.04, not the MHN team! Yeah, i managed to do some work and figured it was something to do with the python command on the registration.txt file. Will try the ubuntu 16.04 with cowrie to see if it eases my pain! |
Well, ubuntu 16.04 isn't much better... Collecting setuptools (from supervisor)
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-W6SX8t/setuptools/ |
Hi , Did you get solution of this?. I am stuck with the same error. |
Hey there! I've been having issues with Cowrie while using the deploy script from MHN.
Changed pip references to pip3 and virtualenv as well. Supervisorctl shows nothing and MHN doesn't even register the probe.
Here's my deploy script:
#!/bin/bash
set -e
set -x
if [ $# -ne 2 ]
then
echo "Wrong number of arguments supplied."
echo "Usage: $0 <server_url> <deploy_key>."
exit 1
fi
apt-get update
apt-get install -y python
server_url=$1
deploy_key=$2
apt-get update
apt-get -y install python-dev git supervisor authbind openssl python3-virtualenv build-essential libgmp-dev libmpfr-dev libmpc-dev libssl-dev python3-pip libffi-dev
pip3 install gmpy
pip install -U supervisor
/etc/init.d/supervisor start || true
sed -i 's/#Port/Port/g' /etc/ssh/sshd_config
sed -i 's/Port 22$/Port 2222/g' /etc/ssh/sshd_config
service ssh restart
useradd -d /home/cowrie -s /bin/bash -m cowrie -g users
cd /opt
git clone https://github.com/micheloosterhof/cowrie.git cowrie
cd cowrie
Most recent known working version
git checkout 34f8464
Config for requirements.txt
cat > /opt/cowrie/requirements.txt <=17.1.0
cryptography>=2.1
configparser
pyopenssl
pyparsing
packaging
appdirs>=1.4.0
pyasn1_modules
attrs
service_identity
python-dateutil
tftpy
bcrypt
EOF
virtualenv --python=python3 cowrie-env #env name has changed to cowrie-env on latest version of cowrie
source cowrie-env/bin/activate
without the following, i get this error:
Could not find a version that satisfies the requirement csirtgsdk (from -r requirements.txt (line 10)) (from versions: 0.0.0a5, 0.0.0a6, 0.0.0a5.linux-x86_64, 0.0.0a6.linux-x86_64, 0.0.0a3)
pip install csirtgsdk==0.0.0a6
pip install -r requirements.txt
Register sensor with MHN server.
wget $server_url/static/registration.txt -O registration.sh
chmod 755 registration.sh
Note: this will export the HPF_* variables
. ./registration.sh $server_url $deploy_key "cowrie"
cd etc
cp cowrie.cfg.dist cowrie.cfg
sed -i 's/hostname = svr04/hostname = server/g' cowrie.cfg
sed -i 's/listen_endpoints = tcp:2222:interface=0.0.0.0/listen_endpoints = tcp:22:interface=0.0.0.0/g' cowrie.cfg
sed -i 's/version = SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2/version = SSH-2.0-OpenSSH_6.7p1 Ubuntu-5ubuntu1.3/g' cowrie.cfg
sed -i 's/#[output_hpfeeds]/[output_hpfeeds]/g' cowrie.cfg
sed -i '/[output_hpfeeds]/!b;n;cenabled = true' cowrie.cfg
sed -i "s/#server = hpfeeds.mysite.org/server = $HPF_HOST/g" cowrie.cfg
sed -i "s/#port = 10000/port = $HPF_PORT/g" cowrie.cfg
sed -i "s/#identifier = abc123/identifier = $HPF_IDENT/g" cowrie.cfg
sed -i "s/#secret = secret/secret = $HPF_SECRET/g" cowrie.cfg
sed -i 's/#debug=false/debug=false/' cowrie.cfg
cd ..
chown -R cowrie:users /opt/cowrie/
touch /etc/authbind/byport/22
chown cowrie /etc/authbind/byport/22
chmod 770 /etc/authbind/byport/22
start.sh is deprecated on new Cowrie version and substituted by "bin/cowrie [start/stop/status]"
sed -i 's/AUTHBIND_ENABLED=no/AUTHBIND_ENABLED=yes/' bin/cowrie
sed -i 's/DAEMONIZE=""/DAEMONIZE="-n"/' bin/cowrie
Config for supervisor
cat > /etc/supervisor/conf.d/cowrie.conf <<EOF
[program:cowrie]
command=/opt/cowrie/bin/cowrie start
directory=/opt/cowrie
stdout_logfile=/opt/cowrie/var/log/cowrie/cowrie.out
stderr_logfile=/opt/cowrie/var/log/cowrie/cowrie.err
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=cowrie
EOF
supervisorctl update
What am i missing? The default script has 3 broken dependencies i think, python-virtualenv, gmpy and one other that i dont recall...any help?
The text was updated successfully, but these errors were encountered: