Sunday, December 27, 2015

Open a port on Windows firewall C

If you need to open a port on the firewall in later versions of windows. But you'll have to be admin for it work. So not without some other shellcode. C and C++ are pretty much the same here.

C++

 #include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

int main()
{

system("netsh advfirewall firewall add rule name=\"Open Port 9999\" dir=in action=allow protocol=TCP localport=9999");

    return 0;

C
#include <stdio.h>
#include <stdlib.h>

int main()
{
system("netsh advfirewall firewall add rule name=\"Open Port 9999\" dir=in action=allow protocol=TCP localport=9999");
    return 0;
}

No comments:

Post a Comment