【文件属性】:
文件名称:safeIO:尝试使用SGX保护Windows中的程序
文件大小:90KB
文件格式:ZIP
更新时间:2021-05-13 05:45:18
C++
为了信安吹逼大赛 (凉了)
初步构想
hook程序的read,send,recv调用,拦截程序的IO,对数据进行加解密来实现对程序的保护
细节
网络
loader会将程序启动,并且将hookdl注入
hookdl在加载的时候会加载hook
在第一次调用hook函数的时候sgx会进行初始化操作
sgx初始化操作无法在dllmain中完成,具体见手册
初始化的过程中会和服务器交换通信用的密钥(这个地方目前还不是很完善)
完成之后会将程序所有流量用这个密钥加密之后发送给中转服务器
中转服务器根据交换密钥时的token信息获取对应的密钥(不完善)
中转服务器将流量解密之后转发给真正的服务器
真正的服务器传回的消息又会被中转服务器加密之后发给应用程序
读写
目前读文件时解密的密钥还是硬编码,需改进。
工程划分
loader:加载程序
hookdl:注入用dll
safeIO:sgx内部代码
serv
【文件预览】:
safeIO-master
----.gitignore(4KB)
----dlltest()
--------ReadMe.txt(1KB)
--------stdafx.h(219B)
--------stdafx.cpp(203B)
--------dlltest.vcxproj(8KB)
--------targetver.h(232B)
--------dlltest.vcxproj.filters(1KB)
--------dlltest.cpp(1KB)
----hookdl()
--------ReadMe.txt(1KB)
--------dllmain.cpp(808B)
--------stdafx.h(299B)
--------safeIO_u.h(2KB)
--------stdafx.cpp(202B)
--------sgx_untrusted.h(38B)
--------sgx_process.h(490B)
--------hookdl.cpp(14KB)
--------targetver.h(232B)
--------safeIO_u.c(7KB)
--------hookdl.vcxproj.filters(2KB)
--------hookdl.vcxproj(25KB)
--------sgx_untrusted.cpp(50B)
--------sgx_process.cpp(3KB)
--------hookdl.h(3KB)
----server()
--------token.pyc(1KB)
--------server.pyproj(2KB)
--------token.py(495B)
--------rsakey.pem(2KB)
--------portforward.py(10KB)
--------server.py(2KB)
--------portforward.pyc(10KB)
--------pysm4()
----safeIO.sln(11KB)
----readme.md(1KB)
----loader()
--------ReadMe.txt(1KB)
--------loader.cpp(3KB)
--------stdafx.h(219B)
--------stdafx.cpp(202B)
--------loader.vcxproj.filters(1KB)
--------targetver.h(232B)
--------loader.vcxproj(8KB)
----sgxtest()
--------ReadMe.txt(1KB)
--------test_untrusted.cpp(1KB)
--------stdafx.h(219B)
--------safeIO_u.h(2KB)
--------sgxtest.vcxproj(23KB)
--------stdafx.cpp(203B)
--------sgxtest.vcxproj.filters(2KB)
--------targetver.h(232B)
--------safeIO_u.c(7KB)
--------test_untrusted.h(449B)
--------sgxtest.cpp(1001B)
----safeIO()
--------ReadMe.txt(1KB)
--------TLSserver.cpp(6KB)
--------TLSclient.cpp(4KB)
--------sm2.cpp(2KB)
--------safeIO.edl(975B)
--------sm3.cpp(4KB)
--------ecc.h(814B)
--------safeIO.cpp(2KB)
--------cpp_int.cpp(4KB)
--------sm4.hpp(407B)
--------init_check.h(612B)
--------safeIO.vcxproj(23KB)
--------sgx_tsgxssl.edl(2KB)
--------init_check.cpp(3KB)
--------cpp_int.h(2KB)
--------safeIO_t.h(2KB)
--------sm4.cpp(5KB)
--------sm4.h(2KB)
--------utils.h(686B)
--------safeIO_t.c(18KB)
--------safeIO.vcxproj.filters(4KB)
--------sm3.h(1KB)
--------safeIO_private.pem(2KB)
--------sm2.h(540B)
--------romangol.h(2KB)
--------safeIO.config.xml(317B)
--------ecc.cpp(4KB)
----.gitattributes(2KB)