ws2_32.dll替换和数据包加密 [英] ws2_32.dll replacement and packet encryption

查看:125
本文介绍了ws2_32.dll替换和数据包加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一次在这里发帖...

基本上,我有一个大学项目...我有一个创建通用的dll库的想法,以加密两个不同程序之间的连接数据包...由于我的讲师更喜欢这样,以便可以在尽可能多的程序中使用,我不能简单地将此代码嵌入任何程序源中,因为当今大多数程序都是封闭源代码...

在许多Google搜索之后,我意识到大多数基于Windows的网络程序都利用套接字Windows dll(WS2_32.DLL)...由此,我有了一个主意(Eureka!)...

我已经试过了:
一个.使用十六进制程序打开任何可执行程序...搜索WS2_32.dll,并将其替换为encryp.dll ...在大多数情况下,如果该程序使用WS2_32.dll,则可以找到字符串...
b.从您的system32文件夹中复制原始WS2_32.dll,并将其粘贴到与可执行程序相同的路径中,并将其重命名为encryp.dll ...现在,该程序使用encryp.dll而不是WS2_32.dll ...

因此,总而言之,我的目标是创建一个dll库:
1.基本上充当程序(已由该库注入)和WS2_32.dll之间的发送/接收加密代理.此库必须具有功能且行为类似于WS2_32.dll,因此注入的程序不会强制关闭...这样,如果我在客户端和服务器上都使用相同的dll库,则它可以在它们之间提供加密连接(特别是如果我在库源代码中重新指定加密密钥)...

2.如果该库发现它是从列入黑名单的可执行文件或非列入白名单的可执行文件中加载的,则会自行关闭...黑名单/白名单已在源代码中列出...那是因为如果有任何程序可以使用这个库,它将杀死该项目的安全目标(例如,创建一个数据包转储程序并仅使用该库)……而且我希望我们不要使用诸如GetProcessName()之类的东西,因为任何程序可以重命名(也许是内部名称?)

3.当由合法程序加载时,如果发现任何列入黑名单的可执行文件/库,它将关闭自身以及合法程序...与上述目的相同...

4.首选使用不带任何.NET框架或VCRedist依赖项的C/C ++进行编码,因为此程序的目标之一是可以在尽可能多的环境中使用...例如,可以裸露地打开它.未安装.NET或VCRedist的WindowsXP ...但是现在我只有Visual C ++ 2010,可以这样做吗?还是可以将我指向另一个编译器程序(例如VC6,TurboC?)?

最后但并非最不重要的一点,谢谢您的关注,非常感谢:)

Hi, first time posting here...

Basically, I have an university project... I have an idea to creates an universal dll library to encrypt a connection packet between two different programs... Since my lecturer prefers so that it can be used in as many program as possible, I can''t simply embed this code into any program source, since most of the program nowadays is closed-source...

After many google searching, I realized that most windows-based network programs utilizes socket windows dll (WS2_32.DLL)... From this, I have an idea (Eureka!)...

I have tried this:
a. open any executable program using hex program... Search for a WS2_32.dll and replace it to encryp.dll... In most cases the string can be found if that program uses WS2_32.dll...
b. copy original WS2_32.dll from your system32 folder and paste it in the same path as the executable program, and rename it to encryp.dll... Now the program uses encryp.dll instead of WS2_32.dll...

So in summary, I have a goal to create a dll library that:
1. basically acts as an send/receive encryption proxy between a program (which has been injected by this library) and WS2_32.dll... This library must have a function and behaves like WS2_32.dll so an injected program will not force close... This way, if I uses the same dll library in both client and server, it can serves an encrypted connection between them (especially if I rephrase the encrypt key in library source code)...

2. will close itself if this library found that it''s being loaded from a blacklisted executables or from other than whitelisted executables... Blacklist/whitelist is listed in source code... That''s because if any program can use this library, it would kill the purpose of security goals of this project (for example, create a packet dump program and just use this library)... And I hope we''re not using something like GetProcessName(), because any program can be renamed (maybe internal names?)

3. when being loaded by legal program, if it founds any blacklisted executable/library, it will close itself and also the legal program... Same purposes as above...

4. preferred to be coded using C/C++ without any .NET framework or VCRedist dependencies, because one of the goal of this program is that it can be used in many environments as possible... For example, it can be opened in bare WindowsXP without .NET or VCRedist installed... But now I only have Visual C++ 2010, is that possible to do it? Or can you point me to another compiler program (like VC6? TurboC?)?

Last but not least, thank you for your attention, really appreciate it :)

推荐答案

但是现在我只有Visual C ++ 2010,可以这样做吗?

是的,VC ++ 2010 Express可以完成C ++中所需的一切.唯一缺少的是资源编辑器,因此您必须手动或使用免费软件来创建资源.
But now I only have Visual C++ 2010, is that possible to do it?

Yes, VC++ 2010 Express can do everything that you need in C++. The only bits missing are the resource editors, so you have to create your resources by hand or with freeware.


这篇关于ws2_32.dll替换和数据包加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆