首页 > 其他分享 >钓鱼攻击第一弹-释放文件

钓鱼攻击第一弹-释放文件

时间:2022-08-28 12:34:42浏览次数:54  
标签:project 释放 const 钓鱼 攻击 char int include buf

钓鱼攻击第一弹-释放文件

之后所有文章发至《熊猫安全》公众号上

获取当前路径

#include <stdio.h>
#include "direct.h"
#define MAX_SIZE 255
int main(int argc, const char* argv[]) 
{
    char buf[MAX_SIZE];
    getcwd(buf, sizeof(buf));
    printf("current working directory : %s\n", buf);
    puts(buf);
    return 0;
}

释放任意资源文件

  1. 首先把需要释放的文件通过winhex打开,然后点击编辑->复制所有->C源码(C)
  2. VS 创建代码->Windows桌面向导->静态库(.lib)
  3. 把第一步获得的C代码添加至项目头文件中,新建头文件MyFile.h

重命名为unsigned char Myfile,里面的数据不能改。

新建源文件project.cpp,写入以下内容

#include "Resour.h"
#include "Myfile.h"
#include <fstream>
using namespace std;

void MyWriteFile(int code,const char *FileName)
{
	ofstream ofs;
	if (code == 1)
	{
		ofs.open(Filename, ios_base::out | ios_base::binary);
		ofs.write((char*)Myfile, sizeof(Myfile));
		ofs.close();
	}
	else if (code == 2)
	{
		MessageBoxW(0, L"释放dll", L"提示", 0);
	}
}

project.h

#pragma once
#include <Windows.h>

void MyWriteFile(int code,const char *FileName);

运行项目,会在Release目录下生成一个Project1.lib。

​4.VS新建一个控制台应用,把project.h、Project1.lib放入目录

导入project.h到头文件,添加Project1.lib到依赖项

main函数代码如下

#include <stdio.h>
#include "direct.h"
#include "project.h"
#pragma warning(disable:4996)
#define MAX_SIZE 255
int main()
{
    char buf[MAX_SIZE];
    const char *name = "\\test.pdf";
    //const char *filename;
    getcwd(buf, sizeof(buf));//获取当前程序路径
    //printf("current working directory : %s\n", buf);
    //puts(buf);"\\test.pdf"
    strcat(buf, name);//拼接文件名进路径
    //printf("current working directory : %s\n", buf);
    //puts(buf);


    printf("你好");
    MyWriteFile(1, buf);
}

运行生成的程序,会在你程序当前路径释放一个test.pdf,该pdf即为你需要释放的文件

结语

这玩意有什么用呢,回归标题**钓鱼 **和 伪装

标签:project,释放,const,钓鱼,攻击,char,int,include,buf
From: https://www.cnblogs.com/Secde0/p/16632554.html

相关文章

  • 带外攻击
    带外攻击基本概念带内攻击​向服务器提交一个payload,而服务器响应给我们相关的response信息。大家都叫它带内攻击,这些理论的东西,我们简单理解就好,这里我们就理解......
  • XSS (跨站脚本攻击) 漏洞
    《WEB常见漏洞之XSS漏洞研判解析》网络空间安全论文题目:XSS攻击手法解析上课时间:8.24授课教师:蔡徐坤姓名:芸学号:20210329......
  • 万物皆可集成系列:低代码释放用友U8+深度价值(2)—数据拓展应用
    在上一篇内容我们介绍了如何利用低代码开发套件实现低代码应用与U8+系统的对接集成,本次给大家带来的是如何将用友U8+系统中的数据进行价值扩展和实际应用。我们以生产物料......
  • Delphi 经典游戏程序设计40例 的学习 例24 xor 的攻击效果
    unitR24;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls,ExtCtrls;typeTRei24=class......
  • dz注册时,要邮箱验证,否则有人攻击
    dz注册时,要邮箱验证,否则有人攻击_爱生活,爱编程的博客-CSDN博客 https://blog.csdn.net/qq_15009739/article/details/115662109dz注册时,要邮箱验证,否则有人攻击 ......
  • ArcGIS API for JavaScript FeatureLayer definitionExpression 被认定为sql注入攻击
    背景 目前有一个区的图斑数据需要分乡镇展示,所以采用FeatureLayer的definitionExpression构造SQL语句进行过滤,官方提供的示例:1//Setdefinitionexpress......
  • 攻击面管理:企业向主动安全转变的开始
    攻击面管理(AttackSurfaceManagement)是包含、传输或处理敏感数据的外部数字资产的持续发现、清点、分类、优先级排序和安全监控。2018年,Gartner倡导企业安全负责人开始监......
  • php优化 - 防止跨域攻击
    php优化-防止跨域攻击解决方案:验证HTTPReferer字段服务端生成token,下发到客户端,客户端提交后并进行验证http的header头自定义属性,每次验证header头中的自定......
  • C++ 黑客攻击系统
    #include<iostream>#include<Windows.h>#include<string>#include<conio.h>//getch使用#include"hacker.h"usingnamespacestd;#defineWIDTH40#define......
  • C++ 黑客攻击系统实现
    #include<iostream>#include<Windows.h>#include<string>#include<conio.h>//getch使用#include"hacker.h"usingnamespacestd;#defineWIDTH40#define......