Re: Rootkit.
El lun, 09-02-2009 a las 12:15 +0100, Francisco Calero escribió:
> Hola a todos, hace ya un tiempo me pasó que la contraseña de root
> cambió sin que nadie (aparentemente) lo hiciese, de maneara que no le di
> importancia porque estaba con otros haceres, de manera que restauré la
> clave de root y a funcionar. Hace un par de semanas me pasó lo mismo,
> con lo que mi sospechas fueron a mayor grado. Empecé a investigar un
> poco y cuando vi el .bash_history del usuario root tenía sólo 3 líneas.
> ----------------
> su
> password
> rm .bash_history
> ----------------
>
> Verdaderamente se puede decir que son tres comandos muy comprometidos
> si tienes la clave de root (información que no se como la han
> conseguido). El caso es que despues de ver esto me puse manos a la obra
> para averiguar un poco sobre lo que estaba pasando.
>
> Encontré algo acerca de los rootkit para linux, concretamente el
> chkrootkit-0.48 que me dió la siguiente salida:
>
> root@Calculon:/home/hipoter/chkrootkit-0.48# cat salida
> ROOTDIR is `/'
> Checking `amd'... not found
> Checking `basename'... not infected
> Checking `biff'... not found
> Checking `chfn'... not infected
> Checking `chsh'... not infected
> Checking `cron'... not infected
> Checking `crontab'... not infected
> Checking `date'... not infected
> Checking `du'... not infected
> Checking `dirname'... not infected
> Checking `echo'... not infected
> Checking `egrep'... not infected
> Checking `env'... not infected
> Checking `find'... not infected
> Checking `fingerd'... not found
> Checking `gpm'... not found
> Checking `grep'... not infected
> Checking `hdparm'... not found
> Checking `su'... not infected
> Checking `ifconfig'... INFECTED
> Checking `inetd'... not tested
> Checking `inetdconf'... not infected
> Checking `identd'... not found
> Checking `init'... not infected
> Checking `killall'... not infected
> Checking `ldsopreload'... not infected
> Checking `login'... not infected
> Checking `ls'... not infected
> Checking `lsof'... not infected
> Checking `mail'... not found
> Checking `mingetty'... not found
> Checking `netstat'... not infected
> Checking `named'... not found
> Checking `passwd'... not infected
> Checking `pidof'... not infected
> Checking `pop2'... not found
> Checking `pop3'... not found
> Checking `ps'... not infectedChecking `tcpd'... not infected
> Checking `tcpdump'... not infected
> Checking `top'... not infected
> Checking `telnetd'... not found
> Checking `timed'... not found
> Checking `traceroute'... not infected
> Checking `vdir'... not infected
> Checking `w'... not infected
> Checking `write'... not infected
> Checking `aliens'... no suspect files
> Searching for sniffer's logs, it may take a while... nothing found
> Searching for HiDrootkit's default dir... nothing found
> Searching for t0rn's default files and dirs... nothing found
> Searching for t0rn's v8 defaults... Possible t0rn v8 \(or variation\)
> rootkit installed
> Searching for Lion Worm default files and dirs... nothing found
> Searching for RSHA's default files and dir... nothing found
> Searching for RH-Sharpe's default files... nothing found
> Searching for Ambient's rootkit (ark) default files and dirs... nothing
> found
> Searching for suspicious files and dirs, it may take a while...
> /usr/lib/xulrunner/.autoreg /usr/lib/iceweasel/.autoreg /lib/init/rw/.ramfs
> Searching for LPD Worm files and dirs... nothing found
> Searching for Ramen Worm files and dirs... nothing found
> Searching for Maniac files and dirs... nothing found
> Searching for RK17 files and dirs... nothing found
> Searching for Ducoci rootkit... nothing found
> Searching for Adore Worm... nothing found
> Searching for ShitC Worm... nothing found
> Searching for Omega Worm... nothing found
> Searching for Sadmind/IIS Worm... nothing found
> Searching for MonKit... nothing found
> Searching for Showtee... Warning: Possible Showtee Rootkit installed
> Searching for OpticKit... nothing found
> Searching for T.R.K... nothing found
> Searching for Mithra... nothing found
> Searching for LOC rootkit... nothing found
> Searching for Romanian
> rootkit... /usr/include/file.h /usr/include/proc.h
> Searching for Suckit rootkit... nothing found
> Searching for Volc rootkit... nothing found
> Searching for Gold2 rootkit... nothing found
> Searching for TC2 Worm default files and dirs... nothing found
> Searching for Anonoying rootkit default files and dirs... nothing found
> Searching for ZK rootkit default files and dirs... nothing found
> Searching for ShKit rootkit default files and dirs... nothing found
> Searching for AjaKit rootkit default files and dirs... nothing found
> Searching for zaRwT rootkit default files and dirs... nothing found
> Searching for Madalin rootkit default files... nothing found
> Searching for Fu rootkit default files... nothing found
> Searching for ESRK rootkit default files... nothing found
> Searching for rootedoor... nothing found
> Searching for ENYELKM rootkit default files... nothing found
> Searching for common ssh-scanners default
> files... /var/tmp/._/alfa/ssh-scan
> /var/tmp/._/alfa/pscan2
> /var/tmp/._/alfa/vuln.txt
> /var/tmp/scan/ssh-scan
> /var/tmp/scan/vuln.txt
> Searching for suspect PHP files... nothing found
> Searching for anomalies in shell history files... Warning:
> `//root/.qemu_history' file size is zero
> Checking `asp'... not infected
> Checking `bindshell'... not infected
> Checking `pstree'... INFECTED
> Checking `rpcinfo'... not infected
> Checking `rlogind'... not found
> Checking `rshd'... not found
> Checking `slogin'... not infected
> Checking `sendmail'... not foundChecking `lkm'... chkproc: nothing
> detected
> chkdirs: nothing detected
> Checking `rexedcs'... not found
> Checking `sniffer'... eth0: not promisc and no PF_PACKET sockets
> Checking `w55808'... not infected
> Checking `wted'... chkwtmp: nothing deleted
> Checking `scalper'... not infected
> Checking `slapper'... not infected
> Checking `z2'... chklastlog: nothing deleted
> Checking `chkutmp'... The tty of the following user process(es) were
> not found
> in /var/run/utmp !
> ! RUID PID TTY CMD
> ! root 13316 tty7 /usr/bin/X :0 -dpi 96 -audit 0
> -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7
> ! hipoter 9795 pts/0 -bash
> ! root 9850 pts/0 su
> ! root 9851 pts/0 bash
> ! root 11047 pts/0 /bin/sh ./chkrootkit
> ! root 12110 pts/0 ./chkutmp
> ! root 12111 pts/0 ps ax -o tty,pid,ruser,args
> chkutmp: nothing deleted
> Checking `sshd'... not infected
> Checking `syslogd'... not infected
> Checking `tar'... not infected
>
>
> Bueno... como podeis ver tengo la suerte de estar infectado con el
> "Searching for t0rn's v8 defaults... Possible t0rn v8 \(or variation\)
> rootkit installed". A parte de que tengo modificado el fichero ifconfig
> y el pstree.
> Cuando cargo el pstree me salta con:
> pstree: error while loading shared libraries: libtermcap.so.2: cannot
> open shared object file: No such file or directory.
> Algo pasa rarete también con el ifconfig porque cuando no tengo
> conexión física y me pongo a cambiar de ip o hacer alguna gestión con el
> mismo, pero sin tener conexión física (cable por ejmp), este se me queda
> congelado por completo.
>
> Estoy tratando de ver mas cosas modificadas en el sistema, la tarjeta
> de red no está en modo promiscuo que en cierto modo es tranquilizador.
> Para ver esto he utilizado un .c que he buscado por ahí para
> comprobarlo.
>
> Mis procesos: ps -auxfw
>
>
>
>
>
> ps auxfw
> USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
> root 1 0.0 0.0 6124 692 ? Ss Feb05 0:00 init
> [2]
> root 2 0.0 0.0 0 0 ? S Feb05 0:00
> [migration/0]
> root 3 0.0 0.0 0 0 ? SN Feb05 0:00
> [ksoftirqd/0]
> root 4 0.0 0.0 0 0 ? S Feb05 0:00
> [watchdog/0]
> root 5 0.0 0.0 0 0 ? S Feb05 0:00
> [migration/1]
> root 6 0.0 0.0 0 0 ? SN Feb05 0:00
> [ksoftirqd/1]
> root 7 0.0 0.0 0 0 ? S Feb05 0:00
> [watchdog/1]
> root 8 0.0 0.0 0 0 ? S< Feb05 0:00
> [events/0]
> root 9 0.0 0.0 0 0 ? S< Feb05 0:00
> [events/1]
> root 10 0.0 0.0 0 0 ? S< Feb05 0:00
> [khelper]
> root 11 0.0 0.0 0 0 ? S< Feb05 0:00
> [kthread]
> root 16 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kblockd/0]
> root 17 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kblockd/1]
> root 18 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kacpid]
> root 129 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [khubd]
> root 131 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kseriod]
> root 180 0.0 0.0 0 0 ? S Feb05 0:00 \_
> [pdflush]
> root 181 0.0 0.0 0 0 ? S Feb05 0:00 \_
> [pdflush]
> root 182 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kswapd0]
> root 183 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [aio/0]
> root 184 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [aio/1]
> root 781 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [ata/0]
> root 782 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [ata/1]
> root 783 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [ata_aux]
> root 798 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [scsi_eh_0]
> root 803 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [scsi_eh_1]
> root 1065 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kjournald]
> root 1603 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kpsmoused]
> root 1936 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kmirrord]
> root 2028 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kjournald]
> root 2030 0.0 0.0 0 0 ? S< Feb05 0:00 \_
> [kjournald]
> root 1260 0.0 0.0 11436 1596 ? S<s Feb05 0:00 udevd
> --daemon
> root 2554 0.0 0.0 3728 664 ? Ss Feb05
> 0:00 /sbin/syslogd
> root 2560 0.0 0.0 2656 388 ? Ss Feb05
> 0:00 /sbin/klogd -x
> root 2591 0.0 0.0 16012 1044 ? Ss Feb05
> 0:00 /usr/sbin/hpiod
> hplip 2594 0.0 0.3 48348 7104 ? S Feb05 0:00
> python /usr/sbin/hpssd
> root 2651 0.0 0.0 10108 1512 ? S Feb05
> 0:00 /bin/sh /usr/bin/mysqld_safe
> mysql 2688 0.0 1.1 147548 23240 ? Sl Feb05 0:02
> \_ /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql
> root 2689 0.0 0.0 2640 536 ? S Feb05 0:00 \_
> logger -p daemon.err -t mysqld_safe -i -t mysqld
> root 2805 0.0 0.0 2652 600 ? Ss Feb05
> 0:00 /usr/sbin/acpid -c /etc/acpi/events -s /var/run/acpid.socket
> root 2826 0.0 0.1 28812 2392 ? Ss Feb05
> 0:07 /usr/sbin/cupsd
> 103 2834 0.0 0.0 9656 1032 ? Ss Feb05
> 0:00 /usr/bin/dbus-daemon --system
> 104 2846 0.0 0.2 19736 4332 ? Ss Feb05
> 0:00 /usr/sbin/hald
> root 2847 0.0 0.0 11268 1128 ? S Feb05 0:00 \_
> hald-runner
> 104 2854 0.0 0.0 9268 892 ? S Feb05 0:00 \_
> hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
> 104 2858 0.0 0.0 9268 900 ? S Feb05 0:00 \_
> hald-addon-keyboard: listening on /dev/input/event0
> root 2878 0.0 0.0 4956 672 ? S Feb05 0:12 \_
> hald-addon-storage: polling /dev/hda
> root 2885 0.0 0.0 4008 692 ? Ss Feb05
> 0:00 /usr/sbin/dhcdbd --system
> root 2892 0.0 0.0 20968 1984 ? Ss Feb05
> 0:00 /usr/sbin/NetworkManager
> --pid-file /var/run/NetworkManager/NetworkManager
> root 2900 0.0 0.0 12312 1176 ? Ss Feb05
> 0:00 /usr/sbin/NetworkManagerDispatcher
> --pid-file /var/run/NetworkManager/Netw
> root 2937 0.0 0.0 28772 1508 ? Ss Feb05
> 0:00 /usr/sbin/nmbd -D
> root 2939 0.0 0.1 40824 3192 ? Ss Feb05
> 0:00 /usr/sbin/smbd -D
> root 2945 0.0 0.0 40716 1368 ? S Feb05 0:00
> \_ /usr/sbin/smbd -D
> root 2997 0.0 0.2 41648 4648 ? S Feb06 0:02
> \_ /usr/sbin/smbd -D
> root 13865 0.0 0.1 41096 2792 ? S 12:07 0:00
> \_ /usr/sbin/smbd -D
> uml-net 2953 0.0 0.0 2652 440 ? Ss Feb05
> 0:00 /usr/bin/uml_switch -unix /var/run/uml-utilities/uml_switch.ctl
> root 2977 0.0 0.0 30024 1776 ? Ss Feb05
> 0:00 /usr/sbin/winbindd
> root 2983 0.0 0.0 30024 1348 ? S Feb05 0:00
> \_ /usr/sbin/winbindd
> root 3893 0.0 0.0 30024 1052 ? S Feb05 0:00
> \_ /usr/sbin/winbindd
> root 3041 0.0 0.0 55124 2004 ? Ss Feb05
> 0:00 /usr/sbin/gdm
> root 13315 0.0 0.1 61632 2960 ? S Feb06 0:00
> \_ /usr/sbin/gdm
> root 13316 17.2 5.0 439004 104640 tty7 SLs+ Feb06 731:28
> \_ /usr/bin/X :0 -dpi 96 -audit 0 -auth /var/lib/gdm/:0.Xauth -nolist
> hipoter 13333 0.0 0.6 102960 13832 ? Ss Feb06 0:01 \_
> x-session-manager
> hipoter 13376 0.0 0.0 17816 792 ? Ss Feb06 0:00
> \_ /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-
> root 3070 0.0 0.0 11500 940 ? Ss Feb05
> 0:00 /usr/sbin/cron
> root 3126 0.0 0.4 39860 9844 ? Ss Feb05
> 0:00 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
> root 3137 0.0 0.0 25280 1216 tty1 Ss Feb05
> 0:00 /bin/login --
> root 12999 0.0 0.0 11784 2036 tty1 S+ Feb06 0:00 \_
> -bash
> root 3138 0.0 0.0 2656 540 tty2 Ss+ Feb05
> 0:00 /sbin/getty 38400 tty2
> root 3139 0.0 0.0 2652 536 tty3 Ss+ Feb05
> 0:00 /sbin/getty 38400 tty3
> root 3140 0.0 0.0 2652 536 tty4 Ss+ Feb05
> 0:00 /sbin/getty 38400 tty4
> root 3141 0.0 0.0 2652 536 tty5 Ss+ Feb05
> 0:00 /sbin/getty 38400 tty5
> root 3142 0.0 0.0 2656 536 tty6 Ss+ Feb05
> 0:00 /sbin/getty 38400 tty6
> root 3155 0.0 0.0 1984 516 ? Ss Feb05
> 0:00 /sbin/ttyload -q
> root 3157 0.0 0.0 1616 548 ? R Feb05 0:05 ttymon
> tymon
> hipoter 13379 0.0 0.0 7852 668 ? S Feb06
> 0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
> hipoter 13380 0.0 0.0 9524 880 ? Ss Feb06
> 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6
> --session
> hipoter 13382 0.0 0.2 23868 4764 ? S Feb06
> 0:00 /usr/lib/libgconf2-4/gconfd-2 5
> hipoter 13385 0.0 0.0 10868 788 ? S Feb06
> 0:00 /usr/bin/gnome-keyring-daemon
> hipoter 13387 0.0 0.1 29312 3628 ? Ss Feb06
> 0:00 /usr/lib/bonobo-activation/bonobo-activation-server --ac-activate
> --ior-ou
> hipoter 13389 0.0 0.5 116320 11728 ? Sl Feb06
> 0:04 /usr/lib/control-center/gnome-settings-daemon
> --oaf-activate-iid=OAFIID:GN
> hipoter 13391 0.0 0.3 97696 8164 ? S Feb06
> 0:12 /usr/lib/vino/vino-server
> --oaf-activate-iid=OAFIID:GNOME_RemoteDesktopSer
> hipoter 13411 0.0 1.1 121476 24220 ? Ssl Feb06 0:04
> gnome-panel --sm-client-id default1
> hipoter 13413 0.0 1.6 189824 33780 ? Ssl Feb06 0:09
> nautilus --no-default-window --sm-client-id default2
> hipoter 13418 0.0 0.3 88988 7824 ? Ss Feb06 0:00
> vino-session --sm-client-id default5
> hipoter 13420 0.0 0.2 57984 5792 ? Ss Feb06 0:00
> bluetooth-applet
> hipoter 13421 0.0 0.2 91252 6076 ? Ss Feb06 0:00
> gnome-volume-manager --sm-client-id default4
> hipoter 13423 0.0 0.2 51280 5216 ? Sl Feb06
> 0:00 /usr/lib/gnome-vfs-2.0/gnome-vfs-daemon
> --oaf-activate-iid=OAFIID:GNOME_VF
> hipoter 13425 0.0 0.7 104292 15052 ? Ss Feb06 0:01
> update-notifier
> hipoter 13429 0.0 0.3 78920 6344 ? Ssl Feb06 0:00
> beryl-manager
> hipoter 13521 0.0 0.6 69428 13308 ? S Feb06 0:18 \_
> emerald --replace
> hipoter 13530 4.9 3.2 208268 67064 ? SL Feb06 210:28 \_
> beryl --skip-gl-yield
> hipoter 13432 0.0 0.5 97480 11392 ? Ss Feb06 0:02
> nm-applet --sm-disable
> hipoter 13439 0.0 0.4 126948 9764 ? Ss Feb06 3:10
> gnome-cups-icon --sm-client-id default3
> hipoter 13452 0.0 0.7 102484 16348 ? S Feb06
> 0:12 /usr/lib/gnome-panel/wnck-applet
> --oaf-activate-iid=OAFIID:GNOME_Wncklet_F
> hipoter 13453 0.0 0.3 97156 6584 ? Ss Feb06 0:02
> gnome-power-manager
> hipoter 13490 0.0 0.0 10788 976 ? S Feb06
> 0:00 /usr/lib/nautilus-cd-burner/mapping-daemon
> hipoter 13555 0.0 0.7 137068 15872 ? Sl Feb06
> 0:00 /usr/lib/gnome-panel/clock-applet
> --oaf-activate-iid=OAFIID:GNOME_ClockApp
> hipoter 13557 0.0 0.4 90384 8880 ? S Feb06
> 0:00 /usr/lib/gnome-panel/notification-area-applet
> --oaf-activate-iid=OAFIID:GN
> hipoter 13559 0.0 0.7 109596 15512 ? S Feb06
> 0:01 /usr/lib/gnome-applets/mixer_applet2
> --oaf-activate-iid=OAFIID:GNOME_Mixer
> hipoter 13565 0.0 0.8 125576 16824 ? Sl Feb06 3:31 xmms
> hipoter 13577 0.0 0.3 86748 7424 ? Ss Feb06 0:06
> gnome-screensaver
> root 4992 0.0 0.4 94928 8616 ? Ss Feb08
> 0:00 /usr/sbin/apache2 -k start
> www-data 5008 0.0 0.3 94928 6644 ? S Feb08 0:00
> \_ /usr/sbin/apache2 -k start
> www-data 5009 0.0 0.3 94928 6244 ? S Feb08 0:00
> \_ /usr/sbin/apache2 -k start
> www-data 5010 0.0 0.3 95040 6860 ? S Feb08 0:00
> \_ /usr/sbin/apache2 -k start
> www-data 5011 0.0 0.3 95040 6928 ? S Feb08 0:00
> \_ /usr/sbin/apache2 -k start
> www-data 5012 0.0 0.3 95096 7880 ? S Feb08 0:00
> \_ /usr/sbin/apache2 -k start
> www-data 9525 0.0 0.2 94928 4972 ? S 10:45 0:00
> \_ /usr/sbin/apache2 -k start
> www-data 12641 0.0 0.2 94928 4972 ? S 11:21 0:00
> \_ /usr/sbin/apache2 -k start
> hipoter 9312 0.2 2.0 270672 41484 ? Sl 10:39 0:14
> evolution-2.6
> hipoter 9314 0.0 0.4 145480 8544 ? Sl 10:39
> 0:00 /usr/lib/evolution/evolution-data-server-1.6
> --oaf-activate-iid=OAFIID:GNO
> hipoter 9320 0.0 0.5 166220 12144 ? Sl 10:39
> 0:00 /usr/lib/evolution/2.6/evolution-alarm-notify
> --oaf-activate-iid=OAFIID:GN
> hipoter 9511 1.0 5.2 319720 108176 ? Sl 10:45
> 0:54 /usr/lib/iceweasel/firefox-bin -a firefox
> hipoter 9544 0.0 0.0 0 0 ? Z 10:45 0:00 \_
> [npviewer.bin] <defunct>
> hipoter 9791 0.0 0.2 54476 4596 ? S 10:57 0:00 Eterm
> hipoter 9795 0.0 0.1 13284 3564 pts/0 Ss 10:57 0:00 \_
> -bash
> root 9850 0.0 0.0 19176 1144 pts/0 S 10:58 0:00 \_
> su
> root 9851 0.0 0.1 11596 2088 pts/0 S+ 10:58 0:00
> \_ bash
> hipoter 12152 0.0 0.2 54640 4756 ? S 11:04 0:00 Eterm
> hipoter 12153 0.0 0.1 14480 3664 pts/1 Ss 11:04 0:00 \_
> -bash
> root 12373 0.0 0.0 19176 1144 pts/1 S 11:11 0:00 \_
> su
> root 12374 0.0 0.1 12808 2220 pts/1 S 11:11 0:00
> \_ bash
> root 13893 0.0 0.0 9784 1080 pts/1 R+ 12:08 0:00
> \_ ps auxfw
>
>
> Mis conexiones: netstat -lntpe
> Active Internet connections (only servers)
> Proto Recv-Q Send-Q Local Address Foreign Address
> State User Inode PID/Program name
> tcp 0 0 127.0.0.1:2208 0.0.0.0:*
> LISTEN 0 6193 2591/hpiod
> tcp 0 0 127.0.0.1:47401 0.0.0.0:*
> LISTEN 112 6204 2594/python
> tcp 0 0 0.0.0.0:3306 0.0.0.0:*
> LISTEN 108 6341 2688/mysqld
> tcp 0 0 0.0.0.0:139 0.0.0.0:*
> LISTEN 0 8162 2939/smbd
> tcp 0 0 0.0.0.0:5900 0.0.0.0:*
> LISTEN 1000 55892 13391/vino-server
> tcp 0 0 0.0.0.0:9870 0.0.0.0:*
> LISTEN 0 8656 3155/ttyload
> tcp 0 0 0.0.0.0:10000 0.0.0.0:*
> LISTEN 0 8585 3126/perl
> tcp 0 0 127.0.0.1:631 0.0.0.0:*
> LISTEN 0 131839 2826/cupsd
> tcp 0 0 0.0.0.0:445 0.0.0.0:*
> LISTEN 0 8161 2939/smbd
> tcp6 0 0 :::80 :::*
> LISTEN 0 109020 4992/apache2
>
>
>
> Nmap: nmap localhost
>
> Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2009-02-09 11:52
> CET
> Interesting ports on localhost (127.0.0.1):
> Not shown: 1673 closed ports
> PORT STATE SERVICE
> 80/tcp open http
> 139/tcp open netbios-ssn
> 445/tcp open microsoft-ds
> 631/tcp open ipp
> 3306/tcp open mysql
> 5900/tcp open vnc
> 10000/tcp open snet-sensor-mgmt
>
>
> Podeis imaginar lo que hice con el ssh despues de ver el .bash_history.
>
> Estoy a punto de reinstalar el sistema base o actualizarlo para
> recuperar los binarios que tengo modificados y "terminar con el
> problema". Me gustaría investigar mas a parte de lo comentado hasta
> ahora para saber mas acerca de este tipo de ataques y por donde han
> entrado que es lo que me hace romperte el celebro, físicamente en este
> ordenador sólo estoy yo trabajando y aqui nadie lo usa porque todos son
> windowseros profesionales, de manera que nadie ha cojido y se ha puesto
> a instalar cosas raras en el sistema, no dejo a nadie del exterior que
> entre al server via ssh ni vnc... resumiento, que nadie toca esta
> máquina menos yo, y a no ser que un día me habría fumado un porro y me
> pusiese a hacer cosas extrañas en el sistema, luego no se como se ha
> podido esto petar.
>
> Me da por pensar.... y me acuerdo del servidor web este que tenía el
> windows nt server creo que se llamaba iss 2, el caso es que pude
> comprobar que había un gusano/troyano como se llame que infectaba el
> mismo y abría el netbios de manera que podías tener acceso a los datos
> del infectado, que el mismo a su vez infectaba a otros servidores
> similares con el mismo fallo. Comento esto, porque pienso que al apache
> le ha pasado algo parecido, si no me explico como carajo han conseguido
> entrar y borrar el .bash_history, pero esto es sólo una teoría mia.
>
> A ver si alguien puede indicarme que otras cosas puedo comprobar antes
> de reinstalar los binarios infectados.
>
> - ¿ Donde estan instalados los ficheros del f0n este ?
> ¿ Como se ha infectado mi máquina ?
> ¿ Que otra información debería comprobar antes de reparar ?
>
> Espero que este post sirva de interes para aquellos que lo consideren y
> colaboren a saber el porqué.... :-)
>
> Salu2.
>
>
Especificamente hace algun tiempo lei, el funcionamiento de los rootkits
en linux, ahora bien raramente se usa la vulnerabilidad de un binario
para subir y escalar privilegios, asi que empiezo a responder tus
preguntas.
1) ¿Donde estan los archivos del rootkit?
R: El rootkit, seguramente sobreescribio los archivos infectados a
traves de algun exploit que explotaba una vulnerabilidad en un servicio.
Asi que ya con archivos con los archivos comprometidos (probablemente
aquellos con el setuid de root) ya no hacen falta los archivos
originales si es que alguna vez los hubo.
2) ¿Como se ha infectado tu maquina?
R: Si estas seguro que nadie fisicamente tuvo acceso a ella, seguramente
haya sido por algun servicio corriendo, he alli la importancia de
desactivar los servicios que no usemos y actualizar contra bugs y fallos
descubiertos los que tenemos funcionando. Seguramente un exploit se
aprovecho de algun servicio vulnerable.
3) ¿Que deberias hacer antes de reinstalar los binarios?
R: Lo mas sensato, seria verificar la tabla de llamadas al sistema, por
que ese es el primer objetivo de un rootkit.. al modificar la tabla de
llamadas al sistema se pueden ocultar procesos, o hasta conexiones de
red. Asi que deberias hacerte de un buen anti-rootkit que te ayude en
esta labor.
PD : Espero te haya servido mi respuesta para aclarar tus dudas.
Reply to:
- References:
- Rootkit.
- From: Francisco Calero <pcm@inproda.es>