Dalam suatu kesempatan, saya pernah melihat seorang auditor keamanan jaringan melalukan penetration test (pen-test) terhadap suatu sistem IT. Karena penasaran saya melihat sedikit2 cara penetration test yang dilakukan. Waktu itu saya belum banyak tahu tools apa aja yang digunakan, yang saya tau dia menggunakan tcpdump untuk menganalisis paket apa aja yang lewat, trus untuk men-scan beberapa host menggunakan Nessus. Ada salah satu aplikasi yang digunakan berbasis web yang terdapat kumpulan beberapa exploit. Waktu itu saya belum tahu aplikasi apa itu, yang saya ingat aplikasi itu menggunakan alamat http://127.0.0.1:55555, nah berbekal port 55555 saya mencari di google, dan ternyata itu adalah Metasploit Framework!.
Peristiwa itu menginspirasikan saya untuk mengenang masa-masa lalu ketika masih seneng2nya ngoprek dan belum ‘tercemar’ oleh DotA. Akhirnya sekarang saya ingin belajar ngoprek lagi, tp lebih fokus ke exploitnya saja. Tulisannya ini akan saya buat menjadi tiga bagian. Bagian pertama mengenai bagaimana salah satu cara umum yang dilakukan untuk menge-hack suatu system. Disini saya lebih menitikberatkan untuk hacking OS Windows XP, karena OS ini paling banyak dipakai orang. Bagian kedua lebih banyak ke teori mengenai exploit. Tapi karena mungkin akan sangat sulit dipahami (saya sendiri msh blm bisa membuat exploit sendiri), saya hanya menuliskan hasil terjemahan yang membahas apa itu dan cara kerja exploit. Sedangkan bagian terakhir merupakan praktek bagaimana mengelakukan penetration test menggunakan metasploit di Windows XP.
Bagian 1
*ini merupakan artikel lama mengenai salah satu cara umum yang dilakukan untuk hacking. (artikel ini jg di mirror oleh Negative a.k.a Jim Geovedi di sini). Langkah dibawah ini merupakan cara ’standar’, hacking sebenarnya tidak harus selalu sesuai dengan ’standar’ ini.
Hacking buat pemula
- by aCh
Artikel ini ditujukan bagi pemula, dan disusun oleh pemula. Ditulis untuk pengetahuan semata. Untuk temen2 yg udah ahli, sok aja dilewat, tapi dibaca juga gpp….
Apa sebenarnya hacking itu? klo menurut pengertian gue, hacking adalah ngoprek. Yup, hacking adalah ngoprek, mempelajari sesuatu dengan keingintahuan (curiosity) yg tinggi, ngutak atik sesuatu, ‘ngudek-ngudek’ sampai ke ‘jeroannya’. Sesuatunya apa dong? ya terserah… bisa komputer, mobil, motor, mesin. Tapi masalahnya ada ngga ya hacker mobil, hacker motor, atau hacker pesawat terbang?? hehe… Walaupun saat ini hacking identik dengan ‘bobol-membobol’, tapi gue kurang setuju klo cuman bobol server orang doang!. Ada yang bilang ‘Hacking is Art’, trus dimana letak seninya dong? Mau tau pengertian hacking sebenarnya, coba baca artikel sebelumnya (How to Become A Hacker). Di situ dijelasin bahwa hacker berkaitan dengan kemahiran teknis serta kegemaran menyelesaikan masalah dan mengatasi keterbatasan. Contoh hacker pada saat ini yang sering-sering disebut adalah Linus Torvald (tau ngga? itu lho yang menciptakan Linux). Apa dia tukang bobol? belum tentu kan….
Pada artikel ini, gue pengen membagi pengalaman mengenai Hacking, walaupun sampai saat ini gue belum pernah nge-Hack ke server orang. Salah satu cara untuk mencoba simulasi Hack yaitu H3cky0uRs3lf! Buat komputer kita sebagai server (sekaligus belajar konfigurasi server) trus install program yg dibutuhkan. Misalnya klo mo Web Hacking, coba install Apache atau IIS. Atau kita sesuaikan dengan exploit yang udah kita dapet. Tapi lebih baik install Linux atau FreeBSD dulu di komputer pribadi, trus konfigurasi sebagai server, lalu simulasi Hack, setelah itu baru Hack Betulan… Apalagi klo di kost ada jaringan.
Pro dan Kontra Hacking
Pro
Kontra
Etika Hacking
Semua informasi adalah free
Jika semua informasi adalah free, maka tidak ada ladi privacy
Aspek Security
Intrusion adalah ilustrasi kelemahan sistem
Tidak perlu menjadi pencuri untuk menunjukkan pintu yang tidak terkunci
Idle Machines
Hacking hanya pada idle machines
idle machines milik siapa ?
science education
hanya membobol tapi tidak merusak
“hacker wannabe” berpotensi sangat besar untuk merusak
Okeh, sekarang waktunya melakukan aksi…
1. Fase Persiapan
~ Mengumpulkan informasi sebanyak-banyaknya
- Secara Aktif : - portscanning
- network mapping
- OS Detection
- application fingerprinting
Semua itu bisa dilakukan menggunakan toolz tambahan seperti nmap atau netcat
- Secara Pasif : - mailing-list (jasakom, newbie_hacker, hackelink, dsb)
- via internet registries (informasi domain, IP Addres)
- Website yang menjadi terget
2. Fase Eksekusi
~ Setelah mendapatkan informasi, biasanya akan didapatkan informasi mengenai OS yg digunakan, serta port yang terbuka dengan daemon yg sedang berjalan. Selanjutnya mencari informasi mengenai vulnerability holes (celah kelemahan suatu program) dan dimanfaatkan menggunakan exploit (packetstromsecurity.org, milw0rm, milis bugtraq, atau mencari lewat #IRC).
~ Mengekspolitasi Vulnerability Holes
- compile eksploit -> local host ->
$gcc -o exploit exploit.c
$./exploit
# hostname (# tanda mendapatkan akses root)
remote host -> $gcc -o exploit exploit.c
$./exploit -t www.target.com
# (klo beruntung mendapatkan akes root)
~ Brute Force
- Secara berulang melakukan percobaan otentifikasi.
- Menebak username dan password.
- Cracking password file
~ Social Engineering
- Memperdayai user untuk memeberi tahu Username dan password
- Intinya ngibulin user….
3. Fase Setelah Eksekusi
~ Menginstall backdoor, trojans, dan rootkit
~ Menghapus jejak dengan memodifikasi file log agar tidak dicurigai admin
~ Menyalin /etc/passwd atau /etc/shadow/passwd
Nah, intinya seh cara masuk ke server seseorang seperti fase diatas. Mencari informasi, temukan exploit, dan tinggalkan backdoor. Cuma masalahnya hacking bukanlah segampang cara-cara diatas. Itu hanyalah teori, banyak hal yang harus diperhatikan jika ingin mempraketekkan hacking ke server seseorang. Jangan sekali-kali mencoba2 hacking ke server orang tanpa memperhatikan anonimitas (apalagi klo connectnya lewat komputer pribadi tanpa menggunakan proxy). Ntar klo ketahuan bisa repot. Saran gue, cobalah pada mesin localhost dulu (komuter pribadi), klo terhubung ke LAN lebih bagus. Sediakan server yang khusus buat dioprek. Kalaupun pun ga terhubung ke jaringan, kita masih bisa menggunakan Virtual Machine menggunakan VMWare seperti yang nanti akan dibahas pada bagian 3!
Referensi :
-Hacking and Defense, Jim Geovedi, negative@magnesium.net
-Network Defense, Jim Geovedi, negative@magnesium.net
Belajar Hack (2) - What is an Exploit?
8 11 2006
*This article originally was written by Pukhraj Singh, K.K. Mookhey, you can get it from here. I am just repost and summarize it so you can understand what is an exploit. I’m sorry not to translate this article into Bahasa Indonesia coz I’m too lazy. Maybe you want to help us to translate it? :-)
Exploit
sploit
(n.) Exploit. A defect in the game code (see bug) or design that can be used to gain unfair advantages. (Source: Dictionary of MMORPG Terms)
At present the exploit development community (hackers and security professionals alike) is more sentient than ever before. The timeline between the release of an advisory and the development of an exploit has shrunk to a great extent. Exploit development, which was considered more of Wiccan art, has reached large masses. The network security administrator needs to be more vigilant then ever before as the enemy is always one step ahead with the latest exploit in his hand.
Memory organization
The basic exploitation techniques can be methodically categorized, like any other technical issue. Before going further, however, the reader must be aware of the basic process of memory organization. A process running in memory has the following sub-structures:
Code is the read-only segment that contains the compiled executable code of the program.
Data and BSS are writable segments containing the static, global, initialized and un-initialized data segments and variables.
Stack is a data structure based on Last-In-First-Out ordering. Items are pushed and popped from the top of the stack. A Stack Pointer (SP) is a register which points to the top of the stack (in most cases). When data is pushed on the stack, SP points to (the top of the stack). Stack grows towards negative memory addresses. It is used for storing the context of a process. A process pushes all its local and dynamic data on to the stack. Instruction Pointer (IP) is a register used to point to the address of the next instruction to be executed. The processor looks at IP each time to find the next instruction to be executed. When an abrupt program redirection takes place (generally due to jmp or call) the address of the next instruction, after returning back from redirection, can be lost. In order to overcome this problem the program stores the address of the next instruction to be executed (after returning from jmp or call) on the stack, and it is called the return address (implemented through assembly instruction RET). This is how a normal program containing many function calls and goto instructions keeps track of right path of execution.
Heap is basically the rest of the memory space assigned to the process. It stores data which have a lifetime in between the global variables and local variables. The allocator and deallocator work to assign space to dynamic data and free heap memory respectively.
This was a brief fly-over on the basics of process organization. Now I describe some techniques recurrently used to abuse the harmony of process organization.
Buffer overflows
The word gives goose bumps to any person who has dealt with them, be it a coder, an application tester or the security administrator. Some say it’s the biggest security risk of the decade. The technique of exploitation is straightforward and lethal. The stack of the program stores the data in order whereby the parameters passed to the function are stored first, then the return address, then the previous stack pointer and subsequently the local variables. If variables (like arrays) are passed without boundary checks, they can be overflowed by shoving in large amounts of data, which corrupts the stack, leading to the overwrite of the return address and consequently a segmentation fault. If the trick is craftily done we can modify the buffers to point to any location, leading to capricious code execution.
Heap overflows
The allocated memory in a heap is organized as a doubly linked list. By performing an overflow we can modify the pointers of the linked list to point into memory. Heap overflows are hard to exploit and are more common in Windows as they contain more prominent data which can be exploited. In the case of a malloc memory allocation system, the information regarding the free and allocated memory is stored within the heap. An overflow can be triggered by exploiting this management information such that we can write to random memory areas afterwards, which can lead to code execution.
So how is the overflow triggered? There are many weapons in the stockpile like strings and string functions, format strings, null pointers, integer overflows, signed issues and race conditions which can be a help to generate exceptional conditions in a process.
I stress the fact that this article was not meant to be a definitive guide to various exploitation techniques. We only provide a quick overview of what is important, in order to get a solid understanding of the things to come in subsequent parts of this article. They just act as pointers for further reference
The Birth of an Exploit
Exploit development tools and automated frameworks for exploit testing and simulation is the need of the hour. Metasploit Framework (MSF) is something which fits the bill. Its latest release has the agility and muscle quite comparable to its high priced commercial counterparts and the lethality to code an exploit in the shortest possible timeframe, due to a very well defined interface for development.
read by :http://spinx21.blogspot.com