1 / 100

Keamanan Web

Keamanan Web. Sejarah WWW. Dikembangan oleh Tim Berners-Lee ketika sedang berada di CERN Kemudahan untuk mengakses informasi melalui sistem hypertext Mula-mula dikembangkan dengan NeXT, kemudian muncul Mosaic (Windows, Mac, Unix), dan … akhirnya Netscape. Kemudian meledak. Sejarah WWW.

hidi
Télécharger la présentation

Keamanan Web

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Keamanan Web

  2. Sejarah WWW • Dikembangan oleh Tim Berners-Leeketika sedang berada di CERN • Kemudahan untuk mengakses informasi melalui sistem hypertext • Mula-mula dikembangkan dengan NeXT, kemudian muncul Mosaic (Windows, Mac, Unix), dan … akhirnya Netscape. Kemudian meledak Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  3. Sejarah WWW • Bahan bacaan • http://ensiklomedia.insan.co.id • Buku Tim Berners-Lee, “Weaving the Web” • http://www.w3.org Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  4. Sistem WWW • Arsitektur sistem WWW • Server (apache, IIS) • Client (IE, Netscape, Mozilla, opera, kfm, arena, amaya, lynx) • Terhubung melalui jaringan • Program dapat dijalankan di server (CGI, [java] servlet) atau di sisi client (javascript, java applet) Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  5. Asumsi [Sisi Pengguna] • Server dimiliki dan dikendalikan oleh organisasi yang mengaku memiliki server tersebut • Dokumen yang ditampilkan bebas dari virus atau itikad jahat lainnya • Server tidak mencatat atau mendistribusikan informasi tentang user (misalnya kebiasaan browsing) Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  6. Asumsi [Sisi Webmaster] • Pengguna tidak mencoba merusak web server atau mengubah isinya • Pengguna hanya mengakses dokumen yang diperkenankan • Identitas pengguna benar Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  7. Asumsi Kedua Pihak • Network bebas dari penyadapan pihak ketiga • Informasi yang disampaikan dari server ke pengguna terjamin keutuhannya dan tidak dimodifikasi oleh pihak ketiga Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  8. Keamanan Server WWW • Server WWW (httpd) menyediakan informasi (statis dan dinamis) • Halaman statis diperoleh dengan perintah GET • Halaman dinamis diperoleh dengan • CGI (Common Gateway Interface) • Server Side Include (SSI) • Active Server Page (ASP), PHP • Servlet (seperti Java Servlet, ASP) Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  9. Eksploitasi server WWW • Tampilan web diubah (deface) • dengan eksploitasi skrip / previledge / OS di server • Situs yang dideface dikoleksi di http://www.alldas.org • Informasi bocor • (misal laporan keuangan semestinya hanya dapat diakses oleh orang/ bagian tertentu) Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  10. Eksploitasi server WWW [2] • Penyadapan informasi • URLwatch: melihat siapa mengakses apa saja. Masalah privacy • SSL memproteksi, namun tidak semua menggunakan SSL karena komputasi yang tinggi • DoS attack • Request dalam jumlah yang banyak (bertubi-tubi) • Request yang memblokir (lambat mengirimkan perintah GET) Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  11. Eksploitasi server WWW [3] • Digunakan untuk menipu firewall (tunelling ke luar jaringan) • Port 80 digunakan untuk identifikasi server (karena biasanya dibuka di router/firewall) • telnet ke port 80 (dibahas di bagian lain) Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  12. Membatasi Akses • Access Control • Hanya IP tertentu yang dapat mengakses server(konfigurasi web server atau firewall) • Via userid & password (htaccess) • Menggunakan enkripsi untuk menyandikan data-data Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  13. htaccess di Apache • Isi berkas “.htaccess” AuthUserFile /home/budi/.passme AuthGroupFile /dev/null AuthName “Khusus untuk Tamu Budi” AuthType Basic <Limit GET> require user tamu </Limit> • Membatasi akses ke user “tamu” dan password • Menggunakan perintah “htpasswd“ untuk membuat password yang disimpan di “.passme” Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  14. Secure Socket Layer (SSL) • Menggunakan enkripsi untuk mengamankan transmisi data • Mulanya dikembangkan oleh Netscape • Implementasi gratis pun tersedia • openSSL Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  15. Cari info server • Informasi tentang server digunakan sebagai bagian dari casing the joint • Dapat dilakukan dengan • Memberikan perintah HTTP langsung via telnet • Menggunakan program nc, ogre Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  16. Keamanan CGI • CGI digunakan sebagai interface dengan sistem informasi lainnya (gopher, WAIS) • Diimplementasikan dengan berbagai bahasa (perl, C, C++, python, dll.) • Skrip CGI dijalankan di server sehingga membuka potensi lubang keamanan Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  17. Lubang Keamanan CGI • Beberapa contoh • CGI dipasang oleh orang yang tidak berhak • CGI dijalankan berulang-ulang untuk menghabiskan resources (CPU, disk): DoS • Masalah setuid CGI di sistem UNIX, dimana CGI dijalankan oleh userid web server • ASP di sistem Windows • Guestbook abuse dengan informasi sampah • Akses ke database via SQL Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  18. Keamanan Client WWW • Berhubungan dengan masalah privacy • Cookies untuk tracking kemana saja browsing • Pengiriman informasi pribadi • Attack (via active script, javascript, java) • Pengiriman data-data komputer (program apa yang terpasang, dsb.) • DoS attack (buka windows banyak) • Penyusupan virus dan trojan horse Keamanan Sistem WWW - BR - 1.2 - 2001.2002

  19. Why worry? (cont.)

  20. Pengantar Security • Keamanan komputer -> fisik • Dari bencana alam • Dari pencuri • Dari serangan / bom • Keamanan sistem informasi -> non fisik • Dari sisi software dan data

  21. Komponen Security (CIA-AN) • Confidentiality: akses terhadap sistem komputer tidak boleh dilakukan oleh unauthorized parties • Integrity: aset sistem komputer tidak boleh dimodifikasi oleh unauthorized users • Availability: Sistem harus dapat selalu online/ada sehingga dapat diakses oleh authorized users Tambahan • Authenticity: sistem mengetahui asal muasal suatu objek atau asal muasal modifikasi yang terjadi • Non-repudiation: seseorang/sesuatu tidak dapat menyanggah bahwa dia melakukan sesuatu

  22. Ancaman • Ancaman (threat) adalah: • Seseorang, sesuatu, kejadian atau ide yang menimbulkan bahaya bagi suatu aset • Threat muncul dari vulnerability (kelemahan sistem & desain) • Serangan (attack) adalah realisasi dari threat. • Klasifikasi threats: • Disengaja (mis. hacker penetration); • Tidak disengaja (mis. Mengirimkan file yang sensitif ke alamat yang salah) • Threats yang disengaja dapat dibagi lagi : • Pasif – tidak kontak langsung (mis. monitoring, wire-tapping,); • Aktif – kontak langsung (mis. mengubah nilai transaksi finansial)

  23. Tujuan Security • Prevention - Penjagaan • Prevent attackers from violating security policy • Detection - Deteksi • Detect attackers’ violation of security policy • Recovery - Mereparasi • Stop attack, assess and repair damage • Continue to function correctly even if attack happen

  24. Segitiga Sistem Functionality Posisi suatu sistem Easy to use Security

  25. Tahapan penyerangan • Reconnaissance • Mengumpulkan data mengenai target • Aktif dan pasif • Scanning • Tanda dimulainya serangan, berusaha mencari jalan masuk • Gaining access • Mendapatkan target • Maintaining access • Mempertahankan akses dgn berbagai cara termasuk menanamkan program dan memperbaiki kelemahan • Covering tracks • Menutupi jejak mereka

  26. Level Serangan • Level Sistem Operasi • Patch & upgrade • Level aplikasi • Patch, Antivirus & Upgrade • Level Shrink Wrap code • Menggunakan program2 bantu untuk serangan • Level Kesalahan konfigurasi

  27. Commonly attacked services • SMTP servers (port 25) • sendmail: “The address parser performs insufficient bounds checking in certain conditions due to a char to int conversion, making it possible for an attacker to take control of the application” • RPC servers (port 111 & others) • NetBIOS shares (ports 135, 139, 445) • Blaster worm • Sasser worm • FTP servers (ports 20, 21) • wuftpd vulnerabilities • SSH servers (port 22) • OpenSSH, PAM vulnerabilities • Web servers (ports 80, 443) • Apache chunked encoding vulnerability

  28. Web server attack • Scan to find open ports • Find out what’s running on open ports (banner grabbing) • Profile the server • Windows (look for Kerberos, NetBIOS, AD) • Unix • Use TCP fingerprinting • Probe for weaknesses on interesting ports • Default configuration files and settings (e.g. popular IIS ones) • Buffer overflows • Insecure applications • Launch attack • Use exploit code from Internet… • …or build your own

  29. Scanning… What O/S is this system?

  30. Scanning… What O/S is this system?

  31. Phising

  32. Pharming

  33. Peminjaman lewat URL <IMG SRC=“tempat.yang.dipinjam/gambarku.gif”> • Gambar / image / berkas tidak dikopi tapi “dipinjam” melalui hyperlink • Pemilk berkas dapat dirugikan: bandwidth terpakai • Auditing sulit dilakukan pemakai biasa, tanpa akses ke berkas log (referer)

  34. Kelemahan security pada aplikasi web http://www.owasp.org Berikut adalah 10 kelemahan security teratas pada aplikasi web • Masukan (input) yang tidak tervalidasi • Broken Access Control • Pengelolaan Autentikasi dan Session yang tidak baik • Cross site scripting • Buffer overflows • Injections flaws • Penyimpanan yang tidak aman • Denial of Service • Pengelolaan konfigurasi yang tidak aman

  35. Kelemahan security pada aplikasi web Input yang tidak divalidasi • Aplikasi web menerima data dari HTTP request yang dimasukkan oleh user • Hacker dapat memanipulasi request untuk menyerang keamanan situs Hal – hal yang harus diperhatikan ketika mengelola validasi: • Tidak cukup hanya bergantung pada script client side yang biasa digunakan untuk mencegah masukan form ketika ada input yang invalid • Penggunaan kode validasi untuk memeriksa masukan tidak mencukupi

  36. Kelemahan security pada aplikasi web Broken Access Control • Pada aplikasi yang membedakan akses dengan menggunakan perbedaan ID, hanya menggunakan satu halaman untuk memeriksa user. • Jika user berhasil melewati halaman login, maka dia bebas melakukan apa saja • Permasalahan lain adalah: • ID yang tidak aman • ID bisa ditebak • Ijin file File yang berisi daftar user bisa dibaca orang lain

  37. Kelemahan security pada aplikasi web Pengelolaan Autentikasi dan Session yang tidak baik • Beberapa hal yang harus diperhatikan: • Password strength • Penggunaan password • Penyimpanan password • Session ID Protection

  38. Kelemahan security pada aplikasi web Buffer Overflows • Pengiriman request yang dapat membuat server menjalankan kode kode yang tidak biasa

  39. Kelemahan security pada aplikasi web Injection Flaws • Penyerang mengirimkan “inject” calls ke OS atau resource lain, seperti database • Salah satu yang terkenal adalah SQL Injection

  40. Kelemahan security pada aplikasi web • Keamanan server juga menjadi hal penting dalam hal keamanan aplikasi web Berikut adalah beberapa kesalahan konfigurasi pada server : • Lubang keamanan yang tidak ditambal (patched) • Ijin file dan direktori yang tidak baik • Account default dengan password default

  41. Command Injection • Allows attacker to relay malicious code in form variables or URL • System commands • SQL • Interpreted code (Perl, Python, etc.) • Many apps use calls to external programs • sendmail • Examples • Path traversal: “../” • Add more commands: “; rm –r *” • SQL injection: “’ OR 1=1” • Countermeasures • Taint all input • Avoid system calls (use libraries instead) • Run with limited privileges

  42. Error Handling • Examples: stack traces, DB dumps • Helps attacker know how to target the app • Inconsistencies can be revealing too • “File not found” vs. “Access denied” • Fail-open errors • Need to give enough info to user w/o giving too much info to attacker • Countermeasures • Code review • Modify default error pages (404, 401, etc.)

  43. Error messages example

  44. Poor Cryptography • Insecure storage of credit cards, passwords, etc. • Poor choice of algorithm (or invent your own) • Poor randomness • Session IDs • Tokens • Cookies • Improper storage in memory • Countermeasures • Store only what you must • Store a hash instead of the full value (SHA-1) • Use only vetted, public cryptography

  45. Web/App Server Misconfiguration • Tension between “work out of the box” and “use only what you need” • Developers ≠ web masters • Examples • Unpatched security flaws (BID example) • Misconfigurations that allow directory traversal • Administrative services accessible • Default accounts/passwords • Countermeasures • Create and use hardening guides • Turn off all unused services • Set up and audit roles, permissions, and accounts • Set up logging and alerts

  46. Web vulnerabilities • Intercept informasi dari klien • Data, password, dll • Pencurian data di server • Data, password, dll • Menjalankan aplikasi di server • Memungkinkan melakukan eksekusi program “ngak benar” di server • Denial Of Services • Server Side Scripting, Cgi-Bin • Kesalahan pemograman membuka peluang

  47. Three opportunities for theft: • on server by other registered users • into server using HTTP • on network by snooping

  48. Kemanan Web • Authentikasi • FORM HTML • Basic, Digest • Klien Side + Server Side Scripting • Manajemen Sesi • Menggunakan Layer lain • S-HTTP ( discontinoued) • HTTPS ( HTTP ovel SSL) • IPSec • Konfigurasi Web Server • Hak Akses • Indexes • Penempatan File

  49. HTTP Authentication • Protect web content from those who don’t have a “need to know” • Require users to authenticate using a userid/password before they are allowed access to certain URLs • HTTP/1.1 requires that when a user makes a request for a protected resource the server responds with a authentication request header • WWW-Authenticate • contains enough pertinent information to carry out a “challenge-response” session between the user and the server Client requests a protected resource Client Web Server Server responds with a 401 (not authorized and a challenge request for the client to authenticate

  50. Authentikasi • FORM HTML • <form action="modules.php?name=Your_Account" method="post">... • <br><input type="hidden" name="op" value="login"> ... • </form> • Tidak di enkripsi • BASIC • Algortima Base64 • Mudah di Dekrip • DIGEST • Alghoritma Digest Ex: MD5 • Belum 100% di support • CS + SS Script • Belum 100% di support • http://toast.newcastle.edu.au/js/md5/browsertest.php3.

More Related