كيف أن يسدّ [دّوس] هجوم في [لينوإكس]

ب [سوكريت] [دهندهنيا] على أبريل - نيسان 13, 2009

[لينوإكس] أمن

نحن ركضنا مادة فوق كيف أن يسدّ [إيب دّرسّ] في [إيبتبلس] في [لينوإكس] [ا فو] أيام [أغو]. هنا مادة مديحية أنّ أعراض أنت كيف أن يكشف ال [إيب] عناوين المهاجمات [إين كس وف] [دنيل وف سرفيس] (أو [دو]) يهاجمون.

أن يتمّ هذا سيستعمل نحن برمجيّة حرّة يدعى [بسد]. [بسد] أعمال في [سنك] مع [إيبتبلس] ومدربات ال [إيبتبلس] يدوّنون ويفحص لمسح يسرى وأخرى حركة مرور مشبوهة أيّ يكون عادة إشارات من أحد ما يحاول أن يكسر داخل ك [لينوإكس] نادلة.

ركّبت أن يبدأ, [بسد]. إن أنت يكون تركض نكهة [لينوإكس] أنّ يتلقّى فاخر مجموعة [منجمنت سستم] مثل [أوبونتث] أو [فدورا] أنت سوفت كنت يمكن أن يستعمل أحد من الأوامر تالي أن يحصل [بسد] على نظامتك:

# [أبت-جت] [سودو] يركّب [بسد]
أو
# يركّب [يوم] [بسد]

إن هذا لا يعمل ل أنت رأس إلى ال [بسد] [دوونلوأد] صفحة وجلبت الشكل أنّ يعمل ل أنت.

بما أنّ أنا أستعمل [أوبونتث] [لينوإكس] نادلة سيكون الإستراحة من هذا [تثتوريل] [أوبونتث] مواصفة. مهما, مع بعض قاصر يعدّل أنت سوفت كنت يمكن أن يجعل هو عمل على أخرى نكهات [لينوإكس]. فتحت ال [سسلوغ.كنف] مبرد مع [تإكست ديتور] ك مفضّلة:

# [فيم] /etc/syslog.conf

أضفت الخطّ تالي في النهاية من ال من المبرد:

kern.info |[/فر/ليب/بسد/بسدفيفو]

أنت يستطيع استعملت الأمر تالي أن ينجز ال نفسه شيء:

# صدى - [إ] "[كرن.ينفو] \ [ت]|[/فر/ليب/بسد/بسدفيفو]" >> /etc/syslog.conf

الآن استأنفت ال [سسكلوغد] و [كلوغ] [دمونس]:

/etc/init.d/sysklogd إستئناف
/etc/init.d/klogd إستئناف

الطريق [بسد] أعمال أنّ سيكشف هو وسيأمر [إيبتبلس] أن يسدّ أيّ [إيبس] مشبوهة. أحيانا هذا أمكن نتجت في ال يسدّ من [إيب] أيّ أنت تستعمل. أن يقهر هذا إصدار أنت سوفت خلقت مبرد يحتوي قائمة ميلان إلى جانب من آمنة [إيب] عناوين. خلقت مبرد مثل هذا واحدة:

# [فيم] /home/calvin/safeiplist.cfg

دخلت ال [إيب] عناوين أنّ يحتاج أنت [بسد] إلى [وهيتليست]:

127.0.0.0 /24
192.168.0.0 /24
122.164.34.240

ما من إستعمال نص مثل يتبع واحدة أن يشكّل [إيبتبلس] مع القواعد ضروريّة. بطاقة أنّ سيزيل هذا نص كلّ عمليّة إعداد سابقة من ك [إيبتبلس] تركيب. يلصق نسخة والنص تالي على ك [لينوإكس] نادلة, ويستبدل المتغيرات [ووركدير] و [سفيبليست] مع ال يصحّ عمليّة إعداد من تركيبك.

[ووركدير] " [/هوم/كلفين/] "
[إينترفل] " 5 "
[هيتكونت] " 5 "
[سفيبليست] " [سفيبليست.كفغ] "

قرص كنيز [$ووركدير]

[إيبتبلس] - [ف]
إن [- [ف] [$سفيبليست]]; بعد ذلك
[إيبس$] ([غرب] - [إف] "^#" [$سفيبليست])
ل أنا في [$يبس]
أتمّت
[إيبتبلس] - مدخل - [س] [$ي] - يقبل [ج]
يتمّ
[في]

[إيبتبلس] - مدخل - [م] دولة - دولة جديدة - [م] أخيرة - مجموعة
iptables -A INPUT -m state –state NEW -m recent –update –seconds $INTERVAL –hitcount $HITCOUNT -j LOG

What the script does is that it logs an IP address if it makes five or more attempts at making a connection in the span of five seconds. I would suggest you use the script as is unless you know what you are doing while modifying it. One you are done, give it executable permissions and run it.

# chmod +x /home/calvin/ipblock.sh

# /home/calvin/ipblock.sh

Now back to psad. Open the psad configuration file and edit it. These are the changes I suggest you make. Feel free to go through the psad documentation and make other changes:

EMAIL_ADDRESSES you@yourdomain.com;

Set machine’s hostname:

HOSTNAME yourdomain.com;

If you have only one network interface on this server, set HOME_NET to:

HOME_NET NOT_USED;

You can also need to adjust danger levels for psad, and define a set of ports to ignore, for example to ask psad ignore udp ports 80 and 8080, make the following change:

IGNORE_PORTS udp/80, udp/8080;

Save and close the file. Then restart psad:

# /etc/init.d/psad restart

You are now good to go. To monitor psad’s reports run the following command:

# psad -S

To remove automatically clocked IPs run the following command:

# psad -F

psad is a very versatile and powerful tool. If you know how to use it it can do wonders for you, but if you don’t you can really mess up your computer. So please use psad with caution.

Related Posts:
  • How to block an IP address in IPTables in Linux
  • Comcast: Another chapter of lies, misdirection and ps. good luck using bittorrent
  • How to determine where all your hard drive space has gone in Windows
  • Getting started with iptables in Linux
  • An introduction to the sudo command and configuration file
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Just enter your email address below:

    You can always opt out of this email subscription at any time.

    { 0 comments… add one now }

    Leave a Comment

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>