Intrusion Detection System (Portsentry dan Honeypot)

Network Security Network Security

  

Intrusion Detection System

(Portsentry dan Honeypot) (Portsentry dan Honeypot) Muhammad Zen S. Hadi

  

N t k I t i D t ti Network Intrusion Detection

  Memahasi dasar intrusion detection systems (portsentry)

  

  Memahami dasar honeypot

  Firewall Saja Tdk Cukup Fi ll S j Tdk C k 

  Tidak semua akses melalui firewall 

  Ada beberapa aplikasi yang memang diloloskan oleh firewall (Web, Email, dll) l h fi ll (W b E il dll) 

  Tidak semua ancaman berasal dari luar firewall, tapi dari dalam jaringan sendiri tapi dari dalam jaringan sendiri 

  Firewall kadang merupakan object serangan  

  Perlu suatu aplikasi sebagai pelengkap Firewall Perlu suatu aplikasi sebagai pelengkap Firewall yang bisa mendeteksi ancaman yang tidak bisa diproteksi oleh firewall

  

D S ti DoS preventive

  IDS

  

  IPS

  

  Honeypots

  

  firewall

  

I t i D t ti S t (IDS) Intrusion Detection System (IDS)

  Examining system logs (host based)

  

  Examining network traffic (network based)

  

  A Combination of the two

  

  Implementation:

   snort

   snort

  

I t i P ti S t (IPS) Intrusion Prevention System (IPS)

  Upgrade application

  

  Active reaction (IDS = passive)

  

  Implementation:

   portsentry

  Pengertian IDS P ti

  IDS 

  IDS kepanjangan Intrusion Detection System

  

  Sistem untuk mendeteksi dan merespons adanya “intrusion” yang dilakukan oleh “intruderintrusion yang dilakukan oleh intruder

  

  Pendeteksian bisa dilakukan sebelum, selama dan sesudah kejadian.

   Terdeteksi sebelum, maka bisa melakukan tindakan T d k i b l k bi l k k i d k pencegahan

  

Terdeteksi selama : bisa diputuskan untuk diblok dan alarm

    Terdeteksi setelah : melihat akibat yang ditimbulkan T d t k i t l h lih t kib t diti b lk

  

  IDS mengumpulkan info dari dari berbagai sistem dan source network kemudian melakukan analisa terhadap info tsb sesuai dengan rule yang sudah ditetapkan i f b i d l d h di k

  Pengertian IDS (Cont…) P ti

  IDS (C t ) 

  Intrusion 

  

Didefinisikan sebagai kegiatan yang bersifat anomaly, incorrect,

inappropriate yang terjadi di jaringan atau di host

    Klasifikasi intrusi : Klasifikasi intrusi : Attempted Break-ins Masquerade attacks   Penetration of Security Control Systems Leakage Leakage Denial of Service

  Malicious Use 

  Anomaly merupakan Traffic/aktivitas yang tidak sesuai dgn policy: d li

   akses dari/ke host yang terlarang

   memiliki content terlarang (virus)

    menjalankan program terlarang (web directory traversal: menjalankan program terlarang (web directory traversal: ../..;cmd.exe

  )

  

Intrusion Detection System (IDS) I t i D t ti S t (IDS)

  Intrusion detection adalah proses notifikasi ketika seseorang ingin masuk ke sebuah sistem.

  

  K t Kategori dari software ini disebut intrusion detection i d i ft i i di b t i t i d t ti systems (IDS)

  

  PortSentry, oleh Psionic, melihat port network ketika PortSentry, oleh Psionic, melihat port network ketika paket melakukan port scan.

  

  Tool yang lebih kompleks dari PortSentry adalah Linux

  IDS t LIDS d t b h Li k l

  IDS, atau LIDS, yang dapat merubah Linux kernel

  

Penggunaan Software Intrusion Penggunaan Software Intrusion

Detection

  Penggunaan yang disarankan untuk tool intrusion detection :

    Gunakan nmap untuk scan system setelah konfigurasi untuk Gunakan nmap untuk scan system setelah konfigurasi untuk mengecek security holes.

   Selanjutnya, gunakan PortSentry untuk melihat host luar yang mencoba melakukan port scan ke server. mencoba melakukan port scan ke server

   Gunakan LIDS untuk mengamankan file system anda, sehingga seseorang yang ingin untuk masuk ke server akan mempunyai akses yang dibatasi. akses yang dibatasi

  Basic Intrusion Detection B i I t i D t ti Intrusion

  

Monitor

Target

  Detection System y System System

  Report Report Respond Respond Intrusion Detection System Infrastructure Intrusion Detection System Infrastructure Intrusion Detection System IDS I t i D t ti S t

  IDS 

  Port : Pelabuhan

  

  Sentry : Penjaga

  

  PortSentry adalah sebuah perangkat lunak yang di P S d l h b h k l k di rancang untuk mendeteksi adanya port scanning & meresponds secara aktif jika ada port scanning secara p j p g real time

  

  portsentry – mencegah portscan

   Jalankan sebagai daemon pada host yang terproteksi, hal ini

akan mendengarkan ke port TCP/UDP dan akan memblok

scanning host dari server yang terkoneksi. g y g

   Untuk implementasi : http://sourceforge.net/projects/sentrytools/

  PortSentry P tS t http://www.psionic.com/products/portsentry.html .

  

Pl tf P t S t Platform Port Sentry

  FreeBSD

  

  Open BSD

  

  Linux

  Keuntungan Port Sentry K t P t S t 

  Deteksi portscan TCP/UDP berbasis host-

based dan mengaktifkan sistem pertahanan

  Deteksi Stealth scan 

  

Bereaksi ke portscan dengan memblok host

  Internal state engine untuk mengingat host yang terkoneksi sebelumnya 

  Semua kejadian akan disimpan ke syslog

  Kekurangan Port Sentry K k P t S t 

  Portsentry dibinding ke port sehingga diperlukan pengecekan menyeluruh

  

  Tidak dapat mendeteksi spoofing Tid k d t d t k i fi

  

Di P t S t Dil t kk Dimana Port Sentry Diletakkan

  Dibelakang Firewall

  

  Dibelakang tiap host yang dilindungi

  

8

  

1 Fiture PortSentry Fit P tS t 

  Mendeteksi scan

  

  Melakukan aksi terhadap host yg melakukan pelanggaran

  

  Mengemail admin system bila di integrasikan dengan Logcheck/LogSentry

  Aksi yang dilakukan Port Sentry Ak i dil k k P t S t 

  Stealth setting ???? g

  

  Melogging semua pelanggaran di syslog dan mengindikasikan nama system, waktu serangan, IP mesin penyerang, TCP / UDP port tempat serangan dilakukan. TCP / UDP t t t dil k k

  

  Menambahkan entry untuk penyerang di /etc/hosts.deny

   

  Mengeblok akses ke sistem berbasis iptables atau Mengeblok akses ke sistem berbasis iptables atau tcpwrapper

  File Konfigurasi PortSentry Fil K fi i P tS t 

  file /etc/portsentry/portsentry.conf fil / t / t t / t t f

  merupakan konfigurasi utama portsentry. Disini secara bertahap diset port mana saja yang perlu di monitor, responds apa yang

harus di lakukan ke mesin yang melakukan portscan, mekanisme

menghilangkan mesin dari routing table, masukan ke host.deny.

  

  file /etc/default/portsentry p y

   set mode deteksi yang dilakukan portsentry. 

  

Semakin baik mode deteksi yang dipilih (advanced stealth

TCP/UP scanning) biasanya PortSentry akan semakin sensitif & TCP/UP scanning), biasanya PortSentry akan semakin sensitif & semakin rewel karena sedikit-sedikit akan memblokir mesin.

  

  file /etc/portsentry/portsentry.ignore

  isikan IP address yang perlu di abaikan i ik

  IP dd l di b ik

  Menjalankan portsentry M j l k t t 

  /usr/sbin/portsentry

  

  /etc/init.d/portsentry start

  

  portsentry -udp (normal scan detection) portsentry udp (normal scan detection)

  

  portsentry -tcp (normal scan detection)

  

  p portsentry -sudp (normal stealth scan detection) y p ( )

  

  portsentry -stcp (normal stealth scan detection)

  

  portsentry -audp (advanced stealth scan detection)

  

  portsentry -atcp (advanced stealth scan detection) t t t ( d d t lth d t ti )

  Konfigurasi Port Sentry K fi i P t S t  Un-comment these if you are really anal:

  #TCP_PORTS="1,7,9,11,15,70,79,80,109,110,111,119,138,139,143,5 #TCP PORTS="1 7 9 11 15 70 79 80 109 110 111 119 138 139 143 5 12,513,514,515,540,635,1080,1524,2000,2001,[..] #UDP_PORTS="1,7,9,66,67,68,69,111,137,138,161,162,474,513,517, 518,635,640,641,666,700,2049,31335,27444,34555,[..] # # U # # Use these if you just want to be aware: th if j t t t b

  TCP_PORTS="1,11,15,79,111,119,143,540,635,1080,1524,2000,5742 ,6667,12345,12346,20034,27665,31337,32771,32772,[..] UDP_PORTS="1,7,9,69,161,162,513,635,640,641,700,37444,34555,3 1335,32770,32771,32772,32773,32774,31337,54321“ 1335 32770 32771 32772 32773 32774 31337 54321“

  # # Use these for just bare-bones #TCP_PORTS="1,11,15,110,111,143,540,635,1080,1524,2000,12345, 12346,20034,32771,32772,32773,32774,49724,54320" , , , , , , , #UDP_PORTS="1,7,9,69,161,162,513,640,700,32770,32771,32772,3 2773,32774,31337,54321"

  

Blocking Host Bl ki H t

  file /etc/portsentry/portsentry.conf

  

  Blocking dengan iptables : KILL_ROUTE="/usr/local/sbin/iptables -I INPUT -s $TARGET$ -j DROP“

   

  Blocking dengan tcpwrapper : Blocking dengan tcpwrapper : KILL_HOSTS_DENY="ALL: $TARGET$ : DENY"

  

D ft L S Daftar Log Serangan

  /etc/hosts.deny

  

  /etc/portsentry/portsentry.blocked.atcp

  

  /etc/portsentry/portsentry.blocked.audp

  

  /etc/portsentry/portsentry.history

  Output PortSentry O t t P tS t 

  Sep 19 01:50:19 striker portsentry[129]: attackalert: \ Host 192.168.0.1 has been blocked

via dropped route using command: \ "/sbin/ipfw

add 1 deny all from 192.168.0.1:255.255.255.255 to any 192 168 0 1:255 255 255 255 to any"

   Sep 19 01:50:19 striker portsentry[129]: attackalert: \ Connect from host: attackalert: \ Connect from host:

192.168.0.1/192.168.0.1 to TCP port: 9 Sep 19

01:50:19 striker portsentry[129]: attackalert: \ 0 50 9 s e po se y[ 9] a ac a e \

Host: 192.168.0.1 is already blocked. Ignoring

  

H t Honeypot

  Merupakan sebuah resource yang berpura-pura menjadi sebuah target real, yang diharapkan untuk diserang.

  T j t

  

  Tujuan utamanya :

  

membelokkan attacker dari serangan ke productive system

   mendapatkan informasi tentang jenis-jenis serangan dan p g j j g penyerang.

  

  Penempatan honeypot

   Penempatan secara tidak langsung antara firewall dan internet

   Penempatan secara tidak langsung antara firewall dan internet

   Penempatan honeypot pada DMZ

  2

  8 HoneypotsHoneypots (http://www.honeynet.org)

  

Vi t l H t Virtual Honeynet

I t t

  

  Implement

  

  VMware Internet

  Host Operating System Guest OS Guest OS Guest OS

  

Tipe Honeypot Ti H t

  High Interaction Honeypot Hi h I t ti H t adalah sistem yang mengoperasikan Sistem Operasi penuh sehingga penyerang akan melihatnya sebagai penuh sehingga penyerang akan melihatnya sebagai sebuah sistem operasi/host yang siap untuk dieksploitasi

  

  Low Interaction Honeypot mensimulasikan sebuah sistem operasi dengan service- service tertentu(misalnya SSH,HTTP,FTP) atau dengan kata lain sistem yang bukan merupakan sistem operasi kata lain sistem yang bukan merupakan sistem operasi secara keseluruhan, service yang berjalan tidak bisa dieksploitasi untuk mendapatkan akses penuh terhadap honeypot. h t

  

T j H t Tujuan Honeypot

  Early Detection

  

  Pendeteksian ancaman baru

  

  Mengenal si attacker (know your enemy)

  

  Menyelamatkan sistem M k l fiki tt k

  

  Mengacaukan pola fikir attacker

  

  Membangun pertahanan

  

  Mencegah proses hacking

  

  Mencegah proses hacking