Date: Wed, 17 Mar 1999 03:53:33 +0200 (EET)
Message-Id: <36EF0A95.9F96C683@service.raksnet.com.tr>
From: Remzi AKYUZ <remzi@service.raksnet.com.tr>
To: Multiple recipients of list <linux@bilkent.edu.tr>
Subject: [LINUX:4422] Re: ping portunu kapatmak,
This is a multi-part message in MIME format.
--------------D52C1FDA9ABD80F1B827ACA1
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Merhabalar,
Kernel 2.0.3x lerden kullanıyorsan Murat arkadaşımızın
yazdığı scripti kullanabilirisin.
Saygılarımla
Devrim SERAL wrote:
> On Tue, 16 Mar 1999, derinkaya wrote:
>
> > Merhaba,
> >     RedHat 5.2 makinenin ping atildiginda cevap vermemesi icin ne yapmam
> > lazim? inet.conf ve services dosyalarinda ne gibi bir degisiklik yapmam
> > lazim.
> >
> > Iyi calismalar,
> Selamlar..
> ipfwadm kullanarak bunu yapabilirsiniz..
> iyi calismalar..
> dS
>
>
>  Listeden  cikmak icin:
>          unsub  linux
>  mesajini  listeci@bilkent.edu.tr'a  gonderiniz.
>    Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin.
>   Liste arsivinin adresi:  http://listweb.bilkent.edu.tr/
--------------D52C1FDA9ABD80F1B827ACA1
Content-Type: text/plain; charset=us-ascii;
 name="f"
Content-Disposition: inline;
 filename="f"
Content-Transfer-Encoding: 7bit
#!/bin/sh
# Ipfwadm Kiti v0.0.000000000000000000000000000000001
# Murat Arslan <arslanm@linux-tr.EU.org> 03/04/98
#
PATH="$PATH:/sbin:/usr/sbin:/bin:/usr/bin"
PORTS="1024:65535"
LOCIP="`ifconfig | grep P-t-P | awk '{print $2}' | cut -d ':' -f2`"
checkroot() {
  KIMIM=`whoami`
  if [ "$KIMIM" != "root" ]; then
  dialog --infobox "Root degilsiniz!" \
  3 22
  sleep 1
  exit 0
fi
}
dnsekle() {
        while [ "$DNS1" = "" ]; do
         dialog --inputbox "Birinci DNS adresi" \
8 50 \
2> /tmp/dns1.$$ 
         if [ $? = 1 -o $? = 255 ]; then
                rm -f /tmp/dns1.$$
                main;
         fi
         DNS1="`cat /tmp/dns1.$$`"
         rm -f /tmp/dns1.$$
        done
        while [ "$DNS2" = "" ]; do
         dialog --inputbox "Ikinci DNS adresi" \
8 50 \
2> /tmp/dns2.$$
         if [ $? = 1 -o $? = 255 ]; then
                rm -f /tmp/dns2.$$
                main;
         fi
         DNS2="`cat /tmp/dns2.$$`"
         rm -f /tmp/dns2.$$
        done
        dialog --yesno \
"DNS kurallarini uygulayayim mi?
Birinci DNS: $DNS1
Ikinci DNS: $DNS2" \
7 40 
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        ipfwadm -I -a accept -P tcp -S $DNS1 53 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P udp -S $DNS1 53 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P tcp -S $DNS2 53 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P udp -S $DNS2 53 -D $LOCIP $PORTS
        main;
}
cekirdek() {
        if [ -r /proc/net/ip_input -a -r /proc/net/ip_output ]; then
                dialog --infobox "IPfwadm kullanmaniz icin cekirdek
desteginiz verilmis. Hersey OK." 5 40
           sleep 2
           main;
           else
                dialog --infobox "Cekirdek desteginiz yok!
Cekirdek derlemeniz gerekiyor. Asagidakileri 
isaretlemeyi unutmayin! 
Networking options  ---> 
  [*] Network firewalls 
  .... 
  [*] IP: forwarding/gatewaying 
  .... 
  [*] IP: firewalling 
  [ ] IP: firewall packet logging" 15 50
        exit 0
        fi
}
flush() {
        dialog --yesno "Mevcut kurallari silip yeniden baslamak \
istermisiniz ?" 5 60
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        ipfwadm -I -f
        ipfwadm -I -p reject
        main;
}
loekle() {
        dialog --yesno "Localhostu ekliyorum.. OK ?" 5 33
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        # localhost ekleniyor..
        ipfwadm -I -a accept -W lo
        main;
}
wwwekle() {
        dialog --yesno "Tum adreslerin 80. ve 8080. portlarini \
erisime aciyorum. OK ?" 5 66
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        ipfwadm -I -a accept -P tcp -S 0/0 80 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P udp -S 0/0 80 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P tcp -S 0/0 8080 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P udp -S 0/0 8080 -D $LOCIP $PORTS
        main;
}
ftpekle() {
        dialog --yesno "Tum adreslerin 21. portunu erisime \
aciyorum.. OK ?" 5 60
        if [ $? = 1 -o $? = 1024 ]; then
                main;
        fi
        ipfwadm -I -a accept -P tcp -S 0/0 21 -D $LOCIP $PORTS
        ipfwadm -I -a accept -P udp -S 0/0 21 -D $LOCIP $PORTS
        main;
}
pop3ekle() {
POP3ADDR=""
        while [ "$POP3ADDR" = "" ]; do
         dialog --inputbox "POP3 adresiniz nedir ? " \
8 35 \
2> /tmp/pop3.$$
         if [ $? = 1 -o $? = 255 ]; then
                rm -f /tmp/pop3.$$
                main;
         fi
         POP3ADDR="`cat /tmp/pop3.$$`"
         rm -f /tmp/pop3.$$
        done
        dialog --yesno "POP3 Adresini ekliyim mi ? 
Adres: $POP3ADDR" 7 40
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        ipfwadm -I -a accept -P tcp -S $POP3ADDR 110 -D $LOCIP $PORTS
        main;
}
shellekle() {
SHELLADDR=""
        while [ "$SHELLADDR" = "" ]; do
        dialog --inputbox "Shell account adresiniz nedir ?" \
8 40 \
2> /tmp/shell.$$
         if [ $? = 1 -o $? = 255 ]; then
                rm -f /tmp/shell.$$
                main;
         fi
         SHELLADDR="`cat /tmp/shell.$$`"
         rm -f /tmp/shell.$$
        done
        dialog --yesno "SHELL Adresini ekleyim mi ?
Adres: $SHELLADDR" 7 40
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        ipfwadm -I -a accept -P tcp -S $SHELLADDR 23 -D $LOCIP $PORTS
        main;
}
ircekle() {
        dialog --yesno "Tum adreslerin 6667 portunu erisime \
aciyorum.. OK ?" 5 61
        if [ $? = 1 -o $? = 255 ]; then
                main;
        fi
        ipfwadm -I -a accept -P tcp -S 0/0 6667 -D $LOCIP $PORTS
        main;
}
listele() {
        dialog --infobox "Lutfen bekleyiniz.." 3 30
        ipfwadm -I -l -n > /tmp/defpol.$$
        DEFPOLICY="`cat /tmp/defpol.$$ | grep rules |\
awk '{print $7}'`"
        if [ "$DEFPOLICY" = "accept" ]; then
                DEFPOLICY="kabul"
        elif [ "$DEFPOLICY" = "reject" -o "$DEFPOLICY" = "deny" ]; then
                DEFPOLICY="red"
        fi
        echo "Tip  Proto   Rem_IP               Loc_IP          \
   Ports R->L" > /tmp/outfw.$$
        OTHER="`cat /tmp/defpol.$$ | grep -v rules |\
grep -v source >> /tmp/outfw.$$`"
        rm -f /tmp/defpol.$$
        dialog --title "Ongorulen islem: $DEFPOLICY" \
--textbox /tmp/outfw.$$ 15 75
        rm -f /tmp/outfw.$$
        main;
}
yardim() {
        cat << EOF > /tmp/yardim.$$
Ipfwadm Kiti:
-------------
Ipfwadm kiti sadece dial-up internete baglanan kullanicilar icin
tasarlanmistir. Ilk etapta DNS,WWW,FTP,POP3,SHELL,IRC islemlerini
gerceklestirmektedir. Ve sadece IP input firewall kurallarini
uygulamaktadir.
Ideal bir baglanti guvenligi icin sirayla asagidaki islemleri 
yapmaniz tavsiye edilir: 
FLUSH -> LO -> DNS -> WWW -> FTP -> POP3 -> SHELL -> IRC
FLUSH: (varsa) mevcut kurallari siler. En bastan baslamanizi saglar.
LO: Localhosttan, yani kendi makinanizdan gene kendi makinaniza
    baglanti yapabilmenizi saglar.
DNS: Adres cevrimi islemi icin gereklidir.
__
Murat Arslan <arslanm@linux-tr.EU.org> 
EOF
        dialog --title "Ipfwadm Kiti Yardim" \
--textbox /tmp/yardim.$$ 17 70
        rm -f /tmp/yardim.$$
        main;
}
main() {        
        checkroot;
        dialog --title "IPfwadm Kiti" --menu "" 17 53 11 \
        "FLUSH" "Mevcut kurallari sil, bastan basla" \
        "LO" "Localhostu ekleme" \
        "DNS" "Domain name server ekleme" \
        "WWW" "Web serverlari ekleme" \
        "FTP" "Ftp serverlari ekleme" \
        "POP3" "POP3 serverini ekleme" \
        "SHELL" "Shell makinasini ekleme" \
        "IRC" "IRC ekleme" \
        "LISTELE" "Tum kurallari listele" \
        "CEKIRDEK" "Cekirdek destegi okmi?" \
        "YARDIM" "Arac hakkinda yardim" \
        2> /tmp/what.$$
        if [ $? = 1 -o $? = 255 ]; then
                rm -f /tmp/what.$$
                exit
           else
                ISTEK="`cat /tmp/what.$$`"
        rm -f /tmp/what.$$
        fi
        if [ "$ISTEK" = "DNS" ]; then
                dnsekle;
          elif [ "$ISTEK" = "FLUSH" ]; then
                flush;
          elif [ "$ISTEK" = "LO" ]; then
                loekle;
          elif [ "$ISTEK" = "WWW" ]; then
                wwwekle;
          elif [ "$ISTEK" = "FTP" ]; then
                ftpekle;
          elif [ "$ISTEK" = "POP3" ]; then
                pop3ekle;
          elif [ "$ISTEK" = "SHELL" ]; then
                shellekle;
          elif [ "$ISTEK" = "IRC" ]; then
                ircekle;
          elif [ "$ISTEK" = "CEKIRDEK" ]; then
                cekirdek;
          elif [ "$ISTEK" = "LISTELE" ]; then
                listele;
          elif [ "$ISTEK" = "YARDIM" ]; then
                yardim;
        fi
}
main;
--------------D52C1FDA9ABD80F1B827ACA1--
 
 Listeden  cikmak icin: 
 	 unsub  linux 
 mesajini  listeci@bilkent.edu.tr'a  gonderiniz.
   Lutfen Listeci icin MIME / HTML / Turkce Aksan kullanmayin. 
  Liste arsivinin adresi:  http://listweb.bilkent.edu.tr/