A virtual webcam

There are a lot of fun things you can do with Linux. What I propose you today is to stream an arbitrary video as if it were your webcam and microphone output.

Some sort of disclaimer

Okay, so the draft of this blog post has been sitting on my hard drive for months now, and if I don’t post it yet, I’ll never post it. The reason I didn’t is because it is incomplete, as there’s a tiny something I don’t understand. I lost interest in this so I won’t look for the solution myself, but if you find it you’re welcome to share it with me! Anyway, let’s see this.

Privilege escalation with setuid

What are setuid and setgid?

When applied on executable (and shell scripts if it’s not disabled), setuid is a mechanism in UNIX systems to allow an user to execute a program with the owner’s permissions. Setguid is the same principle, but we get the group permission instead of the user’s.
If you want too know more about it or setgid (that we won’t use), read the Wikipedia article.

In this article we will create a C program we will run as a normal user, and thanks to setuid it will spawn for us a shell (as root!).

Hyphens in UNIX’s filenames

Today I discovered an interesting UNIX design flaw. UNIX deals badly with files starting with -. Let’s mess around!

Warning: do like me, create a new directory and cd into it.