Shipwreck

admin 2023年1月15日01:21:21评论77 views字数 3364阅读11分12秒阅读模式

这个工具实际在22年年初就写完了,现在才上传到Github,是因为目前的工作实际上大部分时间都在二线,以及以当前所掌握的知识没办法继续更新了,当然有一些零碎的点没有加到工具里,比如IAT导入表擦除等,后续如果学到了新的知识再来继续写下去。也希望有兴趣的同伴一起来改,比如用python/go等语言执行shellcode

Input a raw file to bypass av and execute.

一个只需要提供shellcode文件的免杀框架,可输出exe/dll/ps1

编译需要mingw套件

Shipwreck
Usage
usage:____ _     _ ____ _     ____ _____ ____ _ __/ ___/  /|/ / __/  /|/ __/ __//   _Y |/ /|   | |_||| || /|| | ||| /||  | / |   /___ || | ||| || __/| |/|||   /| /_ | _|   \____/_/ |_/_/   _/ |_/_\____\____|_|_By: BlueWhaleLab@王半仙Input a raw file to bypass av and execute.optional arguments: -h, --help           show this help message and exit -f FILENAME, --filename FILENAME                      Provide a shellcode in raw format. -e ENCRYPTTYPE, --encryptType ENCRYPTTYPE                      Shellcode encryption method(e.g. b64, xor, aes, uuid, mac, ipv4, diy...) --alloc ALLOC         Function for allocating memory(e.g. Virtualalloc, MapViewOfFile, malloc...) --callback CALLBACK   Callback function used to execute your shellcode. --syscall             Replace VirtualAlloc, the VritualProtect function is called by syscall.(Only x64) --bit BIT             Is the shellcode 32-bit or 64-bit? Default is x64. (e.g. x86/x64) --script SCRIPT       Generate binary file type. (e.g. cpp/dll) --obf                 Powershell file easyObf...
Filename
默认为payload.bin, raw格式
-f FILENAME, --filename FILENAME                      Provide a shellcode in raw format.
EncryptType
当前只完成了b64、xor、uuid、mac、ipv4。aes尚未完成、diy自己写算法。
该参数为必选
-e ENCRYPTTYPE, --encryptType ENCRYPTTYPE Shellcode encryption method(e.g. b64,xor,aes,diy...)
  • Base64
  • Xor
  • Aes
  • Uuid
  • Mac
  • IPv4
  • DIY
Alloc

默认申请内存为VirtualAllocExNuma,不可与syscall同用

申请内存方式参考Schrodinger-s-Cat,malloc,calloc,MapViewOfFile申请内存方式存在问题,有成功了的交流一下

--alloc ALLOC Function for allocating memory(e.g. Virtualalloc, HeapAlloc)
  • VirtualAllocExNuma
  • Virtualalloc
  • HeapAlloc
  • Malloc
  • Calloc
  • MapViewOfFile
CallBack

选定回调函数、template目录下的cpp皆可,可自己添加,默认为CertEnumSystemStore

当前有36个可用callback,用来代替经典的CreateThread来执行shellcode

--callback CALLBACK Callback function used to execute your shellcode.
  • CertEnumSystemStore
  • CertEnumSystemStoreLocation
  • CopyFile2
  • CreateThreadPoolWait
  • CreateTimerQueueTimer
  • CryptEnumOIDInfo
  • EnumChildWindows
  • EnumDesktopWindows
  • EnumDesktopsW
  • EnumDirTreeW
  • EnumDisplayMonitors
  • EnumFontFamiliesExW
  • EnumFontFamiliesW
  • EnumFontsW
  • EnumLanguageGroupLocalesW
  • EnumObjects
  • EnumPageFilesW
  • EnumPropsExW
  • EnumPropsW
  • EnumPwrSchemes
  • EnumResourceTypesExW
  • EnumResourceTypesW
  • EnumSystemLocalesEx
  • EnumTimeFormatsEx
  • EnumUILanguagesW
  • EnumWindowStationsW
  • EnumWindows
  • EnumerateLoadedModules
  • ImageGetDigestStream
  • ImmEnumInputContext
  • InitOnceExecuteOnce
  • SetTimer
  • SetupCommitFileQueueW
  • SymEnumProcesses
  • SymFindFileInPath
  • VerifierEnumResource
Syscall
修改VirtualAlloc、VritualProtect为syscall调用,仅支持64位
使用了SysWhispers2项目生成syscall.h,有精力可以用SysWhispers3重新生成一个,SysWhispers3已支持32位
--syscall Replace VirtualAlloc, the VritualProtect function is called by syscall.(Only x64)
BIT
shellcode位数,32位需更换output/lib下sdk为32位,目前放的都是64位的
默认为64位
--bit BIT Is the shellcode 32-bit or 64-bit? Default is x64. (e.g. x86/x64)
Script
输出结果类型 exe/dll/ps1,默认为exe
--script SCRIPT Generate binary file type. (e.g. cpp/dll/ps1)
  • cpp
  • dll
  • ps1
EXE

不指定--script默认为exe,切换到output目录下,使用输出信息中的Compile-Command编译即可

gcc去除黑窗口:-mwindows
Shipwreck
DLL
指定--script为dll,切换到output目录下,使用输出信息中的Compile-Command编译即可
生成的dll导出函数为StartW
Shipwreck
PS1
指定--script为ps1, 可使用--obf参数对生成的ps1文件进行混淆
Shipwreck
Technology
  • Shellcode加密,应对静态查杀
  • 同功能可替代api替换,应对api hook
  • ...
Update
[2022-03-14 1.1.1] 增加输出ps1功能,使用--script ps1参数,默认为ps1
[2022-02-24 1.1.0] 增加输出dll功能,使用--script dll参数,默认为cpp
[2022-01-17 1.0.2] 增加VirtualAlloc、HeapAlloc申请内存方式,使用--alloc参数
[2022-01-01 1.0.1] 增加uuid、Mac、ipv4内存加载,使用-e参数
[2021-12-15 1.0] Shipwreck1.0完成
22年年初刚写完这个框架的测试图
Shipwreck
TODO
1.完善AES加密
2.添加内存混淆
3.输出vba、ps1、py等脚本
4....
不要传VT/WB...!
不要传VT/WB...!
不要传VT/WB...!

下载地址:

https://github.com/Awrrays/Shipwreck

原文始发于微信公众号(仙友道):Shipwreck

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年1月15日01:21:21
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Shipwreckhttp://cn-sec.com/archives/1518150.html

发表评论

匿名网友 填写信息