|
Challenge Of The Month [Scan 29] September
2003,
http://project.honeynet.org
|
On
§
The
main page is kept brief & to the point for better understanding, focusing
on answering the questions & explaining the procedure followed.
§
Detailed
analysis & explanation of procedure followed is provided via links
§
Though
lot of additional information was also discovered & analyzed but the
document below is limited to explaining the procedure pertaining to challenge
questions.
§
Download
the image from project.honeypoy.net to local forensic machine.
# wget http://project.honeynet.org/misc/files/linux-suspended.tar.bz2
# wget http://project.honeynet.org/scans/scan29/linux-suspended-md5s.gz
§
Verify
the md5 check sum of downloaded vmware image.
# md5sum –c linux-suspended.tar.bz2
d95a8c351e048bd7d5596d6fc49b6d72
.
§
Follow step
by step process to secure the evidence.
§
Cross
verify that checksum of created image & actual disk images match.
§
Download
& install the vmware 4.0 evaluation copy.
§
Put a copy of Knoppix CD in
cdrom drive §
Configure the vmware image to boot from cdrom with suspended linux
image environment §
Let Knoppix
boot with vmware configured with “bridged”
network access.
§
The host OS network card will have a Private IP and will not be
connected to any other system or network. §
Install netcat on host OS & make it listen on port 1111 to receive
outputs from vmware image. §
Mounting the suspended image on
Knoppix for analysis
Commands used: #
mount -t ext3 -o
ro,loop,nosuid,noexec,nodev,noatime /dev/sda1 /mnt/sda1 In order to examine the
file systems, we mounted the images (on Knoppix Linux system) using a loop device.
The images were mounted as read-only with no execute permission, no set UID
programs, no device drivers, and no access time modification.
|
§
Download
& install the vmware 4.0 evaluation copy.
§
Vmware
configured with private IP network access “bridged”
The host OS will be having a Private IP and will not be connected to any other system or network §
Install netcat on host OS & make it listen on port 1111 for outputs
from vmware image. Command C:> nc –l –p 1111 > * name of output_file* §
Compile
static binaries & trusted shell, put them in CD 1
§
Start the
suspended image.
§
Mount the
CDROM with trusted shell & static binaries on suspended vmware image
§
Set the path
Command # PATH /mnt/cdrom
|
|
|
|
|
Knoppix http://www.knoppix.net/
Vmware www.vmware.com
|
Challenge
Question 1.
Describe the process you used to confirm that the
live host was compromised while reducing the impact to the running system and
minimizing your trust in the system. |
|
Step
1(live analysis) : verify the md5 checksum of suspended linux image (
suspended-linux.md5) Command: # md5sum –c host79-2003-08-06 | grep –v “OK” Explanation: The command will verify the
md5sum of all the files in file * host79-2003-08-06 & grep –v will invert
the match i.e. all lines that don’t have “OK” will be displayed |
Output:
|
/var/lib/slocate/slocate.db: FAILED /var/lib/random-seed: FAILED /var/lib/logrotate.status: FAILED /var/log/messages: FAILED /var/log/lastlog: FAILED open or read /var/log/secure: FAILED /var/log/maillog: FAILED /var/log/wtmp: FAILED /var/log/sa/sa14: FAILED open or read /var/log/sa/sa15: FAILED open or read /var/log/sa/sar14: FAILED open or read /var/log/sa/sa16: FAILED open or read /var/log/sa/sar15: FAILED open or read /var/log/sa/sa06: FAILED open or read /var/log/samba/log.smbd: FAILED open or read /var/log/samba/smbd.log: FAILED open or read /var/log/samba/log.nmbd: FAILED open or read /var/log/samba/localhost.log: FAILED open or read /var/log/xferlog: FAILED open or read /var/log/httpd/error_log: FAILED open or read /var/log/httpd/ssl_engine_log: FAILED open or read /var/log/httpd/access_log: FAILED open or read /var/log/httpd/ssl_request_log: FAILED open or read /var/log/httpd/access_log.1: FAILED open or read /var/log/httpd/error_log.1: FAILED open or read /var/log/dmesg: FAILED open or read /var/log/cron: FAILED /var/log/boot.log: FAILED /var/log/rpmpkgs: FAILED open or read /var/cache/man/whatis: FAILED /var/cache/samba/smbd.pid: FAILED /var/cache/samba/connections.tdb: FAILED /var/cache/samba/nmbd.pid: FAILED /var/cache/samba/browse.dat: FAILED /var/run/utmp: FAILED /var/run/runlevel.dir: FAILED /var/run/syslogd.pid: FAILED /var/run/klogd.pid: FAILED /var/run/apmd.pid: FAILED /var/run/sshd.pid: FAILED /var/run/sendmail.pid: FAILED /var/run/gpm.pid: FAILED /var/run/crond.pid: FAILED /var/run/ftp.rips-all: FAILED open or read /var/spool/anacron/cron.daily: FAILED /var/spool/anacron/cron.weekly: FAILED /tmp/root.md5: FAILED open or read /etc/mtab: FAILED /etc/rc.d/init.d/functions: FAILED /etc/rc.d/rc.sysinit: FAILED /etc/mail/statistics: FAILED /etc/aliases.db: FAILED /etc/adjtime: FAILED /etc/samba/secrets.tdb: FAILED /etc/httpd/conf/httpd.conf: FAILED /usr/bin/top: FAILED /bin/netstat: FAILED /bin/ls: FAILED /bin/ps: FAILED /sbin/ifconfig: FAILED |
|
Indication
of Intrusion 1: §
§
|
|
|
|
Step 2(
Dead Analysis) : Check for Hidden files & directories Command: # find
/mnt/sda1 -name ".*" -type d -printf "%Tc %h/%f\n" >
hidden_dir Explanation: The command will find all hidden directories ( -type d) & pipe the output to file hidden_dir |
Output:
|
Sun Aug 10 Wed
Aug 6 Wed
Aug 6 |
|
Command # find /mnt/sda1
-name ".*" -type f -printf "%Tc %h/%f\n" > hidden_dir Explanation: The command will find all hidden
files ( -type f) & pipe the output to file hidden_dir |
Output:
|
Mon
Jul 14 Sun
Aug 10 Mon
Jul 9 Mon
Jul 9 Mon
Jul 9 Mon
Jul 14 Thu
Aug 9 Wed
Apr 5 Mon
Jul 9 Thu Mar 20 Sat
Jun 10 Wed
Aug 23 Thu
Jul 5 Wed
Aug 23 Sat
Jun 10 Tue
Jul 11 Sat
Aug 9 Sun
Aug 10 |
|
Indication of Intrusion 2: A hidden directory by the name of
/lib/.x with time stamp of Aug 10 ( day of the incident as described in
challenge ) |
|
Step 3 ( Dead Analysis) : Check for files with SUID & GUID bit set Command # find /mnt/sda1
\( -perm -004000 -o -perm -002000 \) -type f –ls Explanation: The command will find all the
files in mounted file-system with SUID & GUID set |
Output:
|
8988 24 -rwsr-sr-x 1
root root 24116 May 21 59705
767 -rws--x--x 2 root root 785372 59705
767 -rws--x--x 2 root root 785372 59708
34 -rwsr-xr-x 1 root root 34476 59710
36 -rwsr-xr-x 1 root root 36208 60053
37 -rwsr-xr-x 1 root root 37580 60085
13 -rwxr-sr-x 1 root mail 12500 60137
25 -rwxr-sr-x 1 root slocate 25020 62367
14 -r-s--x--x 1 root root 13476 62406
7 -r-xr-sr-x 1 root tty
6444 62414
13 -rws--x--x 1 root root 13136 62415
13 -rws--x--x 1 root root 12484 62433
6 -rws--x--x 1 root root 5456 62444
9 -rwxr-sr-x 1 root tty 8744 62497
21 -rwsr-xr-x 1 root root 21280 62531
206 -rwsr-xr-x 1 root root 209948 62539
15 -rwsr-xr-x 1 root root 14588 62541
11 -rwsr-xr-x 1 root root 10940 62542
8 -rwsr-xr-x 1 root root 7932 59390
19 -rwsr-xr-x 1 root root 18444 59394
10 -rwsr-xr-x 1 root root 9804 62351
7 -rwxr-sr-x 1 root utmp 6604 62400
441 -r-sr-xr-x 1 root root 451076 62480
7 -rwsr-xr-x 1 root root 6340 62545
20 -rwsr-xr-x 1 root root 20120 62595
11 -r-s--x--- 1 root apache 11244 44757 23 -rwsr-xr-x |