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

Error Starting Lab #16

Open w4sp-user1 opened 7 years ago

w4sp-user1 commented 7 years ago

The Lab was working fine after initial setup in Chapter 2, but when I went to use it again in Chapter 5, I get the error below.

DETAILS: When I boot the VM, I was prompted to update Virtualbox -- so I did. Since, I've also ran the Kali update as per the setup instructions on this site [sudo apt-get update && sudo apt-get dist-upgrade]. But I'm still get the same error.

The syntax of the failing command seems OK to me. I have no problem manually downloading and opening the public key file [https://packages.elastic.co/GPG-KEY-elasticsearch] in the text editor. In-fact, I can manually run the entire command without error.

w4sp-lab@W4SP:~/Downloads/w4sp-lab-master$ sudo python w4sp_webapp.py['which', 'dumpcap'] ['getcap', '/usr/bin/dumpcap'] [] Caps set correctly on dumpcap [] 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:elk', 'elk'] The command '/bin/sh -c wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -' returned a non-zero code: 2 Traceback (most recent call last): File "w4sp_webapp.py", line 499, in w4sp.docker_build('images/') File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py", line 102, in docker_build r('docker build -t $image_name $image') 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 219, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['docker', 'build', '-t', 'w4sp/labs:elk', 'elk']' returned non-zero exit status 2

w4sp-book commented 7 years ago

@w4sp-user1 hmm, ok, so it looks like something has changed in the docker networking....again....I was able to reproduce this issue. I was also able to fix it by editing /etc/docker/daemon.json, and changing the iptables value from false to true.

Can you give this a try and let me know if it fixes your issue? I am also slightly worried as I disabled this previously because of another docker networking change that made it were their iptables rules was breaking the lab, although trying it on my machine everything seemed to work. Please let me know if changing that configuration fixes the issue and if you notice any connectivity issues with the lab.

Also keep in mind that right now there is another bug in the lab that whenever you hit the 'SETUP' button it will error out and hang. It looks bad but you can just hit the refresh button and everything keeps working.

w4sp-user1 commented 7 years ago

Got much farther, but an other error popped up.

On 8/22/2017 5:54 PM, w4sp-book wrote:

@w4sp-user1 https://github.com/w4sp-user1 hmm, ok, so it looks like something has changed in the docker networking....again....I was able to reproduce this issue. I was also able to fix it by editing /etc/docker/daemon.json, and changing the iptables value from false to true.

Can you give this a try and let me know if it fixes your issue? I am also slightly worried as I disabled this previously because of another docker networking change that made it were their iptables rules was breaking the lab, although trying it on my machine everything seemed to work. Please let me know if changing that configuration fixes the issue and if you notice any connectivity issues with the lab.

Also keep in mind that right now there is another bug in the lab that whenever you hit the 'SETUP' button it will error out and hang. It looks bad but you can just hit the refresh button and everything keeps working.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w4sp-book/w4sp-lab/issues/16#issuecomment-324173887, or mute the thread https://github.com/notifications/unsubscribe-auth/Adz4yt8GN1oABZlrvZ79QMM-K3vmNT43ks5sa1w6gaJpZM4O_Ptg.

w4sp-book commented 7 years ago

@w4sp-user1 whats the error you are getting now?

w4sp-user1 commented 7 years ago

Sorry, I attached a screen shot, but I guess it got stripped out. Here’s the text version of the error.

4sp-lab@W4SP:~/Downloads/w4sp-lab-masters sudo python w4sp_webapp.py

['which', 'dumpcap']

[‘getcap', ‘/usr/bin/dumpcap']

[*1 Caps set correctly on dumpcap

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker

daemon running?

[*1 Not enough w4sp/labs images found, building now

[home/w4sp-lab/Downloads/w4sp-lab-master/images

|['docker', 'build', '-t', 'w4sp/labszbase', 'base']

[‘docker', 'build', '-t', 'w4sp/labs:elk', 'elk']

'['docker', 'build'. '-t', 'w4sp/labs:inet', 'inet']

|['docker'. 'build', '-t', 'w4sp/labs:vrrpd', 'vrrpd']

['docker', 'build', '-t', 'w4sp/labszswitch', 'switch']

|['docker', 'build'. '-t', 'w4sp/labs:temp', 'temp']

[‘docker', ‘build'. '-t', 'w4sp/labs:samba', 'samba']

[‘docker', 'build', '-t', 'w4sp/labszwireless', 'wireless']

['docker', 'build', '-t', 'w4sp/labszvictims', 'victims']

['docker', 'build', '-t', 'w4sp/labs:ftp_tel', 'ftp_tel']

The command '/bin/sh -c apt-get install -y vsftpd telnetd apacheZ' returned a non-

zero code: 109

Traceback (most recent call last):

File "u4sp_webapp.py”, line 499, in

w4sp.docker_build('images/')

File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py', line 102, in

docker_build

r('docker build -t $image_name $image')

File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/utils.py', line 83, in r

return subprocess.check_output(cmd)

File "/usr/lib/pythonz.7/subprocess.py", line 219, in check_output

raise CalledProcessError(retcode, cmd, output=output)

subprocess.CalledProcessError: Command '['docker'. 'build', '-t', 'w4sp/

labs:ftp_tel', 'ftp_tel']' returned non-zero exit status 100

w4sp-lab@W4SP:~/Downloads/w4sp-lab-masters

From: w4sp-book [mailto:notifications@github.com] Sent: Wednesday, August 23, 2017 4:55 PM To: w4sp-book/w4sp-lab w4sp-lab@noreply.github.com Cc: w4sp-user1 HarveyColwell@harveycolwellconsulting.com; Mention mention@noreply.github.com Subject: Re: [w4sp-book/w4sp-lab] Error Starting Lab (#16)

@w4sp-user1 https://github.com/w4sp-user1 whats the error you are getting now?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/w4sp-book/w4sp-lab/issues/16#issuecomment-324473712 , or mute the thread https://github.com/notifications/unsubscribe-auth/Adz4yhUyjlSEClcqSxkcqSG1fq8meRjcks5sbJ-zgaJpZM4O_Ptg . https://github.com/notifications/beacon/Adz4yiARz1y1fL6DzMJIU2NuXhfXpbZwks5sbJ-zgaJpZM4O_Ptg.gif

w4sp-book commented 7 years ago

@w4sp-user1 - hmm, and this is still happening after modifying the daemon.json file?

What do you get when you run $ sudo docker run -it --rm ubuntu:14.04 ping -c 3 google.com ?

w4sp-user1 commented 7 years ago

Sorry for the long delay in responding. I've been putting in a lot of long hours. Here's a screenshot and the OCRed text.

The package loaded and the command worked.

w4sp-lab@W4SP:~$ sudo docker run -it --rm ubuntu:14.04 ping -c 3 googLe.com PING google.com (172.217.6.110) 56(84) bytes of data. 64 bytes from ord37so3-in-fl4.leloo.net (172.217.6.110): icmp seq=1 ttl=51 time=60.1 ms 64 bytes from ord37s03-in~ fl4.leloo.net (172.217.6.110): icmp seq=2 ttl=51 time=175 ms 64 bytes from ord37so3-in"fl4.lelOo.net (172.217.6.110): icmp seq=3 ttl=51 time=123 ms

--- google.com ping statistics --- 3 packets transmitted, 3 received, O% packet toss~ time 2001ms rtt min/avg/max/mdev = 60.123/119.667/175.118/47.035 ms

On 8/24/2017 5:22 PM, w4sp-book wrote:

|sudo docker run -it --rm ubuntu:14.04 ping -c 3 google.com|

mooret025 commented 6 years ago

I was also getting this error. I got the lab going again by restarting the docker service before you run the w4sp_webapp.py.

$ systemctl start docker $ sudo python w4sp_webapp.py

ASHWINK07 commented 4 years ago

i am getting this error can anyone one please help me

Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package python-netifaces Traceback (most recent call last): File "w4sp_webapp.py", line 8, in import w4sp File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp.py", line 1, in from w4sp_app import * File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/init.py", line 1, in from container import container,ns_root,c File "/home/w4sp-lab/Downloads/w4sp-lab-master/w4sp_app/container.py", line 22, in subprocess.check_call(['apt-get', 'install', 'python-netifaces']) File "/usr/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['apt-get', 'install', 'python-netifaces']' returned non-zero exit status 100

X-Junior commented 3 years ago

@ASHWINK07 me too did you solve that problem ?

Anasuya-Smith commented 3 years ago

Hi,

I am trying to install w4sp lab... Getting the below error. I have tried all the suggestions given here. I use Ubuntu 20.04, on VirtualBox.

$ sudo python3 w4sp_webapp.py ['which', 'dumpcap'] ['getcap', b'/usr/bin/dumpcap'] [] Caps set correctly on dumpcap [] Not enough w4sp/labs images found, building now /home/w4sp-lab/w4sp-lab-master/images ['docker', 'build', '-t', 'w4sp/labs:base', 'base'] ['docker', 'build', '-t', 'w4sp/labs:switch', 'switch'] ['docker', 'build', '-t', 'w4sp/labs:victims', 'victims'] ['docker', 'build', '-t', 'w4sp/labs:temp', 'temp'] ['docker', 'build', '-t', 'w4sp/labs:ftp_tel', 'ftp_tel'] ['docker', 'build', '-t', 'w4sp/labs:samba', 'samba'] ['docker', 'build', '-t', 'w4sp/labs:vrrpd', 'vrrpd'] ['docker', 'build', '-t', 'w4sp/labs:wireless', 'wireless'] ['docker', 'build', '-t', 'w4sp/labs:inet', 'inet'] ['docker', 'build', '-t', 'w4sp/labs:elk', 'elk'] ['docker', 'ps', '-aq', '--filter', 'label=w4sp=true'] ['ifconfig', '-a'] ['ip', 'link', 'delete', b'enp0s3:'] RTNETLINK answers: Operation not supported ['ip', 'link', 'delete', b'lo:'] RTNETLINK answers: Operation not supported ['ip', 'netns'] ['pkill', 'dhclient'] ['ifconfig', '-a'] ['service', 'network-manager', 'start'] ['service', 'networking', 'restart'] Failed to restart networking.service: Unit networking.service not found. Traceback (most recent call last): File "w4sp_webapp.py", line 521, in w4sp.docker_clean() File "/home/w4sp-lab/w4sp-lab-master/w4sp_app/utils.py", line 147, in docker_clean r('service networking restart') File "/home/w4sp-lab/w4sp-lab-master/w4sp_app/utils.py", line 83, in r return subprocess.check_output(cmd) File "/usr/lib/python3.8/subprocess.py", line 411, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.8/subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['service', 'networking', 'restart']' returned non-zero exit status 5.

Any help will be appreciated.

Zijun-ac commented 3 years ago

Did your docker.service start? as mine was not enabled and after I restarted it, I can't setup w4sp lab.