All Projects → wbenny → Ksocket

wbenny / Ksocket

Licence: mit
KSOCKET provides a very basic example how to make a network connections in the Windows Driver by using WSK

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Ksocket

Winspd
Windows Storage Proxy Driver - User mode disk storage
Stars: ✭ 335 (+83.06%)
Mutual labels:  driver, kernel
Ntphp
Ever wanted to execute PHP in your kernel driver? Look no further!
Stars: ✭ 76 (-58.47%)
Mutual labels:  driver, kernel
Pplkiller
Protected Processes Light Killer
Stars: ✭ 453 (+147.54%)
Mutual labels:  driver, kernel
KDBG
The windows kernel debugger consists of two parts, KMOD which is the kernel driver handling ring3 request and KCLI; the command line interface for the driver. It originated due to insufficient useability with CheatEngine's DBVM driver while debugging games running under certain AntiCheat software.
Stars: ✭ 28 (-84.7%)
Mutual labels:  kernel, driver
Af ktls
Linux Kernel TLS/DTLS Module
Stars: ✭ 124 (-32.24%)
Mutual labels:  socket, kernel
Razer Laptop Control
Project to create driver/software to control performance of razer laptops
Stars: ✭ 268 (+46.45%)
Mutual labels:  driver, kernel
Ioctlbf
Windows Kernel Drivers fuzzer
Stars: ✭ 170 (-7.1%)
Mutual labels:  driver, kernel
Driver.NET
Lightweight and flexible library to load and communicate with kernel drivers on Windows.
Stars: ✭ 59 (-67.76%)
Mutual labels:  kernel, driver
Hacksysextremevulnerabledriver
HackSys Extreme Vulnerable Windows Driver
Stars: ✭ 1,330 (+626.78%)
Mutual labels:  driver, kernel
Windows Kernel Explorer
A free but powerful Windows kernel research tool.
Stars: ✭ 1,299 (+609.84%)
Mutual labels:  driver, kernel
Cat-Driver
CatDriver - The Kernel Mode Driver that written in C++. It is an useful driver and has the highest privilege level on the Windows platform. It can be used for Game Hacking and others.
Stars: ✭ 41 (-77.6%)
Mutual labels:  kernel, driver
Pubg Pak Hacker
use windows kernel deriver hidden file and itself to Bypass BE
Stars: ✭ 157 (-14.21%)
Mutual labels:  driver, kernel
pps-gen-gpio
Linux kernel PPS generator using GPIO pins
Stars: ✭ 25 (-86.34%)
Mutual labels:  kernel, driver
Winfsp
Windows File System Proxy - FUSE for Windows
Stars: ✭ 4,071 (+2124.59%)
Mutual labels:  driver, kernel
pearlfan
GNU/Linux kernel driver and libusb app for a Pearl's USB LED fan
Stars: ✭ 20 (-89.07%)
Mutual labels:  kernel, driver
Hidden
Windows driver with usermode interface which can hide objects of file-system and registry, protect processes and etc
Stars: ✭ 768 (+319.67%)
Mutual labels:  driver, kernel
w1-gpio-cl
Command line configured kernel mode 1-wire bus master driver. w1-gpio standard Linux module enhancement/substitution.
Stars: ✭ 17 (-90.71%)
Mutual labels:  kernel, driver
KMAC
Some usefull info when reverse engineering Kernel Mode Anti-Cheat
Stars: ✭ 31 (-83.06%)
Mutual labels:  kernel, driver
Deos
The distributed exokernel operating system
Stars: ✭ 80 (-56.28%)
Mutual labels:  driver, kernel
Awesome Windows Security Development
awesome-windows-security-development
Stars: ✭ 154 (-15.85%)
Mutual labels:  driver, kernel

KSOCKET

KSOCKET provides a very basic example on how to make a network connections in the Windows Driver by using WSK.

Why?

In my opinion there aren't too much examples on WSK on the Internet. This is quite understandable, as generally dealing with networking in the kernel-mode isn't a very good idea. However, sometimes, you're just too interested how it can be done.

What does it do?

It makes a HTTP GET request to the httpbin.org/uuid and prints the response to the debugger. Then, it creates a TCP server listening on port 9095 and waits for a client. When the client connects, it waits for a single message, prints it to the debugger and then responds with Hello from WSK! and closes both client and server sockets.

The output in the debugger might look like this:

windbg

Implementation

Because everyone is familiar with the Berkeley socket API, I've ported a very small subset of it - enough to make a basic TCP/UDP client/server:

int getaddrinfo(const char* node, const char* service, const struct addrinfo* hints, struct addrinfo** res);
void freeaddrinfo(struct addrinfo *res);

int socket_connection(int domain, int type, int protocol);
int socket_listen(int domain, int type, int protocol);
int socket_datagram(int domain, int type, int protocol);
int connect(int sockfd, const struct sockaddr* addr, socklen_t addrlen);
int listen(int sockfd, int backlog);
int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
int send(int sockfd, const void* buf, size_t len, int flags);
int sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);
int recv(int sockfd, void* buf, size_t len, int flags);
int recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen);
int closesocket(int sockfd);

You can probably see the biggest difference between this API and the original Berkeley socket API - instead of a single socket() function, there are socket_connection(), socket_listen() and socket_datagram() functions. This is because in WSK, you have to specify type of the socket when the socket object is created. Although it would probably be possible with some workarounds to make just single socket() function, for simplicity of the implementation I've decided to split it too.

NOTE: This project is purely experimental and its goal is to show basic usage of the WSK. There aren't many error checks and it is not recommended for production use.

License

This software is open-source under the MIT license. See the LICENSE.txt file in this repository.

Dependencies are licensed by their own licenses.

If you find this project interesting, you can buy me a coffee

  BTC 3GwZMNGvLCZMi7mjL8K6iyj6qGbhkVMNMF
  LTC MQn5YC7bZd4KSsaj8snSg4TetmdKDkeCYk
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].