🔍 Socket-Level Traffic Interceptor & Manipulator (Windows)
NetMimic is a C++ DLL that leverages MinHook to intercept Winsock API calls (send, recv, WSASend, WSARecv) inside Windows processes.
It enables developers and researchers to inspect, log, and modify network traffic (e.g., HTTP over raw sockets) in real time according to configurable rules.
- ✅ Hooks Winsock functions:
send,recv,WSASend,WSARecv. - ✅ Console output of all intercepted traffic (sent & received).
- ✅ Mimification engine:
- Block or alter packets in-flight.
- Replace responses with custom payloads.
- Rule-driven transformations via
mimificado.map.
- ✅ Automatic
Content-Lengthrecalculation to avoid protocol errors. - ✅ Configurable behavior through
config.ini. - ✅ Optional persistent logging of all original traffic (
original.log).
NetMimic/
├── hook.cpp/.h # Hooking logic (send/recv/WSA* wrappers)
├── mimic.cpp/.h # Rule processing (mimification engine)
├── config.cpp/.h # INI configuration management
├── logger.cpp/.h # Logging system
├── utils.cpp/.h # Utility functions
├── dllmain.cpp # DLL entry point
├── config.ini # Runtime configuration
└── mimificado.map # Rule definitions for manipulation
-
Clone the repository:
git clone https://github.com/dahaka637/NetMimic.git cd NetMimic -
Open in Visual Studio
- Project type: DLL
- Target: x64 (or x86 depending on the target process)
- Link with
ws2_32.lib
-
Build → Generates
NetMimic.dll. -
Inject the DLL into a target process
- Example tools: Process Hacker, dllinjector.
- On successful injection, a console window will appear showing intercepted traffic.
Automatically created on first execution:
[GENERAL]
Intercept=1
LogOriginal=1- Intercept:
1enables packet manipulation;0only logs. - LogOriginal:
1saves all original traffic intooriginal.log.
Defines conditions and transformations for traffic modification.
[ENVIADO]
keyword1,keyword2
->
[RECEBIDO]
{"status":"success","message":"Fake response","token":"abc123"}- [ENVIADO] → [[ENVIADO]]: replace outgoing packet.
- [RECEBIDO] → [[RECEBIDO]]: replace incoming packet.
- [ENVIADO] → [RECEBIDO]: trigger on outgoing pattern → replace next response.
- [RECEBIDO] → [RECEBIDO]: transform incoming packets directly.
[RECEBIDO]
error,not found
->
[[RECEBIDO]]
{"status":"success","message":"forced ok"}This transforms any response containing error or not found into a success JSON.
[SEND] (127 bytes)
{"key":"123","product":"autogk","hwid":"abcd"}
[RECV] (125 bytes)
HTTP/1.1 200 OK
Content-Type: application/json
[Mimic] Blocking RECEIVED and replacing with fake response.
[INTERCEPTED → RECV modified]
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 120
{"status":"success","message":"License validated successfully","token":"abc123"}
- Interception occurs before TLS decryption. If the target process uses SSL/TLS, captured data will appear encrypted.
- To analyze TLS traffic:
- Use a proxy (Burp Suite, Fiddler, mitmproxy), or
- Enable
SSLKEYLOGFILEin the target process to export session keys for Wireshark.
- Ideal use cases: debugging, protocol reverse engineering, educational research.
This project is intended only for educational and research purposes.
Using NetMimic on software or systems without explicit permission may be illegal.
Always restrict usage to controlled environments or your own applications.
MIT License — Free to use, modify, and distribute with proper attribution.