• 22-02-2014, 09:46:22
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Hoşgeldiniz


    Server saldırılarından alınan hasarı azaltmak ve çeşitli saldırı ve sorunları engellemek için ufak bir rehber hazırlama gereği duydum.


    Öncelikle en baştan bilgilendirmek isterimki yapıcağınız tüm işlemler kullanıcıya aittir, herhangi sorumluluk kabul etmiyorum. Yapacağınız tüm işlemlerden önce yedek almayı unutmayın.


    Öncelikle şunu önemle belirtmek isterim ki metinler TAMAMEN benim tarafımdan çevrilmiş ve DENENMİŞTİR. Lütfen emeğe saygı için izinsiz kopyalamayın.


    Ek olarak şunu da belirtmek isterim Direk İngilizce'den çevirme olmadığı için Farklı makalelerden çevirdiğim için Çeviri'de aksaklık olursa kusura bakmayın.




    İlk olarak PF ve IPFW anlatımı ile başlayalım


    Hemen Anlatıma Başlayalım


    1-1)PF(Packet Filter) Derleme Ve Yapılandırma


    1-1-1)Derleme


    Yapılcaklar;


    • 1-1-1-1)Kernel Kaynağı İndirilecek
    • 1-1-1-2)Başlatıcı Düzenlenicek
    • 1-1-1-3)Konfigrasyon dosyası yeni kernel için yapılandırılcak
    • 1-1-1-4)Yeni kernel derlenecek



    Başlayalım..


    1-1-1-1)Kernel Kaynağı:


    İlk evrede kaynak indirmeyi göstericem.


    Putty'den vereceğim komutları uygulayın;
    sysinstall [enter] --> [seçin] 
    configure [enter] --> [seçin] 
    distributions [enter] --> [seçin] 
    src [enter] --> [seçin]
    base ve sys [işaretleyin] --> [sağ sol tuş ile alttan ok'u seçin] --> [enter] 
    FTP [enter]
    main site [enter] --> bekleyin 
    sysinstall'e kadar geri dönün

    Bu aşama bitti


    Bu şekilde kernel çekirdeği güncelledik artık çalışabilir ve ihtiyacımızı göre adapte edebilir hale getirdik.




    1-1-1-2) Başlatıcı düzenleme:


    PF'nin gerekli izinlerini sağlamak için başlatıcıyı düzenlememiz gerekiyor.


    Aşağıdaki komutu putty'den uygulayın.


    cd /boot/defaults && ee loader.conf

    PF_LOAD="NO"
    Kısmını
    PF_LOAD="YES"
    olarak değiştirin


    Bundan sonra dosyayı kaydedip geri dönün.


    Bu aşamada bitti




    1-1-1-3)Konfigrasyon dosyasını yeni kernel için yapılandırma


    Konfigrasyon çekirdek seçeneklerini PF için düzenleyelim


    32-64Bit sistemler için 2 farklı yol mevcut.


    32Bit Kullanıcıları;
    cd /usr/src/sys/i386/conf

    64Bit Kullanıcıları;
    cd /usr/src/sys/amd64/conf

    Komutunu uygulasın.


    Daha sonra yukarıdaki komutlardan size uygun olanını girdikten sonra aşağıda vereceğim komut ile GENERIC konfigrasyon dosyasını kopyalayın.


    cp GENERIC bizim-cekirdegimiz

    Örnek:


    cp GENERIC Pasha

    Bu komuttan sonra konfigrasyon düzenleme zamanı:


    ee bizim-cekirdegimiz

    Örnek:


    ee Pasha

    "Options" yerine aşağıdaki seçenekleri ekleyelim


    device[TAB][TAB]pf
    device[TAB][TAB]pflog
    device[TAB][TAB]pfsync
    options[TAB][TAB]ALTQ
    options[TAB][TAB]ALTQ_CBQ
    options[TAB][TAB]ALTQ_RED
    options[TAB][TAB]ALTQ_RIO
    options[TAB][TAB]ALTQ_HFSC
    options[TAB][TAB]ALTQ_PRIQ
    options[TAB][TAB]ALTQ_NOPCC

    Not: [TAB] = Notepad'de tab tuşu ile oluşturacağınız boşluk




    Bu aşamada bitti


    1-1-1-4)Yeni kerneli derlemek


    Şimdi PF kısımının son aşaması olan çekirdek derleme kısmına geldik
    Basit bir işlem ancak uzun bir zaman alabilir.


    Aşağıdaki komutları girin.


    cd /usr/src && make buildkernel KERNCONF=çekirdek-adı &&  make installkernel KERNCONF=çekirdek-adı

    Bu aşamada bitti işlemin tamamlanması için yapı oluşturulana kadar bekleyin


    1-1-2) Başlangıç ve komutlar


    Şimdi başlangıç dosyasını düzenleme ve size temel komutları verme zamanı geldi.


    1-1-2-1)Başlangıç


    Aşağıdaki komutlardan sonra başlatma dosyası(rc.conf) düzenleyin.


    ee /etc/rc.conf

    Aşağıdaki içeriği yapıştırın.


    pf_enable="YES"
    pf_rules="/etc/pf.conf"
    pf_flags=""
    pflog_enable="YES"
    pflog_logfile="/var/log/pflog"
    pflog_flags="”

    Bu otomatik başlatma kısmı Şimdi komutları listeleme zamanı:


    1-1-2-2)Komutlar


    PF Komutları:


    /etc/rc.d/pf restart | start | stop
    PF yeniden başlat | aç | kapat
    pfctl -F all -f /etc/pf.conf
    PF kurallarını yeniden yükler ve PF yi yeniden başlatır


    Sırada son adım


    1-1-2-3) PF Kuralları


    PF.conf dosyasında bulunan PF kuralları
    Önemli parça olduğundan Onlar olmadan kernel işlemlerini yapamayız
    Şimdi size hazır kuralları verip bunları nasıl yapacağınızı göstericem


    ilk önce PF dosyası oluşturuyoruz


    ee /etc/pf.conf

    Kuralları yapmaya başlıyoruz.


    Öncelikle rahatça kendi kurallarınızı yazabilirsiniz kendi değişkenlerinizi ve yapılandırmalarını yapabilirsiniz. Yaygın bir makro mevcut.


    Şimdi, aşağıda anlatacağım kurallar ile tamamen kendi kurallarınızı içeren PF yapabilirsiniz.




    • 1 Makro
    • 2 Zaman bağlantısı üzerinden yönetim seçenekleri
    • 3 Parçalanmış veya kırık paketlerin sunulması
    • 4 Standart paketleri
    • 5 Trafik yoğunluğu gibi bant genişliği kontrol yöntemi
    • 6 çeviri Paketi
    • 7 Yönlendirme - filtreleme kuralları
    • 8 paket filtreleme



    Kuralların PF işlevleri;
    Kurallarda PF işaretleme koşul ve protokolleri:
    [INDENT=2]
    Her Kural gibi PF'nin de kendi koşul, bayrak, protokolleri vardır.
    Ayrıca TCP(Genellikle ICMP) üzerinden kullanılan Port taraması, Port engellemeye vs izin verir.
    Bunun için bu kuralları bilmek ve Çeşitli setler ile bu kuralların değerlerini değiştirmek yeterlidir.
    [/INDENT][INDENT=3]
    Koşullar:
    pass - kilidi kaldırmak için kullanılan koşul, paket geçme izni, port kilidi açma vs.
    block - pass karşısında paket , port vs engellemek için kullanılan koşul
    quick - PF'de belirli bir kuralı durdurmak kuralları ve akışı görüntülemesini iptal etmek(ağ güvenliği için yararlı) kullanılan koşul
    proto - Protokol, örneğin TCP protokolünü tanımlar.

    Argümanlar:
    any - Tüm kaynaklardan
    from - bir yerden bir yere (" from any to any" gibi)
    all - Tümü (örneğin herşeyi engellemek için)
    on - ne, hangi kartı
    in / out - paket ve kurallarda giriş çıkışları kontrol etmek için
    max 'num' (Örnek: "max 200")  istek paketin byte boyutunu belirler

    Protokoller:


    TCP - Unix üzerinden hemen hemen her yerde kullanabilirsiniz, port tarama, bağlantı noktası tarama vs standart ve en yaygın kullanılan protokol.
    UDP - İletim ve Birleştirme için standart bir protokol Saldırılarda genellikle DoS saldırılarında tespit için olan protokol sınırı çok azdır.
    ICMP -  Genellikle sistemin kendi aktif bağlantıları, engellenmemiş bağlantıları kontrol etmek için kullanılan protokol
    ICMP6 -  -

    PF Koşulları:


    modulate state - Durumu değiştirir, daha iyi bir pf için kullanılır 
    keep state -  Aşırı yükte iletişimi kesmek için kullanılır

    PF Koşulları, Saldırılardan ağı korumak için çok önemli koşullardır.


    TCP İşaretlemeleri:


    F -- FIN, Bağlantıyı kapatma        
    S -- SYN, Bağlantıyı açma        
    R -- RST, Bağlantıyı yeniden başlatma      
    P -- PSH, Verilerin gelen trafiğini kontrol etmek için    
    A -- ACK, Alınanlar paketler için        
    U -- URG, Paketin acil olduğunu belirtmek için

    Bu işaretlemeler sadece TCP için geçerlidir


    Şuan kendi kurallarını yapmak için yeterli örnekler bulunuyor


    PF temel kurallar bitti.



    [/INDENT]
    Basit Örnekler:


    [INDENT=2]Sızıntı için herhangi bir kombinasyon:


    #makro
    int_if = "em1"
    ext_if = "em0"
    
    
    
    
    #PF kurallari
    pass out on $ext_if proto tcp all modulate state flags S/SA
    pass out on $ext_if proto { udp, icmp } all keep state
    pass in on $ext_if proto tcp all modulate state flags S/SA
    pass in on $ext_if proto { udp, icmp } all keep state
    pass quick on lo0 all

    Hazır orta sınıf kurallar:


    
    
    
    ext_if="em0"
    int_if="em1"
    ***_net="10.0.0.0/24"
    tcp_services="{ 3306, 22 }"
    udp_services="{ 3306, 22 }"
    icmp_types="echoreq"
    set skip on lo0
    set block-policy return
    set loginterface $ext_if
    scrub in all
    block in on $ext_if
    pass in on $int_if from $***_net to any
    pass out on $int_if from any to $***_net
    antispoof log quick for $int_if
    pass in on $ext_if proto tcp from any to any port $tcp_services modulate state flags S/SA
    pass in on $ext_if proto udp from any to any port $udp_services keep state
    pass out on $ext_if proto tcp from any to any port $tcp_services modulate state flags S/SA
    pass out on $ext_if proto udp from any to any port $udp_services keep state
    pass in on $ext_if proto { tcp, udp } from any to $ext_if port 53
    pass in inet proto icmp all icmp-type $icmp_types keep state
    pass out on $ext_if proto { tcp, udp, icmp } all
    [/INDENT]

    1-2) IPFW (IP Firewall) Kurulumu:


    Şimdi size nasıl sunucunuz için güvenlik duvarı oluşturacağınızı göstericem.

    Putty'i açın ve aşağıdaki komutları uygulayın


    sysinstall

    Açılan menüden


    configure > distributions > src
    dizinine girin ve
    sys
    yi işaretleyin. Sağ ve sol tuşlar ile aşağıdan "OK" tuşunu seçin ve devam edin.
    ok > FTP > URL
    ve şimdi aşağıdaki bağlantıya girin.


    64 Bit için:


    ftp://ftp-archive.freebsd.org/pub/FreeBSD/releases/amd64/8.2-RELEASE

    32 Bit için:


    ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/8.2-RELEASE

    Ve
    yes
    diyoruz.


    Şimdi nasıl indirip açmak için aşağıdaki komutları giriyoruz


    64 Bit için:


    cd /usr/src/sys/amd64/conf

    32 Bit için:


    cd /usr/src/sys/i386/conf

    Şimdi,


    cp GENERIC IPFWKERNEL

    Ve ardından,


    ee IPFWKERNEL

    Ve "options" bölümünü bulup ekliyoruz.


    options[tab][tab]IPFIREWALL # IPFW için gerekli
    options[tab][tab]IPFIREWALL_VERBOSE # LOG için gerekli
    options[tab][tab]IPFIREWALL_VERBOSE_LIMIT=10 # Giriş limiti
    options[tab][tab]IPDIVERT # NATD için gerekli

    Not: [TAB] = Notepad'de tab tuşu ile oluşturacağınız boşluk


    Esc > leave editor > yes
    seçin


    Ve türü,


    cd /usr/src && make buildkernel KERNCONF=IPFWKERNEL

    Kurulum için girin


    make installkernel KERNCONF=IPFWKERNEL

    ee /etc/rc.conf

    Ve sonuna ekleyin.


    firewall_enable="YES"
    firewall_script="/etc/ipfw.rules"



    Esc > leave editor > yes
    seçin


    Şimdi girin:


    ee /etc/ipfw.rules

    ve oraya yazın,


    IPF="ipfw -q add"
    ipfw -q -f flush
    
    
    
    
    #loopback
    $IPF 10 allow all from any to any via lo0
    $IPF 20 deny all from any to 127.0.0.0/8
    $IPF 30 deny all from 127.0.0.0/8 to any
    $IPF 40 deny tcp from any to any frag
    
    
    
    
    # statefull
    $IPF 50 check-state
    $IPF 60 allow tcp from any to any established
    $IPF 70 allow all from any to any out keep-state
    $IPF 80 allow icmp from any to any
    
    
    
    
    # open port ftp (20,21), ssh (22), mail (25)
    # http (80), dns (53) etc
    $IPF 110 allow tcp from any to any 21 in
    $IPF 120 allow tcp from any to any 21 out
    $IPF 130 allow tcp from any to any 22 in
    $IPF 140 allow tcp from any to any 22 out
    $IPF 150 allow tcp from any to any 25 in
    $IPF 160 allow tcp from any to any 25 out
    $IPF 170 allow udp from any to any 53 in
    $IPF 175 allow tcp from any to any 53 in
    $IPF 180 allow udp from any to any 53 out
    $IPF 185 allow tcp from any to any 53 out
    $IPF 200 allow tcp from any to any 80 in
    $IPF 210 allow tcp from any to any 80 out
    
    
    
    
    # deny and log everything
    $IPF 500 deny log all from any to any

    Esc > leave editor > yes
    seçin


    İzinleri düzenleyin


    chmod -R 777/etc/ipfw.rules

    Sistemi yeniden başlatın


    reboot

    IPFW Komutları:


    /etc/rc.d/ipfw start - IPFW Başlatır
    /etc/rc.d/ipfw restart - IPFW Yeniden Başlatır
    /etc/rc.d/ipfw stop - IPFW Durdurur



    Port eklemek:


    Winscp ile ftp yi açın ve /etc/ dizinine gidin ipfw.rules dosyasını açın ve aşağıdaki örnekteki gibi portları ekleyin


    $IPF 200 allow all from any to any 11002 in
    $IPF 210 allow all from any to any 11002 out

    IPFW den yasaklama verilmesi:


    # IP yasaklari
    # Ornek
    $IPF 100 deny all from IP/32 to any in
    $IPF 101 deny all from IP/32 to any in
    # SSH, Mysql yasakları
    $IPF 120 deny log all from IP/20 to any 22 in
    $IPF 121 deny log all from IP/20 to any 22 in
    $IPF 122 deny log all from IP/20 to any 3306 in
    $IPF 123 deny log all from IP/20 to any 3306 in

    1-3)RC.Conf Kurulum


    Aşağıdaki komut ile rc.conf'a bağlanın


    ee /etc/rc.conf

    Ve bu değeri yapıştırın.


    #######################
    ####AĞ Değerleri####
    #######################
    
    
    
    
    sshd_enable="YES"
    mysql_enable="YES"
    apache22_enable="YES"
    ntpdate_enable="YES"
    ntpdate_hosts="213.186.33.99"
    
    
    
    
    ###################
    ####Bakım####
    ###################
    fsck_y_enable="YES"
    clear_tmp_enable="YES"
    named_enable="YES"
    
    
    
    
    #############################
    ####AĞ Yapılandırması####
    #############################
    
    
    
    
    ifconfig_em0="inet 37.59.18.89 netmask 255.255.255.0 broadcast 37.59.18.255"
    defaultrouter="37.59.18.254"
    hostname="ns232361.ovh.net"
    
    
    
    
    ######################
    ####Güvenlik####
    ######################
    
    
    
    
    icmp_drop_redirect="YES"
    icmp_log_redirect="YES"
    tcp_drop_synfin="YES"
    icmp_bmcastecho="NO"
    icmp_bandlim="YES"
    clear_tmp_enable="YES"
    
    
    
    
    #################
    ####Firewall####
    #################
    
    
    
    
    firewall_enable="YES"
    firewall_script="/etc/ipfw.rules"
    firewall_logging="YES"
    natd_enable="YES" 
    natd_interface="em0" 
    natd_flags="-dynamic -m"
    pf_enable="YES"
    pf_rules="/etc/pf.conf"
    pf_flags=""
    pflog_enable="YES"
    pflog_logfile="/var/log/pflog"
    pflog_flags=""
    
    
    
    
    
    
    
    
    
    
    
    
    #################
    ####Diğer####
    #################
    
    
    
    
    # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
    dumpdev="NO"

    .
    1-4)Hazır PF CONF


    ee /etc/pf.conf
    komutunu uygulayın.


    Aşağıdaki kodu yapıştırın
    #################
    ###PF Kurallari  :###
    #################
    
    
    
    
    #makro
    ext_if="re0"
    ***_net="10.0.0.0/24"
    tcp_services="{ 9987, 3306, 22, 53, 25 }"
    #udp_services="{ 3306, 25, 53, 22 }"
    icmp_types="echoreq"
    
    
    
    
    #filtre
    set skip on lo0
    set optimization normal
    set ruleset-optimization basic
    set require-order yes
    set block-policy return
    set loginterface $ext_if
    set state-policy if-bound
    scrub in all
    scrub on $ext_if fragment drop-ovl
    scrub on $ext_if all reassemble tcp
    block in quick from urpf-failed
    block in quick from urpf-failed label uRPF
    antispoof log quick for $ext_if
    
    
    
    
    #loopback
    pass out quick on lo0 proto tcp all
    pass in quick on lo0 proto tcp all keep state
    
    
    
    
    #istisnalar
    
    
    
    
    #seçilen oslar
    pass in quick on $ext_if from any os Windows keep state
    pass in quick on $ext_if from any os "Windows XP" keep state
    pass in quick on $ext_if from any os "Windows Vista" keep state
    pass in quick on $ext_if from any os "Windows 7" keep state
    pass in quick on $ext_if from any os unknown keep state
    
    
    
    
    #engellenen oslar
    block in quick on $ext_if from any os "Linux 2.4 ts"
    #block in quick on $ext_if from any os unknown
    block in quick on $ext_if from any os OpenBSD
    block in quick on $ext_if from any os Linux
    block in quick on $ext_if from any os Debian
    
    
    
    
    #engelli ipler
    table <blockip> persist file "/etc/blockip.txt"
    block in quick on $ext_if from <blockip> to any
    
    
    
    
    #port yönlendirme
    pass in quick on $ext_if proto tcp from any to any port $tcp_services keep state flags S/SA
    pass out quick on $ext_if proto tcp from any to any port $tcp_services keep state flags S/SA
    #pass in quick on $ext_if proto udp from any to any port $udp_services keep state
    #pass out quick on $ext_if proto udp from any to any port $udp_services keep state
    pass in quick inet proto icmp all icmp-type $icmp_types keep state
    pass out quick on $ext_if proto { tcp, udp, icmp } all modulate state
    
    
    
    
    #varsayılan kilit
    block return
    block in all
    block out all

    1-5) Sysctl.conf düzenleme


    sysctl -a

    herşey sorunsuz ise bu mesaj çıkmalıdır


    % sysctl kern.maxproc

    şimdi konfigrasyona girip sysctl düzenleme zamanı


    ee /etc/sysctl.conf

    Aşağıdaki gibi yapılandırın


    # $FreeBSD: release/9.0.0/etc/sysctl.conf 112200 2003-03-13 18:43:50Z mux $
    #
    #  This file is read when going to multi-user and its contents piped thru
    #  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
    #
    
    
    
    
    # Uncomment this to prevent users from seeing information about processes that
    # are being run under another UID.
    #security.bsd.see_other_uids=0
    
    
    
    
    ##########################################
    ####Sınırlama ve Ağ ayarları####
    ##########################################
    
    
    
    
    n#security.bsd.see_other_uids=0
    security.bsd.see_other_uids=0
    net.inet.tcp.blackhole=2
    net.inet.udp.blackhole=1
    net.inet.ip.ttl=128
    kern.maxfilesperproc=200000
    kern.maxvnodes=600000
    kern.maxfiles=204800
    kern.ipc.maxsockbuf=16777216
    kern.ipc.shmmax=1073741824
    kern.ipc.somaxconn=32768
    kern.ipc.shmall=134217728
    net.inet.tcp.rfc1323=1
    net.inet.tcp.recvbuf_max=16777216
    net.inet.tcp.sendbuf_auto=1
    net.inet.tcp.sendbuf_inc=262144
    net.inet.tcp.recvbuf_auto=1
    net.inet.tcp.recvbuf_inc=524288
    net.inet.tcp.hostcache.expire=1
    net.inet.ip.redirect=0
    net.inet.ip.sourceroute=0
    net.inet.ip.accept_sourceroute=0
    net.inet.icmp.maskrepl=0
    net.inet.icmp.log_redirect=0
    net.inet.icmp.drop_redirect=1
    net.inet.tcp.drop_synfin=1
    net.inet.tcp.msl=5000
    net.inet.tcp.fast_finwait2_recycle=1
    net.inet.ip.intr_queue_maxlen=4096
    net.inet.ip.forwarding=1
    net.inet.ip.fastforwarding=1
    net.inet.tcp.ecn.enable=1
    net.inet.ip.random_id=1
    net.inet.tcp.log_in_vain=0
    net.inet.tcp.log_debug=0
    net.inet.udp.log_in_vain=0
    kern.random.sys.harvest.ethernet=0
    kern.random.sys.harvest.interrupt=0
    kern.random.sys.harvest.point_to_point=0
    net.inet.icmp.icmplim=40
    net.inet.tcp.delayed_ack=1
    net.inet.tcp.mssdflt=1460
    net.inet.tcp.path_mtu_discovery=0
    net.inet.tcp.recvspace=65536
    net.inet.tcp.sendspace=65536
    net.inet.udp.recvspace=65536
    net.local.stream.recvspace=65536
    net.inet6.ip6.accept_rtadv=0
    net.inet6.ip6.auto_linklocal=0
    
    
    
    
    kern.ipc.nmbjumbop=192000
    net.inet.tcp.maxtcptw=163840
    
    
    
    
    net.inet.tcp.sendbuf_max=16777216
    net.inet.tcp.cc.algorithm=htcp
    net.inet.tcp.hostcache.expire=5400
    net.route.netisr_maxqlen=4096
    net.inet.tcp.nolocaltimewait=1
    net.local.stream.sendspace=163840
    net.local.stream.recvspace=163840
    net.inet.tcp.local_slowstart_flightsize=32
    net.inet.tcp.slowstart_flightsize=32
    net.inet.tcp.rfc3390=0
    net.inet.tcp.syncache.rexmtlimit=1
    net.inet.ip.rtexpire=2
    
    
    
    
    net.inet.ip.check_interface=1
    net.inet.ip.portrange.randomized=1
    net.inet.ip.process_options=0
    net.inet.icmp.bmcastecho=0
    net.inet.icmp.maskfake=0
    
    
    
    
    vfs.read_max=128
    
    
    
    
    net.link.ether.inet.log_arp_movements=0
    net.inet.tcp.log_in_vain=1
    net.inet.udp.log_in_vain=1
    net.inet.ip.rtminexpire=2
    net.inet.tcp.icmp_may_rst=0
    
    
    
    
    
    
    
    
    #####################
    ####IPFW Firewall####
    #####################
    
    
    
    
    net.inet.ip.fw.verbose=1
    net.inet.ip.fw.verbose_limit=5

    1-6)Kernel güvenliğini artırma


    sysctl kern.securelevel=9

    komutunu uygulayın


    1-7)SSH Portu değiştirme


    Filezilla ile bağlandığınız 22 portunu değiştirmek için /etc/sshd/ dizinine gidin sshd.conf dosyasını açın içindeki 22 değerini değiştirip kaydedin Putty'den /etc/sshd/sshd restart komutunu yollayın


    1-8)GM Mod açığını kapatma


    /event_flag test 0 ile yapılan gm mod açığını kapatmak için




    quest gm_mode begin
        state start begin
            when login or logout or levelup or kill or use begin
                if game.get_event_flag("test") &gt; 0 then
                    game.set_event_flag("test", 0)
                end
            end
        end
    end



    1-9) API TOOL FIX


    Öncelikle bir adet hex editör indirin
    kullandığınız game'yi upx unpacker ile açın
    CTRL + F ile arama ekranını açın
     SHOWMETHEMONEY  şeklinde arama yapın
    Gelen sonucu herhangi bir yazı ile değiştirin sadece 14 haneli olcak
    ÖRNEK: SHOWMETHEMONEY şeklinde arama yaptınız bunu jfaoigusamfieu ile değiştirin





    1-10)Mysql Port Değiştirme


    Putty'e Giriniz ve Aşağıdaki Komutu Yazınız
    
    
    
    
    cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf
    
    
    
    
    Kodu Yazıp ENTER Tuşuna Basınız ve Alttaki Komutu Yazınız.
    
    
    
    
    ee /var/db/mysql/my.cnf
    
    
    
    
    Karşınıza Gelen Ekranda Aşağıdaki Yerleri Değiştiriniz
    
    
    
    
    [client] Kısmındaki
    port     = 3306
    3306 Yerine Yeni Portunuzu Giriniz Max 4 Hane 4295 Gibi
    Sonra Az Daha Aşağı Doğru İniniz
    
    
    
    
    [mysqld] Kısmındaki
    port     = 3306
    3306 Yerine Üsste Girdiğiniz Yeni Portunuzu Tekrar Giriniz Hatasız Girmeye Özen Gösterin Yoksa MYSQL Bağlantınız Kopar
    
    
    
    
    Portları Düzenledikten Sonra ESC Tuşuna Basınız ve 2 Kere ENTER Tuşuna Basınız . 
    Ana Ekrana Dönünce reboot Atınız. Artık Yeni Portunuz Aktif. MYSQL Bağlanırken Navicattaki 3306 Yerine Yeni Portunuzu Giriniz

    KARAKTER SORUNUNDAN DOLAYI 2.MESAJDAN DEVAM EDECEKTİR.
  • 22-02-2014, 09:46:55
    #2


    2-1)Bakim ve Kontrol Scriptleri

    Yeteri kadar oyun güvenliğini sağladık şimdi sistem bakımı için bazı bash scriptler hazırlayalım.

    Notepad ile 4 tane dosya oluşturuyoruz.
    1. [*=2]bakim.sh
      [*=2]auth_devam.sh
      [*=2]db_devam.sh
      [*=2]kanal_devam.sh

    Şimdi bu 4 dosyayı oluşturduktan sonra içeriklerini düzenleme başlayabiliriz

    1)bakim.sh ile baslayalim

    echo "BAKIM SCRIPT PASHA37!"
            sleep 6
        # mysql
    echo "Mysql DB Bakim baslatiliyor"
        mysql_upgrade --force --user="dbbakim" --password="Ad4S1%4@" 
            sleep 2
        mysqlcheck --user="dbbakim" --password="Ad4S1%4@" --auto-repair --all-databases
            sleep 2
        /usr/local/etc/rc.d/mysql-server restart
            sleep 6
        # FreeBSD güncelleme baslatiliyor
    echo "Sistem guncellemesi, portlar, hizmet ve guvenlik protokolleri guncelleniyor!"
            sleep 2
        /usr/sbin/freebsd-update fetch install
            sleep 2
        portupgrade -ac
    echo "Calistirma tamamlandi"


    2)auth_devam.sh

    /USR/HOME İÇİN:

    #!/bin/sh
    i=1
    while [ $i -le 2 ]
    do
    netstat -an | grep LISTEN | grep 13000
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13000
    [ $? -eq 0 ] && echo "Acik" || cd /home/g1/auth/ && ./auth &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 15000
    [ $? -eq 0 ] && echo "Acik" || cd /home/g1/auth/ && ./db &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 16000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch2/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 18000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch3/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 20000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch4 && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 22000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch5/ && ./game
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13099
    [ $? -eq 0 ] && echo "Acik" || cd /home/game99/ && ./game99 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13005
    [ $? -eq 0 ] && echo "Acik" || cd /home/game2/ && ./game2 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13010
    [ $? -eq 0 ] && echo "Acik" || cd /home/game3/ && ./game3 &
    sleep 20
    i=`expr $i + 1`
    done


    /USR/GAME/ İÇİN:

    #!/bin/sh
    i=1
    while [ $i -le 2 ]
    do
    netstat -an | grep LISTEN | grep 13000
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13000
    [ $? -eq 0 ] && echo "Acik" || cd /game/g1/auth/ && ./auth &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 15000
    [ $? -eq 0 ] && echo "Acik" || cd /game/g1/auth/ && ./db &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 16000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch2/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 18000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch3/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 20000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch4 && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 22000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch5/ && ./game
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13099
    [ $? -eq 0 ] && echo "Acik" || cd /game/game99/ && ./game99 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13005
    [ $? -eq 0 ] && echo "Acik" || cd /game/game2/ && ./game2 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13010
    [ $? -eq 0 ] && echo "Acik" || cd /game/game3/ && ./game3 &
    sleep 20
    i=`expr $i + 1`
    done


    3)db_devam.sh

    /USR/HOME/ İÇİN:

    #!/bin/sh
    i=1
    while [ $i -le 2 ]
    do
    netstat -an | grep LISTEN | grep 11666
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 1
    [ $? -eq 0 ] && echo "Acik" || cd /home/game/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 16000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch2/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 18000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch3/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 20000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch4 && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 22000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch5/ && ./game
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13099
    [ $? -eq 0 ] && echo "Acik" || cd /home/game99/ && ./game99 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13005
    [ $? -eq 0 ] && echo "Acik" || cd /home/game2/ && ./game2 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13010
    [ $? -eq 0 ] && echo "Acik" || cd /home/game3/ && ./game3 &
    sleep 20
    i=`expr $i + 1`
    done


    /USR/GAME/ İÇİN:

    #!/bin/sh
    i=1
    while [ $i -le 2 ]
    do
    netstat -an | grep LISTEN | grep 11666
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 1
    [ $? -eq 0 ] && echo "Acik" || cd /game/game/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 16000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch2/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 18000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch3/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 20000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch4 && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 22000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch5/ && ./game
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13099
    [ $? -eq 0 ] && echo "Acik" || cd /game/game99/ && ./game99 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13005
    [ $? -eq 0 ] && echo "Acik" || cd /game/game2/ && ./game2 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13010
    [ $? -eq 0 ] && echo "Acik" || cd /game/game3/ && ./game3 &
    sleep 20
    i=`expr $i + 1`
    done

    4)kanal_devam.sh

    /USR/HOME/ İÇİN:

    #!/bin/sh
    i=1
    while [ $i -le 2 ]
    do
    netstat -an | grep LISTEN | grep 11666
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13000
    [ $? -eq 0 ] && echo "Acik" || cd /home/game/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 15000
    [ $? -eq 0 ] && echo "Acik" || cd /home/g1/db/ && ./db &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 16000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch2/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 18000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch3/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 20000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch4 && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 22000
    [ $? -eq 0 ] && echo "Acik" || cd /home/ch5/ && ./game
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13099
    [ $? -eq 0 ] && echo "Acik" || cd /home/game99/ && ./game99 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13005
    [ $? -eq 0 ] && echo "Acik" || cd /home/game2/ && ./game2 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13010
    [ $? -eq 0 ] && echo "Acik" || cd /home/game3/ && ./game3 &
    sleep 20
    i=`expr $i + 1`
    done


    /USR/GAME/ İÇİN:

    #!/bin/sh
    i=1
    while [ $i -le 2 ]
    do
    netstat -an | grep LISTEN | grep 11666
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13000
    [ $? -eq 0 ] && echo "Acik" || cd /game/game/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 15000
    [ $? -eq 0 ] && echo "Acik" || cd /game/g1/db/ && ./db &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 16000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch2/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 18000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch3/ && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 20000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch4 && ./game &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 22000
    [ $? -eq 0 ] && echo "Acik" || cd /game/ch5/ && ./game
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13099
    [ $? -eq 0 ] && echo "Acik" || cd /game/game99/ && ./game99 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13005
    [ $? -eq 0 ] && echo "Acik" || cd /game/game2/ && ./game2 &
    [ $? -eq 0 ] && netstat -an | grep LISTEN | grep 13010
    [ $? -eq 0 ] && echo "Acik" || cd /game/game3/ && ./game3 &
    sleep 20
    i=`expr $i + 1`
    done

    Dosyalar hazir filezilla'dan yükleyin.

    Otomatik olarak devam ettirmek için crontab olarak yüklemeliyiz

    ee /etc/crontab


    Asagidaki degerleri yazin:

    */10[TAB]*[TAB]*[TAB]*[TAB]*[TAB]root[TAB]/db_devam.sh
    */10[TAB]*[TAB]*[TAB]*[TAB]*[TAB]root[TAB]/auth_devam.sh
    */10[TAB]*[TAB]*[TAB]*[TAB]*[TAB]root[TAB]/kanal_devam.sh
    Not: [TAB] = Notepad'de tab tuşu ile oluşturacağınız boşluk


    2-2)DDOS Ataklarini ve Gelen IP'leri görme

    clear
    echo "Kontrol Ediliyor DDOS Attacks.."
    sleep 3
    netstat -np | grep SYN_RECV | awk '{print $5}' | cut -d. -f1-4 | cut -d: -f1 | sort -n | uniq -c | sort -n
    echo "Attacks and IP"
    ;;
    2-3)LOG Temizleme

    #!/bin/sh
    rm -rf /usr/game/channel1/ch1_1/stdout
    rm -rf /usr/game/channel1/ch1_1/packet_info.txt
    rm -rf /usr/game/channel1/ch1_1/p2p_packet_info.txt
    rm -rf /usr/game/channel1/ch1_1/syslog
    rm -rf /usr/game/channel1/ch1_1/syserr
    rm -rf /usr/game/channel1/ch1_1/game.core
    rm -rf /usr/game/channel1/ch1_2/stdout
    rm -rf /usr/game/channel1/ch1_2/packet_info.txt
    rm -rf /usr/game/channel1/ch1_2/p2p_packet_info.txt
    rm -rf /usr/game/channel1/ch1_2/syslog
    rm -rf /usr/game/channel1/ch1_2/syserr
    rm -rf /usr/game/channel1/ch1_2/game.core
    rm -rf /usr/game/channel1/ch1_3/stdout
    rm -rf /usr/game/channel1/ch1_3/packet_info.txt
    rm -rf /usr/game/channel1/ch1_3/p2p_packet_info.txt
    rm -rf /usr/game/channel1/ch1_3/syslog
    rm -rf /usr/game/channel1/ch1_3/syserr
    rm -rf /usr/game/channel1/ch1_3/game.core
    rm -rf /usr/game/game99/game99_1/stdout
    rm -rf /usr/game/game99/game99_1/packet_info.txt
    rm -rf /usr/game/game99/game99_1/p2p_packet_info.txt
    rm -rf /usr/game/game99/game99_1/syslog
    rm -rf /usr/game/game99/game99_1/syserr
    rm -rf /usr/game/game99/game99_1/game.core
    rm -rf /usr/game/g1/db/stdout
    rm -rf /usr/game/g1/db/packet_info.txt
    rm -rf /usr/game/g1/db/p2p_packet_info.txt
    rm -rf /usr/game/g1/db/syslog
    rm -rf /usr/game/g1/db/syserr
    rm -rf /usr/game/g1/auth/stdout
    rm -rf /usr/game/g1/auth/packet_info.txt
    rm -rf /usr/game/g1/auth/p2p_packet_info.txt
    rm -rf /usr/game/g1/auth/syslog
    rm -rf /usr/game/g1/auth/syserr


    2-4)FIREWALL için hazır script

    clear
    echo "FIREWALL SİSTEMİ"
    echo "İnternet Hizmetleri'nin size vermiş olduğu ip adresini giriniz..."
    read serverip
    clear
    echo "Girdiğiniz İp Adresi : $serverip"
    echo 'Bu ip adresi doğruysa "y" yazıp enterleyin.';
    echo 'Değilse "r" yazip enterleyin.';
    echo 'Çıkmakmı istiyorsunuz ? "n" basıp enterlayın.';
    read secim
    case $secim in
    n)
    clear
    echo "Firewall Kurulumundan Çıktınız.!"
    cd /root
    rm -rf firewall.sh
    ;;
    r)
    sh firewall.sh
    ;;
    y)
    clear
    echo "Şuan kurulan ip adresi : $serverip"
    echo "Bayım Kurulum başladı sakin olun."
    echo 'Kurulum bitti mesajı gelirse bilin ki bitmiştir..'
    sleep 3
    clear
    #cd /usr/src/sys/i386/conf
    #cp PAE DOST#echo "options IPFIREWALL" >> /usr/src/sys/i386/conf/DOST
    #echo "options IPFIREWALL_VERBOSE" >> /usr/src/sys/i386/conf/DOST
    #echo "options IPFIREWALL_VERBOSE_LIMIT=15" >> /usr/src/sys/i386/conf/DOST#cd /usr/src
    make kernel KERNCONF=DOST 
    echo 'firewall_enable="YES"' >> /etc/rc.conf
    echo 'firewall_script="/etc/ipfw.rules"' >> /etc/rc.conf
    echo 'IPF="ipfw -q add"' >> /etc/ipfw.rules
    echo "ipfw -q -f flush
    
    
    #
    ipfw add 5 allow tcp from any to me 13000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 14000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 16000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 17000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 14001 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 11002 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 22000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 20000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 19000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 21000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 15000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 18000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 22000 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 3306 in via em0 setup limit src-addr 10
    ipfw add 5 allow tcp from any to me 22 in via em0 setup limit src-addr 10
    
    
    
    
    #İnce ayar
    \$IPF 4 allow all from $serverip to any 12001
    \$IPF 5 allow all from 127.0.0.0/8 to any 12001
    \$IPF 6 deny all from any to me 12001
    \$IPF 7 allow all from $serverip to any 14000
    \$IPF 8 allow all from 127.0.0.0/8 to any 14000
    \$IPF 9 deny all from any to me 14000
    \$IPF 10 allow all from $serverip to any 14001
    \$IPF 11 allow all from 127.0.0.0/8 to any 14001
    \$IPF 12 deny all from any to me 14001
    \$IPF 13 allow all from $serverip to any 14002
    \$IPF 14 allow all from 127.0.0.0/8 to any 14002
    \$IPF 15 deny all from any to me 14002
    \$IPF 16 allow all from $serverip to any 14003
    \$IPF 17 allow all from 127.0.0.0/8 to any 14003
    \$IPF 18 deny all from any to me 14003
    \$IPF 19 allow all from $serverip to any 14004
    \$IPF 20 allow all from 127.0.0.0/8 to any 14004
    \$IPF 21 deny all from any to me 14004
    \$IPF 22 allow all from $serverip to any 14061
    \$IPF 23 allow all from 127.0.0.0/8 to any 14061
    \$IPF 24 deny all from any to me 14061
    \$IPF 25 allow all from $serverip to any 14099
    \$IPF 26 allow all from 127.0.0.0/8 to any 14099
    \$IPF 27 deny all from any to me 14099
    \$IPF 28 allow all from $serverip to any 17000
    \$IPF 29 allow all from 127.0.0.0/8 to any 17000
    \$IPF 30 deny all from any to me 17000
    \$IPF 31 allow all from $serverip to any 17001
    \$IPF 32 allow all from 127.0.0.0/8 to any 17001
    \$IPF 33 deny all from any to me 17001
    \$IPF 34 allow all from $serverip to any 17002
    \$IPF 35 allow all from 127.0.0.0/8 to any 17002
    \$IPF 36 deny all from any to me 17002
    \$IPF 37 allow all from $serverip to any 17003
    \$IPF 38 allow all from 127.0.0.0/8 to any 17003
    \$IPF 39 deny all from any to me 17003
    \$IPF 40 allow all from $serverip to any 17004
    \$IPF 41 allow all from 127.0.0.0/8 to any 17004
    \$IPF 42 deny all from any to me 17004
    \$IPF 43 allow all from $serverip to any 17061
    \$IPF 44 allow all from 127.0.0.0/8 to any 17061
    \$IPF 45 deny all from any to me 17061
    \$IPF 46 allow all from $serverip to any 17099
    \$IPF 47 allow all from 127.0.0.0/8 to any 17099
    \$IPF 48 deny all from any to me 17099
    \$IPF 49 allow all from $serverip to any 19001
    \$IPF 50 allow all from 127.0.0.0/8 to any 19001
    \$IPF 51 deny all from any to me 19001
    \$IPF 52 allow all from $serverip to any 19002
    \$IPF 53 allow all from 127.0.0.0/8 to any 19002
    \$IPF 54 deny all from any to me 19002
    \$IPF 55 allow all from $serverip to any 19003
    \$IPF 56 allow all from 127.0.0.0/8 to any 19003
    \$IPF 57 deny all from any to me 19003
    \$IPF 58 allow all from $serverip to any 19004
    \$IPF 59 allow all from 127.0.0.0/8 to any 19004
    \$IPF 60 deny all from any to me 19004
    \$IPF 61 allow all from $serverip to any 19061
    \$IPF 62 allow all from 127.0.0.0/8 to any 19061
    \$IPF 63 deny all from any to me 19061
    \$IPF 64 allow all from $serverip to any 19099
    \$IPF 65 allow all from 127.0.0.0/8 to any 19099
    \$IPF 66 deny all from any to me 19099
    \$IPF 67 allow all from $serverip to any 21001
    \$IPF 68 allow all from 127.0.0.0/8 to any 21001
    \$IPF 69 deny all from any to me 21001
    \$IPF 70 allow all from $serverip to any 21002
    \$IPF 71 allow all from 127.0.0.0/8 to any 21002
    \$IPF 72 deny all from any to me 21002
    \$IPF 73 allow all from $serverip to any 21003
    \$IPF 74 allow all from 127.0.0.0/8 to any 21003
    \$IPF 75 deny all from any to me 21003
    \$IPF 76 allow all from $serverip to any 21004
    \$IPF 77 allow all from 127.0.0.0/8 to any 21004
    \$IPF 78 deny all from any to me 21004
    \$IPF 79 allow all from $serverip to any 21061
    \$IPF 80 allow all from 127.0.0.0/8 to any 21061
    \$IPF 81 deny all from any to me 21061
    \$IPF 82 allow all from $serverip to any 21099
    \$IPF 83 allow all from 127.0.0.0/8 to any 21099
    \$IPF 84 deny all from any to me 21099
    
    
    #BYKWB
    
    
    \$IPF 10000 allow all from any to any via lo0
    \$IPF 20000 deny all from any to 127.0.0.0/8
    \$IPF 30000 deny all from 127.0.0.0/8 to any
    \$IPF 40000 allow all from any to any" >> /etc/ipfw.rules
    clear
    echo "Kurulum bitti saldırı almayacaksınız."
    echo "Reboot lazım atıyorum.."
    sleep 3
    reboot
    cd /root
    rm -rf firewall.sh
    ;;
    *)
    clear
    echo "Yanlış tuş."
    echo "Bekleyin yeniden başlatıyorum.."
    sleep 2
    sh firewall.sh
    esac


    Yeteri kadar bakım öğeleride eklediğimize göre güncel açıkları kapatmaya geçelim

    3-1)War açığını kapatma

    Aşağıdaki diflerden size uygun olanını uygulayın

    Game 1765:
    https://mega.co.nz/#!UQg20CSI!lcUSFQHjV-_tRM15t5FsyYad7-L5FWSNk6wtlxyAAqY
    Game 2019: https://mega.co.nz/#!ccZF2RST!8vgAXv90XKRC5XnL74AbVMYqJx1W6qCmxtlUZ0Z wlx8
    Game 2089:
    https://mega.co.nz/#!cRYiiRDR!-F0ZZbXAxjptZ1RVquOjkU9c3vLNDk1yOyVkBjfkaBU
    Game 2089M:
    https://mega.co.nz/#!AdBHUbhI!aryRfQXprMrxUuH2hfGzTp3halW5wzD5BhZxwy-Dilo
    Game 34083:
    https://mega.co.nz/#!9IxW0QAQ!Jy6hmybJT0UlBnL1pG7gcTi06d2OfXrqaS3IjJG BNqw

    3-2)Dice açığını kapatma

    Aşağıdaki diflerden size uygun olanını uygulayın

    Game 1765:
    https://mega.co.nz/#!4ARWGbjY!1cDDR6t8wellDYqsNju0056H_2_bcuqOGCpFzoO kmTA
    Game 2019:
    https://mega.co.nz/#!sdYmmRyK!VYaYGdSrnBk9HFaRrBe9rVYXDJ4vqLRh6ae41_S aGyo
    Game 2089:
    https://mega.co.nz/#!cAgSlSxI!_PtOKx90aIcfgBodB1jUklHDqboAxqzxzvtzDzC i454
    Game 2089M:
    https://mega.co.nz/#!RM5RiC7Q!YKvsLZOvVRS6qZrLc0P4ckj6DbLDUkey7qxstJ_ Eas0
    Game 34083:
    https://mega.co.nz/#!RdIhGZoC!2Ws-0at3pFCNkpRWpoIWZrL_sNGVJN5e50kjMjqIvcM

    3-3)INTERNAL IP açığını kapatma

    Aşağıdaki diflerden size uygun olanını uygulayın

    Game 1765:
    https://mega.co.nz/#!MUZyGAxZ!NNZneozKBj7cnY_aZ-6oGU7gVG-q2Ar5J7opR9JVeYs
    Game 2019: https://mega.co.nz/#!wZxTjS7K!nYYBftZ5JESJYXW6PqqGbyuvqOIWWxM1-E21ecwNyjY
    Game 2089: https://mega.co.nz/#!RJJhWa4T!EbczDM2ZZvxKIzMIUISR8f6fVJHEdi6kvNdjUsC SF84
    Game 2089M: https://mega.co.nz/#!wdokTBKY!EDYkbchP4c1Tm4SlLjSXnAeJw4ysyv3r3aohN2D-LqI
    Game 34083: https://mega.co.nz/#!oMBREIhB!CfrF9YPzdK0-yf-sbufEv_RftnFo1v4eqaNV2N5LxYo

    3-4)Lisans süresini kaldırma

    Aşağıdaki diflerden size uygun olanını uygulayın

    Game 1765: https://mega.co.nz/#!BIYk3DZD!q3Pok_tsiRBc5mYMWB8d9Fk_YTozAZKgWCFattD z2hA
    Game 2019: https://mega.co.nz/#!RUhzUSRY!kldi49isuFoeVj3XxnhAITyU1doCWF7SsXb22IN Da4k
    Game 2089: https://mega.co.nz/#!4VQgkTCA!fY7O_K-jggng1ilTuZfYIxlkRL1vyCF2Rhs35m5Tkqk
    Game 2089M: https://mega.co.nz/#!dJZFVD6A!6FRiUq5LTN_YuWMHZ1vBEtZWmfz2_nSwpHO7yOx O6lQ
    Game 34083: https://mega.co.nz/#!dFIFHDbA!KnjsklvhU349e8gU4dAfXxOlEAfEzxfedwgsVY7 7o58

    3-5)Packet Bypass Fix

    https://www.r10.net/oyun-dunyasi/1154859-packet-bypass-fix.html

    3-6)SEQUENCE_LOG FIX

    https://www.r10.net/oyun-dunyasi/1154856-sequence_log-fix.html

    3-7)Buffer Fix

    https://www.r10.net/oyun-dunyasi/1154849-buffer-paket-acigi-fix.html

    3-8)34083 Exploit Fix

    https://www.r10.net/oyun-dunyasi/1154847-34083-exploit-fix.html

    3-9)Report (CheckClientVersion) Fix

    https://www.r10.net/oyun-dunyasi/1154843-reportcheckclientversion-fix.html

    3-10)Client Bug fix

    https://www.r10.net/oyun-dunyasi/1154839-client-bug-fix.html

    3-11)
    "CInputMain__Hack" Paketi fix

    https://www.r10.net/oyun-dunyasi/1154835-cinputmain__hack-paketi-fix.html

    3-12)Adminpage devredışı bırakma

    https://www.r10.net/oyun-dunyasi/1154831-adminpage-devre-disi-birakma.html

    3-13)CMD Açığı fix

    https://www.r10.net/oyun-dunyasi/1154824-cmd-acigi-fix.html

    3-14)Mysql'da ki gereksiz kullanıcıları kaldırma

    Mysql > User > Filesi editleyen kişi tarafından konan güvenlik açıklarıdır.

    https://i.hizliresim.com/wvpYop.png

    Bu açıklar ile sizin yaptığınız bütün işlemler yapılır ( Edit, Ban, İtem gönderme, Database silme, Database onarma, Dosya silme v.s )

    Resimdeki gibi belirtilenlerden harici kullanıcı varsa kaldırın

    3-15)FTP'de ki mysql klasörünü düzenleyin

    Herhangi bir A yapımcısının paylaşmış olduğu files linklerini indirdiniz diyelim. Putty'den kurmadan önce indirilen dosyanın içindeki dosyalara bakılması lazım. Dosya içerisine .exe keyloger dosyaları kuruluyor. Mysql puttyeden kurulum aşamasına geldiğinde otomatik olarak keyloger bilgisayarınıza kurulur.

    https://i.hizliresim.com/xVM2Yr.png

    https://i.hizliresim.com/K6YZG7.png

    ".myd", ".myi" "."frm" gibi dosyalar haricinde ".exe" ".dll" gibi uzantılı dosyaları kesinlikle temizleyin

    3-16)
    Can't connect to local Mysql server through socket '/tmp/mysql.sock' (2) FIX

    1)Config ve Conf Dosyasına Oluşturulan Farklı Userlerin Kaldırılması




    Bu bölümlerde bu user dışında başka user mevcutsa bu şekilde değiştiriniz arkadaşlar. Bu Mysql kurulumunda oluşturduğunuz orjinal tabloları içerir. Eğer bu değiştirilmişte Mysql DB içerisinde sizdeki isimli account mevcut değilse bağlantı sorunu yaşarsınız ve bu bir noktada serverde açık olduğunun göstergesidir. Buraları bu şekilde değiştiriniz.


    PLAYER_SQL: localhost mt2 mt2!@# player
    COMMON_SQL: localhost mt2 mt2!@# common
    LOG_SQL: localhost mt2 mt2!@# log



    Aynı Şekilde DB içerisindeki Conf.txt Dosyasını Da Şu Şekilde Düzenleyiniz:


    SQL_ACCOUNT = "localhost account mt2 mt2!@# 0"
    SQL_PLAYER = "localhost player mt2 mt2!@# 0"
    SQL_COMMON = "localhost common mt2 mt2!@# 0"
    SQL_HOTBACKUP = "localhost hotbackup mt2 mt2!@# 0"


    2)Mysql'u kaldırıp yeniden kurun

    3)Freebsd sürümünü güncelleyin

    3-17)
    Mysql To many connection fix:

    Aşağıdaki dosyayı /etc/ dizinine yükleyin

    http://www.mediafire.com/view/v94v4giws6g6b1k/mysql.conf

    /usr/local/etc/rc.d/mysql-server restart


    Komutu ile mysql'u yeniden başlatın

    3-18)P2P Açığını kapatma

    CONFIG dosyalarındaki "pk_server" "test_server" kısımlarını aşağıdaki şekilde yeniden düzenleyin.

    pk_server : 0
    
    
    TEST_SERVER : 0



    Rehber benim tarafımdan hazırlanmıştır, Alıntılar mevcuttur.

    Yukarıdaki adımları sorunsuz yaptığınız taktirde oyun içi hile sorunlarından başka bir sorununuz kalmaz.
    Hile koruması için:
    https://www.r10.net/pvp-server/1158102-games-tools-v2-hile-koruma-sistemi.html


    pasha37
  • 22-02-2014, 09:53:54
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    sizi böyle bir paylaşımdan dolayı gerçekten kutluyorum
  • 22-02-2014, 12:25:46
    #4
    Üyeliği durduruldu
    Paylaşım için teşekkürler yararlı gözüküyor
  • 22-02-2014, 14:16:27
    #5
    Üyeliği durduruldu
    Çok güzel olmuş Koray ellerine sağlık
  • 22-02-2014, 14:18:13
    #6
    Baya emek vermiş arkadaş eline koluna sağlık.
  • 22-02-2014, 14:18:19
    #7
    Çok güzel ve yararlı bir paylaşım, teşekkürler.
  • 23-02-2014, 13:58:52
    #8
    Üyeliği durduruldu
    Güzel bir paylaşım ancak bu firewalların engelleyebileceği saldırılar en ufak saldırı tipleri, artık en ezik adam bile dns sunucularıyla saldırı yapabiliyor
  • 23-02-2014, 15:58:00
    #9
    Te0mania adlı üyeden alıntı: mesajı görüntüle
    Güzel bir paylaşım ancak bu firewalların engelleyebileceği saldırılar en ufak saldırı tipleri, artık en ezik adam bile dns sunucularıyla saldırı yapabiliyor
    Yazılım ile sağlanabilecek hemen hemen maksimum koruma bukadar, bundan fazlası için kesenin ağzını açıp donanımsal firewall'e başvurmak gerekiyor