Deepdive Containers - Kernel Sources and nsenter

  Рет қаралды 43,341

LiveOverflow

LiveOverflow

Күн бұрын

Let's play around with Docker a bit more. We learn about the nsenter command, how kernel code execution allows escaping from docker and we look at Linux Kernel source code of getpid().
Daniel Mitre's blog: / linux-container-from-s...
bocker: github.com/p8952/bocker/
Elixir: elixir.bootlin.com/linux/late...
Denis Andzakovic: pulsesecurity.co.nz/articles/...
=[ ❤️ Support ]=
→ per Video: / liveoverflow
→ per Month: / @liveoverflow
=[ 🐕 Social ]=
→ Twitter: / liveoverflow
→ Website: liveoverflow.com/
→ Subreddit: / liveoverflow
→ Facebook: / liveoverflow
=[ 📄 P.S. ]=
All links with "*" are affiliate links.
LiveOverflow / Security Flag GmbH is part of the Amazon Affiliate Partner Programm.

Пікірлер: 59
@daved5872
@daved5872 4 жыл бұрын
docker exec --user root
@LiveOverflow
@LiveOverflow 4 жыл бұрын
haha... lol...... well........
@renato.bohler
@renato.bohler 4 жыл бұрын
We accidentally learned something lol
@barefeg
@barefeg 4 жыл бұрын
Can also run with privileged flag
@Cubinator73
@Cubinator73 4 жыл бұрын
"The worst thing that can happen is that you accidentally learn something." For a person like me, who loves learning new stuff about technology, learning something by accident is one of the best things that can happen ;)
@danielmitre
@danielmitre 4 жыл бұрын
Diving in kernel code is scary and fascinating as CTF's, both requires same curiosity though
@Hari-pk4ou
@Hari-pk4ou 4 жыл бұрын
Is it possible to convert ISO image into docker image ?
@AJMansfield1
@AJMansfield1 4 жыл бұрын
@@Hari-pk4ou No, that's not possible in the general case, and probably something that couldn't be done automatically even for the cases where it would be technically possible. Although I guess you could probably run a QEMU vm inside a docker, so there's that.
@martalaisdemacedodantas9620
@martalaisdemacedodantas9620 3 жыл бұрын
Wait, I know this dude!
@danihp9238
@danihp9238 4 жыл бұрын
This kind of videos about kernel/syscall are amazing man, keep going
@mohammedhafiz8039
@mohammedhafiz8039 Жыл бұрын
"this loose and wide approach of learning gets you deeper than just being boxed into a topic by some kind of kind of standard tutorial" well said 👍
@EER0000
@EER0000 4 жыл бұрын
For my work I use a lot of windows containers, so far I haven’t found a great explanation of this on the windows side of things, but I do feel inspired to write Pocker, a powershell implementation of docker on windows, which I’m pretty sure will easily surpass bocker in horribleness ;)
@stefantobler
@stefantobler 3 жыл бұрын
Do it!
@EER0000
@EER0000 3 жыл бұрын
@@stefantobler I got started on it and but got stuck on the first dll call with some weird errors, this combined with the complete lack of documentation led me to put the project on hold :(
@sakshamsethi4123
@sakshamsethi4123 4 жыл бұрын
Kudos brother 👊. You are doing so much for the community, stuff like deep dive in to kernel source is something you simply can't find anywhere else! Thanks for this little series, hope to see another on on aufs.
@greyman1104
@greyman1104 4 жыл бұрын
Very well explained series about Docker. Good job.
@simonthepirate3891
@simonthepirate3891 4 жыл бұрын
Thank you for the three docker vids, i learned a lot!
@sundhaug92
@sundhaug92 4 жыл бұрын
chroot is needed to setup a root filesystem in the mount-namespace. When you later join the mount-namespace the root filesystem is already setup
@svampebob007
@svampebob007 4 жыл бұрын
Dude... I've been watching your videos for a while now, I'm not a programmer or anything and just recently started using linux, docker was something I didn't understand at all. but just recently got around to the idea of running Arch linux on my phone via Termux. I was facing a problem trying to run one piece of software on Arch, it didn't make sense, then I dived deep into the logs and what not... Being a fresh rookie to linux I though there's something I'm doing wrong here, then out of the blue I got a "flashback" seeing how you talked about privilages and docker... it all made sense why I was facing those issues! suddenly the way Arch was being "ran" made total sense, I still haven't solved my issue (and I don't think I will ever solve it from the research I've done now), but it stopped me from diving deep down the termite hole, and maybe get me diving down the rabbit hole. TLDR; Thank you for teaching me something I didn't think I learned watching your videos!
@terinjokes
@terinjokes 3 жыл бұрын
I believe the `chroot` is needed to select the binary you want to call from within the container's mount namespace. Since you don't include the chroot, you're calling the host's /bin/bash instead. This can be useful if you're debugging a container with a minimal (or non-existent) tools. You can use nsenter with tools from the host.
@joonasfi
@joonasfi 4 жыл бұрын
Holy balls, I never thought "getpid" implementation would be so complicated
@stevetec1816
@stevetec1816 4 жыл бұрын
is there a way to get a high-res version of the drawn docker logo used here? i think that it, in combination with some other images from this channel, could make for some great wallpapers
@timg4802
@timg4802 4 жыл бұрын
Nice video :)
@nopr9d847
@nopr9d847 4 жыл бұрын
Hi ! I see 42 of your video today haha ... Yeah get so much time :p I learn a lot with you, your website is cool too (you forgot your KZbin's intro video with comment on your html :p) (if you want some's help for your layout I'm a frond-end) Keep going ! I will test some of your's advice
@kevinjonathan8742
@kevinjonathan8742 4 жыл бұрын
Omg, very good thanla
@KevinPfeifer
@KevinPfeifer 4 жыл бұрын
Thanks for that awesome explanation of how docker works :D definitely learned something. The only major problem I always run into is the fact, that docker runs soooo much slower on MacOS than Linux and even Windows (I mainly develop in PHP) I'm talking like seconds longer for the same request. But I guess this has something to do with how docker is implemented in MacOS. Or do you have any experience with that?
@KevinPfeifer
@KevinPfeifer 4 жыл бұрын
I just found out, that MacOS is partially based on the FreeBSD Kernel and therefore doesn't have such a syscall like unshare... therefore docker will probably have to do something different to accomplish the same thing
@olpizl
@olpizl 4 жыл бұрын
Cooles Video, ich verstehe zwar zu 60% nur Bahnhof, aber ich denke ich habe dennoch ein paar Sachen dazu gelernt.😊
@user-cz9ss4yq4x
@user-cz9ss4yq4x 4 жыл бұрын
BSD jails are like Linux containers but a lot less messy :)
@while-loop
@while-loop 4 жыл бұрын
Inb4 you find a container vuln and end my whole docker/kuberbetes deployment architecture
@user-cz9ss4yq4x
@user-cz9ss4yq4x 4 жыл бұрын
that’s why you do RBAC and drop privileges inside containers
@RoiEXLab
@RoiEXLab 4 жыл бұрын
Repeating my question from the last video: Docker for Linux seems clear now, but how does docker work on other OSes then? VM or something else?
@LiveOverflow
@LiveOverflow 4 жыл бұрын
yep, VMs ;)
@ThoolooExpress
@ThoolooExpress 4 жыл бұрын
​@@LiveOverflow There are native Windows containers too. It's too bad the NT kernel is closed source, it would be fun to compare the implementations.
@neonmatrix1703
@neonmatrix1703 4 жыл бұрын
Bro hi I'm new to your channel
@davidyanceyjr
@davidyanceyjr 3 жыл бұрын
Started with docker, then found systemd-nspawn - which I like tinkering with more than docker.
@wilfridtaylor
@wilfridtaylor 4 жыл бұрын
Cloud computing is just someone else's computer. Containers are just someone else's kernel :p.
@ytsuge
@ytsuge 4 жыл бұрын
NIce, do Hyper-V next :) You might need a soldering iron.
@Asrashas
@Asrashas 4 жыл бұрын
I'd rather see a video about Xen
@sonny23ization
@sonny23ization 2 жыл бұрын
can you please combine this docker videos in one playlist? (docker system hacking)
@barefeg
@barefeg 4 жыл бұрын
Can you investigate how docker uses cgroups too?
@Hari-pk4ou
@Hari-pk4ou 4 жыл бұрын
Can you please make vedios about converting suselinux iso image into docker image
@mina86
@mina86 4 жыл бұрын
Bash sounds like a reasonable language to implement Docker. Definitely better than Go. Docker still sounds to me like over-engineered wrapper around tar and bunch of names pace and cgroup commands.
@almightyhydra
@almightyhydra 4 жыл бұрын
Wow, 8 character tabs and no enforced brackets after if statements.
@maximkovalkov1334
@maximkovalkov1334 4 жыл бұрын
Yep, that's old-school C for you The *clearly superior* style
@d1rtyharry378
@d1rtyharry378 4 жыл бұрын
but nsenter is just docker with root?
@neonmatrix1703
@neonmatrix1703 4 жыл бұрын
I would like if you could make a video about reverse engeneering because I'm interested to know how to hack online games mmorpg
@intrudah
@intrudah 4 жыл бұрын
Beans
@tymekl1509
@tymekl1509 4 жыл бұрын
8th Meow
@TimLF
@TimLF 4 жыл бұрын
Why is bocker "terrible"?
@0xc0ffee_
@0xc0ffee_ 4 жыл бұрын
last
@kevinpuvi2168
@kevinpuvi2168 4 жыл бұрын
0 views and 7 likes.. hmm
@abdarafi
@abdarafi 4 жыл бұрын
Any uefa champions league fan here?
@yonishachar1887
@yonishachar1887 4 жыл бұрын
first at everything: watch, like, comment.
@dasten123
@dasten123 4 жыл бұрын
and getting a dislike
@yonishachar1887
@yonishachar1887 4 жыл бұрын
@@dasten123 thanks! :) I am the first of everything in this video. Also dislikes aren't visible for anyone so your ass got kicked twice🤣🤣🤣🤣
@vskovzgird
@vskovzgird 5 ай бұрын
You are exaplining containers and nsenter not from a Linux perspective but from a shell binaries perspective. Awful video.
Solving Pwnable CTF Challenge With Docker Workflow
20:42
LiveOverflow
Рет қаралды 59 М.
How Docker Works - Intro to Namespaces
12:56
LiveOverflow
Рет қаралды 162 М.
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 174 МЛН
100❤️
00:20
Nonomen ノノメン
Рет қаралды 67 МЛН
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 1,4 МЛН
1❤️#thankyou #shorts
00:21
あみか部
Рет қаралды 75 МЛН
I've been using Redis wrong this whole time...
20:53
Dreams of Code
Рет қаралды 330 М.
The least you need to know about Docker!
13:57
Diolinux
Рет қаралды 238 М.
How To Protect Your Linux Server From Hackers!
20:38
LiveOverflow
Рет қаралды 294 М.
Creative AI Video Upscaling Will Blow Your Mind!
12:35
Theoretically Media
Рет қаралды 15 М.
Mindmapping a Pwnable Challenge - intro_pwn/pwn1 CSCG 2020
17:28
LiveOverflow
Рет қаралды 39 М.
What is a kernel - Gary explains
9:50
Android Authority
Рет қаралды 949 М.
Hacker Tweets Explained
13:47
LiveOverflow
Рет қаралды 157 М.
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 174 МЛН