sekuriti web

47
Web Security Kuliah umum Program Profesi Satu dan Dua Tahun LP3T Nurul Fikri Henry Saptono <[email protected]> Depok, 7 Juni 2007

Upload: echo-oche

Post on 18-Feb-2016

247 views

Category:

Documents


0 download

DESCRIPTION

Sekuriti Web

TRANSCRIPT

Page 1: Sekuriti Web

Web Security

Kuliah umum Program Profesi Satu dan Dua Tahun LP3T Nurul Fikri

Henry Saptono <[email protected]>Depok, 7 Juni 2007

Page 2: Sekuriti Web

Web or Web Application

Lebih dari satu dekade, web telah dirangkul oleh jutaan perusahaan dan industri sebagai saluran untuk berkomunikasi dan bertukar 

informasi yang murah dengan peluang­peluang dan transaksi­transaksi dengan 

pelanggan

Page 3: Sekuriti Web

Web or Web Application (cont'd)Web memberikan suatu cara bagi para marketer  

untuk mengetahui pelanggan atau orang yang mengunjungi website dan memulai untuk 

berkomunikasi dengan mereka. Satu cara yang dilakukan disini adalah mengajak atau 

menanyakan pengunjung web untuk berlangganan  newsletters, men­submit suatu form ketika mereka menginginkan informasi tentang  produk­produk 

atau detil­detil produk 

Page 4: Sekuriti Web

Definition of Web or Web Application

Dari sudut pandang teknikal,  web atau web application adalah suatu environment yang sangat  programmable  dalam bentuk computer programs yang memungkinkan 

pengunjung website men­submit dan menampilkan data dari dan ke suatu database server melalui internet dengan web browser. Kemudian data ditampilkan ke user dalam web 

browser mereka sebagai informasi yang dihasilkan secara dinamis ( biasanya dalam format HTML dengan CSS) oleh 

aplikasi web melalui web server.

Page 5: Sekuriti Web

How do web Application work ?− Web bekerja dalam konsep client – server, artinya ada 

aplikasi client yang meminta data/informasi kepada web server (yang menyediakan data/informasi dinamis). Data/informasi dinamis dihasilkan oleh aplikasi web yang terhubung dengan database server. Aplikasi web client contohnya: Mozilla, Firefox, Netscape, Internet Explorer, Opera dll.  contoh aplikasi web server yaitu: Apache web server, thttpd, IIS (Microsoft web server) dll. Dalam komunikasinya web client dan web server berkomunikasi menggunakan protokol HTTP (Hyper Text Markup Language)

Page 6: Sekuriti Web

Web application layer

Page 7: Sekuriti Web

Web security issue

Ternyata selain keuntungan atau manfaat yang disediakan oleh web, kenaikan jumlah masalah security akibat coding yang tidak 

layak, kesalahan­kesalahan dalam konfigurasi web server, dll. 

Page 8: Sekuriti Web

Web security

Web security merupakan bagian dari Computer/Information security. Pertanyaan 

yang muncul dalam computer security ataupun web security yaitu:  “apa yang harus 

secure ?” 

Page 9: Sekuriti Web

Electronic Assets

Electronic Assets adalah target dari serangan yang mengancam keamanan sistem komputer atau 

sistem informasi. Electronic Assets merupakan aset yang paling berarti bagi suatu perusahaan atau industri yang sehari­harinya bergantung pada 

sistem komputer dan jaringan dalam menjalankan transaksi bisnisnya.  'Electronic Assets adalah 

data dan program'

Page 10: Sekuriti Web

The Difference Between Hackers and Crackers

A hackerhacker is a person intensely interested in the arcane and recondite workings of any computer operating 

system. Hackers are most often programmers. As such, hackers obtain advanced knowledge of operating systems and programming languages. They might 

discover holes within systems and the reasons for such holes. Hackers constantly seek further knowledge, freely share what they have discovered, and never 

intentionally damage data.

Page 11: Sekuriti Web

The Difference Between Hackers and Crackers (cont'd)

A crackercracker is one who breaks into or otherwise violates the system integrity of remote machines with malicious intent. Having gained unauthorized access, crackers 

destroy vital data, deny legitimate users service, or cause problems for their targets. Crackers can easily be identified because 

their actions are malicious.

Page 12: Sekuriti Web

Risks of Web securityLoss of customer confidence, trust and reputation with the consequent harm to brand equity and consequent effects on revenue and profitability; Possible loss of the ability to accept certain payment instruments e.g. VISA, Mastercard Negative impact on revenues and profits arising from any falsified transactions and from employee downtime; 

Page 13: Sekuriti Web

Risks of Web security (cont'd) Website downtime which is in effect the closure of one 

of the most important sales channels for an e­business;  The expenditure involved in repairing the damage 

done and building contingency plans for securing compromised websites and web applications; and, 

Legal battles and related implications from Web application attacks and lax security measures including fines and damages to be paid to victims. 

Page 14: Sekuriti Web

Security Attack

Passive Attack: A passive attack attempts to learn or make use of information from the system but does not affect system resources

Active Attack: An active attack attempts to alter system resources or affect their operation.

Page 15: Sekuriti Web

Web security Attack Passive attack

Sniffing(capture message) Trapper web (web penjebak)

Active attack Denial of Service (DoS) Buffer OverFlow  SQL injection Cross Site Scripting Session Hijacking Directory Traversal attack Authentication Attack (Brute Force attack)

Page 16: Sekuriti Web

Sniffing (capture message) Sniffing adalah suatu serangan yang 

merekam atau menangkap data/message yang lewat melalui jaringan. Serangan jenis ini tidak dapat dihindari Tools sniff : snort, tcpdump, ettercap

Pencegahan: Gunakan VPN (IPsec) Gunakan enkripsi  dalam proses transfer message 

atau data (via HTTPS)

Page 17: Sekuriti Web

Ilustrasi sniffing

Page 18: Sekuriti Web

Capture message with ettercap

Page 19: Sekuriti Web

Ettercap – view connection 

Page 20: Sekuriti Web

Capture SSH connection

Page 21: Sekuriti Web

Trapper Web (web penjebak) Trapper web, adalah passive attack yang 

memanfaatkan kecerobohan pengguna web application, dengan cara membuat website jebakan guna mendapatkan informasi dari pengguna yang terjebak Contoh: www.klikbca.com , menjadi 

www.kilkbca.com Pencegahan:

Pemilik website resmi/valid membeli semua domain yang mirip

Sosialisasi pada pengguna

Page 22: Sekuriti Web

www.klikbca.com

Page 23: Sekuriti Web

www.kilkbca.com

Page 24: Sekuriti Web

Denial of Service Attack DoS adalah suatu  serangan pada engine(web server) 

yang memiliki vulnerability (kelemahan) dengan cara membanjiri engine tersebut dengan request sehingga engine tersebut tidak dapat lagi melayani request dari client lain, sampai pada kondisi crash bahkan down. Tools: dapat ditemukan diberbagai website security, 

atau gunakan search engine  Info vulnerability Anda dapat mengecek di web 

http://cve.mitre.org/cve/ Pencegahan: upgrade atau patch engine dengan versi 

perbaikan, atau gunakan Firewall HTTP seperti untuk Apache HTTPD gunakan mod_security, mod_proxy 

Page 25: Sekuriti Web

Ilustrasi DoS

Page 26: Sekuriti Web

Buffer OverFlow Buffer Overflow adalah suatu serangan yang menyerang 

engine(web server) yang memiliki vulnerability (kelemahan) dalam masalah alokasi memori (buffer) dengan cara memaksakan malicious code agar dieksekusi oleh engine(web server) untuk memperoleh akses root shell. Tools: dapat ditemukan diberbagai website security, 

atau gunakan search engine  Info vulnerability Anda dapat mengecek di web 

http://cve.mitre.org/cve/ Pencegahan: upgrade atau patch engine dengan versi 

perbaikan. Jalankan engine dalam mode chroot(root jail)

Page 27: Sekuriti Web

Ilustrasi buffer overflow

Page 28: Sekuriti Web

SQL injection SQL Injection adalah serangan yang memanfaatkan 

kelemahan coding aplikasi web sehingga penyerang dapat menginjeksi SQL command katakanlah kedalam form login dengan maksud memperoleh akses ke web tersebut. 

Pencegahannya: Buatlah kode program yang menerapkan validasi, 

dan pencegahan manipulasi query SQL Firewall HTTP (mod_security) Intrussion Detection System

Page 29: Sekuriti Web

Ilustrasi SQL Injection<form method="post" action="http://www.xxx.com/login.asp"> <input name="tfUName" type="text" id="tfUName"> <input name="tfUPass" type="password" id="tfUPass"> </form>

The easiest way for the login.asp to work is by building a database query that looks like this:

SELECT idFROM loginsWHERE username = '$username'AND password = '$password’

Page 30: Sekuriti Web

Ilustrasi SQL Injection (cont'd)If the variables $username and $password are requested directly from the user's input, this can easily be compromised. Suppose that we gave "Joe" as a username and that the following string was provided as a password: anything' OR 'x'='x

SELECT idFROM loginsWHERE username = 'Joe'AND password = 'anything' OR 'x'='x'

Page 31: Sekuriti Web

Cross Site Scripting (XSS or CSS) Cross Site Scripting adalah suatu teknik serangan 

yang mempengaruhi kelemahan(vulnerability) dalam coding aplikasi web untuk memungkinkan penyerang mengirimkan malicious content dari client dan mengumpulkan beberapa data­data dari korban.

Pencegahannya: Karakter­karakter berbahaya harus difilter dari input 

aplikasi web.Filter harus diterapkan untuk nilai ASCII and HEX .

Firewall HTTP (mod_security) Intrussion Detection System

Page 32: Sekuriti Web

Ilustrasi Cross Site Scripting 

Page 33: Sekuriti Web

Ilustrasi Cross Site Scripting (cont'd)http://test.searchengine.com/search.php?q=XSS%20Vulnerability

Next we try to send the following query to the search engine:

<script type="text/javascript"> alert('This is an XSS Vulnerability') </script>

By submitting the query to search.php, it is encoded and the resulting URL would be something like:

http://test.searchengine.com/search.php?q=%3Cscript%3Ealert%28%91This%20is%20an%20XSS%20Vulnerability%92%29%3C%2Fscript%3E

Upon loading the results page, the test search engine would probably display no results for the search but it will display a JavaScript alert which was injected into the page by using the XSS vulnerability.

Page 34: Sekuriti Web

Session Hijacking Session Hijacking adalah suatu serangan yang 

memanfaatkan nilai cookies dan token session milik user atau client lain yang dicuri atau ditangkap lewat sniffer. Tujuannya agar si penyerang dapat mengakses halaman­halaman web yang sifatnya private yang biasanya perlu proses login (authentication) Tools: sniffer seperti ettercap, dan GET command

Pencegahannya: Gunakan VPN (IPsec) Gunakan enkripsi  dalam proses transfer message 

atau data (via HTTPS)

Page 35: Sekuriti Web

Ilustrasi Session Hijacking

 

Page 36: Sekuriti Web

Directory Traversal Directory Traversal adalah suatu serangan yang 

mengeksploitasi engine (web server) yang memungkinkan penyerang mengakses direktori yang dibatasi dan mengeksekusi command diluar direktori root web server

Pencegahannya: Gunakan versi web server yang terbaru yang 

menutupi kelemahan directory traversal Gunakan Firewall HTTP seperti mod_security

Page 37: Sekuriti Web

Ilustrasi Directory TraversalIn web applications with dynamic pages, input is usually received from browsers through GET or POST request methods. Here is an example of a GET HTTP request URL:http://test.webarticles.com/show.asp?view=oldarchive.html

With this URL, the browser requests the dynamic page show.asp from the server and with it also sends the parameter "view" with the value of "oldarchive.html". When this request is executed on the web server, show.asp retrieves the file oldarchive.htm from the server's file system, renders it and then sends it back to the browser which displays it to the user. The attacker would assume that show.asp can retrieve files from the file system and sends this custom URL:

http://test.webarticles.com/show.asp?view=../../../../../Windows/system.ini

Page 38: Sekuriti Web

Authentication hacking Authentication memainkan peran penting dalam 

security aplikasi web. Authentication Hacking adalah suatu serangan yang 

mencoba login ke suatu aplikasi web dengan menggunakan tool atau script yang melakukan percobaan­percobaan login dengan account user yang umum terdapat pada sistem (misal root, guest, Administrator) sampai berhasil. Teknik ini sering disebut brute force attack

Pencegahannya: gunakan validasi login menggunakan image

Page 39: Sekuriti Web

Form dgn image input sbg pencegah brute force 

Page 40: Sekuriti Web

Kesimpulan dan saran Gunakan Engine web server yang tangguh, no 

bugs

Segera patch atau upgrade jika engine 

dikemudian hari ditemukan vulnerability

Konfigurasi  Engine web server dengan benar

Ada baiknya menjalankan engine web server 

dalam mode chroot (root jail)

Page 41: Sekuriti Web

Kesimpulan dan saran (cont'd) Ikuti berita dari milis atau forum security untuk 

engine web server yang Anda gunakan

Gunakan fitur­fitur dukungan engine web server 

yang Anda gunakan hanya yang memang Anda  

butuhkan

Page 42: Sekuriti Web

Kesimpulan dan saran (cont'd) Menerapkan HTTP authentication pada directory 

atau dokumen yang dianggap privat

Menerapkan HTTP authorization pada directory 

atau dokumen yang dianggap privat

Page 43: Sekuriti Web

Kesimpulan dan saran (cont'd) Gunakan Aplikasi Firewall HTTP untuk filtering dan 

investigasi request HTTP (contoh: mod_security)

Gunakan aplikasi intrusion detection system (contoh: 

snort)

Untuk data sensitif terapkan Secure connection 

(HTTPS)

Error message hanya disimpan ke file

Page 44: Sekuriti Web

Kesimpulan dan saran (cont'd) Untuk web application, gunakan konsep secure 

programming, seperti menyediakan input filtering, 

input validasi, authentication, authorization, input 

image

Untuk database server, gunakan account user yang 

berbeda privileges untuk akses yang hanya 

membaca dengan akses yang butuh menulis 

Page 45: Sekuriti Web

Kesimpulan dan saran (cont'd)

Rencanakan dan lakukan proses backup 

dengan benar

Buat perencanaan reaksi security

Lakukan pelatihan security

Page 46: Sekuriti Web

Daftar pustaka www.acunetix.com Anonymous, “Maximum Security”, Team LIB, 

Fourth Edition, Dec 16 2002 Piere­Alain Fayolle, Vincent Glaume, “A Buffer 

Overflow Study Attacks and Defenses”,ENSEIRB,  2002

Steve Manzuik, Ken Pfeil, Andre Gold, “Network Security Assessment From Vulnerability to Patch” , Syngress

Page 47: Sekuriti Web

SELESAI

Allhamdulillah