w4sp-book / w4sp-lab

Lab environment for the Wireshark for Security Professionals book
https://github.com/w4sp-book/w4sp-lab/wiki/Lab-Installation
71 stars 42 forks source link

Lab stuck after press "setup" button #66

Open chesswithpidgeon opened 4 years ago

chesswithpidgeon commented 4 years ago

Hello everybody,

trying to install the lab, i notice a lot of error.

Apparently randomly, 3 errors occur:

root@kali:/home/w4sp-lab/Downloads/w4sp-lab-master# python w4sp_webapp.py ['which', 'dumpcap'] ['getcap', '/usr/bin/dumpcap'] [] Caps set correctly on dumpcap Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? [] Not enough w4sp/labs images found, building now /home/w4sp-lab/Downloads/w4sp-lab-master/images ['docker', 'build', '-t', 'w4sp/labs:base', 'base'] ['docker', 'build', '-t', 'w4sp/labs:ftp_tel', 'ftp_tel'] ['docker', 'build', '-t', 'w4sp/labs:switch', 'switch'] ['docker', 'build', '-t', 'w4sp/labs:inet', 'inet'] ['docker', 'build', '-t', 'w4sp/labs:elk', 'elk'] ['docker', 'build', '-t', 'w4sp/labs:samba', 'samba'] ['docker', 'build', '-t', 'w4sp/labs:vrrpd', 'vrrpd'] ['docker', 'build', '-t', 'w4sp/labs:temp', 'temp'] ['docker', 'build', '-t', 'w4sp/labs:wireless', 'wireless'] ['docker', 'build', '-t', 'w4sp/labs:victims', 'victims'] ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] ['docker', 'rm', '-f', '1d7f522beb9f'] ['docker', 'rm', '-f', 'd2159739275f'] ['docker', 'rm', '-f', '22d2a9b3cdcc'] ['docker', 'rm', '-f', '552a962ba8a5'] ['docker', 'rm', '-f', '9aa06a9c136c'] ['docker', 'rm', '-f', 'af1a585b7fe8'] ['docker', 'rm', '-f', '63e7e4d217ab'] ['docker', 'rm', '-f', '718034f08b3a'] ['docker', 'rm', '-f', '15d420ddeeba'] ['docker', 'rm', '-f', 'b2818455b912'] ['docker', 'rm', '-f', '228b6eb709db'] ['ifconfig', '-a'] ['ip', 'link', 'delete', 'docker0:'] ['ip', 'link', 'delete', 'eth0:'] RTNETLINK answers: Operation not supported ['ip', 'link', 'delete', 'lo:'] RTNETLINK answers: Operation not supported ['ip', 'netns'] ['pkill', 'dhclient'] ['ifconfig', '-a'] ['service', 'network-manager', 'start'] ['service', 'networking', 'restart'] ['service', 'docker', 'restart']

127.0.0.1 - - [17/May/2020 00:45:20] "GET /setup HTTP/1.1" 200 - {'nodes': [{'color': 'rgb(204,0,0)', 'title': 'eth0 : 10.0.2.15
', 'id': 1, 'label': ' kali '}], 'edges': []} 127.0.0.1 - - [17/May/2020 00:45:20] "GET /getnet HTTP/1.1" 500 - ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[*] Did not shutdown cleanly, trying again
['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Traceback (most recent call last):
File "w4sp_webapp.py", line 164, in setup
w4sp.setup_network2('eth0')
File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp.py", line 39, in setup_network2
docker_clean()
File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 114, in docker_clean
out = r('docker ps -aq --filter label=w4sp=true').split(b'\n')[:-1] File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 83, in r return subprocess.check_output(cmd) File "/usr/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']' returned non-zero exit status 1

127.0.0.1 - - [17/May/2020 00:54:34] "GET /setup HTTP/1.1" 200 - {'nodes': [{'color': 'rgb(204,0,0)', 'title': 'eth0 : 10.0.2.15
', 'id': 1, 'label': ' kali '}], 'edges': []} 127.0.0.1 - - [17/May/2020 00:54:34] "GET /getnet HTTP/1.1" 500 - 127.0.0.1 - - [17/May/2020 00:54:39] "GET / HTTP/1.1" 200 - {'nodes': [{'color': 'rgb(204,0,0)', 'title': 'eth0 : 10.0.2.15
', 'id': 1, 'label': ' kali '}], 'edges': []} 127.0.0.1 - - [17/May/2020 00:54:39] "GET /getnet HTTP/1.1" 500 - ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? [*] Did not shutdown cleanly, trying again ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Traceback (most recent call last): File "w4sp_webapp.py", line 164, in setup w4sp.setup_network2('eth0') File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp.py", line 39, in setup_network2 docker_clean() File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 114, in docker_clean out = r('docker ps -aq --filter label=w4sp=true').split(b'\n')[:-1] File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 83, in r return subprocess.check_output(cmd) File "/usr/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']' returned non-zero exit status 1

127.0.0.1 - - [17/May/2020 00:54:42] "GET /setup HTTP/1.1" 200 - {'nodes': [{'color': 'rgb(204,0,0)', 'title': 'eth0 : 10.0.2.15
', 'id': 1, 'label': ' kali '}], 'edges': []} 127.0.0.1 - - [17/May/2020 00:54:42] "GET /getnet HTTP/1.1" 500 - 127.0.0.1 - - [17/May/2020 00:59:49] "GET / HTTP/1.1" 200 - {'nodes': [{'color': 'rgb(204,0,0)', 'title': 'eth0 : 10.0.2.15
', 'id': 1, 'label': ' kali '}], 'edges': []} 127.0.0.1 - - [17/May/2020 00:59:49] "GET /getnet HTTP/1.1" 500 - ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? [*] Did not shutdown cleanly, trying again ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Traceback (most recent call last): File "w4sp_webapp.py", line 164, in setup w4sp.setup_network2('eth0') File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp.py", line 39, in setup_network2 docker_clean() File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 114, in docker_clean out = r('docker ps -aq --filter label=w4sp=true').split(b'\n')[:-1] File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 83, in r return subprocess.check_output(cmd) File "/usr/lib/python2.7/subprocess.py", line 223, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']' returned non-zero exit status 1

Could you please help me?

Thank you

giacomomangelli commented 4 years ago

hi, i won't give you a real solution, but when it happens to me that i got stuck after pressing setup cause my docker service doesn't start i first check the service status sudo systemctl status docker.service than i force the start sudo systemctl start docker. than you can also do systemctl enable docker to start it from the next reboot. hope it helps a little