-
Notifications
You must be signed in to change notification settings - Fork 42
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
Ported the thing to Kali 2020 - you need to install python3-docker pa… #62
base: master
Are you sure you want to change the base?
Conversation
hi, thanks for the fixes, now all starts quite well. I have just another issue, it happens that the lab can't complete the setup. When i launch the program it gives me this:
Than when i open the browser link and click on setup it gives me this:
and all the buttons on the right are freezed and i can just click setup again o shutdown If I understood is a known problem, so what shoud i do to make it work? |
Hi,
Looks like you have to prefix some string with b'string' instead of string, or vice-versa. This is the kind of fix I did, but I only fixed what I saw.
The real problem is with the Docker daemon which does not restart well, and I could not do anything on it.
Le mercredi 6 mai 2020 à 17:24:30 UTC+2, Meliodas123 <[email protected]> a écrit :
hi, thanks for the fixes, now all starts quite well. I have just another issue, it happens that the lab can't complete the setup. When i launch the program w4sp-lab@w4sp:~/Scaricati/w4sp-lab-master$ sudo python3 w4sp_webapp.py
it gives me this:
['which', 'dumpcap']
['getcap', b'/usr/bin/dumpcap']
[*] Caps set correctly on dumpcap
[*] Not enough w4sp/labs images found, building now
/home/w4sp-lab/Scaricati/w4sp-lab-master/images
['docker', 'build', '-t', 'w4sp/labs:base', 'base']
['docker', 'build', '-t', 'w4sp/labs:switch', 'switch']
['docker', 'build', '-t', 'w4sp/labs:ftp_tel', 'ftp_tel']
['docker', 'build', '-t', 'w4sp/labs:elk', 'elk']
['docker', 'build', '-t', 'w4sp/labs:victims', 'victims']
['docker', 'build', '-t', 'w4sp/labs:vrrpd', 'vrrpd']
['docker', 'build', '-t', 'w4sp/labs:temp', 'temp']
['docker', 'build', '-t', 'w4sp/labs:inet', 'inet']
['docker', 'build', '-t', 'w4sp/labs:samba', 'samba']
['docker', 'build', '-t', 'w4sp/labs:wireless', 'wireless']
['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']
['ifconfig', '-a']
['ip', 'link', 'delete', b'docker0:']
['ip', 'link', 'delete', b'eth0:']
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']
['service', 'docker', 'restart']
* Serving Flask app "w4sp_webapp" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
[*] Lab Launched, Starting Browser
[*] Do not close this terminal. Closing Terminal will terminate lab.
Error: no DISPLAY environment variable specified
Than when i open the browser link and click on setup it gives me this:
['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']
{'nodes': [{'id': 1, 'label': ' kali ', 'color': 'rgb(204,0,0)', 'title': 'eth0 : 10.0.2.15 <br>docker0 : 172.17.0.1 <br>'}], 'edges': []}
127.0.0.1 - - [06/May/2020 17:08:15] "GET /getnet HTTP/1.1" 200 -
[2020-05-06 17:08:15,736] ERROR in app: Exception on /is_ips [GET]
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3/dist-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
raise value
File "/usr/lib/python3/dist-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3/dist-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "w4sp_webapp.py", line 213, in is_ips
if psef('suricata'):
File "w4sp_webapp.py", line 70, in psef
if grep in cmd:
TypeError: a bytes-like object is required, not 'str'
127.0.0.1 - - [06/May/2020 17:08:15] "GET /is_ips HTTP/1.1" 500 -
['ifconfig', '-a']
['ip', 'link', 'delete', b'docker0:']
['ip', 'link', 'delete', b'eth0:']
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']
['service', 'docker', 'restart']
['docker', 'ps', '-aq', '--filter', 'label=w4sp=true']
['ifconfig', '-a']
['ip', 'link', 'delete', b'docker0:']
['ip', 'link', 'delete', b'eth0:']
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']
['service', 'docker', 'restart']
['docker', 'run', '-id', '--privileged', '--name', 'sw1', '--hostname', 'sw1', '--net=none', 'w4sp/labs:switch']
['docker', 'inspect', '-f', "'{{.State.Pid}}'", b'acef782ac095a1cd9b32da735232805faa0a7925651277b8ae9ca89406941260']
Traceback (most recent call last):
File "w4sp_webapp.py", line 164, in setup
w4sp.setup_network2('eth0')
File "/home/w4sp-lab/Scaricati/w4sp-lab-master/w4sp.py", line 69, in setup_network2
create_netx(net_1)
File "/home/w4sp-lab/Scaricati/w4sp-lab-master/w4sp_app/lab_helper.py", line 249, in create_netx
ns_root.register_ns(name, d_image)
File "/home/w4sp-lab/Scaricati/w4sp-lab-master/w4sp_app/container.py", line 52, in register_ns
self.ns.append(container(name, image))
File "/home/w4sp-lab/Scaricati/w4sp-lab-master/w4sp_app/container.py", line 228, in init
self.mnt_fd = open(self.proc_path + 'mnt')
FileNotFoundError: [Errno 2] No such file or directory: "/proc/b'5494'/ns/mnt"
['docker', 'rm', '-f', b'acef782ac095a1cd9b32da735232805faa0a7925651277b8ae9ca89406941260']
127.0.0.1 - - [06/May/2020 17:08:28] "GET /setup HTTP/1.1" 200 -
and all the buttons on the right are freezed and i can just click setup again o shutdown
What shoud i do?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
i checked a bit and manually enabling the docker service it starts, by the why in container.py there is an issue that i don't know how to solve:
there is a problem specifically here at line 227:
when the sequence of bytes is composed the strip function doesn't deleate the "b" and the " ' " cause the output is this:
what can i do to solve it? |
No idea for your case, I tried by setting and removing the b - you might have :self.proc_path = b'/proc/%s/ns/' % self.pidself.mnt_fd = open(self.proc_path + 'mnt')
It's something like this.
Le jeudi 7 mai 2020 à 16:44:16 UTC+2, Meliodas123 <[email protected]> a écrit :
i checked a bit and manually enabling the docker service it starts, by the why in container.py there is an issue that i don't know how to solve:
class container(root_ns):
def init(self, name, image):
self.nics = []
self.name = name
#start the container and record the container id sleeping randomly to try and improve performance at start
#time.sleep(random.uniform(1,3))
self.id = r('docker run -id --privileged --name $name --hostname $name --net=none $image').strip()
there is a problem specifically here at line 227:
self.pid = r("docker inspect -f '{{.State.Pid}}' $self.id").strip().strip(b"'")
self.proc_path = '/proc/%s/ns/' % self.pid
self.mnt_fd = open(self.proc_path + 'mnt')
when the sequence of bytes is composed the strip function doesn't deleate the "b" and the " ' " cause the output is this:
self.mnt_fd = open(self.proc_path + 'mnt')
FileNotFoundError: [Errno 2] No such file or directory: "/proc/b'6440'/ns/mnt"
what can i do to solve it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
yeah I tryied it too, but it seems that can't recognize it if its not a Byte object before the strip method. i'll try a little bit more, but anyway it won't work for anyone if there is not an official solution |
My solution is not official. :D Just the fixes I tried before it barely works. But it stops when emulating the network, and I ended up playing with my own local area network.
Le vendredi 8 mai 2020 à 10:30:18 UTC+2, Giacomo-it <[email protected]> a écrit :
yeah I tryied it too, but it seems that can't recognize it if its not a Byte object before the strip method. i'll try a little bit more, but anyway it won't work for anyone if there is not an official solution
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
oh my bad, sorry, I thought you were one of the authors of the book or similar. |
excuse me, do you have push rights for this repository? i'm trying to upload the last changes that makes the code works, but i can't do anything else than create a new file |
I don't have them, I've set a merge request but that's all. And it's an update "it works on my VM" quality. In other words the books author need to make them work as well on their Kali 2020 VM and then it's fine.
Le lundi 11 mai 2020 à 09:55:23 UTC+2, Giacomo-it <[email protected]> a écrit :
excuse me, do you have push rights for this repository? i'm trying to upload the last changes that makes the code works, but i can't do anything else than create a new file
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I need help ... $ sudo python3 w4sp_webapp.py
I manually open the browser and enter the address for viewing the Lab. The screen with the SETUP key appears ... ['ifconfig', '-a'] ['docker', 'rm', '-f', b'1d90b25b3e1a1f57ebee67b4bf6c6ab11e2b99e05e2ef1deebf394e82daccf97'] and I ... :-( |
Hi @jaubin ... from what I understand, you managed to start the laboratory without problems even on KALI 2020 or am I wrong? If I have not misinterpreted, can I ask you exactly what version of KALI, and whether or not you upgraded before starting the procedure that Vaibhav Raj points out in his article? (Can't you send me an updated installation guide - or directions to pay attention to - by writing me on [email protected])? Thank you |
Le vendredi 21 mai 2021, 08:50:30 CEST mdimuzio a écrit :
> Kali 2020
Hi @jaubin ... from what I understand, you managed to start the laboratory
**without problems even on KALI 2020** or am I wrong? If I have not
misinterpreted, can I ask you **exactly what version of KALI**, and whether
or not you upgraded before starting [the procedure that Vaibhav Raj
***@***.***/setting-up-the-w4sp-lab-in-2020-d4df6a3d2
a5e)points out in his article? (Can't you send me an updated installation
guide - or directions to pay attention to - by writing me on
***@***.*****)? Thank you
Hi,
I used the Kali version which dates back to one year ago. With the fixed I did
on my github the thing ended up starting. However I hit another problem I
could not solve, towards Docker interactions. I stopped there and played then
with my local network wherever possible.
…--
Julien AUBIN
|
Wonderful... so my own problem! Look at this error screenshot |
I have something issus on ubuntu 18.4,have someone can help me,THX |
Hi,
I've ported the thing to run on Kali 2020.
To make it work :
The bad news is I'm stuck with docker start-limit-hit startup issue from time to time, preventing the setup phase to work from the web page.