Samba Pre-2.0.5 Vulnerabilities
There were a number of vulnerabilities in the Samba package pre-2.0.5. The first is a possible denial of service in nmbd (the netbios name service daemon), which resulted in nmbd spinning until killed. The second vulnerability known is a possible buffer overflow problem in smbd which is not exploit in the default install/configuration. A function in the messaging system could be exploited and arbitrary code executed as root if the "message command" was set in smb.conf. There was also a race condition vulnerability which could possible allow an attacker to mount arbitrary points in the filesystem if smbmnt was setuid root (which it is not by default). The code does not do range checking when copying a username from the environment variables USER or LOGNAME. To get this far into the code we need to execute with dummy arguments of a server and a mountpoint to use (./a in this case). The user will need to create the ./a directory and then execute smbexpl to gain root. This code is also setup to use /tmp/sh as the shell as bash-2.01 appears to do a seteuid(getuid()) so /bin/sh on my system won't work. Finally a "-Q" (an invalid commandline argument) causes smbmount to fail when parsing args and terminate, thus jumping into our shellcode.