Tuesday, March 18, 2008

BOSS 2.0 LiveCD owned / Bundestrojaner entdeckt


The BOSS LiveCD (BSI OSS Security LiveCD) is a bootable Morphix Linux
distribution basically with a nessus scanner and some other security tools.
Its distributed for administrators to check their network for vulnerabilities.
The aim is to make the network more secure.

However there is a backdoor: If you boot this CD in your network it sets up
the network interface(s) via DHCP. It also starts an OpenSSH daemon and guess what,
it has a DSA private key for the user 'slad' placed in slad's homedir. The passphrase
for this key is 'bosscd'. And... the root password to su to root after ssh login
(root login via SSH is disabled) is also 'bosscd'.
One may argue that this is a LiveCD system and this does not matter. Wrong! The laptop
you boot has got a harddisk! And you are behind the firewall!

So, if you are responsible for your network, DO NOT BOOT THIS CD. You are subject to
immidiate owning. It is very easy to scan whole class A networks for this DSA key
within a short period of time, so do not think that "just running it half a hour" is short enough
for you to survive.

More info about the BOSS CD/Bundestrojaner here.

Update:
After contacting the "Bundesamt für Sicherheit in der Informationstechnik" (BSI) they responded
and included a security notice about the LiveCD in their website. Although I do not think
that, due to automatic WLAN setup during boot, a splitted testing environment is possible,
I recognize that they reacted within one day which is very fast for a government agency.

Monday, February 18, 2008

Mono trickery


I always spot the best bugs during coding. While coding tjmd5 (see last posting) I ran across
an interesting mono feature. For each 'foo' C# file that it compiles it lookups 'foo.so'
in /usr, /usr/lib etc directories and 'foo.so.la' in the cwd. This can be abused to execute
arbitrary code while someone is just compiling an C#-file. I am not sure about the impact since
you can say that the dude is executing the .exe after he was compiling it. Well.
Depending on the comments you all make I will decide whether this is something to tell Miguel :-)

Trapper John MD5

During hackweek in Nuremberg I lifted my C#-skills and wrote a MD5 based filesystem
and web integrity checker from scratch. In .NET, from scratch means you plug a few classes
and API calls together and get a complex application in 100 lines :-)
C# is fun coding nevertheless. Never heared again from tripwire, one of my faves
back in the 90's. You can download trapper john md5 here.

Wednesday, January 30, 2008

Fail!

While reading planet security
to get updated about what ubercool bugz the scene is producing I stumbled across the
fail blog. Definitely worth reading :-) Especially "wet squirrel" was funny after
serious and hard work on vlock which I had a look at. "Satellite" shows that hardware-engineers
are experiencing the same problems as computer scientists with software: it crashes all day long.
Heads up guys!


Tuesday, January 29, 2008

The evilness of setuid(getuid())






We recently had a discussion after a code review that a setuid(getuid()) inside a suid without error checking
and program execution afterwards should be fixed. A lot of people think that this could
never fail. getuid() indeed can never fail, but setuid() can. Lets put aside theoretical issues such
as missing CAP_SETUID or signals and lets have a look how the kernel is executing a setuid()
in the first picture. CAP_SETUID should be ok since we talk about a setuid root program which is
executing setuid(getuid()). Obviously we can trigger an error return of EAGAIN if set_user() fails
which is only called if the real UID is changed during the call. That may only happen if some of the set*uid() functions with a different UID than at startup time of the program has been called already.
For instance a setuid root program runs at startup with the real UID of the user and calls setuid(0)
in order to to obtain full privileges. It then calls setuid(getuid()) to drop the privileges again.
How can this fail? Lets have a look at set_user() in the second picture. Obviously if the
RLIMIT_NPROC limit is exceeded and its not setuid'ing to root (which is the case) then
an error is returned. Huh! Lowering limits is always allowed ;-)
The sample program in picture three demonstrates how a setuid root program dropping
its privileges in this way can be tricked into executing other programs as root.

I apologize if you already knew this trick. I also apologize for the madness of this' blog
editing program which always places the pictures as it wants to and which makes me nuts.







Wednesday, January 23, 2008

FireBox

In case you are tired of yet another unknown web browser vulnerability, you might
try firebox. This small script sets up a chroot environment for firefox which then runs
unprivileged, has no access to suid-files, /proc, /dev, /sys etc and can only create files
inside a loopback mount; so possible exploits triggered from evil websites can't modify
your homedir or system-files (as long as theres no kernel-0day of course :-).
Java, flash and all that sh** is not working yet but that might even be an advantage.

Friday, January 11, 2008

Happy new year!

Although a little bit late, I wish every reader a happy new year!

The 24c3 event was great. I missed some old and known faces, but had some interesting evening
with an italian a french and a dutch hacker at a steak house restaurant. Never made and heared so
many jokes on software. :-)

Even in the new year I am continously asked by the famous hakin9 magazine
to write an article for them. There must be a rumor/confusion somewhere about my person -- I am not a hacker! :-)

Monday, November 26, 2007

boot graphs


The exec-notify program can be used together with the exec2dot script to generate program
calling graphs from booting or something like a KDE startup. Especially the boot process from a laptop
looks very interesting.
Sample graphs may be found here and here.

Wednesday, November 21, 2007

satire II

Sorry, the following is only in german due to my limited native language skills :-)

Ich sass neulich in der S-Bahn auf dem Weg zum recurity-labs summit, um
ein paar Freunde wiederzutreffen. In der S-Bahn um mich herum lauter wirklich tolle Leute mit viel
Ahnung ueber Web 2.0, flat-rate-preise und natuerlich - BLOGS!
Dazu die Jungs mit den haengenden Hosen und dieser komischen Musik
(ey, alter - das ging so: uz, uz, uzz. Nee, warte... uzzzzz,uz,uz!) Man lese mehr dazu hier.

Da kam mir die Idee, unsere heutige Welt in einem kleinen Gedicht zusammenzufassen.
Den verantwortlichen Rapper fuer den Originalsong werden die Meisten sicher leidlich kennen,
auch wenn er einem im Radio mittlerweile seltener aufgenoetigt wird.
Wer wirklich gute Musik mag, vertieft sich natuerlich in die Gitarre von Mark Tremonti.
:->

genug geschwafelt:

Mein blog!
---------------

ich habe nichts zu sagen
und das kann ich nicht ertragen,
darum schreib ich das in - mein' blog!

ich gehe noch zur schule,
ich find das alles voll schwul hier,
das schreibe ich in - mein' blog!

besser gesagt geh' ich in die achte,
genau wie die bei der ich immer uebernachte,
wies war schreib ich in - mein' blog!

der typ aus der fuenften,
tut mich immer beschimpfen,
das schreibe ich in - mein' blog!

wenn ich gross bin werd ich politiker,
oder vielleicht auch filmkritiker,
wofuer ich mich entscheide, kommt in - mein' blog!

ich habe weder hefter noch anstand,
und beim tanzen mach ich handstand
ich habe nur - nen block!

Tuesday, November 20, 2007

Eyes on Exec reloaded



10 years ago or so, I wrote a tool called "Eyes on Exec" (EoE) which was a kernel module for the 2.0, 2.2 and 2.4 Kernel.
It created a device /dev/exec from which one could read all the commands executed recently
including callers PID, EUID etc. Some simple hostbased IDS used this input to ensure that e.g.
pop3d never executed anything. It worked very well. Additionally, code reviewers (myself :)
found it usefull since you easily see if some daemons/applications execute shell programs
in a way that is not obvious to the auditor due to weird library calls. The famous modprobe bug
which used ping as a trigger was found by me with the help of EoE (google for rootprobe exploit).

2.2 times are gone, but the new 2.6 Kernel has a nice API called proc connector which allows
to register for certain events such as fork/exec etc. into the proc FS. One is then notified
whenever the questioned event arrives. Ever wanted to know what man really executes or how
acroread is handling mail sent from within a PDF? :-) Jump towards here.