Hyper-v üzerinde çalışan linux virtual sistemler de (Redhat,Suse,Centos) time sekronizasyon problemi oluşmaktaydı.Uzun süre önce Microsoft, bu durumu düzeltmek adına Linux Integration Services isimli bir patch yayınlandı.Belirttiğim güncelleme linux sisteme geçilip reboot edildikten sonra host ve linux virtual makinalar arasındaki saat sekronizasyonu sync edilebiliyordu.Vmware sanallaştırma teknolojilerini kullanmak varken neden Hyper-V üzerinde linux sanallaştırayım diyebilirsiniz.Açıkcası, hyper-v üzerinde çalışan linux sistemler için sık sık time sekronizasyonu ve diğer servislerin uyumsuz çalıştığını görüyorum.Bu sebeple benzeri bir problemin çözümünü detaylıca bu sayfa üzerinde anlatmak istedim. “Linux Integration Services” ayarları yapıldıktan sonra “seth0″ ismin de bir sync interface ve kernel’e eklenen bir kaç adet modül geliyor ki içlerinde gereksiz olanlar da mevcut.Eğer eklenilen modüller build edilmemişse update veya upgrade edilmiş kernel, reboot edildikten sonra time sekronizasyonu için eklenenmiş modulleri load edemiyor dolayısıyla filesystem boot olamayıp operating sistem de açılamıyor.(Kernal Hard Panic) Continue reading
Share on Facebook‘Grub’ Boot Looader Repair
Unix işletim sistemler üzerinde çalışan grub mekanizması(Grub Interface) eğer yapılan hatalı/yanlış bir işlem sebebiyle corrupt olmuşsa, x86 veya x86_64 bit core işletim sistemleri reboot edildiği esnada “grub” işlevi ile çalışamayacaktır. Dolayısıyla yüklü olan herhangi bir kernel ile işletim sistemi de boot edilemeyecektir.
Zira, ilgili işletim sisteminin bahsettiğimiz trouble duruma düşmesi için öncesinde mount edilmiş bir veya birden fazla filesystem’in corrupt olması gerekiyor.Örneğin, kernel image’larının yüklendiği alan olan /boot isimli klasör’ün mount edildiği fiziksel disk’e(sda1,hda1 vs) ait filesystem(ext3,ext4) corrupt olsun veya /boot klasörünü mount eden parametre “fstab” isimli dosyadan silinmiş olsun işte bu iki olası case bahsettiğimiz problemin meydana gelmesine sebep olacaktır.
Bu ve benzeri grub problemlerin de işletim sistemini “Rescue Mode” ile boot edip, ardından aşağıda göreceğiniz “grub-install” komutu ile /boot isimli klasörü tekrar grub interface’sine dahil ederseniz sorun çözülmüş olacaktır
Komut:
grub-install –root-directory=/boot ‘<device_name>’
–root-directory = Klasör ismi
‘<device_name>’ = /boot klasorunun mount edildiği fiziksel disk. Örnek: ‘(sda1)’
Content Search with Sed using REGEX
SED also knowns as the Stream Editor’ when you want to search somethings in files particulary with regex, you can use sed like grep or awk.I gave some example about the this stream editor for, that want to using regex with sed.
sed -n 354p /var/log/messages
Jun 12 03:42:18 rhel6 kernel: pci 0000:00:15.7: BAR 13: can’t allocate I/O resource
[0x1000-0x1fff]
Prints the first line of the file
sed -n ‘$p’ /var/log/messages
Jun 13 21:37:20 rhel6 pulseaudio[2836]: alsa-sink.c: We were woken up with POLLUT set —
however a subsequent snd_pcm_avail() returned 0 or another value < mi_avail.
Prints the last line.
sed -n 4,390p /var/log/messages
Prints lines ’4′ with ’390′.
sed -n ’1!p’ ugur.txt
Prints all line but line ’1′.
sed -n ’1,3!p’ ugur.txt
Prints all line but lines ’1′ and ’3′.
Content Search/Filter with AWK using REGEX
I want to talking about the “awk” command running as a grep or sed .This command is a pattern scanning and processing, if you can use it as correct while working that contain complex file, so it can be usefull.Also you can use regular expression while using awk , if you need of course.But i recommended to you got to use regex with awk.
Let’s start the review this command step by step to understand whic how to work this.
This command that prints first column in ugur.txt.
[root@rhel6 ~]# awk ‘{print $1}’ ugur.txt
linux
LINUX
ugur
hacker
redhat
rhel
rhellinux
bash
init
OS
architecture
This command that prints first and second columns in ugur.txt. Continue reading
Share on FacebookEn ideal listing komutu(ls)
ls -lahtr | grep install.txt && echo “exit status $?”
-rw-r–r–. 1 root root 55K Jun 9 03:20 install.txt
-rw-r–r–. 1 root root 13K Jun 9 03:22 install.txt.gz
-rw-r–r–. 1 root root 13K Jun 9 03:27 install.txt2.gz
-rw-r–r–. 1 root root 15K Jun 9 03:42 install.txt3.gz
exit status 0
Exit status:
0 if OK,
1 if minor problems (e.g., cannot access subdirectory),
2 if serious trouble (e.g., cannot access command-line argument).
l: listing format
a : all
h: print sizes in human readable format
t: sort by modification time
r: reverse order while sorting
Squid ile Erişim İzinleri
Squid’in genel ayarları ve squid ile basit erişim izinlerinin ele alacağız.İşlemler öncesi eğer sistem üzerinde SElinux yapılandırması varsa squid’in çalışması için aşağıdaki kuralı girmemiz gerekiyor.
setsebool -P squid_connect_any 1
Squid, sistem her reboot oluşunda otomatik başlasın.
chkconfig squid on
/et/rc.d/init.d isimli klasöre geçip startup’a eklediğimiz servisi kontrol edelim.
[root@matrix init.d]# ls -l | grep 'squid' & chkconfig --list | grep 'squid'
[1] 25893 -rwxr-xr-x 1 root root 4022 Mar 31 2010 squid squid 0:off 1:off 2:on 3:on 4:on 5:on 6:off [1]+ Done ls --color=tty -l | grep 'squid'
SQUID’in temel konfigürasyon dosyası: /etc/squid/squid.conf
http_port 3128 #Sistem içerisinde , 1100 üzeri listening olmayan bir tcp port'da girilebilir. visible_hostname localhost.localdomain acl lan_net src 192.168.219.0/24 (mevcut C class subnetimizi belirtiliyoruz.) acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl to_localhost dst 127.0.0.0/8
Dosya içerisinde yapılan işlemlerin aktif olması için aşağıdaki komutları çalıştırmalısınız.
[root@matrix ~]#
service squid stop Stopping squid: ................
[ OK ]
[root@matrix ~]# squid -z 2010/12/30 15:15:57| Creating Swap Directories
[root@matrix ~]# service squid start Starting squid: .
[ OK ]
Access Control Lists(Erişim kontrol listeleri)
- Proxy sunucu üzerinden engelsiz ve direk erişim sağlamak.
http_access allow localhost http_access allow all
- Proxy sunucu üzerinden kısıtlı erişim sağlamak.
http_access allow localhost acl block-sites dstdomain "/root/sites.squid" http_access deny block-sites #sites.squid dosyasina erişilmesini istemediğiniz siteleri topluca girebiliriz. acl blocksite dstdomain xxx.com #Sadece ilgili ana domain'e yapılacak erişimler bloklandı. acl blocksites dstdomain .xxx.com #xxx.com ve o domaine ait olan tüm subdomainlere yapılabilecek erişim engellendi. http_access deny blocksite
IP bazli ACL erişimleri aşağıdaki tanımlara göre oluşturabilir.
# acl aclname src ip-address/netmask ... (clients IP address) # acl aclname src addr1-addr2/netmask ... (range of addresses) # acl aclname dst ip-address/netmask ... (URL host's IP address) # acl aclname myip ip-address/netmask ... (local socket IP address) # acl aclname arp mac-address ... (xx:xx:xx:xx:xx:xx notation)
Arp erişim işlemleri için ön bilgi.
# # The arp ACL requires the special configure option --enable-arp-acl. # # Furthermore, the arp ACL code is not portable to all operating systems. # # It works on Linux, Solaris, FreeBSD and some other *BSD variants.
Eğer local’deki clientler IPtables Firewall üzerinden dış dünya ile haberleşiyorlarsa, IPtables’a aşağıdaki kuralı girerek 80.port ile yapacaklari tum requestleri squid üzerinden geçirebilirsiniz.Dolayısıyla iç network trafiği loglanarak belirlenen kurallar ile dışarı çıkacaktır.
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT \ --to-ports 3128
SQUID’e ait dizinler
/etc/squid : Squid'in temel konfigürasyon dosyalarının bulunduğu klasör. /var/log/squidd/ : Genel log dosyalarının bulunduğu klasör. /var/spool/squid/ : Squid tarafindan loglanan http erişimleri. /usr/sbin/squid : Squid'in ana prosesi) Squidguard veya Dansguardian isimli uygulamalardan birini sisteme enregre ederek squid sunucunuzu bir grafik arayüzü(gui) ile daha rahat ve geniş kapsamlı yönetebilirsiniz.
Referanslar:
http://www.squid-cache.org/Doc/
http://dansguardian.org/?page=documentation
http://www.squidguard.org/Doc/
The Art of Human Hacking
I have been looking this book whic is visiting on the offensive page.As you can see these details what about this book .
” For Social Engineering: The Art of Human Hacking has already ranked “#10″ in the Hacking category of Amazon’s best-seller list and it just started shipping this week. For social engineers and anyone that interacts with other people, this is bound to become an essential resource.”