Can I Create a VPN application without Virtual miniport driver? - c++

I want to create a simple VPN like with User application. I went though different VPN application software. I can see most of them uses a Miniport Virtual adapter for example: OpenVPN use Windows TAP driver. Another VPN software uses both miniport and a filter driver. Note : Filter driver sends and receives data from the real physical Miniport. Isn't?
Now I am beginner in driver development process. I have some doubts regrading that VPN drivers. If I want to create a simple VPN application in ะก++ on windows environment,
Why most of the VPN software uses a Virtual adapter and filter
driver (optional)?
Is it mandatory to create a Virtual miniport adapter for VPN
application?
Can i create a VPN application with only filter
driver? (reading / writing packets )
If I create a new virtual driver, should I undergo the HLK/HCK driver signing test for windows 10 and onward?

In general unless an operating system exposes APIs through inbuilt filter drivers you do need to create your own. You will further see 2 basic types of usage.
Virtual Miniport/Nic - A VPN connection creates a virtual interface that can then also be referenced in other decisions like the routing table
Inline - These just sit between your the protocol stack and the physical interface and based on its own logic encrypts and redirects them.
That said atleast on Windows you have a few ways to create a VPN app which is user mode based. The newest and most active development is in the UWP api space of Windows.networking.vpn <
https://learn.microsoft.com/en-us/uwp/api/Windows.Networking.Vpn>

Related

Virtual Box multiple remote desktop

Virtual box has a nice feature of running a remote desktop server. This allows one to connect to the virtual machine remotely. However, I cannot find how to make the connection to several desktops of the same machine.
I have several physical screens attached to the PC and, therefore, there are several desktops available in the virtual machine. Whenever I connect to this virtual machine via the remote desktop service of virtual box, it always connects to desktop 1. While using TeamViewer, for example, I can see all the desktops.
Question: Is there a possibility to remotely access all the desktops of the virtual machine? I could not find any information neither in the docs nor in the posts.
Use different Remote Desktop Server Ports in the vm's config.
Then you can connect to several instances.

How VMware components work each other

I am beginner in VMware. I am trying to understand the VMware components and how it works.But I could not understand how vsphere Client access the EXSi host. Is it directly or through the VMWare VCenter server.please give any reference or explanation to get the understanding.
Using vSphere client you can connect to vCenter or directly to host. Of course if host is added to vCenter you should to connect ONLY to vCenter because vCenter should to know about any changes made on hosts. Connecting directly to host should be done ony in emergency situations (e.g. vCenter is down).
V-Center is the umbrella, under which all EXSI can be controlled. We can assume an example of a company where we have 3 physical servers installed ESXi on it and each server has as many processors cores so it can handle 5 virtual machines on it.
Now What is EXSi ---- EXSI is the product/OS/kernel which will allow you to create the environment to run multiple Servers/OS on the same hardware.
V-sphere client/V-sphere Web client --- If you have only one EXSI Server and you want to control that server functionality you need v-sphere because taking direct connection of EXSI Hardware machine will not allow you to do much with it. so the v-sphere client will give you many tools to play with it.
V-Center/VC ----- Now what if when your company has many ESXi servers as we taken for example. V-Sphere can not control all of those into one centralized platform. Here VC comes into play. VC allow you to manage all of these servers under one tool and many other functionalities which are not available in V-Sphere like Distribution switch, V-Motion(Which allow you to migrate one VM machine from Hardware to hardware in the fluctuation of time or not human noticeable time ).

Application specific network interface in CEF3 based application

I am writing a CEF3 based application. I have a requirement, where I can show available network interface and select any of them. Once I have selected the network interface all the traffic should route through that selected network interface. For example if I am having one Ethernet one wifi and one 3G network interface available in my system. and all communication is going through the default which is Ethernet. Now If I select wifi from the application, All communication within the application should go through wifi.
I searched a lot over net and figured out that using bind() function we can bind a specific IP address for communication. But, How can I achieve it in CEF3?
I am new to CEF3 and never written any networking software.
I have already gone through below links-
Using a specific network interface for a socket in windows
https://www.raymond.cc/blog/bind-windows-application-to-specific-network-adapter-with-forcebindip/
TCP/IP connection on a specific interface
I am writing cef3 application in win32/c++ so looking for the same.

Detect devices on local network for client-server connection in C++

I'm trying to implement an auto-connect feature for my Android application DroidPad, which is basically a TCP server running on an Android phone which the PC application connects to.
To make the process easier for the user, is there any way in (portable?) C++ to scan the IP addresses on the local subnet, possibly ones with a certain open port? I've tried using UDP broadcasting, but couldn't get it to work. I'm currently using the wxWidgets toolkit for GUI and libraries.
Any ideas?
I found a solution: wxServDisc. It uses mDNS (aka Zeroconf / Bonjour) to discover devices on a subnet, and is also based on wxWidgets.

Blocking all Windows Internet access from a Win32 app

What would be the simplest way for an application I'm writing to block all Internet access on a Windows machine?
More details:
Windows: XP or higher
Application: A basic Win32 app written in C/C++.
Blocking: It needs to be able to block and unblock at will, ideally in a way that the user can't easily reverse. (By, say, right clicking on a network connection icon in the system tray.) Also, ideally, I'd like the method it uses to allow access to be restored should the user restart Windows or reset the machine, though I'd also be willing to have the app auto launch with Windows and unblock access upon startup if the machine was reset while in a blocked state.
Internet access: Primarily, I'd like to block conventional browsers from hitting conventional http/https sites. Secondarily, it would be nice to block IM clients and client-side social networking apps. It would also be nice, but not required, to still allow local networking for file sharing, etc. (Note that only the first requirement is absolute.)
Final notes: This is not meant to be a security utility, nor will its relationship to the user be adversarial (as, for example, with a parental control utility) so it's not important for it to use a scheme that can't be worked around by a determined user. (Consider that I intend for a reboot or reset to clear the blocking. This means that any workaround a user might discover that would take more effort than this is okay.)
Thanks!
p.s. I suspect that the Windows Firewall API won't work for me because this needs to work for users that haven't enabled the firewall or don't have admin privileges, but I'll be thrilled if I'm corrected on this.
It sounds like you're intending to run applications that you don't want to access the internet. Perhaps you could run them inside a virtual machine such as VirtualBox with networking disabled.
You could do it with a Winsock SPI. The Windows SDK has a sample (under Samples\netds\winsock\lsp) which implements what is called a layered service provider which allows you to hook all the user mode functions provided by Winsock and reject/modify the calls to block network access or redirect traffic to different locations. All installed winsock applications will be affected, so in your code you could have policys for what applications can go out and the like and disabled/enable on the fly. Now a determined person could find ways around this but it would be a pain.
That said this isn't trivial to do but the sample should get you most of the way there.
You cannot effectively or practically write your tool with only a user mode application.
What you need to write is a network I/O stack filter driver. This done by writing a Windows Driver. This is different from a Windows Win32 application. Drivers run in kernel mode and applications run in user mode.
On Windows Vista and later, the kernel mode Network Programming Interface (NPI) is designed for this. This is the same API that Windows Firewalls use. These are sometimes called the Winsock kernel (WSK) APIs.
In effect, you are writing a network firewall (more or less)
here are some links
Introduction to Winsock Kernel (WSK)
Windows Core Networking Blog
The Network Programming Interface Docs on MSDN
Note, your will likely need at least two components
Your driver
A Graphical application that a person can use to control your tool
If you want to do any monitoring, you will likely need a user mode service that collects data from your driver. This works better than trying to do this in the driver. In general, you should do the minimal amount of work in the driver.
A few notes:
You need to be very conscious of security when writing this kind of software. This is very much non trivial. Software that is network facing has the highest security requirements.
Be cognizant of performance.
Your driver and/or service must be aware of the context of a calling application. This is also a security boundary. For example, an application not running as administrator should not be able to control your driver.
take a look at firewall sourcecodes