Double Dragon: chkrootkit e portsentry, agora vai rolar pancadaria nos intrusos!

Este artigo descreve como instalar o chkrootkit e portsentry. Ele deve funcionar (talvez com pequenas alterações relativas caminhos etc) em todos os sistemas operacionais *nix. Chkrootkit é uma ferramenta para verificar e detectar sinais de um rootkit. Portsentry fornece serviços de vigilância a nível de segurança para a plataforma Unix.

[ Hits: 18.205 ]

Por: Mauro Risonho de Paula Assumpção A.K.A firebits em 11/02/2010


Double Dragon: chkrootkit e portsentry, agora vai rolar pancadaria nos intrusos!



Este artigo descreve como instalar o chkrootkit e portsentry. Ele deve funcionar (talvez com pequenas alterações relativas caminhos etc) em todos os sistemas operacionais *nix.

Chkrootkit é uma ferramenta para verificar e detectar sinais de um rootkit (http://www.chkrootkit.org).

Portsentry fornece serviços de vigilância ao nível de boa segurança para a plataforma Unix. Portsentry, Logcheck/Logsentry e Hostsentry protegem contra portscans, automatizam a auditoria de arquivos de log e detectam atividades suspeitas de login em uma base contínua. Fonte traduzida de: http://sourceforge.net/projects/sentrytools/

Este artigo foi feito para ser um guia prático, que não cobre as orientações teóricas. Eles são tratados em uma série de outros documentos na web. Este artigo vem sem nenhum tipo de garantia!

Quando eu era pequeno, eu (hoje com 32 anos) e meu irmão menor (hoje com 28 anos), na época (somos apenas em 2) íamos todo santo dia jogar Double Dragon no bar aqui em Cosmópolis/SP, perto onde mora minha mãe. Hoje a máquina não existe mais, se não me engano ficaram com ela até no ano de 2005 (durou muito!) e aí me lembrei em fazer este artigo como se fosse aquela dupla do Double Dragon, relembrando os tempos bons das "fichinhas" do Arcade que eu e meu irmão comprávamos muito!
Linux: Double Dragon: chkrootkit e portsentry, agora vai rolar pancadaria nos intrusos!

Obtendo os códigos-fonte

Precisamos dos seguintes softwares: chkrootkit, portsentry e logcheck. Instalaremos o software a partir do diretório /tmp.

# cd /tmp
# wget --passive-ftp
ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz
# wget http://heanet.dl.sourceforge.net/sourceforge/sentrytools/portsentry-x.x.tar.gz
# wget http://heanet.dl.sourceforge.net/sourceforge/sentrytools/logcheck-x.x.x.tar.gz

Instalando o Chkrootkit

# mv chkrootkit.tar.gz /usr/local/
# cd /usr/local/
# tar xvfz chkrootkit.tar.gz
# ln -s chkrootkit-0.xx/ chkrootkit
(entenda como 0.xx uma versão mais recente do software)
# cd chkrootkit/
# make sense


Agora você encontrará o programa chkrootkit em /usr/local/chkrootkit.

Executamos digitando:

# cd /usr/local/chkrootkit/ && ./chkrootkit

Sua saída será algo parecido com isto:

ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... 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'... not infected
Checking `inetd'... not infected
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 infected
Checking `mingetty'... not found
Checking `netstat'... not infected
Checking `named'... not infected
Checking `passwd'... not infected
Checking `pidof'... not infected
Checking `pop2'... not found
Checking `pop3'... not found
Checking `ps'... not infected
Checking `pstree'... not infected
Checking `rpcinfo'... not infected
Checking `rlogind'... not found
Checking `rshd'... not found
Checking `slogin'... not infected
Checking `sendmail'... not infected
Checking `sshd'... not infected
Checking `syslogd'... not infected
Checking `tar'... not infected
Checking `tcpd'... not infected
Checking `tcpdump'... not infected
Checking `top'... not infected
Checking `telnetd'... not found
Checking `timed'... not found
Checking `traceroute'... not found
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... nothing found
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/perl/5.6.1/auto/Test/Harness/.packlist /usr/lib/perl/5.6.1/auto/DB_File/.packlist
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... nothing found
Searching for OpticKit... nothing found
Searching for T.R.K... nothing found
Searching for Mithra... nothing found
Searching for OBSD rk v1... nothing found
Searching for LOC rootkit ... nothing found
Searching for Romanian rootkit ... nothing found
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 anomalies in shell history files... nothing found
Checking `asp'... not infected
Checking `bindshell'... not infected
Checking `lkm'... nothing detected
Checking `rexedcs'... not found
Checking `sniffer'... eth0: not promisc and no PF_PACKET sockets
eth0:0: not promisc and no PF_PACKET sockets
eth0:1: not promisc and no PF_PACKET sockets
eth0:2: not promisc and no PF_PACKET sockets
eth0:3: not promisc and no PF_PACKET sockets
eth0:4: not promisc and no PF_PACKET sockets
Checking `w55808'... not infected
Checking `wted'... nothing deleted
Checking `scalper'... not infected
Checking `slapper'... not infected
Checking `z2'... nothing deleted

Se um worm, rootkit etc é encontrado, será indicado pela palavra "INFECTED" (em maiúsculas).

Se você deseja obter a saída do log do chkrootkit uma vez por dia via email às 3 da manhã, pode colocar a seguinte linha no arquivo raiz do cron. A localização depende de sua distribuição, no Debian Linux é em /var/spool/cron/crontabs/root). Você também pode encontrá-lo em /var/spool/cron/tabs/root ou algo parecido.

0 3 * * * (cd /usr/local/chkrootkit; ./chkrootkit 2>&1 | mail -s "chkrootkit output" me@myself.tld)

Em seguida execute:

# chmod 600 /var/spool/cron/crontabs/root
# /etc/init.d/cron restart


    Próxima página

Páginas do artigo
   1. Double Dragon: chkrootkit e portsentry, agora vai rolar pancadaria nos intrusos!
   2. PortSentry e Logcheck
Outros artigos deste autor

Os 5 princípios básicos de segurança para empresas

Teste de vulnerabilidades com OpenVAS 3.0

Wow! O que esta câmera de segurança está fazendo aí?

Buscar "Teste" no Google

É o hora do churrasco de... exploits! Quê?!? Não! Para churrasco e exploits, use Beef

Leitura recomendada

Auditando senhas com John The Ripper

Aquisição Estática de Dados em Computação Forense

Técnicas forenses para identificação da invasão e do invasor em sistemas Unix/Linux através do SSH (parte 2)

Utilizando RPM para detecção de intrusos

Ferramentas de segurança - uma pequena compilação

  
Comentários
[1] Comentário enviado por removido em 12/02/2010 - 20:04h

Excelente artigo,o rootkit é um vírus que se camufla e altera os binários do sistema fazendo com que o invasor possa ter acesso de Root.Parabéns...

[2] Comentário enviado por luizvieira em 15/02/2010 - 06:56h

Ótimo artigo, sempre utilizei soluções conjugadas desse tipo. Acrescentar um snort + guardian nessa brincadeira faria o negócio ficar mais sério ainda, e aí sairíamos de double dragon para ninja gaiden hehehe

[3] Comentário enviado por removido em 08/04/2010 - 02:39h

Checking `wted'... 3 deletion(s) between Sat Apr 3 17:59:37 2010 and Sun Apr 4 00:05:20 2010

eu executei o chkrootkit e apareceu essa mensagem no log, isso é uma coisa ruim?


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts