安界|自动重构Meterpreter绕过杀软·续( 五 )
为了测试一切是否如预期运行 , 我们使用以下测试文件:#include
intmain(intargc,char**argv){MessageBoxA(NULL,"Test","Something",MB_OK);MessageBoxA(NULL,"Anothertest","Anothersomething",MB_OK);return0;}
运行混淆器:./CMakeBuild/avcleaner.bintest/messagebox_simple.c--strings=true--api=true---D_WIN64-D_UNICODE-DUNICODE-D_WINSOCK_DEPRECATED_NO_WARNINGS-I/usr/local/Cellar/llvm/9.0.1-I/Users/vladimir/dev/scrt/avcleaner/Include/msvc-14.15.26726-include-I/Users/vladimir/dev/scrt/avcleaner/Include/10.0.17134.0/ucrt-I/Users/vladimir/dev/scrt/avcleaner/Include/10.0.17134.0/shared-I/Users/vladimir/dev/scrt/avcleaner/Include/10.0.17134.0/um-I/Users/vladimir/dev/scrt/avcleaner/Include/10.0.17134.0/winrt-w-fdebug-compilation-dir-fno-use-cxa-atexit-fms-extensions-fms-compatibility-fms-compatibility-version=19.15.26726-std=c++14-fdelayed-template-parsing-fobjc-runtime=gcc-fcxx-exceptions-fexceptions-fdiagnostics-show-option-fcolor-diagnostics-xc++-ferror-limit=1900-targetx86_64-pc-windows-msvc19.15.26726-fsyntax-only-disable-free-disable-llvm-verifier-discard-value-names-dwarf-column-info-debugger-tuning=gdb-momit-leaf-frame-pointer-v
检查结果:#include
intmain(intargc,char**argv){constcharhid_Someth_lNGj92poubUG[]={'x53','x6f','x6d','x65','x74','x68','x69','x6e','x67',0};constcharhid_Anothe_UP7KUo4Sa8LC[]={'x41','x6e','x6f','x74','x68','x65','x72','x20','x74','x65','x73','x74',0};constcharhid_Anothe_ACsNhmIcS1tA[]={'x41','x6e','x6f','x74','x68','x65','x72','x20','x73','x6f','x6d','x65','x74','x68','x69','x6e','x67',0};typedefint(*_MessageBoxA)(HWNDhWnd,LPCTSTRlpText,LPCTSTRlpCaption,UINTuType);TCHARhid_User___Bhk5rL2239Kc[]={'x55','x73','x65','x72','x33','x32','x2e','x64','x6c','x6c',0};HANDLEhid_hHandl_PFP2JD4HjR8w=LoadLibrary(hid_User___Bhk5rL2239Kc);TCHARhid_Messag_drqxgJLSrxfT[]={'x4d','x65','x73','x73','x61','x67','x65','x42','x6f','x78','x41',0};_MessageBoxAhid_Messag_1W70P1kc8OJv=(_MessageBoxA)GetProcAddress(hid_hHandl_PFP2JD4HjR8w,hid_Messag_drqxgJLSrxfT);TCHARhid_User___EMmJBb201EuJ[]={'x55','x73','x65','x72','x33','x32','x2e','x64','x6c','x6c',0};HANDLEhid_hHandl_vU1riOrVWM8g=LoadLibrary(hid_User___EMmJBb201EuJ);TCHARhid_Messag_GoaJMFscXsdw[]={'x4d','x65','x73','x73','x61','x67','x65','x42','x6f','x78','x41',0};_MessageBoxAhid_Messag_6nzSLR0dttUn=(_MessageBoxA)GetProcAddress(hid_hHandl_vU1riOrVWM8g,hid_Messag_GoaJMFscXsdw);hid_Messag_1W70P1kc8OJv(NULL,"Test",hid_Someth_lNGj92poubUG,MB_OK);hid_Messag_6nzSLR0dttUn(NULL,hid_Anothe_UP7KUo4Sa8LC,hid_Anothe_ACsNhmIcS1tA,MB_OK);return0;}
可以看到 , 字符串混淆和API混淆的组合非常强大 。 字符串“Test”被忽略了 , 因为我们预先决定忽略小字符串 。 然后 , 可以编译混淆后的源代码:$cptest/messagebox_simple.c.patch/tmp/test.c$x86_64-w64-mingw32-gcc/tmp/test.c-o/tmp/toto.exe
在Windows10虚拟机上进行的测试表明 , 程序原本的功能可以正常执行 。 然后通过搜索 , 我们发现混淆后的二进制文件中没有MessageBox字符串:$rabin2-zz/tmp/toto.exe|grepMessageBox|wc-l0概述
在绕过杀软ESETNod32的过程中 , 我们发现隐藏与samlib.dll相关的API导入非常重要 , 尤其是下面列表中的API:SamConnectSamConnectWithCredsSamEnumerateDomainsInSamServerSamLookupDomainInSamServerSamOpenDomainSamOpenUserSamOpenGroupSamOpenAliasSamQueryInformationUserSamSetInformationUserSamiChangePasswordUserSamGetGroupsForUserSamGetAliasMembershipSamGetMembersInGroupSamGetMembersInAliasSamEnumerateUsersInDomainSamEnumerateGroupsInDomainSamEnumerateAliasesInDomainSamLookupNamesInDomainSamLookupIdsInDomainSamRidToSidSamCloseHandleSamFreeMemory
- 极客码头|想更新时还能手动更新,比第三方好用,无后门禁用Win10自动更新
- 裁员|英工程师为公司奉献20年,疫情期间被裁,补偿仅为两支自动铅笔
- 兵器数据库|撑死一年也就130架,为何不能自动化生产?,F-35脉动生产线
- 产业气象站|为什么有时候自动广告会比手动广告效果好?深入解析匹配逻辑
- 天下快谈|欠费3个月后,别以为会被自动注销,使用“实名制”的手机卡
- 中国信息报道|力争成为国内自动灭火装备领域的领导品牌,国安达成功过会
- 微信支付|正式确认!微信这项功能要关闭,避免自动扣钱,望周知
- 幸运番茄|让冠军车手的大脑来改变自动驾驶
- 汽车之家|微博暗示造车 藏33传感器 拥有L4级自动驾驶,索尼剑指特斯拉
- 聚成教育|Excel表格技巧—如何根据单元格大小自动调整文字大小