{"id":391,"date":"2015-07-30T19:04:10","date_gmt":"2015-07-30T16:04:10","guid":{"rendered":"https:\/\/furkansandal.com\/sitesunucu\/?p=391"},"modified":"2015-08-01T15:21:41","modified_gmt":"2015-08-01T12:21:41","slug":"iptables-ve-apf-ile-saldiri-engelleme","status":"publish","type":"post","link":"https:\/\/furkansandal.com\/iptables-ve-apf-ile-saldiri-engelleme\/","title":{"rendered":"\u0130ptables ve Apf ile Sald\u0131r\u0131 Engelleme"},"content":{"rendered":"

Merhaba arkada\u015flar, \u00f6ncelikle yapmam\u0131z gereken, bir sh dosyas\u0131 olu\u015fturmak ve sizlere g\u00f6sterdi\u011fim kodu sh dosyas\u0131na kaydetmek. Nas\u0131l olu\u015ftururum derseniz,<\/p>\n

nano ornekkoruma.sh<\/pre>\n

\u015feklinde, bir sh dosyas\u0131n\u0131 editlemeye alabilirsiniz. Editlemeye ald\u0131k. \u015eu kodu yaz\u0131yoruz.<\/p>\n

\u00a0#!\/bin\/bash\r\n\/bin\/netstat -ntu | awk '{print $5}'| cut -d: -f1 | sort | uniq -c | sort -n | \\\r\ngrep -v 127.0.0.1 | awk '{if ($1 > 100)\u00a0 print\u00a0 $2;}' > \/tmp\/SINLESS\r\nwhile read sinless; do iptables -A INPUT -p all -s $sinless -j DROP; done < \/tmp\/SINLESS <\/pre>\n

\u0130ngilizce kullananlar ctrl + x ard\u0131ndan y tu\u015flar\u0131na bas\u0131p kaydedebilir T\u00fcrk\u00e7e kullananlar ise, ctrl + x ard\u0131ndan E t\u0131\u015funa basmalar\u0131 kaydetmeye yeterli olacakt\u0131r.<\/p>\n

Program\u0131n amac\u0131 belirtmi\u015f oldu\u011funuz limit baz\u0131nda gelen talepleri durdurmakt\u0131r.
\nProgram i\u00e7erisinde limit 100 olarak belirtilmi\u015ftir.APF i\u00e7in iptables yazan yerlere apf yazman\u0131z yeterlidir.<\/p>\n

Ard\u0131ndan bunu normal bir kodla \u00e7al\u0131\u015ft\u0131rmak i\u00e7in ise, \u015fu kodlar\u0131 yaz\u0131yoruz.<\/p>\n

mv orneksaldiri.sh orneksaldiri\r\nchmod a+x orneksaldiri\r\nmv orneksaldiri \/usr\/bin\/\r\n<\/pre>\n

bu yazd\u0131g\u0131m\u0131z komutlarla, bunu direk verilen komutla rahat bir \u015fekilde sald\u0131r\u0131 korumas\u0131n\u0131 ba\u015flatabiliriz.<\/p>\n

\u015eimdi gelen atak taleplerini durdurmak i\u00e7in ssh’ta sinless yazal\u0131m.Bu i\u015flemi bir ka\u00e7 kez yapt\u0131\u011f\u0131n\u0131z takdirde.100 ba\u011flant\u0131 \u00fczerindeki IP ler banlanm\u0131\u015f olacakt\u0131r. Banlanan yani sald\u0131ran ipleri \u015fu \u015fekilde g\u00f6rebiliriz.<\/p>\n

iptables -L<\/pre>\n

Banlalan ipleri serbest b\u0131rakmak yani ban a\u00e7mak i\u00e7in ise,<\/p>\n

iptables -F<\/pre>\n

komutu ile halloldu.<\/p>\n

\u0130yi g\u00fcnler. Farkl\u0131 bir konuda g\u00f6r\u00fc\u015fmek \u00fczere, Furkan Sandal<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Merhaba arkada\u015flar, \u00f6ncelikle yapmam\u0131z gereken, bir sh dosyas\u0131 olu\u015fturmak ve sizlere g\u00f6sterdi\u011fim kodu sh dosyas\u0131na kaydetmek. Nas\u0131l olu\u015ftururum derseniz, \u015feklinde,…<\/p>\n","protected":false},"author":1,"featured_media":167,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":""},"categories":[6,1,9,10,7,4],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/furkansandal.com\/wp-content\/uploads\/2014\/07\/fiziksel_guvenlik.jpg?fit=227%2C226&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6BM7I-6j","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/posts\/391"}],"collection":[{"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/comments?post=391"}],"version-history":[{"count":0,"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/posts\/391\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/media\/167"}],"wp:attachment":[{"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/media?parent=391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/categories?post=391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/furkansandal.com\/wp-json\/wp\/v2\/tags?post=391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}