Super cool !!!!! Winsocket Interception

Source: Internet
Author: User
 

Practical Skills

Intercepted winsocket, automation Research Institute, Fuzhou University
Lin Yi

---- The TCP/IP protocol is the main communication protocol of various network operating systems and the Internet communication protocol. The Win95/NT platform provides the function library winsocket (wsocket) to implement the TCP/IP protocol. DLL), so you can use winsocket to write an application system based on TCP/IP protocol. (UNIX platform provides BSD-SOCKET)

---- In actual application development, we always hope to implement special processing before calling normal winsocket interface functions, such as when developing VPN Client Software Based on Win95/NT platform, we want the application information to be encrypted before being sent, that is, before calling the send function. If some application systems call the connect function for connection requests, we need to intercept the call and insert our own identity authentication. Module. A normal connect function can be called only when the identity is valid. If the identity is invalid, the connect function is not called. Therefore, we need to develop an intercept winsocket method to intercept winsocket function calls, so that we can call our identity authentication module and encryption and decryption module before the Winsock normal function call. Because winsocket on Win95/NT platform is provided in the form of dynamic connection library (DLL), various application systems do not need to be modified during TCP/IP protocol communication, call our application module to achieve application transparency.

---- It is generally necessary to intercept the call of the dynamic library (DLL). You can use the hook technology or the outsourcing DLL technology to rename the original dll library (for example, change the Winsock library wsock32.dll to. DLL), create a dll library, wsocket32.dll, and call the old dll library in the new dll library.

---- The following provides the source code of the application that uses Visual C ++ to intercept Winsock. Zip 4kb

---- Name the Winsock library wsock32.dll AAA. dll and wsock32.aaa first.

---- Use visual c ++ to create a DLL project wsock32.dll

---- The added module is a log processing module.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.